diff --git a/static/js/ckeditor5/build/ckeditor.css b/static/js/ckeditor5/build/ckeditor.css index cf408e660..576b24cd9 100644 --- a/static/js/ckeditor5/build/ckeditor.css +++ b/static/js/ckeditor5/build/ckeditor.css @@ -1 +1 @@ -.ck.ck-character-grid{& .ck-character-grid__tiles{display:grid}}.ck.ck-special-characters{&>.ck-dialog__content>div{display:grid;height:100%;max-width:100%;width:350px;grid-column-gap:0;grid-row-gap:0;grid-template-columns:1fr;grid-template-rows:auto 1fr auto;&>.ck-character-categories{grid-area:1/1/2/2;padding:var(--ck-spacing-medium) var(--ck-spacing-large);&>.ck-labeled-field-view{padding-top:var(--ck-spacing-standard);width:100%;& .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both;background:var(--ck-color-base-error);color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center;&:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}@media (prefers-reduced-motion:reduce){animation:none}}& .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}&>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}}.ck-dropdown{display:block;width:100%;&>button{&:not(:focus){border:1px solid var(--ck-color-base-border)}&>span{width:100%}}}}&>.ck-character-grid{grid-area:2/1/3/2;max-height:200px}&>.ck-character-info{grid-area:3/1/4/2}}}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#ccced1;--ck-color-base-action:#53a336;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#2977ff;--ck-color-base-active-focus:#0d65ff;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:218,81.8%,56.9%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#cae1fc;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#f0f0f0;--ck-color-button-default-active-background:#f0f0f0;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#f0f7ff;--ck-color-button-on-hover-background:#dbecff;--ck-color-button-on-active-background:#dbecff;--ck-color-button-on-disabled-background:#f0f2f4;--ck-color-button-on-color:#2977ff;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#4d9d30;--ck-color-button-action-active-background:#4d9d30;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#939393;--ck-color-switch-button-off-hover-background:#7d7d7d;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#4d9d30;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-dialog-background:var(--ck-custom-background);--ck-color-dialog-form-header-border:var(--ck-custom-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:var(--ck-color-base-border);--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:var(--ck-color-base-border);--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-button-on-color);--ck-color-list-button-on-background-focus:var(--ck-color-button-on-color);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-background);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-color-highlight-background:#ff0;--ck-color-light-red:#fcc;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{background:transparent;border:0;box-sizing:border-box;height:auto;margin:0;padding:0;position:static;text-decoration:none;transition:none;vertical-align:middle;width:auto;word-wrap:break-word}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}.ck.ck-autocomplete>.ck-search__results{background:var(--ck-color-base-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;max-height:200px;min-width:auto;overflow-y:auto}.ck-rounded-corners .ck.ck-autocomplete>.ck-search__results,.ck.ck-autocomplete>.ck-search__results.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-autocomplete>.ck-search__results{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{border-bottom-left-radius:0;border-bottom-right-radius:0;margin-bottom:-1px}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{border-top-left-radius:0;border-top-right-radius:0;margin-top:-1px}.ck.ck-button,a.ck.ck-button{-webkit-appearance:none;background:var(--ck-color-button-default-background);border:1px solid transparent;border-radius:0;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}@media (prefers-reduced-motion:reduce){.ck.ck-button,a.ck.ck-button{transition:none}}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit;opacity:.5}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:var(--ck-spacing-medium)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background);color:var(--ck-color-button-on-color)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background);color:var(--ck-color-button-action-text)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:calc(1.07692em + 1px);--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2px);--ck-switch-button-inner-hover-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton,.ck.ck-button.ck-switchbutton.ck-on:active,.ck.ck-button.ck-switchbutton.ck-on:focus,.ck.ck-button.ck-switchbutton.ck-on:hover,.ck.ck-button.ck-switchbutton:active,.ck.ck-button.ck-switchbutton:focus,.ck.ck-button.ck-switchbutton:hover{background:transparent;color:inherit}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;border-radius:0;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width)}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);border-radius:0;height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*.5)}@media (prefers-reduced-motion:reduce){.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{transition:none}}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:var(--ck-switch-button-inner-hover-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton:focus{border-color:transparent;box-shadow:none;outline:none}.ck.ck-button.ck-switchbutton:focus .ck-button__toggle{box-shadow:0 0 0 1px var(--ck-color-base-background),0 0 0 5px var(--ck-color-focus-outer-shadow);outline:var(--ck-focus-ring);outline-offset:1px}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var( --ck-switch-button-translation ))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var( --ck-switch-button-translation )*-1))}.ck.ck-button.ck-list-item-button{padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2)}.ck.ck-button.ck-list-item-button,.ck.ck-button.ck-list-item-button.ck-on{background:var(--ck-color-list-background);color:var(--ck-color-text)}[dir=ltr] .ck.ck-button.ck-list-item-button:has(.ck-list-item-button__check-holder){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-list-item-button:has(.ck-list-item-button__check-holder){padding-right:var(--ck-spacing-small)}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable):not(.ck-disabled),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled):not(.ck-disabled){color:var(--ck-color-text)}:root{--ck-collapsible-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-collapsible>.ck.ck-button{border-radius:0;color:inherit;font-weight:700;width:100%}.ck.ck-collapsible>.ck.ck-button:focus{background:transparent}.ck.ck-collapsible>.ck.ck-button:active,.ck.ck-collapsible>.ck.ck-button:hover:not(:focus),.ck.ck-collapsible>.ck.ck-button:not(:focus){background:transparent;border-color:transparent;box-shadow:none}.ck.ck-collapsible>.ck.ck-button>.ck-icon{margin-right:var(--ck-spacing-medium);width:var(--ck-collapsible-arrow-size)}.ck.ck-collapsible>.ck-collapsible__children{padding:var(--ck-spacing-medium) var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-collapsible.ck-collapsible_collapsed>.ck.ck-button .ck-icon{transform:rotate(-90deg)}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#166fd4}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{transition:box-shadow .2s ease}@media (forced-colors:none){.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;width:var(--ck-color-grid-tile-size)}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile.ck-color-selector__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}}@media (forced-colors:active){.ck.ck-color-grid__tile{height:unset;min-height:unset;min-width:unset;padding:0 var(--ck-spacing-small);width:unset}.ck.ck-color-grid__tile .ck-button__label{display:inline-block}}@media (prefers-reduced-motion:reduce){.ck.ck-color-grid__tile{transition:none}}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile .ck.ck-icon{color:var(--ck-color-color-grid-check-icon);display:none}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{width:100%}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-left:var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment label.ck.ck-color-grid__label{font-weight:unset}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker{padding:8px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker{height:100px;min-width:180px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation){border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue){border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius)}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue-pointer),.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation-pointer){height:15px;width:15px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{padding:0 8px 8px}:root{--ck-dialog-overlay-background-color:rgba(0,0,0,.5);--ck-dialog-drop-shadow:0px 0px 6px 2px rgba(0,0,0,.15);--ck-dialog-max-width:100vw;--ck-dialog-max-height:90vh;--ck-color-dialog-background:var(--ck-color-base-background);--ck-color-dialog-form-header-border:var(--ck-color-base-border)}.ck.ck-dialog-overlay{animation:ck-dialog-fade-in .3s;background:var(--ck-dialog-overlay-background-color);z-index:var(--ck-z-dialog)}.ck.ck-dialog{border-radius:0;--ck-drop-shadow:var(--ck-dialog-drop-shadow);background:var(--ck-color-dialog-background);border:1px solid var(--ck-color-base-border);max-height:var(--ck-dialog-max-height);max-width:var(--ck-dialog-max-width);overscroll-behavior:contain}.ck-rounded-corners .ck.ck-dialog,.ck.ck-dialog.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dialog{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-dialog .ck.ck-form__header{border-bottom:1px solid var(--ck-color-dialog-form-header-border)}.ck-dialog-scroll-locked{overflow:hidden}@keyframes ck-dialog-fade-in{0%{background:transparent}to{background:var(--ck-dialog-overlay-background-color)}}.ck.ck-dialog .ck.ck-dialog__actions{padding:var(--ck-spacing-large)}.ck.ck-dialog .ck.ck-dialog__actions>*+*{margin-left:var(--ck-spacing-large)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{overflow:hidden;text-overflow:ellipsis;width:7em}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;bottom:0;min-width:100%}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}.ck.ck-dropdown__panel:focus{outline:none}.ck.ck-dropdown>.ck-dropdown__panel>.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown>.ck-dropdown__panel>.ck-list,.ck.ck-dropdown>.ck-dropdown__panel>.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:first-child>.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:first-child>.ck-button,.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:first-child>.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button,.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton>.ck-splitbutton__arrow:not(:focus){border-bottom-width:0;border-top-width:0}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:"";height:100%;position:absolute;width:1px}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:focus:after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:focus:after{--ck-color-split-button-hover-border:var(--ck-color-focus-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button{border-radius:0;padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2);width:100%}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button:focus{border-color:transparent;box-shadow:none}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button:focus:not(.ck-on){background:var(--ck-color-button-default-hover-background)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-button__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button.ck-disabled>.ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button.ck-icon-spacing:not(:has(.ck-button__icon))>.ck-button__label{margin-left:calc(var(--ck-icon-size) - var(--ck-spacing-small))}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{margin-right:calc(var(--ck-spacing-small)*-1);transform:rotate(-90deg)}[dir=rtl] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{margin-left:calc(var(--ck-spacing-small)*-1);transform:rotate(90deg)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button.ck-disabled>.ck-dropdown-menu-list__nested-menu__button__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=ltr] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}:root{--ck-dropdown-menu-menu-item-min-width:18em}.ck.ck-dropdown-menu-list__nested-menu__item{min-width:var(--ck-dropdown-menu-menu-item-min-width)}.ck-button.ck-dropdown-menu-list__nested-menu__item__button{border-radius:0}.ck-button.ck-dropdown-menu-list__nested-menu__item__button>.ck-spinner-container,.ck-button.ck-dropdown-menu-list__nested-menu__item__button>.ck-spinner-container .ck-spinner{--ck-toolbar-spinner-size:20px}.ck-button.ck-dropdown-menu-list__nested-menu__item__button>.ck-spinner-container{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}.ck-button.ck-dropdown-menu-list__nested-menu__item__button:focus{border-color:transparent;box-shadow:none}.ck-button.ck-dropdown-menu-list__nested-menu__item__button:focus:not(.ck-on){background:var(--ck-color-button-default-hover-background)}:root{--ck-dropdown-menu-menu-panel-max-width:75vw}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 0;height:fit-content;max-width:var(--ck-dropdown-menu-menu-panel-max-width)}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel:after,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel:before{display:none}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_es,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_se{border-top-left-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_sw,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_ws{border-top-right-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_en,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_ne{border-bottom-left-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_nw,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_wn{border-bottom-right-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel:focus{outline:none}:root{--ck-accessibility-help-dialog-max-width:600px;--ck-accessibility-help-dialog-max-height:400px;--ck-accessibility-help-dialog-border-color:#ccced1;--ck-accessibility-help-dialog-code-background-color:#ededed;--ck-accessibility-help-dialog-kbd-shadow-color:#9c9c9c}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content{border:1px solid transparent;max-height:var(--ck-accessibility-help-dialog-max-height);max-width:var(--ck-accessibility-help-dialog-max-width);overflow:auto;padding:var(--ck-spacing-large);user-select:text}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content *{white-space:normal}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content .ck-label{display:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3{font-size:1.2em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4{font-size:1em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content p,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content table{margin:1em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl{border-bottom:none;border-top:1px solid var(--ck-accessibility-help-dialog-border-color);display:grid;grid-template-columns:2fr 1fr}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{border-bottom:1px solid var(--ck-accessibility-help-dialog-border-color);padding:.4em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{grid-column-start:1}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd{grid-column-start:2;text-align:right}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{background:var(--ck-accessibility-help-dialog-code-background-color);border-radius:2px;display:inline-block;font-size:.9em;line-height:1;padding:.4em;text-align:center;vertical-align:middle}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code{font-family:monospace}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{box-shadow:0 1px 1px var(--ck-accessibility-help-dialog-kbd-shadow-color);margin:0 1px;min-width:1.8em}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd+kbd{margin-left:2px}:root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable.ck-rounded-corners:not(.ck-editor__nested-editable){border-radius:var(--ck-border-radius)}.ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable){border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background)}:root{--ck-form-header-height:44px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}[dir=ltr] .ck.ck-form__header>.ck-icon{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-form__header>.ck-icon{margin-left:var(--ck-spacing-medium)}.ck.ck-form__header .ck-form__header__label{--ck-font-size-base:15px;font-weight:700}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal));--ck-icon-font-size:.8333350694em}.ck.ck-icon{font-size:var(--ck-icon-font-size);height:var(--ck-icon-size);width:var(--ck-icon-size);will-change:transform}.ck.ck-icon,.ck.ck-icon *{cursor:inherit}.ck.ck-icon.ck-icon_inherit-color,.ck.ck-icon.ck-icon_inherit-color *{color:inherit}.ck.ck-icon.ck-icon_inherit-color :not([fill]){fill:currentColor}:root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);border-radius:0;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}@media (prefers-reduced-motion:reduce){.ck.ck-input{transition:none}}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}@media (prefers-reduced-motion:reduce){.ck.ck-input.ck-error{animation:none}}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}.ck.ck-label{font-weight:700}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-labeled-field-label-default-position-x:var(--ck-spacing-medium);--ck-labeled-field-label-default-position-y:calc(var(--ck-font-size-base)*0.6);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;top:0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0;transform:translate(calc(var(--ck-spacing-medium)*-1),-6px) scale(.75);transform-origin:100% 0}@media (prefers-reduced-motion:reduce){.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transition:none}}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-labeled-field-label-default-position-x),var(--ck-labeled-field-label-default-position-y)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-labeled-field-label-default-position-x)*-1),var(--ck-labeled-field-label-default-position-y)) scale(1)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}.ck.ck-labeled-input .ck-labeled-input__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-input .ck-labeled-input__status_error{color:var(--ck-color-base-error)}.ck.ck-list{background:var(--ck-color-list-background);border-radius:0;list-style-type:none;padding:var(--ck-spacing-small) 0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list__item{cursor:default;min-width:15em}.ck.ck-list__item>.ck-button:not(.ck-list-item-button){border-radius:0;min-height:unset;padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2);width:100%}[dir=ltr] .ck.ck-list__item>.ck-button:not(.ck-list-item-button){text-align:left}[dir=rtl] .ck.ck-list__item>.ck-button:not(.ck-list-item-button){text-align:right}.ck.ck-list__item>.ck-button:not(.ck-list-item-button) .ck-button__label{line-height:calc(var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button){background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck-list .ck-list__group{padding-top:var(--ck-spacing-medium)}.ck-list .ck-list__group:first-child{padding-top:0}:not(.ck-hidden)~.ck-list .ck-list__group{border-top:1px solid var(--ck-color-base-border)}.ck-list .ck-list__group>.ck-label{font-size:11px;font-weight:700;padding:var(--ck-spacing-medium) var(--ck-spacing-large) 0}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;margin:var(--ck-spacing-small) 0;width:100%}.ck.ck-menu-bar{background:var(--ck-color-base-background);border:1px solid var(--ck-color-toolbar-border);display:flex;flex-wrap:wrap;gap:var(--ck-spacing-small);justify-content:flex-start;padding:var(--ck-spacing-small);width:100%}.ck.ck-menu-bar__menu{font-size:inherit}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level{max-width:100%}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button{width:100%}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-button__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button.ck-disabled>.ck-button__label{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button{min-height:unset;padding:var(--ck-spacing-small) var(--ck-spacing-medium)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-button__label{line-height:unset;overflow:visible;width:unset}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-icon{display:none}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button{border-radius:0}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{margin-left:var(--ck-spacing-standard);margin-right:calc(var(--ck-spacing-small)*-1);transform:rotate(-90deg)}[dir=rtl] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{left:var(--ck-spacing-standard);margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small);transform:rotate(90deg)}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button.ck-disabled>.ck-menu-bar__menu__button__arrow{opacity:var(--ck-disabled-opacity)}:root{--ck-menu-bar-menu-item-min-width:18em}.ck.ck-menu-bar__menu .ck.ck-menu-bar__menu__item{min-width:var(--ck-menu-bar-menu-item-min-width)}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button{border-radius:0}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container,.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container .ck-spinner{--ck-toolbar-spinner-size:20px}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{font-size:var(--ck-icon-font-size)}[dir=ltr] .ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{margin-left:var(--ck-spacing-medium)}:root{--ck-menu-bar-menu-panel-max-width:75vw}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;bottom:0;height:fit-content;max-width:var(--ck-menu-bar-menu-panel-max-width)}.ck-rounded-corners .ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{border-top-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{border-top-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne{border-bottom-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{border-bottom-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel:focus{outline:none}.ck.ck-menu-bar .ck-list-item-button:active,.ck.ck-menu-bar .ck-list-item-button:focus{border-color:transparent;box-shadow:none}.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:active,.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none;position:relative;z-index:2}:root{--ck-balloon-border-width:1px;--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);border-radius:0;min-height:15px}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent;margin-top:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow));margin-bottom:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_e]:after,.ck.ck-balloon-panel[class*=arrow_e]:before{border-width:var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_e]:before{border-color:transparent transparent transparent var(--ck-color-panel-border);margin-right:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_e]:after{border-color:transparent transparent transparent var(--ck-color-panel-background);margin-right:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_w]:after,.ck.ck-balloon-panel[class*=arrow_w]:before{border-width:var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_w]:before{border-color:transparent var(--ck-color-panel-border) transparent transparent;margin-left:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_w]:after{border-color:transparent var(--ck-color-panel-background) transparent transparent;margin-left:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:before{margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);right:calc(var(--ck-balloon-arrow-height)*-1);top:50%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:before{left:calc(var(--ck-balloon-arrow-height)*-1);margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);top:50%}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-number,.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}:root{--ck-search-field-view-horizontal-spacing:calc(var(--ck-icon-size) + var(--ck-spacing-medium))}.ck.ck-search>.ck-labeled-field-view .ck-input{width:100%}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon{--ck-labeled-field-label-default-position-x:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon>.ck-labeled-field-view__input-wrapper>.ck-icon{opacity:.5;pointer-events:none}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input,[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input:not(.ck-input-text_empty){padding-left:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset{--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset.ck-labeled-field-view_empty{--ck-labeled-field-empty-unfocused-max-width:100% - var(--ck-search-field-view-horizontal-spacing) - var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{background:none;min-height:auto;min-width:auto;opacity:.5;padding:0}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{left:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset:hover{opacity:1}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input:not(.ck-input-text_empty),[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{padding-right:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-search__results{min-width:100%}.ck.ck-search>.ck-search__results>.ck-search__info{padding:var(--ck-spacing-medium) var(--ck-spacing-large);width:100%}.ck.ck-search>.ck-search__results>.ck-search__info *{white-space:normal}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{font-weight:700}.ck.ck-search>.ck-search__results>.ck-search__info>span:last-child{margin-top:var(--ck-spacing-medium)}.ck.ck-spinner-container{animation:ck-spinner-rotate 1.5s linear infinite;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@media (prefers-reduced-motion:reduce){.ck.ck-spinner-container{animation-duration:3s}}.ck.ck-spinner{border:2px solid var(--ck-color-text);border-radius:50%;border-top:2px solid transparent;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@keyframes ck-spinner-rotate{to{transform:rotate(1turn)}}.ck-textarea{overflow-x:hidden}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);border:1px solid var(--ck-color-toolbar-border);border-radius:0;padding:0 var(--ck-spacing-small)}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar .ck.ck-toolbar__separator{background:var(--ck-color-toolbar-border);height:var(--ck-icon-size);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border-radius:0;margin:0;width:100%}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-dropdown__panel{min-width:auto}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-button>.ck-button__label{max-width:7em;width:auto}.ck.ck-toolbar:focus{outline:none}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=rtl]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=ltr]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-balloon-panel.ck-tooltip{--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-tooltip-text-padding:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);box-shadow:none;padding:0 var(--ck-spacing-medium)}.ck.ck-balloon-panel.ck-tooltip .ck-tooltip__text{color:var(--ck-color-tooltip-text);font-size:.9em;line-height:1.5}.ck.ck-balloon-panel.ck-tooltip.ck-tooltip_multi-line .ck-tooltip__text{display:inline-block;max-width:200px;padding:var(--ck-tooltip-text-padding) 0;white-space:break-spaces}.ck.ck-balloon-panel.ck-tooltip:before{display:none}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content{border:solid var(--ck-color-base-border);border-radius:0;border-width:1px 1px 0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.ck-sticky-panel__content_sticky{border-bottom-width:1px}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-menu-bar{border:0;border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-toolbar{border:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}.ck .ck-fake-bookmark-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-bookmark-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:"";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}.ck.ck-clipboard-drop-target-line{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);height:0;margin-top:-1px}.ck.ck-clipboard-drop-target-line:before{border-style:solid;content:"";height:0;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-width)*-.5);width:0}[dir=ltr] .ck.ck-clipboard-drop-target-line:before{border-color:transparent transparent transparent var(--ck-clipboard-drop-target-color);border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height);left:-1px}[dir=rtl] .ck.ck-clipboard-drop-target-line:before{border-color:transparent var(--ck-clipboard-drop-target-color) transparent transparent;border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0;right:-1px}:root{--ck-color-code-block-label-background:#757575}.ck.ck-editor__editable pre[data-language]:after{background:var(--ck-color-code-block-label-background);color:#fff;font-family:var(--ck-font-face);font-size:10px;line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);right:10px;top:-1px;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}@media (forced-colors:active){.ck .ck-placeholder,.ck.ck-placeholder{forced-color-adjust:preserve-parent-color}}.ck .ck-placeholder:before,.ck.ck-placeholder:before{cursor:text}@media (forced-colors:none){.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text)}}@media (forced-colors:active){.ck .ck-placeholder:before,.ck.ck-placeholder:before{font-style:italic;margin-left:1px}}.ck.ck-find-and-replace-form{width:400px}.ck.ck-find-and-replace-form:focus{outline:none}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs{align-content:stretch;align-items:center;flex:1 1 auto;flex-direction:row;flex-wrap:wrap;margin:0;padding:var(--ck-spacing-large)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>.ck-button,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-button{flex:0 0 auto}[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>*+*,[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>*+*{margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>*+*,[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>*+*{margin-right:var(--ck-spacing-standard)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions .ck-labeled-field-view,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-labeled-field-view{flex:1 1 auto}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions .ck-labeled-field-view .ck-input,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-labeled-field-view .ck-input{min-width:50px;width:100%}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs{align-items:flex-start}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-button-prev>.ck-icon{transform:rotate(90deg)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-button-next>.ck-icon{transform:rotate(-90deg)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{color:var(--ck-color-base-border);top:50%;transform:translateY(-50%)}[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{left:var(--ck-spacing-standard)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-labeled-field-replace{flex:0 0 100%;padding-top:var(--ck-spacing-standard)}[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-labeled-field-replace{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-labeled-field-replace{margin-right:0}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions{flex-wrap:wrap;justify-content:flex-end;margin-top:calc(var(--ck-spacing-large)*-1)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>.ck-button-find{font-weight:700}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>.ck-button-find .ck-button__label{padding-left:var(--ck-spacing-large);padding-right:var(--ck-spacing-large)}.ck.ck-find-and-replace-form .ck-switchbutton{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;width:100%}@media screen and (max-width:600px){.ck.ck-find-and-replace-form{max-width:100%;width:300px}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input{flex-wrap:wrap}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input .ck-labeled-field-view{flex:1 0 auto;margin-bottom:var(--ck-spacing-standard);width:100%}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button{text-align:center}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type{flex:1 1 auto}[dir=ltr] .ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type{margin-right:0}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type .ck-button__label{text-align:center;width:100%}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view){flex:1 1 auto;flex-wrap:wrap}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button{text-align:center}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button:first-of-type{flex:1 1 auto}[dir=ltr] .ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button:first-of-type{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button:first-of-type{margin-right:0}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button .ck-button__label{text-align:center;width:100%}}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{background:var(--ck-color-focus-border);padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{right:var(--ck-spacing-standard);top:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;direction:ltr;font-family:monospace;font-size:var(--ck-font-size-base);height:var(--ck-html-embed-source-height);min-width:0;padding:var(--ck-spacing-standard);resize:none;tab-size:4;text-align:left;white-space:pre-wrap;width:var(--ck-html-embed-content-width)}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{background-color:var(--ck-color-base-foreground);box-sizing:border-box}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}:root{--ck-image-insert-insert-by-url-width:250px}.ck.ck-image-insert-url{--ck-input-width:100%}.ck.ck-image-insert-url .ck-image-insert-url__action-row{grid-column-gap:var(--ck-spacing-large);margin-top:var(--ck-spacing-large)}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-cancel,.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-save{justify-content:center;min-width:auto}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}.ck.ck-image-insert-form>.ck.ck-button{display:block;width:100%}[dir=ltr] .ck.ck-image-insert-form>.ck.ck-button{text-align:left}[dir=rtl] .ck.ck-image-insert-form>.ck.ck-button{text-align:right}.ck.ck-image-insert-form>.ck.ck-collapsible{min-width:var(--ck-image-insert-insert-by-url-width)}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:first-child){border-top:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:last-child){border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-image-insert-url{min-width:var(--ck-image-insert-insert-by-url-width);padding:var(--ck-spacing-large)}.ck.ck-image-insert-form:focus{outline:none}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@media (prefers-reduced-motion:reduce){.ck-image-upload-complete-icon{animation-duration:0ms}.ck-image-upload-complete-icon:after{animation:none;height:.45em;opacity:1;width:.3em}}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:none;opacity:1}}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{max-width:100%;min-width:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}.ck.ck-link-form_layout-vertical{min-width:var(--ck-input-width);padding:0}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical>.ck-button{border-radius:0;margin:0;padding:var(--ck-spacing-standard);width:50%}.ck.ck-link-form_layout-vertical>.ck-button:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form_layout-vertical>.ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:0 var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}:root{--ck-link-image-indicator-icon-size:20;--ck-link-image-indicator-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{background-color:rgba(0,0,0,.4);background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzUuNzUgMCAwIDEtLjIxNy4yMDYgNS4yNTEgNS4yNTEgMCAwIDEtOC41MDMtNS45NTUuNy43IDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NHptNS40OTQtNS4zMzVhLjc1Ljc1IDAgMCAxLS4xMi4yNzRsLTEuMTQ3IDEuNjM5YS43NS43NSAwIDEgMS0xLjIyOC0uODZsLjg2LTEuMjNhMy43NSAzLjc1IDAgMCAwLTYuMTQ0LTQuMzAxbC0uODYgMS4yMjlhLjc1Ljc1IDAgMCAxLTEuMjI5LS44NmwxLjE0OC0xLjY0YS43NS43NSAwIDAgMSAuMjE3LS4yMDYgNS4yNTEgNS4yNTEgMCAwIDEgOC41MDMgNS45NTVtLTQuNTYzLTIuNTMyYS43NS43NSAwIDAgMSAuMTg0IDEuMDQ1bC0zLjE1NSA0LjUwNWEuNzUuNzUgMCAxIDEtMS4yMjktLjg2bDMuMTU1LTQuNTA2YS43NS43NSAwIDAgMSAxLjA0NS0uMTg0Ii8+PC9zdmc+);background-position:50%;background-repeat:no-repeat;background-size:14px;border-radius:100%;content:"";height:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size));overflow:hidden;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);width:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size))}.ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{background:var(--ck-color-base-foreground);padding:calc(var(--ck-spacing-standard)*3)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{background-position:50%;background-size:cover;height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);min-width:var(--ck-media-embed-placeholder-icon-size)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{height:100%;width:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);font-style:italic;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-height:380px;max-width:300px}.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSlzY2FsZSguOTgwMTIpIj48cmVjdCB3aWR0aD0iNjAuMDk5IiBoZWlnaHQ9IjYwLjA5OSIgeD0iMTc2LjAzMSIgeT0iMjMxLjM5OSIgZmlsbD0iIzM0YTY2OCIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjIzOCIgcnk9IjUuMjM4Ii8+PHBhdGggZmlsbD0iIzVjODhjNSIgZD0ibTIwNi40NzcgMjYwLjktMjguOTg3IDI4Ljk4N2E1LjIyIDUuMjIgMCAwIDAgMy43OCAxLjYxaDQ5LjYyMWMxLjY5NCAwIDMuMTktLjc5OCA0LjE0Ni0yLjAzN3oiLz48cGF0aCBmaWxsPSIjZGQ0YjNlIiBkPSJNMjI2Ljc0MiAyMjIuOTg4Yy05LjI2NiAwLTE2Ljc3NyA3LjE3LTE2Ljc3NyAxNi4wMTQuMDA3IDIuNzYyLjY2MyA1LjQ3NCAyLjA5MyA3Ljg3NS40My43MDMuODMgMS40MDggMS4xOSAyLjEwN3EuNS43NTMuOTUgMS41MDguNTE1LjcxNS45ODggMS40NGMxLjMxIDEuNzY5IDIuNSAzLjUwMiAzLjYzNyA1LjE2OC43OTMgMS4yNzUgMS42ODMgMi42NCAyLjQ2NiAzLjk5IDIuMzYzIDQuMDk0IDQuMDA3IDguMDkyIDQuNiAxMy45MTR2LjAxMmMuMTgyLjQxMi41MTYuNjY2Ljg3OS42NjcuNDAzLS4wMDEuNzY4LS4zMTQuOTMtLjc5OS42MDMtNS43NTYgMi4yMzgtOS43MjkgNC41ODUtMTMuNzk0Ljc4Mi0xLjM1IDEuNjczLTIuNzE1IDIuNDY1LTMuOTkgMS4xMzctMS42NjYgMi4zMjgtMy40IDMuNjM4LTUuMTY5cS40NzMtLjcyMy45ODgtMS40MzkuNDUtLjc1NS45NS0xLjUwOGMuMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIGN4PSIyMjYuNzQyIiBjeT0iMjM5LjAwMiIgZmlsbD0iIzgwMmQyNyIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjgyOCIgcnk9IjUuNTY0Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjlxLS4wMDEtLjU0My0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhxLS4wMDEtLjAwMy0uMDA0LS4wMDVjLTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTVtNC40MyA1LjY2LjAwMy4wMDZ2LS4wMDN6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGZpbGw9IiNjM2MzYzMiIGQ9Im0yMTUuMTg0IDI1MS45MjktNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMiA1LjIgMCAwIDAgLjQ0OS0yLjEyM3YtMzEuMTY1Yy0uNDY5LjY3NS0uOTM0IDEuMzQ5LTEuMzgyIDIuMDA1LS43OTIgMS4yNzUtMS42ODIgMi42NC0yLjQ2NSAzLjk5LTIuMzQ3IDQuMDY1LTMuOTgyIDguMDM4LTQuNTg1IDEzLjc5NC0uMTYyLjQ4NS0uNTI3Ljc5OC0uOTMuNzk5LS4zNjMtLjAwMS0uNjk3LS4yNTUtLjg3OS0uNjY3di0uMDEyYy0uNTkzLTUuODIyLTIuMjM3LTkuODItNC42LTEzLjkxNC0uNzgzLTEuMzUtMS42NzMtMi43MTUtMi40NjYtMy45OS0xLjEzNy0xLjY2Ni0yLjMyNy0zLjQtMy42MzctNS4xNjl6Ii8+PHBhdGggZmlsbD0iI2ZkZGM0ZiIgZD0ibTIxMi45ODMgMjQ4LjQ5NS0zNi45NTIgMzYuOTUzdi44MTJhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYgMTM2IDAgMCAwLTIuNzY0LTMuOSAzOCAzOCAwIDAgMC0uOTg5LTEuNDQgMzUgMzUgMCAwIDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJtMjExLjk5OCAyNjEuMDgzLTYuMTUyIDYuMTUxIDI0LjI2NCAyNC4yNjRoLjc4MWE1LjIyNyA1LjIyNyAwIDAgMCA1LjIzOS01LjIzOHYtMS4wNDV6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDI0IiBoZWlnaHQ9IjEwMjQiIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjx0aXRsZT5GaWxsIDE8L3RpdGxlPjxwYXRoIGZpbGw9IiNGRkZGRkUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTk2Ny40ODQgMEg1Ni41MTdDMjUuMzA0IDAgMCAyNS4zMDQgMCA1Ni41MTd2OTEwLjk2NkMwIDk5OC42OTQgMjUuMjk3IDEwMjQgNTYuNTIyIDEwMjRINTQ3VjYyOEg0MTRWNDczaDEzM1YzNTkuMDI5YzAtMTMyLjI2MiA4MC43NzMtMjA0LjI4MiAxOTguNzU2LTIwNC4yODIgNTYuNTEzIDAgMTA1LjA4NiA0LjIwOCAxMTkuMjQ0IDYuMDg5VjI5OWwtODEuNjE2LjAzN2MtNjMuOTkzIDAtNzYuMzg0IDMwLjQ5Mi03Ni4zODQgNzUuMjM2VjQ3M2gxNTMuNDg3bC0xOS45ODYgMTU1SDcwN3YzOTZoMjYwLjQ4NGMzMS4yMTMgMCA1Ni41MTYtMjUuMzAzIDU2LjUxNi01Ni41MTZWNTYuNTE1QzEwMjQgMjUuMzAzIDk5OC42OTcgMCA5NjcuNDg0IDAiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgdmlld0JveD0iMCAwIDUwNCA1MDQiPjx0aXRsZT5nbHlwaC1sb2dvX01heTIwMTY8L3RpdGxlPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMCAuMTU5aDUwMy44NDFWNTAzLjk0SDB6Ii8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHBhdGggZmlsbD0iI0ZGRiIgZD0iTTI1MS45MjEuMTU5Yy02OC40MTggMC03Ni45OTcuMjktMTAzLjg2NyAxLjUxNi0yNi44MTQgMS4yMjMtNDUuMTI3IDUuNDgyLTYxLjE1MSAxMS43MS0xNi41NjYgNi40MzctMzAuNjE1IDE1LjA1MS00NC42MjEgMjkuMDU2LTE0LjAwNSAxNC4wMDYtMjIuNjE5IDI4LjA1NS0yOS4wNTYgNDQuNjIxLTYuMjI4IDE2LjAyNC0xMC40ODcgMzQuMzM3LTExLjcxIDYxLjE1MUMuMjkgMTc1LjA4MyAwIDE4My42NjIgMCAyNTIuMDhjMCA2OC40MTcuMjkgNzYuOTk2IDEuNTE2IDEwMy44NjYgMS4yMjMgMjYuODE0IDUuNDgyIDQ1LjEyNyAxMS43MSA2MS4xNTEgNi40MzcgMTYuNTY2IDE1LjA1MSAzMC42MTUgMjkuMDU2IDQ0LjYyMSAxNC4wMDYgMTQuMDA1IDI4LjA1NSAyMi42MTkgNDQuNjIxIDI5LjA1NyAxNi4wMjQgNi4yMjcgMzQuMzM3IDEwLjQ4NiA2MS4xNTEgMTEuNzA5IDI2Ljg3IDEuMjI2IDM1LjQ0OSAxLjUxNiAxMDMuODY3IDEuNTE2IDY4LjQxNyAwIDc2Ljk5Ni0uMjkgMTAzLjg2Ni0xLjUxNiAyNi44MTQtMS4yMjMgNDUuMTI3LTUuNDgyIDYxLjE1MS0xMS43MDkgMTYuNTY2LTYuNDM4IDMwLjYxNS0xNS4wNTIgNDQuNjIxLTI5LjA1NyAxNC4wMDUtMTQuMDA2IDIyLjYxOS0yOC4wNTUgMjkuMDU3LTQ0LjYyMSA2LjIyNy0xNi4wMjQgMTAuNDg2LTM0LjMzNyAxMS43MDktNjEuMTUxIDEuMjI2LTI2Ljg3IDEuNTE2LTM1LjQ0OSAxLjUxNi0xMDMuODY2IDAtNjguNDE4LS4yOS03Ni45OTctMS41MTYtMTAzLjg2Ny0xLjIyMy0yNi44MTQtNS40ODItNDUuMTI3LTExLjcwOS02MS4xNTEtNi40MzgtMTYuNTY2LTE1LjA1Mi0zMC42MTUtMjkuMDU3LTQ0LjYyMS0xNC4wMDYtMTQuMDA1LTI4LjA1NS0yMi42MTktNDQuNjIxLTI5LjA1Ni0xNi4wMjQtNi4yMjgtMzQuMzM3LTEwLjQ4Ny02MS4xNTEtMTEuNzFDMzI4LjkxNy40NDkgMzIwLjMzOC4xNTkgMjUxLjkyMS4xNTltMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1czE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NmMzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjZzLTE3LjIwNyAxNC4yNzUtMjguOTY2IDE4Ljg0NWMtOC44NzcgMy40NS0yMi4yMTYgNy41NTQtNDYuNzc4IDguNjc0LTI2LjU2IDEuMjEyLTM0LjUyNyAxLjQ2OS0xMDEuNzk3IDEuNDY5LTY3LjI3MSAwLTc1LjIzNy0uMjU3LTEwMS43OTgtMS40NjktMjQuNTYyLTEuMTItMzcuOTAxLTUuMjI0LTQ2Ljc3OC04LjY3NC0xMS43NTktNC41Ny0yMC4xNTEtMTAuMDI5LTI4Ljk2Ni0xOC44NDVzLTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2NmMtMy40NS04Ljg3Ny03LjU1NC0yMi4yMTYtOC42NzQtNDYuNzc4LTEuMjEyLTI2LjU2NC0xLjQ2OS0zNC41MzItMS40NjktMTAxLjc5NyAwLTY3LjI2Ni4yNTctNzUuMjM0IDEuNDY5LTEwMS43OTggMS4xMi0yNC41NjIgNS4yMjQtMzcuOTAxIDguNjc0LTQ2Ljc3OCA0LjU3LTExLjc1OSAxMC4wMjktMjAuMTUxIDE4Ljg0NS0yOC45NjZzMTcuMjA3LTE0LjI3NSAyOC45NjYtMTguODQ1YzguODc3LTMuNDUgMjIuMjE2LTcuNTU0IDQ2Ljc3OC04LjY3NCAyNi41NjQtMS4yMTIgMzQuNTMyLTEuNDY5IDEwMS43OTgtMS40NjkiIG1hc2s9InVybCgjYikiLz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzNzMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0YzQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzNtMC0yMTMuMzM4Yy03MS40NDcgMC0xMjkuMzY1IDU3LjkxOC0xMjkuMzY1IDEyOS4zNjUgMCA3MS40NDYgNTcuOTE4IDEyOS4zNjQgMTI5LjM2NSAxMjkuMzY0IDcxLjQ0NiAwIDEyOS4zNjQtNTcuOTE4IDEyOS4zNjQtMTI5LjM2NCAwLTcxLjQ0Ny01Ny45MTgtMTI5LjM2NS0xMjkuMzY0LTEyOS4zNjVNNDE2LjYyNyAxMTcuNjA0YzAgMTYuNjk2LTEzLjUzNSAzMC4yMy0zMC4yMzEgMzAuMjMtMTYuNjk1IDAtMzAuMjMtMTMuNTM0LTMwLjIzLTMwLjIzczEzLjUzNS0zMC4yMzEgMzAuMjMtMzAuMjMxYzE2LjY5NiAwIDMwLjIzMSAxMy41MzUgMzAuMjMxIDMwLjIzMSIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwME0xNjMuNCAzMDUuNWM4OC43IDAgMTM3LjItNzMuNSAxMzcuMi0xMzcuMiAwLTIuMSAwLTQuMi0uMS02LjIgOS40LTYuOCAxNy42LTE1LjMgMjQuMS0yNS04LjYgMy44LTE3LjkgNi40LTI3LjcgNy42IDEwLTYgMTcuNi0xNS40IDIxLjItMjYuNy05LjMgNS41LTE5LjYgOS41LTMwLjYgMTEuNy04LjgtOS40LTIxLjMtMTUuMi0zNS4yLTE1LjItMjYuNiAwLTQ4LjIgMjEuNi00OC4yIDQ4LjIgMCAzLjguNCA3LjUgMS4zIDExLTQwLjEtMi03NS42LTIxLjItOTkuNC01MC40LTQuMSA3LjEtNi41IDE1LjQtNi41IDI0LjIgMCAxNi43IDguNSAzMS41IDIxLjUgNDAuMS03LjktLjItMTUuMy0yLjQtMjEuOC02di42YzAgMjMuNCAxNi42IDQyLjggMzguNyA0Ny4zLTQgMS4xLTguMyAxLjctMTIuNyAxLjctMy4xIDAtNi4xLS4zLTkuMS0uOSA2LjEgMTkuMiAyMy45IDMzLjEgNDUgMzMuNS0xNi41IDEyLjktMzcuMyAyMC42LTU5LjkgMjAuNi0zLjkgMC03LjctLjItMTEuNS0uNyAyMS4xIDEzLjggNDYuNSAyMS44IDczLjcgMjEuOCIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}:root{--ck-color-mention-background:rgba(153,0,48,.1);--ck-color-mention-text:#990030}.ck-content .mention{background:var(--ck-color-mention-background);color:var(--ck-color-mention-text)}:root{--ck-color-restricted-editing-exception-background:rgba(255,169,77,.2);--ck-color-restricted-editing-exception-hover-background:rgba(255,169,77,.35);--ck-color-restricted-editing-exception-brackets:rgba(204,105,0,.4);--ck-color-restricted-editing-selected-exception-background:rgba(255,169,77,.5);--ck-color-restricted-editing-selected-exception-brackets:rgba(204,105,0,.6)}.ck-editor__editable .restricted-editing-exception{background-color:var(--ck-color-restricted-editing-exception-background);border:1px solid;border-image:linear-gradient(to right,var(--ck-color-restricted-editing-exception-brackets) 0,var(--ck-color-restricted-editing-exception-brackets) 5px,transparent 6px,transparent calc(100% - 6px),var(--ck-color-restricted-editing-exception-brackets) calc(100% - 5px),var(--ck-color-restricted-editing-exception-brackets) 100%) 1;transition:background .2s ease-in-out}@media (prefers-reduced-motion:reduce){.ck-editor__editable .restricted-editing-exception{transition:none}}.ck-editor__editable .restricted-editing-exception.restricted-editing-exception_selected{background-color:var(--ck-color-restricted-editing-selected-exception-background);border-image:linear-gradient(to right,var(--ck-color-restricted-editing-selected-exception-brackets) 0,var(--ck-color-restricted-editing-selected-exception-brackets) 5px,var(--ck-color-restricted-editing-selected-exception-brackets) calc(100% - 5px),var(--ck-color-restricted-editing-selected-exception-brackets) 100%) 1}.ck-editor__editable .restricted-editing-exception.restricted-editing-exception_collapsed{padding-left:1ch}.ck-restricted-editing_mode_restricted,.ck-restricted-editing_mode_restricted *{cursor:default}.ck-restricted-editing_mode_restricted .restricted-editing-exception,.ck-restricted-editing_mode_restricted .restricted-editing-exception *{cursor:text}.ck-restricted-editing_mode_restricted .restricted-editing-exception:hover{background:var(--ck-color-restricted-editing-exception-hover-background)}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{overflow-x:hidden;overflow-y:auto}.ck.ck-character-grid .ck-character-grid__tiles{grid-template-columns:repeat(auto-fill,minmax(var(--ck-character-grid-tile-size),1fr));margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-standard)}.ck.ck-character-grid .ck-character-grid__tile{border:0;font-size:1.5em;height:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-character-grid-tile-size)}@media (prefers-reduced-motion:reduce){.ck.ck-character-grid .ck-character-grid__tile{transition:none}}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);text-align:center;width:100%}.ck.ck-character-info{border-top:1px solid var(--ck-color-base-border);padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-character-info>*{font-size:var(--ck-font-size-small);text-transform:uppercase}.ck.ck-character-info .ck-character-info__name{max-width:280px;overflow:hidden;text-overflow:ellipsis}.ck.ck-character-info .ck-character-info__code{opacity:.6}.ck.ck-special-characters-navigation>.ck-label{max-width:160px;overflow:hidden;text-overflow:ellipsis}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}@media screen and (max-width:600px){.ck.ck-special-characters-navigation{max-width:190px}.ck.ck-special-characters-navigation>.ck-form__header__label{overflow:hidden;text-overflow:ellipsis}}.ck.ck-dropdown.ck-style-dropdown.ck-style-dropdown_multiple-active>.ck-button>.ck-button__label{font-style:italic}:root{--ck-style-panel-button-width:120px;--ck-style-panel-button-height:80px;--ck-style-panel-button-label-background:#f0f0f0;--ck-style-panel-button-hover-label-background:#ebebeb;--ck-style-panel-button-hover-border-color:#b3b3b3}.ck.ck-style-panel .ck-style-grid{column-gap:var(--ck-spacing-large);row-gap:var(--ck-spacing-large)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button{--ck-color-button-default-hover-background:var(--ck-color-base-background);--ck-color-button-default-active-background:var(--ck-color-base-background);height:var(--ck-style-panel-button-height);padding:0;width:var(--ck-style-panel-button-width)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button .ck-button__label{flex-shrink:0;height:22px;line-height:22px;overflow:hidden;padding:0 var(--ck-spacing-medium);text-overflow:ellipsis;width:100%}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button .ck-style-grid__button__preview{background:var(--ck-color-base-background);border:2px solid var(--ck-color-base-background);opacity:.9;overflow:hidden;padding:var(--ck-spacing-medium);width:100%}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled{--ck-color-button-default-disabled-background:var(--ck-color-base-foreground)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled:not(:focus){border-color:var(--ck-style-panel-button-label-background)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled .ck-style-grid__button__preview{border-color:var(--ck-color-base-foreground);filter:saturate(.3);opacity:.4}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-on{border-color:var(--ck-color-base-active)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-on .ck-button__label{box-shadow:0 -1px 0 var(--ck-color-base-active);z-index:1}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-on:hover{border-color:var(--ck-color-base-active-focus)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:not(.ck-on) .ck-button__label{background:var(--ck-style-panel-button-label-background)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:not(.ck-on):hover .ck-button__label{background:var(--ck-style-panel-button-hover-label-background)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:hover:not(.ck-disabled):not(.ck-on){border-color:var(--ck-style-panel-button-hover-border-color)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:hover:not(.ck-disabled):not(.ck-on) .ck-style-grid__button__preview{opacity:1}.ck.ck-style-panel .ck-style-panel__style-group>.ck-label{margin:var(--ck-spacing-large) 0}.ck.ck-style-panel .ck-style-panel__style-group:first-child>.ck-label{margin-top:0}:root{--ck-style-panel-max-height:470px}.ck.ck-style-panel{max-height:var(--ck-style-panel-max-height);overflow-y:auto;padding:var(--ck-spacing-large)}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-input-color>.ck.ck-input-text:focus{z-index:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-left-radius:0;border-top-left-radius:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-left:1px solid transparent}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-right:1px solid transparent}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border:1px solid var(--ck-color-input-border);border-radius:0;height:20px;width:20px}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{background:red;border-radius:2px;height:150%;left:50%;top:-30%;transform:rotate(45deg);transform-origin:50%;width:8%}.ck.ck-input-color .ck.ck-input-color__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);width:100%}.ck.ck-input-color .ck.ck-input-color__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-input-border)}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard);margin-right:0}.ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{min-width:100%;width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2)}.ck .ck-insert-table-dropdown__label,.ck[dir=rtl] .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{border:1px solid var(--ck-color-base-border);border-radius:1px;margin:var(--ck-insert-table-dropdown-box-margin);min-height:var(--ck-insert-table-dropdown-box-height);min-width:var(--ck-insert-table-dropdown-box-width);outline:none;transition:none}@media (prefers-reduced-motion:reduce){.ck .ck-insert-table-dropdown-grid-box{transition:none}}.ck .ck-insert-table-dropdown-grid-box:focus{box-shadow:none}.ck .ck-insert-table-dropdown-grid-box.ck-on{background:var(--ck-color-focus-outer-shadow);border-color:var(--ck-color-focus-border)}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{align-self:flex-end;padding:0;width:25%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}:root{--ck-color-selector-focused-cell-background:rgba(158,201,250,.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-selector-focused-cell-background);outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{max-width:80px;min-width:80px;width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:flex-end;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view{padding-top:var(--ck-spacing-standard)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both;background:var(--ck-color-base-error);border-radius:0;color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}@media (prefers-reduced-motion:reduce){.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:none}}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-self:flex-end;padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}:root{--ck-table-selected-cell-background:rgba(158,207,250,.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{box-shadow:unset;caret-color:transparent;outline:unset;position:relative}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{background-color:var(--ck-table-selected-cell-background);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget{transition:none}}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{box-shadow:var(--ck-inner-shadow),0 0}@media (forced-colors:none){.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{background-color:var(--ck-color-widget-editable-focus-background)}}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused:not(td,th),.ck .ck-editor__nested-editable:focus:not(td,th){border:var(--ck-focus-ring);outline:none}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{transition:none}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{transition:none}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);width:var(--ck-widget-type-around-button-size)}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button svg{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button:hover,.ck .ck-widget .ck-widget__type-around__button:hover svg line,.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:none}}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}.ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}.ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}:root{--ck-bookmark-icon-hover-fill-color:var(--ck-color-widget-hover-border);--ck-bookmark-icon-selected-fill-color:var(--ck-color-focus-border);--ck-bookmark-icon-animation-duration:var(--ck-widget-handler-animation-duration);--ck-bookmark-icon-animation-curve:var(--ck-widget-handler-animation-curve)}.ck-bookmark.ck-widget{outline:none}.ck-bookmark.ck-widget .ck-bookmark__icon .ck-icon__fill{transition:fill var(--ck-bookmark-icon-animation-duration) var(--ck-bookmark-icon-animation-curve)}.ck-bookmark.ck-widget:hover .ck-bookmark__icon .ck-icon__fill{fill:var(--ck-bookmark-icon-hover-fill-color)}.ck-bookmark.ck-widget.ck-widget_selected .ck-bookmark__icon .ck-icon__fill{fill:var(--ck-bookmark-icon-selected-fill-color)}.ck-bookmark.ck-widget.ck-widget_selected,.ck-bookmark.ck-widget.ck-widget_selected:hover{outline:none}.ck-bookmark.ck-widget .ck-bookmark__icon{position:relative;top:-.1em}.ck-bookmark.ck-widget .ck-bookmark__icon .ck-icon{height:1.2em;vertical-align:middle;width:auto}.ck.ck-bookmark-view:focus{outline:none}.ck.ck-bookmark-form{align-items:flex-start;display:flex}@media screen and (max-width:600px){.ck.ck-bookmark-form{flex-wrap:wrap}.ck.ck-bookmark-form .ck-button,.ck.ck-bookmark-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-bookmark-form .ck-button{justify-content:center}.ck.ck-bookmark-form.ck-responsive-form>.ck-button:last-child{border-radius:var(--ck-border-radius);margin:var(--ck-spacing-large);padding:0 var(--ck-spacing-standard)}}.ck.ck-bookmark-actions{align-items:center;display:flex}.ck.ck-bookmark-actions .ck-bookmark-actions__preview{cursor:default;font-weight:400;max-width:var(--ck-input-width);min-width:3em;overflow:hidden;text-align:center;text-overflow:ellipsis;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}@media screen and (max-width:600px){.ck.ck-bookmark-actions{display:flex;flex-wrap:wrap}.ck.ck-bookmark-actions .ck-bookmark-actions__preview{flex-basis:100%;margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0;min-width:auto}.ck.ck-bookmark-actions.ck-responsive-form .ck-button{flex-basis:50%;margin-top:var(--ck-spacing-standard)}}:root{--ck-image-processing-highlight-color:#f9fafa;--ck-image-processing-background-color:#e3e5e8}.ck.ck-editor__editable .image.image-processing{position:relative}.ck.ck-editor__editable .image.image-processing:before{animation:ck-image-processing-animation 2s linear infinite;background:linear-gradient(90deg,var(--ck-image-processing-background-color),var(--ck-image-processing-highlight-color),var(--ck-image-processing-background-color));background-size:200% 100%;content:"";height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.ck.ck-editor__editable .image.image-processing img{height:100%}@keyframes ck-image-processing-animation{0%{background-position:200% 0}to{background-position:-200% 0}}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute}.ck-content pre{background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;color:#353535;direction:ltr;font-style:normal;min-width:200px;padding:1em;tab-size:4;text-align:left;white-space:pre-wrap}.ck-content pre code{background:unset;border-radius:0;padding:0}.ck.ck-editor__editable pre{position:relative}.ck.ck-editor__editable pre[data-language]:after{content:attr(data-language);position:absolute}.ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}.ck.ck-menu-bar{border:none;border-bottom:1px solid var(--ck-color-toolbar-border)}.ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}.ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}.ck-find-result{background:var(--ck-color-highlight-background);color:var(--ck-color-text)}.ck-find-result_selected{background:#ff9633}.ck.ck-find-and-replace-form{max-width:100%}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs{display:flex}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions.ck-find-and-replace-form__inputs .ck-results-counter,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs.ck-find-and-replace-form__inputs .ck-results-counter{position:absolute}.ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}.ck.ck-heading_heading1 .ck-button__label{font-size:20px}.ck.ck-heading_heading2 .ck-button__label{font-size:17px}.ck.ck-heading_heading3 .ck-button__label{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}:root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{background-color:transparent;color:var(--ck-highlight-pen-red)}.ck-content .pen-green{background-color:transparent;color:var(--ck-highlight-pen-green)}.ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{background:#dedede;border:0;height:4px;margin:15px 0}.ck-widget.raw-html-embed{display:flow-root;font-style:normal;margin:.9em auto;min-width:15em;position:relative}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{display:flex;flex-direction:column;position:absolute}.ck-widget.raw-html-embed .raw-html-embed__preview{display:flex;overflow:hidden;position:relative}.ck-widget.raw-html-embed .raw-html-embed__preview-content{border-collapse:separate;border-spacing:7px;display:table;margin:auto;position:relative;width:100%}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}:root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base);min-width:calc(76px + var(--ck-spacing-standard));padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large))}.ck-widget.html-object-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.html-object-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-object-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);font-style:normal;font-weight:400;left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);position:absolute;top:0;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.html-object-embed .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck-widget.html-object-embed .html-object-embed__content{pointer-events:none}div.ck-widget.html-object-embed{margin:1em auto}span.ck-widget.html-object-embed{display:inline-block}:root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highlighted-background:#fd0}.ck-content .image>figcaption{background-color:var(--ck-color-image-caption-background);caption-side:bottom;color:var(--ck-color-image-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;word-break:break-word}@media (forced-colors:active){.ck-content .image>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:none}}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highlighted-background)}to{background-color:var(--ck-color-image-caption-background)}}.ck.ck-image-insert-url{padding:var(--ck-spacing-large) var(--ck-spacing-large) 0;width:400px}.ck.ck-image-insert-url .ck-image-insert-url__action-row{display:grid;grid-template-columns:repeat(2,1fr)}.ck-content img.image_resized{height:auto}.ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}.ck.ck-image-custom-resize-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{display:inline-block}.ck.ck-image-custom-resize-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-image-custom-resize-form{flex-wrap:wrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-image-custom-resize-form .ck-button{flex-basis:50%}}:root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image.image-style-block-align-left,.ck-content .image.image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image.image-style-align-left,.ck-content .image.image-style-align-right{clear:none}.ck-content .image.image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image.image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image.image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image.image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image.image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content p+.image.image-style-align-left,.ck-content p+.image.image-style-align-right,.ck-content p+.image.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-bottom:var(--ck-inline-image-style-spacing);margin-top:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}.ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}.ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.ck-image-upload-complete-icon:after{content:"";position:absolute}.ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}.ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;height:auto;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image{z-index:1}.ck.ck-editor__editable .image.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable .image-inline img{height:auto}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}.ck.ck-editor__editable img.image_placeholder{background-size:100% 100%}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{display:block;position:absolute}.ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-form{align-items:flex-start;display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck-editor__editable .ck-list-bogus-paragraph{display:block}.ck.ck-list-styles-list{display:grid}.ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}:root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px;position:relative}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-content[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-content .todo-list .todo-list__label>input:before{transition:none}}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-editor__editable.ck-content .todo-list .todo-list__label>input,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{cursor:pointer}.ck-editor__editable.ck-content .todo-list .todo-list__label>input:hover:before,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label>span[contenteditable=false]>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{transition:none}}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:after{border-color:#fff}.ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-content .media{clear:both;display:block;margin:.9em 0;min-width:15em}.ck-media__wrapper .ck-media__placeholder{align-items:center;display:flex;flex-direction:column}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{display:block;overflow:hidden}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}.ck-vertical-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck.ck-media-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap;width:400px}.ck.ck-media-form .ck-labeled-field-view{display:inline-block;width:100%}.ck.ck-media-form .ck-label{display:none}.ck.ck-media-form .ck-input{width:100%}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}:root{--ck-mention-list-max-height:300px}.ck.ck-mentions{max-height:var(--ck-mention-list-max-height);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}.ck.ck-mentions>.ck-list__item{flex-shrink:0;overflow:hidden}:root{--ck-color-minimap-tracker-background:208,0%,51%;--ck-color-minimap-iframe-outline:#bfbfbf;--ck-color-minimap-iframe-shadow:rgba(0,0,0,.11);--ck-color-minimap-progress-background:#666}.ck.ck-minimap{background:var(--ck-color-base-background);position:absolute;user-select:none}.ck.ck-minimap,.ck.ck-minimap iframe{height:100%;width:100%}.ck.ck-minimap iframe{border:0;box-shadow:0 2px 5px var(--ck-color-minimap-iframe-shadow);margin:0;outline:1px solid var(--ck-color-minimap-iframe-outline);pointer-events:none;position:relative}.ck.ck-minimap .ck.ck-minimap__position-tracker{background:hsla(var(--ck-color-minimap-tracker-background),.2);position:absolute;top:0;transition:background .1s ease-in-out;width:100%;z-index:1}@media (prefers-reduced-motion:reduce){.ck.ck-minimap .ck.ck-minimap__position-tracker{transition:none}}.ck.ck-minimap .ck.ck-minimap__position-tracker:hover{background:hsla(var(--ck-color-minimap-tracker-background),.3)}.ck.ck-minimap .ck.ck-minimap__position-tracker.ck-minimap__position-tracker_dragging,.ck.ck-minimap .ck.ck-minimap__position-tracker.ck-minimap__position-tracker_dragging:hover{background:hsla(var(--ck-color-minimap-tracker-background),.4)}.ck.ck-minimap .ck.ck-minimap__position-tracker.ck-minimap__position-tracker_dragging:after,.ck.ck-minimap .ck.ck-minimap__position-tracker.ck-minimap__position-tracker_dragging:hover:after{opacity:1}.ck.ck-minimap .ck.ck-minimap__position-tracker:after{background:var(--ck-color-minimap-progress-background);border:1px solid var(--ck-color-base-background);border-radius:3px;color:var(--ck-color-base-background);content:attr(data-progress) "%";font-size:10px;opacity:0;padding:2px 4px;position:absolute;right:5px;top:5px;transition:opacity .1s ease-in-out}@media (prefers-reduced-motion:reduce){.ck.ck-minimap .ck.ck-minimap__position-tracker:after{transition:none}}.ck-content .page-break{align-items:center;clear:both;display:flex;justify-content:center;padding:5px 0;position:relative}.ck-content .page-break:after{border-bottom:2px dashed #c4c4c4;content:"";position:absolute;width:100%}.ck-content .page-break__label{background:#fff;border:1px solid #c4c4c4;border-radius:2px;box-shadow:2px 2px 1px rgba(0,0,0,.15);color:#333;display:block;font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;font-size:.75em;font-weight:700;padding:.3em .6em;position:relative;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1}@media print{.ck-content .page-break{padding:0}.ck-content .page-break:after{display:none}.ck-content :has(+.page-break){margin-bottom:0}}:root{--ck-show-blocks-border-color:#757575}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address{background-image:url("data:image/svg+xml;utf8,ADDRESS");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address{background-image:url("data:image/svg+xml;utf8,ADDRESS");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside{background-image:url("data:image/svg+xml;utf8,ASIDE");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside{background-image:url("data:image/svg+xml;utf8,ASIDE");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote{background-image:url("data:image/svg+xml;utf8,BLOCKQUOTE");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote{background-image:url("data:image/svg+xml;utf8,BLOCKQUOTE");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details{background-image:url("data:image/svg+xml;utf8,DETAILS");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details{background-image:url("data:image/svg+xml;utf8,DETAILS");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *){background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *):not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *){background-image:url("data:image/svg+xml;utf8,DIV");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *){background-image:url("data:image/svg+xml;utf8,DIV");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer{background-image:url("data:image/svg+xml;utf8,FOOTER");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer{background-image:url("data:image/svg+xml;utf8,FOOTER");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1{background-image:url("data:image/svg+xml;utf8,H1");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1{background-image:url("data:image/svg+xml;utf8,H1");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2{background-image:url("data:image/svg+xml;utf8,H2");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2{background-image:url("data:image/svg+xml;utf8,H2");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3{background-image:url("data:image/svg+xml;utf8,H3");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3{background-image:url("data:image/svg+xml;utf8,H3");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4{background-image:url("data:image/svg+xml;utf8,H4");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4{background-image:url("data:image/svg+xml;utf8,H4");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5{background-image:url("data:image/svg+xml;utf8,H5");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5{background-image:url("data:image/svg+xml;utf8,H5");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6{background-image:url("data:image/svg+xml;utf8,H6");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6{background-image:url("data:image/svg+xml;utf8,H6");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header{background-image:url("data:image/svg+xml;utf8,HEADER");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header{background-image:url("data:image/svg+xml;utf8,HEADER");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main{background-image:url("data:image/svg+xml;utf8,MAIN");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main{background-image:url("data:image/svg+xml;utf8,MAIN");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav{background-image:url("data:image/svg+xml;utf8,NAV");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav{background-image:url("data:image/svg+xml;utf8,NAV");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre{background-image:url("data:image/svg+xml;utf8,PRE");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre{background-image:url("data:image/svg+xml;utf8,PRE");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol{background-image:url("data:image/svg+xml;utf8,OL");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol{background-image:url("data:image/svg+xml;utf8,OL");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul{background-image:url("data:image/svg+xml;utf8,UL");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul{background-image:url("data:image/svg+xml;utf8,UL");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p{background-image:url("data:image/svg+xml;utf8,P");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p{background-image:url("data:image/svg+xml;utf8,P");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section{background-image:url("data:image/svg+xml;utf8,SECTION");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section{background-image:url("data:image/svg+xml;utf8,SECTION");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption{background-image:url("data:image/svg+xml;utf8,FIGCAPTION");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption{background-image:url("data:image/svg+xml;utf8,FIGCAPTION");background-position:calc(100% - 1px) 1px}.ck-source-editing-area{overflow:hidden;position:relative}.ck-source-editing-area textarea,.ck-source-editing-area:after{border:1px solid transparent;font-family:monospace;font-size:var(--ck-font-size-normal);line-height:var(--ck-line-height-base);margin:0;padding:var(--ck-spacing-large);white-space:pre-wrap}.ck-source-editing-area:after{content:attr(data-value) " ";display:block;visibility:hidden}.ck-source-editing-area textarea{border-color:var(--ck-color-base-border);border-radius:0;box-sizing:border-box;height:100%;outline:none;overflow:hidden;position:absolute;resize:none;width:100%}.ck-rounded-corners .ck-source-editing-area textarea,.ck-source-editing-area textarea.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck-source-editing-area textarea:not([readonly]):focus{border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-character-grid{max-width:100%}.ck.ck-character-grid .ck-character-grid__tiles{display:grid}.ck.ck-character-info{display:flex;justify-content:space-between}.ck.ck-special-characters>.ck-dialog__content>div{display:grid;height:100%;max-width:100%;width:350px;grid-column-gap:0;grid-row-gap:0;grid-template-columns:1fr;grid-template-rows:auto 1fr auto}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories{grid-area:1/1/2/2;padding:var(--ck-spacing-medium) var(--ck-spacing-large)}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view{padding-top:var(--ck-spacing-standard);width:100%}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both;background:var(--ck-color-base-error);color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}@media (prefers-reduced-motion:reduce){.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:none}}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories .ck-dropdown{display:block;width:100%}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories .ck-dropdown>button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories .ck-dropdown>button>span{width:100%}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-grid{grid-area:2/1/3/2;max-height:200px}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-info{grid-area:3/1/4/2}:root{--ck-style-panel-columns:3}.ck.ck-style-panel .ck-style-grid{display:grid;grid-template-columns:repeat(var(--ck-style-panel-columns),auto);justify-content:start}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button{display:flex;flex-direction:column;justify-content:space-between}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button .ck-style-grid__button__preview{align-content:center;align-items:center;display:flex;flex-basis:100%;flex-grow:1;justify-content:flex-start}.ck-content .table{display:table;margin:.9em auto}.ck-content .table table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;height:100%;width:100%}.ck-content .table table td,.ck-content .table table th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}.ck-content .table table th{background:rgba(0,0,0,.05);font-weight:700}@media print{.ck-content .table table{height:auto}}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}.ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}.ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:first-of-type{flex-grow:0.57}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:last-of-type{flex-grow:0.43}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar .ck-button{flex-grow:1}.ck.ck-input-color{display:flex;flex-direction:row-reverse;width:100%}.ck.ck-input-color>input.ck.ck-input-text{flex-grow:1;min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button{display:flex}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{overflow:hidden;position:relative}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{display:block;position:absolute}.ck.ck-table-form .ck-form__row.ck-table-form__background-row,.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{align-items:center;flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{align-items:center;display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;position:absolute;transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:"";left:50%;position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translateX(-50%)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-content:baseline;flex-basis:0;flex-wrap:wrap}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}:root{--ck-color-selector-caption-background:#f7f7f7;--ck-color-selector-caption-text:#333;--ck-color-selector-caption-highlighted-background:#fd0}.ck-content .table>figcaption{background-color:var(--ck-color-selector-caption-background);caption-side:top;color:var(--ck-color-selector-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;text-align:center;word-break:break-word}@media (forced-colors:active){.ck-content .table>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .table>figcaption.table__caption_highlighted{animation:ck-table-caption-highlight .6s ease-out}}.ck.ck-editor__editable .table>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}@keyframes ck-table-caption-highlight{0%{background-color:var(--ck-color-selector-caption-highlighted-background)}to{background-color:var(--ck-color-selector-caption-background)}}:root{--ck-color-selector-column-resizer-hover:var(--ck-color-base-active);--ck-table-column-resizer-width:7px;--ck-table-column-resizer-position-offset:calc(var(--ck-table-column-resizer-width)*-0.5 - 0.5px)}.ck-content .table .ck-table-resized{table-layout:fixed}.ck-content .table table{overflow:hidden}.ck-content .table td,.ck-content .table th{overflow-wrap:break-word;position:relative}.ck.ck-editor__editable .table .ck-table-column-resizer{bottom:0;cursor:col-resize;position:absolute;right:var(--ck-table-column-resizer-position-offset);top:0;user-select:none;width:var(--ck-table-column-resizer-width);z-index:var(--ck-z-default)}.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer,.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer{display:none}.ck.ck-editor__editable .table .ck-table-column-resizer:hover,.ck.ck-editor__editable .table .ck-table-column-resizer__active{background-color:var(--ck-color-selector-column-resizer-hover);bottom:-999999px;opacity:.25;top:-999999px}.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer{left:var(--ck-table-column-resizer-position-offset);right:unset}.ck-hidden{display:none!important}:root{--ck-z-default:1;--ck-z-panel:calc(var(--ck-z-default) + 999);--ck-z-dialog:9999}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-powered-by-font-size:calc(var(--ck-font-size-base)*7.5/13);--ck-powered-by-line-height:calc(var(--ck-font-size-base)*10/13);--ck-powered-by-letter-spacing:calc(var(--ck-font-size-base)*-0.2/13);--ck-powered-by-padding-vertical:2px;--ck-powered-by-padding-horizontal:4px;--ck-powered-by-text-color:#4f4f4f;--ck-powered-by-border-radius:var(--ck-border-radius);--ck-powered-by-background:#fff;--ck-powered-by-border-color:var(--ck-color-focus-border);--ck-powered-by-svg-width:53;--ck-powered-by-svg-height:10;--ck-powered-by-icon-width:calc(var(--ck-font-size-base)*var(--ck-powered-by-svg-width)/13);--ck-powered-by-icon-height:calc(var(--ck-font-size-base)*var(--ck-powered-by-svg-height)/13)}.ck.ck-balloon-panel.ck-powered-by-balloon{--ck-border-radius:var(--ck-powered-by-border-radius);background:var(--ck-powered-by-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by{line-height:var(--ck-powered-by-line-height)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by a{align-items:center;cursor:pointer;display:flex;filter:grayscale(80%);line-height:var(--ck-powered-by-line-height);opacity:.66;padding:var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label{color:var(--ck-powered-by-text-color);cursor:pointer;font-size:var(--ck-powered-by-font-size);font-weight:700;letter-spacing:var(--ck-powered-by-letter-spacing);line-height:normal;margin-right:4px;padding-left:2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon{cursor:pointer;display:block;height:var(--ck-powered-by-icon-height);width:var(--ck-powered-by-icon-width)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a{filter:grayscale(0);opacity:1}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-powered-by-border-color)}:root{--ck-evaluation-badge-font-size:calc(var(--ck-font-size-base)*7.5/13);--ck-evaluation-badge-line-height:calc(var(--ck-font-size-base)*7.5/13);--ck-evaluation-badge-letter-spacing:calc(var(--ck-font-size-base)*-0.2/13);--ck-evaluation-badge-padding-vertical:2px;--ck-evaluation-badge-padding-horizontal:4px;--ck-evaluation-badge-text-color:#4f4f4f;--ck-evaluation-badge-border-radius:var(--ck-border-radius);--ck-evaluation-badge-background:#fff;--ck-evaluation-badge-border-color:var(--ck-color-focus-border)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon{--ck-border-radius:var(--ck-evaluation-badge-border-radius);background:var(--ck-evaluation-badge-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge{line-height:var(--ck-evaluation-badge-line-height);padding:var(--ck-evaluation-badge-padding-vertical) var(--ck-evaluation-badge-padding-horizontal)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge .ck-evaluation-badge__label{color:var(--ck-evaluation-badge-text-color);display:block;font-size:var(--ck-evaluation-badge-font-size);font-weight:700;letter-spacing:var(--ck-evaluation-badge-letter-spacing);line-height:normal;padding:0 2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-evaluation-badge-border-color)}.ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}[dir=ltr] .ck.ck-button,[dir=ltr] a.ck.ck-button{justify-content:left}[dir=rtl] .ck.ck-button,[dir=rtl] a.ck.ck-button{justify-content:right}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}.ck.ck-list-item-button{border-radius:0;min-height:unset;width:100%}[dir=ltr] .ck.ck-list-item-button{text-align:left}[dir=rtl] .ck.ck-list-item-button{text-align:right}[dir=ltr] .ck.ck-list-item-button.ck-list-item-button_toggleable{padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-list-item-button.ck-list-item-button_toggleable{padding-right:var(--ck-spacing-small)}.ck.ck-list-item-button .ck-list-item-button__check-holder{display:inline-flex;height:.9em;width:.9em}[dir=ltr] .ck.ck-list-item-button .ck-list-item-button__check-holder{margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-list-item-button .ck-list-item-button__check-holder{margin-left:var(--ck-spacing-small)}.ck.ck-list-item-button .ck-list-item-button__check-icon{height:100%}.ck.ck-collapsible.ck-collapsible_collapsed>.ck-collapsible__children{display:none}.ck.ck-color-grid{display:grid}.color-picker-hex-input{width:max-content}.color-picker-hex-input .ck.ck-input{min-width:unset}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;margin:var(--ck-spacing-large) 0 0;width:unset}.ck.ck-color-picker__row .ck.ck-labeled-field-view{padding-top:unset}.ck.ck-color-picker__row .ck.ck-input-text{width:unset}.ck.ck-color-picker__row .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{align-items:center;display:flex}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{justify-content:flex-start}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{display:flex;flex-direction:row;justify-content:space-around}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-cancel,.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-save{flex:1}.ck.ck-dialog .ck.ck-dialog__actions{display:flex;justify-content:flex-end}.ck.ck-dialog-overlay{bottom:0;left:0;overscroll-behavior:none;position:fixed;right:0;top:0;user-select:none}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent{animation:none;background:none;pointer-events:none}.ck.ck-dialog{overscroll-behavior:none;position:absolute;width:fit-content}.ck.ck-dialog .ck.ck-form__header{flex-shrink:0}.ck.ck-dialog:not(.ck-dialog_modal) .ck.ck-form__header .ck-form__header__label{cursor:grab}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent .ck.ck-dialog{pointer-events:all}:root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-panel) + 1)}.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}:root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel{max-height:314px;overflow-y:auto;position:absolute;z-index:calc(var(--ck-z-panel) + 1)}.ck.ck-dropdown-menu-list__nested-menu{display:block}.ck.ck-aria-live-announcer{left:-10000px;position:absolute;top:-10000px}.ck.ck-aria-live-region-list{list-style-type:none}.ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__header h2.ck-form__header__label{flex-grow:1}.ck.ck-icon{vertical-align:middle}.ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}.ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}:root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-panel)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}.ck .ck-balloon-rotator__navigation{align-items:center;display:flex;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-panel) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-autocomplete{position:relative}.ck.ck-autocomplete>.ck-search__results{position:absolute;z-index:var(--ck-z-panel)}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{bottom:100%}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{bottom:auto;top:100%}.ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{position:absolute;top:50%;transform:translateY(-50%)}[dir=ltr] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{left:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{right:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view .ck-search__reset{position:absolute;top:50%;transform:translateY(-50%)}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{display:block}.ck.ck-search>.ck-search__results>.ck-search__info:not(.ck-hidden)~*{display:none}.ck.ck-highlighted-text mark{background:var(--ck-color-highlight-background);font-size:inherit;font-weight:inherit;line-height:inherit;vertical-align:initial}.ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:calc(var(--ck-z-dialog) + 100)}:root{--ck-toolbar-spinner-size:18px}.ck.ck-spinner-container{display:block;position:relative}.ck.ck-spinner{left:0;margin:0 auto;position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:1}.ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}:root{--ck-menu-bar-menu-max-width:75vw;--ck-menu-bar-nested-menu-horizontal-offset:5px}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{max-width:var(--ck-menu-bar-menu-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw{bottom:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{bottom:auto;top:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{left:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{right:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{left:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en{bottom:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{right:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{bottom:0}.ck.ck-menu-bar__menu{display:block;position:relative}:root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}.ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}.ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none} \ No newline at end of file +.ck.ck-character-grid{& .ck-character-grid__tiles{display:grid}}.ck.ck-special-characters{&>.ck-dialog__content>div{display:grid;height:100%;max-width:100%;width:350px;grid-column-gap:0;grid-row-gap:0;grid-template-columns:1fr;grid-template-rows:auto 1fr auto;&>.ck-character-categories{grid-area:1/1/2/2;padding:var(--ck-spacing-medium) var(--ck-spacing-large);&>.ck-labeled-field-view{padding-top:var(--ck-spacing-standard);width:100%;& .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both;background:var(--ck-color-base-error);color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center;&:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}@media (prefers-reduced-motion:reduce){animation:none}}& .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}&>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}}.ck-dropdown{display:block;width:100%;&>button{&:not(:focus){border:1px solid var(--ck-color-base-border)}&>span{width:100%}}}}&>.ck-character-grid{grid-area:2/1/3/2;max-height:200px}&>.ck-character-info{grid-area:3/1/4/2}}}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#ccced1;--ck-color-base-action:#53a336;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#2977ff;--ck-color-base-active-focus:#0d65ff;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:218,81.8%,56.9%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#cae1fc;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#f0f0f0;--ck-color-button-default-active-background:#f0f0f0;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#f0f7ff;--ck-color-button-on-hover-background:#dbecff;--ck-color-button-on-active-background:#dbecff;--ck-color-button-on-disabled-background:#f0f2f4;--ck-color-button-on-color:#2977ff;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#4d9d30;--ck-color-button-action-active-background:#4d9d30;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#939393;--ck-color-switch-button-off-hover-background:#7d7d7d;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#4d9d30;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-dialog-background:var(--ck-custom-background);--ck-color-dialog-form-header-border:var(--ck-custom-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:var(--ck-color-base-border);--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:var(--ck-color-base-border);--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-button-on-color);--ck-color-list-button-on-background-focus:var(--ck-color-button-on-color);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-background);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-color-highlight-background:#ff0;--ck-color-light-red:#fcc;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{background:transparent;border:0;box-sizing:border-box;height:auto;margin:0;padding:0;position:static;text-decoration:none;transition:none;vertical-align:middle;width:auto;word-wrap:break-word}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}.ck.ck-autocomplete>.ck-search__results{background:var(--ck-color-base-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;max-height:200px;min-width:auto;overflow-y:auto}.ck-rounded-corners .ck.ck-autocomplete>.ck-search__results,.ck.ck-autocomplete>.ck-search__results.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-autocomplete>.ck-search__results{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{border-bottom-left-radius:0;border-bottom-right-radius:0;margin-bottom:-1px}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{border-top-left-radius:0;border-top-right-radius:0;margin-top:-1px}.ck.ck-button,a.ck.ck-button{-webkit-appearance:none;background:var(--ck-color-button-default-background);border:1px solid transparent;border-radius:0;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}@media (prefers-reduced-motion:reduce){.ck.ck-button,a.ck.ck-button{transition:none}}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit;opacity:.5}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:var(--ck-spacing-medium)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background);color:var(--ck-color-button-on-color)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background);color:var(--ck-color-button-action-text)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:calc(1.07692em + 1px);--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2px);--ck-switch-button-inner-hover-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton,.ck.ck-button.ck-switchbutton.ck-on:active,.ck.ck-button.ck-switchbutton.ck-on:focus,.ck.ck-button.ck-switchbutton.ck-on:hover,.ck.ck-button.ck-switchbutton:active,.ck.ck-button.ck-switchbutton:focus,.ck.ck-button.ck-switchbutton:hover{background:transparent;color:inherit}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;border-radius:0;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width)}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);border-radius:0;height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*.5)}@media (prefers-reduced-motion:reduce){.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{transition:none}}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:var(--ck-switch-button-inner-hover-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton:focus{border-color:transparent;box-shadow:none;outline:none}.ck.ck-button.ck-switchbutton:focus .ck-button__toggle{box-shadow:0 0 0 1px var(--ck-color-base-background),0 0 0 5px var(--ck-color-focus-outer-shadow);outline:var(--ck-focus-ring);outline-offset:1px}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var( --ck-switch-button-translation ))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var( --ck-switch-button-translation )*-1))}.ck.ck-button.ck-list-item-button{padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2)}.ck.ck-button.ck-list-item-button,.ck.ck-button.ck-list-item-button.ck-on{background:var(--ck-color-list-background);color:var(--ck-color-text)}[dir=ltr] .ck.ck-button.ck-list-item-button:has(.ck-list-item-button__check-holder){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-list-item-button:has(.ck-list-item-button__check-holder){padding-right:var(--ck-spacing-small)}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:hover,.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-button.ck-list-item-button.ck-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:hover:not(.ck-disabled),.ck.ck-button.ck-list-item-button.ck-on:not(.ck-list-item-button_toggleable):not(.ck-disabled),.ck.ck-button.ck-list-item-button:hover:not(.ck-disabled):not(.ck-disabled){color:var(--ck-color-text)}:root{--ck-collapsible-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-collapsible>.ck.ck-button{border-radius:0;color:inherit;font-weight:700;width:100%}.ck.ck-collapsible>.ck.ck-button:focus{background:transparent}.ck.ck-collapsible>.ck.ck-button:active,.ck.ck-collapsible>.ck.ck-button:hover:not(:focus),.ck.ck-collapsible>.ck.ck-button:not(:focus){background:transparent;border-color:transparent;box-shadow:none}.ck.ck-collapsible>.ck.ck-button>.ck-icon{margin-right:var(--ck-spacing-medium);width:var(--ck-collapsible-arrow-size)}.ck.ck-collapsible>.ck-collapsible__children{padding:var(--ck-spacing-medium) var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-collapsible.ck-collapsible_collapsed>.ck.ck-button .ck-icon{transform:rotate(-90deg)}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#166fd4}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{transition:box-shadow .2s ease}@media (forced-colors:none){.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;width:var(--ck-color-grid-tile-size)}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile.ck-color-selector__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}}@media (forced-colors:active){.ck.ck-color-grid__tile{height:unset;min-height:unset;min-width:unset;padding:0 var(--ck-spacing-small);width:unset}.ck.ck-color-grid__tile .ck-button__label{display:inline-block}}@media (prefers-reduced-motion:reduce){.ck.ck-color-grid__tile{transition:none}}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile .ck.ck-icon{color:var(--ck-color-color-grid-check-icon);display:none}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{width:100%}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker .ck.ck-icon{margin-left:var(--ck-spacing-standard)}.ck.ck-color-selector .ck-color-grids-fragment label.ck.ck-color-grid__label{font-weight:unset}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker{padding:8px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker{height:100px;min-width:180px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation){border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue){border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius)}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(hue-pointer),.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-picker .hex-color-picker::part(saturation-pointer){height:15px;width:15px}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{padding:0 8px 8px}:root{--ck-dialog-overlay-background-color:rgba(0,0,0,.5);--ck-dialog-drop-shadow:0px 0px 6px 2px rgba(0,0,0,.15);--ck-dialog-max-width:100vw;--ck-dialog-max-height:90vh;--ck-color-dialog-background:var(--ck-color-base-background);--ck-color-dialog-form-header-border:var(--ck-color-base-border)}.ck.ck-dialog-overlay{animation:ck-dialog-fade-in .3s;background:var(--ck-dialog-overlay-background-color);z-index:var(--ck-z-dialog)}.ck.ck-dialog{border-radius:0;--ck-drop-shadow:var(--ck-dialog-drop-shadow);background:var(--ck-color-dialog-background);border:1px solid var(--ck-color-base-border);max-height:var(--ck-dialog-max-height);max-width:var(--ck-dialog-max-width);overscroll-behavior:contain}.ck-rounded-corners .ck.ck-dialog,.ck.ck-dialog.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dialog{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-dialog .ck.ck-form__header{border-bottom:1px solid var(--ck-color-dialog-form-header-border)}.ck-dialog-scroll-locked{overflow:hidden}@keyframes ck-dialog-fade-in{0%{background:transparent}to{background:var(--ck-dialog-overlay-background-color)}}.ck.ck-dialog .ck.ck-dialog__actions{padding:var(--ck-spacing-large)}.ck.ck-dialog .ck.ck-dialog__actions>*+*{margin-left:var(--ck-spacing-large)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{overflow:hidden;text-overflow:ellipsis;width:7em}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;bottom:0;min-width:100%}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}.ck.ck-dropdown__panel:focus{outline:none}.ck.ck-dropdown>.ck-dropdown__panel>.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown>.ck-dropdown__panel>.ck-list,.ck.ck-dropdown>.ck-dropdown__panel>.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:first-child>.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:first-child>.ck-button,.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:first-child>.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button,.ck.ck-dropdown>.ck-dropdown__panel>.ck-list .ck-list__item:last-child>.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton>.ck-splitbutton__arrow:not(:focus){border-bottom-width:0;border-top-width:0}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:"";height:100%;position:absolute;width:1px}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:focus:after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:focus:after{--ck-color-split-button-hover-border:var(--ck-color-focus-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button{border-radius:0;padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2);width:100%}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button:focus{border-color:transparent;box-shadow:none}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button:focus:not(.ck-on){background:var(--ck-color-button-default-hover-background)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-button__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button.ck-disabled>.ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button.ck-icon-spacing:not(:has(.ck-button__icon))>.ck-button__label{margin-left:calc(var(--ck-icon-size) - var(--ck-spacing-small))}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{margin-right:calc(var(--ck-spacing-small)*-1);transform:rotate(-90deg)}[dir=rtl] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{margin-left:calc(var(--ck-spacing-small)*-1);transform:rotate(90deg)}.ck.ck-button.ck-dropdown-menu-list__nested-menu__button.ck-disabled>.ck-dropdown-menu-list__nested-menu__button__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=ltr] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}:root{--ck-dropdown-menu-menu-item-min-width:18em}.ck.ck-dropdown-menu-list__nested-menu__item{min-width:var(--ck-dropdown-menu-menu-item-min-width)}.ck-button.ck-dropdown-menu-list__nested-menu__item__button{border-radius:0}.ck-button.ck-dropdown-menu-list__nested-menu__item__button>.ck-spinner-container,.ck-button.ck-dropdown-menu-list__nested-menu__item__button>.ck-spinner-container .ck-spinner{--ck-toolbar-spinner-size:20px}.ck-button.ck-dropdown-menu-list__nested-menu__item__button>.ck-spinner-container{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}.ck-button.ck-dropdown-menu-list__nested-menu__item__button:focus{border-color:transparent;box-shadow:none}.ck-button.ck-dropdown-menu-list__nested-menu__item__button:focus:not(.ck-on){background:var(--ck-color-button-default-hover-background)}:root{--ck-dropdown-menu-menu-panel-max-width:75vw}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 0;height:fit-content;max-width:var(--ck-dropdown-menu-menu-panel-max-width)}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel:after,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel:before{display:none}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_es,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_se{border-top-left-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_sw,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_ws{border-top-right-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_en,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_ne{border-bottom-left-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_nw,.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel.ck-balloon-panel_wn{border-bottom-right-radius:0}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel:focus{outline:none}:root{--ck-accessibility-help-dialog-max-width:600px;--ck-accessibility-help-dialog-max-height:400px;--ck-accessibility-help-dialog-border-color:#ccced1;--ck-accessibility-help-dialog-code-background-color:#ededed;--ck-accessibility-help-dialog-kbd-shadow-color:#9c9c9c}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content{border:1px solid transparent;max-height:var(--ck-accessibility-help-dialog-max-height);max-width:var(--ck-accessibility-help-dialog-max-width);overflow:auto;padding:var(--ck-spacing-large);user-select:text}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content *{white-space:normal}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content .ck-label{display:none}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3{font-size:1.2em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4{font-size:1em;font-weight:700}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h3,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content h4,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content p,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content table{margin:1em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl{border-bottom:none;border-top:1px solid var(--ck-accessibility-help-dialog-border-color);display:grid;grid-template-columns:2fr 1fr}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{border-bottom:1px solid var(--ck-accessibility-help-dialog-border-color);padding:.4em 0}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dt{grid-column-start:1}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content dl dd{grid-column-start:2;text-align:right}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code,.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{background:var(--ck-accessibility-help-dialog-code-background-color);border-radius:2px;display:inline-block;font-size:.9em;line-height:1;padding:.4em;text-align:center;vertical-align:middle}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content code{font-family:monospace}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd{box-shadow:0 1px 1px var(--ck-accessibility-help-dialog-kbd-shadow-color);margin:0 1px;min-width:1.8em}.ck.ck-accessibility-help-dialog .ck-accessibility-help-dialog__content kbd+kbd{margin-left:2px}:root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable.ck-rounded-corners:not(.ck-editor__nested-editable){border-radius:var(--ck-border-radius)}.ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable){border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background)}:root{--ck-form-header-height:44px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}[dir=ltr] .ck.ck-form__header>.ck-icon{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-form__header>.ck-icon{margin-left:var(--ck-spacing-medium)}.ck.ck-form__header .ck-form__header__label{--ck-font-size-base:15px;font-weight:700}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal));--ck-icon-font-size:.8333350694em}.ck.ck-icon{font-size:var(--ck-icon-font-size);height:var(--ck-icon-size);width:var(--ck-icon-size)}.ck.ck-icon,.ck.ck-icon *{cursor:inherit}.ck.ck-icon.ck-icon_inherit-color,.ck.ck-icon.ck-icon_inherit-color *{color:inherit}.ck.ck-icon.ck-icon_inherit-color :not([fill]){fill:currentColor}:root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);border-radius:0;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}@media (prefers-reduced-motion:reduce){.ck.ck-input{transition:none}}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}@media (prefers-reduced-motion:reduce){.ck.ck-input.ck-error{animation:none}}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}.ck.ck-label{font-weight:700}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-labeled-field-label-default-position-x:var(--ck-spacing-medium);--ck-labeled-field-label-default-position-y:calc(var(--ck-font-size-base)*0.6);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;top:0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0;transform:translate(calc(var(--ck-spacing-medium)*-1),-6px) scale(.75);transform-origin:100% 0}@media (prefers-reduced-motion:reduce){.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transition:none}}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-labeled-field-label-default-position-x),var(--ck-labeled-field-label-default-position-y)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty:not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder):not(.ck-error)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-labeled-field-label-default-position-x)*-1),var(--ck-labeled-field-label-default-position-y)) scale(1)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}.ck.ck-labeled-input .ck-labeled-input__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-input .ck-labeled-input__status_error{color:var(--ck-color-base-error)}.ck.ck-list{background:var(--ck-color-list-background);border-radius:0;list-style-type:none;padding:var(--ck-spacing-small) 0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list__item{cursor:default;min-width:15em}.ck.ck-list__item>.ck-button:not(.ck-list-item-button){border-radius:0;min-height:unset;padding:var(--ck-spacing-tiny) calc(var(--ck-spacing-standard)*2);width:100%}[dir=ltr] .ck.ck-list__item>.ck-button:not(.ck-list-item-button){text-align:left}[dir=rtl] .ck.ck-list__item>.ck-button:not(.ck-list-item-button){text-align:right}.ck.ck-list__item>.ck-button:not(.ck-list-item-button) .ck-button__label{line-height:calc(var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button){background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):active{box-shadow:none}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item>.ck-button.ck-on:not(.ck-list-item-button):focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item>.ck-button:not(.ck-list-item-button):hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item>.ck-button.ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck-list .ck-list__group{padding-top:var(--ck-spacing-medium)}.ck-list .ck-list__group:first-child{padding-top:0}:not(.ck-hidden)~.ck-list .ck-list__group{border-top:1px solid var(--ck-color-base-border)}.ck-list .ck-list__group>.ck-label{font-size:11px;font-weight:700;padding:var(--ck-spacing-medium) var(--ck-spacing-large) 0}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;margin:var(--ck-spacing-small) 0;width:100%}.ck.ck-menu-bar{background:var(--ck-color-base-background);border:1px solid var(--ck-color-toolbar-border);display:flex;flex-wrap:wrap;gap:var(--ck-spacing-small);justify-content:flex-start;padding:var(--ck-spacing-small);width:100%}.ck.ck-menu-bar__menu{font-size:inherit}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level{max-width:100%}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button{width:100%}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-button__label{flex-grow:1;overflow:hidden;text-overflow:ellipsis}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button.ck-disabled>.ck-button__label{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-menu-bar__menu>.ck-menu-bar__menu__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button{min-height:unset;padding:var(--ck-spacing-small) var(--ck-spacing-medium)}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-button__label{line-height:unset;overflow:visible;width:unset}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-menu-bar__menu.ck-menu-bar__menu_top-level>.ck-menu-bar__menu__button .ck-icon{display:none}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button{border-radius:0}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{margin-left:var(--ck-spacing-standard);margin-right:calc(var(--ck-spacing-small)*-1);transform:rotate(-90deg)}[dir=rtl] .ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{left:var(--ck-spacing-standard);margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small);transform:rotate(90deg)}.ck.ck-menu-bar__menu:not(.ck-menu-bar__menu_top-level) .ck-menu-bar__menu__button.ck-disabled>.ck-menu-bar__menu__button__arrow{opacity:var(--ck-disabled-opacity)}:root{--ck-menu-bar-menu-item-min-width:18em}.ck.ck-menu-bar__menu .ck.ck-menu-bar__menu__item{min-width:var(--ck-menu-bar-menu-item-min-width)}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button{border-radius:0}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container,.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container .ck-spinner{--ck-toolbar-spinner-size:20px}.ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{font-size:var(--ck-icon-font-size)}[dir=ltr] .ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{margin-right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-menu-bar__menu .ck-button.ck-menu-bar__menu__item__button>.ck-spinner-container{margin-left:var(--ck-spacing-medium)}:root{--ck-menu-bar-menu-panel-max-width:75vw}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);border-radius:0;bottom:0;height:fit-content;max-width:var(--ck-menu-bar-menu-panel-max-width)}.ck-rounded-corners .ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{border-top-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{border-top-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne{border-bottom-left-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{border-bottom-right-radius:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel:focus{outline:none}.ck.ck-menu-bar .ck-list-item-button:active,.ck.ck-menu-bar .ck-list-item-button:focus{border-color:transparent;box-shadow:none}.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:active,.ck.ck-menu-bar.ck-menu-bar_focus-border-enabled .ck-list-item-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none;position:relative;z-index:2}:root{--ck-balloon-border-width:1px;--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);border-radius:0;min-height:15px}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent;margin-top:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow));margin-bottom:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_e]:after,.ck.ck-balloon-panel[class*=arrow_e]:before{border-width:var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_e]:before{border-color:transparent transparent transparent var(--ck-color-panel-border);margin-right:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_e]:after{border-color:transparent transparent transparent var(--ck-color-panel-background);margin-right:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_w]:after,.ck.ck-balloon-panel[class*=arrow_w]:before{border-width:var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_w]:before{border-color:transparent var(--ck-color-panel-border) transparent transparent;margin-left:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_w]:after{border-color:transparent var(--ck-color-panel-background) transparent transparent;margin-left:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:before{margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);right:calc(var(--ck-balloon-arrow-height)*-1);top:50%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:before{left:calc(var(--ck-balloon-arrow-height)*-1);margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);top:50%}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-number,.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}:root{--ck-search-field-view-horizontal-spacing:calc(var(--ck-icon-size) + var(--ck-spacing-medium))}.ck.ck-search>.ck-labeled-field-view .ck-input{width:100%}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon{--ck-labeled-field-label-default-position-x:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon>.ck-labeled-field-view__input-wrapper>.ck-icon{opacity:.5;pointer-events:none}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input,[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-icon .ck-input:not(.ck-input-text_empty){padding-left:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset{--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset.ck-labeled-field-view_empty{--ck-labeled-field-empty-unfocused-max-width:100% - var(--ck-search-field-view-horizontal-spacing) - var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{background:none;min-height:auto;min-width:auto;opacity:.5;padding:0}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{right:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset{left:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-search__reset:hover{opacity:1}.ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{width:100%}[dir=ltr] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input:not(.ck-input-text_empty),[dir=rtl] .ck.ck-search>.ck-labeled-field-view.ck-search__query_with-reset .ck-input{padding-right:var(--ck-search-field-view-horizontal-spacing)}.ck.ck-search>.ck-search__results{min-width:100%}.ck.ck-search>.ck-search__results>.ck-search__info{padding:var(--ck-spacing-medium) var(--ck-spacing-large);width:100%}.ck.ck-search>.ck-search__results>.ck-search__info *{white-space:normal}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{font-weight:700}.ck.ck-search>.ck-search__results>.ck-search__info>span:last-child{margin-top:var(--ck-spacing-medium)}.ck.ck-spinner-container{animation:ck-spinner-rotate 1.5s linear infinite;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@media (prefers-reduced-motion:reduce){.ck.ck-spinner-container{animation-duration:3s}}.ck.ck-spinner{border:2px solid var(--ck-color-text);border-radius:50%;border-top:2px solid transparent;height:var(--ck-toolbar-spinner-size);width:var(--ck-toolbar-spinner-size)}@keyframes ck-spinner-rotate{to{transform:rotate(1turn)}}.ck-textarea{overflow-x:hidden}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);border:1px solid var(--ck-color-toolbar-border);border-radius:0;padding:0 var(--ck-spacing-small)}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar .ck.ck-toolbar__separator{background:var(--ck-color-toolbar-border);height:var(--ck-icon-size);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border-radius:0;margin:0;width:100%}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-dropdown__panel{min-width:auto}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-button>.ck-button__label{max-width:7em;width:auto}.ck.ck-toolbar:focus{outline:none}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=rtl]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=ltr]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-balloon-panel.ck-tooltip{--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-tooltip-text-padding:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);box-shadow:none;padding:0 var(--ck-spacing-medium)}.ck.ck-balloon-panel.ck-tooltip .ck-tooltip__text{color:var(--ck-color-tooltip-text);font-size:.9em;line-height:1.5}.ck.ck-balloon-panel.ck-tooltip.ck-tooltip_multi-line .ck-tooltip__text{display:inline-block;max-width:200px;padding:var(--ck-tooltip-text-padding) 0;white-space:break-spaces}.ck.ck-balloon-panel.ck-tooltip:before{display:none}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content{border:solid var(--ck-color-base-border);border-radius:0;border-width:1px 1px 0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.ck-sticky-panel__content_sticky{border-bottom-width:1px}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-menu-bar{border:0;border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-toolbar{border:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}.ck .ck-fake-bookmark-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-bookmark-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:"";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}.ck.ck-clipboard-drop-target-line{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);height:0;margin-top:-1px}.ck.ck-clipboard-drop-target-line:before{border-style:solid;content:"";height:0;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-width)*-.5);width:0}[dir=ltr] .ck.ck-clipboard-drop-target-line:before{border-color:transparent transparent transparent var(--ck-clipboard-drop-target-color);border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height);left:-1px}[dir=rtl] .ck.ck-clipboard-drop-target-line:before{border-color:transparent var(--ck-clipboard-drop-target-color) transparent transparent;border-width:calc(var(--ck-clipboard-drop-target-dot-width)*.5) var(--ck-clipboard-drop-target-dot-height) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0;right:-1px}:root{--ck-color-code-block-label-background:#757575}.ck.ck-editor__editable pre[data-language]:after{background:var(--ck-color-code-block-label-background);color:#fff;font-family:var(--ck-font-face);font-size:10px;line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);right:10px;top:-1px;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}@media (forced-colors:active){.ck .ck-placeholder,.ck.ck-placeholder{forced-color-adjust:preserve-parent-color}}.ck .ck-placeholder:before,.ck.ck-placeholder:before{cursor:text}@media (forced-colors:none){.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text)}}@media (forced-colors:active){.ck .ck-placeholder:before,.ck.ck-placeholder:before{font-style:italic;margin-left:1px}}.ck.ck-find-and-replace-form{width:400px}.ck.ck-find-and-replace-form:focus{outline:none}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs{align-content:stretch;align-items:center;flex:1 1 auto;flex-direction:row;flex-wrap:wrap;margin:0;padding:var(--ck-spacing-large)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>.ck-button,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-button{flex:0 0 auto}[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>*+*,[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>*+*{margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>*+*,[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>*+*{margin-right:var(--ck-spacing-standard)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions .ck-labeled-field-view,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-labeled-field-view{flex:1 1 auto}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions .ck-labeled-field-view .ck-input,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-labeled-field-view .ck-input{min-width:50px;width:100%}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs{align-items:flex-start}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-button-prev>.ck-icon{transform:rotate(90deg)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-button-next>.ck-icon{transform:rotate(-90deg)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{color:var(--ck-color-base-border);top:50%;transform:translateY(-50%)}[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs .ck-results-counter{left:var(--ck-spacing-standard)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-labeled-field-replace{flex:0 0 100%;padding-top:var(--ck-spacing-standard)}[dir=ltr] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-labeled-field-replace{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs>.ck-labeled-field-replace{margin-right:0}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions{flex-wrap:wrap;justify-content:flex-end;margin-top:calc(var(--ck-spacing-large)*-1)}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>.ck-button-find{font-weight:700}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions>.ck-button-find .ck-button__label{padding-left:var(--ck-spacing-large);padding-right:var(--ck-spacing-large)}.ck.ck-find-and-replace-form .ck-switchbutton{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;width:100%}@media screen and (max-width:600px){.ck.ck-find-and-replace-form{max-width:100%;width:300px}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input{flex-wrap:wrap}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input .ck-labeled-field-view{flex:1 0 auto;margin-bottom:var(--ck-spacing-standard);width:100%}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button{text-align:center}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type{flex:1 1 auto}[dir=ltr] .ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type{margin-right:0}.ck.ck-find-and-replace-form.ck-find-and-replace-form__input>.ck-button:first-of-type .ck-button__label{text-align:center;width:100%}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view){flex:1 1 auto;flex-wrap:wrap}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button{text-align:center}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button:first-of-type{flex:1 1 auto}[dir=ltr] .ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button:first-of-type{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button:first-of-type{margin-right:0}.ck.ck-find-and-replace-form.ck-find-and-replace-form__actions>:not(.ck-labeled-field-view)>.ck-button .ck-button__label{text-align:center;width:100%}}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{background:var(--ck-color-focus-border);padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{right:var(--ck-spacing-standard);top:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;direction:ltr;font-family:monospace;font-size:var(--ck-font-size-base);height:var(--ck-html-embed-source-height);min-width:0;padding:var(--ck-spacing-standard);resize:none;tab-size:4;text-align:left;white-space:pre-wrap;width:var(--ck-html-embed-content-width)}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{background-color:var(--ck-color-base-foreground);box-sizing:border-box}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}:root{--ck-image-insert-insert-by-url-width:250px}.ck.ck-image-insert-url{--ck-input-width:100%}.ck.ck-image-insert-url .ck-image-insert-url__action-row{grid-column-gap:var(--ck-spacing-large);margin-top:var(--ck-spacing-large)}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-cancel,.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button-save{justify-content:center;min-width:auto}.ck.ck-image-insert-url .ck-image-insert-url__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}.ck.ck-image-insert-form>.ck.ck-button{display:block;width:100%}[dir=ltr] .ck.ck-image-insert-form>.ck.ck-button{text-align:left}[dir=rtl] .ck.ck-image-insert-form>.ck.ck-button{text-align:right}.ck.ck-image-insert-form>.ck.ck-collapsible{min-width:var(--ck-image-insert-insert-by-url-width)}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:first-child){border-top:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-collapsible:not(:last-child){border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-image-insert-form>.ck.ck-image-insert-url{min-width:var(--ck-image-insert-insert-by-url-width);padding:var(--ck-spacing-large)}.ck.ck-image-insert-form:focus{outline:none}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@media (prefers-reduced-motion:reduce){.ck-image-upload-complete-icon{animation-duration:0ms}.ck-image-upload-complete-icon:after{animation:none;height:.45em;opacity:1;width:.3em}}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:none;opacity:1}}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{max-width:100%;min-width:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}.ck.ck-link-form_layout-vertical{min-width:var(--ck-input-width);padding:0}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical>.ck-button{border-radius:0;margin:0;padding:var(--ck-spacing-standard);width:50%}.ck.ck-link-form_layout-vertical>.ck-button:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form_layout-vertical>.ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:0 var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}:root{--ck-link-image-indicator-icon-size:20;--ck-link-image-indicator-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{background-color:rgba(0,0,0,.4);background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAyMCI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzUuNzUgMCAwIDEtLjIxNy4yMDYgNS4yNTEgNS4yNTEgMCAwIDEtOC41MDMtNS45NTUuNy43IDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NHptNS40OTQtNS4zMzVhLjc1Ljc1IDAgMCAxLS4xMi4yNzRsLTEuMTQ3IDEuNjM5YS43NS43NSAwIDEgMS0xLjIyOC0uODZsLjg2LTEuMjNhMy43NSAzLjc1IDAgMCAwLTYuMTQ0LTQuMzAxbC0uODYgMS4yMjlhLjc1Ljc1IDAgMCAxLTEuMjI5LS44NmwxLjE0OC0xLjY0YS43NS43NSAwIDAgMSAuMjE3LS4yMDYgNS4yNTEgNS4yNTEgMCAwIDEgOC41MDMgNS45NTVtLTQuNTYzLTIuNTMyYS43NS43NSAwIDAgMSAuMTg0IDEuMDQ1bC0zLjE1NSA0LjUwNWEuNzUuNzUgMCAxIDEtMS4yMjktLjg2bDMuMTU1LTQuNTA2YS43NS43NSAwIDAgMSAxLjA0NS0uMTg0Ii8+PC9zdmc+);background-position:50%;background-repeat:no-repeat;background-size:14px;border-radius:100%;content:"";height:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size));overflow:hidden;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);width:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size))}.ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{background:var(--ck-color-base-foreground);padding:calc(var(--ck-spacing-standard)*3)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{background-position:50%;background-size:cover;height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);min-width:var(--ck-media-embed-placeholder-icon-size)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{height:100%;width:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);font-style:italic;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-height:380px;max-width:300px}.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSlzY2FsZSguOTgwMTIpIj48cmVjdCB3aWR0aD0iNjAuMDk5IiBoZWlnaHQ9IjYwLjA5OSIgeD0iMTc2LjAzMSIgeT0iMjMxLjM5OSIgZmlsbD0iIzM0YTY2OCIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjIzOCIgcnk9IjUuMjM4Ii8+PHBhdGggZmlsbD0iIzVjODhjNSIgZD0ibTIwNi40NzcgMjYwLjktMjguOTg3IDI4Ljk4N2E1LjIyIDUuMjIgMCAwIDAgMy43OCAxLjYxaDQ5LjYyMWMxLjY5NCAwIDMuMTktLjc5OCA0LjE0Ni0yLjAzN3oiLz48cGF0aCBmaWxsPSIjZGQ0YjNlIiBkPSJNMjI2Ljc0MiAyMjIuOTg4Yy05LjI2NiAwLTE2Ljc3NyA3LjE3LTE2Ljc3NyAxNi4wMTQuMDA3IDIuNzYyLjY2MyA1LjQ3NCAyLjA5MyA3Ljg3NS40My43MDMuODMgMS40MDggMS4xOSAyLjEwN3EuNS43NTMuOTUgMS41MDguNTE1LjcxNS45ODggMS40NGMxLjMxIDEuNzY5IDIuNSAzLjUwMiAzLjYzNyA1LjE2OC43OTMgMS4yNzUgMS42ODMgMi42NCAyLjQ2NiAzLjk5IDIuMzYzIDQuMDk0IDQuMDA3IDguMDkyIDQuNiAxMy45MTR2LjAxMmMuMTgyLjQxMi41MTYuNjY2Ljg3OS42NjcuNDAzLS4wMDEuNzY4LS4zMTQuOTMtLjc5OS42MDMtNS43NTYgMi4yMzgtOS43MjkgNC41ODUtMTMuNzk0Ljc4Mi0xLjM1IDEuNjczLTIuNzE1IDIuNDY1LTMuOTkgMS4xMzctMS42NjYgMi4zMjgtMy40IDMuNjM4LTUuMTY5cS40NzMtLjcyMy45ODgtMS40MzkuNDUtLjc1NS45NS0xLjUwOGMuMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIGN4PSIyMjYuNzQyIiBjeT0iMjM5LjAwMiIgZmlsbD0iIzgwMmQyNyIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiIHJ4PSI1LjgyOCIgcnk9IjUuNTY0Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjlxLS4wMDEtLjU0My0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhxLS4wMDEtLjAwMy0uMDA0LS4wMDVjLTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTVtNC40MyA1LjY2LjAwMy4wMDZ2LS4wMDN6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGZpbGw9IiNjM2MzYzMiIGQ9Im0yMTUuMTg0IDI1MS45MjktNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMiA1LjIgMCAwIDAgLjQ0OS0yLjEyM3YtMzEuMTY1Yy0uNDY5LjY3NS0uOTM0IDEuMzQ5LTEuMzgyIDIuMDA1LS43OTIgMS4yNzUtMS42ODIgMi42NC0yLjQ2NSAzLjk5LTIuMzQ3IDQuMDY1LTMuOTgyIDguMDM4LTQuNTg1IDEzLjc5NC0uMTYyLjQ4NS0uNTI3Ljc5OC0uOTMuNzk5LS4zNjMtLjAwMS0uNjk3LS4yNTUtLjg3OS0uNjY3di0uMDEyYy0uNTkzLTUuODIyLTIuMjM3LTkuODItNC42LTEzLjkxNC0uNzgzLTEuMzUtMS42NzMtMi43MTUtMi40NjYtMy45OS0xLjEzNy0xLjY2Ni0yLjMyNy0zLjQtMy42MzctNS4xNjl6Ii8+PHBhdGggZmlsbD0iI2ZkZGM0ZiIgZD0ibTIxMi45ODMgMjQ4LjQ5NS0zNi45NTIgMzYuOTUzdi44MTJhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYgMTM2IDAgMCAwLTIuNzY0LTMuOSAzOCAzOCAwIDAgMC0uOTg5LTEuNDQgMzUgMzUgMCAwIDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJtMjExLjk5OCAyNjEuMDgzLTYuMTUyIDYuMTUxIDI0LjI2NCAyNC4yNjRoLjc4MWE1LjIyNyA1LjIyNyAwIDAgMCA1LjIzOS01LjIzOHYtMS4wNDV6IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDI0IiBoZWlnaHQ9IjEwMjQiIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiPjx0aXRsZT5GaWxsIDE8L3RpdGxlPjxwYXRoIGZpbGw9IiNGRkZGRkUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTk2Ny40ODQgMEg1Ni41MTdDMjUuMzA0IDAgMCAyNS4zMDQgMCA1Ni41MTd2OTEwLjk2NkMwIDk5OC42OTQgMjUuMjk3IDEwMjQgNTYuNTIyIDEwMjRINTQ3VjYyOEg0MTRWNDczaDEzM1YzNTkuMDI5YzAtMTMyLjI2MiA4MC43NzMtMjA0LjI4MiAxOTguNzU2LTIwNC4yODIgNTYuNTEzIDAgMTA1LjA4NiA0LjIwOCAxMTkuMjQ0IDYuMDg5VjI5OWwtODEuNjE2LjAzN2MtNjMuOTkzIDAtNzYuMzg0IDMwLjQ5Mi03Ni4zODQgNzUuMjM2VjQ3M2gxNTMuNDg3bC0xOS45ODYgMTU1SDcwN3YzOTZoMjYwLjQ4NGMzMS4yMTMgMCA1Ni41MTYtMjUuMzAzIDU2LjUxNi01Ni41MTZWNTYuNTE1QzEwMjQgMjUuMzAzIDk5OC42OTcgMCA5NjcuNDg0IDAiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgdmlld0JveD0iMCAwIDUwNCA1MDQiPjx0aXRsZT5nbHlwaC1sb2dvX01heTIwMTY8L3RpdGxlPjxkZWZzPjxwYXRoIGlkPSJhIiBkPSJNMCAuMTU5aDUwMy44NDFWNTAzLjk0SDB6Ii8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PG1hc2sgaWQ9ImIiIGZpbGw9IiNmZmYiPjx1c2UgeGxpbms6aHJlZj0iI2EiLz48L21hc2s+PHBhdGggZmlsbD0iI0ZGRiIgZD0iTTI1MS45MjEuMTU5Yy02OC40MTggMC03Ni45OTcuMjktMTAzLjg2NyAxLjUxNi0yNi44MTQgMS4yMjMtNDUuMTI3IDUuNDgyLTYxLjE1MSAxMS43MS0xNi41NjYgNi40MzctMzAuNjE1IDE1LjA1MS00NC42MjEgMjkuMDU2LTE0LjAwNSAxNC4wMDYtMjIuNjE5IDI4LjA1NS0yOS4wNTYgNDQuNjIxLTYuMjI4IDE2LjAyNC0xMC40ODcgMzQuMzM3LTExLjcxIDYxLjE1MUMuMjkgMTc1LjA4MyAwIDE4My42NjIgMCAyNTIuMDhjMCA2OC40MTcuMjkgNzYuOTk2IDEuNTE2IDEwMy44NjYgMS4yMjMgMjYuODE0IDUuNDgyIDQ1LjEyNyAxMS43MSA2MS4xNTEgNi40MzcgMTYuNTY2IDE1LjA1MSAzMC42MTUgMjkuMDU2IDQ0LjYyMSAxNC4wMDYgMTQuMDA1IDI4LjA1NSAyMi42MTkgNDQuNjIxIDI5LjA1NyAxNi4wMjQgNi4yMjcgMzQuMzM3IDEwLjQ4NiA2MS4xNTEgMTEuNzA5IDI2Ljg3IDEuMjI2IDM1LjQ0OSAxLjUxNiAxMDMuODY3IDEuNTE2IDY4LjQxNyAwIDc2Ljk5Ni0uMjkgMTAzLjg2Ni0xLjUxNiAyNi44MTQtMS4yMjMgNDUuMTI3LTUuNDgyIDYxLjE1MS0xMS43MDkgMTYuNTY2LTYuNDM4IDMwLjYxNS0xNS4wNTIgNDQuNjIxLTI5LjA1NyAxNC4wMDUtMTQuMDA2IDIyLjYxOS0yOC4wNTUgMjkuMDU3LTQ0LjYyMSA2LjIyNy0xNi4wMjQgMTAuNDg2LTM0LjMzNyAxMS43MDktNjEuMTUxIDEuMjI2LTI2Ljg3IDEuNTE2LTM1LjQ0OSAxLjUxNi0xMDMuODY2IDAtNjguNDE4LS4yOS03Ni45OTctMS41MTYtMTAzLjg2Ny0xLjIyMy0yNi44MTQtNS40ODItNDUuMTI3LTExLjcwOS02MS4xNTEtNi40MzgtMTYuNTY2LTE1LjA1Mi0zMC42MTUtMjkuMDU3LTQ0LjYyMS0xNC4wMDYtMTQuMDA1LTI4LjA1NS0yMi42MTktNDQuNjIxLTI5LjA1Ni0xNi4wMjQtNi4yMjgtMzQuMzM3LTEwLjQ4Ny02MS4xNTEtMTEuNzFDMzI4LjkxNy40NDkgMzIwLjMzOC4xNTkgMjUxLjkyMS4xNTltMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1czE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NmMzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjZzLTE3LjIwNyAxNC4yNzUtMjguOTY2IDE4Ljg0NWMtOC44NzcgMy40NS0yMi4yMTYgNy41NTQtNDYuNzc4IDguNjc0LTI2LjU2IDEuMjEyLTM0LjUyNyAxLjQ2OS0xMDEuNzk3IDEuNDY5LTY3LjI3MSAwLTc1LjIzNy0uMjU3LTEwMS43OTgtMS40NjktMjQuNTYyLTEuMTItMzcuOTAxLTUuMjI0LTQ2Ljc3OC04LjY3NC0xMS43NTktNC41Ny0yMC4xNTEtMTAuMDI5LTI4Ljk2Ni0xOC44NDVzLTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2NmMtMy40NS04Ljg3Ny03LjU1NC0yMi4yMTYtOC42NzQtNDYuNzc4LTEuMjEyLTI2LjU2NC0xLjQ2OS0zNC41MzItMS40NjktMTAxLjc5NyAwLTY3LjI2Ni4yNTctNzUuMjM0IDEuNDY5LTEwMS43OTggMS4xMi0yNC41NjIgNS4yMjQtMzcuOTAxIDguNjc0LTQ2Ljc3OCA0LjU3LTExLjc1OSAxMC4wMjktMjAuMTUxIDE4Ljg0NS0yOC45NjZzMTcuMjA3LTE0LjI3NSAyOC45NjYtMTguODQ1YzguODc3LTMuNDUgMjIuMjE2LTcuNTU0IDQ2Ljc3OC04LjY3NCAyNi41NjQtMS4yMTIgMzQuNTMyLTEuNDY5IDEwMS43OTgtMS40NjkiIG1hc2s9InVybCgjYikiLz48cGF0aCBmaWxsPSIjRkZGIiBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzNzMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0YzQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzNtMC0yMTMuMzM4Yy03MS40NDcgMC0xMjkuMzY1IDU3LjkxOC0xMjkuMzY1IDEyOS4zNjUgMCA3MS40NDYgNTcuOTE4IDEyOS4zNjQgMTI5LjM2NSAxMjkuMzY0IDcxLjQ0NiAwIDEyOS4zNjQtNTcuOTE4IDEyOS4zNjQtMTI5LjM2NCAwLTcxLjQ0Ny01Ny45MTgtMTI5LjM2NS0xMjkuMzY0LTEyOS4zNjVNNDE2LjYyNyAxMTcuNjA0YzAgMTYuNjk2LTEzLjUzNSAzMC4yMy0zMC4yMzEgMzAuMjMtMTYuNjk1IDAtMzAuMjMtMTMuNTM0LTMwLjIzLTMwLjIzczEzLjUzNS0zMC4yMzEgMzAuMjMtMzAuMjMxYzE2LjY5NiAwIDMwLjIzMSAxMy41MzUgMzAuMjMxIDMwLjIzMSIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwME0xNjMuNCAzMDUuNWM4OC43IDAgMTM3LjItNzMuNSAxMzcuMi0xMzcuMiAwLTIuMSAwLTQuMi0uMS02LjIgOS40LTYuOCAxNy42LTE1LjMgMjQuMS0yNS04LjYgMy44LTE3LjkgNi40LTI3LjcgNy42IDEwLTYgMTcuNi0xNS40IDIxLjItMjYuNy05LjMgNS41LTE5LjYgOS41LTMwLjYgMTEuNy04LjgtOS40LTIxLjMtMTUuMi0zNS4yLTE1LjItMjYuNiAwLTQ4LjIgMjEuNi00OC4yIDQ4LjIgMCAzLjguNCA3LjUgMS4zIDExLTQwLjEtMi03NS42LTIxLjItOTkuNC01MC40LTQuMSA3LjEtNi41IDE1LjQtNi41IDI0LjIgMCAxNi43IDguNSAzMS41IDIxLjUgNDAuMS03LjktLjItMTUuMy0yLjQtMjEuOC02di42YzAgMjMuNCAxNi42IDQyLjggMzguNyA0Ny4zLTQgMS4xLTguMyAxLjctMTIuNyAxLjctMy4xIDAtNi4xLS4zLTkuMS0uOSA2LjEgMTkuMiAyMy45IDMzLjEgNDUgMzMuNS0xNi41IDEyLjktMzcuMyAyMC42LTU5LjkgMjAuNi0zLjkgMC03LjctLjItMTEuNS0uNyAyMS4xIDEzLjggNDYuNSAyMS44IDczLjcgMjEuOCIgc3R5bGU9ImZpbGw6I2ZmZiIvPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}:root{--ck-color-mention-background:rgba(153,0,48,.1);--ck-color-mention-text:#990030}.ck-content .mention{background:var(--ck-color-mention-background);color:var(--ck-color-mention-text)}:root{--ck-color-restricted-editing-exception-background:rgba(255,169,77,.2);--ck-color-restricted-editing-exception-hover-background:rgba(255,169,77,.35);--ck-color-restricted-editing-exception-brackets:rgba(204,105,0,.4);--ck-color-restricted-editing-selected-exception-background:rgba(255,169,77,.5);--ck-color-restricted-editing-selected-exception-brackets:rgba(204,105,0,.6)}.ck-editor__editable .restricted-editing-exception{background-color:var(--ck-color-restricted-editing-exception-background);border:1px solid;border-image:linear-gradient(to right,var(--ck-color-restricted-editing-exception-brackets) 0,var(--ck-color-restricted-editing-exception-brackets) 5px,transparent 6px,transparent calc(100% - 6px),var(--ck-color-restricted-editing-exception-brackets) calc(100% - 5px),var(--ck-color-restricted-editing-exception-brackets) 100%) 1;transition:background .2s ease-in-out}@media (prefers-reduced-motion:reduce){.ck-editor__editable .restricted-editing-exception{transition:none}}.ck-editor__editable .restricted-editing-exception.restricted-editing-exception_selected{background-color:var(--ck-color-restricted-editing-selected-exception-background);border-image:linear-gradient(to right,var(--ck-color-restricted-editing-selected-exception-brackets) 0,var(--ck-color-restricted-editing-selected-exception-brackets) 5px,var(--ck-color-restricted-editing-selected-exception-brackets) calc(100% - 5px),var(--ck-color-restricted-editing-selected-exception-brackets) 100%) 1}.ck-editor__editable .restricted-editing-exception.restricted-editing-exception_collapsed{padding-left:1ch}.ck-restricted-editing_mode_restricted,.ck-restricted-editing_mode_restricted *{cursor:default}.ck-restricted-editing_mode_restricted .restricted-editing-exception,.ck-restricted-editing_mode_restricted .restricted-editing-exception *{cursor:text}.ck-restricted-editing_mode_restricted .restricted-editing-exception:hover{background:var(--ck-color-restricted-editing-exception-hover-background)}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{overflow-x:hidden;overflow-y:auto}.ck.ck-character-grid .ck-character-grid__tiles{grid-template-columns:repeat(auto-fill,minmax(var(--ck-character-grid-tile-size),1fr));margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-standard)}.ck.ck-character-grid .ck-character-grid__tile{border:0;font-size:1.5em;height:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-character-grid-tile-size)}@media (prefers-reduced-motion:reduce){.ck.ck-character-grid .ck-character-grid__tile{transition:none}}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);text-align:center;width:100%}.ck.ck-character-info{border-top:1px solid var(--ck-color-base-border);padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-character-info>*{font-size:var(--ck-font-size-small);text-transform:uppercase}.ck.ck-character-info .ck-character-info__name{max-width:280px;overflow:hidden;text-overflow:ellipsis}.ck.ck-character-info .ck-character-info__code{opacity:.6}.ck.ck-special-characters-navigation>.ck-label{max-width:160px;overflow:hidden;text-overflow:ellipsis}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}@media screen and (max-width:600px){.ck.ck-special-characters-navigation{max-width:190px}.ck.ck-special-characters-navigation>.ck-form__header__label{overflow:hidden;text-overflow:ellipsis}}.ck.ck-dropdown.ck-style-dropdown.ck-style-dropdown_multiple-active>.ck-button>.ck-button__label{font-style:italic}:root{--ck-style-panel-button-width:120px;--ck-style-panel-button-height:80px;--ck-style-panel-button-label-background:#f0f0f0;--ck-style-panel-button-hover-label-background:#ebebeb;--ck-style-panel-button-hover-border-color:#b3b3b3}.ck.ck-style-panel .ck-style-grid{column-gap:var(--ck-spacing-large);row-gap:var(--ck-spacing-large)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button{--ck-color-button-default-hover-background:var(--ck-color-base-background);--ck-color-button-default-active-background:var(--ck-color-base-background);height:var(--ck-style-panel-button-height);padding:0;width:var(--ck-style-panel-button-width)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button .ck-button__label{flex-shrink:0;height:22px;line-height:22px;overflow:hidden;padding:0 var(--ck-spacing-medium);text-overflow:ellipsis;width:100%}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button .ck-style-grid__button__preview{background:var(--ck-color-base-background);border:2px solid var(--ck-color-base-background);opacity:.9;overflow:hidden;padding:var(--ck-spacing-medium);width:100%}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled{--ck-color-button-default-disabled-background:var(--ck-color-base-foreground)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled:not(:focus){border-color:var(--ck-style-panel-button-label-background)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled .ck-style-grid__button__preview{border-color:var(--ck-color-base-foreground);filter:saturate(.3);opacity:.4}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-on{border-color:var(--ck-color-base-active)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-on .ck-button__label{box-shadow:0 -1px 0 var(--ck-color-base-active);z-index:1}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-on:hover{border-color:var(--ck-color-base-active-focus)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:not(.ck-on) .ck-button__label{background:var(--ck-style-panel-button-label-background)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:not(.ck-on):hover .ck-button__label{background:var(--ck-style-panel-button-hover-label-background)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:hover:not(.ck-disabled):not(.ck-on){border-color:var(--ck-style-panel-button-hover-border-color)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:hover:not(.ck-disabled):not(.ck-on) .ck-style-grid__button__preview{opacity:1}.ck.ck-style-panel .ck-style-panel__style-group>.ck-label{margin:var(--ck-spacing-large) 0}.ck.ck-style-panel .ck-style-panel__style-group:first-child>.ck-label{margin-top:0}:root{--ck-style-panel-max-height:470px}.ck.ck-style-panel{max-height:var(--ck-style-panel-max-height);overflow-y:auto;padding:var(--ck-spacing-large)}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-input-color>.ck.ck-input-text:focus{z-index:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-left-radius:0;border-top-left-radius:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-left:1px solid transparent}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-right:1px solid transparent}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border:1px solid var(--ck-color-input-border);border-radius:0;height:20px;width:20px}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{background:red;border-radius:2px;height:150%;left:50%;top:-30%;transform:rotate(45deg);transform-origin:50%;width:8%}.ck.ck-input-color .ck.ck-input-color__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);width:100%}.ck.ck-input-color .ck.ck-input-color__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-input-border)}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard);margin-right:0}.ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{min-width:100%;width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2)}.ck .ck-insert-table-dropdown__label,.ck[dir=rtl] .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{border:1px solid var(--ck-color-base-border);border-radius:1px;margin:var(--ck-insert-table-dropdown-box-margin);min-height:var(--ck-insert-table-dropdown-box-height);min-width:var(--ck-insert-table-dropdown-box-width);outline:none;transition:none}@media (prefers-reduced-motion:reduce){.ck .ck-insert-table-dropdown-grid-box{transition:none}}.ck .ck-insert-table-dropdown-grid-box:focus{box-shadow:none}.ck .ck-insert-table-dropdown-grid-box.ck-on{background:var(--ck-color-focus-outer-shadow);border-color:var(--ck-color-focus-border)}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{align-self:flex-end;padding:0;width:25%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}:root{--ck-color-selector-focused-cell-background:rgba(158,201,250,.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-selector-focused-cell-background);outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{max-width:80px;min-width:80px;width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:flex-end;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view{padding-top:var(--ck-spacing-standard)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both;background:var(--ck-color-base-error);border-radius:0;color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}@media (prefers-reduced-motion:reduce){.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:none}}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-self:flex-end;padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}:root{--ck-table-selected-cell-background:rgba(158,207,250,.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{box-shadow:unset;caret-color:transparent;outline:unset;position:relative}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{background-color:var(--ck-table-selected-cell-background);bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget{transition:none}}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{box-shadow:var(--ck-inner-shadow),0 0}@media (forced-colors:none){.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{background-color:var(--ck-color-widget-editable-focus-background)}}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused:not(td,th),.ck .ck-editor__nested-editable:focus:not(td,th){border:var(--ck-focus-ring);outline:none}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{transition:none}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}@media (prefers-reduced-motion:reduce){.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{transition:none}}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);width:var(--ck-widget-type-around-button-size)}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button svg{transition:none}}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}@media (prefers-reduced-motion:reduce){.ck .ck-widget .ck-widget__type-around__button:hover,.ck .ck-widget .ck-widget__type-around__button:hover svg line,.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:none}}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}.ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}.ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}:root{--ck-bookmark-icon-hover-fill-color:var(--ck-color-widget-hover-border);--ck-bookmark-icon-selected-fill-color:var(--ck-color-focus-border);--ck-bookmark-icon-animation-duration:var(--ck-widget-handler-animation-duration);--ck-bookmark-icon-animation-curve:var(--ck-widget-handler-animation-curve)}.ck-bookmark.ck-widget{outline:none}.ck-bookmark.ck-widget .ck-bookmark__icon .ck-icon__fill{transition:fill var(--ck-bookmark-icon-animation-duration) var(--ck-bookmark-icon-animation-curve)}.ck-bookmark.ck-widget:hover .ck-bookmark__icon .ck-icon__fill{fill:var(--ck-bookmark-icon-hover-fill-color)}.ck-bookmark.ck-widget.ck-widget_selected .ck-bookmark__icon .ck-icon__fill{fill:var(--ck-bookmark-icon-selected-fill-color)}.ck-bookmark.ck-widget.ck-widget_selected,.ck-bookmark.ck-widget.ck-widget_selected:hover{outline:none}.ck-bookmark.ck-widget .ck-bookmark__icon{position:relative;top:-.1em}.ck-bookmark.ck-widget .ck-bookmark__icon .ck-icon{height:1.2em;vertical-align:middle;width:auto}.ck.ck-bookmark-view:focus{outline:none}.ck.ck-bookmark-form{align-items:flex-start;display:flex}@media screen and (max-width:600px){.ck.ck-bookmark-form{flex-wrap:wrap}.ck.ck-bookmark-form .ck-button,.ck.ck-bookmark-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-bookmark-form .ck-button{justify-content:center}.ck.ck-bookmark-form.ck-responsive-form>.ck-button:last-child{border-radius:var(--ck-border-radius);margin:var(--ck-spacing-large);padding:0 var(--ck-spacing-standard)}}.ck.ck-bookmark-actions{align-items:center;display:flex}.ck.ck-bookmark-actions .ck-bookmark-actions__preview{cursor:default;font-weight:400;max-width:var(--ck-input-width);min-width:3em;overflow:hidden;text-align:center;text-overflow:ellipsis;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}@media screen and (max-width:600px){.ck.ck-bookmark-actions{display:flex;flex-wrap:wrap}.ck.ck-bookmark-actions .ck-bookmark-actions__preview{flex-basis:100%;margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0;min-width:auto}.ck.ck-bookmark-actions.ck-responsive-form .ck-button{flex-basis:50%;margin-top:var(--ck-spacing-standard)}}:root{--ck-image-processing-highlight-color:#f9fafa;--ck-image-processing-background-color:#e3e5e8}.ck.ck-editor__editable .image.image-processing{position:relative}.ck.ck-editor__editable .image.image-processing:before{animation:ck-image-processing-animation 2s linear infinite;background:linear-gradient(90deg,var(--ck-image-processing-background-color),var(--ck-image-processing-highlight-color),var(--ck-image-processing-background-color));background-size:200% 100%;content:"";height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.ck.ck-editor__editable .image.image-processing img{height:100%}@keyframes ck-image-processing-animation{0%{background-position:200% 0}to{background-position:-200% 0}}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute}.ck-content pre{background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;color:#353535;direction:ltr;font-style:normal;min-width:200px;padding:1em;tab-size:4;text-align:left;white-space:pre-wrap}.ck-content pre code{background:unset;border-radius:0;padding:0}.ck.ck-editor__editable pre{position:relative}.ck.ck-editor__editable pre[data-language]:after{content:attr(data-language);position:absolute}.ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}.ck.ck-menu-bar{border:none;border-bottom:1px solid var(--ck-color-toolbar-border)}.ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}.ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}.ck-find-result{background:var(--ck-color-highlight-background);color:var(--ck-color-text)}.ck-find-result_selected{background:#ff9633}.ck.ck-find-and-replace-form{max-width:100%}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs{display:flex}.ck.ck-find-and-replace-form .ck-find-and-replace-form__actions.ck-find-and-replace-form__inputs .ck-results-counter,.ck.ck-find-and-replace-form .ck-find-and-replace-form__inputs.ck-find-and-replace-form__inputs .ck-results-counter{position:absolute}.ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}.ck.ck-heading_heading1 .ck-button__label{font-size:20px}.ck.ck-heading_heading2 .ck-button__label{font-size:17px}.ck.ck-heading_heading3 .ck-button__label{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}:root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{background-color:transparent;color:var(--ck-highlight-pen-red)}.ck-content .pen-green{background-color:transparent;color:var(--ck-highlight-pen-green)}.ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{background:#dedede;border:0;height:4px;margin:15px 0}.ck-widget.raw-html-embed{display:flow-root;font-style:normal;margin:.9em auto;min-width:15em;position:relative}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{display:flex;flex-direction:column;position:absolute}.ck-widget.raw-html-embed .raw-html-embed__preview{display:flex;overflow:hidden;position:relative}.ck-widget.raw-html-embed .raw-html-embed__preview-content{border-collapse:separate;border-spacing:7px;display:table;margin:auto;position:relative;width:100%}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}:root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base);min-width:calc(76px + var(--ck-spacing-standard));padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large))}.ck-widget.html-object-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.html-object-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-object-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);font-style:normal;font-weight:400;left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);position:absolute;top:0;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.html-object-embed .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck-widget.html-object-embed .html-object-embed__content{pointer-events:none}div.ck-widget.html-object-embed{margin:1em auto}span.ck-widget.html-object-embed{display:inline-block}:root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highlighted-background:#fd0}.ck-content .image>figcaption{background-color:var(--ck-color-image-caption-background);caption-side:bottom;color:var(--ck-color-image-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;word-break:break-word}@media (forced-colors:active){.ck-content .image>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}}@media (prefers-reduced-motion:reduce){.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:none}}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highlighted-background)}to{background-color:var(--ck-color-image-caption-background)}}.ck.ck-image-insert-url{padding:var(--ck-spacing-large) var(--ck-spacing-large) 0;width:400px}.ck.ck-image-insert-url .ck-image-insert-url__action-row{display:grid;grid-template-columns:repeat(2,1fr)}.ck-content img.image_resized{height:auto}.ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}.ck.ck-image-custom-resize-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{display:inline-block}.ck.ck-image-custom-resize-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-image-custom-resize-form{flex-wrap:wrap}.ck.ck-image-custom-resize-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-image-custom-resize-form .ck-button{flex-basis:50%}}:root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image.image-style-block-align-left,.ck-content .image.image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image.image-style-align-left,.ck-content .image.image-style-align-right{clear:none}.ck-content .image.image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image.image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image.image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image.image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image.image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content p+.image.image-style-align-left,.ck-content p+.image.image-style-align-right,.ck-content p+.image.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-bottom:var(--ck-inline-image-style-spacing);margin-top:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}.ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}.ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.ck-image-upload-complete-icon:after{content:"";position:absolute}.ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}.ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;height:auto;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image{z-index:1}.ck.ck-editor__editable .image.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected{z-index:2}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable .image-inline img{height:auto}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}.ck.ck-editor__editable img.image_placeholder{background-size:100% 100%}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{display:block;position:absolute}.ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-form{align-items:flex-start;display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck-editor__editable .ck-list-bogus-paragraph{display:block}.ck.ck-list-styles-list{display:grid}.ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}:root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px;position:relative}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-content[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-content .todo-list .todo-list__label>input:before{transition:none}}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-editor__editable.ck-content .todo-list .todo-list__label>input,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{cursor:pointer}.ck-editor__editable.ck-content .todo-list .todo-list__label>input:hover:before,.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label>span[contenteditable=false]>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:"";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out;width:100%}@media (prefers-reduced-motion:reduce){.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:before{transition:none}}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:"";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-editor__editable.ck-content .todo-list .todo-list__label>span[contenteditable=false]>input[checked]:after{border-color:#fff}.ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox]{position:absolute}.ck-content .media{clear:both;display:block;margin:.9em 0;min-width:15em}.ck-media__wrapper .ck-media__placeholder{align-items:center;display:flex;flex-direction:column}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{display:block;overflow:hidden}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}.ck-vertical-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:"";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck.ck-media-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap;width:400px}.ck.ck-media-form .ck-labeled-field-view{display:inline-block;width:100%}.ck.ck-media-form .ck-label{display:none}.ck.ck-media-form .ck-input{width:100%}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}:root{--ck-mention-list-max-height:300px}.ck.ck-mentions{max-height:var(--ck-mention-list-max-height);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}.ck.ck-mentions>.ck-list__item{flex-shrink:0;overflow:hidden}:root{--ck-color-minimap-tracker-background:208,0%,51%;--ck-color-minimap-iframe-outline:#bfbfbf;--ck-color-minimap-iframe-shadow:rgba(0,0,0,.11);--ck-color-minimap-progress-background:#666}.ck.ck-minimap{background:var(--ck-color-base-background);position:absolute;user-select:none}.ck.ck-minimap,.ck.ck-minimap iframe{height:100%;width:100%}.ck.ck-minimap iframe{border:0;box-shadow:0 2px 5px var(--ck-color-minimap-iframe-shadow);margin:0;outline:1px solid var(--ck-color-minimap-iframe-outline);pointer-events:none;position:relative}.ck.ck-minimap .ck.ck-minimap__position-tracker{background:hsla(var(--ck-color-minimap-tracker-background),.2);position:absolute;top:0;transition:background .1s ease-in-out;width:100%;z-index:1}@media (prefers-reduced-motion:reduce){.ck.ck-minimap .ck.ck-minimap__position-tracker{transition:none}}.ck.ck-minimap .ck.ck-minimap__position-tracker:hover{background:hsla(var(--ck-color-minimap-tracker-background),.3)}.ck.ck-minimap .ck.ck-minimap__position-tracker.ck-minimap__position-tracker_dragging,.ck.ck-minimap .ck.ck-minimap__position-tracker.ck-minimap__position-tracker_dragging:hover{background:hsla(var(--ck-color-minimap-tracker-background),.4)}.ck.ck-minimap .ck.ck-minimap__position-tracker.ck-minimap__position-tracker_dragging:after,.ck.ck-minimap .ck.ck-minimap__position-tracker.ck-minimap__position-tracker_dragging:hover:after{opacity:1}.ck.ck-minimap .ck.ck-minimap__position-tracker:after{background:var(--ck-color-minimap-progress-background);border:1px solid var(--ck-color-base-background);border-radius:3px;color:var(--ck-color-base-background);content:attr(data-progress) "%";font-size:10px;opacity:0;padding:2px 4px;position:absolute;right:5px;top:5px;transition:opacity .1s ease-in-out}@media (prefers-reduced-motion:reduce){.ck.ck-minimap .ck.ck-minimap__position-tracker:after{transition:none}}.ck-content .page-break{align-items:center;clear:both;display:flex;justify-content:center;padding:5px 0;position:relative}.ck-content .page-break:after{border-bottom:2px dashed #c4c4c4;content:"";position:absolute;width:100%}.ck-content .page-break__label{background:#fff;border:1px solid #c4c4c4;border-radius:2px;box-shadow:2px 2px 1px rgba(0,0,0,.15);color:#333;display:block;font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;font-size:.75em;font-weight:700;padding:.3em .6em;position:relative;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1}@media print{.ck-content .page-break{padding:0}.ck-content .page-break:after{display:none}.ck-content :has(+.page-break){margin-bottom:0}}:root{--ck-show-blocks-border-color:#757575}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address{background-image:url("data:image/svg+xml;utf8,ADDRESS");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) address{background-image:url("data:image/svg+xml;utf8,ADDRESS");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside{background-image:url("data:image/svg+xml;utf8,ASIDE");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) aside{background-image:url("data:image/svg+xml;utf8,ASIDE");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote{background-image:url("data:image/svg+xml;utf8,BLOCKQUOTE");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) blockquote{background-image:url("data:image/svg+xml;utf8,BLOCKQUOTE");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details{background-image:url("data:image/svg+xml;utf8,DETAILS");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) details{background-image:url("data:image/svg+xml;utf8,DETAILS");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *){background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *):not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *){background-image:url("data:image/svg+xml;utf8,DIV");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) div:not(.ck-widget,.ck-widget *){background-image:url("data:image/svg+xml;utf8,DIV");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer{background-image:url("data:image/svg+xml;utf8,FOOTER");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) footer{background-image:url("data:image/svg+xml;utf8,FOOTER");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1{background-image:url("data:image/svg+xml;utf8,H1");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h1{background-image:url("data:image/svg+xml;utf8,H1");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2{background-image:url("data:image/svg+xml;utf8,H2");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h2{background-image:url("data:image/svg+xml;utf8,H2");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3{background-image:url("data:image/svg+xml;utf8,H3");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h3{background-image:url("data:image/svg+xml;utf8,H3");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4{background-image:url("data:image/svg+xml;utf8,H4");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h4{background-image:url("data:image/svg+xml;utf8,H4");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5{background-image:url("data:image/svg+xml;utf8,H5");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h5{background-image:url("data:image/svg+xml;utf8,H5");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6{background-image:url("data:image/svg+xml;utf8,H6");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) h6{background-image:url("data:image/svg+xml;utf8,H6");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header{background-image:url("data:image/svg+xml;utf8,HEADER");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) header{background-image:url("data:image/svg+xml;utf8,HEADER");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main{background-image:url("data:image/svg+xml;utf8,MAIN");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) main{background-image:url("data:image/svg+xml;utf8,MAIN");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav{background-image:url("data:image/svg+xml;utf8,NAV");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) nav{background-image:url("data:image/svg+xml;utf8,NAV");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre{background-image:url("data:image/svg+xml;utf8,PRE");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) pre{background-image:url("data:image/svg+xml;utf8,PRE");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol{background-image:url("data:image/svg+xml;utf8,OL");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ol{background-image:url("data:image/svg+xml;utf8,OL");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul{background-image:url("data:image/svg+xml;utf8,UL");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) ul{background-image:url("data:image/svg+xml;utf8,UL");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p{background-image:url("data:image/svg+xml;utf8,P");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) p{background-image:url("data:image/svg+xml;utf8,P");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section{background-image:url("data:image/svg+xml;utf8,SECTION");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) section{background-image:url("data:image/svg+xml;utf8,SECTION");background-position:calc(100% - 1px) 1px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption{background-repeat:no-repeat;padding-top:15px}.ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption:not(.ck-widget_selected):not(.ck-widget:hover){outline:1px dashed var(--ck-show-blocks-border-color)}[dir=ltr] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption{background-image:url("data:image/svg+xml;utf8,FIGCAPTION");background-position:1px 1px}[dir=rtl] .ck.ck-editor__editable.ck-editor__editable_inline.ck-show-blocks:not(.ck-widget) :where(figure.image,figure.table) figcaption{background-image:url("data:image/svg+xml;utf8,FIGCAPTION");background-position:calc(100% - 1px) 1px}.ck-source-editing-area{overflow:hidden;position:relative}.ck-source-editing-area textarea,.ck-source-editing-area:after{border:1px solid transparent;font-family:monospace;font-size:var(--ck-font-size-normal);line-height:var(--ck-line-height-base);margin:0;padding:var(--ck-spacing-large);white-space:pre-wrap}.ck-source-editing-area:after{content:attr(data-value) " ";display:block;visibility:hidden}.ck-source-editing-area textarea{border-color:var(--ck-color-base-border);border-radius:0;box-sizing:border-box;height:100%;outline:none;overflow:hidden;position:absolute;resize:none;width:100%}.ck-rounded-corners .ck-source-editing-area textarea,.ck-source-editing-area textarea.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck-source-editing-area textarea:not([readonly]):focus{border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-character-grid{max-width:100%}.ck.ck-character-grid .ck-character-grid__tiles{display:grid}.ck.ck-character-info{display:flex;justify-content:space-between}.ck.ck-special-characters>.ck-dialog__content>div{display:grid;height:100%;max-width:100%;width:350px;grid-column-gap:0;grid-row-gap:0;grid-template-columns:1fr;grid-template-rows:auto 1fr auto}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories{grid-area:1/1/2/2;padding:var(--ck-spacing-medium) var(--ck-spacing-large)}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view{padding-top:var(--ck-spacing-standard);width:100%}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both;background:var(--ck-color-base-error);color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}@media (prefers-reduced-motion:reduce){.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:none}}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories>.ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories .ck-dropdown{display:block;width:100%}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories .ck-dropdown>button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-categories .ck-dropdown>button>span{width:100%}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-grid{grid-area:2/1/3/2;max-height:200px}.ck.ck-special-characters>.ck-dialog__content>div>.ck-character-info{grid-area:3/1/4/2}:root{--ck-style-panel-columns:3}.ck.ck-style-panel .ck-style-grid{display:grid;grid-template-columns:repeat(var(--ck-style-panel-columns),auto);justify-content:start}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button{display:flex;flex-direction:column;justify-content:space-between}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button .ck-style-grid__button__preview{align-content:center;align-items:center;display:flex;flex-basis:100%;flex-grow:1;justify-content:flex-start}.ck-content .table{display:table;margin:.9em auto}.ck-content .table table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;height:100%;width:100%}.ck-content .table table td,.ck-content .table table th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}.ck-content .table table th{background:rgba(0,0,0,.05);font-weight:700}@media print{.ck-content .table table{height:auto}}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}.ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}.ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:first-of-type{flex-grow:0.57}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:last-of-type{flex-grow:0.43}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar .ck-button{flex-grow:1}.ck.ck-input-color{display:flex;flex-direction:row-reverse;width:100%}.ck.ck-input-color>input.ck.ck-input-text{flex-grow:1;min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button{display:flex}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{overflow:hidden;position:relative}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{display:block;position:absolute}.ck.ck-table-form .ck-form__row.ck-table-form__background-row,.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{align-items:center;flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{align-items:center;display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;position:absolute;transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:"";left:50%;position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translateX(-50%)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-content:baseline;flex-basis:0;flex-wrap:wrap}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}:root{--ck-color-selector-caption-background:#f7f7f7;--ck-color-selector-caption-text:#333;--ck-color-selector-caption-highlighted-background:#fd0}.ck-content .table>figcaption{background-color:var(--ck-color-selector-caption-background);caption-side:top;color:var(--ck-color-selector-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;text-align:center;word-break:break-word}@media (forced-colors:active){.ck-content .table>figcaption{background-color:unset;color:unset}}@media (forced-colors:none){.ck.ck-editor__editable .table>figcaption.table__caption_highlighted{animation:ck-table-caption-highlight .6s ease-out}}.ck.ck-editor__editable .table>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}@keyframes ck-table-caption-highlight{0%{background-color:var(--ck-color-selector-caption-highlighted-background)}to{background-color:var(--ck-color-selector-caption-background)}}:root{--ck-color-selector-column-resizer-hover:var(--ck-color-base-active);--ck-table-column-resizer-width:7px;--ck-table-column-resizer-position-offset:calc(var(--ck-table-column-resizer-width)*-0.5 - 0.5px)}.ck-content .table .ck-table-resized{table-layout:fixed}.ck-content .table table{overflow:hidden}.ck-content .table td,.ck-content .table th{overflow-wrap:break-word;position:relative}.ck.ck-editor__editable .table .ck-table-column-resizer{bottom:0;cursor:col-resize;position:absolute;right:var(--ck-table-column-resizer-position-offset);top:0;user-select:none;width:var(--ck-table-column-resizer-width);z-index:var(--ck-z-default)}.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer,.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer{display:none}.ck.ck-editor__editable .table .ck-table-column-resizer:hover,.ck.ck-editor__editable .table .ck-table-column-resizer__active{background-color:var(--ck-color-selector-column-resizer-hover);bottom:-999999px;opacity:.25;top:-999999px}.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer{left:var(--ck-table-column-resizer-position-offset);right:unset}.ck-hidden{display:none!important}:root{--ck-z-default:1;--ck-z-panel:calc(var(--ck-z-default) + 999);--ck-z-dialog:9999}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-powered-by-font-size:calc(var(--ck-font-size-base)*7.5/13);--ck-powered-by-line-height:calc(var(--ck-font-size-base)*10/13);--ck-powered-by-letter-spacing:calc(var(--ck-font-size-base)*-0.2/13);--ck-powered-by-padding-vertical:2px;--ck-powered-by-padding-horizontal:4px;--ck-powered-by-text-color:#4f4f4f;--ck-powered-by-border-radius:var(--ck-border-radius);--ck-powered-by-background:#fff;--ck-powered-by-border-color:var(--ck-color-focus-border);--ck-powered-by-svg-width:53;--ck-powered-by-svg-height:10;--ck-powered-by-icon-width:calc(var(--ck-font-size-base)*var(--ck-powered-by-svg-width)/13);--ck-powered-by-icon-height:calc(var(--ck-font-size-base)*var(--ck-powered-by-svg-height)/13)}.ck.ck-balloon-panel.ck-powered-by-balloon{--ck-border-radius:var(--ck-powered-by-border-radius);background:var(--ck-powered-by-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by{line-height:var(--ck-powered-by-line-height)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by a{align-items:center;cursor:pointer;display:flex;filter:grayscale(80%);line-height:var(--ck-powered-by-line-height);opacity:.66;padding:var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label{color:var(--ck-powered-by-text-color);cursor:pointer;font-size:var(--ck-powered-by-font-size);font-weight:700;letter-spacing:var(--ck-powered-by-letter-spacing);line-height:normal;margin-right:4px;padding-left:2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon{cursor:pointer;display:block;height:var(--ck-powered-by-icon-height);width:var(--ck-powered-by-icon-width)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a{filter:grayscale(0);opacity:1}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-powered-by-border-color)}:root{--ck-evaluation-badge-font-size:calc(var(--ck-font-size-base)*7.5/13);--ck-evaluation-badge-line-height:calc(var(--ck-font-size-base)*7.5/13);--ck-evaluation-badge-letter-spacing:calc(var(--ck-font-size-base)*-0.2/13);--ck-evaluation-badge-padding-vertical:2px;--ck-evaluation-badge-padding-horizontal:4px;--ck-evaluation-badge-text-color:#4f4f4f;--ck-evaluation-badge-border-radius:var(--ck-border-radius);--ck-evaluation-badge-background:#fff;--ck-evaluation-badge-border-color:var(--ck-color-focus-border)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon{--ck-border-radius:var(--ck-evaluation-badge-border-radius);background:var(--ck-evaluation-badge-background);box-shadow:none;min-height:unset;z-index:calc(var(--ck-z-panel) - 1)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge{line-height:var(--ck-evaluation-badge-line-height);padding:var(--ck-evaluation-badge-padding-vertical) var(--ck-evaluation-badge-padding-horizontal)}.ck.ck-balloon-panel.ck-evaluation-badge-balloon .ck.ck-evaluation-badge .ck-evaluation-badge__label{color:var(--ck-evaluation-badge-text-color);display:block;font-size:var(--ck-evaluation-badge-font-size);font-weight:700;letter-spacing:var(--ck-evaluation-badge-letter-spacing);line-height:normal;padding:0 2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*=position_inside]{border-color:transparent}.ck.ck-balloon-panel.ck-evaluation-badge-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-evaluation-badge-border-color)}.ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}[dir=ltr] .ck.ck-button,[dir=ltr] a.ck.ck-button{justify-content:left}[dir=rtl] .ck.ck-button,[dir=rtl] a.ck.ck-button{justify-content:right}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}.ck.ck-list-item-button{border-radius:0;min-height:unset;width:100%}[dir=ltr] .ck.ck-list-item-button{text-align:left}[dir=rtl] .ck.ck-list-item-button{text-align:right}[dir=ltr] .ck.ck-list-item-button.ck-list-item-button_toggleable{padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-list-item-button.ck-list-item-button_toggleable{padding-right:var(--ck-spacing-small)}.ck.ck-list-item-button .ck-list-item-button__check-holder{display:inline-flex;height:.9em;width:.9em}[dir=ltr] .ck.ck-list-item-button .ck-list-item-button__check-holder{margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-list-item-button .ck-list-item-button__check-holder{margin-left:var(--ck-spacing-small)}.ck.ck-list-item-button .ck-list-item-button__check-icon{height:100%}.ck.ck-collapsible.ck-collapsible_collapsed>.ck-collapsible__children{display:none}.ck.ck-color-grid{display:grid}.color-picker-hex-input{width:max-content}.color-picker-hex-input .ck.ck-input{min-width:unset}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between;margin:var(--ck-spacing-large) 0 0;width:unset}.ck.ck-color-picker__row .ck.ck-labeled-field-view{padding-top:unset}.ck.ck-color-picker__row .ck.ck-input-text{width:unset}.ck.ck-color-picker__row .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,.ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{align-items:center;display:flex}[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__color-picker,[dir=rtl] .ck.ck-color-selector .ck-color-grids-fragment .ck-button.ck-color-selector__remove-color{justify-content:flex-start}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar{display:flex;flex-direction:row;justify-content:space-around}.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-cancel,.ck.ck-color-selector .ck-color-picker-fragment .ck.ck-color-selector_action-bar .ck-button-save{flex:1}.ck.ck-dialog .ck.ck-dialog__actions{display:flex;justify-content:flex-end}.ck.ck-dialog-overlay{bottom:0;left:0;overscroll-behavior:none;position:fixed;right:0;top:0;user-select:none}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent{animation:none;background:none;pointer-events:none}.ck.ck-dialog{overscroll-behavior:none;position:absolute;width:fit-content}.ck.ck-dialog .ck.ck-form__header{flex-shrink:0}.ck.ck-dialog:not(.ck-dialog_modal) .ck.ck-form__header .ck-form__header__label{cursor:grab}.ck.ck-dialog-overlay.ck-dialog-overlay__transparent .ck.ck-dialog{pointer-events:all}:root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-panel) + 1)}.ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}:root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-dropdown-menu-list__nested-menu__button>.ck-dropdown-menu-list__nested-menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-balloon-panel.ck-dropdown-menu__nested-menu__panel{max-height:314px;overflow-y:auto;position:absolute;z-index:calc(var(--ck-z-panel) + 1)}.ck.ck-dropdown-menu-list__nested-menu{display:block}.ck.ck-aria-live-announcer{left:-10000px;position:absolute;top:-10000px}.ck.ck-aria-live-region-list{list-style-type:none}.ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__header h2.ck-form__header__label{flex-grow:1}.ck.ck-icon{vertical-align:middle}.ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}.ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}:root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-panel)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}.ck .ck-balloon-rotator__navigation{align-items:center;display:flex;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-panel) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-autocomplete{position:relative}.ck.ck-autocomplete>.ck-search__results{position:absolute;z-index:var(--ck-z-panel)}.ck.ck-autocomplete>.ck-search__results.ck-search__results_n{bottom:100%}.ck.ck-autocomplete>.ck-search__results.ck-search__results_s{bottom:auto;top:100%}.ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{position:absolute;top:50%;transform:translateY(-50%)}[dir=ltr] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{left:var(--ck-spacing-medium)}[dir=rtl] .ck.ck-search>.ck-labeled-field-view>.ck-labeled-field-view__input-wrapper>.ck-icon{right:var(--ck-spacing-medium)}.ck.ck-search>.ck-labeled-field-view .ck-search__reset{position:absolute;top:50%;transform:translateY(-50%)}.ck.ck-search>.ck-search__results>.ck-search__info>span:first-child{display:block}.ck.ck-search>.ck-search__results>.ck-search__info:not(.ck-hidden)~*{display:none}.ck.ck-highlighted-text mark{background:var(--ck-color-highlight-background);font-size:inherit;font-weight:inherit;line-height:inherit;vertical-align:initial}.ck.ck-balloon-panel.ck-tooltip{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;z-index:calc(var(--ck-z-dialog) + 100)}:root{--ck-toolbar-spinner-size:18px}.ck.ck-spinner-container{display:block;position:relative}.ck.ck-spinner{left:0;margin:0 auto;position:absolute;right:0;top:50%;transform:translateY(-50%);z-index:1}.ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}.ck.ck-menu-bar__menu>.ck-menu-bar__menu__button>.ck-menu-bar__menu__button__arrow{pointer-events:none;z-index:var(--ck-z-default)}:root{--ck-menu-bar-menu-max-width:75vw;--ck-menu-bar-nested-menu-horizontal-offset:5px}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel{max-width:var(--ck-menu-bar-menu-max-width);position:absolute;z-index:var(--ck-z-panel)}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw{bottom:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{bottom:auto;top:100%}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ne,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_se{left:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_nw,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_sw{right:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{left:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_es{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_en{bottom:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn,.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{right:calc(100% - var(--ck-menu-bar-nested-menu-horizontal-offset))}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_ws{top:0}.ck.ck-menu-bar__menu>.ck.ck-menu-bar__menu__panel.ck-menu-bar__menu__panel_position_wn{bottom:0}.ck.ck-menu-bar__menu{display:block;position:relative}:root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}.ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}.ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none} \ No newline at end of file diff --git a/static/js/ckeditor5/build/ckeditor.js b/static/js/ckeditor5/build/ckeditor.js index 92d7f41f7..72810c067 100644 --- a/static/js/ckeditor5/build/ckeditor.js +++ b/static/js/ckeditor5/build/ckeditor.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ClassicEditor=t():e.ClassicEditor=t()}(self,(()=>(()=>{var e,t,i={659:(e,t,i)=>{const n=i(156),r={};for(const e of Object.keys(n))r[n[e]]=e;const s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=s;for(const e of Object.keys(s)){if(!("channels"in s[e]))throw new Error("missing channels property: "+e);if(!("labels"in s[e]))throw new Error("missing channel labels property: "+e);if(s[e].labels.length!==s[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:i}=s[e];delete s[e].channels,delete s[e].labels,Object.defineProperty(s[e],"channels",{value:t}),Object.defineProperty(s[e],"labels",{value:i})}s.rgb.hsl=function(e){const t=e[0]/255,i=e[1]/255,n=e[2]/255,r=Math.min(t,i,n),s=Math.max(t,i,n),o=s-r;let a,l;s===r?a=0:t===s?a=(i-n)/o:i===s?a=2+(n-t)/o:n===s&&(a=4+(t-i)/o),a=Math.min(60*a,360),a<0&&(a+=360);const c=(r+s)/2;return l=s===r?0:c<=.5?o/(s+r):o/(2-s-r),[a,100*l,100*c]},s.rgb.hsv=function(e){let t,i,n,r,s;const o=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(o,a,l),h=c-Math.min(o,a,l),d=function(e){return(c-e)/6/h+.5};return 0===h?(r=0,s=0):(s=h/c,t=d(o),i=d(a),n=d(l),o===c?r=n-i:a===c?r=1/3+t-n:l===c&&(r=2/3+i-t),r<0?r+=1:r>1&&(r-=1)),[360*r,100*s,100*c]},s.rgb.hwb=function(e){const t=e[0],i=e[1];let n=e[2];const r=s.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(i,n));return n=1-1/255*Math.max(t,Math.max(i,n)),[r,100*o,100*n]},s.rgb.cmyk=function(e){const t=e[0]/255,i=e[1]/255,n=e[2]/255,r=Math.min(1-t,1-i,1-n);return[100*((1-t-r)/(1-r)||0),100*((1-i-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*r]},s.rgb.keyword=function(e){const t=r[e];if(t)return t;let i,s=1/0;for(const t of Object.keys(n)){const r=n[t],l=(a=r,((o=e)[0]-a[0])**2+(o[1]-a[1])**2+(o[2]-a[2])**2);l.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;return[100*(.4124*t+.3576*i+.1805*n),100*(.2126*t+.7152*i+.0722*n),100*(.0193*t+.1192*i+.9505*n)]},s.rgb.lab=function(e){const t=s.rgb.xyz(e);let i=t[0],n=t[1],r=t[2];i/=95.047,n/=100,r/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(i-n),200*(n-r)]},s.hsl.rgb=function(e){const t=e[0]/360,i=e[1]/100,n=e[2]/100;let r,s,o;if(0===i)return o=255*n,[o,o,o];r=n<.5?n*(1+i):n+i-n*i;const a=2*n-r,l=[0,0,0];for(let e=0;e<3;e++)s=t+1/3*-(e-1),s<0&&s++,s>1&&s--,o=6*s<1?a+6*(r-a)*s:2*s<1?r:3*s<2?a+(r-a)*(2/3-s)*6:a,l[e]=255*o;return l},s.hsl.hsv=function(e){const t=e[0];let i=e[1]/100,n=e[2]/100,r=i;const s=Math.max(n,.01);n*=2,i*=n<=1?n:2-n,r*=s<=1?s:2-s;return[t,100*(0===n?2*r/(s+r):2*i/(n+i)),100*((n+i)/2)]},s.hsv.rgb=function(e){const t=e[0]/60,i=e[1]/100;let n=e[2]/100;const r=Math.floor(t)%6,s=t-Math.floor(t),o=255*n*(1-i),a=255*n*(1-i*s),l=255*n*(1-i*(1-s));switch(n*=255,r){case 0:return[n,l,o];case 1:return[a,n,o];case 2:return[o,n,l];case 3:return[o,a,n];case 4:return[l,o,n];case 5:return[n,o,a]}},s.hsv.hsl=function(e){const t=e[0],i=e[1]/100,n=e[2]/100,r=Math.max(n,.01);let s,o;o=(2-i)*n;const a=(2-i)*r;return s=i*r,s/=a<=1?a:2-a,s=s||0,o/=2,[t,100*s,100*o]},s.hwb.rgb=function(e){const t=e[0]/360;let i=e[1]/100,n=e[2]/100;const r=i+n;let s;r>1&&(i/=r,n/=r);const o=Math.floor(6*t),a=1-n;s=6*t-o,1&o&&(s=1-s);const l=i+s*(a-i);let c,h,d;switch(o){default:case 6:case 0:c=a,h=l,d=i;break;case 1:c=l,h=a,d=i;break;case 2:c=i,h=a,d=l;break;case 3:c=i,h=l,d=a;break;case 4:c=l,h=i,d=a;break;case 5:c=a,h=i,d=l}return[255*c,255*h,255*d]},s.cmyk.rgb=function(e){const t=e[0]/100,i=e[1]/100,n=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},s.xyz.rgb=function(e){const t=e[0]/100,i=e[1]/100,n=e[2]/100;let r,s,o;return r=3.2406*t+-1.5372*i+-.4986*n,s=-.9689*t+1.8758*i+.0415*n,o=.0557*t+-.204*i+1.057*n,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[255*r,255*s,255*o]},s.xyz.lab=function(e){let t=e[0],i=e[1],n=e[2];t/=95.047,i/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;return[116*i-16,500*(t-i),200*(i-n)]},s.lab.xyz=function(e){let t,i,n;i=(e[0]+16)/116,t=e[1]/500+i,n=i-e[2]/200;const r=i**3,s=t**3,o=n**3;return i=r>.008856?r:(i-16/116)/7.787,t=s>.008856?s:(t-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,t*=95.047,i*=100,n*=108.883,[t,i,n]},s.lab.lch=function(e){const t=e[0],i=e[1],n=e[2];let r;r=360*Math.atan2(n,i)/2/Math.PI,r<0&&(r+=360);return[t,Math.sqrt(i*i+n*n),r]},s.lch.lab=function(e){const t=e[0],i=e[1],n=e[2]/360*2*Math.PI;return[t,i*Math.cos(n),i*Math.sin(n)]},s.rgb.ansi16=function(e,t=null){const[i,n,r]=e;let o=null===t?s.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(i/255));return 2===o&&(a+=60),a},s.hsv.ansi16=function(e){return s.rgb.ansi16(s.hsv.rgb(e),e[2])},s.rgb.ansi256=function(e){const t=e[0],i=e[1],n=e[2];if(t===i&&i===n)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5)},s.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const i=.5*(1+~~(e>50));return[(1&t)*i*255,(t>>1&1)*i*255,(t>>2&1)*i*255]},s.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},s.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},s.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let i=t[0];3===t[0].length&&(i=i.split("").map((e=>e+e)).join(""));const n=parseInt(i,16);return[n>>16&255,n>>8&255,255&n]},s.rgb.hcg=function(e){const t=e[0]/255,i=e[1]/255,n=e[2]/255,r=Math.max(Math.max(t,i),n),s=Math.min(Math.min(t,i),n),o=r-s;let a,l;return a=o<1?s/(1-o):0,l=o<=0?0:r===t?(i-n)/o%6:r===i?2+(n-t)/o:4+(t-i)/o,l/=6,l%=1,[360*l,100*o,100*a]},s.hsl.hcg=function(e){const t=e[1]/100,i=e[2]/100,n=i<.5?2*t*i:2*t*(1-i);let r=0;return n<1&&(r=(i-.5*n)/(1-n)),[e[0],100*n,100*r]},s.hsv.hcg=function(e){const t=e[1]/100,i=e[2]/100,n=t*i;let r=0;return n<1&&(r=(i-n)/(1-n)),[e[0],100*n,100*r]},s.hcg.rgb=function(e){const t=e[0]/360,i=e[1]/100,n=e[2]/100;if(0===i)return[255*n,255*n,255*n];const r=[0,0,0],s=t%1*6,o=s%1,a=1-o;let l=0;switch(Math.floor(s)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return l=(1-i)*n,[255*(i*r[0]+l),255*(i*r[1]+l),255*(i*r[2]+l)]},s.hcg.hsv=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);let n=0;return i>0&&(n=t/i),[e[0],100*n,100*i]},s.hcg.hsl=function(e){const t=e[1]/100,i=e[2]/100*(1-t)+.5*t;let n=0;return i>0&&i<.5?n=t/(2*i):i>=.5&&i<1&&(n=t/(2*(1-i))),[e[0],100*n,100*i]},s.hcg.hwb=function(e){const t=e[1]/100,i=t+e[2]/100*(1-t);return[e[0],100*(i-t),100*(1-i)]},s.hwb.hcg=function(e){const t=e[1]/100,i=1-e[2]/100,n=i-t;let r=0;return n<1&&(r=(i-n)/(1-n)),[e[0],100*n,100*r]},s.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},s.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},s.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},s.gray.hsl=function(e){return[0,0,e[0]]},s.gray.hsv=s.gray.hsl,s.gray.hwb=function(e){return[0,100,e[0]]},s.gray.cmyk=function(e){return[0,0,0,e[0]]},s.gray.lab=function(e){return[e[0],0,0]},s.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),i=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(i.length)+i},s.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},734:(e,t,i)=>{const n=i(659),r=i(507),s={};Object.keys(n).forEach((e=>{s[e]={},Object.defineProperty(s[e],"channels",{value:n[e].channels}),Object.defineProperty(s[e],"labels",{value:n[e].labels});const t=r(e);Object.keys(t).forEach((i=>{const n=t[i];s[e][i]=function(e){const t=function(...t){const i=t[0];if(null==i)return i;i.length>1&&(t=i);const n=e(t);if("object"==typeof n)for(let e=n.length,t=0;t1&&(t=i),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))})),e.exports=s},507:(e,t,i)=>{const n=i(659);function r(e){const t=function(){const e={},t=Object.keys(n);for(let i=t.length,n=0;n{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return i[e](s,s.exports,r),s.exports}t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(i,n){if(1&n&&(i=this(i)),8&n)return i;if("object"==typeof i&&i){if(4&n&&i.__esModule)return i;if(16&n&&"function"==typeof i.then)return i}var s=Object.create(null);r.r(s);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&n&&i;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>i[e]));return o.default=()=>i,r.d(s,o),s},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return(()=>{"use strict";r.d(s,{default:()=>cR});const e=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const t="object"==typeof global&&global&&global.Object===Object&&global;var i="object"==typeof self&&self&&self.Object===Object&&self;const n=t||i||Function("return this")();const o=n.Symbol;var a=Object.prototype,l=a.hasOwnProperty,c=a.toString,h=o?o.toStringTag:void 0;const d=function(e){var t=l.call(e,h),i=e[h];try{e[h]=void 0;var n=!0}catch(e){}var r=c.call(e);return n&&(t?e[h]=i:delete e[h]),r};var u=Object.prototype.toString;const m=function(e){return u.call(e)};var g=o?o.toStringTag:void 0;const f=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":g&&g in Object(e)?d(e):m(e)};const p=Array.isArray;const w=function(e){return null!=e&&"object"==typeof e};const b=function(e){return"string"==typeof e||!p(e)&&w(e)&&"[object String]"==f(e)};const _=function(e,t){return function(i){return e(t(i))}};const v=_(Object.getPrototypeOf,Object);var y=Function.prototype,k=Object.prototype,C=y.toString,x=k.hasOwnProperty,A=C.call(Object);const T=function(e){if(!w(e)||"[object Object]"!=f(e))return!1;var t=v(e);if(null===t)return!0;var i=x.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&C.call(i)==A};const E=function(){this.__data__=[],this.size=0};const S=function(e,t){return e===t||e!=e&&t!=t};const P=function(e,t){for(var i=e.length;i--;)if(S(e[i][0],t))return i;return-1};var I=Array.prototype.splice;const V=function(e){var t=this.__data__,i=P(t,e);return!(i<0)&&(i==t.length-1?t.pop():I.call(t,i,1),--this.size,!0)};const R=function(e){var t=this.__data__,i=P(t,e);return i<0?void 0:t[i][1]};const B=function(e){return P(this.__data__,e)>-1};const O=function(e,t){var i=this.__data__,n=P(i,e);return n<0?(++this.size,i.push([e,t])):i[n][1]=t,this};function F(e){var t=-1,i=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991};var qe={};qe["[object Float32Array]"]=qe["[object Float64Array]"]=qe["[object Int8Array]"]=qe["[object Int16Array]"]=qe["[object Int32Array]"]=qe["[object Uint8Array]"]=qe["[object Uint8ClampedArray]"]=qe["[object Uint16Array]"]=qe["[object Uint32Array]"]=!0,qe["[object Arguments]"]=qe["[object Array]"]=qe["[object ArrayBuffer]"]=qe["[object Boolean]"]=qe["[object DataView]"]=qe["[object Date]"]=qe["[object Error]"]=qe["[object Function]"]=qe["[object Map]"]=qe["[object Number]"]=qe["[object Object]"]=qe["[object RegExp]"]=qe["[object Set]"]=qe["[object String]"]=qe["[object WeakMap]"]=!1;const Ge=function(e){return w(e)&&je(e.length)&&!!qe[f(e)]};const Ke=function(e){return function(t){return e(t)}};var Ze="object"==typeof exports&&exports&&!exports.nodeType&&exports,Je=Ze&&"object"==typeof module&&module&&!module.nodeType&&module,Qe=Je&&Je.exports===Ze&&t.process;const Ye=function(){try{var e=Je&&Je.require&&Je.require("util").types;return e||Qe&&Qe.binding&&Qe.binding("util")}catch(e){}}();var Xe=Ye&&Ye.isTypedArray;const et=Xe?Ke(Xe):Ge;var tt=Object.prototype.hasOwnProperty;const it=function(e,t){var i=p(e),n=!i&&Ne(e),r=!i&&!n&&We(e),s=!i&&!n&&!r&&et(e),o=i||n||r||s,a=o?Re(e.length,String):[],l=a.length;for(var c in e)!t&&!tt.call(e,c)||o&&("length"==c||r&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ue(c,l))||a.push(c);return a};var nt=Object.prototype;const rt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||nt)};const st=_(Object.keys,Object);var ot=Object.prototype.hasOwnProperty;const at=function(e){if(!rt(e))return st(e);var t=[];for(var i in Object(e))ot.call(e,i)&&"constructor"!=i&&t.push(i);return t};const lt=function(e){return null!=e&&je(e.length)&&!H(e)};const ct=function(e){return lt(e)?it(e):at(e)};const ht=function(e,t){return e&&Ve(t,ct(t),e)};const dt=function(e){var t=[];if(null!=e)for(var i in Object(e))t.push(i);return t};var ut=Object.prototype.hasOwnProperty;const mt=function(t){if(!e(t))return dt(t);var i=rt(t),n=[];for(var r in t)("constructor"!=r||!i&&ut.call(t,r))&&n.push(r);return n};const gt=function(e){return lt(e)?it(e,!0):mt(e)};const ft=function(e,t){return e&&Ve(t,gt(t),e)};var pt="object"==typeof exports&&exports&&!exports.nodeType&&exports,wt=pt&&"object"==typeof module&&module&&!module.nodeType&&module,bt=wt&&wt.exports===pt?n.Buffer:void 0,_t=bt?bt.allocUnsafe:void 0;const vt=function(e,t){if(t)return e.slice();var i=e.length,n=_t?_t(i):new e.constructor(i);return e.copy(n),n};const yt=function(e,t){var i=-1,n=e.length;for(t||(t=Array(n));++i0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}};const Di=Li(Mi);const zi=function(e,t){return Di(Oi(e,t,Vi),e+"")};const Hi=function(t,i,n){if(!e(n))return!1;var r=typeof i;return!!("number"==r?lt(n)&&Ue(i,n.length):"string"==r&&i in n)&&S(n[i],t)};const Wi=function(e){return zi((function(t,i){var n=-1,r=i.length,s=r>1?i[r-1]:void 0,o=r>2?i[2]:void 0;for(s=e.length>3&&"function"==typeof s?(r--,s):void 0,o&&Hi(i[0],i[1],o)&&(s=r<3?void 0:s,r=1),t=Object(t);++n-1}function Ji(e){return e.indexOf("windows")>-1}function Qi(e){return!!e.match(/gecko\/\d+/)}function Yi(e){return e.indexOf(" applewebkit/")>-1&&-1===e.indexOf("chrome")}function Xi(e){return!!e.match(/iphone|ipad/i)||Zi(e)&&navigator.maxTouchPoints>0}function en(e){return e.indexOf("android")>-1}function tn(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function nn(){let e=!1;try{e=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(e){}return e}function rn(e,t,i,n){i=i||function(e,t){return e===t};const r=Array.isArray(e)?e:Array.prototype.slice.call(e),s=Array.isArray(t)?t:Array.prototype.slice.call(t),o=function(e,t,i){const n=sn(e,t,i);if(-1===n)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const r=on(e,n),s=on(t,n),o=sn(r,s,i),a=e.length-o,l=t.length-o;return{firstIndex:n,lastIndexOld:a,lastIndexNew:l}}(r,s,i),a=n?function(e,t){const{firstIndex:i,lastIndexOld:n,lastIndexNew:r}=e;if(-1===i)return Array(t).fill("equal");let s=[];i>0&&(s=s.concat(Array(i).fill("equal")));r-i>0&&(s=s.concat(Array(r-i).fill("insert")));n-i>0&&(s=s.concat(Array(n-i).fill("delete")));r0&&i.push({index:n,type:"insert",values:e.slice(n,s)});r-n>0&&i.push({index:n+(s-n),type:"delete",howMany:r-n});return i}(s,o);return a}function sn(e,t,i){for(let n=0;n200||r>200||n+r>300)return an.fastDiff(e,t,i,!0);let s,o;if(rc?-1:1;h[n+u]&&(h[n]=h[n+u].slice(0)),h[n]||(h[n]=[]),h[n].push(r>c?s:o);let m=Math.max(r,c),g=m-n;for(;gc;m--)d[m]=u(m);d[c]=u(c),g++}while(d[c]!==l);return h[c].slice(1)}an.fastDiff=rn;class ln{source;name;path;stop;off;return;constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=function e(){e.called=!0},this.off=function e(){e.called=!0}}}const cn=new Array(256).fill("").map(((e,t)=>("0"+t.toString(16)).slice(-2)));function hn(){const[e,t,i,n]=crypto.getRandomValues(new Uint32Array(4));return"e"+cn[255&e]+cn[e>>8&255]+cn[e>>16&255]+cn[e>>24&255]+cn[255&t]+cn[t>>8&255]+cn[t>>16&255]+cn[t>>24&255]+cn[255&i]+cn[i>>8&255]+cn[i>>16&255]+cn[i>>24&255]+cn[255&n]+cn[n>>8&255]+cn[n>>16&255]+cn[n>>24&255]}const dn={get(e="normal"){return"number"!=typeof e?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function un(e,t){const i=dn.get(t.priority);let n=0,r=e.length;for(;n>1;dn.get(e[t].priority){if("object"==typeof t&&null!==t){if(i.has(t))return`[object ${t.constructor.name}]`;i.add(t)}return t},r=t?` ${JSON.stringify(t,n)}`:"",s=wn(e);return e+r+s}(e,i)),this.name="CKEditorError",this.context=t,this.data=i}is(e){return"CKEditorError"===e}static rethrowUnexpectedError(e,t){if(e.is&&e.is("CKEditorError"))throw e;const i=new gn(e.message,t);throw i.stack=e.stack,i}}function fn(e,t){console.warn(...bn(e,t))}function pn(e,t){console.error(...bn(e,t))}function wn(e){return`\nRead more: ${mn}#error-${e}`}function bn(e,t){const i=wn(e);return t?[e,t,i]:[e,i]}const _n=new Date(2024,11,2);if(globalThis.CKEDITOR_VERSION)throw new gn("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION="44.0.0";const vn=Symbol("listeningTo"),yn=Symbol("emitterId"),kn=Symbol("delegations"),Cn=xn(Object);function xn(e){if(!e)return Cn;return class extends e{on(e,t,i){this.listenTo(this,e,t,i)}once(e,t,i){let n=!1;this.listenTo(this,e,((e,...i)=>{n||(n=!0,e.off(),t.call(this,e,...i))}),i)}off(e,t){this.stopListening(this,e,t)}listenTo(e,t,i,n={}){let r,s;this[vn]||(this[vn]={});const o=this[vn];Tn(e)||An(e);const a=Tn(e);(r=o[a])||(r=o[a]={emitter:e,callbacks:{}}),(s=r.callbacks[t])||(s=r.callbacks[t]=[]),s.push(i),function(e,t,i,n,r){t._addEventListener?t._addEventListener(i,n,r):e._addEventListener.call(t,i,n,r)}(this,e,t,i,n)}stopListening(e,t,i){const n=this[vn];let r=e&&Tn(e);const s=n&&r?n[r]:void 0,o=s&&t?s.callbacks[t]:void 0;if(!(!n||e&&!s||t&&!o))if(i){Vn(this,e,t,i);-1!==o.indexOf(i)&&(1===o.length?delete s.callbacks[t]:Vn(this,e,t,i))}else if(o){for(;i=o.pop();)Vn(this,e,t,i);delete s.callbacks[t]}else if(s){for(t in s.callbacks)this.stopListening(e,t);delete n[r]}else{for(r in n)this.stopListening(n[r].emitter);delete this[vn]}}fire(e,...t){try{const i=e instanceof ln?e:new ln(this,e),n=i.name;let r=Pn(this,n);if(i.path.push(this),r){const e=[i,...t];r=Array.from(r);for(let t=0;t{this[kn]||(this[kn]=new Map),e.forEach((e=>{const n=this[kn].get(e);n?n.set(t,i):this[kn].set(e,new Map([[t,i]]))}))}}}stopDelegating(e,t){if(this[kn])if(e)if(t){const i=this[kn].get(e);i&&i.delete(t)}else this[kn].delete(e);else this[kn].clear()}_addEventListener(e,t,i){!function(e,t){const i=En(e);if(i[t])return;let n=t,r=null;const s=[];for(;""!==n&&!i[n];)i[n]={callbacks:[],childEvents:[]},s.push(i[n]),r&&i[n].childEvents.push(r),r=n,n=n.substr(0,n.lastIndexOf(":"));if(""!==n){for(const e of s)e.callbacks=i[n].callbacks.slice();i[n].childEvents.push(r)}}(this,e);const n=Sn(this,e),r={callback:t,priority:dn.get(i.priority)};for(const e of n)un(e,r)}_removeEventListener(e,t){const i=Sn(this,e);for(const e of i)for(let i=0;i-1?Pn(e,t.substr(0,t.lastIndexOf(":"))):null}function In(e,t,i){for(let[n,r]of e){r?"function"==typeof r&&(r=r(t.name)):r=t.name;const e=new ln(t.source,r);e.path=[...t.path],n.fire(e,...i)}}function Vn(e,t,i,n){t._removeEventListener?t._removeEventListener(i,n):e._removeEventListener.call(t,i,n)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{xn[e]=Cn.prototype[e]}));const Rn=Symbol("observableProperties"),Bn=Symbol("boundObservables"),On=Symbol("boundProperties"),Fn=Symbol("decoratedMethods"),Mn=Symbol("decoratedOriginal"),Nn=Ln(xn());function Ln(t){if(!t)return Nn;return class extends t{set(t,i){if(e(t))return void Object.keys(t).forEach((e=>{this.set(e,t[e])}),this);Dn(this);const n=this[Rn];if(t in this&&!n.has(t))throw new gn("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>n.get(t),set(e){const i=n.get(t);let r=this.fire(`set:${t}`,t,e,i);void 0===r&&(r=e),i===r&&n.has(t)||(n.set(t,r),this.fire(`change:${t}`,t,r,i))}}),this[t]=i}bind(...e){if(!e.length||!Wn(e))throw new gn("observable-bind-wrong-properties",this);if(new Set(e).size!==e.length)throw new gn("observable-bind-duplicate-properties",this);Dn(this);const t=this[On];e.forEach((e=>{if(t.has(e))throw new gn("observable-bind-rebind",this)}));const i=new Map;return e.forEach((e=>{const n={property:e,to:[]};t.set(e,n),i.set(e,n)})),{to:zn,toMany:Hn,_observable:this,_bindProperties:e,_to:[],_bindings:i}}unbind(...e){if(!this[Rn])return;const t=this[On],i=this[Bn];if(e.length){if(!Wn(e))throw new gn("observable-unbind-wrong-properties",this);e.forEach((e=>{const n=t.get(e);n&&(n.to.forEach((([e,t])=>{const r=i.get(e),s=r[t];s.delete(n),s.size||delete r[t],Object.keys(r).length||(i.delete(e),this.stopListening(e,"change"))})),t.delete(e))}))}else i.forEach(((e,t)=>{this.stopListening(t,"change")})),i.clear(),t.clear()}decorate(e){Dn(this);const t=this[e];if(!t)throw new gn("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:e});this.on(e,((e,i)=>{e.return=t.apply(this,i)})),this[e]=function(...t){return this.fire(e,t)},this[e][Mn]=t,this[Fn]||(this[Fn]=[]),this[Fn].push(e)}stopListening(e,t,i){if(!e&&this[Fn]){for(const e of this[Fn])this[e]=this[e][Mn];delete this[Fn]}super.stopListening(e,t,i)}[Rn];[Fn];[On];[Bn]}}function Dn(e){e[Rn]||(Object.defineProperty(e,Rn,{value:new Map}),Object.defineProperty(e,Bn,{value:new Map}),Object.defineProperty(e,On,{value:new Map}))}function zn(...e){const t=function(...e){if(!e.length)throw new gn("observable-bind-to-parse-error",null);const t={to:[]};let i;"function"==typeof e[e.length-1]&&(t.callback=e.pop());return e.forEach((e=>{if("string"==typeof e)i.properties.push(e);else{if("object"!=typeof e)throw new gn("observable-bind-to-parse-error",null);i={observable:e,properties:[]},t.to.push(i)}})),t}(...e),i=Array.from(this._bindings.keys()),n=i.length;if(!t.callback&&t.to.length>1)throw new gn("observable-bind-to-no-callback",this);if(n>1&&t.callback)throw new gn("observable-bind-to-extra-callback",this);var r;t.to.forEach((e=>{if(e.properties.length&&e.properties.length!==n)throw new gn("observable-bind-to-properties-length",this);e.properties.length||(e.properties=this._bindProperties)})),this._to=t.to,t.callback&&(this._bindings.get(i[0]).callback=t.callback),r=this._observable,this._to.forEach((e=>{const t=r[Bn];let i;t.get(e.observable)||r.listenTo(e.observable,"change",((n,s)=>{i=t.get(e.observable)[s],i&&i.forEach((e=>{$n(r,e.property)}))}))})),function(e){let t;e._bindings.forEach(((i,n)=>{e._to.forEach((r=>{t=r.properties[i.callback?0:e._bindProperties.indexOf(n)],i.to.push([r.observable,t]),function(e,t,i,n){const r=e[Bn],s=r.get(i),o=s||{};o[n]||(o[n]=new Set);o[n].add(t),s||r.set(i,o)}(e._observable,i,r.observable,t)}))}))}(this),this._bindProperties.forEach((e=>{$n(this._observable,e)}))}function Hn(e,t,i){if(this._bindings.size>1)throw new gn("observable-bind-to-many-not-one-binding",this);this.to(...function(e,t){const i=e.map((e=>[e,t]));return Array.prototype.concat.apply([],i)}(e,t),i)}function Wn(e){return e.every((e=>"string"==typeof e))}function $n(e,t){const i=e[On].get(t);let n;i.callback?n=i.callback.apply(e,i.to.map((e=>e[0][e[1]]))):(n=i.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=n:e.set(t,n)}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{Ln[e]=Nn.prototype[e]}));class Un{_replacedElements;constructor(){this._replacedElements=[]}replace(e,t){this._replacedElements.push({element:e,newElement:t}),e.style.display="none",t&&e.parentNode.insertBefore(t,e.nextSibling)}restore(){this._replacedElements.forEach((({element:e,newElement:t})=>{e.style.display="",t&&t.remove()})),this._replacedElements=[]}}function jn(e){let t=0;for(const i of e)t++;return t}function qn(e,t){const i=Math.min(e.length,t.length);for(let n=0;n{this._setToTarget(e,n,t[n],i)}))}}function Jn(e){return ki(e,Qn)}function Qn(e){return Ci(e)||"function"==typeof e?e:void 0}function Yn(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}function Xn(e){const t=Object.prototype.toString.apply(e);return"[object Window]"==t||"[object global]"==t}const er=tr(xn());function tr(e){if(!e)return er;return class extends e{listenTo(e,t,i,n={}){if(Yn(e)||Xn(e)){const r={capture:!!n.useCapture,passive:!!n.usePassive},s=this._getProxyEmitter(e,r)||new ir(e,r);this.listenTo(s,t,i,n)}else super.listenTo(e,t,i,n)}stopListening(e,t,i){if(Yn(e)||Xn(e)){const n=this._getAllProxyEmitters(e);for(const e of n)this.stopListening(e,t,i)}else super.stopListening(e,t,i)}_getProxyEmitter(e,t){return function(e,t){const i=e[vn];return i&&i[t]?i[t].emitter:null}(this,nr(e,t))}_getAllProxyEmitters(e){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map((t=>this._getProxyEmitter(e,t))).filter((e=>!!e))}}}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((e=>{tr[e]=er.prototype[e]}));class ir extends(xn()){_domNode;_options;constructor(e,t){super(),An(this,nr(e,t)),this._domNode=e,this._options=t}_domListeners;attach(e){if(this._domListeners&&this._domListeners[e])return;const t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;!this._domListeners[e]||(t=this._events[e])&&t.callbacks.length||this._domListeners[e].removeListener()}_addEventListener(e,t,i){this.attach(e),xn().prototype._addEventListener.call(this,e,t,i)}_removeEventListener(e,t){xn().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){const t=t=>{this.fire(e,t)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}}function nr(e,t){let i=function(e){return e["data-ck-expando"]||(e["data-ck-expando"]=hn())}(e);for(const e of Object.keys(t).sort())t[e]&&(i+="-"+e);return i}function rr(e){const t=[];let i=e;for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)t.unshift(i),i=i.parentNode;return t}function sr(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}function or(e){const t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}function ar(e){if(!e.target)return null;const t=e.target.ownerDocument,i=e.clientX,n=e.clientY;let r=null;return t.caretRangeFromPoint&&t.caretRangeFromPoint(i,n)?r=t.caretRangeFromPoint(i,n):e.rangeParent&&(r=t.createRange(),r.setStart(e.rangeParent,e.rangeOffset),r.collapse(!0)),r}function lr(e){return"[object Text]"==Object.prototype.toString.call(e)}function cr(e){return"[object Range]"==Object.prototype.toString.apply(e)}function hr(e){return e&&e.parentNode?e.offsetParent===ji.document.body?null:e.offsetParent:null}const dr=["top","right","bottom","left","width","height"];class ur{top;right;bottom;left;width;height;_source;constructor(e){const t=cr(e);if(Object.defineProperty(this,"_source",{value:e._source||e,writable:!0,enumerable:!1}),fr(e)||t)if(t){const t=ur.getDomRangeRects(e);mr(this,ur.getBoundingRect(t))}else mr(this,e.getBoundingClientRect());else if(Xn(e)){const{innerWidth:t,innerHeight:i}=e;mr(this,{top:0,right:t,bottom:i,left:0,width:t,height:i})}else mr(this,e)}clone(){return new ur(this)}moveTo(e,t){return this.top=t,this.right=e+this.width,this.bottom=t+this.height,this.left=e,this}moveBy(e,t){return this.top+=t,this.right+=e,this.left+=e,this.bottom+=t,this}getIntersection(e){const t={top:Math.max(this.top,e.top),right:Math.min(this.right,e.right),bottom:Math.min(this.bottom,e.bottom),left:Math.max(this.left,e.left),width:0,height:0};if(t.width=t.right-t.left,t.height=t.bottom-t.top,t.width<0||t.height<0)return null;{const e=new ur(t);return e._source=this._source,e}}getIntersectionArea(e){const t=this.getIntersection(e);return t?t.getArea():0}getArea(){return this.width*this.height}getVisible(){const e=this._source;let t=this.clone();if(gr(e))return t;let i,n=e,r=e.parentNode||e.commonAncestorContainer;for(;r&&!gr(r);){const e="visible"===((s=r)instanceof HTMLElement?s.ownerDocument.defaultView.getComputedStyle(s).overflow:"visible");n instanceof HTMLElement&&"absolute"===pr(n)&&(i=n);const o=pr(r);if(e||i&&("relative"===o&&e||"relative"!==o)){n=r,r=r.parentNode;continue}const a=new ur(r),l=t.getIntersection(a);if(!l)return null;l.getArea(){for(const t of e){const e=wr._getElementCallbacks(t.target);if(e)for(const i of e)i(t)}}))}}function br(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=t}function _r(e){return t=>t+e}function vr(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}function yr(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}function kr(e){return e&&e.nodeType===Node.COMMENT_NODE}function Cr(e){try{ji.document.createAttribute(e)}catch(e){return!1}return!0}function xr(e){return!!e&&(lr(e)?xr(e.parentElement):!!e.getClientRects&&!!e.getClientRects().length)}function Ar({element:e,target:t,positions:i,limiter:n,fitInViewport:r,viewportOffsetConfig:s}){H(t)&&(t=t()),H(n)&&(n=n());const o=hr(e),a=function(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);const t=new ur(ji.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t}(s),l=new ur(e),c=Tr(t,a);let h;if(!c||!a.getIntersection(c))return null;const d={targetRect:c,elementRect:l,positionedElementAncestor:o,viewportRect:a};if(n||r){if(n){const e=Tr(n,a);e&&(d.limiterRect=e)}h=function(e,t){const{elementRect:i}=t,n=i.getArea(),r=e.map((e=>new Er(e,t))).filter((e=>!!e.name));let s=0,o=null;for(const e of r){const{limiterIntersectionArea:t,viewportIntersectionArea:i}=e;if(t===n)return e;const r=i**2+t**2;r>s&&(s=r,o=e)}return o}(i,d)}else h=new Er(i[0],d);return h}function Tr(e,t){const i=new ur(e).getVisible();return i?i.getIntersection(t):null}class Er{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(e,t){const i=e(t.targetRect,t.elementRect,t.viewportRect,t.limiterRect);if(!i)return;const{left:n,top:r,name:s,config:o}=i;this.name=s,this.config=o,this._positioningFunctionCoordinates={left:n,top:r},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){const e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect||(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top)),this._cachedRect}get _absoluteRect(){return this._cachedAbsoluteRect||(this._cachedAbsoluteRect=this._rect.toAbsoluteRect()),this._cachedAbsoluteRect}}function Sr(e){const t=e.parentNode;t&&t.removeChild(e)}function Pr({target:e,viewportOffset:t=0,ancestorOffset:i=0,alignToTop:n,forceScroll:r}){const s=Mr(e);let o=s,a=null;for(t=function(e){if("number"==typeof e)return{top:e,bottom:e,left:e,right:e};return e}(t);o;){let l;l=Nr(o==s?e:a),Vr({parent:l,getRect:()=>Lr(e,o),alignToTop:n,ancestorOffset:i,forceScroll:r});let c=Lr(e,o);const h=Lr(l,o);if(c.height>h.height){const e=c.getIntersection(h);e&&(c=e)}if(Ir({window:o,rect:c,viewportOffset:t,alignToTop:n,forceScroll:r}),o.parent!=o){if(a=o.frameElement,o=o.parent,!a)return}else o=null}}function Ir({window:e,rect:t,alignToTop:i,forceScroll:n,viewportOffset:r}){const s=t.clone().moveBy(0,r.bottom),o=t.clone().moveBy(0,-r.top),a=new ur(e).excludeScrollbarsAndBorders(),l=i&&n,c=[o,s].every((e=>a.contains(e)));let{scrollX:h,scrollY:d}=e;const u=h,m=d;l?d-=a.top-t.top+r.top:c||(Br(o,a)?d-=a.top-t.top+r.top:Rr(s,a)&&(d+=i?t.top-a.top-r.top:t.bottom-a.bottom+r.bottom)),c||(Or(t,a)?h-=a.left-t.left+r.left:Fr(t,a)&&(h+=t.right-a.right+r.right)),h==u&&d===m||e.scrollTo(h,d)}function Vr({parent:e,getRect:t,alignToTop:i,forceScroll:n,ancestorOffset:r=0,limiterElement:s}){const o=Mr(e),a=i&&n;let l,c,h;const d=s||o.document.body;for(;e!=d;)c=t(),l=new ur(e).excludeScrollbarsAndBorders(),h=l.contains(c),a?e.scrollTop-=l.top-c.top+r:h||(Br(c,l)?e.scrollTop-=l.top-c.top+r:Rr(c,l)&&(e.scrollTop+=i?c.top-l.top-r:c.bottom-l.bottom+r)),h||(Or(c,l)?e.scrollLeft-=l.left-c.left+r:Fr(c,l)&&(e.scrollLeft+=c.right-l.right+r)),e=e.parentNode}function Rr(e,t){return e.bottom>t.bottom}function Br(e,t){return e.topt.right}function Mr(e){return cr(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function Nr(e){if(cr(e)){let t=e.commonAncestorContainer;return lr(t)&&(t=t.parentNode),t}return e.parentNode}function Lr(e,t){const i=Mr(e),n=new ur(e);if(i===t)return n;{let e=i;for(;e!=t;){const t=e.frameElement,i=new ur(t).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top),e=e.parent}}return n}const Dr={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},zr={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},Hr={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},Wr=Kr(),$r=Object.fromEntries(Object.entries(Wr).map((([e,t])=>{let i;return i=t in Hr?Hr[t]:e.charAt(0).toUpperCase()+e.slice(1),[t,i]})));function Ur(e){let t;if("string"==typeof e){if(t=Wr[e.toLowerCase()],!t)throw new gn("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?Wr.alt:0)+(e.ctrlKey?Wr.ctrl:0)+(e.shiftKey?Wr.shift:0)+(e.metaKey?Wr.cmd:0);return t}function jr(e){return"string"==typeof e&&(e=function(e){return e.split("+").map((e=>e.trim()))}(e)),e.map((e=>"string"==typeof e?function(e){if(e.endsWith("!"))return Ur(e.slice(0,-1));const t=Ur(e);return(Ki.isMac||Ki.isiOS)&&t==Wr.ctrl?Wr.cmd:t}(e):e)).reduce(((e,t)=>t+e),0)}function qr(e){let t=jr(e);return Object.entries(Ki.isMac||Ki.isiOS?Dr:zr).reduce(((e,[i,n])=>(t&Wr[i]&&(t&=~Wr[i],e+=n),e)),"")+(t?$r[t]:"")}function Gr(e,t){const i="ltr"===t;switch(e){case Wr.arrowleft:return i?"left":"right";case Wr.arrowright:return i?"right":"left";case Wr.arrowup:return"up";case Wr.arrowdown:return"down"}}function Kr(){const e={pageup:33,pagedown:34,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){e[String.fromCharCode(t).toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}const Zr=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig"];function Jr(e){return Zr.includes(e)?"rtl":"ltr"}function Qr(e){return Array.isArray(e)?e:[e]}function Yr(e,t,i=1,n){if("number"!=typeof i)throw new gn("translation-service-quantity-not-a-number",null,{quantity:i});const r=n||ji.window.CKEDITOR_TRANSLATIONS,s=function(e){return Object.keys(e).length}(r);1===s&&(e=Object.keys(r)[0]);const o=t.id||t.string;if(0===s||!function(e,t,i){return!!i[e]&&!!i[e].dictionary[t]}(e,o,r))return 1!==i?t.plural:t.string;const a=r[e].dictionary,l=r[e].getPluralForm||(e=>1===e?0:1),c=a[o];if("string"==typeof c)return c;return c[Number(l(i))]}ji.window.CKEDITOR_TRANSLATIONS||(ji.window.CKEDITOR_TRANSLATIONS={});class Xr{uiLanguage;uiLanguageDirection;contentLanguage;contentLanguageDirection;t;translations;constructor({uiLanguage:e="en",contentLanguage:t,translations:i}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=Jr(this.uiLanguage),this.contentLanguageDirection=Jr(this.contentLanguage),this.translations=function(e){return Array.isArray(e)?e.reduce(((e,t)=>$i(e,t))):e}(i),this.t=(e,t)=>this._t(e,t)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(e,t=[]){t=Qr(t),"string"==typeof e&&(e={string:e});const i=!!e.plural?t[0]:1;return function(e,t){return e.replace(/%(\d+)/g,((e,i)=>ithis._items.length||t<0)throw new gn("collection-add-item-invalid-index",this);let i=0;for(const n of e){const e=this._getItemIdBeforeAdding(n),r=t+i;this._items.splice(r,0,n),this._itemMap.set(e,n),this.fire("add",n,r),i++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if("string"==typeof e)t=this._itemMap.get(e);else{if("number"!=typeof e)throw new gn("collection-get-invalid-arg",this);t=this._items[e]}return t||null}has(e){if("string"==typeof e)return this._itemMap.has(e);{const t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return t="string"==typeof e?this._itemMap.get(e):e,t?this._items.indexOf(t):-1}remove(e){const[t,i]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:i}),t}map(e,t){return this._items.map(e,t)}forEach(e,t){this._items.forEach(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new gn("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:e=>{this._setUpBindToBinding((t=>new e(t)))},using:e=>{"function"==typeof e?this._setUpBindToBinding(e):this._setUpBindToBinding((t=>t[e]))}}}_setUpBindToBinding(e){const t=this._bindToCollection,i=(i,n,r)=>{const s=t._bindToCollection==this,o=t._bindToInternalToExternalMap.get(n);if(s&&o)this._bindToExternalToInternalMap.set(n,o),this._bindToInternalToExternalMap.set(o,n);else{const i=e(n);if(!i)return void this._skippedIndexesFromExternal.push(r);let s=r;for(const e of this._skippedIndexesFromExternal)r>e&&s--;for(const e of t._skippedIndexesFromExternal)s>=e&&s++;this._bindToExternalToInternalMap.set(n,i),this._bindToInternalToExternalMap.set(i,n),this.add(i,s);for(let e=0;e{const n=this._bindToExternalToInternalMap.get(t);n&&this.remove(n),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce(((e,t)=>(it&&e.push(t),e)),[])}))}_getItemIdBeforeAdding(e){const t=this._idProperty;let i;if(t in e){if(i=e[t],"string"!=typeof i)throw new gn("collection-add-invalid-id",this);if(this.get(i))throw new gn("collection-add-item-already-exists",this)}else e[t]=i=hn();return i}_remove(e){let t,i,n,r=!1;const s=this._idProperty;if("string"==typeof e?(i=e,n=this._itemMap.get(i),r=!n,n&&(t=this._items.indexOf(n))):"number"==typeof e?(t=e,n=this._items[t],r=!n,n&&(i=n[s])):(n=e,i=n[s],t=this._items.indexOf(n),r=-1==t||!this._itemMap.get(i)),r)throw new gn("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(i);const o=this._bindToInternalToExternalMap.get(n);return this._bindToInternalToExternalMap.delete(n),this._bindToExternalToInternalMap.delete(o),this.fire("remove",n,t),[n,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}function ts(e){const t=e.next();return t.done?null:t.value}class is extends(tr(Ln())){_elements=new Set;_externalViews=new Set;_blurTimeout=null;constructor(){super(),this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(rs(e))this._addElement(e);else if(ns(e))this._addView(e);else{if(!e.element)throw new gn("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){rs(e)?this._removeElement(e):ns(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new gn("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",(()=>{const t=this.externalViews.find((t=>function(e,t){if(ss(e,t))return!0;return!!t.focusTracker.externalViews.find((t=>ss(e,t)))}(e,t)));t?this._focus(t.element):this._focus(e)}),{useCapture:!0}),this.listenTo(e,"blur",(()=>{this._blur()}),{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",(()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()})),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){if(this.elements.find((e=>e.contains(document.activeElement))))return;this.externalViews.find((e=>e.focusTracker.isFocused&&!e.focusTracker._blurTimeout))||(this._clearBlurTimeout(),this._blurTimeout=setTimeout((()=>{this.focusedElement=null,this.isFocused=!1}),0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}}function ns(e){return"focusTracker"in e&&e.focusTracker instanceof is}function rs(e){return Ci(e)}function ss(e,t){return!!t.element&&t.element.contains(document.activeElement)&&e.contains(t.element)}class os{_listener;constructor(){this._listener=new(tr())}listenTo(e){this._listener.listenTo(e,"keydown",((e,t)=>{this._listener.fire("_keydown:"+Ur(t),t)}))}set(e,t,i={}){const n=jr(e),r=i.priority;this._listener.listenTo(this._listener,"_keydown:"+n,((e,n)=>{i.filter&&!i.filter(n)||(t(n,(()=>{n.preventDefault(),n.stopPropagation(),e.stop()})),e.return=!0)}),{priority:r})}press(e){return!!this._listener.fire("_keydown:"+Ur(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}}function as(e){return Gn(e)?new Map(e):function(e){const t=new Map;for(const i in e)t.set(i,e[i]);return t}(e)}function ls(e,t,i,n){if(Math.max(t.length,e.length)>1e4)return e.slice(0,i).concat(t).concat(e.slice(i+n,e.length));{const r=Array.from(e);return r.splice(i,n,...t),r}}function cs(e,t){let i;function n(...r){n.cancel(),i=setTimeout((()=>e(...r)),t)}return n.cancel=()=>{clearTimeout(i)},n}function hs(e){try{if(!e.startsWith("ey"))return null;const t=atob(e.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch(e){return null}}function ds(e,t){return!!(i=e.charAt(t-1))&&1==i.length&&/[\ud800-\udbff]/.test(i)&&function(e){return!!e&&1==e.length&&/[\udc00-\udfff]/.test(e)}(e.charAt(t));var i}function us(e,t){return!!(i=e.charAt(t))&&1==i.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(i);var i}const ms=fs();function gs(e,t){const i=String(e).matchAll(ms);return Array.from(i).some((e=>e.indexe.source)).join("|")+")";return new RegExp(`${e}|${t}(?:‍${t})*`,"ug")}const ps=function(e){return"symbol"==typeof e||w(e)&&"[object Symbol]"==f(e)};var ws=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bs=/^\w*$/;const _s=function(e,t){if(p(e))return!1;var i=typeof e;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=e&&!ps(e))||(bs.test(e)||!ws.test(e)||null!=t&&e in Object(t))};function vs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var i=function(){var n=arguments,r=t?t.apply(this,n):n[0],s=i.cache;if(s.has(r))return s.get(r);var o=e.apply(this,n);return i.cache=s.set(r,o)||s,o};return i.cache=new(vs.Cache||ke),i}vs.Cache=ke;const ys=vs;const ks=function(e){var t=ys(e,(function(e){return 500===i.size&&i.clear(),e})),i=t.cache;return t};var Cs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xs=/\\(\\)?/g,As=ks((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Cs,(function(e,i,n,r){t.push(n?r.replace(xs,"$1"):i||e)})),t}));const Ts=As;const Es=function(e,t){for(var i=-1,n=null==e?0:e.length,r=Array(n);++ir?0:r+t),(i=i>r?r:i)<0&&(i+=r),r=t>i?0:i-t>>>0,t>>>=0;for(var s=Array(r);++n=i||t<0||u&&e-h>=o}function p(){var e=js();if(f(e))return w(e);l=setTimeout(p,function(e){var t=i-(e-c);return u?io(t,o-(e-h)):t}(e))}function w(e){return l=void 0,m&&r?g(e):(r=s=void 0,a)}function b(){var e=js(),t=f(e);if(r=arguments,s=this,c=e,t){if(void 0===l)return function(e){return h=e,l=setTimeout(p,i),d?g(e):a}(c);if(u)return clearTimeout(l),l=setTimeout(p,i),g(c)}return void 0===l&&(l=setTimeout(p,i)),a}return i=eo(i)||0,e(n)&&(d=!!n.leading,o=(u="maxWait"in n)?to(eo(n.maxWait)||0,i):o,m="trailing"in n?!!n.trailing:m),b.cancel=function(){void 0!==l&&clearTimeout(l),h=0,r=c=s=l=void 0},b.flush=function(){return void 0===l?a:w(js())},b};const ro=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const so=function(e){return this.__data__.has(e)};function oo(e){var t=-1,i=null==e?0:e.length;for(this.__data__=new ke;++ta))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var d=-1,u=!0,m=2&i?new ao:void 0;for(s.set(e,t),s.set(t,e);++dRo(s,e)))}So.has(s)||(So.set(s,new Map),s.registerPostFixer((e=>Ro(s,e))),s.on("change:isComposing",(()=>{e.change((e=>Ro(s,e)))}),{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",((e,t,i)=>{o(i)})),t.placeholder?o(t.placeholder):i&&o(i),i&&function(){Po||fn("enableplaceholder-deprecated-text-option");Po=!0}()}function Vo(e,t){return!!t.hasClass("ck-placeholder")&&(e.removeClass("ck-placeholder",t),!0)}function Ro(e,t){const i=So.get(e),n=[];let r=!1;for(const[e,s]of i)s.isDirectHost&&(n.push(e),Bo(t,e,s)&&(r=!0));for(const[e,s]of i){if(s.isDirectHost)continue;const i=Oo(e);i&&(n.includes(i)||(s.hostElement=i,Bo(t,e,s)&&(r=!0)))}return r}function Bo(e,t,i){const{text:n,isDirectHost:r,hostElement:s}=i;let o=!1;s.getAttribute("data-placeholder")!==n&&(e.setAttribute("data-placeholder",n,s),o=!0);return(r||1==t.childCount)&&function(e,t){if(!e.isAttached())return!1;const i=Array.from(e.getChildren()).some((e=>!e.is("uiElement")));if(i)return!1;const n=e.document,r=n.selection.anchor;return!(n.isComposing&&r&&r.parent===e||!t&&n.isFocused&&(!r||r.parent===e))}(s,i.keepOnFocus)?function(e,t){return!t.hasClass("ck-placeholder")&&(e.addClass("ck-placeholder",t),!0)}(e,s)&&(o=!0):Vo(e,s)&&(o=!0),o}function Oo(e){if(e.childCount){const t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}let Fo=class{is(){throw new Error("is() method is abstract")}},Mo=class extends(xn(Fo)){document;parent;constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if(-1==(e=this.parent.getChildIndex(this)))throw new gn("view-node-not-found-in-parent",this);return e}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),n=e.getAncestors(t);let r=0;for(;i[r]==n[r]&&i[r];)r++;return 0===r?null:i[r-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),n=qn(t,i);switch(n){case"prefix":return!0;case"extension":return!1;default:return t[n]e.data.length)throw new gn("view-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.data.length)throw new gn("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}getAncestors(e={}){const t=[];let i=e.includeSelf?this.textNode:this.parent;for(;null!==i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}};Lo.prototype.is=function(e){return"$textProxy"===e||"view:$textProxy"===e||"textProxy"===e||"view:textProxy"===e};class Do{_patterns=[];constructor(...e){this.add(...e)}add(...e){for(let t of e)("string"==typeof t||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(const t of e)for(const e of this._patterns){const i=zo(t,e);if(i)return{element:t,pattern:e,match:i}}return null}matchAll(...e){const t=[];for(const i of e)for(const e of this._patterns){const n=zo(i,e);n&&t.push({element:i,pattern:e,match:n})}return t.length>0?t:null}getElementName(){if(1!==this._patterns.length)return null;const e=this._patterns[0],t=e.name;return"function"==typeof e||!t||t instanceof RegExp?null:t}}function zo(e,t){if("function"==typeof t)return t(e);const i={};return t.name&&(i.name=function(e,t){if(e instanceof RegExp)return!!t.match(e);return e===t}(t.name,e.name),!i.name)||t.attributes&&(i.attributes=function(e,t){const i=new Set(t.getAttributeKeys());T(e)?(void 0!==e.style&&fn("matcher-pattern-deprecated-attributes-style-key",e),void 0!==e.class&&fn("matcher-pattern-deprecated-attributes-class-key",e)):(i.delete("style"),i.delete("class"));return Ho(e,i,(e=>t.getAttribute(e)))}(t.attributes,e),!i.attributes)||t.classes&&(i.classes=function(e,t){return Ho(e,t.getClassNames(),(()=>{}))}(t.classes,e),!i.classes)||t.styles&&(i.styles=function(e,t){return Ho(e,t.getStyleNames(!0),(e=>t.getStyle(e)))}(t.styles,e),!i.styles)?null:i}function Ho(e,t,i){const n=function(e){if(Array.isArray(e))return e.map((e=>T(e)?(void 0!==e.key&&void 0!==e.value||fn("matcher-pattern-missing-key-or-value",e),[e.key,e.value]):[e,!0]));if(T(e))return Object.entries(e);return[[e,!0]]}(e),r=Array.from(t),s=[];if(n.forEach((([e,t])=>{r.forEach((n=>{(function(e,t){return!0===e||e===t||e instanceof RegExp&&t.match(e)})(e,n)&&function(e,t,i){if(!0===e)return!0;const n=i(t);return e===n||e instanceof RegExp&&!!String(n).match(e)}(t,n,i)&&s.push(n)}))})),n.length&&!(s.lengtht===e));return Array.isArray(t)}set(t,i){if(e(t))for(const[e,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(e,i,this._styles);else this._styleProcessor.toNormalizedForm(t,i,this._styles)}remove(e){const t=Uo(e);$s(this._styles,t),delete this._styles[e],this._cleanEmptyObjectsOnPath(t)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map((e=>e.join(":"))).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!e(this._styles[t]))return this._styles[t];const i=this._styleProcessor.getReducedForm(t,this._styles).find((([e])=>e===t));return Array.isArray(i)?i[1]:void 0}getStyleNames(e=!1){if(this.isEmpty)return[];if(e)return this._styleProcessor.getStyleNames(this._styles);return this.getStylesEntries().map((([e])=>e))}clear(){this._styles={}}getStylesEntries(){const e=[],t=Object.keys(this._styles);for(const i of t)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_cleanEmptyObjectsOnPath(e){const t=e.split(".");if(!(t.length>1))return;const i=t.splice(0,t.length-1).join("."),n=Fs(this._styles,i);if(!n)return;!Object.keys(n).length&&this.remove(i)}}class $o{_normalizers;_extractors;_reducers;_consumables;constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,i,n){if(e(i))jo(n,Uo(t),i);else if(this._normalizers.has(t)){const e=this._normalizers.get(t),{path:r,value:s}=e(i);jo(n,r,s)}else jo(n,t,i)}getNormalized(e,t){if(!e)return $i({},t);if(void 0!==t[e])return t[e];if(this._extractors.has(e)){const i=this._extractors.get(e);if("string"==typeof i)return Fs(t,i);const n=i(e,t);if(n)return n}return Fs(t,Uo(e))}getReducedForm(e,t){const i=this.getNormalized(e,t);if(void 0===i)return[];if(this._reducers.has(e)){return this._reducers.get(e)(i)}return[[e,i]]}getStyleNames(e){const t=new Set;for(const i of this._consumables.keys()){const n=this.getNormalized(i,e);n&&("object"!=typeof n||Object.keys(n).length)&&t.add(i)}for(const i of Object.keys(e))t.add(i);return Array.from(t)}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(const i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}}function Uo(e){return e.replace("-",".")}function jo(t,i,n){let r=n;e(n)&&(r=$i({},Fs(t,i),n)),Ns(t,i,r)}let qo=class e extends Mo{name;_unsafeAttributesToRender=[];_attrs;_children;_classes;_styles;_customProperties=new Map;constructor(e,t,i,n){if(super(e),this.name=t,this._attrs=function(e){const t=as(e);for(const[e,i]of t)null===i?t.delete(e):"string"!=typeof i&&t.set(e,String(i));return t}(i),this._children=[],n&&this._insertChild(0,n),this._classes=new Set,this._attrs.has("class")){const e=this._attrs.get("class");Go(this._classes,e),this._attrs.delete("class")}this._styles=new Wo(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style"))}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(e){if("class"==e)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==e){const e=this._styles.toString();return""==e?void 0:e}return this._attrs.get(e)}hasAttribute(e){return"class"==e?this._classes.size>0:"style"==e?!this._styles.isEmpty:this._attrs.has(e)}isSimilar(t){if(!(t instanceof e))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,i]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==i)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...e){for(const t of e)if(!this._classes.has(t))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(e){return this._styles.getAsString(e)}getNormalizedStyle(e){return this._styles.getNormalized(e)}getStyleNames(e){return this._styles.getStyleNames(e)}hasStyle(...e){for(const t of e)if(!this._styles.has(t))return!1;return!0}findAncestor(...e){const t=new Do(...e);let i=this.parent;for(;i&&!i.is("documentFragment");){if(t.match(i))return i;i=i.parent}return null}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const e=Array.from(this._classes).sort().join(","),t=this._styles.toString(),i=Array.from(this._attrs).map((e=>`${e[0]}="${e[1]}"`)).sort().join(" ");return this.name+(""==e?"":` class="${e}"`)+(t?` style="${t}"`:"")+(""==i?"":` ${i}`)}shouldRenderUnsafeAttribute(e){return this._unsafeAttributesToRender.includes(e)}_clone(e=!1){const t=[];if(e)for(const i of this.getChildren())t.push(i._clone(e));const i=new this.constructor(this.document,this.name,this._attrs,t);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._unsafeAttributesToRender=this._unsafeAttributesToRender,i}_appendChild(e){return this._insertChild(this.childCount,e)}_insertChild(e,t){this._fireChange("children",this);let i=0;const n=function(e,t){if("string"==typeof t)return[new No(e,t)];Gn(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new No(e,t):t instanceof Lo?new No(e,t.data):t))}(this.document,t);for(const t of n)null!==t.parent&&t._remove(),t.parent=this,t.document=this.document,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this);for(let i=e;i0&&(this._classes.clear(),!0):"style"==e?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(e)}_addClass(e){this._fireChange("attributes",this);for(const t of Qr(e))this._classes.add(t)}_removeClass(e){this._fireChange("attributes",this);for(const t of Qr(e))this._classes.delete(t)}_setStyle(e,t){this._fireChange("attributes",this),"string"!=typeof e?this._styles.set(e):this._styles.set(e,t)}_removeStyle(e){this._fireChange("attributes",this);for(const t of Qr(e))this._styles.remove(t)}_setCustomProperty(e,t){this._customProperties.set(e,t)}_removeCustomProperty(e){return this._customProperties.delete(e)}};function Go(e,t){const i=t.split(/\s+/);e.clear(),i.forEach((t=>e.add(t)))}qo.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"view:element"===e):"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Ko extends qo{constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=Zo}}function Zo(){const e=[...this.getChildren()],t=e[this.childCount-1];if(t&&t.is("element","br"))return this.childCount;for(const t of e)if(!t.is("uiElement"))return null;return this.childCount}Ko.prototype.is=function(e,t){return t?t===this.name&&("containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class Jo extends(Ln(Ko)){constructor(e,t,i,n){super(e,t,i,n),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("placeholder",void 0),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",(t=>t&&e.selection.editableElement==this)),this.listenTo(e.selection,"change",(()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this}))}destroy(){this.stopListening()}}Jo.prototype.is=function(e,t){return t?t===this.name&&("editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};const Qo=Symbol("rootName");class Yo extends Jo{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(Qo)}set rootName(e){this._setCustomProperty(Qo,e)}set _name(e){this.name=e}}Yo.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e):"rootElement"===e||"view:rootElement"===e||"editableElement"===e||"view:editableElement"===e||"containerElement"===e||"view:containerElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};let Xo=class{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new gn("view-tree-walker-no-start-position",null);if(e.direction&&"forward"!=e.direction&&"backward"!=e.direction)throw new gn("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=ea._createAt(e.startPosition):this._position=ea._createAt(e.boundaries["backward"==e.direction?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i;do{i=this.position,t=this.next()}while(!t.done&&e(t.value));t.done||(this._position=i)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&e.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let n;if(i instanceof No){if(e.isAtEnd)return this._position=ea._createAfter(i),this._next();n=i.data[e.offset]}else n=i.getChild(e.offset);if(n instanceof qo){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}else e=new ea(n,0);return this._position=e,this._formatReturnValue("elementStart",n,t,e,1)}if(n instanceof No){if(this.singleCharacters)return e=new ea(n,0),this._position=e,this._next();let i,r=n.data.length;return n==this._boundaryEndParent?(r=this.boundaries.end.offset,i=new Lo(n,0,r),e=ea._createAfter(i)):(i=new Lo(n,0,n.data.length),e.offset++),this._position=e,this._formatReturnValue("text",i,t,e,r)}if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{n=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-e.offset}const r=new Lo(i,e.offset,n);return e.offset+=n,this._position=e,this._formatReturnValue("text",r,t,e,n)}return e=ea._createAfter(i),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,t,e)}_previous(){let e=this.position.clone();const t=this.position,i=e.parent;if(null===i.parent&&0===e.offset)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let n;if(i instanceof No){if(e.isAtStart)return this._position=ea._createBefore(i),this._previous();n=i.data[e.offset-1]}else n=i.getChild(e.offset-1);if(n instanceof qo)return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",n,t,e,1)):(e=new ea(n,n.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",n,t,e));if(n instanceof No){if(this.singleCharacters)return e=new ea(n,n.data.length),this._position=e,this._previous();let i,r=n.data.length;if(n==this._boundaryStartParent){const t=this.boundaries.start.offset;i=new Lo(n,t,n.data.length-t),r=i.data.length,e=ea._createBefore(i)}else i=new Lo(n,0,n.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",i,t,e,r)}if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{const t=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=e.offset-t}e.offset-=n;const r=new Lo(i,e.offset,n);return this._position=e,this._formatReturnValue("text",r,t,e,n)}return e=ea._createBefore(i),this._position=e,this._formatReturnValue("elementStart",i,t,e,1)}_formatReturnValue(e,t,i,n,r){return t instanceof Lo&&(t.offsetInText+t.data.length==t.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=ea._createAfter(t.textNode):(n=ea._createAfter(t.textNode),this._position=n)),0===t.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=ea._createBefore(t.textNode):(n=ea._createBefore(t.textNode),this._position=n))),{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:r}}}},ea=class e extends Fo{parent;offset;constructor(e,t){super(),this.parent=e,this.offset=t}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const e=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===e}get root(){return this.parent.root}get editableElement(){let e=this.parent;for(;!(e instanceof Jo);){if(!e.parent)return null;e=e.parent}return e}getShiftedBy(t){const i=e._createAt(this),n=i.offset+t;return i.offset=n<0?0:n,i}getLastMatchingPosition(e,t={}){t.startPosition=this;const i=new Xo(t);return i.skip(e),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(e){const t=this.getAncestors(),i=e.getAncestors();let n=0;for(;t[n]==i[n]&&t[n];)n++;return 0===n?null:t[n-1]}isEqual(e){return this.parent==e.parent&&this.offset==e.offset}isBefore(e){return"before"==this.compareWith(e)}isAfter(e){return"after"==this.compareWith(e)}compareWith(e){if(this.root!==e.root)return"different";if(this.isEqual(e))return"same";const t=this.parent.is("node")?this.parent.getPath():[],i=e.parent.is("node")?e.parent.getPath():[];t.push(this.offset),i.push(e.offset);const n=qn(t,i);switch(n){case"prefix":return"before";case"extension":return"after";default:return t[n]0?new this(i,n):new this(n,i)}static _createIn(e){return this._createFromParentsAndOffsets(e,0,e,e.childCount)}static _createOn(e){const t=e.is("$textProxy")?e.offsetSize:1;return this._createFromPositionAndShift(ea._createBefore(e),t)}};function ia(e){return!(!e.item.is("attributeElement")&&!e.item.is("uiElement"))}ta.prototype.is=function(e){return"range"===e||"view:range"===e};let na=class e extends(xn(Fo)){_ranges;_lastRangeBackward;_isFake;_fakeSelectionLabel;constructor(...e){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",e.length&&this.setTo(...e)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.end:e.start).clone()}get focus(){if(!this._ranges.length)return null;const e=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?e.start:e.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const e of this._ranges)yield e.clone()}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?e.clone():null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?e.clone():null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}isEqual(e){if(this.isFake!=e.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=e.fakeSelectionLabel)return!1;if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const n of e._ranges)if(t.isEqual(n)){i=!0;break}if(!i)return!1}return!0}isSimilar(e){if(this.isBackward!=e.isBackward)return!1;const t=jn(this.getRanges());if(t!=jn(e.getRanges()))return!1;if(0==t)return!0;for(let t of this.getRanges()){t=t.getTrimmed();let i=!1;for(let n of e.getRanges())if(n=n.getTrimmed(),t.start.isEqual(n.start)&&t.end.isEqual(n.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(...t){let[i,n,r]=t;if("object"==typeof n&&(r=n,n=void 0),null===i)this._setRanges([]),this._setFakeOptions(r);else if(i instanceof e||i instanceof ra)this._setRanges(i.getRanges(),i.isBackward),this._setFakeOptions({fake:i.isFake,label:i.fakeSelectionLabel});else if(i instanceof ta)this._setRanges([i],r&&r.backward),this._setFakeOptions(r);else if(i instanceof ea)this._setRanges([new ta(i)]),this._setFakeOptions(r);else if(i instanceof Mo){const e=!!r&&!!r.backward;let t;if(void 0===n)throw new gn("view-selection-setto-required-second-parameter",this);t="in"==n?ta._createIn(i):"on"==n?ta._createOn(i):new ta(ea._createAt(i,n)),this._setRanges([t],e),this._setFakeOptions(r)}else{if(!Gn(i))throw new gn("view-selection-setto-not-selectable",this);this._setRanges(i,r&&r.backward),this._setFakeOptions(r)}this.fire("change")}setFocus(e,t){if(null===this.anchor)throw new gn("view-selection-setfocus-no-ranges",this);const i=ea._createAt(e,t);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.pop(),"before"==i.compareWith(n)?this._addRange(new ta(i,n),!0):this._addRange(new ta(n,i)),this.fire("change")}_setRanges(e,t=!1){e=Array.from(e),this._ranges=[];for(const t of e)this._addRange(t);this._lastRangeBackward=!!t}_setFakeOptions(e={}){this._isFake=!!e.fake,this._fakeSelectionLabel=e.fake&&e.label||""}_addRange(e,t=!1){if(!(e instanceof ta))throw new gn("view-selection-add-range-not-range",this);this._pushRange(e),this._lastRangeBackward=!!t}_pushRange(e){for(const t of this._ranges)if(e.isIntersecting(t))throw new gn("view-selection-range-intersects",this,{addedRange:e,intersectingRange:t});this._ranges.push(new ta(e.start,e.end))}};na.prototype.is=function(e){return"selection"===e||"view:selection"===e};let ra=class extends(xn(Fo)){_selection;constructor(...e){super(),this._selection=new na,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}};ra.prototype.is=function(e){return"selection"===e||"documentSelection"==e||"view:selection"==e||"view:documentSelection"==e};class sa extends ln{startRange;_eventPhase;_currentTarget;constructor(e,t,i){super(e,t),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const oa=Symbol("bubbling contexts");function aa(e){return class extends e{fire(e,...t){try{const i=e instanceof ln?e:new ln(this,e),n=da(this);if(!n.size)return;if(la(i,"capturing",this),ca(n,"$capture",i,...t))return i.return;const r=i.startRange||this.selection.getFirstRange(),s=r?r.getContainedElement():null,o=!!s&&Boolean(ha(n,s));let a=s||function(e){if(!e)return null;const t=e.start.parent,i=e.end.parent,n=t.getPath(),r=i.getPath();return n.length>r.length?t:i}(r);if(la(i,"atTarget",a),!o){if(ca(n,"$text",i,...t))return i.return;la(i,"bubbling",a)}for(;a;){if(a.is("rootElement")){if(ca(n,"$root",i,...t))return i.return}else if(a.is("element")&&ca(n,a.name,i,...t))return i.return;if(ca(n,a,i,...t))return i.return;a=a.parent,la(i,"bubbling",a)}return la(i,"bubbling",this),ca(n,"$document",i,...t),i.return}catch(e){gn.rethrowUnexpectedError(e,this)}}_addEventListener(e,t,i){const n=Qr(i.context||"$document"),r=da(this);for(const s of n){let n=r.get(s);n||(n=new(xn()),r.set(s,n)),this.listenTo(n,e,t,i)}}_removeEventListener(e,t){const i=da(this);for(const n of i.values())this.stopListening(n,e,t)}}}{const e=aa(Object);["fire","_addEventListener","_removeEventListener"].forEach((t=>{aa[t]=e.prototype[t]}))}function la(e,t,i){e instanceof sa&&(e._eventPhase=t,e._currentTarget=i)}function ca(e,t,i,...n){const r="string"==typeof t?e.get(t):ha(e,t);return!!r&&(r.fire(i,...n),i.stop.called)}function ha(e,t){for(const[i,n]of e)if("function"==typeof i&&i(t))return n;return null}function da(e){return e[oa]||(e[oa]=new Map),e[oa]}let ua=class extends(aa(Ln())){selection;roots;stylesProcessor;_postFixers=new Set;constructor(e){super(),this.selection=new ra,this.roots=new es({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach((e=>e.destroy())),this.stopListening()}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(t=i(e),t)break}while(t)}};class ma extends qo{static DEFAULT_PRIORITY=10;_priority=10;_id=null;_clonesGroup=null;constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=ga}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new gn("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return null!==this.id||null!==e.id?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}_clone(e=!1){const t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}}function ga(){if(fa(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(fa(e)>1)return null;e=e.parent}return!e||fa(e)>1?null:this.childCount}function fa(e){return Array.from(e.getChildren()).filter((e=>!e.is("uiElement"))).length}ma.prototype.is=function(e,t){return t?t===this.name&&("attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e):"attributeElement"===e||"view:attributeElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class pa extends qo{constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=wa}_insertChild(e,t){if(t&&(t instanceof Mo||Array.from(t).length>0))throw new gn("view-emptyelement-cannot-add",[this,t]);return 0}}function wa(){return null}pa.prototype.is=function(e,t){return t?t===this.name&&("emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e):"emptyElement"===e||"view:emptyElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class ba extends qo{constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=va}_insertChild(e,t){if(t&&(t instanceof Mo||Array.from(t).length>0))throw new gn("view-uielement-cannot-add",[this,t]);return 0}render(e,t){return this.toDomElement(e)}toDomElement(e){const t=e.createElement(this.name);for(const e of this.getAttributeKeys())t.setAttribute(e,this.getAttribute(e));return t}}function _a(e){e.document.on("arrowKey",((t,i)=>function(e,t,i){if(t.keyCode==Wr.arrowright){const e=t.domTarget.ownerDocument.defaultView.getSelection(),n=1==e.rangeCount&&e.getRangeAt(0).collapsed;if(n||t.shiftKey){const t=e.focusNode,r=e.focusOffset,s=i.domPositionToView(t,r);if(null===s)return;let o=!1;const a=s.getLastMatchingPosition((e=>(e.item.is("uiElement")&&(o=!0),!(!e.item.is("uiElement")&&!e.item.is("attributeElement")))));if(o){const t=i.viewPositionToDom(a);n?e.collapse(t.parent,t.offset):e.extend(t.parent,t.offset)}}}}(0,i,e.domConverter)),{priority:"low"})}function va(){return null}ba.prototype.is=function(e,t){return t?t===this.name&&("uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e):"uiElement"===e||"view:uiElement"===e||"element"===e||"view:element"===e||"node"===e||"view:node"===e};class ya extends qo{constructor(e,t,i,n){super(e,t,i,n),this.getFillerOffset=ka}_insertChild(e,t){if(t&&(t instanceof Mo||Array.from(t).length>0))throw new gn("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}}function ka(){return null}ya.prototype.is=function(e,t){return t?t===this.name&&("rawElement"===e||"view:rawElement"===e||"element"===e||"view:element"===e):"rawElement"===e||"view:rawElement"===e||e===this.name||e==="view:"+this.name||"element"===e||"view:element"===e||"node"===e||"view:node"===e};let Ca=class extends(xn(Fo)){document;_children=[];_customProperties=new Map;constructor(e,t){super(),this.document=e,t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}get name(){}get getFillerOffset(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this);let i=0;const n=function(e,t){if("string"==typeof t)return[new No(e,t)];Gn(t)||(t=[t]);return Array.from(t).map((t=>"string"==typeof t?new No(e,t):t instanceof Lo?new No(e,t.data):t))}(this.document,t);for(const t of n)null!==t.parent&&t._remove(),t.parent=this,this._children.splice(e,0,t),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this);for(let i=e;i{const i=e[e.length-1],n=!t.is("uiElement");return i&&i.breakAttributes==n?i.nodes.push(t):e.push({breakAttributes:n,nodes:[t]}),e}),[]);let n=null,r=e;for(const{nodes:e,breakAttributes:t}of i){const i=this._insertNodes(r,e,t);n||(n=i.start),r=i.end}return n?new ta(n,r):new ta(e)}remove(e){const t=e instanceof ta?e:ta._createOn(e);if(Ba(t,this.document),t.isCollapsed)return new Ca(this.document);const{start:i,end:n}=this._breakAttributesRange(t,!0),r=i.parent,s=n.offset-i.offset,o=r._removeChildren(i.offset,s);for(const e of o)this._removeFromClonedElementsGroup(e);const a=this.mergeAttributes(i);return t.start=a,t.end=a.clone(),new Ca(this.document,o)}clear(e,t){Ba(e,this.document);const i=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(const n of i){const i=n.item;let r;if(i.is("element")&&t.isSimilar(i))r=ta._createOn(i);else if(!n.nextPosition.isAfter(e.start)&&i.is("$textProxy")){const e=i.getAncestors().find((e=>e.is("element")&&t.isSimilar(e)));e&&(r=ta._createIn(e))}r&&(r.end.isAfter(e.end)&&(r.end=e.end),r.start.isBefore(e.start)&&(r.start=e.start),this.remove(r))}}move(e,t){let i;if(t.isAfter(e.end)){const n=(t=this._breakAttributes(t,!0)).parent,r=n.childCount;e=this._breakAttributesRange(e,!0),i=this.remove(e),t.offset+=n.childCount-r}else i=this.remove(e);return this.insert(t,i)}wrap(e,t){if(!(t instanceof ma))throw new gn("view-writer-wrap-invalid-attribute",this.document);if(Ba(e,this.document),e.isCollapsed){let n=e.start;n.parent.is("element")&&(i=n.parent,!Array.from(i.getChildren()).some((e=>!e.is("uiElement"))))&&(n=n.getLastMatchingPosition((e=>e.item.is("uiElement")))),n=this._wrapPosition(n,t);const r=this.document.selection;return r.isCollapsed&&r.getFirstPosition().isEqual(e.start)&&this.setSelection(n),new ta(n)}return this._wrapRange(e,t);var i}unwrap(e,t){if(!(t instanceof ma))throw new gn("view-writer-unwrap-invalid-attribute",this.document);if(Ba(e,this.document),e.isCollapsed)return e;const{start:i,end:n}=this._breakAttributesRange(e,!0),r=i.parent,s=this._unwrapChildren(r,i.offset,n.offset,t),o=this.mergeAttributes(s.start);o.isEqual(s.start)||s.end.offset--;const a=this.mergeAttributes(s.end);return new ta(o,a)}rename(e,t){const i=new Ko(this.document,e,t.getAttributes());return this.insert(ea._createAfter(t),i),this.move(ta._createIn(t),ea._createAt(i,0)),this.remove(ta._createOn(t)),i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return ea._createAt(e,t)}createPositionAfter(e){return ea._createAfter(e)}createPositionBefore(e){return ea._createBefore(e)}createRange(e,t){return new ta(e,t)}createRangeOn(e){return ta._createOn(e)}createRangeIn(e){return ta._createIn(e)}createSelection(...e){return new na(...e)}createSlot(e="children"){if(!this._slotFactory)throw new gn("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,i){let n,r;if(n=i?Aa(e):e.parent.is("$text")?e.parent.parent:e.parent,!n)throw new gn("view-writer-invalid-position-container",this.document);r=i?this._breakAttributes(e,!0):e.parent.is("$text")?Sa(e):e;const s=n._insertChild(r.offset,t);for(const e of t)this._addToClonedElementsGroup(e);const o=r.getShiftedBy(s),a=this.mergeAttributes(r);a.isEqual(r)||o.offset--;const l=this.mergeAttributes(o);return new ta(a,l)}_wrapChildren(e,t,i,n){let r=t;const s=[];for(;r!1,e.parent._insertChild(e.offset,i);const n=new ta(e,e.getShiftedBy(1));this.wrap(n,t);const r=new ea(i.parent,i.index);i._remove();const s=r.nodeBefore,o=r.nodeAfter;return s instanceof No&&o instanceof No?Pa(s,o):Ea(r)}_wrapAttributeElement(e,t){if(!Oa(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const i of e.getAttributeKeys())if("class"!==i&&"style"!==i&&t.hasAttribute(i)&&t.getAttribute(i)!==e.getAttribute(i))return!1;for(const i of e.getStyleNames())if(t.hasStyle(i)&&t.getStyle(i)!==e.getStyle(i))return!1;for(const i of e.getAttributeKeys())"class"!==i&&"style"!==i&&(t.hasAttribute(i)||this.setAttribute(i,e.getAttribute(i),t));for(const i of e.getStyleNames())t.hasStyle(i)||this.setStyle(i,e.getStyle(i),t);for(const i of e.getClassNames())t.hasClass(i)||this.addClass(i,t);return!0}_unwrapAttributeElement(e,t){if(!Oa(e,t))return!1;if(e.name!==t.name||e.priority!==t.priority)return!1;for(const i of e.getAttributeKeys())if("class"!==i&&"style"!==i&&(!t.hasAttribute(i)||t.getAttribute(i)!==e.getAttribute(i)))return!1;if(!t.hasClass(...e.getClassNames()))return!1;for(const i of e.getStyleNames())if(!t.hasStyle(i)||t.getStyle(i)!==e.getStyle(i))return!1;for(const i of e.getAttributeKeys())"class"!==i&&"style"!==i&&this.removeAttribute(i,t);return this.removeClass(Array.from(e.getClassNames()),t),this.removeStyle(Array.from(e.getStyleNames()),t),!0}_breakAttributesRange(e,t=!1){const i=e.start,n=e.end;if(Ba(e,this.document),e.isCollapsed){const i=this._breakAttributes(e.start,t);return new ta(i,i)}const r=this._breakAttributes(n,t),s=r.parent.childCount,o=this._breakAttributes(i,t);return r.offset+=r.parent.childCount-s,new ta(o,r)}_breakAttributes(e,t=!1){const i=e.offset,n=e.parent;if(e.parent.is("emptyElement"))throw new gn("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new gn("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new gn("view-writer-cannot-break-raw-element",this.document);if(!t&&n.is("$text")&&Ra(n.parent))return e.clone();if(Ra(n))return e.clone();if(n.is("$text"))return this._breakAttributes(Sa(e),t);if(i==n.childCount){const e=new ea(n.parent,n.index+1);return this._breakAttributes(e,t)}if(0===i){const e=new ea(n.parent,n.index);return this._breakAttributes(e,t)}{const e=n.index+1,r=n._clone();n.parent._insertChild(e,r),this._addToClonedElementsGroup(r);const s=n.childCount-i,o=n._removeChildren(i,s);r._appendChild(o);const a=new ea(n.parent,e);return this._breakAttributes(a,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(const t of e.getChildren())this._addToClonedElementsGroup(t);const t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i||(i=new Set,this._cloneGroups.set(t,i)),i.add(e),e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element"))for(const t of e.getChildren())this._removeFromClonedElementsGroup(t);const t=e.id;if(!t)return;const i=this._cloneGroups.get(t);i&&i.delete(e)}}function Aa(e){let t=e.parent;for(;!Ra(t);){if(!t)return;t=t.parent}return t}function Ta(e,t){return e.priorityt.priority)&&e.getIdentity()i instanceof e)))throw new gn("view-writer-insert-invalid-node-type",t);i.is("$text")||Va(i.getChildren(),t)}}function Ra(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function Ba(e,t){const i=Aa(e.start),n=Aa(e.end);if(!i||!n||i!==n)throw new gn("view-writer-invalid-range-container",t)}function Oa(e,t){return null===e.id&&null===t.id}const Fa=e=>e.createTextNode(" "),Ma=e=>{const t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText=" ",t},Na=e=>{const t=e.createElement("br");return t.dataset.ckeFiller="true",t},La=7,Da="⁠".repeat(La);function za(e){return"string"==typeof e?e.substr(0,La)===Da:lr(e)&&e.data.substr(0,La)===Da}function Ha(e){return e.data.length==La&&za(e)}function Wa(e){const t="string"==typeof e?e:e.data;return za(e)?t.slice(La):t}function $a(e,t){if(t.keyCode==Wr.arrowleft){const e=t.domTarget.ownerDocument.defaultView.getSelection();if(1==e.rangeCount&&e.getRangeAt(0).collapsed){const t=e.getRangeAt(0).startContainer,i=e.getRangeAt(0).startOffset;za(t)&&i<=La&&e.collapse(t,0)}}}class Ua extends(Ln()){domDocuments=new Set;domConverter;markedAttributes=new Set;markedChildren=new Set;markedTexts=new Set;selection;_inlineFiller=null;_fakeSelectionContainer=null;constructor(e,t){super(),this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),Ki.isBlink&&!Ki.isAndroid&&this.on("change:isSelecting",(()=>{this.isSelecting||this.render()}))}markToSync(e,t){if("text"===e)this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if("attributes"===e)this.markedAttributes.add(t);else{if("children"!==e)throw new gn("view-renderer-unknown-type",this);this.markedChildren.add(t)}}}render(){if(this.isComposing&&!Ki.isAndroid)return;let e=null;const t=!(Ki.isBlink&&!Ki.isAndroid)||!this.isSelecting;for(const e of this.markedChildren)this._updateChildrenMappings(e);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&this._inlineFiller.parentNode&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=ea._createBefore(e.parent)));for(const e of this.markedAttributes)this._updateAttrs(e);for(const t of this.markedChildren)this._updateChildren(t,{inlineFillerPosition:e});for(const t of this.markedTexts)!this.markedChildren.has(t.parent)&&this.domConverter.mapViewToDom(t.parent)&&this._updateText(t,{inlineFillerPosition:e});if(t)if(e){const t=this.domConverter.viewPositionToDom(e),i=t.parent.ownerDocument;za(t.parent)?this._inlineFiller=t.parent:this._inlineFiller=ja(i,t.parent,t.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){const t=this.domConverter.mapViewToDom(e);if(!t)return;const i=Array.from(t.childNodes),n=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),r=this._diffNodeLists(i,n),s=this._findUpdateActions(r,i,n,qa);if(-1!==s.indexOf("update")){const t={equal:0,insert:0,delete:0};for(const r of s)if("update"===r){const r=t.equal+t.insert,s=t.equal+t.delete,o=e.getChild(r);!o||o.is("uiElement")||o.is("rawElement")||this._updateElementMappings(o,i[s]),Sr(n[r]),t.equal++}else t[r]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){const e=this.selection.getFirstPosition();return e.parent.is("$text")?ea._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&lr(t.parent)&&za(t.parent))}_removeInlineFiller(){const e=this._inlineFiller;if(!za(e))throw new gn("view-renderer-filler-was-lost",this);Ha(e)?e.remove():e.data=e.data.substr(La),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const e=this.selection.getFirstPosition(),t=e.parent,i=e.offset;if(!this.domConverter.mapViewToDom(t.root))return!1;if(!t.is("element"))return!1;if(!function(e){if("false"==e.getAttribute("contenteditable"))return!1;const t=e.findAncestor((e=>e.hasAttribute("contenteditable")));return!t||"true"==t.getAttribute("contenteditable")}(t))return!1;const n=e.nodeBefore,r=e.nodeAfter;return!(n instanceof No||r instanceof No)&&(!!(i!==t.getFillerOffset()||n&&n.is("element","br"))&&(!Ki.isAndroid||!n&&!r))}_updateText(e,t){const i=this.domConverter.findCorrespondingDomText(e);let n=this.domConverter.viewToDom(e).data;const r=t.inlineFillerPosition;r&&r.parent==e.parent&&r.offset==e.index&&(n=Da+n),this._updateTextNode(i,n)}_updateAttrs(e){const t=this.domConverter.mapViewToDom(e);if(t){for(const i of Array.from(t.attributes)){const n=i.name;e.hasAttribute(n)||this.domConverter.removeDomElementAttribute(t,n)}for(const i of e.getAttributeKeys())this.domConverter.setDomElementAttribute(t,i,e.getAttribute(i),e)}}_updateChildren(e,t){const i=this.domConverter.mapViewToDom(e);if(!i)return;if(Ki.isAndroid){let e=null;for(const t of Array.from(i.childNodes)){if(e&&lr(e)&&lr(t)){i.normalize();break}e=t}}const n=t.inlineFillerPosition,r=i.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));n&&n.parent===e&&ja(i.ownerDocument,s,n.offset);const o=this._diffNodeLists(r,s),a=this._findUpdateActions(o,r,s,Ga);let l=0;const c=new Set;for(const e of a)"delete"===e?(c.add(r[l]),Sr(r[l])):"equal"!==e&&"update"!==e||l++;l=0;for(const e of a)"insert"===e?(yr(i,l,s[l]),l++):"update"===e?(this._updateTextNode(r[l],s[l].data),l++):"equal"===e&&(this._markDescendantTextToSync(this.domConverter.domToView(s[l])),l++);for(const e of c)e.parentNode||this.domConverter.unbindDomElement(e)}_diffNodeLists(e,t){return e=function(e,t){const i=Array.from(e);if(0==i.length||!t)return i;const n=i[i.length-1];n==t&&i.pop();return i}(e,this._fakeSelectionContainer),an(e,t,Ka.bind(null,this.domConverter))}_findUpdateActions(e,t,i,n){if(-1===e.indexOf("insert")||-1===e.indexOf("delete"))return e;let r=[],s=[],o=[];const a={equal:0,insert:0,delete:0};for(const l of e)"insert"===l?o.push(i[a.equal+a.insert]):"delete"===l?s.push(t[a.equal+a.delete]):(r=r.concat(an(s,o,n).map((e=>"equal"===e?"update":e))),r.push("equal"),s=[],o=[]),a[l]++;return r.concat(an(s,o,n).map((e=>"equal"===e?"update":e)))}_updateTextNode(e,t){const i=e.data;i!=t&&(Ki.isAndroid&&this.isComposing&&i.replace(/\u00A0/g," ")==t.replace(/\u00A0/g," ")||this._updateTextNodeInternal(e,t))}_updateTextNodeInternal(e,t){const i=rn(e.data,t);for(const t of i)"insert"===t.type?e.insertData(t.index,t.values.join("")):e.deleteData(t.index,t.howMany)}_markDescendantTextToSync(e){if(e)if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(const t of e.getChildren())this._markDescendantTextToSync(t)}_updateSelection(){if(Ki.isBlink&&!Ki.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const e=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&e&&(this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&Ki.isAndroid||this._updateDomSelection(e))}_updateFakeSelection(e){const t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(e){const t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent=" ",t}(t));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(e))return;i.parentElement&&i.parentElement==e||e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const n=t.getSelection(),r=t.createRange();n.removeAllRanges(),r.selectNodeContents(i),n.addRange(r)}_updateDomSelection(e){const t=e.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(t))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),n=this.domConverter.viewPositionToDom(this.selection.focus);t.setBaseAndExtent(i.parent,i.offset,n.parent,n.offset),Ki.isGecko&&function(e,t){let i=e.parent,n=e.offset;lr(i)&&Ha(i)&&(n=vr(i)+1,i=i.parentNode);if(i.nodeType!=Node.ELEMENT_NODE||n!=i.childNodes.length-1)return;const r=i.childNodes[n];r&&"BR"==r.tagName&&t.addRange(t.getRangeAt(0))}(n,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;const t=e&&this.domConverter.domSelectionToView(e);return(!t||!this.selection.isEqual(t))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){const t=this._fakeSelectionContainer,i=e.ownerDocument.getSelection();return!t||t.parentElement!==e||(i.anchorNode!==t&&!t.contains(i.anchorNode)||t.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const e of this.domDocuments){const t=e.getSelection();if(t.rangeCount){const i=e.activeElement,n=this.domConverter.mapDomToView(i);i&&n&&t.removeAllRanges()}}}_removeFakeSelection(){const e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){const e=this.selection.editableElement;e&&this.domConverter.focus(e)}}}function ja(e,t,i){const n=t instanceof Array?t:t.childNodes,r=n[i];if(lr(r))return r.data=Da+r.data,r;{const r=e.createTextNode(Da);return Array.isArray(t)?n.splice(i,0,r):yr(t,i,r),r}}function qa(e,t){return Yn(e)&&Yn(t)&&!lr(e)&&!lr(t)&&!kr(e)&&!kr(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Ga(e,t){return Yn(e)&&Yn(t)&&lr(e)&&lr(t)}function Ka(e,t,i){return t===i||(lr(t)&&lr(i)?t.data===i.data:!(!e.isBlockFiller(t)||!e.isBlockFiller(i)))}const Za=Na(ji.document),Ja=Fa(ji.document),Qa=Ma(ji.document),Ya="data-ck-unsafe-attribute-",Xa="data-ck-unsafe-element";class el{document;renderingMode;blockFillerMode;preElements;blockElements;inlineObjectElements;unsafeElements;_domDocument;_domToViewMapping=new WeakMap;_viewToDomMapping=new WeakMap;_fakeSelectionMapping=new WeakMap;_rawContentElementMatcher=new Do;_inlineObjectElementMatcher=new Do;_elementsWithTemporaryCustomProperties=new Set;constructor(e,{blockFillerMode:t,renderingMode:i="editing"}={}){this.document=e,this.renderingMode=i,this.blockFillerMode=t||("editing"===i?"br":"nbsp"),this.preElements=["pre","textarea"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument="editing"===this.renderingMode?ji.document:ji.document.implementation.createHTMLDocument("")}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new na(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){const t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(const t of e.children)this.unbindDomElement(t)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,i){return"data"===this.renderingMode||!(e=e.toLowerCase()).startsWith("on")&&(("srcdoc"!==e||!t.match(/\bon\S+\s*=|javascript:|<\s*\/*script/i))&&("img"===i&&("src"===e||"srcset"===e)||("source"===i&&"srcset"===e||!t.match(/^\s*(javascript:|data:(image\/svg|text\/x?html))/i))))}setContentOf(e,t){if("data"===this.renderingMode)return void(e.innerHTML=t);const i=(new DOMParser).parseFromString(t,"text/html"),n=i.createDocumentFragment(),r=i.body.childNodes;for(;r.length>0;)n.appendChild(r[0]);const s=i.createTreeWalker(n,NodeFilter.SHOW_ELEMENT),o=[];let a;for(;a=s.nextNode();)o.push(a);for(const e of o){for(const t of e.getAttributeNames())this.setDomElementAttribute(e,t,e.getAttribute(t));const t=e.tagName.toLowerCase();this._shouldRenameElement(t)&&(nl(t),e.replaceWith(this._createReplacementDomElement(t,e)))}for(;e.firstChild;)e.firstChild.remove();e.append(n)}viewToDom(e,t={}){if(e.is("$text")){const t=this._processDataFromViewText(e);return this._domDocument.createTextNode(t)}{const i=e;if(this.mapViewToDom(i)){if(!i.getCustomProperty("editingPipeline:doNotReuseOnce"))return this.mapViewToDom(i);this._elementsWithTemporaryCustomProperties.add(i)}let n;if(i.is("documentFragment"))n=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(n,i);else{if(i.is("uiElement"))return n="$comment"===i.name?this._domDocument.createComment(i.getCustomProperty("$rawContent")):i.render(this._domDocument,this),t.bind&&this.bindElements(n,i),n;this._shouldRenameElement(i.name)?(nl(i.name),n=this._createReplacementDomElement(i.name)):n=i.hasAttribute("xmlns")?this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(n,this),t.bind&&this.bindElements(n,i);for(const e of i.getAttributeKeys())this.setDomElementAttribute(n,e,i.getAttribute(e),i)}if(!1!==t.withChildren)for(const e of this.viewChildrenToDom(i,t))n instanceof HTMLTemplateElement?n.content.appendChild(e):n.appendChild(e);return n}}setDomElementAttribute(e,t,i,n){const r=this.shouldRenderAttribute(t,i,e.tagName.toLowerCase())||n&&n.shouldRenderUnsafeAttribute(t);r||fn("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:i}),Cr(t)?(e.hasAttribute(t)&&!r?e.removeAttribute(t):e.hasAttribute(Ya+t)&&r&&e.removeAttribute(Ya+t),e.setAttribute(r?t:Ya+t,i)):fn("domconverter-invalid-attribute-detected",{domElement:e,key:t,value:i})}removeDomElementAttribute(e,t){t!=Xa&&(e.removeAttribute(t),e.removeAttribute(Ya+t))}*viewChildrenToDom(e,t={}){const i=e.getFillerOffset&&e.getFillerOffset();let n=0;for(const r of e.getChildren()){i===n&&(yield this._getBlockFiller());const e=r.is("element")&&!!r.getCustomProperty("dataPipeline:transparentRendering")&&!ts(r.getAttributes());if(e&&"data"==this.renderingMode)if(r.is("rawElement")){const e=this._domDocument.createElement(r.name);r.render(e,this),yield*[...e.childNodes]}else yield*this.viewChildrenToDom(r,t);else e&&fn("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:r}),yield this.viewToDom(r,t);n++}i===n&&(yield this._getBlockFiller())}viewRangeToDom(e){const t=this.viewPositionToDom(e.start),i=this.viewPositionToDom(e.end),n=this._domDocument.createRange();return n.setStart(t.parent,t.offset),n.setEnd(i.parent,i.offset),n}viewPositionToDom(e){const t=e.parent;if(t.is("$text")){const i=this.findCorrespondingDomText(t);if(!i)return null;let n=e.offset;return za(i)&&(n+=La),{parent:i,offset:n}}{let i,n,r;if(0===e.offset){if(i=this.mapViewToDom(t),!i)return null;r=i.childNodes[0]}else{const t=e.nodeBefore;if(n=t.is("$text")?this.findCorrespondingDomText(t):this.mapViewToDom(t),!n)return null;i=n.parentNode,r=n.nextSibling}if(lr(r)&&za(r))return{parent:r,offset:La};return{parent:i,offset:n?vr(n)+1:0}}}domToView(e,t={}){const i=[],n=this._domToView(e,t,i),r=n.next().value;return r?(n.next(),this._processDomInlineNodes(null,i,t),r.is("$text")&&0==r.data.length?null:r):null}*domChildrenToView(e,t={},i=[]){let n=[];n=e instanceof HTMLTemplateElement?[...e.content.childNodes]:[...e.childNodes];for(let r=0;r{const{scrollLeft:t,scrollTop:i}=e;n.push([t,i])})),t.focus(),tl(t,(e=>{const[t,i]=n.shift();e.scrollLeft=t,e.scrollTop=i})),ji.window.scrollTo(e,i)}}_clearDomSelection(){const e=this.mapViewToDom(this.document.selection.editableElement);if(!e)return;const t=e.ownerDocument.defaultView.getSelection(),i=this.domSelectionToView(t);i&&i.rangeCount>0&&t.removeAllRanges()}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return"br"==this.blockFillerMode?e.isEqualNode(Za):!("BR"!==e.tagName||!il(e,this.blockElements)||1!==e.parentNode.childNodes.length)||(e.isEqualNode(Qa)||function(e,t){const i=e.isEqualNode(Ja);return i&&il(e,t)&&1===e.parentNode.childNodes.length}(e,this.blockElements))}isDomSelectionBackward(e){if(e.isCollapsed)return!1;const t=this._domDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch(e){return!1}const i=t.collapsed;return t.detach(),i}getHostViewElement(e){const t=rr(e);for(t.pop();t.length;){const e=t.pop(),i=this._domToViewMapping.get(e);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}registerInlineObjectMatcher(e){this._inlineObjectElementMatcher.add(e)}_clearTemporaryCustomProperties(){for(const e of this._elementsWithTemporaryCustomProperties)e._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return Fa(this._domDocument);case"markedNbsp":return Ma(this._domDocument);case"br":return Na(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(lr(e)&&za(e)&&t0?t[e-1]:null,l=e+1e.is("element")&&t.includes(e.name)))}(e,this.preElements))return!0;for(const t of e.getAncestors({parentFirst:!0}))if(t.is("element")&&t.hasStyle("white-space")&&"inherit"!==t.getStyle("white-space"))return["pre","pre-wrap","break-spaces"].includes(t.getStyle("white-space"));return!1}_getTouchingInlineViewNode(e,t){const i=new Xo({startPosition:t?ea._createAfter(e):ea._createBefore(e),direction:t?"forward":"backward"});for(const{item:e}of i){if(e.is("$textProxy"))return e;if(!e.is("element")||!e.getCustomProperty("dataPipeline:transparentRendering")){if(e.is("element","br"))return null;if(this._isInlineObjectElement(e))return e;if(e.is("containerElement"))return null}}return null}_isBlockDomElement(e){return this.isElement(e)&&this.blockElements.includes(e.tagName.toLowerCase())}_isBlockViewElement(e){return e.is("element")&&this.blockElements.includes(e.name)}_isInlineObjectElement(e){return!!e.is("element")&&("br"==e.name||this.inlineObjectElements.includes(e.name)||!!this._inlineObjectElementMatcher.match(e))}_createViewElement(e,t){if(kr(e))return new ba(this.document,"$comment");const i=t.keepOriginalCase?e.tagName:e.tagName.toLowerCase();return new qo(this.document,i)}_isViewElementWithRawContent(e,t){return!1!==t.withChildren&&e.is("element")&&!!this._rawContentElementMatcher.match(e)}_shouldRenameElement(e){const t=e.toLowerCase();return"editing"===this.renderingMode&&this.unsafeElements.includes(t)}_createReplacementDomElement(e,t){const i=this._domDocument.createElement("span");if(i.setAttribute(Xa,e),t){for(;t.firstChild;)i.appendChild(t.firstChild);for(const e of t.getAttributeNames())i.setAttribute(e,t.getAttribute(e))}return i}}function tl(e,t){let i=e;for(;i;)t(i),i=i.parentElement}function il(e,t){const i=e.parentNode;return!!i&&!!i.tagName&&t.includes(i.tagName.toLowerCase())}function nl(e){"script"===e&&fn("domconverter-unsafe-script-element-detected"),"style"===e&&fn("domconverter-unsafe-style-element-detected")}class rl extends(tr()){view;document;_isEnabled=!1;constructor(e){super(),this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&3===e.nodeType&&(e=e.parentNode),!(!e||1!==e.nodeType)&&e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}class sl{view;document;domEvent;domTarget;constructor(e,t,i){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Us(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class ol extends rl{useCapture=!1;usePassive=!1;observe(e){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach((t=>{this.listenTo(e,t,((e,t)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(t.target)&&this.onDomEvent(t)}),{useCapture:this.useCapture,usePassive:this.usePassive})}))}stopObserving(e){this.stopListening(e)}fire(e,t,i){this.isEnabled&&this.document.fire(e,new sl(this.view,t,i))}}class al extends ol{domEventType=["keydown","keyup"];onDomEvent(e){const t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return Ur(this)}};this.fire(e.type,e,t)}}class ll extends rl{_fireSelectionChangeDoneDebounced;constructor(e){super(e),this._fireSelectionChangeDoneDebounced=no((e=>{this.document.fire("selectionChangeDone",e)}),200)}observe(){const e=this.document;e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&i.preventDefault()}),{context:"$capture"}),e.on("arrowKey",((t,i)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)}),{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){const t=this.document.selection,i=new na(t.getRanges(),{backward:t.isBackward,fake:!1});e!=Wr.arrowleft&&e!=Wr.arrowup||i.setTo(i.getFirstPosition()),e!=Wr.arrowright&&e!=Wr.arrowdown||i.setTo(i.getLastPosition());const n={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",n),this._fireSelectionChangeDoneDebounced(n)}}class cl extends rl{domConverter;_config;_domElements;_mutationObserver;constructor(e){super(e),this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=e.domConverter,this._domElements=new Set,this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.add(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}stopObserving(e){if(this._domElements.delete(e),this.isEnabled){this._mutationObserver.disconnect();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}}enable(){super.enable();for(const e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(0===e.length)return;const t=this.domConverter,i=new Set,n=new Set;for(const i of e){const e=t.mapDomToView(i.target);e&&(e.is("uiElement")||e.is("rawElement")||"childList"!==i.type||this._isBogusBrMutation(i)||n.add(e))}for(const r of e){const e=t.mapDomToView(r.target);if((!e||!e.is("uiElement")&&!e.is("rawElement"))&&"characterData"===r.type){const e=t.findCorrespondingViewText(r.target);e&&!n.has(e.parent)?i.add(e):!e&&za(r.target)&&n.add(t.mapDomToView(r.target.parentNode))}}const r=[];for(const e of i)r.push({type:"text",node:e});for(const e of n){const i=t.mapViewToDom(e),n=Array.from(e.getChildren()),s=Array.from(t.domChildrenToView(i,{withChildren:!1}));Ao(n,s,hl)||r.push({type:"children",node:e})}r.length&&this.document.fire("mutations",{mutations:r})}_isBogusBrMutation(e){let t=null;return null===e.nextSibling&&0===e.removedNodes.length&&1==e.addedNodes.length&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}}function hl(e,t){if(!Array.isArray(e))return e===t||!(!e.is("$text")||!t.is("$text"))&&e.data===t.data}class dl extends ol{_renderTimeoutId=null;_isFocusChanging=!1;domEventType=["focus","blur"];constructor(e){super(e),this.useCapture=!0;const t=this.document;t.on("focus",(()=>this._handleFocus())),t.on("blur",((e,t)=>this._handleBlur(t))),t.on("beforeinput",(()=>{t.isFocused||this._handleFocus()}),{priority:"highest"})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._clearTimeout(),super.destroy()}_handleFocus(){this._clearTimeout(),this._isFocusChanging=!0,this._renderTimeoutId=setTimeout((()=>{this._renderTimeoutId=null,this.flush(),this.view.change((()=>{}))}),50)}_handleBlur(e){const t=this.document.selection.editableElement;null!==t&&t!==e.target||(this.document.isFocused=!1,this._isFocusChanging=!1,this.view.change((()=>{})))}_clearTimeout(){this._renderTimeoutId&&(clearTimeout(this._renderTimeoutId),this._renderTimeoutId=null)}}class ul extends rl{mutationObserver;focusObserver;selection;domConverter;_documents;_fireSelectionChangeDoneDebounced;_clearInfiniteLoopInterval;_documentIsSelectingInactivityTimeoutDebounced;_loopbackCounter;constructor(e){super(e),this.mutationObserver=e.getObserver(cl),this.focusObserver=e.getObserver(dl),this.selection=this.document.selection,this.domConverter=e.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=no((e=>{this.document.fire("selectionChangeDone",e)}),200),this._clearInfiniteLoopInterval=setInterval((()=>this._clearInfiniteLoop()),1e3),this._documentIsSelectingInactivityTimeoutDebounced=no((()=>this.document.isSelecting=!1),5e3),this._loopbackCounter=0}observe(e){const t=e.ownerDocument,i=()=>{this.document.isSelecting&&(this._handleSelectionChange(t),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",(()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()}),{priority:"highest"}),this.listenTo(e,"keydown",i,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",i,{priority:"highest",useCapture:!0}),this._documents.has(t)||(this.listenTo(t,"mouseup",i,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",(()=>{this.document.isComposing&&!Ki.isAndroid||(this._handleSelectionChange(t),this._documentIsSelectingInactivityTimeoutDebounced())})),this.listenTo(this.view.document,"compositionstart",(()=>{this._handleSelectionChange(t)}),{priority:"lowest"}),this._documents.add(t))}stopObserving(e){this.stopListening(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(e){if(!this.isEnabled)return;const t=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(t.anchorNode))return;this.mutationObserver.flush();const i=this.domConverter.domSelectionToView(t);if(0!=i.rangeCount){if(this.view.hasDomSelection=!0,this.focusObserver.flush(),!this.selection.isEqual(i)||!this.domConverter.isDomSelectionCorrect(t))if(++this._loopbackCounter>60)this._reportInfiniteLoop();else if(this.selection.isSimilar(i))this.view.forceRender();else{const e={oldSelection:this.selection,newSelection:i,domSelection:t};this.document.fire("selectionChange",e),this._fireSelectionChangeDoneDebounced(e)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class ml extends ol{domEventType=["compositionstart","compositionupdate","compositionend"];constructor(e){super(e);const t=this.document;t.on("compositionstart",(()=>{t.isComposing=!0}),{priority:"low"}),t.on("compositionend",(()=>{t.isComposing=!1}),{priority:"low"})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}}class gl{_files;_native;constructor(e,t={}){this._files=t.cacheFiles?fl(e):null,this._native=e}get files(){return this._files||(this._files=fl(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}setDragImage(e,t,i){this._native.setDragImage(e,t,i)}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}function fl(e){const t=Array.from(e.files||[]),i=Array.from(e.items||[]);return t.length?t:i.filter((e=>"file"===e.kind)).map((e=>e.getAsFile()))}class pl extends ol{domEventType="beforeinput";onDomEvent(e){const t=e.getTargetRanges(),i=this.view,n=i.document;let r=null,s=null,o=[];if(e.dataTransfer&&(r=new gl(e.dataTransfer)),null!==e.data?s=e.data:r&&(s=r.getData("text/plain")),n.selection.isFake)o=Array.from(n.selection.getRanges());else if(t.length)o=t.map((e=>{const t=i.domConverter.domPositionToView(e.startContainer,e.startOffset),n=i.domConverter.domPositionToView(e.endContainer,e.endOffset);return t?i.createRange(t,n):n?i.createRange(n):void 0})).filter((e=>!!e));else if(Ki.isAndroid){const t=e.target.ownerDocument.defaultView.getSelection();o=Array.from(i.domConverter.domSelectionToView(t).getRanges())}if(Ki.isAndroid&&"insertCompositionText"==e.inputType&&s&&s.endsWith("\n"))this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[i.createRange(o[0].end)]});else if("insertText"==e.inputType&&s&&s.includes("\n")){const t=s.split(/\n{1,2}/g);let i=o;for(let s=0;s{if(this.isEnabled&&((i=t.keyCode)==Wr.arrowright||i==Wr.arrowleft||i==Wr.arrowup||i==Wr.arrowdown)){const i=new sa(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(i,t),i.stop.called&&e.stop()}var i}))}observe(){}stopObserving(){}}class bl extends rl{constructor(e){super(e);const t=this.document;t.on("keydown",((e,i)=>{if(!this.isEnabled||i.keyCode!=Wr.tab||i.ctrlKey)return;const n=new sa(t,"tab",t.selection.getFirstRange());t.fire(n,i),n.stop.called&&e.stop()}))}observe(){}stopObserving(){}}class _l extends(Ln()){document;domConverter;domRoots=new Map;_renderer;_initialDomRootAttributes=new WeakMap;_observers=new Map;_writer;_ongoingChange=!1;_postFixersInProgress=!1;_renderingDisabled=!1;_hasChangedSinceTheLastRendering=!1;constructor(e){super(),this.document=new ua(e),this.domConverter=new el(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Ua(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new xa(this.document),this.addObserver(cl),this.addObserver(dl),this.addObserver(ul),this.addObserver(al),this.addObserver(ll),this.addObserver(ml),this.addObserver(wl),this.addObserver(pl),this.addObserver(bl),this.document.on("arrowKey",$a,{priority:"low"}),_a(this),this.on("render",(()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1})),this.listenTo(this.document.selection,"change",(()=>{this._hasChangedSinceTheLastRendering=!0})),this.listenTo(this.document,"change:isFocused",(()=>{this._hasChangedSinceTheLastRendering=!0})),Ki.isiOS&&this.listenTo(this.document,"blur",((e,t)=>{this.domConverter.mapDomToView(t.domEvent.relatedTarget)||this.domConverter._clearDomSelection()})),this.listenTo(this.document,"mutations",((e,{mutations:t})=>{t.forEach((e=>this._renderer.markToSync(e.type,e.node)))}),{priority:"low"}),this.listenTo(this.document,"mutations",(()=>{this.forceRender()}),{priority:"lowest"})}attachDomRoot(e,t="main"){const i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();const n={};for(const{name:t,value:r}of Array.from(e.attributes))n[t]=r,"class"===t?this._writer.addClass(r.split(" "),i):i.hasAttribute(t)||this._writer.setAttribute(t,r,i);this._initialDomRootAttributes.set(e,n);const r=()=>{this._writer.setAttribute("contenteditable",(!i.isReadOnly).toString(),i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};r(),this.domRoots.set(t,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(e.ownerDocument),i.on("change:children",((e,t)=>this._renderer.markToSync("children",t))),i.on("change:attributes",((e,t)=>this._renderer.markToSync("attributes",t))),i.on("change:text",((e,t)=>this._renderer.markToSync("text",t))),i.on("change:isReadOnly",(()=>this.change(r))),i.on("change",(()=>{this._hasChangedSinceTheLastRendering=!0}));for(const i of this._observers.values())i.observe(e,t)}detachDomRoot(e){const t=this.domRoots.get(e);Array.from(t.attributes).forEach((({name:e})=>t.removeAttribute(e)));const i=this._initialDomRootAttributes.get(t);for(const e in i)t.setAttribute(e,i[e]);this.domRoots.delete(e),this.domConverter.unbindDomElement(t);for(const e of this._observers.values())e.stopObserving(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(const[e,i]of this.domRoots)t.observe(i,e);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(const e of this._observers.values())e.disable()}enableObservers(){for(const e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:t,viewportOffset:i=20,ancestorOffset:n=20}={}){const r=this.document.selection.getFirstRange();if(!r)return;const s=To({alignToTop:e,forceScroll:t,viewportOffset:i,ancestorOffset:n});"number"==typeof i&&(i={top:i,bottom:i,left:i,right:i});const o={target:this.domConverter.viewRangeToDom(r),viewportOffset:i,ancestorOffset:n,alignToTop:e,forceScroll:t};this.fire("scrollToTheSelection",o,s),Pr(o)}focus(){if(!this.document.isFocused){const e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new gn("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;const t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(e){gn.rethrowUnexpectedError(e,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(dl).flush(),this.change((()=>{}))}destroy(){for(const e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return ea._createAt(e,t)}createPositionAfter(e){return ea._createAfter(e)}createPositionBefore(e){return ea._createBefore(e)}createRange(e,t){return new ta(e,t)}createRangeOn(e){return ta._createOn(e)}createRangeIn(e){return ta._createIn(e)}createSelection(...e){return new na(...e)}_disableRendering(e){this._renderingDisabled=e,0==e&&this.change((()=>{}))}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}class vl{is(){throw new Error("is() method is abstract")}}let yl=class extends vl{parent=null;_attrs;_index=null;_startOffset=null;constructor(e){super(),this._attrs=as(e)}get document(){return null}get index(){return this._index}get startOffset(){return this._startOffset}get offsetSize(){return 1}get endOffset(){return null===this.startOffset?null:this.startOffset+this.offsetSize}get nextSibling(){const e=this.index;return null!==e&&this.parent.getChild(e+1)||null}get previousSibling(){const e=this.index;return null!==e&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return null!==this.parent&&this.root.isAttached()}getPath(){const e=[];let t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){const i=this.getAncestors(t),n=e.getAncestors(t);let r=0;for(;i[r]==n[r]&&i[r];)r++;return 0===r?null:i[r-1]}isBefore(e){if(this==e)return!1;if(this.root!==e.root)return!1;const t=this.getPath(),i=e.getPath(),n=qn(t,i);switch(n){case"prefix":return!0;case"extension":return!1;default:return t[n](e[t[0]]=t[1],e)),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=as(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}};yl.prototype.is=function(e){return"node"===e||"model:node"===e};class kl{_nodes=[];_offsetToNode=[];constructor(e){e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._offsetToNode.length}getNode(e){return this._nodes[e]||null}getNodeAtOffset(e){return this._offsetToNode[e]||null}getNodeIndex(e){return e.index}getNodeStartOffset(e){return e.startOffset}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;const t=this._nodes[e];if(!t)throw new gn("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){if(e==this._offsetToNode.length)return this._nodes.length;const t=this._offsetToNode[e];if(!t)throw new gn("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.getNodeIndex(t)}_insertNodes(e,t){for(const e of t)if(!(e instanceof yl))throw new gn("model-nodelist-insertnodes-not-node",this);const i=Array.from(t),n=function(e){const t=[];for(const i of e){const e=t.length;t.length+=i.offsetSize,t.fill(i,e)}return t}(i);let r=this.indexToOffset(e);this._nodes=ls(this._nodes,i,e,0),this._offsetToNode=ls(this._offsetToNode,n,r,0);for(let t=e;te.toJSON()))}}class Cl extends yl{_data;constructor(e,t){super(t),this._data=e||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){const e=super.toJSON();return e.data=this.data,e}_clone(){return new Cl(this.data,this.getAttributes())}static fromJSON(e){return new Cl(e.data,e.attributes)}}Cl.prototype.is=function(e){return"$text"===e||"model:$text"===e||"text"===e||"model:text"===e||"node"===e||"model:node"===e};class xl extends vl{textNode;data;offsetInText;constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new gn("model-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.offsetSize)throw new gn("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}getPath(){const e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){const t=[];let i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}xl.prototype.is=function(e){return"$textProxy"===e||"model:$textProxy"===e||"textProxy"===e||"model:textProxy"===e};class Al extends yl{name;_children=new kl;constructor(e,t,i){super(t),this.name=e,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}offsetToIndex(e){return this._children.offsetToIndex(e)}getNodeByPath(e){let t=this;for(const i of e)t=t.getChildAtOffset(i);return t}findAncestor(e,t={}){let i=t.includeSelf?this:this.parent;for(;i;){if(i.name===e)return i;i=i.parent}return null}toJSON(){const e=super.toJSON();if(e.name=this.name,this._children.length>0){e.children=[];for(const t of this._children)e.children.push(t.toJSON())}return e}_clone(e=!1){const t=e?Array.from(this._children).map((e=>e._clone(!0))):void 0;return new Al(this.name,this.getAttributes(),t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){if("string"==typeof e)return[new Cl(e)];Gn(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new Cl(e):e instanceof xl?new Cl(e.data,e.getAttributes()):e))}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}static fromJSON(e){let t;if(e.children){t=[];for(const i of e.children)i.name?t.push(Al.fromJSON(i)):t.push(Cl.fromJSON(i))}return new Al(e.name,e.attributes,t)}}Al.prototype.is=function(e,t){return t?t===this.name&&("element"===e||"model:element"===e):"element"===e||"model:element"===e||"node"===e||"model:node"===e};class Tl{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;_visitedParent;constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new gn("model-tree-walker-no-start-position",null);const t=e.direction||"forward";if("forward"!=t&&"backward"!=t)throw new gn("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=Sl._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i,n,r;do{n=this.position,r=this._visitedParent,({done:t,value:i}=this.next())}while(!t&&e(i));t||(this._position=n,this._visitedParent=r)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const e=this.position,t=this.position.clone(),i=this._visitedParent;if(null===i.parent&&t.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};const n=Pl(t,i),r=n||Il(t,i,n);if(r instanceof Al){if(this.shallow){if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}else t.path.push(0),this._visitedParent=r;return this._position=t,El("elementStart",r,e,t,1)}if(r instanceof Cl){let n;if(this.singleCharacters)n=1;else{let e=r.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsete&&(e=this.boundaries.start.offset),n=t.offset-e}const r=t.offset-s.startOffset,o=new xl(s,r-n,n);return t.offset-=n,this._position=t,El("text",o,e,t,n)}return t.path.pop(),this._position=t,this._visitedParent=i.parent,El("elementStart",i,e,t,1)}}function El(e,t,i,n,r){return{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:n,length:r}}}class Sl extends vl{root;path;stickiness;constructor(e,t,i="toNone"){if(super(),!e.is("element")&&!e.is("documentFragment"))throw new gn("model-position-root-invalid",e);if(!(t instanceof Array)||0===t.length)throw new gn("model-position-path-incorrect-format",e,{path:t});e.is("rootElement")?t=t.slice():(t=[...e.getPath(),...t],e=e.root),this.root=e,this.path=t,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(e){this.path[this.path.length-1]=e}get parent(){let e=this.root;for(let t=0;t1)return!1;if(1===t)return Rl(e,this,i);if(-1===t)return Rl(this,e,i)}return this.path.length===e.path.length||(this.path.length>e.path.length?Bl(this.path,t):Bl(e.path,t))}hasSameParentAs(e){if(this.root!==e.root)return!1;return"same"==qn(this.getParentPath(),e.getParentPath())}getTransformedByOperation(e){let t;switch(e.type){case"insert":t=this._getTransformedByInsertOperation(e);break;case"move":case"remove":case"reinsert":t=this._getTransformedByMoveOperation(e);break;case"split":t=this._getTransformedBySplitOperation(e);break;case"merge":t=this._getTransformedByMergeOperation(e);break;default:t=Sl._createAt(this)}return t}_getTransformedByInsertOperation(e){return this._getTransformedByInsertion(e.position,e.howMany)}_getTransformedByMoveOperation(e){return this._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany)}_getTransformedBySplitOperation(e){const t=e.movedRange;return t.containsPosition(this)||t.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(e.splitPosition,e.moveTargetPosition):e.graveyardPosition?this._getTransformedByMove(e.graveyardPosition,e.insertionPosition,1):this._getTransformedByInsertion(e.insertionPosition,1)}_getTransformedByMergeOperation(e){const t=e.movedRange;let i;return t.containsPosition(this)||t.start.isEqual(this)?(i=this._getCombined(e.sourcePosition,e.targetPosition),e.sourcePosition.isBefore(e.targetPosition)&&(i=i._getTransformedByDeletion(e.deletionPosition,1))):i=this.isEqual(e.deletionPosition)?Sl._createAt(e.deletionPosition):this._getTransformedByMove(e.deletionPosition,e.graveyardPosition,1),i}_getTransformedByDeletion(e,t){const i=Sl._createAt(this);if(this.root!=e.root)return i;if("same"==qn(e.getParentPath(),this.getParentPath())){if(e.offsetthis.offset)return null;i.offset-=t}}else if("prefix"==qn(e.getParentPath(),this.getParentPath())){const n=e.path.length-1;if(e.offset<=this.path[n]){if(e.offset+t>this.path[n])return null;i.path[n]-=t}}return i}_getTransformedByInsertion(e,t){const i=Sl._createAt(this);if(this.root!=e.root)return i;if("same"==qn(e.getParentPath(),this.getParentPath()))(e.offset=t;){if(e.path[n]+r!==i.maxOffset)return!1;r=1,n--,i=i.parent}return!0}(e,i+1))}function Bl(e,t){for(;tt+1;){const t=n.maxOffset-i.offset;0!==t&&e.push(new Ol(i,i.getShiftedBy(t))),i.path=i.path.slice(0,-1),i.offset++,n=n.parent}for(;i.path.length<=this.end.path.length;){const t=this.end.path[i.path.length-1],n=t-i.offset;0!==n&&e.push(new Ol(i,i.getShiftedBy(n))),i.offset=t,i.path.push(0)}return e}getWalker(e={}){return e.boundaries=this,new Tl(e)}*getItems(e={}){e.boundaries=this,e.ignoreElementEnd=!0;const t=new Tl(e);for(const e of t)yield e.item}*getPositions(e={}){e.boundaries=this;const t=new Tl(e);yield t.position;for(const e of t)yield e.nextPosition}getTransformedByOperation(e){switch(e.type){case"insert":return this._getTransformedByInsertOperation(e);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(e);case"split":return[this._getTransformedBySplitOperation(e)];case"merge":return[this._getTransformedByMergeOperation(e)]}return[new Ol(this.start,this.end)]}getTransformedByOperations(e){const t=[new Ol(this.start,this.end)];for(const i of e)for(let e=0;e0?new this(i,n):new this(n,i)}static _createIn(e){return new this(Sl._createAt(e,0),Sl._createAt(e,e.maxOffset))}static _createOn(e){return this._createFromPositionAndShift(Sl._createBefore(e),e.offsetSize)}static _createFromRanges(e){if(0===e.length)throw new gn("range-create-from-ranges-empty-array",null);if(1==e.length)return e[0].clone();const t=e[0];e.sort(((e,t)=>e.start.isAfter(t.start)?1:-1));const i=e.indexOf(t),n=new this(t.start,t.end);for(let t=i-1;t>=0&&e[t].end.isEqual(n.start);t--)n.start=Sl._createAt(e[t].start);for(let t=i+1;t{if(t.viewPosition)return;const i=this._modelToViewMapping.get(t.modelPosition.parent);if(!i)throw new gn("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)}),{priority:"low"}),this.on("viewToModelPosition",((e,t)=>{if(t.modelPosition)return;const i=this.findMappedViewAncestor(t.viewPosition),n=this._viewToModelMapping.get(i),r=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=Sl._createAt(n,r)}),{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){const i=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(const t of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(t);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e),this._modelToViewMapping.get(i)==e&&this._modelToViewMapping.delete(i))}unbindModelElement(e){const t=this.toViewElement(e);this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e&&this._viewToModelMapping.delete(t)}bindElementToMarker(e,t){const i=this._markerNameToElements.get(t)||new Set;i.add(e);const n=this._elementToMarkerNames.get(e)||new Set;n.add(t),this._markerNameToElements.set(t,i),this._elementToMarkerNames.set(e,n)}unbindElementFromMarkerName(e,t){const i=this._markerNameToElements.get(t);i&&(i.delete(e),0==i.size&&this._markerNameToElements.delete(t));const n=this._elementToMarkerNames.get(e);n&&(n.delete(t),0==n.size&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){const e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(const[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new Ol(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new ta(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){const t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){const i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(e){const t=this._markerNameToElements.get(e);if(!t)return null;const i=new Set;for(const e of t)if(e.is("attributeElement"))for(const t of e.getElementsWithSameId())i.add(t);else i.add(e);return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,i){if(i!=e){return this._toModelOffset(e.parent,e.index,i)+this._toModelOffset(e,t,e)}if(e.is("$text"))return t;let n=0;for(let i=0;i1?t[0]+":"+t[1]:t[0]}class Ll extends(xn()){_conversionApi;_firedEventsMap;constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,i){const n=this._createConversionApi(i,e.getRefreshedItems());for(const t of e.getMarkersToRemove())this._convertMarkerRemove(t.name,t.range,n);const r=this._reduceChanges(e.getChanges());for(const e of r)"insert"===e.type?this._convertInsert(Ol._createFromPositionAndShift(e.position,e.length),n):"reinsert"===e.type?this._convertReinsert(Ol._createFromPositionAndShift(e.position,e.length),n):"remove"===e.type?this._convertRemove(e.position,e.length,e.name,n):this._convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,n);n.mapper.flushDeferredBindings();for(const e of n.mapper.flushUnboundMarkerNames()){const i=t.get(e).getRange();this._convertMarkerRemove(e,i,n),this._convertMarkerAdd(e,i,n)}for(const t of e.getMarkersToAdd())this._convertMarkerAdd(t.name,t.range,n);n.consumable.verifyAllConsumed("insert")}convert(e,t,i,n={}){const r=this._createConversionApi(i,void 0,n);this._convertInsert(e,r);for(const[e,i]of t)this._convertMarkerAdd(e,i,r);r.consumable.verifyAllConsumed("insert")}convertSelection(e,t,i){const n=this._createConversionApi(i);this.fire("cleanSelection",{selection:e},n);const r=e.getFirstPosition().root;if(!n.mapper.toViewElement(r))return;const s=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(n.consumable,e,s),this.fire("selection",{selection:e},n),e.isCollapsed){for(const t of s)if(n.consumable.test(e,"addMarker:"+t.name)){const i=t.getRange();if(!Dl(e.getFirstPosition(),t,n.mapper))continue;const r={item:e,markerName:t.name,markerRange:i};this.fire(`addMarker:${t.name}`,r,n)}for(const t of e.getAttributeKeys())if(n.consumable.test(e,"attribute:"+t)){const i={item:e,range:e.getFirstRange(),attributeKey:t,attributeOldValue:null,attributeNewValue:e.getAttribute(t)};this.fire(`attribute:${t}:$text`,i,n)}}}_convertInsert(e,t,i={}){i.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,e);for(const i of Array.from(e.getWalker({shallow:!0})).map(zl))this._testAndFire("insert",i,t)}_convertRemove(e,t,i,n){this.fire(`remove:${i}`,{position:e,length:t},n)}_convertAttribute(e,t,i,n,r){this._addConsumablesForRange(r.consumable,e,`attribute:${t}`);for(const s of e){const e={item:s.item,range:Ol._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:t,attributeOldValue:i,attributeNewValue:n};this._testAndFire(`attribute:${t}`,e,r)}}_convertReinsert(e,t){const i=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,i);for(const e of i.map(zl))this._testAndFire("insert",{...e,reconversion:!0},t)}_convertMarkerAdd(e,t,i){if("$graveyard"==t.root.rootName)return;const n=`addMarker:${e}`;if(i.consumable.add(t,n),this.fire(n,{markerName:e,markerRange:t},i),i.consumable.consume(t,n)){this._addConsumablesForRange(i.consumable,t,n);for(const r of t.getItems()){if(!i.consumable.test(r,n))continue;const s={item:r,range:Ol._createOn(r),markerName:e,markerRange:t};this.fire(n,s,i)}}}_convertMarkerRemove(e,t,i){"$graveyard"!=t.root.rootName&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},i)}_reduceChanges(e){const t={changes:e};return this.fire("reduceChanges",t),t.changes}_addConsumablesForInsert(e,t){for(const i of t){const t=i.item;if(null===e.test(t,"insert")){e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}}return e}_addConsumablesForRange(e,t,i){for(const n of t.getItems())e.add(n,i);return e}_addConsumablesForSelection(e,t,i){e.add(t,"selection");for(const n of i)e.add(t,"addMarker:"+n.name);for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i);return e}_testAndFire(e,t,i){const n=function(e,t){const i=t.item.is("element")?t.item.name:"$text";return`${e}:${i}`}(e,t),r=t.item.is("$textProxy")?i.consumable._getSymbolForTextProxy(t.item):t.item,s=this._firedEventsMap.get(i),o=s.get(r);if(o){if(o.has(n))return;o.add(n)}else s.set(r,new Set([n]));this.fire(n,t,i)}_testAndFireAddAttributes(e,t){const i={item:e,range:Ol._createOn(e)};for(const e of i.item.getAttributeKeys())i.attributeKey=e,i.attributeOldValue=null,i.attributeNewValue=i.item.getAttribute(e),this._testAndFire(`attribute:${e}`,i,t)}_createConversionApi(e,t=new Set,i={}){const n={...this._conversionApi,consumable:new Ml,writer:e,options:i,convertItem:e=>this._convertInsert(Ol._createOn(e),n),convertChildren:e=>this._convertInsert(Ol._createIn(e),n,{doNotAddConsumables:!0}),convertAttributes:e=>this._testAndFireAddAttributes(e,n),canReuseView:e=>!t.has(n.mapper.toModelElement(e))};return this._firedEventsMap.set(n,new Map),n}}function Dl(e,t,i){const n=t.getRange(),r=Array.from(e.getAncestors());r.shift(),r.reverse();return!r.some((e=>{if(n.containsItem(e)){return!!i.toViewElement(e).getCustomProperty("addHighlight")}}))}function zl(e){return{item:e.item,range:Ol._createFromPositionAndShift(e.previousPosition,e.length)}}class Hl extends(xn(vl)){_lastRangeBackward=!1;_attrs=new Map;_ranges=[];constructor(...e){super(),e.length&&this.setTo(...e)}get anchor(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.end:e.start}return null}get focus(){if(this._ranges.length>0){const e=this._ranges[this._ranges.length-1];return this._lastRangeBackward?e.start:e.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(e){if(this.rangeCount!=e.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(e.anchor)||!this.focus.isEqual(e.focus))return!1;for(const t of this._ranges){let i=!1;for(const n of e._ranges)if(t.isEqual(n)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const e of this._ranges)yield new Ol(e.start,e.end)}getFirstRange(){let e=null;for(const t of this._ranges)e&&!t.start.isBefore(e.start)||(e=t);return e?new Ol(e.start,e.end):null}getLastRange(){let e=null;for(const t of this._ranges)e&&!t.end.isAfter(e.end)||(e=t);return e?new Ol(e.start,e.end):null}getFirstPosition(){const e=this.getFirstRange();return e?e.start.clone():null}getLastPosition(){const e=this.getLastRange();return e?e.end.clone():null}setTo(...e){let[t,i,n]=e;if("object"==typeof i&&(n=i,i=void 0),null===t)this._setRanges([]);else if(t instanceof Hl)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof Ol)this._setRanges([t],!!n&&!!n.backward);else if(t instanceof Sl)this._setRanges([new Ol(t)]);else if(t instanceof yl){const e=!!n&&!!n.backward;let r;if("in"==i)r=Ol._createIn(t);else if("on"==i)r=Ol._createOn(t);else{if(void 0===i)throw new gn("model-selection-setto-required-second-parameter",[this,t]);r=new Ol(Sl._createAt(t,i))}this._setRanges([r],e)}else{if(!Gn(t))throw new gn("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,n&&!!n.backward)}}_setRanges(e,t=!1){const i=Array.from(e),n=i.some((t=>{if(!(t instanceof Ol))throw new gn("model-selection-set-ranges-not-range",[this,e]);return this._ranges.every((e=>!e.isEqual(t)))}));(i.length!==this._ranges.length||n)&&(this._replaceAllRanges(i),this._lastRangeBackward=!!t,this.fire("change:range",{directChange:!0}))}setFocus(e,t){if(null===this.anchor)throw new gn("model-selection-setfocus-no-ranges",[this,e]);const i=Sl._createAt(e,t);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(n)?(this._pushRange(new Ol(i,n)),this._lastRangeBackward=!0):(this._pushRange(new Ol(n,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(e){return this._attrs.get(e)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(e){return this._attrs.has(e)}removeAttribute(e){this.hasAttribute(e)&&(this._attrs.delete(e),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}setAttribute(e,t){this.getAttribute(e)!==t&&(this._attrs.set(e,t),this.fire("change:attribute",{attributeKeys:[e],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){const e=new WeakSet;for(const t of this.getRanges()){const i=Ul(t.start,e);ql(i,t)&&(yield i);for(const i of t.getWalker()){const n=i.item;"elementEnd"==i.type&&$l(n,e,t)&&(yield n)}const n=Ul(t.end,e);Gl(n,t)&&(yield n)}}containsEntireContent(e=this.anchor.root){const t=Sl._createAt(e,0),i=Sl._createAt(e,"end");return t.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(e){this._checkRange(e),this._ranges.push(new Ol(e.start,e.end))}_checkRange(e){for(let t=0;t0;)this._popRange()}_popRange(){this._ranges.pop()}}function Wl(e,t){return!t.has(e)&&(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function $l(e,t,i){return Wl(e,t)&&jl(e,i)}function Ul(e,t){const i=e.parent.root.document.model.schema,n=e.parent.getAncestors({parentFirst:!0,includeSelf:!0});let r=!1;const s=n.find((e=>!r&&(r=i.isLimit(e),!r&&Wl(e,t))));return n.forEach((e=>t.add(e))),s}function jl(e,t){const i=function(e){const t=e.root.document.model.schema;let i=e.parent;for(;i;){if(t.isBlock(i))return i;i=i.parent}}(e);if(!i)return!0;return!t.containsRange(Ol._createOn(i),!0)}function ql(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.start.isTouching(Sl._createAt(e,e.maxOffset))&&jl(e,t))}function Gl(e,t){return!!e&&(!(!t.isCollapsed&&!e.isEmpty)||!t.end.isTouching(Sl._createAt(e,0))&&jl(e,t))}Hl.prototype.is=function(e){return"selection"===e||"model:selection"===e};class Kl extends(xn(Ol)){constructor(e,t){super(e,t),Zl.call(this)}detach(){this.stopListening()}toRange(){return new Ol(this.start,this.end)}static fromRange(e){return new Kl(e.start,e.end)}}function Zl(){this.listenTo(this.root.document.model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&Jl.call(this,i)}),{priority:"low"})}function Jl(e){const t=this.getTransformedByOperation(e),i=Ol._createFromRanges(t),n=!i.isEqual(this),r=function(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}(this,e);let s=null;if(n){"$graveyard"==i.root.rootName&&(s="remove"==e.type?e.sourcePosition:e.deletionPosition);const t=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",t,{deletionPosition:s})}else r&&this.fire("change:content",this.toRange(),{deletionPosition:s})}Kl.prototype.is=function(e){return"liveRange"===e||"model:liveRange"===e||"range"==e||"model:range"===e};const Ql="selection:";class Yl extends(xn(vl)){_selection;constructor(e){super(),this._selection=new Xl(e),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return Ql+e}static _isStoreAttributeKey(e){return e.startsWith(Ql)}}Yl.prototype.is=function(e){return"selection"===e||"model:selection"==e||"documentSelection"==e||"model:documentSelection"==e};class Xl extends Hl{markers=new es({idProperty:"name"});_model;_document;_attributePriority=new Map;_selectionRestorePosition=null;_hasChangedRange=!1;_overriddenGravityRegister=new Set;_observedMarkers=new Set;constructor(e){super(),this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))}),{priority:"lowest"}),this.on("change:range",(()=>{this._validateSelectionRanges(this.getRanges())})),this.listenTo(this._model.markers,"update",((e,t,i,n)=>{this._updateMarker(t,n)})),this.listenTo(this._document,"change",((e,t)=>{!function(e,t){const i=e.document.differ;for(const n of i.getChanges()){if("insert"!=n.type)continue;const i=n.position.parent;n.length===i.maxOffset&&e.enqueueChange(t,(e=>{const t=Array.from(i.getAttributeKeys()).filter((e=>e.startsWith(Ql)));for(const n of t)e.removeAttribute(n,i)}))}}(this._model,t)}))}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let e=0;e{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=n.deletionPosition;const e=this._ranges.indexOf(t);this._ranges.splice(e,1),t.detach()}})),t}updateMarkers(){if(!this._observedMarkers.size)return;const e=[];let t=!1;for(const t of this._model.markers){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const n=t.getRange();for(const i of this.getRanges())n.containsRange(i,!i.isCollapsed)&&e.push(t)}const i=Array.from(this.markers);for(const i of e)this.markers.has(i)||(this.markers.add(i),t=!0);for(const i of Array.from(this.markers))e.includes(i)||(this.markers.remove(i),t=!0);t&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(e,t){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let n=!1;const r=Array.from(this.markers),s=this.markers.has(e);if(t){let i=!1;for(const e of this.getRanges())if(t.containsRange(e,!e.isCollapsed)){i=!0;break}i&&!s?(this.markers.add(e),n=!0):!i&&s&&(this.markers.remove(e),n=!0)}else s&&(this.markers.remove(e),n=!0);n&&this.fire("change:marker",{oldMarkers:r,directChange:!1})}_updateAttributes(e){const t=as(this._getSurroundingAttributes()),i=as(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(const[e,t]of this._attributePriority)"low"==t&&(this._attrs.delete(e),this._attributePriority.delete(e));this._setAttributesTo(t);const n=[];for(const[e,t]of this.getAttributes())i.has(e)&&i.get(e)===t||n.push(e);for(const[e]of i)this.hasAttribute(e)||n.push(e);n.length>0&&this.fire("change:attribute",{attributeKeys:n,directChange:!1})}_setAttribute(e,t,i=!0){const n=i?"normal":"low";if("low"==n&&"normal"==this._attributePriority.get(e))return!1;return super.getAttribute(e)!==t&&(this._attrs.set(e,t),this._attributePriority.set(e,n),!0)}_removeAttribute(e,t=!0){const i=t?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(e))&&(this._attributePriority.set(e,i),!!super.hasAttribute(e)&&(this._attrs.delete(e),!0))}_setAttributesTo(e){const t=new Set;for(const[t,i]of this.getAttributes())e.get(t)!==i&&this._removeAttribute(t,!1);for(const[i,n]of e){this._setAttribute(i,n,!1)&&t.add(i)}return t}*getStoredAttributes(){const e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(const t of e.getAttributeKeys())if(t.startsWith(Ql)){const i=t.substr(10);yield[i,e.getAttribute(t)]}}_getSurroundingAttributes(){const e=this.getFirstPosition(),t=this._model.schema;if("$graveyard"==e.root.rootName)return null;let i=null;if(this.isCollapsed){const n=e.textNode?e.textNode:e.nodeBefore,r=e.textNode?e.textNode:e.nodeAfter;if(this.isGravityOverridden||(i=ec(n,t)),i||(i=ec(r,t)),!this.isGravityOverridden&&!i){let e=n;for(;e&&!i;)e=e.previousSibling,i=ec(e,t)}if(!i){let e=r;for(;e&&!i;)e=e.nextSibling,i=ec(e,t)}i||(i=this.getStoredAttributes())}else{const e=this.getFirstRange();for(const n of e){if(n.item.is("element")&&t.isObject(n.item)){i=ec(n.item,t);break}if("text"==n.type){i=n.item.getAttributes();break}}}return i}_fixGraveyardSelection(e){const t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}}function ec(e,t){if(!e)return null;if(e instanceof xl||e instanceof Cl)return e.getAttributes();if(!t.isInline(e))return null;if(!t.isObject(e))return[];const i=[];for(const[n,r]of e.getAttributes())t.checkAttribute("$text",n)&&!1!==t.getAttributeProperties(n).copyFromObject&&i.push([n,r]);return i}class tc{_dispatchers;constructor(e){this._dispatchers=e}add(e){for(const t of this._dispatchers)e(t);return this}}class ic extends tc{elementToElement(e){return this.add(function(e){const t=lc(e.model),i=cc(e.view,"container");t.attributes.length&&(t.children=!0);return n=>{n.on(`insert:${t.name}`,sc(i,gc(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&n.on("reduceChanges",mc(t),{priority:"low"})}}(e))}elementToStructure(e){return this.add(function(e){const t=lc(e.model),i=cc(e.view,"container");return t.children=!0,n=>{if(n._conversionApi.schema.checkChild(t.name,"$text"))throw new gn("conversion-element-to-structure-disallowed-text",n,{elementName:t.name});var r,s;n.on(`insert:${t.name}`,(r=i,s=gc(t),(e,t,i)=>{if(!s(t.item,i.consumable,{preflight:!0}))return;const n=new Map;i.writer._registerSlotFactory(function(e,t,i){return(n,r)=>{const s=n.createContainerElement("$slot");let o=null;if("children"===r)o=Array.from(e.getChildren());else{if("function"!=typeof r)throw new gn("conversion-slot-mode-unknown",i.dispatcher,{modeOrFilter:r});o=Array.from(e.getChildren()).filter((e=>r(e)))}return t.set(s,o),s}}(t.item,n,i));const o=r(t.item,i,t);if(i.writer._clearSlotFactory(),!o)return;!function(e,t,i){const n=Array.from(t.values()).flat(),r=new Set(n);if(r.size!=n.length)throw new gn("conversion-slot-filter-overlap",i.dispatcher,{element:e});if(r.size!=e.childCount)throw new gn("conversion-slot-filter-incomplete",i.dispatcher,{element:e})}(t.item,n,i),s(t.item,i.consumable);const a=i.mapper.toViewPosition(t.range.start);i.mapper.bindElements(t.item,o),i.writer.insert(a,o),i.convertAttributes(t.item),function(e,t,i,n){i.mapper.on("modelToViewPosition",o,{priority:"highest"});let r=null,s=null;for([r,s]of t)fc(e,s,i,n),i.writer.move(i.writer.createRangeIn(r),i.writer.createPositionBefore(r)),i.writer.remove(r);function o(e,t){const i=t.modelPosition.nodeAfter,n=s.indexOf(i);n<0||(t.viewPosition=t.mapper.findPositionIn(r,n))}i.mapper.off("modelToViewPosition",o)}(o,n,i,{reconversion:t.reconversion})}),{priority:e.converterPriority||"normal"}),n.on("reduceChanges",mc(t),{priority:"low"})}}(e))}attributeToElement(e){return this.add(function(e){e=To(e);let t=e.model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;t.name&&(i+=":"+t.name);if(t.values)for(const i of t.values)e.view[i]=cc(e.view[i],"attribute");else e.view=cc(e.view,"attribute");const n=hc(e);return t=>{t.on(i,rc(n),{priority:e.converterPriority||"normal"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=To(e);let t=e.model;"string"==typeof t&&(t={key:t});let i=`attribute:${t.key}`;t.name&&(i+=":"+t.name);if(t.values)for(const i of t.values)e.view[i]=dc(e.view[i]);else e.view=dc(e.view);const n=hc(e);return t=>{var r;t.on(i,(r=n,(e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const n=r(t.attributeOldValue,i,t),s=r(t.attributeNewValue,i,t);if(!n&&!s)return;i.consumable.consume(t.item,e.name);const o=i.mapper.toViewElement(t.item),a=i.writer;if(!o)throw new gn("conversion-attribute-to-attribute-on-text",i.dispatcher,t);if(null!==t.attributeOldValue&&n)if("class"==n.key){const e="string"==typeof n.value?n.value.split(/\s+/):n.value;for(const t of e)a.removeClass(t,o)}else if("style"==n.key)if("string"==typeof n.value){const e=new Wo(a.document.stylesProcessor);e.setTo(n.value);for(const[t]of e.getStylesEntries())a.removeStyle(t,o)}else{const e=Object.keys(n.value);for(const t of e)a.removeStyle(t,o)}else a.removeAttribute(n.key,o);if(null!==t.attributeNewValue&&s)if("class"==s.key){const e="string"==typeof s.value?s.value.split(/\s+/):s.value;for(const t of e)a.addClass(t,o)}else if("style"==s.key)if("string"==typeof s.value){const e=new Wo(a.document.stylesProcessor);e.setTo(s.value);for(const[t,i]of e.getStylesEntries())a.setStyle(t,i,o)}else{const e=Object.keys(s.value);for(const t of e)a.setStyle(t,s.value[t],o)}else a.setAttribute(s.key,s.value,o)}),{priority:e.converterPriority||"normal"})}}(e))}markerToElement(e){return this.add(function(e){const t=cc(e.view,"ui");return i=>{i.on(`addMarker:${e.model}`,oc(t),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,((e,t,i)=>{const n=i.mapper.markerNameToElements(t.markerName);if(n){for(const e of n)i.mapper.unbindElementFromMarkerName(e,t.markerName),i.writer.clear(i.writer.createRangeOn(e),e);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}}),{priority:e.converterPriority||"normal"})}}(e))}markerToHighlight(e){return this.add(function(e){return t=>{var i;t.on(`addMarker:${e.model}`,(i=e.view,(e,t,n)=>{if(!t.item)return;if(!(t.item instanceof Hl||t.item instanceof Yl||t.item.is("$textProxy")))return;const r=uc(i,t,n);if(!r)return;if(!n.consumable.consume(t.item,e.name))return;const s=n.writer,o=nc(s,r),a=s.document.selection;if(t.item instanceof Hl||t.item instanceof Yl)s.wrap(a.getFirstRange(),o);else{const e=n.mapper.toViewRange(t.range),i=s.wrap(e,o);for(const e of i.getItems())if(e.is("attributeElement")&&e.isSimilar(o)){n.mapper.bindElementToMarker(e,t.markerName);break}}}),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,function(e){return(t,i,n)=>{if(!i.item)return;if(!(i.item instanceof Al))return;const r=uc(e,i,n);if(!r)return;if(!n.consumable.test(i.item,t.name))return;const s=n.mapper.toViewElement(i.item);if(s&&s.getCustomProperty("addHighlight")){n.consumable.consume(i.item,t.name);for(const e of Ol._createIn(i.item))n.consumable.consume(e.item,t.name);s.getCustomProperty("addHighlight")(s,r,n.writer),n.mapper.bindElementToMarker(s,i.markerName)}}}(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,function(e){return(t,i,n)=>{if(i.markerRange.isCollapsed)return;const r=uc(e,i,n);if(!r)return;const s=nc(n.writer,r),o=n.mapper.markerNameToElements(i.markerName);if(o){for(const e of o)if(n.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("attributeElement"))n.writer.unwrap(n.writer.createRangeOn(e),s);else{e.getCustomProperty("removeHighlight")(e,r.id,n.writer)}n.writer.clearClonedElementsGroup(i.markerName),t.stop()}}}(e.view),{priority:e.converterPriority||"normal"})}}(e))}markerToData(e){return this.add(function(e){e=To(e);const t=e.model;let i=e.view;i||(i=i=>({group:t,name:i.substr(e.model.length+1)}));return n=>{var r;n.on(`addMarker:${t}`,(r=i,(e,t,i)=>{const n=r(t.markerName,i);if(!n)return;const s=t.markerRange;i.consumable.consume(s,e.name)&&(ac(s,!1,i,t,n),ac(s,!0,i,t,n),e.stop())}),{priority:e.converterPriority||"normal"}),n.on(`removeMarker:${t}`,function(e){return(t,i,n)=>{const r=e(i.markerName,n);if(!r)return;const s=n.mapper.markerNameToElements(i.markerName);if(s){for(const e of s)n.mapper.unbindElementFromMarkerName(e,i.markerName),e.is("containerElement")?(o(`data-${r.group}-start-before`,e),o(`data-${r.group}-start-after`,e),o(`data-${r.group}-end-before`,e),o(`data-${r.group}-end-after`,e)):n.writer.clear(n.writer.createRangeOn(e),e);n.writer.clearClonedElementsGroup(i.markerName),t.stop()}function o(e,t){if(t.hasAttribute(e)){const i=new Set(t.getAttribute(e).split(","));i.delete(r.name),0==i.size?n.writer.removeAttribute(e,t):n.writer.setAttribute(e,Array.from(i).join(","),t)}}}}(i),{priority:e.converterPriority||"normal"})}}(e))}}function nc(e,t){const i=e.createAttributeElement("span",t.attributes);return t.classes&&i._addClass(t.classes),"number"==typeof t.priority&&(i._priority=t.priority),i._id=t.id,i}function rc(e){return(t,i,n)=>{if(!n.consumable.test(i.item,t.name))return;const r=e(i.attributeOldValue,n,i),s=e(i.attributeNewValue,n,i);if(!r&&!s)return;n.consumable.consume(i.item,t.name);const o=n.writer,a=o.document.selection;if(i.item instanceof Hl||i.item instanceof Yl)o.wrap(a.getFirstRange(),s);else{let e=n.mapper.toViewRange(i.range);null!==i.attributeOldValue&&r&&(e=o.unwrap(e,r)),null!==i.attributeNewValue&&s&&o.wrap(e,s)}}}function sc(e,t=wc){return(i,n,r)=>{if(!t(n.item,r.consumable,{preflight:!0}))return;const s=e(n.item,r,n);if(!s)return;t(n.item,r.consumable);const o=r.mapper.toViewPosition(n.range.start);r.mapper.bindElements(n.item,s),r.writer.insert(o,s),r.convertAttributes(n.item),fc(s,n.item.getChildren(),r,{reconversion:n.reconversion})}}function oc(e){return(t,i,n)=>{i.isOpening=!0;const r=e(i,n);i.isOpening=!1;const s=e(i,n);if(!r||!s)return;const o=i.markerRange;if(o.isCollapsed&&!n.consumable.consume(o,t.name))return;for(const e of o)if(!n.consumable.consume(e.item,t.name))return;const a=n.mapper,l=n.writer;l.insert(a.toViewPosition(o.start),r),n.mapper.bindElementToMarker(r,i.markerName),o.isCollapsed||(l.insert(a.toViewPosition(o.end),s),n.mapper.bindElementToMarker(s,i.markerName)),t.stop()}}function ac(e,t,i,n,r){const s=t?e.start:e.end,o=s.nodeAfter&&s.nodeAfter.is("element")?s.nodeAfter:null,a=s.nodeBefore&&s.nodeBefore.is("element")?s.nodeBefore:null;if(o||a){let e,s;t&&o||!t&&!a?(e=o,s=!0):(e=a,s=!1);const l=i.mapper.toViewElement(e);if(l)return void function(e,t,i,n,r,s){const o=`data-${s.group}-${t?"start":"end"}-${i?"before":"after"}`,a=e.hasAttribute(o)?e.getAttribute(o).split(","):[];a.unshift(s.name),n.writer.setAttribute(o,a.join(","),e),n.mapper.bindElementToMarker(e,r.markerName)}(l,t,s,i,n,r)}!function(e,t,i,n,r){const s=`${r.group}-${t?"start":"end"}`,o=r.name?{name:r.name}:null,a=i.writer.createUIElement(s,o);i.writer.insert(e,a),i.mapper.bindElementToMarker(a,n.markerName)}(i.mapper.toViewPosition(s),t,i,n,r)}function lc(e){return"string"==typeof e&&(e={name:e}),{name:e.name,attributes:e.attributes?Qr(e.attributes):[],children:!!e.children}}function cc(e,t){return"function"==typeof e?e:(i,n)=>function(e,t,i){"string"==typeof e&&(e={name:e});let n;const r=t.writer,s=Object.assign({},e.attributes);if("container"==i)n=r.createContainerElement(e.name,s);else if("attribute"==i){const t={priority:e.priority||ma.DEFAULT_PRIORITY};n=r.createAttributeElement(e.name,s,t)}else n=r.createUIElement(e.name,s);if(e.styles){const t=Object.keys(e.styles);for(const i of t)r.setStyle(i,e.styles[i],n)}if(e.classes){const t=e.classes;if("string"==typeof t)r.addClass(t,n);else for(const e of t)r.addClass(e,n)}return n}(e,n,t)}function hc(e){return e.model.values?(t,i,n)=>{const r=e.view[t];return r?r(t,i,n):null}:e.view}function dc(e){return"string"==typeof e?t=>({key:e,value:t}):"object"==typeof e?e.value?()=>e:t=>({key:e.key,value:t}):e}function uc(e,t,i){const n="function"==typeof e?e(t,i):e;return n?(n.priority||(n.priority=10),n.id||(n.id=t.markerName),n):null}function mc(e){const t=function(e){return(t,i)=>{if(!t.is("element",e.name))return!1;if("attribute"==i.type){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}(e);return(e,i)=>{const n=[];i.reconvertedElements||(i.reconvertedElements=new Set);for(const e of i.changes){const r="attribute"==e.type?e.range.start.nodeAfter:e.position.parent;if(r&&t(r,e)){if(!i.reconvertedElements.has(r)){i.reconvertedElements.add(r);const e=Sl._createBefore(r);let t=n.length;for(let i=n.length-1;i>=0;i--){const r=n[i],s=("attribute"==r.type?r.range.start:r.position).compareWith(e);if("before"==s||"remove"==r.type&&"same"==s)break;t=i}n.splice(t,0,{type:"remove",name:r.name,position:e,length:1},{type:"reinsert",name:r.name,position:e,length:1})}}else n.push(e)}i.changes=n}}function gc(e){return(t,i,n={})=>{const r=["insert"];for(const i of e.attributes)t.hasAttribute(i)&&r.push(`attribute:${i}`);return!!r.every((e=>i.test(t,e)))&&(n.preflight||r.forEach((e=>i.consume(t,e))),!0)}}function fc(e,t,i,n){for(const r of t)pc(e.root,r,i,n)||i.convertItem(r)}function pc(e,t,i,n){const{writer:r,mapper:s}=i;if(!n.reconversion)return!1;const o=s.toViewElement(t);return!(!o||o.root==e)&&(!!i.canReuseView(o)&&(r.move(r.createRangeOn(o),s.toViewPosition(Sl._createBefore(t))),!0))}function wc(e,t,{preflight:i}={}){return i?t.test(e,"insert"):t.consume(e,"insert")}function bc(e){const{schema:t,document:i}=e.model;for(const n of i.getRoots())if(n.isEmpty&&!t.checkChild(n,"$text")&&t.checkChild(n,"paragraph"))return e.insertElement("paragraph",n),!0;return!1}function _c(e,t,i){const n=i.createContext(e);return!!i.checkChild(n,"paragraph")&&!!i.checkChild(n.push("paragraph"),t)}function vc(e,t){const i=t.createElement("paragraph");return t.insert(i,e),t.createPositionAt(i,0)}class yc extends tc{elementToElement(e){return this.add(kc(e))}elementToAttribute(e){return this.add(function(e){e=To(e),Ac(e);const t=Tc(e,!1),i=Cc(e.view),n=i?`element:${i}`:"element";return i=>{i.on(n,t,{priority:e.converterPriority||"low"})}}(e))}attributeToAttribute(e){return this.add(function(e){e=To(e);let t=null;("string"==typeof e.view||e.view.key)&&(t=function(e){"string"==typeof e.view&&(e.view={key:e.view});const t=e.view.key,i=void 0===e.view.value?/[\s\S]*/:e.view.value;let n;if("class"==t||"style"==t){const e="class"==t?"classes":"styles";n={[e]:i}}else n={attributes:{[t]:i}};e.view.name&&(n.name=e.view.name);return e.view=n,t}(e));Ac(e,t);const i=Tc(e,!0);return t=>{t.on("element",i,{priority:e.converterPriority||"low"})}}(e))}elementToMarker(e){return this.add(function(e){const t=function(e){return(t,i)=>{const n="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":n})}}(e.model);return kc({...e,model:t})}(e))}dataToMarker(e){return this.add(function(e){e=To(e),e.model||(e.model=t=>t?e.view+":"+t:e.view);const t={view:e.view,model:e.model},i=xc(Ec(t,"start")),n=xc(Ec(t,"end"));return r=>{r.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),r.on(`element:${e.view}-end`,n,{priority:e.converterPriority||"normal"});const s=dn.low,o=dn.highest,a=dn.get(e.converterPriority)/o;r.on("element",function(e){return(t,i,n)=>{const r=`data-${e.view}`;function s(t,r){for(const s of r){const r=e.model(s,n),o=n.writer.createElement("$marker",{"data-name":r});n.writer.insert(o,t),i.modelCursor.isEqual(t)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(t,1),i.modelRange=i.modelRange._getTransformedByInsertion(t,1)[0]}}(n.consumable.test(i.viewItem,{attributes:r+"-end-after"})||n.consumable.test(i.viewItem,{attributes:r+"-start-after"})||n.consumable.test(i.viewItem,{attributes:r+"-end-before"})||n.consumable.test(i.viewItem,{attributes:r+"-start-before"}))&&(i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor)),n.consumable.consume(i.viewItem,{attributes:r+"-end-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(r+"-end-after").split(",")),n.consumable.consume(i.viewItem,{attributes:r+"-start-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(r+"-start-after").split(",")),n.consumable.consume(i.viewItem,{attributes:r+"-end-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(r+"-end-before").split(",")),n.consumable.consume(i.viewItem,{attributes:r+"-start-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(r+"-start-before").split(",")))}}(t),{priority:s+a})}}(e))}}function kc(e){const t=xc(e=To(e)),i=Cc(e.view),n=i?`element:${i}`:"element";return i=>{i.on(n,t,{priority:e.converterPriority||"normal"})}}function Cc(e){return"string"==typeof e?e:"object"==typeof e&&"string"==typeof e.name?e.name:null}function xc(e){const t=new Do(e.view);return(i,n,r)=>{const s=t.match(n.viewItem);if(!s)return;const o=s.match;if(o.name=!0,!r.consumable.test(n.viewItem,o))return;const a=function(e,t,i){return e instanceof Function?e(t,i):i.writer.createElement(e)}(e.model,n.viewItem,r);a&&r.safeInsert(a,n.modelCursor)&&(r.consumable.consume(n.viewItem,o),r.convertChildren(n.viewItem,a),r.updateConversionResult(a,n))}}function Ac(e,t=null){const i=null===t||(e=>e.getAttribute(t)),n="object"!=typeof e.model?e.model:e.model.key,r="object"!=typeof e.model||void 0===e.model.value?i:e.model.value;e.model={key:n,value:r}}function Tc(e,t){const i=new Do(e.view);return(n,r,s)=>{if(!r.modelRange&&t)return;const o=i.match(r.viewItem);if(!o)return;if(!function(e,t){const i="function"==typeof e?e(t):e;if("object"==typeof i&&!Cc(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(e.view,r.viewItem)?delete o.match.name:o.match.name=!0,!s.consumable.test(r.viewItem,o.match))return;const a=e.model.key,l="function"==typeof e.model.value?e.model.value(r.viewItem,s):e.model.value;if(null===l)return;r.modelRange||Object.assign(r,s.convertChildren(r.viewItem,r.modelCursor));const c=function(e,t,i,n){let r=!1;for(const s of Array.from(e.getItems({shallow:i})))n.schema.checkAttribute(s,t.key)&&(r=!0,s.hasAttribute(t.key)||n.writer.setAttribute(t.key,t.value,s));return r}(r.modelRange,{key:a,value:l},t,s);c&&(s.consumable.test(r.viewItem,{name:!0})&&(o.match.name=!0),s.consumable.consume(r.viewItem,o.match))}}function Ec(e,t){return{view:`${e.view}-${t}`,model:(t,i)=>{const n=t.getAttribute("name"),r=e.model(n,i);return i.writer.createElement("$marker",{"data-name":r})}}}function Sc(e){e.document.registerPostFixer((t=>function(e,t){const i=t.document.selection,n=t.schema,r=[];let s=!1;for(const e of i.getRanges()){const t=Pc(e,n);t&&!t.isEqual(e)?(r.push(t),s=!0):r.push(e)}s&&e.setSelection(function(e){const t=[...e],i=new Set;let n=1;for(;n!i.has(t)))}(r),{backward:i.isBackward});return!1}(t,e)))}function Pc(e,t){return e.isCollapsed?function(e,t){const i=e.start,n=t.getNearestSelectionRange(i);if(!n){const e=i.getAncestors().reverse().find((e=>t.isObject(e)));return e?Ol._createOn(e):null}if(!n.isCollapsed)return n;const r=n.start;if(i.isEqual(r))return null;return new Ol(r)}(e,t):function(e,t){const{start:i,end:n}=e,r=t.checkChild(i,"$text"),s=t.checkChild(n,"$text"),o=t.getLimitElement(i),a=t.getLimitElement(n);if(o===a){if(r&&s)return null;if(function(e,t,i){const n=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text"),r=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return n||r}(i,n,t)){const e=i.nodeAfter&&t.isSelectable(i.nodeAfter)?null:t.getNearestSelectionRange(i,"forward"),r=n.nodeBefore&&t.isSelectable(n.nodeBefore)?null:t.getNearestSelectionRange(n,"backward"),s=e?e.start:i,o=r?r.end:n;return new Ol(s,o)}}const l=o&&!o.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const e=i.nodeAfter&&n.nodeBefore&&i.nodeAfter.parent===n.nodeBefore.parent,r=l&&(!e||!Vc(i.nodeAfter,t)),s=c&&(!e||!Vc(n.nodeBefore,t));let h=i,d=n;return r&&(h=Sl._createBefore(Ic(o,t))),s&&(d=Sl._createAfter(Ic(a,t))),new Ol(h,d)}return null}(e,t)}function Ic(e,t){let i=e,n=i;for(;t.isLimit(n)&&n.parent;)i=n,n=n.parent;return i}function Vc(e,t){return e&&t.isSelectable(e)}class Rc extends(Ln()){model;view;mapper;downcastDispatcher;constructor(e,t){super(),this.model=e,this.view=new _l(t),this.mapper=new Fl,this.downcastDispatcher=new Ll({mapper:this.mapper,schema:e.schema});const i=this.model.document,n=i.selection,r=this.model.markers;var s,o,a;this.listenTo(this.model,"_beforeChanges",(()=>{this.view._disableRendering(!0)}),{priority:"highest"}),this.listenTo(this.model,"_afterChanges",(()=>{this.view._disableRendering(!1)}),{priority:"lowest"}),this.listenTo(i,"change",(()=>{this.view.change((e=>{this.downcastDispatcher.convertChanges(i.differ,r,e),this.downcastDispatcher.convertSelection(n,r,e)}))}),{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(e,t){return(i,n)=>{const r=n.newSelection,s=[];for(const e of r.getRanges())s.push(t.toModelRange(e));const o=e.createSelection(s,{backward:r.isBackward});o.isEqual(e.document.selection)||e.change((e=>{e.setSelection(o)}))}}(this.model,this.mapper)),this.listenTo(this.view.document,"beforeinput",(s=this.mapper,o=this.model.schema,a=this.view,(e,t)=>{if(!a.document.isComposing||Ki.isAndroid)for(let e=0;e{if(!i.consumable.consume(t.item,e.name))return;const n=i.writer,r=i.mapper.toViewPosition(t.range.start),s=n.createText(t.item.data);n.insert(r,s)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.downcastDispatcher.on("remove",((e,t,i)=>{const n=i.mapper.toViewPosition(t.position),r=t.position.getShiftedBy(t.length),s=i.mapper.toViewPosition(r,{isPhantom:!0}),o=i.writer.createRange(n,s),a=i.writer.remove(o.getTrimmed());for(const e of i.writer.createRangeIn(a).getItems())i.mapper.unbindViewElement(e,{defer:!0})}),{priority:"low"}),this.downcastDispatcher.on("cleanSelection",((e,t,i)=>{const n=i.writer,r=n.document.selection;for(const e of r.getRanges())e.isCollapsed&&e.end.parent.isAttached()&&i.writer.mergeAttributes(e.start);n.setSelection(null)})),this.downcastDispatcher.on("selection",((e,t,i)=>{const n=t.selection;if(n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const r=[];for(const e of n.getRanges())r.push(i.mapper.toViewRange(e));i.writer.setSelection(r,{backward:n.isBackward})}),{priority:"low"}),this.downcastDispatcher.on("selection",((e,t,i)=>{const n=t.selection;if(!n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const r=i.writer,s=n.getFirstPosition(),o=i.mapper.toViewPosition(s),a=r.breakAttributes(o);r.setSelection(a)}),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using((e=>{if("$graveyard"==e.rootName)return null;const t=new Yo(this.view.document,e.name);return t.rootName=e.rootName,this.mapper.bindElements(e,t),t}))}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){const t="string"==typeof e?e:e.name,i=this.model.markers.get(t);if(!i)throw new gn("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change((()=>{this.model.markers._refresh(i)}))}reconvertItem(e){this.model.change((()=>{this.model.document.differ._refreshItem(e)}))}}class Bc{_consumables=new Map;add(e,t){let i;e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):(this._consumables.has(e)?i=this._consumables.get(e):(i=new Fc(e),this._consumables.set(e,i)),i.add(t))}test(e,t){const i=this._consumables.get(e);return void 0===i?null:e.is("$text")||e.is("documentFragment")?i:i.test(t)}consume(e,t){return!!this.test(e,t)&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!1):this._consumables.get(e).consume(t),!0)}revert(e,t){const i=this._consumables.get(e);void 0!==i&&(e.is("$text")||e.is("documentFragment")?this._consumables.set(e,!0):i.revert(t))}static consumablesFromElement(e){const t={element:e,name:!0,attributes:[],classes:[],styles:[]},i=e.getAttributeKeys();for(const e of i)"style"!=e&&"class"!=e&&t.attributes.push(e);const n=e.getClassNames();for(const e of n)t.classes.push(e);const r=e.getStyleNames();for(const e of r)t.styles.push(e);return t}static createFrom(e,t){if(t||(t=new Bc),e.is("$text"))return t.add(e),t;e.is("element")&&t.add(e,Bc.consumablesFromElement(e)),e.is("documentFragment")&&t.add(e);for(const i of e.getChildren())t=Bc.createFrom(i,t);return t}}const Oc=["attributes","classes","styles"];class Fc{element;_canConsumeName;_consumables;constructor(e){this.element=e,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(e){e.name&&(this._canConsumeName=!0);for(const t of Oc)t in e&&this._add(t,e[t])}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(const t of Oc)if(t in e){const i=this._test(t,e[t]);if(!0!==i)return i}return!0}consume(e){e.name&&(this._canConsumeName=!1);for(const t of Oc)t in e&&this._consume(t,e[t])}revert(e){e.name&&(this._canConsumeName=!0);for(const t of Oc)t in e&&this._revert(t,e[t])}_add(e,t){const i=Qr(t),n=this._consumables[e];for(const t of i){if("attributes"===e&&("class"===t||"style"===t))throw new gn("viewconsumable-invalid-attribute",this);if(n.set(t,!0),"styles"===e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))n.set(e,!0)}}_test(e,t){const i=Qr(t),n=this._consumables[e];for(const t of i)if("attributes"!==e||"class"!==t&&"style"!==t){const e=n.get(t);if(void 0===e)return null;if(!e)return!1}else{const e="class"==t?"classes":"styles",i=this._test(e,[...this._consumables[e].keys()]);if(!0!==i)return i}return!0}_consume(e,t){const i=Qr(t),n=this._consumables[e];for(const t of i)if("attributes"!==e||"class"!==t&&"style"!==t){if(n.set(t,!1),"styles"==e)for(const e of this.element.document.stylesProcessor.getRelatedStyles(t))n.set(e,!1)}else{const e="class"==t?"classes":"styles";this._consume(e,[...this._consumables[e].keys()])}}_revert(e,t){const i=Qr(t),n=this._consumables[e];for(const t of i)if("attributes"!==e||"class"!==t&&"style"!==t){!1===n.get(t)&&n.set(t,!0)}else{const e="class"==t?"classes":"styles";this._revert(e,[...this._consumables[e].keys()])}}}class Mc extends(Ln()){_sourceDefinitions={};_attributeProperties=Object.create(null);_customChildChecks=new Map;_customAttributeChecks=new Map;_genericCheckSymbol=Symbol("$generic");_compiledDefinitions;constructor(){super(),this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",((e,t)=>{t[0]=new Nc(t[0])}),{priority:"highest"}),this.on("checkChild",((e,t)=>{t[0]=new Nc(t[0]),t[1]=this.getDefinition(t[1])}),{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new gn("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new gn("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return t="string"==typeof e?e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?"$text":e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){const t=this.getDefinition(e);return!(!t||!t.isBlock)}isLimit(e){const t=this.getDefinition(e);return!!t&&!(!t.isLimit&&!t.isObject)}isObject(e){const t=this.getDefinition(e);return!!t&&!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent)}isInline(e){const t=this.getDefinition(e);return!(!t||!t.isInline)}isSelectable(e){const t=this.getDefinition(e);return!!t&&!(!t.isSelectable&&!t.isObject)}isContent(e){const t=this.getDefinition(e);return!!t&&!(!t.isContent&&!t.isObject)}checkChild(e,t){return!!t&&this._checkContextMatch(e,t)}checkAttribute(e,t){const i=this.getDefinition(e.last);if(!i)return!1;const n=this._evaluateAttributeChecks(e,t);return void 0!==n?n:i.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof Sl){const t=e.nodeBefore,i=e.nodeAfter;if(!(t instanceof Al))throw new gn("schema-check-merge-no-element-before",this);if(!(i instanceof Al))throw new gn("schema-check-merge-no-element-after",this);return this.checkMerge(t,i)}if(this.isLimit(e)||this.isLimit(t))return!1;for(const i of t.getChildren())if(!this.checkChild(e,i))return!1;return!0}addChildCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,n=this._customChildChecks.get(i)||[];n.push(e),this._customChildChecks.set(i,n)}addAttributeCheck(e,t){const i=void 0!==t?t:this._genericCheckSymbol,n=this._customAttributeChecks.get(i)||[];n.push(e),this._customAttributeChecks.set(i,n)}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||Object.create(null)}getLimitElement(e){let t;if(e instanceof Sl)t=e.parent;else{t=(e instanceof Ol?[e]:Array.from(e.getRanges())).reduce(((e,t)=>{const i=t.getCommonAncestor();return e?e.getCommonAncestor(i,{includeSelf:!0}):i}),null)}for(;!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){const i=[...e.getFirstPosition().getAncestors(),new Cl("",e.getAttributes())];return this.checkAttribute(i,t)}{const i=e.getRanges();for(const e of i)for(const i of e)if(this.checkAttribute(i.item,t))return!0}return!1}*getValidRanges(e,t){e=function*(e){for(const t of e)yield*t.getMinimalFlatRanges()}(e);for(const i of e)yield*this._getValidRangesForRange(i,t)}getNearestSelectionRange(e,t="both"){if("$graveyard"==e.root.rootName)return null;if(this.checkChild(e,"$text"))return new Ol(e);let i,n;const r=e.getAncestors().reverse().find((e=>this.isLimit(e)))||e.root;"both"!=t&&"backward"!=t||(i=new Tl({boundaries:Ol._createIn(r),startPosition:e,direction:"backward"})),"both"!=t&&"forward"!=t||(n=new Tl({boundaries:Ol._createIn(r),startPosition:e}));for(const e of function*(e,t){let i=!1;for(;!i;){if(i=!0,e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}if(t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}}}(i,n)){const t=e.walker==i?"elementEnd":"elementStart",n=e.value;if(n.type==t&&this.isObject(n.item))return Ol._createOn(n.item);if(this.checkChild(n.nextPosition,"$text"))return new Ol(n.nextPosition)}return null}findAllowedParent(e,t){let i=e.parent;for(;i;){if(this.checkChild(i,t))return i;if(this.isLimit(i))return null;i=i.parent}return null}setAllowedAttributes(e,t,i){const n=i.model;for(const[r,s]of Object.entries(t))n.schema.checkAttribute(e,r)&&i.setAttribute(r,s,e)}removeDisallowedAttributes(e,t){for(const i of e)if(i.is("$text"))Jc(this,i,t);else{const e=Ol._createIn(i).getPositions();for(const i of e){Jc(this,i.nodeBefore||i.parent,t)}}}getAttributesWithProperty(e,t,i){const n={};for(const[r,s]of e.getAttributes()){const e=this.getAttributeProperties(r);void 0!==e[t]&&(void 0!==i&&i!==e[t]||(n[r]=s))}return n}createContext(e){return new Nc(e)}_clearCache(){this._compiledDefinitions=null}_compile(){const e={},t=this._sourceDefinitions,i=Object.keys(t);for(const n of i)e[n]=Lc(t[n],n);const n=Object.values(e);for(const t of n)Dc(e,t),zc(e,t),Hc(e,t),Wc(e,t);for(const t of n)$c(e,t);for(const t of n)Uc(e,t);for(const t of n)jc(e,t);for(const t of n)qc(e,t);for(const t of n)Gc(e,t);this._compiledDefinitions=function(e){const t={};for(const i of Object.values(e))t[i.name]={name:i.name,isBlock:!!i.isBlock,isContent:!!i.isContent,isInline:!!i.isInline,isLimit:!!i.isLimit,isObject:!!i.isObject,isSelectable:!!i.isSelectable,allowIn:Array.from(i.allowIn).filter((t=>!!e[t])),allowChildren:Array.from(i.allowChildren).filter((t=>!!e[t])),allowAttributes:Array.from(i.allowAttributes)};return t}(e)}_checkContextMatch(e,t){const i=e.last;let n=this._evaluateChildChecks(e,t);if(n=void 0!==n?n:t.allowIn.includes(i.name),!n)return!1;const r=this.getDefinition(i),s=e.trimLast();return!!r&&(0==s.length||this._checkContextMatch(s,r))}_evaluateChildChecks(e,t){const i=this._customChildChecks.get(this._genericCheckSymbol)||[],n=this._customChildChecks.get(t.name)||[];for(const r of[...i,...n]){const i=r(e,t);if(void 0!==i)return i}}_evaluateAttributeChecks(e,t){const i=this._customAttributeChecks.get(this._genericCheckSymbol)||[],n=this._customAttributeChecks.get(t)||[];for(const r of[...i,...n]){const i=r(e,t);if(void 0!==i)return i}}*_getValidRangesForRange(e,t){let i=e.start,n=e.start;for(const r of e.getItems({shallow:!0}))r.is("element")&&(yield*this._getValidRangesForRange(Ol._createIn(r),t)),this.checkAttribute(r,t)||(i.isEqual(n)||(yield new Ol(i,n)),i=Sl._createAfter(r)),n=Sl._createAfter(r);i.isEqual(n)||(yield new Ol(i,n))}findOptimalInsertionRange(e,t){const i=e.getSelectedElement();if(i&&this.isObject(i)&&!this.isInline(i))return"before"==t||"after"==t?new Ol(Sl._createAt(i,t)):Ol._createOn(i);const n=ts(e.getSelectedBlocks());if(!n)return new Ol(e.focus);if(n.isEmpty)return new Ol(Sl._createAt(n,0));const r=Sl._createAfter(n);return e.focus.isTouching(r)?new Ol(r):new Ol(Sl._createBefore(n))}}class Nc{_items;constructor(e){if(e instanceof Nc)return e;let t;t="string"==typeof e?[e]:Array.isArray(e)?e:e.getAncestors({includeSelf:!0}),this._items=t.map(Zc)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(e){const t=new Nc([e]);return t._items=[...this._items,...t._items],t}trimLast(){const e=new Nc([]);return e._items=this._items.slice(0,-1),e}getItem(e){return this._items[e]}*getNames(){yield*this._items.map((e=>e.name))}endsWith(e){return Array.from(this.getNames()).join(" ").endsWith(e)}startsWith(e){return Array.from(this.getNames()).join(" ").startsWith(e)}}function Lc(e,t){const i={name:t,allowIn:new Set,allowChildren:new Set,disallowIn:new Set,disallowChildren:new Set,allowContentOf:new Set,allowWhere:new Set,allowAttributes:new Set,disallowAttributes:new Set,allowAttributesOf:new Set,inheritTypesFrom:new Set};return function(e,t){for(const i of e){const e=Object.keys(i).filter((e=>e.startsWith("is")));for(const n of e)t[n]=!!i[n]}}(e,i),Kc(e,i,"allowIn"),Kc(e,i,"allowChildren"),Kc(e,i,"disallowIn"),Kc(e,i,"disallowChildren"),Kc(e,i,"allowContentOf"),Kc(e,i,"allowWhere"),Kc(e,i,"allowAttributes"),Kc(e,i,"disallowAttributes"),Kc(e,i,"allowAttributesOf"),Kc(e,i,"inheritTypesFrom"),function(e,t){for(const i of e){const e=i.inheritAllFrom;e&&(t.allowContentOf.add(e),t.allowWhere.add(e),t.allowAttributesOf.add(e),t.inheritTypesFrom.add(e))}}(e,i),i}function Dc(e,t){for(const i of t.allowIn){const n=e[i];n?n.allowChildren.add(t.name):t.allowIn.delete(i)}}function zc(e,t){for(const i of t.allowChildren){const n=e[i];n?n.allowIn.add(t.name):t.allowChildren.delete(i)}}function Hc(e,t){for(const i of t.disallowIn){const n=e[i];n?n.disallowChildren.add(t.name):t.disallowIn.delete(i)}}function Wc(e,t){for(const i of t.disallowChildren){const n=e[i];n?n.disallowIn.add(t.name):t.disallowChildren.delete(i)}}function $c(e,t){for(const e of t.disallowChildren)t.allowChildren.delete(e);for(const e of t.disallowIn)t.allowIn.delete(e);for(const e of t.disallowAttributes)t.allowAttributes.delete(e)}function Uc(e,t){for(const i of t.allowContentOf){const n=e[i];n&&(n.disallowChildren.forEach((i=>{t.allowChildren.has(i)||(t.disallowChildren.add(i),e[i].disallowIn.add(t.name))})),n.allowChildren.forEach((i=>{t.disallowChildren.has(i)||(t.allowChildren.add(i),e[i].allowIn.add(t.name))})))}}function jc(e,t){for(const i of t.allowWhere){const n=e[i];n&&(n.disallowIn.forEach((i=>{t.allowIn.has(i)||(t.disallowIn.add(i),e[i].disallowChildren.add(t.name))})),n.allowIn.forEach((i=>{t.disallowIn.has(i)||(t.allowIn.add(i),e[i].allowChildren.add(t.name))})))}}function qc(e,t){for(const i of t.allowAttributesOf){const n=e[i];if(!n)return;n.allowAttributes.forEach((e=>{t.disallowAttributes.has(e)||t.allowAttributes.add(e)}))}}function Gc(e,t){for(const i of t.inheritTypesFrom){const n=e[i];if(n){const e=Object.keys(n).filter((e=>e.startsWith("is")));for(const i of e)i in t||(t[i]=n[i])}}}function Kc(e,t,i){for(const n of e){let e=n[i];"string"==typeof e&&(e=[e]),Array.isArray(e)&&e.forEach((e=>t[i].add(e)))}}function Zc(e){return"string"==typeof e||e.is("documentFragment")?{name:"string"==typeof e?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute:t=>e.getAttribute(t)}}function Jc(e,t,i){for(const n of t.getAttributeKeys())e.checkAttribute(t,n)||i.removeAttribute(n,t)}class Qc extends(xn()){conversionApi;_splitParts=new Map;_cursorParents=new Map;_modelCursor=null;_emptyElementsToKeep=new Set;constructor(e){super(),this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(e,t)=>this._convertItem(e,t),convertChildren:(e,t)=>this._convertChildren(e,t),safeInsert:(e,t)=>this._safeInsert(e,t),updateConversionResult:(e,t)=>this._updateConversionResult(e,t),splitToAllowedParent:(e,t)=>this._splitToAllowedParent(e,t),getSplitParts:e=>this._getSplitParts(e),keepEmptyElement:e=>this._keepEmptyElement(e)}}convert(e,t,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=function(e,t){let i;for(const n of new Nc(e)){const e={};for(const t of n.getAttributeKeys())e[t]=n.getAttribute(t);const r=t.createElement(n.name,e);i&&t.insert(r,i),i=Sl._createAt(r,0)}return i}(i,t),this.conversionApi.writer=t,this.conversionApi.consumable=Bc.createFrom(e),this.conversionApi.store={};const{modelRange:n}=this._convertItem(e,this._modelCursor),r=t.createDocumentFragment();if(n){this._removeEmptyElements();for(const e of Array.from(this._modelCursor.parent.getChildren()))t.append(e,r);r.markers=function(e,t){const i=new Set,n=new Map,r=Ol._createIn(e).getItems();for(const e of r)e.is("element","$marker")&&i.add(e);for(const e of i){const i=e.getAttribute("data-name"),r=t.createPositionBefore(e);n.has(i)?n.get(i).end=r.clone():n.set(i,new Ol(r.clone())),t.remove(e)}return n}(r,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,r}_convertItem(e,t){const i={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,i,this.conversionApi):e.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof Ol))throw new gn("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){let i=t.is("position")?t:Sl._createAt(t,0);const n=new Ol(i);for(const t of Array.from(e.getChildren())){const e=this._convertItem(t,i);e.modelRange instanceof Ol&&(n.end=e.modelRange.end,i=e.modelCursor)}return{modelRange:n,modelCursor:i}}_safeInsert(e,t){const i=this._splitToAllowedParent(e,t);return!!i&&(this.conversionApi.writer.insert(e,i.position),!0)}_updateConversionResult(e,t){const i=this._getSplitParts(e),n=this.conversionApi.writer;t.modelRange||(t.modelRange=n.createRange(n.createPositionBefore(e),n.createPositionAfter(i[i.length-1])));const r=this._cursorParents.get(e);t.modelCursor=r?n.createPositionAt(r,0):t.modelRange.end}_splitToAllowedParent(e,t){const{schema:i,writer:n}=this.conversionApi;let r=i.findAllowedParent(t,e);if(r){if(r===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(r)&&(r=null)}if(!r)return _c(t,e,i)?{position:vc(t,n)}:null;const s=this.conversionApi.writer.split(t,r),o=[];for(const e of s.range.getWalker())if("elementEnd"==e.type)o.push(e.item);else{const t=o.pop(),i=e.item;this._registerSplitPair(t,i)}const a=s.range.end.parent;return this._cursorParents.set(e,a),{position:s.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);const i=this._splitParts.get(e);this._splitParts.set(t,i),i.push(t)}_getSplitParts(e){let t;return t=this._splitParts.has(e)?this._splitParts.get(e):[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=!1;for(const t of this._splitParts.keys())t.isEmpty&&!this._emptyElementsToKeep.has(t)&&(this.conversionApi.writer.remove(t),this._splitParts.delete(t),e=!0);e&&this._removeEmptyElements()}}class Yc{getHtml(e){const t=ji.document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}}class Xc{domParser;domConverter;htmlWriter;skipComments=!0;constructor(e){this.domParser=new DOMParser,this.domConverter=new el(e,{renderingMode:"data"}),this.htmlWriter=new Yc}toData(e){const t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){const t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode="marked"==e?"markedNbsp":"nbsp"}_toDom(e){/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4))||(e=`${e}`);const t=this.domParser.parseFromString(e,"text/html"),i=t.createDocumentFragment(),n=t.body.childNodes;for(;n.length>0;)i.appendChild(n[0]);return i}}class eh extends(xn()){model;mapper;downcastDispatcher;upcastDispatcher;viewDocument;stylesProcessor;htmlProcessor;processor;_viewWriter;constructor(e,t){super(),this.model=e,this.mapper=new Fl,this.downcastDispatcher=new Ll({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=i.writer,r=i.mapper.toViewPosition(t.range.start),s=n.createText(t.item.data);n.insert(r,s)}),{priority:"lowest"}),this.downcastDispatcher.on("insert",((e,t,i)=>{i.convertAttributes(t.item),t.reconversion||!t.item.is("element")||t.item.isEmpty||i.convertChildren(t.item)}),{priority:"lowest"}),this.upcastDispatcher=new Qc({schema:e.schema}),this.viewDocument=new ua(t),this.stylesProcessor=t,this.htmlProcessor=new Xc(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new xa(this.viewDocument),this.upcastDispatcher.on("text",((e,t,{schema:i,consumable:n,writer:r})=>{let s=t.modelCursor;if(!n.test(t.viewItem))return;if(!i.checkChild(s,"$text")){if(!_c(s,"$text",i))return;if(0==t.viewItem.data.trim().length)return;s=vc(s,r)}n.consume(t.viewItem);const o=r.createText(t.viewItem.data);r.insert(o,s),t.modelRange=r.createRange(s,s.getShiftedBy(o.offsetSize)),t.modelCursor=t.modelRange.end}),{priority:"lowest"}),this.upcastDispatcher.on("element",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=n}}),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",((e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){const{modelRange:e,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=e,t.modelCursor=n}}),{priority:"lowest"}),Ln().prototype.decorate.call(this,"init"),Ln().prototype.decorate.call(this,"set"),Ln().prototype.decorate.call(this,"get"),Ln().prototype.decorate.call(this,"toView"),Ln().prototype.decorate.call(this,"toModel"),this.on("init",(()=>{this.fire("ready")}),{priority:"lowest"}),this.on("ready",(()=>{this.model.enqueueChange({isUndoable:!1},bc)}),{priority:"lowest"})}get(e={}){const{rootName:t="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([t]))throw new gn("datacontroller-get-non-existent-root",this);const n=this.model.document.getRoot(t);return n.isAttached()||fn("datacontroller-get-detached-root",this),"empty"!==i||this.model.hasContent(n,{ignoreWhitespaces:!0})?this.stringify(n,e):""}stringify(e,t={}){const i=this.toView(e,t);return this.processor.toData(i)}toView(e,t={}){const i=this.viewDocument,n=this._viewWriter;this.mapper.clearBindings();const r=Ol._createIn(e),s=new Ca(i);this.mapper.bindElements(e,s);const o=e.is("documentFragment")?e.markers:function(e){const t=[],i=e.root.document;if(!i)return new Map;const n=Ol._createIn(e);for(const e of i.model.markers){const i=e.getRange(),r=i.isCollapsed,s=i.start.isEqual(n.start)||i.end.isEqual(n.end);if(r&&s)t.push([e.name,i]);else{const r=n.getIntersection(i);r&&t.push([e.name,r])}}return t.sort((([e,t],[i,n])=>{if("after"!==t.end.compareWith(n.start))return 1;if("before"!==t.start.compareWith(n.end))return-1;switch(t.start.compareWith(n.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(n.end)){case"before":return 1;case"after":return-1;default:return i.localeCompare(e)}}})),new Map(t)}(e);return this.downcastDispatcher.convert(r,o,n,t),s}init(e){if(this.model.document.version)throw new gn("datacontroller-init-document-not-empty",this);let t={};if("string"==typeof e?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new gn("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},(e=>{for(const i of Object.keys(t)){const n=this.model.document.getRoot(i);e.insert(this.parse(t[i],n),n,0)}})),Promise.resolve()}set(e,t={}){let i={};if("string"==typeof e?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new gn("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},(e=>{e.setSelection(null),e.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const t of Object.keys(i)){const n=this.model.document.getRoot(t);e.remove(e.createRangeIn(n)),e.insert(this.parse(i[t],n),n,0)}}))}parse(e,t="$root"){const i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change((i=>this.upcastDispatcher.convert(e,i,t)))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(const t of e)if(!this.model.document.getRoot(t))return!1;return!0}}class th{_helpers=new Map;_downcast;_upcast;constructor(e,t){this._downcast=Qr(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Qr(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){const i=this._downcast.includes(t);if(!this._upcast.includes(t)&&!i)throw new gn("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new gn("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(const{model:t,view:i}of ih(e))this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(const{model:t,view:i}of ih(e))this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(const{model:t,view:i}of ih(e))this.for("upcast").attributeToAttribute({view:i,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e))throw new gn("conversion-group-exists",this);const n=i?new ic(t):new yc(t);this._helpers.set(e,n)}}function*ih(e){if(e.model.values)for(const t of e.model.values){const i={key:e.model.key,value:t},n=e.view[t],r=e.upcastAlso?e.upcastAlso[t]:void 0;yield*nh(i,n,r)}else yield*nh(e.model,e.view,e.upcastAlso)}function*nh(e,t,i){if(yield{model:e,view:t},i)for(const t of Qr(i))yield{model:e,view:t}}class rh{baseVersion;isDocumentOperation;batch;constructor(e){this.baseVersion=e,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}}function sh(e,t){const i=lh(t),n=i.reduce(((e,t)=>e+t.offsetSize),0),r=e.parent;hh(e);const s=e.index;return r._insertChild(s,i),ch(r,s+i.length),ch(r,s),new Ol(e,e.getShiftedBy(n))}function oh(e){if(!e.isFlat)throw new gn("operation-utils-remove-range-not-flat",this);const t=e.start.parent;hh(e.start),hh(e.end);const i=t._removeChildren(e.start.index,e.end.index-e.start.index);return ch(t,e.start.index),i}function ah(e,t){if(!e.isFlat)throw new gn("operation-utils-move-range-not-flat",this);const i=oh(e);return sh(t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),i)}function lh(e){const t=[];!function e(i){if("string"==typeof i)t.push(new Cl(i));else if(i instanceof xl)t.push(new Cl(i.data,i.getAttributes()));else if(i instanceof yl)t.push(i);else if(Gn(i))for(const t of i)e(t)}(e);for(let e=1;ee.maxOffset)throw new gn("move-operation-nodes-do-not-exist",this);if(e===t&&i=i&&this.targetPosition.path[e]e._clone(!0)))),t=new mh(this.position,e,this.baseVersion);return t.shouldReceiveAttributes=this.shouldReceiveAttributes,t}getReversed(){const e=this.position.root.document.graveyard,t=new Sl(e,[0]);return new uh(this.position,this.nodes.maxOffset,t,this.baseVersion+1)}_validate(){const e=this.position.parent;if(!e||e.maxOffsete._clone(!0)))),sh(this.position,e)}toJSON(){const e=super.toJSON();return e.position=this.position.toJSON(),e.nodes=this.nodes.toJSON(),e}static get className(){return"InsertOperation"}static fromJSON(e,t){const i=[];for(const t of e.nodes)t.name?i.push(Al.fromJSON(t)):i.push(Cl.fromJSON(t));const n=new mh(Sl.fromJSON(e.position,t),i,e.baseVersion);return n.shouldReceiveAttributes=e.shouldReceiveAttributes,n}}class gh extends rh{splitPosition;howMany;insertionPosition;graveyardPosition;constructor(e,t,i,n,r){super(r),this.splitPosition=e.clone(),this.splitPosition.stickiness="toNext",this.howMany=t,this.insertionPosition=i,this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const e=this.insertionPosition.path.slice();return e.push(0),new Sl(this.insertionPosition.root,e)}get movedRange(){const e=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new Ol(this.splitPosition,e)}get affectedSelectable(){const e=[Ol._createFromPositionAndShift(this.splitPosition,0),Ol._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&e.push(Ol._createFromPositionAndShift(this.graveyardPosition,0)),e}clone(){return new gh(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const e=this.splitPosition.root.document.graveyard,t=new Sl(e,[0]);return new fh(this.moveTargetPosition,this.howMany,this.splitPosition,t,this.baseVersion+1)}_validate(){const e=this.splitPosition.parent,t=this.splitPosition.offset;if(!e||e.maxOffset0&&(e.sourcePosition.isEqual(t.sourcePosition.getShiftedBy(t.howMany))&&this._setRelation(e,t,"mergeSourceAffected"),e.targetPosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeTargetWasBefore"));else if(e instanceof ph){const i=e.newRange;if(!i)return;if(t instanceof fh){const n=i.start.isEqual(t.targetPosition),r=i.start.isEqual(t.deletionPosition),s=i.end.isEqual(t.deletionPosition),o=i.end.isEqual(t.sourcePosition);(n||r||s||o)&&this._setRelation(e,t,{wasInLeftElement:n,wasStartBeforeMergedElement:r,wasEndBeforeMergedElement:s,wasInRightElement:o})}}}getContext(e,t,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){const t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){const i=this.originalOperations.get(t),n=this._history.getUndoneOperation(i);if(!n)return null;const r=this.originalOperations.get(e),s=this._relations.get(r);return s&&s.get(n)||null}_setRelation(e,t,i){const n=this.originalOperations.get(e),r=this.originalOperations.get(t);let s=this._relations.get(n);s||(s=new Map,this._relations.set(n,s)),s.set(r,i)}}function Ih(e,t){for(const i of e)i.baseVersion=t++}function Vh(e,t){for(let i=0;i{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){const n=e.range.getDifference(t.range).map((t=>new wh(t,e.key,e.oldValue,e.newValue,0))),r=e.range.getIntersection(t.range);return r&&i.aIsStrong&&n.push(new wh(r,t.key,t.newValue,e.newValue,0)),0==n.length?[new bh(0)]:n}return[e]})),Ah(wh,mh,((e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){const i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map((t=>new wh(t,e.key,e.oldValue,e.newValue,e.baseVersion)));if(t.shouldReceiveAttributes){const n=Bh(t,e.key,e.oldValue);n&&i.unshift(n)}return i}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]})),Ah(wh,fh,((e,t)=>{const i=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&i.push(Ol._createFromPositionAndShift(t.graveyardPosition,1));const n=e.range._getTransformedByMergeOperation(t);return n.isCollapsed||i.push(n),i.map((t=>new wh(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),Ah(wh,uh,((e,t)=>{const i=function(e,t){const i=Ol._createFromPositionAndShift(t.sourcePosition,t.howMany);let n=null,r=[];i.containsRange(e,!0)?n=e:e.start.hasSameParentAs(i.start)?(r=e.getDifference(i),n=e.getIntersection(i)):r=[e];const s=[];for(let e of r){e=e._getTransformedByDeletion(t.sourcePosition,t.howMany);const i=t.getMovedRangeStart(),n=e.start.hasSameParentAs(i),r=e._getTransformedByInsertion(i,t.howMany,n);s.push(...r)}n&&s.push(n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]);return s}(e.range,t);return i.map((t=>new wh(t,e.key,e.oldValue,e.newValue,e.baseVersion)))})),Ah(wh,gh,((e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){const i=e.clone();return i.range=new Ol(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,i]}return e.range=e.range._getTransformedBySplitOperation(t),[e]})),Ah(mh,wh,((e,t)=>{const i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){const n=Bh(e,t.key,t.newValue);n&&i.push(n)}return i})),Ah(mh,mh,((e,t,i)=>(e.position.isEqual(t.position)&&i.aIsStrong||(e.position=e.position._getTransformedByInsertOperation(t)),[e]))),Ah(mh,uh,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),Ah(mh,gh,((e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e]))),Ah(mh,fh,((e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e]))),Ah(ph,mh,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e]))),Ah(ph,ph,((e,t,i)=>{if(e.name==t.name){if(!i.aIsStrong)return[new bh(0)];e.oldRange=t.newRange?t.newRange.clone():null}return[e]})),Ah(ph,fh,((e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e]))),Ah(ph,uh,((e,t)=>{const i=[e];if(e.oldRange&&(e.oldRange=Ol._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){const n=e.newRange._getTransformedByMoveOperation(t);e.newRange=n[0];for(let t=1;t{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(i.abRelation){const n=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?e.newRange.start=Sl._createAt(t.insertionPosition):e.newRange.start.isEqual(t.splitPosition)&&!i.abRelation.wasInLeftElement?e.newRange.start=Sl._createAt(t.moveTargetPosition):e.newRange.start=n.start,e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasInRightElement?e.newRange.end=Sl._createAt(t.moveTargetPosition):e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?e.newRange.end=Sl._createAt(t.insertionPosition):e.newRange.end=n.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]})),Ah(fh,mh,((e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e]))),Ah(fh,fh,((e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition)){if(i.bWasUndone){const i=t.graveyardPosition.path.slice();return i.push(0),e.sourcePosition=new Sl(t.graveyardPosition.root,i),e.howMany=0,[e]}return[new bh(0)]}if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const n="$graveyard"==e.targetPosition.root.rootName,r="$graveyard"==t.targetPosition.root.rootName;if(r&&!n||!(n&&!r)&&i.aIsStrong){const i=t.targetPosition._getTransformedByMergeOperation(t),n=e.targetPosition._getTransformedByMergeOperation(t);return[new uh(i,e.howMany,n,0)]}return[new bh(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),e.graveyardPosition.isEqual(t.graveyardPosition)&&i.aIsStrong||(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),Ah(fh,uh,((e,t,i)=>{const n=Ol._createFromPositionAndShift(t.sourcePosition,t.howMany);return"remove"==t.type&&!i.bWasUndone&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.sourcePosition)?[new bh(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(e.sourcePosition)?e.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(e.sourcePosition)&&"mergeSourceAffected"==i.abRelation?e.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(e.targetPosition)?(e.targetPosition.stickiness="toNone",e.howMany-=t.howMany):t.targetPosition.isEqual(e.targetPosition)&&"mergeTargetWasBefore"==i.abRelation?(e.targetPosition.stickiness="toPrevious",e.howMany+=t.howMany):(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany)),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.sourcePosition.stickiness="toPrevious",e.targetPosition.stickiness="toNext",e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])})),Ah(fh,gh,((e,t,i)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)){if(t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition)||"mergeTargetNotMoved"==i.abRelation)return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e]}if(e.sourcePosition.isEqual(t.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if("mergeSameElement"==i.abRelation||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]})),Ah(uh,mh,((e,t)=>{const i=Ol._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]})),Ah(uh,uh,((e,t,i)=>{const n=Ol._createFromPositionAndShift(e.sourcePosition,e.howMany),r=Ol._createFromPositionAndShift(t.sourcePosition,t.howMany);let s,o=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),s=e.targetPosition.isEqual(t.targetPosition)&&a?e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Oh(e,t)&&Oh(t,e))return[t.getReversed()];if(n.containsPosition(t.targetPosition)&&n.containsRange(r,!0))return n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Fh([n],s);if(r.containsPosition(e.targetPosition)&&r.containsRange(n,!0))return n.start=n.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),n.end=n.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),Fh([n],s);const l=qn(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return n.start=n.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),n.end=n.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Fh([n],s);"remove"!=e.type||"remove"==t.type||i.aWasUndone||i.forceWeakRemove?"remove"==e.type||"remove"!=t.type||i.bWasUndone||i.forceWeakRemove||(o=!1):o=!0;const c=[],h=n.getDifference(r);for(const e of h){e.start=e.start._getTransformedByDeletion(t.sourcePosition,t.howMany),e.end=e.end._getTransformedByDeletion(t.sourcePosition,t.howMany);const i="same"==qn(e.start.getParentPath(),t.getMovedRangeStart().getParentPath()),n=e._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,i);c.push(...n)}const d=n.getIntersection(r);return null!==d&&o&&(d.start=d.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),d.end=d.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),0===c.length?c.push(d):1==c.length?r.start.isBefore(n.start)||r.start.isEqual(n.start)?c.unshift(d):c.push(d):c.splice(1,0,d)),0===c.length?[new bh(e.baseVersion)]:Fh(c,s)})),Ah(uh,gh,((e,t,i)=>{let n=e.targetPosition.clone();e.targetPosition.isEqual(t.insertionPosition)&&t.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(n=e.targetPosition._getTransformedBySplitOperation(t));const r=Ol._createFromPositionAndShift(e.sourcePosition,e.howMany);if(r.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.howMany++,e.targetPosition=n,[e];if(r.start.hasSameParentAs(t.splitPosition)&&r.containsPosition(t.splitPosition)){let e=new Ol(t.splitPosition,r.end);e=e._getTransformedBySplitOperation(t);return Fh([new Ol(r.start,t.splitPosition),e],n)}e.targetPosition.isEqual(t.splitPosition)&&"insertAtSource"==i.abRelation&&(n=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&"insertBetween"==i.abRelation&&(n=e.targetPosition);const s=[r._getTransformedBySplitOperation(t)];if(t.graveyardPosition){const n=r.start.isEqual(t.graveyardPosition)||r.containsPosition(t.graveyardPosition);e.howMany>1&&n&&!i.aWasUndone&&s.push(Ol._createFromPositionAndShift(t.insertionPosition,1))}return Fh(s,n)})),Ah(uh,fh,((e,t,i)=>{const n=Ol._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.sourcePosition))if("remove"!=e.type||i.forceWeakRemove){if(1==e.howMany)return i.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new bh(0)]}else if(!i.aWasUndone){const i=[];let n=t.graveyardPosition.clone(),r=t.targetPosition._getTransformedByMergeOperation(t);const s=e.targetPosition.getTransformedByOperation(t);e.howMany>1&&(i.push(new uh(e.sourcePosition,e.howMany-1,s,0)),n=n._getTransformedByMove(e.sourcePosition,s,e.howMany-1),r=r._getTransformedByMove(e.sourcePosition,s,e.howMany-1));const o=t.deletionPosition._getCombined(e.sourcePosition,s),a=new uh(n,1,o,0),l=a.getMovedRangeStart().path.slice();l.push(0);const c=new Sl(a.targetPosition.root,l);r=r._getTransformedByMove(n,o,1);const h=new uh(r,t.howMany,c,0);return i.push(a),i.push(h),i}const r=Ol._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=r.start,e.howMany=r.end.offset-r.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]})),Ah(_h,mh,((e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e]))),Ah(_h,fh,((e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e]))),Ah(_h,uh,((e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]))),Ah(_h,_h,((e,t,i)=>{if(e.position.isEqual(t.position)){if(!i.aIsStrong)return[new bh(0)];e.oldName=t.newName}return[e]})),Ah(_h,gh,((e,t)=>{if("same"==qn(e.position.path,t.splitPosition.getParentPath())&&!t.graveyardPosition){const t=new _h(e.position.getShiftedBy(1),e.oldName,e.newName,0);return[e,t]}return e.position=e.position._getTransformedBySplitOperation(t),[e]})),Ah(vh,vh,((e,t,i)=>{if(e.root===t.root&&e.key===t.key){if(!i.aIsStrong||e.newValue===t.newValue)return[new bh(0)];e.oldValue=t.newValue}return[e]})),Ah(yh,yh,((e,t)=>e.rootName===t.rootName&&e.isAdd===t.isAdd?[new bh(0)]:[e])),Ah(gh,mh,((e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){const i=t.graveyardPosition.path.slice();i.push(0);const n=new Sl(t.graveyardPosition.root,i),r=gh.getInsertionPosition(new Sl(t.graveyardPosition.root,i)),s=new gh(n,0,r,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=gh.getInsertionPosition(e.splitPosition),e.graveyardPosition=s.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[s,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=gh.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]})),Ah(gh,uh,((e,t,i)=>{const n=Ol._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){const r=n.start.isEqual(e.graveyardPosition)||n.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&r){const i=e.splitPosition._getTransformedByMoveOperation(t),n=e.graveyardPosition._getTransformedByMoveOperation(t),r=n.path.slice();r.push(0);const s=new Sl(n.root,r);return[new uh(i,e.howMany,s,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}const r=e.splitPosition.isEqual(t.targetPosition);if(r&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=gh.getInsertionPosition(e.splitPosition),[e];if(r&&i.abRelation&&i.abRelation.howMany){const{howMany:t,offset:n}=i.abRelation;return e.howMany+=t,e.splitPosition=e.splitPosition.getShiftedBy(n),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.splitPosition)){const i=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=i,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new bh(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new bh(0)];if("splitBefore"==i.abRelation)return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){const n="$graveyard"==e.splitPosition.root.rootName,r="$graveyard"==t.splitPosition.root.rootName;if(r&&!n||!(n&&!r)&&i.aIsStrong){const i=[];return t.howMany&&i.push(new uh(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&i.push(new uh(e.splitPosition,e.howMany,e.moveTargetPosition,0)),i}return[new bh(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.abRelation)return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.baRelation){const i=t.insertionPosition.path.slice();i.push(0);const n=new Sl(t.insertionPosition.root,i);return[e,new uh(e.insertionPosition,1,n,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset{const i=t[0];i.isDocumentOperation&&Lh.call(this,i)}),{priority:"low"})}function Lh(e){const t=this.getTransformedByOperation(e);if(!this.isEqual(t)){const e=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",e)}}Mh.prototype.is=function(e){return"livePosition"===e||"model:livePosition"===e||"position"==e||"model:position"===e};class Dh{operations;isUndoable;isLocal;isUndo;isTyping;constructor(e={}){"string"==typeof e&&(e="transparent"===e?{isUndoable:!1}:{},fn("batch-constructor-deprecated-string-type"));const{isUndoable:t=!0,isLocal:i=!0,isUndo:n=!1,isTyping:r=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=i,this.isUndo=n,this.isTyping=r}get type(){return fn("batch-type-deprecated"),"default"}get baseVersion(){for(const e of this.operations)if(null!==e.baseVersion)return e.baseVersion;return null}addOperation(e){return e.batch=this,this.operations.push(e),e}}class zh{static _statesPriority=[void 0,"refresh","rename","move"];_markerCollection;_changesInElement=new Map;_elementsSnapshots=new Map;_elementChildrenSnapshots=new Map;_elementState=new Map;_changedMarkers=new Map;_changedRoots=new Map;_changeCount=0;_cachedChanges=null;_cachedChangesWithGraveyard=null;_refreshedItems=new Set;constructor(e){this._markerCollection=e}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size&&0==this._changedRoots.size}bufferOperation(e){const t=e;switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);const n=Ol._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of n.getItems({shallow:!0}))this._setElementState(e,"move");break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=Ol._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getData();this.bufferMarkerChange(t.name,e,e)}this._setElementState(t.position.nodeAfter,"rename");break}case"split":{const e=t.splitPosition.parent;if(!this._isInInsertedElement(e)){this._markRemove(e,t.splitPosition.offset,t.howMany);const i=Ol._createFromPositionAndShift(t.splitPosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&(this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1),this._setElementState(t.graveyardPosition.nodeAfter,"move"));break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1),this._setElementState(e,"move");const n=t.targetPosition.parent;if(!this._isInInsertedElement(n)){this._markInsert(n,t.targetPosition.offset,e.maxOffset);const i=Ol._createFromPositionAndShift(t.sourcePosition,t.howMany);for(const e of i.getItems({shallow:!0}))this._setElementState(e,"move")}break}case"detachRoot":case"addRoot":{const e=t.affectedSelectable;if(!e._isLoaded)return;if(e.isAttached()==t.isAdd)return;this._bufferRootStateChange(t.rootName,t.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!t.root._isLoaded)return;const e=t.root.rootName;this._bufferRootAttributeChange(e,t.key,t.oldValue,t.newValue);break}}this._cachedChanges=null}bufferMarkerChange(e,t,i){t.range&&t.range.root.is("rootElement")&&!t.range.root._isLoaded&&(t.range=null),i.range&&i.range.root.is("rootElement")&&!i.range.root._isLoaded&&(i.range=null);let n=this._changedMarkers.get(e);n?n.newMarkerData=i:(n={newMarkerData:i,oldMarkerData:t},this._changedMarkers.set(e,n)),null==n.oldMarkerData.range&&null==i.range&&this._changedMarkers.delete(e)}getMarkersToRemove(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.oldMarkerData.range&&e.push({name:t,range:i.oldMarkerData.range});return e}getMarkersToAdd(){const e=[];for(const[t,i]of this._changedMarkers)null!=i.newMarkerData.range&&e.push({name:t,range:i.newMarkerData.range});return e}getChangedMarkers(){return Array.from(this._changedMarkers).map((([e,t])=>({name:e,data:{oldRange:t.oldMarkerData.range,newRange:t.newMarkerData.range}})))}hasDataChanges(){if(this.getChanges().length)return!0;if(this._changedRoots.size>0)return!0;for(const{newMarkerData:e,oldMarkerData:t}of this._changedMarkers.values()){if(e.affectsData!==t.affectsData)return!0;if(e.affectsData){const i=e.range&&!t.range,n=!e.range&&t.range,r=e.range&&t.range&&!e.range.isEqual(t.range);if(i||n||r)return!0}}return!1}getChanges(e={}){if(this._cachedChanges)return e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let t=[];for(const e of this._changesInElement.keys()){const i=this._changesInElement.get(e).sort(((e,t)=>e.offset===t.offset?e.type!=t.type?"remove"==e.type?-1:1:0:e.offsete.position.root!=t.position.root?e.position.root.rootNamee));for(const e of t)delete e.changeCount,"attribute"==e.type&&(delete e.position,delete e.length);return this._changeCount=0,this._cachedChangesWithGraveyard=t,this._cachedChanges=t.filter(Uh),e.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map((e=>{const t={...e};return void 0!==t.state&&delete t.attributes,t}))}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementChildrenSnapshots.clear(),this._elementsSnapshots.clear(),this._elementState.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems.clear(),this._cachedChanges=null}_refreshItem(e){if(this._isInInsertedElement(e.parent))return;this._markRemove(e.parent,e.startOffset,e.offsetSize),this._markInsert(e.parent,e.startOffset,e.offsetSize),this._refreshedItems.add(e),this._setElementState(e,"refresh");const t=Ol._createOn(e);for(const e of this._markerCollection.getMarkersIntersectingRange(t)){const t=e.getData();this.bufferMarkerChange(e.name,t,t)}this._cachedChanges=null}_bufferRootLoad(e){if(e.isAttached()){this._bufferRootStateChange(e.rootName,!0),this._markInsert(e,0,e.maxOffset);for(const t of e.getAttributeKeys())this._bufferRootAttributeChange(e.rootName,t,null,e.getAttribute(t));for(const t of this._markerCollection)if(t.getRange().root==e){const e=t.getData();this.bufferMarkerChange(t.name,{...e,range:null},e)}}}_bufferRootStateChange(e,t){if(!this._changedRoots.has(e))return void this._changedRoots.set(e,{name:e,state:t?"attached":"detached"});const i=this._changedRoots.get(e);void 0!==i.state?(delete i.state,void 0===i.attributes&&this._changedRoots.delete(e)):i.state=t?"attached":"detached"}_bufferRootAttributeChange(e,t,i,n){const r=this._changedRoots.get(e)||{name:e},s=r.attributes||{};if(s[t]){const e=s[t];n===e.oldValue?delete s[t]:e.newValue=n}else s[t]={oldValue:i,newValue:n};0===Object.entries(s).length?(delete r.attributes,void 0===r.state&&this._changedRoots.delete(e)):(r.attributes=s,this._changedRoots.set(e,r))}_markInsert(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const n={type:"insert",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,n)}_markRemove(e,t,i){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const n={type:"remove",offset:t,howMany:i,count:this._changeCount++};this._markChange(e,n),this._removeAllNestedChanges(e,t,i)}_markAttribute(e){if(e.root.is("rootElement")&&!e.root._isLoaded)return;const t={type:"attribute",offset:e.startOffset,howMany:e.offsetSize,count:this._changeCount++};this._markChange(e.parent,t)}_markChange(e,t){this._makeSnapshots(e);const i=this._getChangesForElement(e);this._handleChange(t,i),i.push(t);for(let e=0;ei&&this._elementState.set(e,t)}_getDiffActionForNode(e,t){if(!e.is("element"))return t;if(!this._elementsSnapshots.has(e))return t;const i=this._elementState.get(e);return i&&"move"!=i?i:t}_getChangesForElement(e){let t;return this._changesInElement.has(e)?t=this._changesInElement.get(e):(t=[],this._changesInElement.set(e,t)),t}_makeSnapshots(e){if(this._elementChildrenSnapshots.has(e))return;const t=Wh(e.getChildren());this._elementChildrenSnapshots.set(e,t);for(const e of t)this._elementsSnapshots.set(e.node,e)}_handleChange(e,t){e.nodesToHandle=e.howMany;for(const i of t){const n=e.offset+e.howMany,r=i.offset+i.howMany;if("insert"==e.type&&("insert"==i.type&&(e.offset<=i.offset?i.offset+=e.howMany:e.offseti.offset){if(n>r){const e={type:"attribute",offset:r,howMany:n-r,count:this._changeCount++};this._handleChange(e,t),t.push(e)}e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}else e.offset>=i.offset&&e.offsetr?(e.nodesToHandle=n-r,e.offset=r):e.nodesToHandle=0);if("remove"==i.type&&e.offseti.offset){const r={type:"attribute",offset:i.offset,howMany:n-i.offset,count:this._changeCount++};this._handleChange(r,t),t.push(r),e.nodesToHandle=i.offset-e.offset,e.howMany=e.nodesToHandle}"attribute"==i.type&&(e.offset>=i.offset&&n<=r?(e.nodesToHandle=0,e.howMany=0,e.offset=0):e.offset<=i.offset&&n>=r&&(i.howMany=0))}}e.howMany=e.nodesToHandle,delete e.nodesToHandle}_getInsertDiff(e,t,i,n,r){const s={type:"insert",position:Sl._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++,action:i};return"insert"!=i&&r&&(s.before={name:r.name,attributes:new Map(r.attributes)}),s}_getRemoveDiff(e,t,i,n){return{type:"remove",action:i,position:Sl._createAt(e,t),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(e,t,i){const n=[];i=new Map(i);for(const[r,s]of t){const t=i.has(r)?i.get(r):null;t!==s&&n.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:r,attributeOldValue:s,attributeNewValue:t,changeCount:this._changeCount++}),i.delete(r)}for(const[t,r]of i)n.push({type:"attribute",position:e.start,range:e.clone(),length:1,attributeKey:t,attributeOldValue:null,attributeNewValue:r,changeCount:this._changeCount++});return n}_isInInsertedElement(e){const t=e.parent;if(!t)return!1;const i=this._changesInElement.get(t),n=e.startOffset;if(i)for(const e of i)if("insert"==e.type&&n>=e.offset&&nn){for(let t=0;t1500)for(let t=0;tthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new gn("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];const i=this._operations[0];void 0===e&&(e=i.baseVersion);let n=t-1;for(const[t,i]of this._gaps)e>t&&et&&nthis.lastOperation.baseVersion)return[];let r=this._baseVersionToOperationIndex.get(e);void 0===r&&(r=0);let s=this._baseVersionToOperationIndex.get(n);return void 0===s&&(s=this._operations.length-1),this._operations.slice(r,s+1)}getOperation(e){const t=this._baseVersionToOperationIndex.get(e);if(void 0!==t)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}}class qh extends Al{rootName;_document;_isAttached=!0;_isLoaded=!0;constructor(e,t,i="main"){super(t),this._document=e,this.rootName=i}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}}qh.prototype.is=function(e,t){return t?t===this.name&&("rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e):"rootElement"===e||"model:rootElement"===e||"element"===e||"model:element"===e||"node"===e||"model:node"===e};const Gh="$graveyard";class Kh extends(xn()){model;history;selection;roots;differ;isReadOnly;_postFixers;_hasSelectionChangedFromTheLastChangeBlock;constructor(e){super(),this.model=e,this.history=new jh,this.selection=new Yl(this),this.roots=new es({idProperty:"rootName"}),this.differ=new zh(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Gh),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.differ.bufferOperation(i)}),{priority:"high"}),this.listenTo(e,"applyOperation",((e,t)=>{const i=t[0];i.isDocumentOperation&&this.history.addOperation(i)}),{priority:"low"}),this.listenTo(this.selection,"change",(()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0})),this.listenTo(e.markers,"update",((e,t,i,n,r)=>{const s={...t.getData(),range:n};this.differ.bufferMarkerChange(t.name,r,s),null===i&&t.on("change",((e,i)=>{const n=t.getData();this.differ.bufferMarkerChange(t.name,{...n,range:i},n)}))})),this.registerPostFixer((e=>{let t=!1;for(const i of this.roots)i.isAttached()||i.isEmpty||(e.remove(e.createRangeIn(i)),t=!0);for(const i of this.model.markers)i.getRange().root.isAttached()||(e.removeMarker(i),t=!0);return t}))}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Gh)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new gn("model-document-createroot-name-exists",this,{name:t});const i=new qh(this,e,t);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map((e=>e.rootName))}getRoots(e=!1){return this.roots.filter((t=>t!=this.graveyard&&(e||t.isAttached())&&t._isLoaded))}registerPostFixer(e){this._postFixers.add(e)}toJSON(){const e=Ls(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){const e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){const e=this._getDefaultRoot(),t=this.model,i=t.schema,n=t.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(n)||t.createRange(n)}_validateSelectionRange(e){return e.start.isValid()&&e.end.isValid()&&Zh(e.start)&&Zh(e.end)}_callPostFixers(e){let t=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),t=i(e),t)break}while(t)}}function Zh(e){const t=e.textNode;if(t){const i=t.data,n=e.offset-t.startOffset;return!ds(i,n)&&!us(i,n)}return!0}class Jh extends(xn()){_markers=new Map;[Symbol.iterator](){return this._markers.values()}has(e){const t=e instanceof Qh?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,i=!1,n=!1){const r=e instanceof Qh?e.name:e;if(r.includes(","))throw new gn("markercollection-incorrect-marker-name",this);const s=this._markers.get(r);if(s){const e=s.getData(),o=s.getRange();let a=!1;return o.isEqual(t)||(s._attachLiveRange(Kl.fromRange(t)),a=!0),i!=s.managedUsingOperations&&(s._managedUsingOperations=i,a=!0),"boolean"==typeof n&&n!=s.affectsData&&(s._affectsData=n,a=!0),a&&this.fire(`update:${r}`,s,o,t,e),s}const o=Kl.fromRange(t),a=new Qh(r,o,i,n);return this._markers.set(r,a),this.fire(`update:${r}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){const t=e instanceof Qh?e.name:e,i=this._markers.get(t);return!!i&&(this._markers.delete(t),this.fire(`update:${t}`,i,i.getRange(),null,i.getData()),this._destroyMarker(i),!0)}_refresh(e){const t=e instanceof Qh?e.name:e,i=this._markers.get(t);if(!i)throw new gn("markercollection-refresh-marker-not-exists",this);const n=i.getRange();this.fire(`update:${t}`,i,n,n,i.getData())}*getMarkersAtPosition(e){for(const t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(const t of this)null!==t.getRange().getIntersection(e)&&(yield t)}destroy(){for(const e of this._markers.values())this._destroyMarker(e);this._markers=null,this.stopListening()}*getMarkersGroup(e){for(const t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}}class Qh extends(xn(vl)){name;_managedUsingOperations;_affectsData;_liveRange;constructor(e,t,i,n){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=i,this._affectsData=n}get managedUsingOperations(){if(!this._liveRange)throw new gn("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new gn("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new gn("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new gn("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new gn("marker-destroyed",this);return this._liveRange.toRange()}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}Qh.prototype.is=function(e){return"marker"===e||"model:marker"===e};class Yh extends rh{sourcePosition;howMany;constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){const e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new gn("detach-operation-on-document-node",this)}_execute(){oh(Ol._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Xh extends vl{markers=new Map;_children=new kl;constructor(e){super(),e&&this._insertChild(0,e)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(e){return this._children.getNode(e)}getChildAtOffset(e){return this._children.getNodeAtOffset(e)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(e){return this._children.getNodeIndex(e)}getChildStartOffset(e){return this._children.getNodeStartOffset(e)}getPath(){return[]}getNodeByPath(e){let t=this;for(const i of e)t=t.getChildAtOffset(i);return t}offsetToIndex(e){return this._children.offsetToIndex(e)}toJSON(){const e=[];for(const t of this._children)e.push(t.toJSON());return e}static fromJSON(e){const t=[];for(const i of e)i.name?t.push(Al.fromJSON(i)):t.push(Cl.fromJSON(i));return new Xh(t)}_appendChild(e){this._insertChild(this.childCount,e)}_insertChild(e,t){const i=function(e){if("string"==typeof e)return[new Cl(e)];Gn(e)||(e=[e]);return Array.from(e).map((e=>"string"==typeof e?new Cl(e):e instanceof xl?new Cl(e.data,e.getAttributes()):e))}(t);for(const e of i)null!==e.parent&&e._remove(),e.parent=this;this._children._insertNodes(e,i)}_removeChildren(e,t=1){const i=this._children._removeNodes(e,t);for(const e of i)e.parent=null;return i}}Xh.prototype.is=function(e){return"documentFragment"===e||"model:documentFragment"===e};class ed{model;batch;constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new Cl(e,t)}createElement(e,t){return new Al(e,t)}createDocumentFragment(){return new Xh}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,i=0){if(this._assertWriterUsedCorrectly(),e instanceof Cl&&""==e.data)return;const n=Sl._createAt(t,i);if(e.parent){if(sd(e.root,n.root))return void this.move(Ol._createOn(e),n);if(e.root.document)throw new gn("model-writer-insert-forbidden-move",this);this.remove(e)}const r=n.root.document?n.root.document.version:null,s=new mh(n,e,r);if(e instanceof Cl&&(s.shouldReceiveAttributes=!0),this.batch.addOperation(s),this.model.applyOperation(s),e instanceof Xh)for(const[t,i]of e.markers){const e=Sl._createAt(i.root,0),r={range:new Ol(i.start._getCombined(e,n),i.end._getCombined(e,n)),usingOperation:!0,affectsData:!0};this.model.markers.has(t)?this.updateMarker(t,r):this.addMarker(t,r)}}insertText(e,t,i,n){t instanceof Xh||t instanceof Al||t instanceof Sl?this.insert(this.createText(e),t,i):this.insert(this.createText(e,t),i,n)}insertElement(e,t,i,n){t instanceof Xh||t instanceof Al||t instanceof Sl?this.insert(this.createElement(e),t,i):this.insert(this.createElement(e,t),i,n)}append(e,t){this.insert(e,t,"end")}appendText(e,t,i){t instanceof Xh||t instanceof Al?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),i,"end")}appendElement(e,t,i){t instanceof Xh||t instanceof Al?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),i,"end")}setAttribute(e,t,i){if(this._assertWriterUsedCorrectly(),i instanceof Ol){const n=i.getMinimalFlatRanges();for(const i of n)td(this,e,t,i)}else id(this,e,t,i)}setAttributes(e,t){for(const[i,n]of as(e))this.setAttribute(i,n,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof Ol){const i=t.getMinimalFlatRanges();for(const t of i)td(this,e,null,t)}else id(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();const t=e=>{for(const t of e.getAttributeKeys())this.removeAttribute(t,e)};if(e instanceof Ol)for(const i of e.getItems())t(i);else t(e)}move(e,t,i){if(this._assertWriterUsedCorrectly(),!(e instanceof Ol))throw new gn("writer-move-invalid-range",this);if(!e.isFlat)throw new gn("writer-move-range-not-flat",this);const n=Sl._createAt(t,i);if(n.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!sd(e.root,n.root))throw new gn("writer-move-different-document",this);const r=e.root.document?e.root.document.version:null,s=new uh(e.start,e.end.offset-e.start.offset,n,r);this.batch.addOperation(s),this.model.applyOperation(s)}remove(e){this._assertWriterUsedCorrectly();const t=(e instanceof Ol?e:Ol._createOn(e)).getMinimalFlatRanges().reverse();for(const e of t)this._addOperationForAffectedMarkers("move",e),rd(e.start,e.end.offset-e.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();const t=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof Al))throw new gn("writer-merge-no-element-before",this);if(!(i instanceof Al))throw new gn("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){const t=e.nodeBefore,i=e.nodeAfter;this.move(Ol._createIn(i),Sl._createAt(t,"end")),this.remove(i)}_merge(e){const t=Sl._createAt(e.nodeBefore,"end"),i=Sl._createAt(e.nodeAfter,0),n=e.root.document.graveyard,r=new Sl(n,[0]),s=e.root.document.version,o=new fh(i,e.nodeAfter.maxOffset,t,r,s);this.batch.addOperation(o),this.model.applyOperation(o)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof Al))throw new gn("writer-rename-not-element-instance",this);const i=e.root.document?e.root.document.version:null,n=new _h(Sl._createBefore(e),e.name,t,i);this.batch.addOperation(n),this.model.applyOperation(n)}split(e,t){this._assertWriterUsedCorrectly();let i,n,r=e.parent;if(!r.parent)throw new gn("writer-split-element-no-parent",this);if(t||(t=r.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new gn("writer-split-invalid-limit-element",this);do{const t=r.root.document?r.root.document.version:null,s=r.maxOffset-e.offset,o=gh.getInsertionPosition(e),a=new gh(e,s,o,null,t);this.batch.addOperation(a),this.model.applyOperation(a),i||n||(i=r,n=e.parent.nextSibling),r=(e=this.createPositionAfter(e.parent)).parent}while(r!==t);return{position:e,range:new Ol(Sl._createAt(i,"end"),Sl._createAt(n,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new gn("writer-wrap-range-not-flat",this);const i=t instanceof Al?t:new Al(t);if(i.childCount>0)throw new gn("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new gn("writer-wrap-element-attached",this);this.insert(i,e.start);const n=new Ol(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(n,Sl._createAt(i,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),null===e.parent)throw new gn("writer-unwrap-element-no-parent",this);this.move(Ol._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||"boolean"!=typeof t.usingOperation)throw new gn("writer-addmarker-no-usingoperation",this);const i=t.usingOperation,n=t.range,r=void 0!==t.affectsData&&t.affectsData;if(this.model.markers.has(e))throw new gn("writer-addmarker-marker-exists",this);if(!n)throw new gn("writer-addmarker-no-range",this);return i?(nd(this,e,null,n,r),this.model.markers.get(e)):this.model.markers._set(e,n,i,r)}updateMarker(e,t){this._assertWriterUsedCorrectly();const i="string"==typeof e?e:e.name,n=this.model.markers.get(i);if(!n)throw new gn("writer-updatemarker-marker-not-exists",this);if(!t)return fn("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),void this.model.markers._refresh(n);const r="boolean"==typeof t.usingOperation,s="boolean"==typeof t.affectsData,o=s?t.affectsData:n.affectsData;if(!r&&!t.range&&!s)throw new gn("writer-updatemarker-wrong-options",this);const a=n.getRange(),l=t.range?t.range:a;r&&t.usingOperation!==n.managedUsingOperations?t.usingOperation?nd(this,i,null,l,o):(nd(this,i,a,null,o),this.model.markers._set(i,l,void 0,o)):n.managedUsingOperations?nd(this,i,a,l,o):this.model.markers._set(i,l,void 0,o)}removeMarker(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?e:e.name;if(!this.model.markers.has(t))throw new gn("writer-removemarker-no-marker",this);const i=this.model.markers.get(t);if(!i.managedUsingOperations)return void this.model.markers._remove(t);nd(this,t,i.getRange(),null,i.affectsData)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();const i=this.model.document.getRoot(e);if(i&&i.isAttached())throw new gn("writer-addroot-root-exists",this);const n=this.model.document,r=new yh(e,t,!0,n,n.version);return this.batch.addOperation(r),this.model.applyOperation(r),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();const t="string"==typeof e?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new gn("writer-detachroot-no-root",this);for(const e of this.model.markers)e.getRange().root===t&&this.removeMarker(e);for(const e of t.getAttributeKeys())this.removeAttribute(e,t);this.remove(this.createRangeIn(t));const i=this.model.document,n=new yh(t.rootName,t.name,!1,i,i.version);this.batch.addOperation(n),this.model.applyOperation(n)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._setSelectionAttribute(e,t);else for(const[t,i]of as(e))this._setSelectionAttribute(t,i)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),"string"==typeof e)this._removeSelectionAttribute(e);else for(const t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const n=Yl._getStoreAttributeKey(e);this.setAttribute(n,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){const t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){const i=Yl._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new gn("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const n=i.getRange();let r=!1;if("move"===e){const e=t;r=e.containsPosition(n.start)||e.start.isEqual(n.start)||e.containsPosition(n.end)||e.end.isEqual(n.end)}else{const e=t,i=e.nodeBefore,s=e.nodeAfter,o=n.start.parent==i&&n.start.isAtEnd,a=n.end.parent==s&&0==n.end.offset,l=n.end.nodeAfter==s,c=n.start.nodeAfter==s;r=o||a||l||c}r&&this.updateMarker(i.name,{range:n})}}}function td(e,t,i,n){const r=e.model,s=r.document;let o,a,l,c=n.start;for(const e of n.getWalker({shallow:!0}))l=e.item.getAttribute(t),o&&a!=l&&(a!=i&&h(),c=o),o=e.nextPosition,a=l;function h(){const n=new Ol(c,o),l=n.root.document?s.version:null,h=new wh(n,t,a,i,l);e.batch.addOperation(h),r.applyOperation(h)}o instanceof Sl&&o!=c&&a!=i&&h()}function id(e,t,i,n){const r=e.model,s=r.document,o=n.getAttribute(t);let a,l;if(o!=i){if(n.root===n){const e=n.document?s.version:null;l=new vh(n,t,o,i,e)}else{a=new Ol(Sl._createBefore(n),e.createPositionAfter(n));const r=a.root.document?s.version:null;l=new wh(a,t,o,i,r)}e.batch.addOperation(l),r.applyOperation(l)}}function nd(e,t,i,n,r){const s=e.model,o=s.document,a=new ph(t,i,n,s.markers,!!r,o.version);e.batch.addOperation(a),s.applyOperation(a)}function rd(e,t,i,n){let r;if(e.root.document){const i=n.document,s=new Sl(i.graveyard,[0]);r=new uh(e,t,s,i.version)}else r=new Yh(e,t);i.addOperation(r),n.applyOperation(r)}function sd(e,t){return e===t||e instanceof qh&&t instanceof qh}function od(e,t,i={}){if(t.isCollapsed)return;const n=t.getFirstRange();if("$graveyard"==n.root.rootName)return;const r=e.schema;e.change((e=>{if(!i.doNotResetEntireContent&&function(e,t){const i=e.getLimitElement(t);if(!t.containsEntireContent(i))return!1;const n=t.getFirstRange();if(n.start.parent==n.end.parent)return!1;return e.checkChild(i,"paragraph")}(r,t))return void function(e,t){const i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i)),hd(e,e.createPositionAt(i,0),t)}(e,t);const s={};if(!i.doNotAutoparagraph){const e=t.getSelectedElement();e&&Object.assign(s,r.getAttributesWithProperty(e,"copyOnReplace",!0))}const[o,a]=function(e){const t=e.root.document.model,i=e.start;let n=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){const i=function(e){const t=e.parent,i=t.root.document.model.schema,n=t.getAncestors({parentFirst:!0,includeSelf:!0});for(const e of n){if(i.isLimit(e))return null;if(i.isBlock(e))return e}}(n);if(i&&n.isTouching(t.createPositionAt(i,0))){const i=t.createSelection(e);t.modifySelection(i,{direction:"backward"});const r=i.getLastPosition(),s=t.createRange(r,n);t.hasContent(s,{ignoreMarkers:!0})||(n=r)}}return[Mh.fromPosition(i,"toPrevious"),Mh.fromPosition(n,"toNext")]}(n);o.isTouching(a)||e.remove(e.createRange(o,a)),i.leaveUnmerged||(!function(e,t,i){const n=e.model;if(!cd(e.model.schema,t,i))return;const[r,s]=function(e,t){const i=e.getAncestors(),n=t.getAncestors();let r=0;for(;i[r]&&i[r]==n[r];)r++;return[i[r],n[r]]}(t,i);if(!r||!s)return;!n.hasContent(r,{ignoreMarkers:!0})&&n.hasContent(s,{ignoreMarkers:!0})?ld(e,t,i,r.parent):ad(e,t,i,r.parent)}(e,o,a),r.removeDisallowedAttributes(o.parent.getChildren(),e)),dd(e,t,o),!i.doNotAutoparagraph&&function(e,t){const i=e.checkChild(t,"$text"),n=e.checkChild(t,"paragraph");return!i&&n}(r,o)&&hd(e,o,t,s),o.detach(),a.detach()}))}function ad(e,t,i,n){const r=t.parent,s=i.parent;if(r!=n&&s!=n){for(t=e.createPositionAfter(r),(i=e.createPositionBefore(s)).isEqual(t)||e.insert(s,t),e.merge(t);i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}cd(e.model.schema,t,i)&&ad(e,t,i,n)}}function ld(e,t,i,n){const r=t.parent,s=i.parent;if(r!=n&&s!=n){for(t=e.createPositionAfter(r),(i=e.createPositionBefore(s)).isEqual(t)||e.insert(r,i);t.parent.isEmpty;){const i=t.parent;t=e.createPositionBefore(i),e.remove(i)}i=e.createPositionBefore(s),function(e,t){const i=t.nodeBefore,n=t.nodeAfter;i.name!=n.name&&e.rename(i,n.name);e.clearAttributes(i),e.setAttributes(Object.fromEntries(n.getAttributes()),i),e.merge(t)}(e,i),cd(e.model.schema,t,i)&&ld(e,t,i,n)}}function cd(e,t,i){const n=t.parent,r=i.parent;return n!=r&&(!e.isLimit(n)&&!e.isLimit(r)&&function(e,t,i){const n=new Ol(e,t);for(const e of n.getWalker())if(i.isLimit(e.item))return!1;return!0}(t,i,e))}function hd(e,t,i,n={}){const r=e.createElement("paragraph");e.model.schema.setAllowedAttributes(r,n,e),e.insert(r,t),dd(e,i,e.createPositionAt(r,0))}function dd(e,t,i){t instanceof Yl?e.setSelection(i):t.setTo(i)}function ud(e,t){const i=[];Array.from(e.getItems({direction:"backward"})).map((e=>t.createRangeOn(e))).filter((t=>(t.start.isAfter(e.start)||t.start.isEqual(e.start))&&(t.end.isBefore(e.end)||t.end.isEqual(e.end)))).forEach((e=>{i.push(e.start.parent),t.remove(e)})),i.forEach((e=>{let i=e;for(;i.parent&&i.isEmpty;){const e=t.createRangeOn(i);i=i.parent,t.remove(e)}}))}class md{model;writer;position;canMergeWith;schema;_documentFragment;_documentFragmentPosition;_firstNode=null;_lastNode=null;_lastAutoParagraph=null;_filterAttributesOf=[];_affectedStart=null;_affectedEnd=null;_nodeToSelect=null;constructor(e,t,i){this.model=e,this.writer=t,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(const t of Array.from(e))this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(e){const t=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(e);if(i.isAfter(t)){if(this._lastNode=e,this.position.parent!=e||!this.position.isAtEnd)throw new gn("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?Ol._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new Ol(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){this._checkAndSplitToAllowedPosition(e)?(this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e):this.schema.isObject(e)||this._handleDisallowedNode(e)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const e=Mh.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleDisallowedNode(e){e.is("element")&&this.handleNodes(e.getChildren())}_appendToFragment(e){if(!this.schema.checkChild(this.position,e))throw new gn("insertcontent-wrong-position",this,{node:e,position:this.position});this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesOf.push(e)}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=Mh.fromPosition(e,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(e)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=Mh.fromPosition(e,"toNext"))}_mergeOnLeft(){const e=this._firstNode;if(!(e instanceof Al))return;if(!this._canMergeLeft(e))return;const t=Mh._createBefore(e);t.stickiness="toNext";const i=Mh.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=Mh._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=Mh._createAt(t.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_mergeOnRight(){const e=this._lastNode;if(!(e instanceof Al))return;if(!this._canMergeRight(e))return;const t=Mh._createAfter(e);if(t.stickiness="toNext",!this.position.isEqual(t))throw new gn("insertcontent-invalid-insertion-position",this);this.position=Sl._createAt(t.nodeBefore,"end");const i=Mh.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=Mh._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=Mh._createAt(t.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),t.detach()}_canMergeLeft(e){const t=e.previousSibling;return t instanceof Al&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){const t=e.nextSibling;return t instanceof Al&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_insertAutoParagraph(){this._insertPartialFragment();const e=this.writer.createElement("paragraph");this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0)}_checkAndSplitToAllowedPosition(e){const t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){const e=this.position.parent;this.position=this.writer.createPositionBefore(e),e.isEmpty&&e.parent===t&&this.writer.remove(e)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const e=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=e,this.canMergeWith.add(this.position.nodeAfter)}return this.schema.checkChild(this.position.parent,e)||this._insertAutoParagraph(),!0}_getAllowedIn(e,t){return this.schema.checkChild(e,t)||this.schema.checkChild(e,"paragraph")&&this.schema.checkChild("paragraph",t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}}function gd(e,t,i,n={}){if(!e.schema.isObject(t))throw new gn("insertobject-element-not-an-object",e,{object:t});const r=i||e.document.selection;let s=r;n.findOptimalPosition&&e.schema.isBlock(t)&&(s=e.createSelection(e.schema.findOptimalInsertionRange(r,n.findOptimalPosition)));const o=ts(r.getSelectedBlocks()),a={};return o&&Object.assign(a,e.schema.getAttributesWithProperty(o,"copyOnReplace",!0)),e.change((i=>{s.isCollapsed||e.deleteContent(s,{doNotAutoparagraph:!0});let r=t;const o=s.anchor.parent;!e.schema.checkChild(o,t)&&e.schema.checkChild(o,"paragraph")&&e.schema.checkChild("paragraph",t)&&(r=i.createElement("paragraph"),i.insert(t,r)),e.schema.setAllowedAttributes(r,a,i);const l=e.insertContent(r,s);return l.isCollapsed||n.setSelection&&function(e,t,i,n){const r=e.model;if("on"==i)return void e.setSelection(t,"on");if("after"!=i)throw new gn("insertobject-invalid-place-parameter-value",r);let s=t.nextSibling;if(r.schema.isInline(t))return void e.setSelection(t,"after");const o=s&&r.schema.checkChild(s,"$text");!o&&r.schema.checkChild(t.parent,"paragraph")&&(s=e.createElement("paragraph"),r.schema.setAllowedAttributes(s,n,e),r.insertContent(s,e.createPositionAfter(t)));s&&e.setSelection(s,0)}(i,t,n.setSelection,a),l}))}const fd=' ,.?!:;"-()';function pd(e,t){const{isForward:i,walker:n,unit:r,schema:s,treatEmojiAsSingleUnit:o}=e,{type:a,item:l,nextPosition:c}=t;if("text"==a)return"word"===e.unit?function(e,t){let i=e.position.textNode;i||(i=t?e.position.nodeAfter:e.position.nodeBefore);for(;i&&i.is("$text");){const n=e.position.offset-i.startOffset;if(_d(i,n,t))i=t?e.position.nodeAfter:e.position.nodeBefore;else{if(bd(i.data,n,t))break;e.next()}}return e.position}(n,i):function(e,t,i){const n=e.position.textNode;if(n){const r=n.data;let s=e.position.offset-n.startOffset;for(;ds(r,s)||"character"==t&&us(r,s)||i&&gs(r,s);)e.next(),s=e.position.offset-n.startOffset}return e.position}(n,r,o);if(a==(i?"elementStart":"elementEnd")){if(s.isSelectable(l))return Sl._createAt(l,i?"after":"before");if(s.checkChild(c,"$text"))return c}else{if(s.isLimit(l))return void n.skip((()=>!0));if(s.checkChild(c,"$text"))return c}}function wd(e,t){const i=e.root,n=Sl._createAt(i,t?"end":0);return t?new Ol(e,n):new Ol(n,e)}function bd(e,t,i){const n=t+(i?0:-1);return fd.includes(e.charAt(n))}function _d(e,t,i){return t===(i?e.offsetSize:0)}class vd extends(Ln()){markers;document;schema;_pendingChanges;_currentWriter;constructor(){super(),this.markers=new Jh,this.document=new Kh(this),this.schema=new Mc,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach((e=>this.decorate(e))),this.on("applyOperation",((e,t)=>{t[0]._validate()}),{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((()=>!0),"$marker"),Sc(this),this.document.registerPostFixer(bc),this.on("insertContent",((e,[t,i])=>{e.return=function(e,t,i){return e.change((n=>{const r=i||e.document.selection;r.isCollapsed||e.deleteContent(r,{doNotAutoparagraph:!0});const s=new md(e,n,r.anchor),o=[];let a;if(t.is("documentFragment")){if(t.markers.size){const e=[];for(const[i,n]of t.markers){const{start:t,end:r}=n,s=t.isEqual(r);e.push({position:t,name:i,isCollapsed:s},{position:r,name:i,isCollapsed:s})}e.sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:i,name:r,isCollapsed:s}of e){let e=null,a=null;const l=i.parent===t&&i.isAtStart,c=i.parent===t&&i.isAtEnd;l||c?s&&(a=l?"start":"end"):(e=n.createElement("$marker"),n.insert(e,i)),o.push({name:r,element:e,collapsed:a})}}a=t.getChildren()}else a=[t];s.handleNodes(a);let l=s.getSelectionRange();if(t.is("documentFragment")&&o.length){const e=l?Kl.fromRange(l):null,t={};for(let e=o.length-1;e>=0;e--){const{name:i,element:r,collapsed:a}=o[e],l=!t[i];if(l&&(t[i]=[]),r){const e=n.createPositionAt(r,"before");t[i].push(e),n.remove(r)}else{const e=s.getAffectedRange();if(!e){a&&t[i].push(s.position);continue}a?t[i].push(e[a]):t[i].push(l?e.start:e.end)}}for(const[e,[i,r]]of Object.entries(t))i&&r&&i.root===r.root&&i.root.document&&!n.model.markers.has(e)&&n.addMarker(e,{usingOperation:!0,affectsData:!0,range:new Ol(i,r)});e&&(l=e.toRange(),e.detach())}l&&(r instanceof Yl?n.setSelection(l):r.setTo(l));const c=s.getAffectedRange()||e.createRange(r.anchor);return s.destroy(),c}))}(this,t,i)})),this.on("insertObject",((e,[t,i,n])=>{e.return=gd(this,t,i,n)})),this.on("canEditAt",(e=>{const t=!this.document.isReadOnly;e.return=t,t||e.stop()}))}change(e){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Dh,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(e){gn.rethrowUnexpectedError(e,this)}}enqueueChange(e,t){try{e?"function"==typeof e?(t=e,e=new Dh):e instanceof Dh||(e=new Dh(e)):e=new Dh,this._pendingChanges.push({batch:e,callback:t}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(e){gn.rethrowUnexpectedError(e,this)}}applyOperation(e){e._execute()}insertContent(e,t,i,...n){const r=yd(t,i);return this.fire("insertContent",[e,r,i,...n])}insertObject(e,t,i,n,...r){const s=yd(t,i);return this.fire("insertObject",[e,s,n,n,...r])}deleteContent(e,t){od(this,e,t)}modifySelection(e,t){!function(e,t,i={}){const n=e.schema,r="backward"!=i.direction,s=i.unit?i.unit:"character",o=!!i.treatEmojiAsSingleUnit,a=t.focus,l=new Tl({boundaries:wd(a,r),singleCharacters:!0,direction:r?"forward":"backward"}),c={walker:l,schema:n,isForward:r,unit:s,treatEmojiAsSingleUnit:o};let h;for(;h=l.next();){if(h.done)return;const i=pd(c,h.value);if(i)return void(t instanceof Yl?e.change((e=>{e.setSelectionFocus(i)})):t.setFocus(i))}}(this,e,t)}getSelectedContent(e){return function(e,t){return e.change((e=>{const i=e.createDocumentFragment(),n=t.getFirstRange();if(!n||n.isCollapsed)return i;const r=n.start.root,s=n.start.getCommonPath(n.end),o=r.getNodeByPath(s);let a;a=n.start.parent==n.end.parent?n:e.createRange(e.createPositionAt(o,n.start.path[s.length]),e.createPositionAt(o,n.end.path[s.length]+1));const l=a.end.offset-a.start.offset;for(const t of a.getItems({shallow:!0}))t.is("$textProxy")?e.appendText(t.data,t.getAttributes(),i):e.append(e.cloneElement(t,!0),i);if(a!=n){const t=n._getTransformedByMove(a.start,e.createPositionAt(i,0),l)[0],r=e.createRange(e.createPositionAt(i,0),t.start);ud(e.createRange(t.end,e.createPositionAt(i,"end")),e),ud(r,e)}return i}))}(this,e)}hasContent(e,t={}){const i=e instanceof Ol?e:Ol._createIn(e);if(i.isCollapsed)return!1;const{ignoreWhitespaces:n=!1,ignoreMarkers:r=!1}=t;if(!r)for(const e of this.markers.getMarkersIntersectingRange(i))if(e.affectsData)return!0;for(const e of i.getItems())if(this.schema.isContent(e)){if(!e.is("$textProxy"))return!0;if(!n)return!0;if(-1!==e.data.search(/\S/))return!0}return!1}canEditAt(e){const t=yd(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,i){return new Sl(e,t,i)}createPositionAt(e,t){return Sl._createAt(e,t)}createPositionAfter(e){return Sl._createAfter(e)}createPositionBefore(e){return Sl._createBefore(e)}createRange(e,t){return new Ol(e,t)}createRangeIn(e){return Ol._createIn(e)}createRangeOn(e){return Ol._createOn(e)}createSelection(...e){return new Hl(...e)}createBatch(e){return new Dh(e)}createOperationFromJSON(e){return Ch.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){const t=this._pendingChanges[0].batch;this._currentWriter=new ed(this,t);const i=this._pendingChanges[0].callback(this._currentWriter);e.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}}function yd(e,t){if(e)return e instanceof Hl||e instanceof Yl?e:e instanceof yl?t||0===t?new Hl(e,t):e.is("rootElement")?new Hl(e,"in"):new Hl(e,"on"):new Hl(e)}class kd extends ol{domEventType="click";onDomEvent(e){this.fire(e.type,e)}}class Cd extends ol{domEventType=["mousedown","mouseup","mouseover","mouseout"];onDomEvent(e){this.fire(e.type,e)}}class xd{document;constructor(e){this.document=e}createDocumentFragment(e){return new Ca(this.document,e)}createElement(e,t,i){return new qo(this.document,e,t,i)}createText(e){return new No(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){const t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){const i=e.parent;if(i){const n=i.getChildIndex(e);return this.removeChildren(n,1,i),this.insertChild(n,t,i),!0}return!1}unwrapElement(e){const t=e.parent;if(t){const i=t.getChildIndex(e);this.remove(e),this.insertChild(i,e.getChildren(),t)}}rename(e,t){const i=new qo(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){T(e)&&void 0===i?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return ea._createAt(e,t)}createPositionAfter(e){return ea._createAfter(e)}createPositionBefore(e){return ea._createBefore(e)}createRange(e,t){return new ta(e,t)}createRangeOn(e){return ta._createOn(e)}createRangeIn(e){return ta._createIn(e)}createSelection(...e){return new na(...e)}}const Ad=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Td=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,Ed=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Sd=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,Pd=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,Id=/\w+\((?:[^()]|\([^()]*\))*\)|\S+/gi,Vd=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);function Rd(e){return e.startsWith("#")?Ad.test(e):e.startsWith("rgb")?Td.test(e)||Ed.test(e):e.startsWith("hsl")?Sd.test(e)||Pd.test(e):Vd.has(e.toLowerCase())}const Bd=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function Od(e){return Bd.includes(e)}const Fd=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function Md(e){return Fd.test(e)}const Nd=/^[+-]?[0-9]*([.][0-9]+)?%$/;function Ld(e){return Nd.test(e)}const Dd=["repeat-x","repeat-y","repeat","space","round","no-repeat"];function zd(e){return Dd.includes(e)}const Hd=["center","top","bottom","left","right"];function Wd(e){return Hd.includes(e)}const $d=["fixed","scroll","local"];function Ud(e){return $d.includes(e)}const jd=/^url\(/;function qd(e){return jd.test(e)}function Gd(e=""){if(""===e)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const t=Qd(e),i=t[0],n=t[2]||i,r=t[1]||i;return{top:i,bottom:n,right:r,left:t[3]||r}}function Kd(e){return t=>{const{top:i,right:n,bottom:r,left:s}=t,o=[];return[i,n,s,r].every((e=>!!e))?o.push([e,Zd(t)]):(i&&o.push([e+"-top",i]),n&&o.push([e+"-right",n]),r&&o.push([e+"-bottom",r]),s&&o.push([e+"-left",s])),o}}function Zd({top:e,right:t,bottom:i,left:n}){const r=[];return n!==t?r.push(e,t,i,n):i!==e?r.push(e,t,i):t!==e?r.push(e,t):r.push(e),r.join(" ")}function Jd(e){return t=>({path:e,value:Gd(t)})}function Qd(e){const t=e.trim().slice(0,1500).matchAll(Id);return Array.from(t).map((e=>e[0]))}function Yd(e){e.setNormalizer("background",(e=>{const t={},i=Qd(e);for(const e of i)zd(e)?(t.repeat=t.repeat||[],t.repeat.push(e)):Wd(e)?(t.position=t.position||[],t.position.push(e)):Ud(e)?t.attachment=e:Rd(e)?t.color=e:qd(e)&&(t.image=e);return{path:"background",value:t}})),e.setNormalizer("background-color",(e=>({path:"background.color",value:e}))),e.setReducer("background",(e=>{const t=[];return t.push(["background-color",e.color]),t})),e.setStyleRelation("background",["background-color"])}function Xd(e){e.setNormalizer("border",(e=>{const{color:t,style:i,width:n}=ou(e);return{path:"border",value:{color:Gd(t),style:Gd(i),width:Gd(n)}}})),e.setNormalizer("border-top",eu("top")),e.setNormalizer("border-right",eu("right")),e.setNormalizer("border-bottom",eu("bottom")),e.setNormalizer("border-left",eu("left")),e.setNormalizer("border-color",tu("color")),e.setNormalizer("border-width",tu("width")),e.setNormalizer("border-style",tu("style")),e.setNormalizer("border-top-color",nu("color","top")),e.setNormalizer("border-top-style",nu("style","top")),e.setNormalizer("border-top-width",nu("width","top")),e.setNormalizer("border-right-color",nu("color","right")),e.setNormalizer("border-right-style",nu("style","right")),e.setNormalizer("border-right-width",nu("width","right")),e.setNormalizer("border-bottom-color",nu("color","bottom")),e.setNormalizer("border-bottom-style",nu("style","bottom")),e.setNormalizer("border-bottom-width",nu("width","bottom")),e.setNormalizer("border-left-color",nu("color","left")),e.setNormalizer("border-left-style",nu("style","left")),e.setNormalizer("border-left-width",nu("width","left")),e.setExtractor("border-top",ru("top")),e.setExtractor("border-right",ru("right")),e.setExtractor("border-bottom",ru("bottom")),e.setExtractor("border-left",ru("left")),e.setExtractor("border-top-color","border.color.top"),e.setExtractor("border-right-color","border.color.right"),e.setExtractor("border-bottom-color","border.color.bottom"),e.setExtractor("border-left-color","border.color.left"),e.setExtractor("border-top-width","border.width.top"),e.setExtractor("border-right-width","border.width.right"),e.setExtractor("border-bottom-width","border.width.bottom"),e.setExtractor("border-left-width","border.width.left"),e.setExtractor("border-top-style","border.style.top"),e.setExtractor("border-right-style","border.style.right"),e.setExtractor("border-bottom-style","border.style.bottom"),e.setExtractor("border-left-style","border.style.left"),e.setReducer("border-color",Kd("border-color")),e.setReducer("border-style",Kd("border-style")),e.setReducer("border-width",Kd("border-width")),e.setReducer("border-top",au("top")),e.setReducer("border-right",au("right")),e.setReducer("border-bottom",au("bottom")),e.setReducer("border-left",au("left")),e.setReducer("border",function(){return t=>{const i=su(t,"top"),n=su(t,"right"),r=su(t,"bottom"),s=su(t,"left"),o=[i,n,r,s],a={width:e(o,"width"),style:e(o,"style"),color:e(o,"color")},l=lu(a,"all");if(l.length)return l;const c=Object.entries(a).reduce(((e,[t,i])=>(i&&(e.push([`border-${t}`,i]),o.forEach((e=>delete e[t]))),e)),[]);return[...c,...lu(i,"top"),...lu(n,"right"),...lu(r,"bottom"),...lu(s,"left")]};function e(e,t){return e.map((e=>e[t])).reduce(((e,t)=>e==t?e:null))}}()),e.setStyleRelation("border",["border-color","border-style","border-width","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"]),e.setStyleRelation("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"]),e.setStyleRelation("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-top",["border-top-color","border-top-style","border-top-width"]),e.setStyleRelation("border-right",["border-right-color","border-right-style","border-right-width"]),e.setStyleRelation("border-bottom",["border-bottom-color","border-bottom-style","border-bottom-width"]),e.setStyleRelation("border-left",["border-left-color","border-left-style","border-left-width"])}function eu(e){return t=>{const{color:i,style:n,width:r}=ou(t),s={};return void 0!==i&&(s.color={[e]:i}),void 0!==n&&(s.style={[e]:n}),void 0!==r&&(s.width={[e]:r}),{path:"border",value:s}}}function tu(e){return t=>({path:"border",value:iu(t,e)})}function iu(e,t){return{[t]:Gd(e)}}function nu(e,t){return i=>({path:"border",value:{[e]:{[t]:i}}})}function ru(e){return(t,i)=>{if(i.border)return su(i.border,e)}}function su(e,t){const i={};return e.width&&e.width[t]&&(i.width=e.width[t]),e.style&&e.style[t]&&(i.style=e.style[t]),e.color&&e.color[t]&&(i.color=e.color[t]),i}function ou(e){const t={},i=Qd(e);for(const e of i)Md(e)||/thin|medium|thick/.test(e)?t.width=e:Od(e)?t.style=e:t.color=e;return t}function au(e){return t=>lu(t,e)}function lu(e,t){const i=[];if(e&&e.width&&i.push("width"),e&&e.style&&i.push("style"),e&&e.color&&i.push("color"),3==i.length){const n=i.map((t=>e[t])).join(" ");return["all"==t?["border",n]:[`border-${t}`,n]]}return"all"==t?[]:i.map((i=>[`border-${t}-${i}`,e[i]]))}function cu(e){e.setNormalizer("margin",Jd("margin")),e.setNormalizer("margin-top",(e=>({path:"margin.top",value:e}))),e.setNormalizer("margin-right",(e=>({path:"margin.right",value:e}))),e.setNormalizer("margin-bottom",(e=>({path:"margin.bottom",value:e}))),e.setNormalizer("margin-left",(e=>({path:"margin.left",value:e}))),e.setReducer("margin",Kd("margin")),e.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}function hu(e){e.setNormalizer("padding",Jd("padding")),e.setNormalizer("padding-top",(e=>({path:"padding.top",value:e}))),e.setNormalizer("padding-right",(e=>({path:"padding.right",value:e}))),e.setNormalizer("padding-bottom",(e=>({path:"padding.bottom",value:e}))),e.setNormalizer("padding-left",(e=>({path:"padding.left",value:e}))),e.setReducer("padding",Kd("padding")),e.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}const du=function(t,i,n){var r=!0,s=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return e(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),no(t,i,{leading:r,maxWait:i,trailing:s})};class uu{crashes=[];state="initializing";_crashNumberLimit;_now=Date.now;_minimumNonErrorTimePeriod;_boundErrorHandler;_listeners;constructor(e){if(this.crashes=[],this._crashNumberLimit="number"==typeof e.crashNumberLimit?e.crashNumberLimit:3,this._minimumNonErrorTimePeriod="number"==typeof e.minimumNonErrorTimePeriod?e.minimumNonErrorTimePeriod:5e3,this._boundErrorHandler=e=>{const t="error"in e?e.error:e.reason;t instanceof Error&&this._handleError(t,e)},this._listeners={},!this._restart)throw new Error("The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.")}destroy(){this._stopErrorHandling(),this._listeners={}}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]=this._listeners[e].filter((e=>e!==t))}_fire(e,...t){const i=this._listeners[e]||[];for(const e of i)e.apply(this,[null,...t])}_startErrorHandling(){window.addEventListener("error",this._boundErrorHandler),window.addEventListener("unhandledrejection",this._boundErrorHandler)}_stopErrorHandling(){window.removeEventListener("error",this._boundErrorHandler),window.removeEventListener("unhandledrejection",this._boundErrorHandler)}_handleError(e,t){if(this._shouldReactToError(e)){this.crashes.push({message:e.message,stack:e.stack,filename:t instanceof ErrorEvent?t.filename:void 0,lineno:t instanceof ErrorEvent?t.lineno:void 0,colno:t instanceof ErrorEvent?t.colno:void 0,date:this._now()});const i=this._shouldRestart();this.state="crashed",this._fire("stateChange"),this._fire("error",{error:e,causesRestart:i}),i?this._restart():(this.state="crashedPermanently",this._fire("stateChange"))}}_shouldReactToError(e){return e.is&&e.is("CKEditorError")&&void 0!==e.context&&null!==e.context&&"ready"===this.state&&this._isErrorComingFromThisItem(e)}_shouldRestart(){if(this.crashes.length<=this._crashNumberLimit)return!0;return(this.crashes[this.crashes.length-1].date-this.crashes[this.crashes.length-1-this._crashNumberLimit].date)/this._crashNumberLimit>this._minimumNonErrorTimePeriod}}function mu(e,t=new Set){const i=[e],n=new Set;let r=0;for(;i.length>r;){const e=i[r++];if(!n.has(e)&&gu(e)&&!t.has(e))if(n.add(e),Symbol.iterator in e)try{for(const t of e)i.push(t)}catch(e){}else for(const t in e)"defaultValue"!==t&&i.push(e[t])}return n}function gu(e){const t=Object.prototype.toString.call(e),i=typeof e;return!("number"===i||"boolean"===i||"string"===i||"symbol"===i||"function"===i||"[object Date]"===t||"[object RegExp]"===t||"[object Module]"===t||null==e||e._watchdogExcluded||e instanceof EventTarget||e instanceof Event)}function fu(e,t,i=new Set){if(e===t&&("object"==typeof(n=e)&&null!==n))return!0;var n;const r=mu(e,i),s=mu(t,i);for(const e of r)if(s.has(e))return!0;return!1}class pu extends uu{_editor=null;_lifecyclePromise=null;_throttledSave;_data;_lastDocumentVersion;_elementOrData;_initUsingData=!0;_editables={};_config;_excludedProps;constructor(e,t={}){super(t),this._throttledSave=du(this._save.bind(this),"number"==typeof t.saveInterval?t.saveInterval:5e3),e&&(this._creator=(t,i)=>e.create(t,i)),this._destructor=e=>e.destroy()}get editor(){return this._editor}get _item(){return this._editor}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}_restart(){return Promise.resolve().then((()=>(this.state="initializing",this._fire("stateChange"),this._destroy()))).catch((e=>{console.error("An error happened during the editor destroying.",e)})).then((()=>{const e={},t=[],i=this._config.rootsAttributes||{},n={};for(const[r,s]of Object.entries(this._data.roots))s.isLoaded?(e[r]="",n[r]=i[r]||{}):t.push(r);const r={...this._config,extraPlugins:this._config.extraPlugins||[],lazyRoots:t,rootsAttributes:n,_watchdogInitialData:this._data};return delete r.initialData,r.extraPlugins.push(wu),this._initUsingData?this.create(e,r,r.context):Ci(this._elementOrData)?this.create(this._elementOrData,r,r.context):this.create(this._editables,r,r.context)})).then((()=>{this._fire("restart")}))}create(e=this._elementOrData,t=this._config,i){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>(super._startErrorHandling(),this._elementOrData=e,this._initUsingData="string"==typeof e||Object.keys(e).length>0&&"string"==typeof Object.values(e)[0],this._config=this._cloneEditorConfiguration(t)||{},this._config.context=i,this._creator(e,this._config)))).then((e=>{this._editor=e,e.model.document.on("change:data",this._throttledSave),this._lastDocumentVersion=e.model.document.version,this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this.state="ready",this._fire("stateChange")})).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}destroy(){return this._lifecyclePromise=Promise.resolve(this._lifecyclePromise).then((()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy()))).finally((()=>{this._lifecyclePromise=null})),this._lifecyclePromise}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling(),this._throttledSave.cancel();const e=this._editor;return this._editor=null,e.model.document.off("change:data",this._throttledSave),this._destructor(e)}))}_save(){const e=this._editor.model.document.version;try{this._data=this._getData(),this._initUsingData||(this._editables=this._getEditables()),this._lastDocumentVersion=e}catch(e){console.error(e,"An error happened during restoring editor data. Editor will be restored from the previously saved data.")}}_setExcludedProperties(e){this._excludedProps=e}_getData(){const e=this._editor,t=e.model.document.roots.filter((e=>e.isAttached()&&"$graveyard"!=e.rootName)),{plugins:i}=e,n=i.has("CommentsRepository")&&i.get("CommentsRepository"),r=i.has("TrackChanges")&&i.get("TrackChanges"),s={roots:{},markers:{},commentThreads:JSON.stringify([]),suggestions:JSON.stringify([])};t.forEach((e=>{s.roots[e.rootName]={content:JSON.stringify(Array.from(e.getChildren())),attributes:JSON.stringify(Array.from(e.getAttributes())),isLoaded:e._isLoaded}}));for(const t of e.model.markers)t._affectsData&&(s.markers[t.name]={rangeJSON:t.getRange().toJSON(),usingOperation:t._managedUsingOperations,affectsData:t._affectsData});return n&&(s.commentThreads=JSON.stringify(n.getCommentThreads({toJSON:!0,skipNotAttached:!0}))),r&&(s.suggestions=JSON.stringify(r.getSuggestions({toJSON:!0,skipNotAttached:!0}))),s}_getEditables(){const e={};for(const t of this.editor.model.document.getRootNames()){const i=this.editor.ui.getEditableElement(t);i&&(e[t]=i)}return e}_isErrorComingFromThisItem(e){return fu(this._editor,e.context,this._excludedProps)}_cloneEditorConfiguration(e){return ki(e,((e,t)=>Ci(e)||"context"===t?e:void 0))}}class wu{editor;_data;constructor(e){this.editor=e,this._data=e.config.get("_watchdogInitialData")}init(){this.editor.data.on("init",(e=>{e.stop(),this.editor.model.enqueueChange({isUndoable:!1},(e=>{this._restoreCollaborationData(),this._restoreEditorData(e)})),this.editor.data.fire("ready")}),{priority:999})}_createNode(e,t){if("name"in t){const i=e.createElement(t.name,t.attributes);if(t.children)for(const n of t.children)i._appendChild(this._createNode(e,n));return i}return e.createText(t.data,t.attributes)}_restoreEditorData(e){const t=this.editor;Object.entries(this._data.roots).forEach((([i,{content:n,attributes:r}])=>{const s=JSON.parse(n),o=JSON.parse(r),a=t.model.document.getRoot(i);for(const[t,i]of o)e.setAttribute(t,i,a);for(const t of s){const i=this._createNode(e,t);e.insert(i,a,"end")}})),Object.entries(this._data.markers).forEach((([i,n])=>{const{document:r}=t.model,{rangeJSON:{start:s,end:o},...a}=n,l=r.getRoot(s.root),c=e.createPositionFromPath(l,s.path,s.stickiness),h=e.createPositionFromPath(l,o.path,o.stickiness),d=e.createRange(c,h);e.addMarker(i,{range:d,...a})}))}_restoreCollaborationData(){const e=JSON.parse(this._data.commentThreads),t=JSON.parse(this._data.suggestions);e.forEach((e=>{const t=this.editor.config.get("collaboration.channelId"),i=this.editor.plugins.get("CommentsRepository");if(i.hasCommentThread(e.threadId)){i.getCommentThread(e.threadId).remove()}i.addCommentThread({channelId:t,...e})})),t.forEach((e=>{const t=this.editor.plugins.get("TrackChangesEditing");if(t.hasSuggestion(e.id)){t.getSuggestion(e.id).attributes=e.attributes}else t.addSuggestionData(e)}))}}const bu=Symbol("MainQueueId");class _u extends uu{_watchdogs=new Map;_watchdogConfig;_context=null;_contextProps=new Set;_actionQueues=new vu;_contextConfig;_item;constructor(e,t={}){super(t),this._watchdogConfig=t,this._creator=t=>e.create(t),this._destructor=e=>e.destroy(),this._actionQueues.onEmpty((()=>{"initializing"===this.state&&(this.state="ready",this._fire("stateChange"))}))}setCreator(e){this._creator=e}setDestructor(e){this._destructor=e}get context(){return this._context}create(e={}){return this._actionQueues.enqueue(bu,(()=>(this._contextConfig=e,this._create())))}getItem(e){return this._getWatchdog(e)._item}getItemState(e){return this._getWatchdog(e).state}add(e){const t=yu(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e.id,(()=>{if("destroyed"===this.state)throw new Error("Cannot add items to destroyed watchdog.");if(!this._context)throw new Error("Context was not created yet. You should call the `ContextWatchdog#create()` method first.");let t;if(this._watchdogs.has(e.id))throw new Error(`Item with the given id is already added: '${e.id}'.`);if("editor"===e.type)return t=new pu(null,this._watchdogConfig),t.setCreator(e.creator),t._setExcludedProperties(this._contextProps),e.destructor&&t.setDestructor(e.destructor),this._watchdogs.set(e.id,t),t.on("error",((i,{error:n,causesRestart:r})=>{this._fire("itemError",{itemId:e.id,error:n}),r&&this._actionQueues.enqueue(e.id,(()=>new Promise((i=>{const n=()=>{t.off("restart",n),this._fire("itemRestart",{itemId:e.id}),i()};t.on("restart",n)}))))})),t.create(e.sourceElementOrData,e.config,this._context);throw new Error(`Not supported item type: '${e.type}'.`)})))))}remove(e){const t=yu(e);return Promise.all(t.map((e=>this._actionQueues.enqueue(e,(()=>{const t=this._getWatchdog(e);return this._watchdogs.delete(e),t.destroy()})))))}destroy(){return this._actionQueues.enqueue(bu,(()=>(this.state="destroyed",this._fire("stateChange"),super.destroy(),this._destroy())))}_restart(){return this._actionQueues.enqueue(bu,(()=>(this.state="initializing",this._fire("stateChange"),this._destroy().catch((e=>{console.error("An error happened during destroying the context or items.",e)})).then((()=>this._create())).then((()=>this._fire("restart"))))))}_create(){return Promise.resolve().then((()=>(this._startErrorHandling(),this._creator(this._contextConfig)))).then((e=>(this._context=e,this._contextProps=mu(this._context),Promise.all(Array.from(this._watchdogs.values()).map((e=>(e._setExcludedProperties(this._contextProps),e.create(void 0,void 0,this._context))))))))}_destroy(){return Promise.resolve().then((()=>{this._stopErrorHandling();const e=this._context;return this._context=null,this._contextProps=new Set,Promise.all(Array.from(this._watchdogs.values()).map((e=>e.destroy()))).then((()=>this._destructor(e)))}))}_getWatchdog(e){const t=this._watchdogs.get(e);if(!t)throw new Error(`Item with the given id was not registered: ${e}.`);return t}_isErrorComingFromThisItem(e){for(const t of this._watchdogs.values())if(t._isErrorComingFromThisItem(e))return!1;return fu(this._context,e.context)}}class vu{_onEmptyCallbacks=[];_queues=new Map;_activeActions=0;onEmpty(e){this._onEmptyCallbacks.push(e)}enqueue(e,t){const i=e===bu;this._activeActions++,this._queues.get(e)||this._queues.set(e,Promise.resolve());const n=(i?Promise.all(this._queues.values()):Promise.all([this._queues.get(bu),this._queues.get(e)])).then(t),r=n.catch((()=>{}));return this._queues.set(e,r),n.finally((()=>{this._activeActions--,this._queues.get(e)===r&&0===this._activeActions&&this._onEmptyCallbacks.forEach((e=>e()))}))}}function yu(e){return Array.isArray(e)?e:[e]}class ku extends(Ln()){editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Cu,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Cu),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}function Cu(e){e.return=!1,e.stop()}class xu extends(Ln()){editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",(()=>{this.refresh()})),this.listenTo(e,"change:isReadOnly",(()=>{this.refresh()})),this.on("set:isEnabled",(t=>{if(!this.affectsData)return;const i=e.model.document.selection,n=!("$graveyard"==i.getFirstPosition().root.rootName)&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!n)&&(t.return=!1,t.stop())}),{priority:"highest"}),this.on("execute",(e=>{this.isEnabled||e.stop()}),{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),1==this._disableStack.size&&(this.on("set:isEnabled",Au,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),0==this._disableStack.size&&(this.off("set:isEnabled",Au),this.refresh())}execute(...e){}destroy(){this.stopListening()}}function Au(e){e.return=!1,e.stop()}class Tu extends xu{_childCommandsDefinitions=[];refresh(){}execute(...e){const t=this._getFirstEnabledCommand();return!!t&&t.execute(e)}registerChildCommand(e,t={}){un(this._childCommandsDefinitions,{command:e,priority:t.priority||"normal"}),e.on("change:isEnabled",(()=>this._checkEnabled())),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){const e=this._childCommandsDefinitions.find((({command:e})=>e.isEnabled));return e&&e.command}}class Eu extends(xn()){_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,t=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(const e of t)e.pluginName&&this._availablePlugins.set(e.pluginName,e);this._contextPlugins=new Map;for(const[e,t]of i)this._contextPlugins.set(e,t),this._contextPlugins.set(t,e),e.pluginName&&this._availablePlugins.set(e.pluginName,e)}*[Symbol.iterator](){for(const e of this._plugins)"function"==typeof e[0]&&(yield e)}get(e){const t=this._plugins.get(e);if(!t){let t=e;throw"function"==typeof e&&(t=e.pluginName||e.name),new gn("plugincollection-plugin-not-loaded",this._context,{plugin:t})}return t}has(e){return this._plugins.has(e)}init(e,t=[],i=[]){const n=this,r=this._context;!function e(t,i=new Set){t.forEach((t=>{a(t)&&(i.has(t)||(i.add(t),t.pluginName&&!n._availablePlugins.has(t.pluginName)&&n._availablePlugins.set(t.pluginName,t),t.requires&&e(t.requires,i)))}))}(e),d(e);const s=[...function e(t,i=new Set){return t.map((e=>a(e)?e:n._availablePlugins.get(e))).reduce(((t,n)=>i.has(n)?t:(i.add(n),n.requires&&(d(n.requires,n),e(n.requires,i).forEach((e=>t.add(e)))),t.add(n))),new Set)}(e.filter((e=>!c(e,t))))];!function(e,t){for(const i of t){if("function"!=typeof i)throw new gn("plugincollection-replace-plugin-invalid-type",null,{pluginItem:i});const t=i.pluginName;if(!t)throw new gn("plugincollection-replace-plugin-missing-name",null,{pluginItem:i});if(i.requires&&i.requires.length)throw new gn("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:t});const r=n._availablePlugins.get(t);if(!r)throw new gn("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:t});const s=e.indexOf(r);if(-1===s){if(n._contextPlugins.has(r))return;throw new gn("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:t})}if(r.requires&&r.requires.length)throw new gn("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:t});e.splice(s,1,i),n._availablePlugins.set(t,i)}}(s,i);const o=function(e){return e.map((e=>{let t=n._contextPlugins.get(e);return t=t||new e(r),n._add(e,t),t}))}(s);return u(o,"init").then((()=>u(o,"afterInit"))).then((()=>o));function a(e){return"function"==typeof e}function l(e){return a(e)&&!!e.isContextPlugin}function c(e,t){return t.some((t=>t===e||(h(e)===t||h(t)===e)))}function h(e){return a(e)?e.pluginName||e.name:e}function d(e,i=null){e.map((e=>a(e)?e:n._availablePlugins.get(e)||e)).forEach((e=>{!function(e,t){if(a(e))return;if(t)throw new gn("plugincollection-soft-required",r,{missingPlugin:e,requiredBy:h(t)});throw new gn("plugincollection-plugin-not-found",r,{plugin:e})}(e,i),function(e,t){if(!l(t))return;if(l(e))return;throw new gn("plugincollection-context-required",r,{plugin:h(e),requiredBy:h(t)})}(e,i),function(e,i){if(!i)return;if(!c(e,t))return;throw new gn("plugincollection-required",r,{plugin:h(e),requiredBy:h(i)})}(e,i)}))}function u(e,t){return e.reduce(((e,i)=>i[t]?n._contextPlugins.has(i)?e:e.then(i[t].bind(i)):e),Promise.resolve())}}destroy(){const e=[];for(const[,t]of this)"function"!=typeof t.destroy||this._contextPlugins.has(t)||e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);const i=e.pluginName;if(i){if(this._plugins.has(i))throw new gn("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}}class Su{config;plugins;locale;t;editors;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){const{translations:t,...i}=e||{};this.config=new Zn(i,this.constructor.defaultConfig);const n=this.constructor.builtinPlugins;this.config.define("plugins",n),this.plugins=new Eu(this,n);const r=this.config.get("language")||{};this.locale=new Xr({uiLanguage:"string"==typeof r?r:r.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new es}initPlugins(){const e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(const i of e.concat(t)){if("function"!=typeof i)throw new gn("context-initplugins-constructor-only",null,{Plugin:i});if(!0!==i.isContextPlugin)throw new gn("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t)}destroy(){return Promise.all(Array.from(this.editors,(e=>e.destroy()))).then((()=>this.plugins.destroy()))}_addEditor(e,t){if(this._contextOwner)throw new gn("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){const e={};for(const t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise((t=>{const i=new this(e);t(i.initPlugins().then((()=>i)))}))}}class Pu extends(Ln()){context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}}class Iu{_commands;constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){const i=this.get(e);if(!i)throw new gn("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const e of this.commands())e.destroy()}}class Vu extends os{editor;constructor(e){super(),this.editor=e}set(e,t,i={}){if("string"==typeof t){const e=t;t=(t,i)=>{this.editor.execute(e),i()}}super.set(e,t,i)}}const Ru="contentEditing",Bu="common";class Ou{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;const t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:Ru,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});const n=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&n.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:n}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:n}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:Bu}),n&&n.forEach((t=>{this.addKeystrokeInfoGroup({categoryId:e,...t})}))}addKeystrokeInfoGroup({categoryId:e=Ru,id:t,label:i,keystrokes:n}){const r=this.keystrokeInfos.get(e);if(!r)throw new gn("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});r.groups.set(t,{id:t,label:i,keystrokes:n||[]})}addKeystrokeInfos({categoryId:e=Ru,groupId:t=Bu,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new gn("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});const n=this.keystrokeInfos.get(e);if(!n.groups.has(t))throw new gn("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});n.groups.get(t).keystrokes.push(...i)}}function Fu(e){return Object.getPrototypeOf(e).constructor.editorName}function Mu(e){if(!e)return;const t=Array.isArray(e)?{items:e}:e,i=function e(t){return t.flatMap((t=>"string"==typeof t?[t]:e(t.items)))}(t.items||[]);return{isMultiline:i.includes("-"),shouldNotGroupWhenFull:!!t.shouldNotGroupWhenFull,items:(n=i,n.filter((e=>"|"!==e&&"-"!==e)))};var n}function Nu(){let e="unknown",t="unknown";return Ki.isMac?e="mac":Ki.isWindows?e="windows":Ki.isiOS?e="ios":Ki.isAndroid&&(e="android"),Ki.isGecko?t="gecko":Ki.isBlink?t="blink":Ki.isSafari&&(t="safari"),{os:e,browser:t}}function Lu(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",hn()),localStorage.getItem("__ckeditor-session-id")}function Du(){return ji.window.CKEDITOR_PAGE_SESSION_ID=ji.window.CKEDITOR_PAGE_SESSION_ID||hn(),ji.window.CKEDITOR_PAGE_SESSION_ID}class zu extends(Ln()){static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;_readOnlyLocks;constructor(e={}){if(super(),"sanitizeHtml"in e)throw new gn("editor-config-sanitizehtml-not-supported");const t=this.constructor,{translations:i,...n}=t.defaultConfig||{},{translations:r=i,...s}=e,o=e.language||n.language;this._context=e.context||new Su({language:o,translations:r}),this._context._addEditor(this,!e.context);const a=Array.from(t.builtinPlugins||[]);this.config=new Zn(s,n),this.config.define("plugins",a),this.config.define(this._context._getEditorConfig()),function(e){let t=e.get("licenseKey");!t&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(t=window.CKEDITOR_GLOBAL_LICENSE_KEY,e.set("licenseKey",t));if(!t)throw new gn("license-key-missing")}(this.config),this.plugins=new Eu(this,a,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new Iu,this.set("state","initializing"),this.once("ready",(()=>this.state="ready"),{priority:"high"}),this.once("destroy",(()=>this.state="destroyed"),{priority:"high"}),this.model=new vd,this.on("change:isReadOnly",(()=>{this.model.document.isReadOnly=this.isReadOnly}));const l=new $o;this.data=new eh(this.model,l),this.editing=new Rc(this.model,l),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new th([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Vu(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new Ou(this),function(e){const t=e.config.get("licenseKey"),i=window[Symbol.for("cke distribution")]||"sh";function n(t){e.enableReadOnlyMode(Symbol("invalidLicense")),e._showLicenseError(t)}if("GPL"==t)return void("cloud"==i&&n("distributionChannel"));const r=function(e){const t=e.split(".");return 3!=t.length?null:t[1]}(t);if(!r)return void n("invalid");const s=hs(r);if(!s)return void n("invalid");if(!function(e){return["exp","jti","vc"].every((t=>t in e))}(s))return void n("invalid");if(s.distributionChannel&&!Qr(s.distributionChannel).includes(i))return void n("distributionChannel");if(function(e){const t=Array.isArray(e)?e:[e],i=function(){const e=[];for(let t=0;t<256;t++){let i=t;for(let e=0;e<8;e++)1&i?i=3988292384^i>>>1:i>>>=1;e[t]=i}return e}();let n=-1;const r=t.map((e=>Array.isArray(e)?e.join(""):String(e))).join("");for(let e=0;e>>8^i[255&(n^r.charCodeAt(e))];return n=~n>>>0,n.toString(16).padStart(8,"0")}(function(e){return Object.getOwnPropertyNames(e).sort().filter((t=>"vc"!=t&&null!=e[t])).map((t=>e[t]))}(s))!=s.vc.toLowerCase())return void n("invalid");if(new Date(1e3*s.exp)<_n)return void n("expired");const o=s.licensedHosts;if(o&&o.length>0&&!function(e){const{hostname:t}=new URL(window.location.href);if(e.includes(t))return!0;const i=t.split(".");return e.filter((e=>e.includes("*"))).map((e=>e.split("."))).filter((e=>e.length<=i.length)).map((e=>Array(i.length-e.length).fill("*"===e[0]?"*":"").concat(e))).some((e=>i.every(((t,i)=>e[i]===t||"*"===e[i]))))}(o))return void n("domainLimit");if(["evaluation","trial"].includes(s.licenseType)&&1e3*s.exp{n(`${t}Limit`)}),6e5);e.on("destroy",(()=>{clearTimeout(i)}))}s.usageEndpoint&&e.once("ready",(()=>{const i={requestId:hn(),requestTime:Math.round(Date.now()/1e3),license:t,editor:Hu(e)};e._sendUsageRequest(s.usageEndpoint,i).then((e=>{const{status:t,message:i}=e;i&&console.warn(i),"ok"!=t&&n("usageLimit")}),(()=>{pn("license-key-validation-endpoint-not-reachable",{url:s.usageEndpoint})}))}),{priority:"high"})}(this)}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new gn("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new gn("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),1===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if("string"!=typeof e&&"symbol"!=typeof e)throw new gn("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),0===this._readOnlyLocks.size&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}initPlugins(){const e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],n=e.get("extraPlugins")||[],r=e.get("substitutePlugins")||[];return this.plugins.init(t.concat(n),i,r)}destroy(){let e=Promise.resolve();return"initializing"==this.state&&(e=new Promise((e=>this.once("ready",e)))),e.then((()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()})).then((()=>this.plugins.destroy())).then((()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()})).then((()=>this._context._removeEditor(this)))}execute(e,...t){try{return this.commands.execute(e,...t)}catch(e){gn.rethrowUnexpectedError(e,this)}}focus(){this.editing.view.focus()}static create(...e){throw new Error("This is an abstract method.")}static Context=Su;static EditorWatchdog=pu;static ContextWatchdog=_u;_showLicenseError(e,t){setTimeout((()=>{if("invalid"==e)throw new gn("invalid-license-key");if("expired"==e)throw new gn("license-key-expired");if("domainLimit"==e)throw new gn("license-key-domain-limit");if("featureNotAllowed"==e)throw new gn("license-key-plugin-not-allowed",null,{pluginName:t});if("evaluationLimit"==e)throw new gn("license-key-evaluation-limit");if("trialLimit"==e)throw new gn("license-key-trial-limit");if("developmentLimit"==e)throw new gn("license-key-development-limit");if("usageLimit"==e)throw new gn("license-key-usage-limit");if("distributionChannel"==e)throw new gn("license-key-invalid-distribution-channel")}),0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){const i=new Headers({"Content-Type":"application/json"}),n=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(t)});if(!n.ok)throw new Error(`HTTP Response: ${n.status}`);return n.json()}}function Hu(e){const t=function(e){return{sessionId:Lu(),pageSessionId:Du(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:Fu(e),plugins:(t=e.plugins,Array.from(t).filter((([e])=>!!e.pluginName)).map((([e])=>{const{pluginName:t,isContextPlugin:i,isOfficialPlugin:n,isPremiumPlugin:r}=e;return{isContext:!!i,isOfficial:!!n,isPremium:!!r,name:t}}))),distribution:{channel:window[Symbol.for("cke distribution")]||"sh"},env:Nu(),integration:Object.create(null),menuBar:{isVisible:!!e.config.get("menuBar.isVisible")},language:{ui:e.locale.uiLanguage,content:e.locale.contentLanguage},toolbar:{main:Mu(e.config.get("toolbar")),block:Mu(e.config.get("blockToolbar")),balloon:Mu(e.config.get("balloonToolbar"))}};var t}(e);return e.fire("collectUsageData",{setUsageData:function(e,i){if(void 0!==Fs(t,e))throw new gn("editor-usage-data-path-already-set",{path:e});Ns(t,e,i)}}),t}function Wu(e){if(!H(e.updateSourceElement))throw new gn("attachtoform-missing-elementapi-interface",e);const t=e.sourceElement;if(function(e){return!!e&&"textarea"===e.tagName.toLowerCase()}(t)&&t.form){let i;const n=t.form,r=()=>e.updateSourceElement();H(n.submit)&&(i=n.submit,n.submit=()=>{r(),i.apply(n)}),n.addEventListener("submit",r),e.on("destroy",(()=>{n.removeEventListener("submit",r),i&&(n.submit=i)}))}}function $u(e){return class extends e{sourceElement;updateSourceElement(e){if(!this.sourceElement)throw new gn("editor-missing-sourceelement",this);const t=this.config.get("updateSourceElementOnDestroy"),i=this.sourceElement instanceof HTMLTextAreaElement;if(!t&&!i)return void br(this.sourceElement,"");const n="string"==typeof e?e:this.data.get();br(this.sourceElement,n)}}}$u.updateSourceElement=$u(Object).prototype.updateSourceElement;class Uu extends Pu{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new es({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if("string"!=typeof e)throw new gn("pendingactions-add-invalid-message",this);const t=new(Ln());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const ju={bold:'',cancel:'',caption:'',check:'',cog:'',colorPalette:'',eraser:'',history:'',image:'',imageUpload:'',imageAssetManager:'',imageUrl:'',lowVision:'',textAlternative:'',loupe:'',previousArrow:'',nextArrow:'',importExport:'',paragraph:'',plus:'',text:'',alignBottom:'',alignMiddle:'',alignTop:'',alignLeft:'',alignCenter:'',alignRight:'',alignJustify:'',objectLeft:'',objectCenter:'',objectRight:'',objectFullWidth:'',objectInline:'',objectBlockLeft:'',objectBlockRight:'',objectSizeCustom:'',objectSizeFull:'',objectSizeLarge:'',objectSizeSmall:'',objectSizeMedium:'',pencil:'',pilcrow:'',quote:'',threeVerticalDots:'',dragIndicator:'',redo:'',undo:'',bulletedList:'',numberedList:'',todoList:'',codeBlock:'',browseFiles:'',heading1:'',heading2:'',heading3:'',heading4:'',heading5:'',heading6:'',horizontalLine:'',html:'',indent:'',outdent:'',table:'',remove:'',bookmark:'',bookmarkInline:''};class qu extends(Ln()){total;_reader;_data;constructor(){super();const e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=e=>{this.loaded=e.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){const t=this._reader;return this.total=e.size,new Promise(((i,n)=>{t.onload=()=>{const e=t.result;this._data=e,i(e)},t.onerror=()=>{n("error")},t.onabort=()=>{n("aborted")},this._reader.readAsDataURL(e)}))}abort(){this._reader.abort()}}class Gu extends ku{loaders=new es;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[Uu]}init(){this.loaders.on("change",(()=>this._updatePendingAction())),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((e,t)=>t?e/t*100:0))}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return fn("filerepository-no-upload-adapter"),null;const t=new Ku(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then((e=>{this._loadersMap.set(e,t)})).catch((()=>{})),t.on("change:uploaded",(()=>{let e=0;for(const t of this.loaders)e+=t.uploaded;this.uploaded=e})),t.on("change:uploadTotal",(()=>{let e=0;for(const t of this.loaders)t.uploadTotal&&(e+=t.uploadTotal);this.uploadTotal=e})),t}destroyLoader(e){const t=e instanceof Ku?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach(((e,i)=>{e===t&&this._loadersMap.delete(i)}))}_updatePendingAction(){const e=this.editor.plugins.get(Uu);if(this.loaders.length){if(!this._pendingAction){const t=this.editor.t,i=e=>`${t("Upload in progress")} ${parseInt(e)}%.`;this._pendingAction=e.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else e.remove(this._pendingAction),this._pendingAction=null}}class Ku extends(Ln()){id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=hn(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new qu,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",((e,t)=>t?e/t*100:0)),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then((e=>this._filePromiseWrapper?e:null)):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new gn("filerepository-read-wrong-status",this);return this.status="reading",this.file.then((e=>this._reader.read(e))).then((e=>{if("reading"!==this.status)throw this.status;return this.status="idle",e})).catch((e=>{if("aborted"===e)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:e}))}upload(){if("idle"!=this.status)throw new gn("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then((()=>this._adapter.upload())).then((e=>(this.uploadResponse=e,this.status="idle",e))).catch((e=>{if("aborted"===this.status)throw"aborted";throw this.status="error",e}))}abort(){const e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==e?this._reader.abort():"uploading"==e&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch((()=>{})),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(e){const t={};return t.promise=new Promise(((i,n)=>{t.rejecter=n,t.isFulfilled=!1,e.then((e=>{t.isFulfilled=!0,i(e)})).catch((e=>{t.isFulfilled=!0,n(e)}))})),t}}let Zu=class{loader;reader;constructor(e){this.loader=e}upload(){return new Promise(((e,t)=>{const i=this.reader=new window.FileReader;i.addEventListener("load",(()=>{e({default:i.result})})),i.addEventListener("error",(e=>{t(e)})),i.addEventListener("abort",(()=>{t()})),this.loader.file.then((e=>{i.readAsDataURL(e)}))}))}abort(){this.reader.abort()}};var Ju=/[\\^$.*+?()[\]{}|]/g,Qu=RegExp(Ju.source);const Yu=function(e){return(e=Vs(e))&&Qu.test(e)?e.replace(Ju,"\\$&"):e};const Xu=function(e){return function(t){return null==e?void 0:e[t]}};Xu({"&":"&","<":"<",">":">",'"':""","'":"'"});var em=/[&<>"']/g;RegExp(em.source);var tm=r(156);const im=function(e){var t,i,n=[],r=1;if("string"==typeof e)if(tm[e])n=tm[e].slice(),i="rgb";else if("transparent"===e)r=0,i="rgb",n=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var s=e.slice(1);r=1,(l=s.length)<=4?(n=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===l&&(r=parseInt(s[3]+s[3],16)/255)):(n=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===l&&(r=parseInt(s[6]+s[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var o=t[1],a="rgb"===o;i=s=o.replace(/a$/,"");var l="cmyk"===s?4:"gray"===s?1:3;n=t[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(e,t){if(/%$/.test(e))return t===l?parseFloat(e)/100:"rgb"===s?255*parseFloat(e)/100:parseFloat(e);if("h"===s[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==nm[e])return nm[e]}return parseFloat(e)})),o===s&&n.push(1),r=a||void 0===n[l]?1:n[l],n=n.slice(0,l)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(n=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(n=[e[0],e[1],e[2]],i="rgb",r=4===e.length?e[3]:1):e instanceof Object&&(null!=e.r||null!=e.red||null!=e.R?(i="rgb",n=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(i="hsl",n=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),r=e.a||e.alpha||e.opacity||1,null!=e.opacity&&(r/=100)):(i="rgb",n=[e>>>16,(65280&e)>>>8,255&e]);return{space:i,values:n,alpha:r}};var nm={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};var rm=r(734),sm=r.t(rm,2);const om=(e,t=0,i=1)=>e>i?i:eMath.round(i*e)/i,lm=(Math.PI,e=>("#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?am(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?am(parseInt(e.substring(6,8),16)/255,2):1})),cm=({h:e,s:t,v:i,a:n})=>{const r=(200-t)*i/100;return{h:am(e),s:am(r>0&&r<200?t*i/100/(r<=100?r:200-r)*100:0),l:am(r/2),a:am(n,2)}},hm=e=>{const{h:t,s:i,l:n}=cm(e);return`hsl(${t}, ${i}%, ${n}%)`},dm=({h:e,s:t,v:i,a:n})=>{e=e/360*6,t/=100,i/=100;const r=Math.floor(e),s=i*(1-t),o=i*(1-(e-r)*t),a=i*(1-(1-e+r)*t),l=r%6;return{r:am(255*[i,o,s,s,a,i][l]),g:am(255*[a,i,i,o,s,s][l]),b:am(255*[s,s,a,i,i,o][l]),a:am(n,2)}},um=e=>{const t=e.toString(16);return t.length<2?"0"+t:t},mm=({r:e,g:t,b:i,a:n})=>{const r=n<1?um(am(255*n)):"";return"#"+um(e)+um(t)+um(i)+r},gm=({r:e,g:t,b:i,a:n})=>{const r=Math.max(e,t,i),s=r-Math.min(e,t,i),o=s?r===e?(t-i)/s:r===t?2+(i-e)/s:4+(e-t)/s:0;return{h:am(60*(o<0?o+6:o)),s:am(r?s/r*100:0),v:am(r/255*100),a:n}},fm=(e,t)=>{if(e===t)return!0;for(const i in e)if(e[i]!==t[i])return!1;return!0},pm={},wm=e=>{let t=pm[e];return t||(t=document.createElement("template"),t.innerHTML=e,pm[e]=t),t},bm=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))};let _m=!1;const vm=e=>"touches"in e,ym=(e,t)=>{const i=vm(t)?t.touches[0]:t,n=e.el.getBoundingClientRect();bm(e.el,"move",e.getMove({x:om((i.pageX-(n.left+window.pageXOffset))/n.width),y:om((i.pageY-(n.top+window.pageYOffset))/n.height)}))};class km{constructor(e,t,i,n){const r=wm(`
`);e.appendChild(r.content.cloneNode(!0));const s=e.querySelector(`[part=${t}]`);s.addEventListener("mousedown",this),s.addEventListener("touchstart",this),s.addEventListener("keydown",this),this.el=s,this.xy=n,this.nodes=[s.firstChild,s]}set dragging(e){const t=e?document.addEventListener:document.removeEventListener;t(_m?"touchmove":"mousemove",this),t(_m?"touchend":"mouseup",this)}handleEvent(e){switch(e.type){case"mousedown":case"touchstart":if(e.preventDefault(),!(e=>!(_m&&!vm(e)||(_m||(_m=vm(e)),0)))(e)||!_m&&0!=e.button)return;this.el.focus(),ym(this,e),this.dragging=!0;break;case"mousemove":case"touchmove":e.preventDefault(),ym(this,e);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":((e,t)=>{const i=t.keyCode;i>40||e.xy&&i<37||i<33||(t.preventDefault(),bm(e.el,"move",e.getMove({x:39===i?.01:37===i?-.01:34===i?.05:33===i?-.05:35===i?1:36===i?-1:0,y:40===i?.01:38===i?-.01:0},!0)))})(this,e)}}style(e){e.forEach(((e,t)=>{for(const i in e)this.nodes[t].style.setProperty(i,e[i])}))}}class Cm extends km{constructor(e){super(e,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:e}){this.h=e,this.style([{left:e/360*100+"%",color:hm({h:e,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${am(e)}`)}getMove(e,t){return{h:t?om(this.h+360*e.x,0,360):360*e.x}}}class xm extends km{constructor(e){super(e,"saturation",'aria-label="Color"',!0)}update(e){this.hsva=e,this.style([{top:100-e.v+"%",left:`${e.s}%`,color:hm(e)},{"background-color":hm({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${am(e.s)}%, Brightness ${am(e.v)}%`)}getMove(e,t){return{s:t?om(this.hsva.s+100*e.x,0,100):100*e.x,v:t?om(this.hsva.v-100*e.y,0,100):Math.round(100-100*e.y)}}}const Am=Symbol("same"),Tm=Symbol("color"),Em=Symbol("hsva"),Sm=Symbol("update"),Pm=Symbol("parts"),Im=Symbol("css"),Vm=Symbol("sliders");class Rm extends HTMLElement{static get observedAttributes(){return["color"]}get[Im](){return[':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',"[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}","[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}"]}get[Vm](){return[xm,Cm]}get color(){return this[Tm]}set color(e){if(!this[Am](e)){const t=this.colorModel.toHsva(e);this[Sm](t),this[Tm]=e}}constructor(){super();const e=wm(``),t=this.attachShadow({mode:"open"});t.appendChild(e.content.cloneNode(!0)),t.addEventListener("move",this),this[Pm]=this[Vm].map((e=>new e(t)))}connectedCallback(){if(this.hasOwnProperty("color")){const e=this.color;delete this.color,this.color=e}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(e,t,i){const n=this.colorModel.fromAttr(i);this[Am](n)||(this.color=n)}handleEvent(e){const t=this[Em],i={...t,...e.detail};let n;this[Sm](i),fm(i,t)||this[Am](n=this.colorModel.fromHsva(i))||(this[Tm]=n,bm(this,"color-changed",{value:n}))}[Am](e){return this.color&&this.colorModel.equal(e,this.color)}[Sm](e){this[Em]=e,this[Pm].forEach((t=>t.update(e)))}}const Bm={defaultColor:"#000",toHsva:e=>gm(lm(e)),fromHsva:({h:e,s:t,v:i})=>mm(dm({h:e,s:t,v:i,a:1})),equal:(e,t)=>e.toLowerCase()===t.toLowerCase()||fm(lm(e),lm(t)),fromAttr:e=>e};class Om extends Rm{get colorModel(){return Bm}}class Fm extends es{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",((e,t,i)=>{this._renderViewIntoCollectionParent(t,i)})),this.on("remove",((e,t)=>{t.element&&this._parentElement&&t.element.remove()})),this._parentElement=null}destroy(){this.map((e=>e.destroy()))}setParent(e){this._parentElement=e;for(const e of this)this._renderViewIntoCollectionParent(e)}delegate(...e){if(!e.length||!e.every((e=>"string"==typeof e)))throw new gn("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const n of e)i.delegate(n).to(t);this.on("add",((i,n)=>{for(const i of e)n.delegate(i).to(t)})),this.on("remove",((i,n)=>{for(const i of e)n.stopDelegating(i,t)}))}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}class Mm extends(xn()){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,qm(jm(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new gn("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){yield*function*e(t){if(t.children)for(const i of t.children)Ym(i)?yield i:Xm(i)&&(yield*e(i))}(this)}static bind(e,t){return{to:(i,n)=>new Lm({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:n}),if:(i,n,r)=>new Dm({observable:e,emitter:t,attribute:i,valueIfTrue:n,callback:r})}}static extend(e,t){if(e._isRendered)throw new gn("template-extend-render",[this,e]);Jm(e,qm(jm(t)))}_renderNode(e){let t;if(t=e.node?this.tag&&this.text:this.tag?this.text:!this.text,t)throw new gn("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),zm(this.text)?this._bindToObservable({schema:this.text,updater:Wm(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const n in this.attributes){const r=t.getAttribute(n),s=this.attributes[n];i&&(i.attributes[n]=r);const o=tg(s)?s[0].ns:null;if(zm(s)){const a=tg(s)?s[0].value:s;i&&ig(n)&&a.unshift(r),this._bindToObservable({schema:a,updater:$m(t,n,o),data:e})}else if("style"==n&&"string"!=typeof s[0])this._renderStyleAttribute(s[0],e);else{i&&r&&ig(n)&&s.unshift(r);const e=s.map((e=>e&&e.value||e)).reduce(((e,t)=>e.concat(t)),[]).reduce(Km,"");Qm(e)||t.setAttributeNS(o,n,e)}}}_renderStyleAttribute(e,t){const i=t.node;for(const n in e){const r=e[n];zm(r)?this._bindToObservable({schema:[r],updater:Um(i,n),data:t}):i.style[n]=r}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,n=e.isApplying;let r=0;for(const s of this.children)if(eg(s)){if(!n){s.setParent(t);for(const e of s)i.appendChild(e.element)}}else if(Ym(s))n||(s.isRendered||s.render(),i.appendChild(s.element));else if(Yn(s))i.appendChild(s);else if(n){const t={children:[],bindings:[],attributes:{}};e.revertData.children.push(t),s._renderNode({intoFragment:!1,node:i.childNodes[r++],isApplying:!0,revertData:t})}else i.appendChild(s.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map((i=>{const[n,r]=t.split("@");return i.activateDomEventListener(n,r,e)}));e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const n=i.revertData;Hm(e,t,i);const r=e.filter((e=>!Qm(e))).filter((e=>e.observable)).map((n=>n.activateAttributeListener(e,t,i)));n&&n.bindings.push(r)}_revertTemplateFromNode(e,t){for(const e of t.bindings)for(const t of e)t();if(t.text)return void(e.textContent=t.text);const i=e;for(const e in t.attributes){const n=t.attributes[e];null===n?i.removeAttribute(e):i.setAttribute(e,n)}for(let e=0;eHm(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,n),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,n)}}}class Lm extends Nm{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const n=(e,i)=>{t&&!i.target.matches(t)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,e,n),()=>{this.emitter.stopListening(i.node,e,n)}}}class Dm extends Nm{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return!Qm(super.getValue(e))&&(this.valueIfTrue||!0)}}function zm(e){return!!e&&(e.value&&(e=e.value),Array.isArray(e)?e.some(zm):e instanceof Nm)}function Hm(e,t,{node:i}){const n=function(e,t){return e.map((e=>e instanceof Nm?e.getValue(t):e))}(e,i);let r;r=1==e.length&&e[0]instanceof Dm?n[0]:n.reduce(Km,""),Qm(r)?t.remove():t.set(r)}function Wm(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function $m(e,t,i){return{set(n){e.setAttributeNS(i,t,n)},remove(){e.removeAttributeNS(i,t)}}}function Um(e,t){return{set(i){e.style[t]=i},remove(){e.style[t]=null}}}function jm(e){return ki(e,(e=>{if(e&&(e instanceof Nm||Xm(e)||Ym(e)||eg(e)))return e}))}function qm(e){if("string"==typeof e?e=function(e){return{text:[e]}}(e):e.text&&function(e){e.text=Qr(e.text)}(e),e.on&&(e.eventListeners=function(e){for(const t in e)Gm(e,t);return e}(e.on),delete e.on),!e.text){e.attributes&&function(e){for(const t in e)e[t].value&&(e[t].value=Qr(e[t].value)),Gm(e,t)}(e.attributes);const t=[];if(e.children)if(eg(e.children))t.push(e.children);else for(const i of e.children)Xm(i)||Ym(i)||Yn(i)?t.push(i):t.push(new Mm(i));e.children=t}return e}function Gm(e,t){e[t]=Qr(e[t])}function Km(e,t){return Qm(t)?e:Qm(e)?t:`${e} ${t}`}function Zm(e,t){for(const i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function Jm(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),Zm(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),Zm(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new gn("ui-template-extend-children-mismatch",e);let i=0;for(const n of t.children)Jm(e.children[i++],n)}}function Qm(e){return!e&&0!==e}function Ym(e){return e instanceof ng}function Xm(e){return e instanceof Mm}function eg(e){return e instanceof Fm}function tg(t){return e(t[0])&&t[0].ns}function ig(e){return"class"==e||"style"==e}class ng extends(tr(Ln())){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new es,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",((t,i)=>{i.locale=e,i.t=e&&e.t})),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Mm.bind(this,this)}createCollection(e){const t=new Fm(e);return this._viewCollections.add(t),t}registerChild(e){Gn(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){Gn(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new Mm(e)}extendTemplate(e){Mm.extend(this.template,e)}render(){if(this.isRendered)throw new gn("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map((e=>e.destroy())),this.template&&this.template._revertData&&this.template.revert(this.element)}}function rg({emitter:e,activator:t,callback:i,contextElements:n,listenerOptions:r}){e.listenTo(document,"mousedown",((e,r)=>{if(!t())return;const s="function"==typeof r.composedPath?r.composedPath():[],o="function"==typeof n?n():n;for(const e of o)if(e.contains(r.target)||s.includes(e))return;i()}),r)}function sg(e){return class extends e{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...e){super(...e),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}}function og({view:e}){e.listenTo(e.element,"submit",((t,i)=>{i.preventDefault(),e.fire("submit")}),{useCapture:!0})}function ag({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:n,uiLanguageDirection:r}){const s="number"==typeof n?()=>n:n;function o(e){return n=>{const r=i.find((e=>e.element===t.focusedElement)),s=i.getIndex(r),o=e(s,i);i.get(o).focus(),n.stopPropagation(),n.preventDefault()}}function a(e,t){return e===t-1?0:e+1}function l(e,t){return 0===e?t-1:e-1}e.set("arrowright",o(((e,t)=>"rtl"===r?l(e,t.length):a(e,t.length)))),e.set("arrowleft",o(((e,t)=>"rtl"===r?a(e,t.length):l(e,t.length)))),e.set("arrowup",o(((e,t)=>{let i=e-s();return i<0&&(i=e+s()*Math.floor(t.length/s()),i>t.length-1&&(i-=s())),i}))),e.set("arrowdown",o(((e,t)=>{let i=e+s();return i>t.length-1&&(i=e%s()),i})))}class lg extends ng{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",(e=>!e)),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",(()=>{this._updateXMLContent(),this._colorFillPaths()})),this.on("change:fillColor",(()=>{this._colorFillPaths()}))}_updateXMLContent(){if(this.content){const e=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),t=e.getAttribute("viewBox");t&&(this.viewBox=t);for(const{name:t,value:i}of Array.from(e.attributes))lg.presentationalAttributeNames.includes(t)&&this.element.setAttribute(t,i);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;e.childNodes.length>0;)this.element.appendChild(e.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach((e=>{e.style.fill=this.fillColor}))}}class cg extends ng{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}class hg extends ng{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new cg){super(e);const i=this.bindTemplate,n=hn();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${n}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new lg,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const r={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",(e=>!e)),i.if("isVisible","ck-hidden",(e=>!e)),i.to("isOn",(e=>e?"ck-on":"ck-off")),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",(e=>e||"button")),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,(e=>!e)),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to((e=>{this.isEnabled?this.fire("execute"):e.preventDefault()}))}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",((e,t,i)=>!(!t||dg(i))&&String(!!e))),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",((e,t,i)=>!(!t||!dg(i))&&String(!!e))),Ki.isSafari&&(this._focusDelayed||(this._focusDelayed=cs((()=>this.focus()),0)),r.on.mousedown=i.to((()=>{this._focusDelayed()})),r.on.mouseup=i.to((()=>{this._focusDelayed.cancel()}))),this.setTemplate(r)}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new ng;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",(e=>qr(e)))}]}),e}_getTooltipString(e,t,i){return e?"string"==typeof e?e:(i&&(i=qr(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}function dg(e){switch(e){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class ug extends ng{children;iconView;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new lg,this.iconView.content=t.icon,this.children.add(this.iconView));const n=new ng(e);n.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(n)}}class mg extends(xn()){focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let i=e.actions[t];"string"==typeof i&&(i=[i]);for(const n of i)e.keystrokeHandler.set(n,((e,i)=>{this[t](),i()}),e.keystrokeHandlerOptions)}this.on("forwardCycle",(()=>this.focusFirst()),{priority:"low"}),this.on("backwardCycle",(()=>this.focusLast()),{priority:"low"})}get first(){return this.focusables.find(gg)||null}get last(){return this.focusables.filter(gg).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find(((t,i)=>{const n=t.element===this.focusTracker.focusedElement;return n&&(e=i),n})),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;e&&this.focusables.getIndex(e)===this.current||e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;e&&this.focusables.getIndex(e)===this.current||e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){const t=()=>null===this.current?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",(e=>{const i=t();this.focusNext(),i!==t()&&e.stop()}),{priority:"low"}),this.listenTo(e,"backwardCycle",(e=>{const i=t();this.focusPrevious(),i!==t()&&e.stop()}),{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){const t=this.focusables.length;if(!t)return null;const i=this.current;if(null===i)return this[1===e?"first":"last"];let n=this.focusables.get(i),r=(i+t+e)%t;do{const i=this.focusables.get(r);if(gg(i)){n=i;break}r=(r+t+e)%t}while(r!==i);return n}}function gg(e){return fg(e)&&xr(e.element)}function fg(e){return!(!("focus"in e)||"function"!=typeof e.focus)}function pg(e){return class extends e{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...e){super(...e),this.on("render",(()=>{this._attachListeners()})),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(ji.document,"mouseup",this._onDragEndBound),this.listenTo(ji.document,"touchend",this._onDragEndBound),this.listenTo(ji.document,"mousemove",this._onDragBound),this.listenTo(ji.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(ji.document,"mouseup",this._onDragEndBound),this.stopListening(ji.document,"touchend",this._onDragEndBound),this.stopListening(ji.document,"mousemove",this._onDragBound),this.stopListening(ji.document,"touchmove",this._onDragBound)}_onDragStart(e,t){if(!this._isHandleElementPressed(t))return;this._attachDragListeners();let i=0,n=0;t instanceof MouseEvent?(i=t.clientX,n=t.clientY):(i=t.touches[0].clientX,n=t.touches[0].clientY),this._lastDraggingCoordinates={x:i,y:n},this.isDragging=!0}_onDrag(e,t){if(!this.isDragging)return void this._detachDragListeners();let i=0,n=0;t instanceof MouseEvent?(i=t.clientX,n=t.clientY):(i=t.touches[0].clientX,n=t.touches[0].clientY),t.preventDefault(),this.fire("drag",{deltaX:Math.round(i-this._lastDraggingCoordinates.x),deltaY:Math.round(n-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:i,y:n}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(e){return!!this.dragHandleElement&&(this.dragHandleElement===e.target||e.target instanceof HTMLElement&&this.dragHandleElement.contains(e.target))}}}class wg extends ng{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new os,this._focusTracker=new is,this._focusables=new Fm,this.focusCycler=new mg({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const t of e){const e=new hg(this.locale);let i;for(i in e.on("execute",(()=>t.onExecute())),t.onCreate&&t.onCreate(e),t)"onExecute"!=i&&"onCreate"!=i&&e.set(i,t[i]);this.children.add(e)}this._updateFocusCyclableItems()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach((e=>{this._focusables.add(e),this._focusTracker.add(e.element)}))}}class bg extends ng{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}const _g="screen-center",vg="editor-center",yg="editor-top-side",kg="editor-top-center",Cg="editor-bottom-center",xg="editor-above-center",Ag="editor-below-center",Tg=_r("px");class Eg extends(pg(ng)){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i}){super(e);const n=this.bindTemplate,r=e.t;this.set("className",""),this.set("ariaLabel",r("Editor dialog")),this.set("isModal",!1),this.set("position",_g),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new os,this.focusTracker=new is,this._focusables=new Fm,this._focusCycler=new mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",n.if("isModal","ck-dialog-overlay__transparent",(e=>!e)),n.if("_isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",n.if("isModal","ck-dialog_modal"),n.to("className")],role:"dialog","aria-label":n.to("ariaLabel"),style:{top:n.to("_top",(e=>Tg(e))),left:n.to("_left",(e=>Tg(e))),visibility:n.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",((e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())})),this.on("drag",((e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)})),this.listenTo(ji.window,"resize",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.listenTo(ji.document,"scroll",(()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()})),this.on("change:_isVisible",((e,t,i)=>{i&&(this._isTransparent=!0,setTimeout((()=>{this.updatePosition(),this._isTransparent=!1,this.focus()}),10))})),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:n,actionButtons:r}){t&&(this.headerView=new ug(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),n&&(n instanceof ng&&(n=[n]),this.contentView=new bg(this.locale),this.contentView.children.addMany(n),this.parts.add(this.contentView)),r&&(this.actionsView=new wg(this.locale),this.actionsView.setButtons(r),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){const i=this._getViewportRect(),n=this._getDialogRect();e+n.width>i.right&&(e=i.right-n.width),e{var t;this._focusables.add(e),this.focusTracker.add(e.element),fg(t=e)&&"focusCycler"in t&&t.focusCycler instanceof mg&&this._focusCycler.chain(e.focusCycler)}))}_createCloseButton(){const e=new hg(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:ju.cancel}),e.on("execute",(()=>this.fire("close",{source:"closeButton"}))),e}}class Sg extends ku{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",((e,t)=>{this._show(t)})),this.on("show",((e,t)=>{t.onShow&&t.onShow(this)}),{priority:"low"}),this.on("hide",(()=>{Sg._visibleDialogPlugin&&Sg._visibleDialogPlugin._hide()})),this.on("hide",(()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)}),{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",((t,i)=>{this.isOpen&&!this.view.isModal&&(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())}))}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",(()=>{if(!this.view)return;const t=e.document.differ.getChangedRoots();for(const e of t)e.state&&this.view.updatePosition()}))}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:n=!0,content:r,actionButtons:s,className:o,isModal:a,position:l,onHide:c}){const h=this.editor;this.view=new Eg(h.locale,{getCurrentDomRoot:()=>h.editing.view.getDomRoot(h.model.document.selection.anchor.root.rootName),getViewportOffset:()=>h.ui.viewportOffset});const d=this.view;d.on("close",(()=>{this.hide()})),h.ui.view.body.add(d),h.keystrokes.listenTo(d.element),l||(l=a?_g:vg),a&&this._lockBodyScroll(),d.set({position:l,_isVisible:!0,className:o,isModal:a}),d.setupParts({icon:t,title:i,hasCloseButton:n,content:r,actionButtons:s}),this.id=e,c&&(this._onHide=c),this.isOpen=!0,Sg._visibleDialogPlugin=this}hide(){Sg._visibleDialogPlugin&&Sg._visibleDialogPlugin.fire(`hide:${Sg._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,Sg._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}class Pg extends hg{_checkIconHolderView=new Ig;constructor(e,t=new cg){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",((e,t)=>e||t))}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",(e=>this.isToggleable&&e)),this.on("change:_hasCheck",((e,t,i)=>{const{children:n,_checkIconHolderView:r}=this;i?n.add(r,0):n.remove(r)}))}}class Ig extends ng{children;_checkIconView=this._createCheckIconView();constructor(){super();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",(e=>e?"ck-on":"ck-off"))]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",((e,t,i)=>{const{children:n,_checkIconView:r}=this;i&&!n.has(r)?n.add(r):!i&&n.has(r)&&n.remove(r)}))}_createCheckIconView(){const e=new lg;return e.content=ju.check,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class Vg extends Pg{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class Rg extends ng{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${hn()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class Bg extends ng{constructor(e,t){super(e);const i=e.t,n=new Rg;n.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":n.id,role:"document",tabindex:-1},children:[Kn(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),n]})}focus(){this.element.focus()}_createCategories(e){return e.map((e=>{const t=[Kn(document,"h3",{},e.label),...Array.from(e.groups.values()).map((e=>this._createGroup(e))).flat()];return e.description&&t.splice(1,0,Kn(document,"p",{},e.description)),Kn(document,"section",{},t)}))}_createGroup(e){const t=e.keystrokes.sort(((e,t)=>e.label.localeCompare(t.label))).map((e=>this._createGroupRow(e))).flat(),i=[Kn(document,"dl",{},t)];return e.label&&i.unshift(Kn(document,"h4",{},e.label)),i}_createGroupRow(e){const t=this.locale.t,i=Kn(document,"dt"),n=Kn(document,"dd"),r=function(e){if("string"==typeof e)return[[e]];if("string"==typeof e[0])return[e];return e}(e.keystroke),s=[];for(const e of r)s.push(e.map(Og).join(""));return i.innerHTML=e.label,n.innerHTML=s.join(", ")+(e.mayRequireFn&&Ki.isMac?` ${t("(may require Fn)")}`:""),[i,n]}}function Og(e){return qr(e).split("+").map((e=>`${e}`)).join("+")}var Fg='';class Mg extends ku{contentView=null;static get requires(){return[Sg]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",(()=>{const e=this._createButton(hg);return e.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),e})),e.ui.componentFactory.add("menuBar:accessibilityHelp",(()=>{const e=this._createButton(Vg);return e.label=t("Accessibility"),e})),e.keystrokes.set("Alt+0",((e,t)=>{this._toggleDialog(),t()})),this._setupRootLabels()}_createButton(e){const t=this.editor,i=t.plugins.get("Dialog"),n=new e(t.locale);return n.set({keystroke:"Alt+0",icon:Fg,isToggleable:!0}),n.on("execute",(()=>this._toggleDialog())),n.bind("isOn").to(i,"id",(e=>"accessibilityHelp"===e)),n}_setupRootLabels(){const e=this.editor,t=e.editing.view,i=e.t;function n(e,t){const n=[t.getAttribute("aria-label"),i("Press %0 for help.",[qr("Alt+0")])].filter((e=>e)).join(". ");e.setAttribute("aria-label",n,t)}e.ui.on("ready",(()=>{t.change((e=>{for(const i of t.document.roots)n(e,i)})),e.on("addRoot",((i,r)=>{const s=e.editing.view.document.getRoot(r.rootName);t.change((e=>n(e,s)))}),{priority:"low"})}))}_toggleDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new Bg(e.locale,e.accessibility.keystrokeInfos)),"accessibilityHelp"===t.id?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:Fg,hasCloseButton:!0,content:this.contentView})}}class Ng extends Fm{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new Mm({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),Ng._bodyWrapper&&Ng._bodyWrapper.isConnected||(Ng._bodyWrapper=Kn(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(Ng._bodyWrapper)),Ng._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),Ng._bodyWrapper&&!Ng._bodyWrapper.childElementCount&&(Ng._bodyWrapper.remove(),delete Ng._bodyWrapper)}}class Lg extends hg{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new ng;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class Dg extends(Hg(hg)){}class zg extends(Hg(Pg)){}function Hg(e){return class extends e{buttonView;_fileInputView;constructor(...e){super(...e),this.buttonView=this,this._fileInputView=new Wg(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",(()=>{this._fileInputView.open()})),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}}class Wg extends ng{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to((()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""}))}})}open(){this.element.click()}}var $g='';class Ug extends ng{buttonView;children;constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new hg(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:$g}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",(e=>!e)),e.on("execute",(()=>{this.isCollapsed=!this.isCollapsed})),e}}function jg(e,t){const i=e.t,n={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return t.map((e=>{const t=n[e.label];return t&&t!=e.label&&(e.label=t),e}))}function qg(e){return e.map(Gg).filter((e=>!!e))}function Gg(e){return"string"==typeof e?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:void 0!==e.hasBorder&&e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}class Kg extends hg{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon='',this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",(e=>Ki.isMediaForcedColors?null:e))},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class Zg extends ng{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);const i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t&&t.columns?t.columns:5;const n={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new is,this.keystrokes=new os,this.items.on("add",((e,t)=>{t.isOn=t.color===this.selectedColor})),i.forEach((e=>{const t=new Kg;t.set({color:e.color,label:e.label,tooltip:!0,hasBorder:e.options.hasBorder}),t.on("execute",(()=>{this.fire("execute",{value:e.color,hasBorder:e.options.hasBorder,label:e.label})})),this.items.add(t)})),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:n}}),this.on("change:selectedColor",((e,t,i)=>{for(const e of this.items)e.isOn=e.color===i}))}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",((e,t)=>{this.focusTracker.add(t.element)})),this.items.on("remove",((e,t)=>{this.focusTracker.remove(t.element)})),this.keystrokes.listenTo(this.element),ag({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}function Jg(e,t){if(!e)return"";const i=Qg(e);if(!i)return"";if(i.space===t)return e;if(n=i,!Object.keys(sm).includes(n.space))return"";var n;const r=sm[i.space][t];if(!r)return"";return function(e,t){switch(t){case"hex":return`#${e}`;case"rgb":return`rgb( ${e[0]}, ${e[1]}, ${e[2]} )`;case"hsl":return`hsl( ${e[0]}, ${e[1]}%, ${e[2]}% )`;case"hwb":return`hwb( ${e[0]}, ${e[1]}, ${e[2]} )`;case"lab":return`lab( ${e[0]}% ${e[1]} ${e[2]} )`;case"lch":return`lch( ${e[0]}% ${e[1]} ${e[2]} )`;default:return""}}(r("hex"===i.space?i.hexValue:i.values),t)}function Qg(e){if(e.startsWith("#")){const t=im(e);return{space:"hex",values:t.values,hexValue:e,alpha:t.alpha}}const t=im(e);return t.space?t:null}class Yg extends ng{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);const i=`ck-labeled-field-view-${hn()}`,n=`ck-labeled-field-view-status-${hn()}`;this.fieldView=t(this,i,n),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(n),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",((e,t)=>e||t));const r=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",r.to("class"),r.if("isEnabled","ck-disabled",(e=>!e)),r.if("isEmpty","ck-labeled-field-view_empty"),r.if("isFocused","ck-labeled-field-view_focused"),r.if("placeholder","ck-labeled-field-view_placeholder"),r.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new Rg(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new ng(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",(e=>!e))],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class Xg extends ng{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new is,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to(((...e)=>{this.fire("input",...e),this._updateIsEmpty()})),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",((e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()}))}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(e){this.element.value=e||0===e?e:""}}class ef extends Xg{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class tf extends ef{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class nf extends ef{constructor(e,{min:t,max:i,step:n}={}){super(e);const r=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",n),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:r.to("min"),max:r.to("max"),step:r.to("step")}})}}class rf extends ng{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",(e=>`ck-dropdown__panel_${e}`)),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()}))}})}focus(){if(this.children.length){const e=this.children.first;"function"==typeof e.focus?e.focus():fn("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;"function"==typeof e.focusLast?e.focusLast():e.focus()}}}class sf extends ng{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);const n=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new os,this.focusTracker=new is,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",(e=>!e))],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":n.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",(()=>{this.isOpen=!this.isOpen})),this.on("change:isOpen",((e,t,i)=>{if(i)if("auto"===this.panelPosition){const e=sf._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=e?e.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition})),this.keystrokes.listenTo(this.element);const e=(e,t)=>{this.isOpen&&(this.isOpen=!1,t())};this.keystrokes.set("arrowdown",((e,t)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,t())})),this.keystrokes.set("arrowright",((e,t)=>{this.isOpen&&t()})),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:i,southWest:n,northEast:r,northWest:s,southMiddleEast:o,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=sf.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,n,o,a,e,r,s,l,c,t]:[n,i,a,o,e,s,r,c,l,t]}get _defaultPanelPositionName(){return"rtl"===this.locale.uiLanguageDirection?"sw":"se"}static defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-3*(t.width-e.width)/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-3*(t.width-e.width)/4,name:"nmw"})};static _getOptimalPosition=Ar}class of extends hg{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",(e=>String(e)))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new lg;return e.content=$g,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class af extends ng{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",(e=>!e))],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class lf extends ng{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class cf extends ng{labelView;items;children;constructor(e,t=new Rg){super(e);const i=this.bindTemplate,n=new hf(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,n]),n.set({role:"group",ariaLabelledBy:t.id}),n.focusTracker.destroy(),n.keystrokes.destroy(),this.items=n.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",(e=>!e))]},children:this.children})}focus(){if(this.items){const e=this.items.find((e=>!(e instanceof lf)));e&&e.focus()}}}class hf extends ng{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);const t=this.bindTemplate;this.focusables=new Fm,this.items=this.createCollection(),this.focusTracker=new is,this.keystrokes=new os,this._focusCycler=new mg({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof cf?this._registerFocusableItemsGroup(e):e instanceof af&&this._registerFocusableListItem(e);this.items.on("change",((e,t)=>{for(const e of t.removed)e instanceof cf?this._deregisterFocusableItemsGroup(e):e instanceof af&&this._deregisterFocusableListItem(e);for(const e of Array.from(t.added).reverse())e instanceof cf?this._registerFocusableItemsGroup(e,t.index):this._registerFocusableListItem(e,t.index)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(const e of i.removed)this._deregisterFocusableListItem(e);for(const t of Array.from(i.added).reverse())this._registerFocusableListItem(t,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach(((e,i)=>{const n=void 0!==t?t+i:void 0;this._registerFocusableListItem(e,n)}));const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}const df=_r("px"),uf={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class mf extends ng{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",(e=>`ck-balloon-panel_${e}`)),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",df),left:t.to("left",df)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){const t=gf(e.target);if(t&&!xr(t))return!1;this.show();const i=mf.defaultPositions,n=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:ji.document.body,fitInViewport:!0},e),r=mf._getOptimalPosition(n)||uf,s=parseInt(r.left),o=parseInt(r.top),a=r.name,l=r.config||{},{withArrow:c=!0}=l;return this.top=o,this.left=s,this.position=a,this.withArrow=c,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let t=gf(e.target);const i=e.limiter?gf(e.limiter):ji.document.body;if(this.listenTo(ji.document,"scroll",((n,r)=>{const s=r.target,o=t&&s.contains(t),a=i&&s.contains(i);!o&&!a&&t&&i||this.attachTo(e)}),{useCapture:!0}),this.listenTo(ji.window,"resize",(()=>{this.attachTo(e)})),!this._resizeObserver&&(t&&lr(t)&&(t=t.parentElement),t)){const e=()=>{xr(t)||this.unpin()};this._resizeObserver=new wr(t,e)}return!0}_stopPinning(){this.stopListening(ji.document,"scroll"),this.stopListening(ji.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){const{sideOffset:t=mf.arrowSideOffset,heightOffset:i=mf.arrowHeightOffset,stickyVerticalOffset:n=mf.stickyVerticalOffset,config:r}=e;return{northWestArrowSouthWest:(e,i)=>({top:s(e,i),left:e.left-t,name:"arrow_sw",...r&&{config:r}}),northWestArrowSouthMiddleWest:(e,i)=>({top:s(e,i),left:e.left-.25*i.width-t,name:"arrow_smw",...r&&{config:r}}),northWestArrowSouth:(e,t)=>({top:s(e,t),left:e.left-t.width/2,name:"arrow_s",...r&&{config:r}}),northWestArrowSouthMiddleEast:(e,i)=>({top:s(e,i),left:e.left-.75*i.width+t,name:"arrow_sme",...r&&{config:r}}),northWestArrowSouthEast:(e,i)=>({top:s(e,i),left:e.left-i.width+t,name:"arrow_se",...r&&{config:r}}),northArrowSouthWest:(e,i)=>({top:s(e,i),left:e.left+e.width/2-t,name:"arrow_sw",...r&&{config:r}}),northArrowSouthMiddleWest:(e,i)=>({top:s(e,i),left:e.left+e.width/2-.25*i.width-t,name:"arrow_smw",...r&&{config:r}}),northArrowSouth:(e,t)=>({top:s(e,t),left:e.left+e.width/2-t.width/2,name:"arrow_s",...r&&{config:r}}),northArrowSouthMiddleEast:(e,i)=>({top:s(e,i),left:e.left+e.width/2-.75*i.width+t,name:"arrow_sme",...r&&{config:r}}),northArrowSouthEast:(e,i)=>({top:s(e,i),left:e.left+e.width/2-i.width+t,name:"arrow_se",...r&&{config:r}}),northEastArrowSouthWest:(e,i)=>({top:s(e,i),left:e.right-t,name:"arrow_sw",...r&&{config:r}}),northEastArrowSouthMiddleWest:(e,i)=>({top:s(e,i),left:e.right-.25*i.width-t,name:"arrow_smw",...r&&{config:r}}),northEastArrowSouth:(e,t)=>({top:s(e,t),left:e.right-t.width/2,name:"arrow_s",...r&&{config:r}}),northEastArrowSouthMiddleEast:(e,i)=>({top:s(e,i),left:e.right-.75*i.width+t,name:"arrow_sme",...r&&{config:r}}),northEastArrowSouthEast:(e,i)=>({top:s(e,i),left:e.right-i.width+t,name:"arrow_se",...r&&{config:r}}),southWestArrowNorthWest:e=>({top:o(e),left:e.left-t,name:"arrow_nw",...r&&{config:r}}),southWestArrowNorthMiddleWest:(e,i)=>({top:o(e),left:e.left-.25*i.width-t,name:"arrow_nmw",...r&&{config:r}}),southWestArrowNorth:(e,t)=>({top:o(e),left:e.left-t.width/2,name:"arrow_n",...r&&{config:r}}),southWestArrowNorthMiddleEast:(e,i)=>({top:o(e),left:e.left-.75*i.width+t,name:"arrow_nme",...r&&{config:r}}),southWestArrowNorthEast:(e,i)=>({top:o(e),left:e.left-i.width+t,name:"arrow_ne",...r&&{config:r}}),southArrowNorthWest:e=>({top:o(e),left:e.left+e.width/2-t,name:"arrow_nw",...r&&{config:r}}),southArrowNorthMiddleWest:(e,i)=>({top:o(e),left:e.left+e.width/2-.25*i.width-t,name:"arrow_nmw",...r&&{config:r}}),southArrowNorth:(e,t)=>({top:o(e),left:e.left+e.width/2-t.width/2,name:"arrow_n",...r&&{config:r}}),southArrowNorthMiddleEast:(e,i)=>({top:o(e),left:e.left+e.width/2-.75*i.width+t,name:"arrow_nme",...r&&{config:r}}),southArrowNorthEast:(e,i)=>({top:o(e),left:e.left+e.width/2-i.width+t,name:"arrow_ne",...r&&{config:r}}),southEastArrowNorthWest:e=>({top:o(e),left:e.right-t,name:"arrow_nw",...r&&{config:r}}),southEastArrowNorthMiddleWest:(e,i)=>({top:o(e),left:e.right-.25*i.width-t,name:"arrow_nmw",...r&&{config:r}}),southEastArrowNorth:(e,t)=>({top:o(e),left:e.right-t.width/2,name:"arrow_n",...r&&{config:r}}),southEastArrowNorthMiddleEast:(e,i)=>({top:o(e),left:e.right-.75*i.width+t,name:"arrow_nme",...r&&{config:r}}),southEastArrowNorthEast:(e,i)=>({top:o(e),left:e.right-i.width+t,name:"arrow_ne",...r&&{config:r}}),westArrowEast:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.left-t.width-i,name:"arrow_e",...r&&{config:r}}),eastArrowWest:(e,t)=>({top:e.top+e.height/2-t.height/2,left:e.right+i,name:"arrow_w",...r&&{config:r}}),viewportStickyNorth:(e,t,i,s)=>{const o=s||i;return e.getIntersection(o)?o.height-e.height>n?null:{top:o.top+n,left:e.left+e.width/2-t.width/2,name:"arrowless",config:{withArrow:!1,...r}}:null}};function s(e,t){return e.top-t.height-i}function o(e){return e.bottom+i}}static arrowSideOffset=25;static arrowHeightOffset=10;static stickyVerticalOffset=20;static _getOptimalPosition=Ar;static defaultPositions=mf.generatePositions()}function gf(e){return Ci(e)?e:cr(e)?e.commonAncestorContainer:"function"==typeof e?gf(e()):null}class ff extends ng{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class pf extends ng{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function wf(e){if(Array.isArray(e))return{items:e,removeItems:[]};const t={items:[],removeItems:[]};return e?{...t,...e}:t}const bf=(()=>({alignLeft:ju.alignLeft,bold:ju.bold,importExport:ju.importExport,paragraph:ju.paragraph,plus:ju.plus,text:ju.text,threeVerticalDots:ju.threeVerticalDots,pilcrow:ju.pilcrow,dragIndicator:ju.dragIndicator}))();class _f extends ng{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);const i=this.bindTemplate,n=this.t;this.options=t||{},this.set("ariaLabel",n("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new is,this.keystrokes=new os,this.set("class",void 0),this.set("isCompact",!1),this.itemsView=new vf(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const r="rtl"===e.uiLanguageDirection;this._focusCycler=new mg({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[r?"arrowright":"arrowleft","arrowup"],focusNext:[r?"arrowleft":"arrowright","arrowdown"]}});const s=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")];var o;this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:(o=this,o.bindTemplate.to((e=>{e.target===o.element&&e.preventDefault()})))}}),this._behavior=this.options.shouldGroupWhenFull?new kf(this):new yf(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",((e,t)=>{this.focusTracker.add(t)})),this.items.on("remove",((e,t)=>{this.focusTracker.remove(t)})),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}_buildItemsFromConfig(t,i,n){const r=wf(t),s=n||r.removeItems;return this._cleanItemsConfiguration(r.items,i,s).map((t=>e(t)?this._createNestedToolbarDropdown(t,i,s):"|"===t?new ff:"-"===t?new pf:i.create(t))).filter((e=>!!e))}_cleanItemsConfiguration(t,i,n){const r=t.filter(((t,r,s)=>"|"===t||-1===n.indexOf(t)&&("-"===t?!this.options.shouldGroupWhenFull||(fn("toolbarview-line-break-ignored-when-grouping-items",s),!1):!(!e(t)&&!i.has(t))||(fn("toolbarview-item-unavailable",{item:t}),!1))));return this._cleanSeparatorsAndLineBreaks(r)}_cleanSeparatorsAndLineBreaks(e){const t=e=>"-"!==e&&"|"!==e,i=e.length,n=e.findIndex(t);if(-1===n)return[];const r=i-e.slice().reverse().findIndex(t);return e.slice(n,r).filter(((e,i,n)=>{if(t(e))return!0;return!(i>0&&n[i-1]===e)}))}_createNestedToolbarDropdown(e,t,i){let{label:n,icon:r,items:s,tooltip:o=!0,withText:a=!1}=e;if(s=this._cleanItemsConfiguration(s,t,i),!s.length)return null;const l=xf(this.locale);return n||fn("toolbarview-nested-toolbar-dropdown-missing-label",e),l.class="ck-toolbar__nested-toolbar-dropdown",l.buttonView.set({label:n,tooltip:o,withText:!!a}),!1!==r?l.buttonView.icon=bf[r]||r||ju.threeVerticalDots:l.buttonView.withText=!0,Af(l,(()=>l.toolbarView._buildItemsFromConfig(s,t,i))),l}}class vf extends ng{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class yf{constructor(e){const t=e.bindTemplate;e.set("isVertical",!1),e.itemsView.children.bindTo(e.items).using((e=>e)),e.focusables.bindTo(e.items).using((e=>fg(e)?e:null)),e.extendTemplate({attributes:{class:[t.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class kf{view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using((e=>e)),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",((e,t)=>{const i=t.index,n=Array.from(t.added);for(const e of t.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e);for(let e=i;ethis.ungroupedItems.length?this.groupedItems.add(t,e-this.ungroupedItems.length):this.ungroupedItems.add(t,e)}this._updateGrouping()})),e.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!xr(this.viewElement))return void(this.shouldUpdateGroupingOnNextResize=!0);const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,i=new ur(e.lastChild),n=new ur(e);if(!this.cachedPadding){const i=ji.window.getComputedStyle(e),n="ltr"===t?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[n])}return"ltr"===t?i.right>n.right-this.cachedPadding:i.left{e&&e===t.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)})),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",(()=>{this._updateGrouping()}))}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new ff),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,i=xf(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===e.uiLanguageDirection?"sw":"se",Af(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:"rtl"===e.uiLanguageDirection?"se":"sw",icon:ju.threeVerticalDots}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map((e=>{fg(e)&&this.viewFocusables.add(e)})),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class Cf extends ng{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new os,this.focusTracker=new is,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",(e=>!e)),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",((e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())})),this.keystrokes.set("arrowleft",((e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const t=e||new hg;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const e=new hg,t=e.bindTemplate;return e.icon=$g,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",(e=>String(e)))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function xf(e,t=of){const i="function"==typeof t?new t(e):t,n=new rf(e),r=new sf(e,i,n);return i.bind("isEnabled").to(r),i instanceof Cf?i.arrowView.bind("isOn").to(r,"isOpen"):i.bind("isOn").to(r,"isOpen"),function(e){(function(e){rg({emitter:e,activator:()=>e.isRendered&&e.isOpen,callback:()=>{e.isOpen=!1},contextElements:()=>[e.element,...If(e.focusTracker).filter((t=>!e.element.contains(t)))]})})(e),function(e){e.on("execute",(t=>{t.source instanceof Lg||(e.isOpen=!1)}))}(e),function(e){e.focusTracker.on("change:isFocused",((t,i,n)=>{!n&&e.isOpen&&(e.isOpen=!1)}))}(e),function(e){e.keystrokes.set("arrowdown",((t,i)=>{e.isOpen&&(e.panelView.focus(),i())})),e.keystrokes.set("arrowup",((t,i)=>{e.isOpen&&(e.panelView.focusLast(),i())}))}(e),function(e){e.on("change:isOpen",((t,i,n)=>{if(n)return;e.focusTracker.elements.some((e=>e.contains(ji.document.activeElement)))&&e.buttonView.focus()}))}(e),function(e){e.on("change:isOpen",((t,i,n)=>{n&&e.panelView.focus()}),{priority:"low"})}(e)}(r),r}function Af(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?Tf(e,t,i):e.once("change:isOpen",(()=>Tf(e,t,i)),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&Pf(e,(()=>e.toolbarView.items.find((e=>e.isOn))))}function Tf(e,t,i){const n=e.locale,r=n.t,s=e.toolbarView=new _f(n),o="function"==typeof t?t():t;s.ariaLabel=i.ariaLabel||r("Dropdown toolbar"),i.maxWidth&&(s.maxWidth=i.maxWidth),i.class&&(s.class=i.class),i.isCompact&&(s.isCompact=i.isCompact),i.isVertical&&(s.isVertical=!0),o instanceof Fm?s.items.bindTo(o).using((e=>e)):s.items.addMany(o),e.panelView.children.add(s),e.focusTracker.add(s),s.items.delegate("execute").to(e)}function Ef(e,t,i={}){e.isOpen?Sf(e,t,i):e.once("change:isOpen",(()=>Sf(e,t,i)),{priority:"highest"}),Pf(e,(()=>e.listView.items.find((e=>e instanceof af&&e.children.first.isOn))))}function Sf(e,t,i){const n=e.locale,r=e.listView=new hf(n),s="function"==typeof t?t():t;r.ariaLabel=i.ariaLabel,r.role=i.role,Vf(e,r.items,s,n),e.panelView.children.add(r),r.items.delegate("execute").to(e)}function Pf(e,t){e.on("change:isOpen",(()=>{if(!e.isOpen)return;const i=t();i&&("function"==typeof i.focus?i.focus():fn("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))}),{priority:dn.low-10})}function If(e){return[...e.elements,...e.externalViews.flatMap((e=>If(e.focusTracker)))]}function Vf(e,t,i,n){t.on("change",(()=>{const e=[...t].reduce(((e,t)=>(t instanceof af&&t.children.first instanceof Pg&&e.push(t.children.first),e)),[]),i=e.some((e=>e.isToggleable));e.forEach((e=>{e.hasCheckSpace=i}))})),t.bindTo(i).using((t=>{if("separator"===t.type)return new lf(n);if("group"===t.type){const i=new cf(n);return i.set({label:t.label}),Vf(e,i.items,t.items,n),i.items.delegate("execute").to(e),i}if("button"===t.type||"switchbutton"===t.type){const e="menuitemcheckbox"===t.model.role||"menuitemradio"===t.model.role,i=new af(n);let r;return"button"===t.type?(r=new Pg(n),r.set({isToggleable:e})):r=new Lg(n),r.bind(...Object.keys(t.model)).to(t.model),r.delegate("execute").to(i),i.children.add(r),i}return null}))}const Rf=(e,t,i)=>{const n=new tf(e.locale);return n.set({id:t,ariaDescribedById:i}),n.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),n.bind("hasError").to(e,"errorText",(e=>!!e)),n.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(n),n},Bf=(e,t,i)=>{const n=new nf(e.locale);return n.set({id:t,ariaDescribedById:i,inputMode:"numeric"}),n.bind("isReadOnly").to(e,"isEnabled",(e=>!e)),n.bind("hasError").to(e,"errorText",(e=>!!e)),n.on("input",(()=>{e.errorText=null})),e.bind("isEmpty","isFocused","placeholder").to(n),n},Of=(e,t,i)=>{const n=xf(e.locale);return n.set({id:t,ariaDescribedById:i}),n.bind("isEnabled").to(e),n};class Ff extends ng{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=no((e=>{this.set("color",e),this.fire("colorSelected",{color:this.color})}),150,{leading:!0}),this.on("set:color",((e,t,i)=>{e.return=Jg(i,this._config.format||"hsl")})),this.on("change:color",(()=>{this._hexColor=Mf(this.color)})),this.on("change:_hexColor",(()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),Mf(this.color)!=Mf(this._hexColor)&&(this.color=this._hexColor)}))}render(){var e,t;if(super.render(),e="hex-color-picker",t=Om,void 0===customElements.get(e)&&customElements.define(e,t),this.picker=ji.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);const e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",(e=>{const t=e.detail.value;this._debounceColorPickerEvent(t)}))}focus(){if(!this._config.hideInput&&(Ki.isGecko||Ki.isiOS||Ki.isSafari)){this.hexInputRow.children.get(1).focus()}this.slidersView.first.focus()}_createSlidersView(){const e=[...this.picker.shadowRoot.children].filter((e=>"slider"===e.getAttribute("role"))).map((e=>new Nf(e)));this.slidersView=this.createCollection(),e.forEach((e=>{this.slidersView.add(e)}))}_createInputRow(){const e=this._createColorInput();return new Df(this.locale,e)}_createColorInput(){const e=new Yg(this.locale,Rf),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",(t=>e.isFocused?e.fieldView.value:t.startsWith("#")?t.substring(1):t)),e.fieldView.on("input",(()=>{const t=e.fieldView.element.value;if(t){const e=zf(t);e&&this._debounceColorPickerEvent(e)}})),e}isValid(){const{t:e}=this.locale;return!!this._config.hideInput||(this.resetValidationStatus(),!!this.hexInputRow.getParsedColor()||(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function Mf(e){let t=function(e){if(!e)return"";const t=Qg(e);return t?"hex"===t.space?t.hexValue:Jg(e,"hex"):"#000"}(e);return t||(t="#000"),4===t.length&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join("")),t.toLowerCase()}class Nf extends ng{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class Lf extends ng{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class Df extends ng{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new Lf,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return zf(this.inputView.fieldView.element.value)}}function zf(e){if(!e)return null;const t=e.trim().replace(/^#/,"");return[3,4,6,8].includes(t.length)&&/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(t)?`#${t}`:null}class Hf extends(Ln(es)){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",(()=>{this.set("isEmpty",0===this.length)}))}add(e,t){return this.find((t=>t.color===e.color))?this:super.add(e,t)}hasColor(e){return!!this.find((t=>t.color===e))}}class Wf extends ng{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:n,documentColorsLabel:r,documentColorsCount:s,colorPickerLabel:o,focusTracker:a,focusables:l}){super(e);const c=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=a,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new Hf,this.documentColorsCount=s,this._focusables=l,this._removeButtonLabel=n,this._colorPickerLabel=o,this._documentColorsLabel=r,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",c.if("isVisible","ck-hidden",(e=>!e))]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){const i=e.document,n=this.documentColorsCount;this.documentColors.clear();for(const r of i.getRoots()){const i=e.createRangeIn(r);for(const e of i.getItems())if(e.is("$textProxy")&&e.hasAttribute(t)&&(this._addColorToDocumentColors(e.getAttribute(t)),this.documentColors.length>=n))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){const e=Mm.bind(this.documentColors,this.documentColors),t=new ng(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new hg,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:ju.colorPalette,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",(()=>{this.fire("colorPicker:show")}))}_createRemoveColorButton(){const e=new hg;return e.set({withText:!0,icon:ju.eraser,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",(()=>{this.fire("execute",{value:null,source:"removeColorButton"})})),e.render(),e}_createStaticColorsGrid(){const e=new Zg(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",((e,t)=>{this.fire("execute",{value:t.value,source:"staticColorsGrid"})})),e}_createDocumentColorsGrid(){const e=Mm.bind(this.documentColors,this.documentColors),t=new Zg(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using((e=>{const t=new Kg;return t.set({color:e.color,hasBorder:e.options&&e.options.hasBorder}),e.label&&t.set({label:e.label,tooltip:!0}),t.on("execute",(()=>{this.fire("execute",{value:e.color,source:"documentColorsGrid"})})),t})),this.documentColors.on("change:isEmpty",((e,i,n)=>{n&&(t.selectedColor=null)})),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find((t=>t.color===e));t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class $f extends ng{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:n,colorPickerViewConfig:r}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=n,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=r;const s=this.bindTemplate,{saveButtonView:o,cancelButtonView:a}=this._createActionButtons();this.saveButtonView=o,this.cancelButtonView=a,this.actionBarView=this._createActionBarView({saveButtonView:o,cancelButtonView:a}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",s.if("isVisible","ck-hidden",(e=>!e))]},children:this.items})}render(){super.render();const e=new Ff(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",((t,i,n)=>{e.color=n})),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",(e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())}))}_stopPropagationOnArrowsKeys(){const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(const e of this.colorPickerView.slidersView)this.focusTracker.add(e.element),this._focusables.add(e);const e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){const i=new ng,n=this.createCollection();return n.add(e),n.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:n}),i}_createActionButtons(){const e=this.locale,t=e.t,i=new hg(e),n=new hg(e);return i.set({icon:ju.check,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),n.set({icon:ju.cancel,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",(()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})})),n.on("execute",(()=>{this.fire("colorPicker:cancel")})),{saveButtonView:i,cancelButtonView:n}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",((e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)}))}}class Uf extends ng{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:n,documentColorsLabel:r,documentColorsCount:s,colorPickerLabel:o,colorPickerViewConfig:a}){super(e),this.items=this.createCollection(),this.focusTracker=new is,this.keystrokes=new os,this._focusables=new Fm,this._colorPickerViewConfig=a,this._focusCycler=new mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new Wf(e,{colors:t,columns:i,removeButtonLabel:n,documentColorsLabel:r,documentColorsCount:s,colorPickerLabel:o,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new $f(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:a}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",((e,t,i)=>{this.colorGridsFragmentView.set("selectedColor",i),this.colorPickerFragmentView.set("selectedColor",i)})),this.colorGridsFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.colorPickerFragmentView.on("change:selectedColor",((e,t,i)=>{this.set("selectedColor",i)})),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){this.colorPickerFragmentView.colorPickerView&&!this._isColorPickerFragmentVisible&&(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){2!==this.items.length&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",(()=>{this.showColorPickerFragment()})),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class jf{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(qf(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new gn("componentfactory-item-missing",this,{name:e});return this._components.get(qf(e)).callback(this.editor.locale)}has(e){return this._components.has(qf(e))}}function qf(e){return String(e).toLowerCase()}const Gf="ck-tooltip";class Kf extends(tr()){tooltipTextView;balloonPanelView;static defaultBalloonPositions=mf.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(e){if(super(),Kf._editors.add(e),Kf._instance)return Kf._instance;Kf._instance=this,this.tooltipTextView=new ng(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new mf(e.locale),this.balloonPanelView.class=Gf,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=function(e){const t=new MutationObserver((()=>{e()}));return{attach(e){t.observe(e,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}((()=>{this._updateTooltipPosition()})),this._pinTooltipDebounced=no(this._pinTooltip,600),this._unpinTooltipDebounced=no(this._unpinTooltip,400),this.listenTo(ji.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(ji.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(ji.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(ji.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(ji.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(ji.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;Kf._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),Kf._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),Kf._instance=null)}static getPositioningFunctions(e){const t=Kf.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onKeyDown(e,t){"Escape"===t.key&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){const i=Zf(t);i?i!==this._currentElementWithTooltip&&(this._unpinTooltip(),"focus"!==e.name||i.matches(":hover")?this._pinTooltipDebounced(i,Jf(i)):this._pinTooltip(i,Jf(i))):"focus"===e.name&&this._unpinTooltip()}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if("mouseleave"===e.name){if(!Ci(t))return;const e=this.balloonPanelView.element,n=e&&(e===i||e.contains(i)),r=!n&&t===e;if(n)return void this._unpinTooltipDebounced.cancel();if(!r&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const s=Zf(t),o=Zf(i);(r||s&&s!==o)&&this._unpinTooltipDebounced()}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:i,cssClass:n}){this._unpinTooltip();const r=ts(Kf._editors.values()).ui.view.body;r.has(this.balloonPanelView)||r.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[Gf,n].filter((e=>e)).join(" "),this.balloonPanelView.pin({target:e,positions:Kf.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(const e of Kf._editors)this.listenTo(e.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of Kf._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=Jf(this._currentElementWithTooltip);xr(this._currentElementWithTooltip)&&e.text?this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:Kf.getPositioningFunctions(e.position)}):this._unpinTooltip()}}function Zf(e){return Ci(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function Jf(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}const Qf=50,Yf=350;class Xf extends(tr()){editor;_balloonView=null;_showBalloonThrottled=du((()=>this._showBalloon()),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",(()=>this._handleEditorReady()))}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",((e,t,i)=>{this._updateLastFocusedEditableElement(),i?this._showBalloon():this._hideBalloon()})),e.ui.focusTracker.on("change:focusedElement",((e,t,i)=>{this._updateLastFocusedEditableElement(),i&&this._showBalloon()})),e.ui.on("update",(()=>{this._showBalloonThrottled()})))}_getNormalizedConfig(){return{side:"ltr"===this.editor.locale.contentLanguageDirection?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,t=new mf,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),t="right"===e.side?ep(this._lastFocusedEditableElement,i=e,((e,t)=>e.left+e.width-t.width-i.horizontalOffset)):function(e,t){return ep(e,t,(e=>e.left+t.horizontalOffset))}(this._lastFocusedEditableElement,e);var i;return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i)return void(this._lastFocusedEditableElement=null);const n=Array.from(e.ui.getEditableElementsNames()).map((t=>e.ui.getEditableElement(t)));n.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=n[0]}}function ep(e,t,i){return(n,r)=>{const s=new ur(e);if(s.width\n',isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:n.to((e=>e.preventDefault()))}}]})}}class np extends Xf{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){const e=sp(this.editor.config.get("licenseKey"));return Boolean(e&&this.licenseTypeMessage[e])}_createBadgeContent(){const e=sp(this.editor.config.get("licenseKey"));return new rp(this.editor.locale,this.licenseTypeMessage[e])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{};return{position:t.position||e.position,side:"left"===(t.side||e.side)?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class rp extends ng{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}}function sp(e){if("GPL"==e)return"GPL";const t=hs(e.split(".")[1]);return t?t.licenseType||"production":null}const op={POLITE:"polite",ASSERTIVE:"assertive"};class ap{editor;view;constructor(e){this.editor=e,e.once("ready",(()=>{for(const e of Object.values(op))this.announce("",e)}))}announce(e,t=op.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new lp(i.locale),i.ui.view.body.add(this.view));const{politeness:n,isUnsafeHTML:r}="string"==typeof t?{politeness:t}:t;let s=this.view.regionViews.find((e=>e.politeness===n));s||(s=new cp(i,n),this.view.regionViews.add(s)),s.announce({announcement:e,isUnsafeHTML:r})}}class lp extends ng{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class cp extends ng{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",(()=>{null!==this._pruneAnnouncementsInterval&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)})),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval((()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()}),5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;const i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}class hp extends af{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}const dp={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",(t=>{if(e.isFocusBorderEnabled||e.isOpen){if(e.isOpen)for(const i of e.menus){const e=t.path[0],n=e instanceof hp&&e.children.first===i;i.isOpen=(t.path.includes(i)||n)&&i.isEnabled}t.source.focus()}}))},focusCycleMenusOnArrows(e){const t="rtl"===e.locale.uiLanguageDirection;function i(t,i){const n=e.children.getIndex(t),r=t.isOpen,s=e.children.length,o=e.children.get((n+s+i)%s);t.isOpen=!1,r&&(o.isOpen=!0),o.buttonView.focus()}e.on("menu:arrowright",(e=>{i(e.source,t?-1:1)})),e.on("menu:arrowleft",(e=>{i(e.source,t?1:-1)}))},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",(()=>{e.isOpen||e.menus.forEach((e=>{e.isOpen=!1}))}))},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",((t,i,n)=>{n&&e.menus.filter((e=>t.source.parentMenuView===e.parentMenuView&&t.source!==e&&e.isOpen)).forEach((e=>{e.isOpen=!1}))}))},closeOnClickOutside(e){rg({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map((e=>e.element))})},enableFocusHighlightOnInteraction(e){let t=!1;e.on("change:isOpen",((i,n,r)=>{r||(t||(e.isFocusBorderEnabled=!1),t=!1)})),e.listenTo(e.element,"keydown",(()=>{t=!0}),{useCapture:!0}),e.listenTo(e.element,"keyup",(()=>{t=!1}),{useCapture:!0}),e.listenTo(e.element,"focus",(()=>{t&&(e.isFocusBorderEnabled=!0)}),{useCapture:!0})}},up={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnArrowRightKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowleft":"arrowright";e.keystrokes.set(t,((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&e.isEnabled&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())}))},openOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!0}))},toggleOnButtonClick(e){e.buttonView.on("execute",(()=>{e.isOpen=!e.isOpen}))},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",((t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())}))},closeOnArrowLeftKey(e){const t="rtl"===e.locale.uiLanguageDirection?"arrowright":"arrowleft";e.keystrokes.set(t,((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnEscKey(e){e.keystrokes.set("esc",((t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())}))},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",((t,i,n)=>{n||t.source!==e.parentMenuView||(e.isOpen=!1)}))}},mp={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-5,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-5,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+5,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+5,name:"wn"})},gp=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable"]},{groupId:"insertInline",items:["menuBar:link","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function fp({normalizedConfig:e,locale:t,componentFactory:i,extraItems:n}){const r=To(e);return pp(e,r,n),function(e,t){const i=t.removeItems,n=[];t.items=t.items.filter((({menuId:e})=>!i.includes(e)||(n.push(e),!1))),vp(t.items,(e=>{e.groups=e.groups.filter((({groupId:e})=>!i.includes(e)||(n.push(e),!1)));for(const t of e.groups)t.items=t.items.filter((e=>{const t=xp(e);return!i.includes(t)||(n.push(t),!1)}))}));for(const t of i)n.includes(t)||fn("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:t})}(e,r),pp(e,r,r.addItems),function(e,t,i){vp(t.items,(n=>{for(const r of n.groups)r.items=r.items.filter((r=>{const s="string"==typeof r&&!i.has(r);return s&&!t.isUsingDefaultConfig&&fn("menu-bar-item-unavailable",{menuBarConfig:e,parentMenuConfig:To(n),componentName:r}),!s}))}))}(e,r,i),bp(e,r),function(e,t){const i=t.t,n={File:i({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:i({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:i({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:i({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:i({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:i({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:i({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:i({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:i({string:"Font",id:"MENU_BAR_MENU_FONT"})};vp(e.items,(e=>{e.label in n&&(e.label=n[e.label])}))}(r,t),r}function pp(e,t,i){const n=[];if(0!=i.length){for(const e of i){const i=kp(e.position),s=Cp(e.position);if("object"==typeof(r=e)&&"menu"in r)if(s){const r=t.items.findIndex((e=>e.menuId===s));if(-1!=r)"before"===i?(t.items.splice(r,0,e.menu),n.push(e)):"after"===i&&(t.items.splice(r+1,0,e.menu),n.push(e));else{wp(t,e.menu,s,i)&&n.push(e)}}else"start"===i?(t.items.unshift(e.menu),n.push(e)):"end"===i&&(t.items.push(e.menu),n.push(e));else if(yp(e))vp(t.items,(t=>{if(t.menuId===s)"start"===i?(t.groups.unshift(e.group),n.push(e)):"end"===i&&(t.groups.push(e.group),n.push(e));else{const r=t.groups.findIndex((e=>e.groupId===s));-1!==r&&("before"===i?(t.groups.splice(r,0,e.group),n.push(e)):"after"===i&&(t.groups.splice(r+1,0,e.group),n.push(e)))}}));else{wp(t,e.item,s,i)&&n.push(e)}}var r;for(const t of i)n.includes(t)||fn("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:t})}}function wp(e,t,i,n){let r=!1;return vp(e.items,(e=>{for(const{groupId:s,items:o}of e.groups){if(r)return;if(s===i)"start"===n?(o.unshift(t),r=!0):"end"===n&&(o.push(t),r=!0);else{const e=o.findIndex((e=>xp(e)===i));-1!==e&&("before"===n?(o.splice(e,0,t),r=!0):"after"===n&&(o.splice(e+1,0,t),r=!0))}}})),r}function bp(e,t){const i=t.isUsingDefaultConfig;let n=!1;t.items=t.items.filter((t=>!!t.groups.length||(_p(e,t,i),!1))),t.items.length?(vp(t.items,(t=>{t.groups=t.groups.filter((e=>!!e.items.length||(n=!0,!1)));for(const r of t.groups)r.items=r.items.filter((t=>!(Ap(t)&&!t.groups.length)||(_p(e,t,i),n=!0,!1)))})),n&&bp(e,t)):_p(e,e,i)}function _p(e,t,i){i||fn("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function vp(e,t){if(Array.isArray(e))for(const t of e)i(t);function i(e){t(e);for(const t of e.groups)for(const e of t.items)Ap(e)&&i(e)}}function yp(e){return"object"==typeof e&&"group"in e}function kp(e){return e.startsWith("start")?"start":e.startsWith("end")?"end":e.startsWith("after")?"after":"before"}function Cp(e){const t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}function xp(e){return"string"==typeof e?e:e.menuId}function Ap(e){return"object"==typeof e&&"menuId"in e}class Tp extends(Ln()){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;constructor(e){super();const t=e.editing.view;this.editor=e,this.componentFactory=new jf(e),this.focusTracker=new is,this.tooltipManager=new Kf(e),this.poweredBy=new tp(e),this.evaluationBadge=new np(e),this.ariaLiveAnnouncer=new ap(e),this.set("viewportOffset",this._readViewportOffsetFromConfig()),this.once("ready",(()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0})),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[]}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",(()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)})),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}_initMenuBar(e){const t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);const i=function(e){let t;return t="items"in e&&e.items?{items:e.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...e}:{items:To(gp),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...e},t}(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",((e,i)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),i())})),this.editor.keystrokes.set("Alt+F9",((i,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),n())}))}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){const e=this.editor;let t;e.keystrokes.set("Alt+F10",((e,i)=>{this._saveLastFocusedForeignElement();const n=this._getCurrentFocusedToolbarDefinition();n&&t||(t=this._getFocusableCandidateToolbarDefinitions());for(let e=0;e{const n=this._getCurrentFocusedToolbarDefinition();n&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),n.options.afterBlur&&n.options.afterBlur(),i())}))}_saveLastFocusedForeignElement(){const e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:i,options:n}=t;(xr(i.element)||n.beforeFocus)&&e.push(t)}return e.sort(((e,t)=>Ep(e)-Ep(t))),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),!!xr(t.element)&&(t.focus(),!0)}_handleScrollToTheSelection(e,t){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const t of e)this.focusTracker.add(t.element);e.on("add",((e,t)=>{this.focusTracker.add(t.element)})),e.on("remove",((e,t)=>{this.focusTracker.remove(t.element)}))}}function Ep(e){const{toolbarView:t,options:i}=e;let n=10;return xr(t.element)&&n--,i.isContextual&&n--,n}class Sp extends ng{body;menuBarView;constructor(e){super(e),this.body=new Ng(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class Pp extends Sp{top;main;_voiceLabelView;constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,t=new Rg;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class Ip extends ng{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",(()=>this._updateIsFocusedClasses())),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;function t(t){e.change((i=>{const n=e.document.getRoot(t.name);i.addClass(t.isFocused?"ck-focused":"ck-blurred",n),i.removeClass(t.isFocused?"ck-blurred":"ck-focused",n)}))}e.isRenderingInProgress?function i(n){e.once("change:isRenderingInProgress",((e,r,s)=>{s?i(n):t(n)}))}(this):t(this)}}class Vp extends Ip{_options;constructor(e,t,i,n={}){super(e,t,i),this._options=n,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change((t=>{const i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)}))}getEditableAriaLabel(){const e=this.locale.t,t=this._options.label,i=this._editableElement,n=this.name;if("string"==typeof t)return t;if("object"==typeof t)return t[n];if("function"==typeof t)return t(this);if(i){const e=i.getAttribute("aria-label");if(e)return e}return e("Rich Text Editor. Editing area: %0",n)}}class Rp extends Pu{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",((e,t)=>{window.alert(t.message)}),{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class Bp extends(Ln()){constructor(e,t){super(),t&&Us(this,t),e&&this.set(e)}}const Op=_r("px");class Fp extends ku{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{const e=this.editor.editing.view,t=e.document.selection.editableElement;return t?e.domConverter.mapViewToDom(t.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new gn("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t))return this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!e.singleViewMode||this.showStack(t));const i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new gn("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(1===t.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),1===t.size?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:this.editor.ui.viewportOffset})),e}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new gn("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new mf(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find((t=>t[1]===e))[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Mp(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>1)),e.on("change:isNavigationVisible",(()=>this.updatePosition()),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",((e,i)=>{if(i<2)return"";const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[n,i])})),e.buttonNextView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()})),e.buttonPrevView.on("execute",(()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()})),e}_createFakePanelsView(){const e=new Np(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",((e,t)=>!t&&e>=2?Math.min(e-1,2):0)),e.listenTo(this.view,"change:top",(()=>e.updatePosition())),e.listenTo(this.view,"change:left",(()=>e.updatePosition())),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:n=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),n&&(this._singleViewMode=!0)}}class Mp extends ng{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new is,this.buttonPrevView=this._createButtonView(t("Previous"),ju.previousArrow),this.buttonNextView=this._createButtonView(t("Next"),ju.nextArrow),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",(e=>e?"":"ck-hidden"))]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new hg(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class Np extends ng{content;_balloonPanelView;constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",(e=>e?"":"ck-hidden"))],style:{top:i.to("top",Op),left:i.to("left",Op),width:i.to("width",Op),height:i.to("height",Op)}},children:this.content}),this.on("change:numberOfPanels",((e,t,i,n)=>{i>n?this._addPanels(i-n):this._removePanels(n-i),this.updatePosition()}))}_addPanels(e){for(;e--;){const e=new ng;e.setTemplate({tag:"div"}),this.content.add(e),this.registerChild(e)}}_removePanels(e){for(;e--;){const e=this.content.last;this.content.remove(e),this.deregisterChild(e),e.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:i,height:n}=new ur(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:n})}}}const Lp=_r("px");class Dp extends ng{content;contentPanelElement;_contentPanelPlaceholder;constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new Mm({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",(e=>e?"block":"none")),height:t.to("isSticky",(e=>e?Lp(this._contentPanelRect.height):null))}}}).render(),this.contentPanelElement=new Mm({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",(e=>e?Lp(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:t.to("_stickyTopOffset",(e=>e?Lp(e):e)),bottom:t.to("_stickyBottomOffset",(e=>e?Lp(e):e)),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(ji.document,"scroll",(()=>{this.checkIfShouldBeSticky()}),{useCapture:!0}),this.listenTo(this,"change:isActive",(()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();const e=new ur(this.limiterElement);let t=e.getVisible();if(t){const e=new ur(ji.window);e.top+=this.viewportTopOffset,e.height-=this.viewportTopOffset,t=t.getIntersection(e)}if(t&&e.topt.bottom){const i=Math.max(e.bottom-t.bottom,0)+this.limiterBottomOffset;e.bottom-i>e.top+this._contentPanelRect.height?this._stickToBottomOfLimiter(i):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffsetString(e))),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new lg;return e.content=$g,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class Hp extends ng{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",(e=>`ck-menu-bar__menu__panel_position_${e}`)),t.if("isVisible","ck-hidden",(e=>!e))],tabindex:"-1"},children:this.children,on:{selectstart:t.to((e=>{"input"!==e.target.tagName.toLocaleLowerCase()&&e.preventDefault()}))}})}focus(e=1){this.children.length&&(1===e?this.children.first.focus():this.children.last.focus())}}class Wp extends ng{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new zp(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new Hp(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new os,this.focusTracker=new is,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",(e=>!e)),t.if("parentMenuView","ck-menu-bar__menu_top-level",(e=>!e))]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),up.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(up.openOnButtonClick(this),up.openOnArrowRightKey(this),up.closeOnArrowLeftKey(this),up.openAndFocusOnEnterKeyPress(this),up.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),up.openAndFocusPanelOnArrowDownKey(this),up.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",((e,t)=>{this.fire("arrowright"),t()})),this.keystrokes.set("arrowleft",((e,t)=>{this.fire("arrowleft"),t()}))}_repositionPanelOnOpen(){this.on("change:isOpen",((e,t,i)=>{if(!i)return;const n=Wp._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=n?n.name:this._defaultMenuPositionName}))}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:i,northWest:n,westSouth:r,eastSouth:s,westNorth:o,eastNorth:a}=mp;return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?[s,a,r,o]:[e,t,i,n]:this.parentMenuView?[r,o,s,a]:[t,e,n,i]}get _defaultMenuPositionName(){return"ltr"===this.locale.uiLanguageDirection?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=Ar}class $p extends hf{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const e=Array.from(this.items).some((e=>{const t=Up(e);return t&&t.isToggleable}));this.items.forEach((t=>{const i=Up(t);i&&(i.hasCheckSpace=e)}))}}function Up(e){return e instanceof af?e.children.map((e=>function(e){return"object"==typeof e&&"buttonView"in e&&e.buttonView instanceof hg}(e)?e.buttonView:e)).find((e=>e instanceof Pg)):null}class jp extends zg{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}const qp=["mouseenter","arrowleft","arrowright","change:isOpen"];class Gp extends ng{children;menus=[];constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){const n=fp({normalizedConfig:e,locale:this.locale,componentFactory:t,extraItems:i}).items.map((e=>this._createMenu({componentFactory:t,menuDefinition:e})));this.children.addMany(n)}render(){super.render(),dp.toggleMenusAndFocusItemsOnHover(this),dp.closeMenusWhenTheBarCloses(this),dp.closeMenuWhenAnotherOnTheSameLevelOpens(this),dp.focusCycleMenusOnArrows(this),dp.closeOnClickOutside(this),dp.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}registerMenu(e,t=null){t?(e.delegate(...qp).to(t),e.parentMenuView=t):e.delegate(...qp).to(this,(e=>"menu:"+e)),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){const n=this.locale,r=new Wp(n);return this.registerMenu(r,i),r.buttonView.set({label:t.label}),r.once("change:isOpen",(()=>{const i=new $p(n);i.ariaLabel=t.label,r.panelView.children.add(i),i.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:r,componentFactory:e}))})),r}_createMenuItems({menuDefinition:t,parentMenuView:i,componentFactory:n}){const r=this.locale,s=[];for(const o of t.groups){for(const t of o.items){const o=new hp(r,i);if(e(t))o.children.add(this._createMenu({componentFactory:n,menuDefinition:t,parentMenuView:i}));else{const e=this._createMenuItemContentFromFactory({componentName:t,componentFactory:n,parentMenuView:i});if(!e)continue;o.children.add(e)}s.push(o)}o!==t.groups[t.groups.length-1]&&s.push(new lf(r))}return s}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){const n=i.create(e);return n instanceof Wp||n instanceof Vg||n instanceof jp?(this._registerMenuTree(n,t),n.on("execute",(()=>{this.close()})),n):(fn("menu-bar-component-unsupported",{componentName:e,componentView:n}),null)}_registerMenuTree(e,t){if(!(e instanceof Wp))return void e.delegate("mouseenter").to(t);this.registerMenu(e,t);const i=e.panelView.children.filter((e=>e instanceof $p))[0];if(!i)return void e.delegate("mouseenter").to(t);const n=i.items.filter((e=>e instanceof af));for(const t of n)this._registerMenuTree(t.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",((t,i,n)=>{clearTimeout(e),n?this.isOpen=!0:e=setTimeout((()=>{this.isOpen=Array.from(this.children).some((e=>e.isOpen))}),0)}))}}const Kp=["left","right","center","justify"];function Zp(e){return Kp.includes(e)}function Jp(e,t){return"rtl"==t.contentLanguageDirection?"right"===e:"left"===e}function Qp(e){const t=e.map((e=>{let t;return t="string"==typeof e?{name:e}:e,t})).filter((e=>{const t=Kp.includes(e.name);return t||fn("alignment-config-name-not-recognized",{option:e}),t})),i=t.filter((e=>Boolean(e.className))).length;if(i&&i{const r=n.slice(i+1);if(r.some((e=>e.name==t.name)))throw new gn("alignment-config-name-already-defined",{option:t,configuredOptions:e});if(t.className){if(r.some((e=>e.className==t.className)))throw new gn("alignment-config-classname-already-defined",{option:t,configuredOptions:e})}})),t}const Yp="alignment";class Xp extends xu{refresh(){const e=this.editor.locale,t=ts(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=Boolean(t)&&this._canBeAligned(t),this.isEnabled&&t.hasAttribute("alignment")?this.value=t.getAttribute("alignment"):this.value="rtl"===e.contentLanguageDirection?"right":"left"}execute(e={}){const t=this.editor,i=t.locale,n=t.model,r=n.document,s=e.value;n.change((e=>{const t=Array.from(r.selection.getSelectedBlocks()).filter((e=>this._canBeAligned(e))),n=t[0].getAttribute("alignment");Jp(s,i)||n===s||!s?function(e,t){for(const i of e)t.removeAttribute(Yp,i)}(t,e):function(e,t,i){for(const n of e)t.setAttribute(Yp,i,n)}(t,e,s)}))}_canBeAligned(e){return this.editor.model.schema.checkAttribute(e,Yp)}}class ew extends ku{static get pluginName(){return"AlignmentEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("alignment",{options:Kp.map((e=>({name:e})))})}init(){const e=this.editor,t=e.locale,i=e.model.schema,n=Qp(e.config.get("alignment.options")).filter((e=>Zp(e.name)&&!Jp(e.name,t))),r=n.some((e=>!!e.className));i.extend("$block",{allowAttributes:"alignment"}),e.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),r?e.conversion.attributeToAttribute(function(e){const t={};for(const i of e)t[i.name]={key:"class",value:i.className};const i={model:{key:"alignment",values:e.map((e=>e.name))},view:t};return i}(n)):e.conversion.for("downcast").attributeToAttribute(function(e){const t={};for(const{name:i}of e)t[i]={key:"style",value:{"text-align":i}};const i={model:{key:"alignment",values:e.map((e=>e.name))},view:t};return i}(n));const s=function(e){const t=[];for(const{name:i}of e)t.push({view:{key:"style",value:{"text-align":i}},model:{key:"alignment",value:i}});return t}(n);for(const t of s)e.conversion.for("upcast").attributeToAttribute(t);const o=function(e){const t=[];for(const{name:i}of e)t.push({view:{key:"align",value:i},model:{key:"alignment",value:i}});return t}(n);for(const t of o)e.conversion.for("upcast").attributeToAttribute(t);e.commands.add("alignment",new Xp(e))}}const tw=(()=>new Map([["left",ju.alignLeft],["right",ju.alignRight],["center",ju.alignCenter],["justify",ju.alignJustify]]))();class iw extends ku{get localizedOptionTitles(){const e=this.editor.t;return{left:e("Align left"),right:e("Align right"),center:e("Align center"),justify:e("Justify")}}static get pluginName(){return"AlignmentUI"}static get isOfficialPlugin(){return!0}init(){const e=Qp(this.editor.config.get("alignment.options"));e.map((e=>e.name)).filter(Zp).forEach((e=>this._addButton(e))),this._addToolbarDropdown(e),this._addMenuBarMenu(e)}_addButton(e){this.editor.ui.componentFactory.add(`alignment:${e}`,(t=>this._createButton(t,e)))}_createButton(e,t,i={}){const n=this.editor,r=n.commands.get("alignment"),s=new hg(e);return s.set({label:this.localizedOptionTitles[t],icon:tw.get(t),tooltip:!0,isToggleable:!0,...i}),s.bind("isEnabled").to(r),s.bind("isOn").to(r,"value",(e=>e===t)),this.listenTo(s,"execute",(()=>{n.execute("alignment",{value:t}),n.editing.view.focus()})),s}_addToolbarDropdown(e){const t=this.editor;t.ui.componentFactory.add("alignment",(i=>{const n=xf(i),r="rtl"===i.uiLanguageDirection?"w":"e",s=i.t;Af(n,(()=>e.map((e=>this._createButton(i,e.name,{tooltipPosition:r})))),{enableActiveItemFocusOnDropdownOpen:!0,isVertical:!0,ariaLabel:s("Text alignment toolbar")}),n.buttonView.set({label:s("Text alignment"),tooltip:!0}),n.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const o="rtl"===i.contentLanguageDirection?tw.get("right"):tw.get("left"),a=t.commands.get("alignment");return n.buttonView.bind("icon").to(a,"value",(e=>tw.get(e)||o)),n.bind("isEnabled").to(a,"isEnabled"),this.listenTo(n,"execute",(()=>{t.editing.view.focus()})),n}))}_addMenuBarMenu(e){const t=this.editor;t.ui.componentFactory.add("menuBar:alignment",(i=>{const n=t.commands.get("alignment"),r=i.t,s=new Wp(i),o=new $p(i);s.bind("isEnabled").to(n),o.set({ariaLabel:r("Text alignment"),role:"menu"}),s.buttonView.set({label:r("Text alignment")});for(const r of e){const e=new hp(i,s),a=new Vg(i);a.delegate("execute").to(s),a.set({label:this.localizedOptionTitles[r.name],icon:tw.get(r.name),role:"menuitemcheckbox",isToggleable:!0}),a.on("execute",(()=>{t.execute("alignment",{value:r.name}),t.editing.view.focus()})),a.bind("isOn").to(n,"value",(e=>e===r.name)),a.bind("isEnabled").to(n,"isEnabled"),e.children.add(a),o.items.add(e)}return s.panelView.children.add(o),s}))}}class nw{model;limit;_isLocked;_size;_batch=null;_changeCallback;_selectionChangeCallback;constructor(e,t=20){this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(e,t)=>{t.isLocal&&t.isUndoable&&t!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}lock(){this._isLocked=!0}unlock(){this._isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(e=!1){this.isLocked&&!e||(this._batch=null,this._size=0)}}class rw extends xu{_buffer;constructor(e,t){super(e),this._buffer=new nw(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){const t=this.editor.model,i=t.document,n=e.text||"",r=n.length;let s=i.selection;if(e.selection?s=e.selection:e.range&&(s=t.createSelection(e.range)),!t.canEditAt(s))return;const o=e.resultRange;t.enqueueChange(this._buffer.batch,(e=>{this._buffer.lock();const a=Array.from(i.selection.getAttributes());t.deleteContent(s),n&&t.insertContent(e.createText(n,a),s),o?e.setSelection(o):s.is("documentSelection")||e.setSelection(s),this._buffer.unlock(),this._buffer.input(r)}))}}const sw=["insertText","insertReplacementText"],ow=[...sw,"insertCompositionText"];class aw extends rl{focusObserver;constructor(e){super(e),this.focusObserver=e.getObserver(dl);const t=Ki.isAndroid?ow:sw,i=e.document;i.on("beforeinput",((n,r)=>{if(!this.isEnabled)return;const{data:s,targetRanges:o,inputType:a,domEvent:l}=r;if(!t.includes(a))return;this.focusObserver.flush();const c=new ln(i,"insertText");i.fire(c,new sl(e,l,{text:s,selection:e.createSelection(o)})),c.stop.called&&n.stop()})),Ki.isAndroid||i.on("compositionend",((t,{data:n,domEvent:r})=>{this.isEnabled&&n&&i.fire("insertText",new sl(e,r,{text:n}))}),{priority:"lowest"})}observe(){}stopObserving(){}}class lw extends ku{_compositionQueue;static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model,i=e.editing.view,n=e.editing.mapper,r=t.document.selection;this._compositionQueue=new cw(e),i.addObserver(aw);const s=new rw(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",s),e.commands.add("input",s),this.listenTo(i.document,"insertText",((s,o)=>{i.document.isComposing||o.preventDefault(),Ki.isAndroid&&i.document.isComposing&&this._compositionQueue.flush("next beforeinput");const{text:a,selection:l}=o;let c;c=l?Array.from(l.getRanges()).map((e=>n.toModelRange(e))):Array.from(r.getRanges());let h=a;if(Ki.isAndroid){const e=Array.from(c[0].getItems()).reduce(((e,t)=>e+(t.is("$textProxy")?t.data:"")),"");if(e&&(e.length<=h.length?h.startsWith(e)&&(h=h.substring(e.length),c[0].start=c[0].start.getShiftedBy(e.length)):e.startsWith(h)&&(c[0].start=c[0].start.getShiftedBy(h.length),h="")),0==h.length&&c[0].isCollapsed)return}const d={text:h,selection:t.createSelection(c)};Ki.isAndroid&&i.document.isComposing?this._compositionQueue.push(d):(e.execute("insertText",d),i.scrollToTheSelection())})),Ki.isAndroid?this.listenTo(i.document,"keydown",((e,n)=>{!r.isCollapsed&&229==n.keyCode&&i.document.isComposing&&hw(t,s)})):this.listenTo(i.document,"compositionstart",(()=>{r.isCollapsed||hw(t,s)})),Ki.isAndroid?(this.listenTo(i.document,"mutations",((e,{mutations:t})=>{if(i.document.isComposing)for(const{node:e}of t){const t=dw(e,n),i=n.toModelElement(t);if(this._compositionQueue.isComposedElement(i))return void this._compositionQueue.flush("mutations")}})),this.listenTo(i.document,"compositionend",(()=>{this._compositionQueue.flush("composition end")})),this.listenTo(i.document,"compositionend",(()=>{const e=[];for(const t of this._compositionQueue.flushComposedElements()){const i=n.toViewElement(t);i&&e.push({type:"children",node:i})}e.length&&i.document.fire("mutations",{mutations:e})}),{priority:"lowest"})):this.listenTo(i.document,"compositionend",(()=>{i.document.fire("mutations",{mutations:[]})}),{priority:"lowest"})}destroy(){super.destroy(),this._compositionQueue.destroy()}}class cw{editor;flushDebounced=no((()=>this.flush("timeout")),50);_queue=[];_compositionElements=new Set;constructor(e){this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._compositionElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e){const t={text:e.text};if(e.selection){t.selectionRanges=[];for(const i of e.selection.getRanges())t.selectionRanges.push(Kl.fromRange(i)),this._compositionElements.add(i.start.parent)}this._queue.push(t),this.flushDebounced()}shift(){const e=this._queue.shift(),t={text:e.text};if(e.selectionRanges){const i=e.selectionRanges.map((e=>function(e){const t=e.toRange();if(e.detach(),"$graveyard"==t.root.rootName)return null;return t}(e))).filter((e=>!!e));i.length&&(t.selection=this.editor.model.createSelection(i))}return t}flush(e){const t=this.editor,i=t.model,n=t.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;const r=t.commands.get("insertText").buffer;i.enqueueChange(r.batch,(()=>{for(r.lock();this._queue.length;){const e=this.shift();t.execute("insertText",e)}r.unlock()})),n.scrollToTheSelection()}isComposedElement(e){return this._compositionElements.has(e)}flushComposedElements(){const e=Array.from(this._compositionElements);return this._compositionElements.clear(),e}}function hw(e,t){if(!t.isEnabled)return;const i=t.buffer;i.lock(),e.enqueueChange(i.batch,(()=>{e.deleteContent(e.document.selection)})),i.unlock()}function dw(e,t){let i=e.is("$text")?e.parent:e;for(;!t.toModelElement(i);)i=i.parent;return i}class uw extends xu{direction;_buffer;constructor(e,t){super(e),this.direction=t,this._buffer=new nw(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){const t=this.editor.model,i=t.document;t.enqueueChange(this._buffer.batch,(n=>{this._buffer.lock();const r=n.createSelection(e.selection||i.selection);if(!t.canEditAt(r))return;const s=e.sequence||1,o=r.isCollapsed;if(r.isCollapsed&&t.modifySelection(r,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s))return void this._replaceEntireContentWithParagraph(n);if(this._shouldReplaceFirstBlockWithParagraph(r,s))return void this.editor.execute("paragraph",{selection:r});if(r.isCollapsed)return;let a=0;r.getFirstRange().getMinimalFlatRanges().forEach((e=>{a+=jn(e.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))})),t.deleteContent(r,{doNotResetEntireContent:o,direction:this.direction}),this._buffer.input(a),n.setSelection(r),this._buffer.unlock()}))}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;const t=this.editor.model,i=t.document.selection,n=t.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(n)))return!1;if(!t.schema.checkChild(n,"paragraph"))return!1;const r=n.getChild(0);return!r||!r.is("element","paragraph")}_replaceEntireContentWithParagraph(e){const t=this.editor.model,i=t.document.selection,n=t.schema.getLimitElement(i),r=e.createElement("paragraph");e.remove(e.createRangeIn(n)),e.insert(r,n),e.setSelection(r,0)}_shouldReplaceFirstBlockWithParagraph(e,t){const i=this.editor.model;if(t>1||"backward"!=this.direction)return!1;if(!e.isCollapsed)return!1;const n=e.getFirstPosition(),r=i.schema.getLimitElement(n),s=r.getChild(0);return n.parent==s&&(!!e.containsEntireContent(s)&&(!!i.schema.checkChild(r,"paragraph")&&"paragraph"!=s.name))}}const mw="word",gw="selection",fw="backward",pw="forward",ww={deleteContent:{unit:gw,direction:fw},deleteContentBackward:{unit:"codePoint",direction:fw},deleteWordBackward:{unit:mw,direction:fw},deleteHardLineBackward:{unit:gw,direction:fw},deleteSoftLineBackward:{unit:gw,direction:fw},deleteContentForward:{unit:"character",direction:pw},deleteWordForward:{unit:mw,direction:pw},deleteHardLineForward:{unit:gw,direction:pw},deleteSoftLineForward:{unit:gw,direction:pw}};class bw extends rl{constructor(e){super(e);const t=e.document;let i=0;t.on("keydown",(()=>{i++})),t.on("keyup",(()=>{i=0})),t.on("beforeinput",((n,r)=>{if(!this.isEnabled)return;const{targetRanges:s,domEvent:o,inputType:a}=r,l=ww[a];if(!l)return;const c={direction:l.direction,unit:l.unit,sequence:i};c.unit==gw&&(c.selectionToRemove=e.createSelection(s[0])),"deleteContentBackward"===a&&(Ki.isAndroid&&(c.sequence=1),function(e){if(1!=e.length||e[0].isCollapsed)return!1;const t=e[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0});let i=0;for(const{nextPosition:e,item:n}of t){if(e.parent.is("$text")){const t=e.parent.data,n=e.offset;if(ds(t,n)||us(t,n)||gs(t,n))continue;i++}else(n.is("containerElement")||n.is("emptyElement"))&&i++;if(i>1)return!0}return!1}(s)&&(c.unit=gw,c.selectionToRemove=e.createSelection(s)));const h=new sa(t,"delete",s[0]);t.fire(h,new sl(e,o,c)),h.stop.called&&n.stop()})),Ki.isBlink&&function(e){const t=e.view,i=t.document;let n=null,r=!1;function s(e){return e==Wr.backspace||e==Wr.delete}function o(e){return e==Wr.backspace?fw:pw}i.on("keydown",((e,{keyCode:t})=>{n=t,r=!1})),i.on("keyup",((a,{keyCode:l,domEvent:c})=>{const h=i.selection,d=e.isEnabled&&l==n&&s(l)&&!h.isCollapsed&&!r;if(n=null,d){const e=h.getFirstRange(),n=new sa(i,"delete",e),r={unit:gw,direction:o(l),selectionToRemove:h};i.fire(n,new sl(t,c,r))}})),i.on("beforeinput",((e,{inputType:t})=>{const i=ww[t];s(n)&&i&&i.direction==o(n)&&(r=!0)}),{priority:"high"}),i.on("beforeinput",((e,{inputType:t,data:i})=>{n==Wr.delete&&"insertText"==t&&""==i&&e.stop()}),{priority:"high"})}(this)}observe(){}stopObserving(){}}class _w extends ku{_undoOnBackspace;static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,n=e.model.document;t.addObserver(bw),this._undoOnBackspace=!1;const r=new uw(e,"forward");e.commands.add("deleteForward",r),e.commands.add("forwardDelete",r),e.commands.add("delete",new uw(e,"backward")),this.listenTo(i,"delete",((n,r)=>{i.isComposing||r.preventDefault();const{direction:s,sequence:o,selectionToRemove:a,unit:l}=r,c="forward"===s?"deleteForward":"delete",h={sequence:o};if("selection"==l){const t=Array.from(a.getRanges()).map((t=>e.editing.mapper.toModelRange(t)));h.selection=e.model.createSelection(t)}else h.unit=l;e.execute(c,h),t.scrollToTheSelection()}),{priority:"low"}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",((t,i)=>{this._undoOnBackspace&&"backward"==i.direction&&1==i.sequence&&"codePoint"==i.unit&&(this._undoOnBackspace=!1,e.execute("undo"),i.preventDefault(),t.stop())}),{context:"$capture"}),this.listenTo(n,"change",(()=>{this._undoOnBackspace=!1})))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}}class vw extends ku{static get requires(){return[lw,_w]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}}function yw(e,t){let i=e.start;return{text:Array.from(e.getWalker({ignoreElementEnd:!1})).reduce(((e,{item:n})=>n.is("$text")||n.is("$textProxy")?e+n.data:(i=t.createPositionAfter(n),"")),""),range:t.createRange(i,e.end)}}class kw extends(Ln()){model;testCallback;_hasMatch;constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",(()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))})),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){const e=this.model.document;this.listenTo(e.selection,"change:range",((t,{directChange:i})=>{i&&(e.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1))})),this.listenTo(e,"change:data",((e,t)=>{!t.isUndo&&t.isLocal&&this._evaluateTextBeforeSelection("data",{batch:t})}))}_evaluateTextBeforeSelection(e,t={}){const i=this.model,n=i.document.selection,r=i.createRange(i.createPositionAt(n.focus.parent,0),n.focus),{text:s,range:o}=yw(r,i),a=this.testCallback(s);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){const i=Object.assign(t,{text:s,range:o});"object"==typeof a&&Object.assign(i,a),this.fire(`matched:${e}`,i)}}}class Cw extends ku{attributes;_overrideUid;_isNextGravityRestorationSkipped=!1;static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){const e=this.editor,t=e.model,i=e.editing.view,n=e.locale,r=t.document.selection;this.listenTo(i.document,"arrowKey",((e,t)=>{if(!r.isCollapsed)return;if(t.shiftKey||t.altKey||t.ctrlKey)return;const i=t.keyCode==Wr.arrowright,s=t.keyCode==Wr.arrowleft;if(!i&&!s)return;const o=n.contentLanguageDirection;let a=!1;a="ltr"===o&&i||"rtl"===o&&s?this._handleForwardMovement(t):this._handleBackwardMovement(t),!0===a&&e.stop()}),{context:"$text",priority:"highest"}),this.listenTo(r,"change:range",((e,t)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!t.directChange&&Pw(r.getFirstPosition(),this.attributes)||this._restoreGravity())})),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){const t=this.attributes,i=this.editor.model,n=i.document.selection,r=n.getFirstPosition();return!this._isGravityOverridden&&((!r.isAtStart||!xw(n,t))&&(!!Pw(r,t)&&(Ew(e),xw(n,t)&&Pw(r,t,!0)?Tw(i,t):this._overrideGravity(),!0)))}_handleBackwardMovement(e){const t=this.attributes,i=this.editor.model,n=i.document.selection,r=n.getFirstPosition();return this._isGravityOverridden?(Ew(e),this._restoreGravity(),Pw(r,t,!0)?Tw(i,t):Aw(i,t,r),!0):r.isAtStart?!!xw(n,t)&&(Ew(e),Aw(i,t,r),!0):!xw(n,t)&&Pw(r,t,!0)?(Ew(e),Aw(i,t,r),!0):!!Sw(r,t)&&(r.isAtEnd&&!xw(n,t)&&Pw(r,t)?(Ew(e),Aw(i,t,r),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1))}_enableClickingAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,n=e.editing.view.document;e.editing.view.addObserver(Cd);let r=!1;this.listenTo(n,"mousedown",(()=>{r=!0})),this.listenTo(n,"selectionChange",(()=>{const e=this.attributes;if(!r)return;if(r=!1,!i.isCollapsed)return;if(!xw(i,e))return;const n=i.getFirstPosition();Pw(n,e)&&(n.isAtStart||Pw(n,e,!0)?Tw(t,e):this._isGravityOverridden||this._overrideGravity())}))}_enableInsertContentSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection,i=this.attributes;this.listenTo(e,"insertContent",(()=>{const n=t.getFirstPosition();xw(t,i)&&Pw(n,i)&&Tw(e,i)}),{priority:"low"})}_handleDeleteContentAfterNode(){const e=this.editor,t=e.model,i=t.document.selection,n=e.editing.view;let r=!1,s=!1;this.listenTo(n.document,"delete",((e,t)=>{r="backward"===t.direction}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{if(!r)return;const e=i.getFirstPosition();s=xw(i,this.attributes)&&!Sw(e,this.attributes)}),{priority:"high"}),this.listenTo(t,"deleteContent",(()=>{r&&(r=!1,s||e.model.enqueueChange((()=>{const e=i.getFirstPosition();xw(i,this.attributes)&&Pw(e,this.attributes)&&(e.isAtStart||Pw(e,this.attributes,!0)?Tw(t,this.attributes):this._isGravityOverridden||this._overrideGravity())})))}),{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change((e=>e.overrideSelectionGravity()))}_restoreGravity(){this.editor.model.change((e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null}))}}function xw(e,t){for(const i of t)if(e.hasAttribute(i))return!0;return!1}function Aw(e,t,i){const n=i.nodeBefore;e.change((i=>{if(n){const t=[],r=e.schema.isObject(n)&&e.schema.isInline(n);for(const[i,s]of n.getAttributes())!e.schema.checkAttribute("$text",i)||r&&!1===e.schema.getAttributeProperties(i).copyFromObject||t.push([i,s]);i.setSelectionAttribute(t)}else i.removeSelectionAttribute(t)}))}function Tw(e,t){e.change((e=>{e.removeSelectionAttribute(t)}))}function Ew(e){e.preventDefault()}function Sw(e,t){return Pw(e.getShiftedBy(-1),t)}function Pw(e,t,i=!1){const{nodeBefore:n,nodeAfter:r}=e;for(const e of t){const t=n?n.getAttribute(e):void 0,s=r?r.getAttribute(e):void 0;if((!i||void 0!==t&&void 0!==s)&&s!==t)return!0}return!1}const Iw={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"½",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"⅓",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"⅔",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"¼",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"¾",null]},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Mw('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Mw("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Mw("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Mw('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Mw('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Mw("'"),to:[null,"‚",null,"’"]}},Vw={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},Rw=["symbols","mathematical","typography","quotes"];function Bw(e){return"string"==typeof e?new RegExp(`(${Yu(e)})$`):e}function Ow(e){return"string"==typeof e?()=>[e]:e instanceof Array?()=>e:e}function Fw(e){return(e.textNode?e.textNode:e.nodeAfter).getAttributes()}function Mw(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}function Nw(e,t,i,n){return n.createRange(Lw(e,t,i,!0,n),Lw(e,t,i,!1,n))}function Lw(e,t,i,n,r){let s=e.textNode||(n?e.nodeBefore:e.nodeAfter),o=null;for(;s&&s.getAttribute(t)==i;)o=s,s=n?s.previousSibling:s.nextSibling;return o?r.createPositionAt(o,n?"before":"after"):e}function Dw(e,t,i,n){const r=e.editing.view,s=new Set;r.document.registerPostFixer((r=>{const o=e.model.document.selection;let a=!1;if(o.hasAttribute(t)){const l=Nw(o.getFirstPosition(),t,o.getAttribute(t),e.model),c=e.editing.mapper.toViewRange(l);for(const e of c.getItems())e.is("element",i)&&!e.hasClass(n)&&(r.addClass(n,e),s.add(e),a=!0)}return a})),e.conversion.for("editingDowncast").add((e=>{function t(){r.change((e=>{for(const t of s.values())e.removeClass(n,t),s.delete(t)}))}e.on("insert",t,{priority:"highest"}),e.on("remove",t,{priority:"highest"}),e.on("attribute",t,{priority:"highest"}),e.on("selection",t,{priority:"highest"})}))}function zw(e,t,i,n){let r,s=null;"function"==typeof n?r=n:(s=e.commands.get(n),r=()=>{e.execute(n)}),e.model.document.on("change:data",((o,a)=>{if(s&&!s.isEnabled||!t.isEnabled)return;const l=ts(e.model.document.selection.getRanges());if(!l.isCollapsed)return;if(a.isUndo||!a.isLocal)return;const c=Array.from(e.model.document.differ.getChanges()),h=c[0];if(1!=c.length||"insert"!==h.type||"$text"!=h.name||1!=h.length)return;const d=h.position.parent;if(d.is("element","codeBlock"))return;if(d.is("element","listItem")&&"function"!=typeof n&&!["numberedList","bulletedList","todoList"].includes(n))return;if(s&&!0===s.value)return;const u=d.getChild(0),m=e.model.createRangeOn(u);if(!m.containsRange(l)&&!l.end.isEqual(m.end))return;const g=i.exec(u.data.substr(0,l.end.offset));g&&e.model.enqueueChange((t=>{const i=t.createPositionAt(d,0),n=t.createPositionAt(d,g[0].length),s=new Kl(i,n);if(!1!==r({match:g})){t.remove(s);const i=e.model.document.selection.getFirstRange(),n=t.createRangeIn(d);!d.isEmpty||n.isEqual(i)||n.containsRange(i,!0)||t.remove(d)}s.detach(),e.model.enqueueChange((()=>{e.plugins.get("Delete").requestUndoOnBackspace()}))}))}))}function Hw(e,t,i,n){let r,s;i instanceof RegExp?r=i:s=i,s=s||(e=>{let t;const i=[],n=[];for(;null!==(t=r.exec(e))&&!(t&&t.length<4);){let{index:e,1:r,2:s,3:o}=t;const a=r+s+o;e+=t[0].length-a.length;const l=[e,e+r.length],c=[e+r.length+s.length,e+r.length+s.length+o.length];i.push(l),i.push(c),n.push([e+r.length,e+r.length+s.length])}return{remove:i,format:n}}),e.model.document.on("change:data",((i,r)=>{if(r.isUndo||!r.isLocal||!t.isEnabled)return;const o=e.model,a=o.document.selection;if(!a.isCollapsed)return;const l=Array.from(o.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const h=a.focus,d=h.parent,{text:u,range:m}=function(e,t){let i=e.start;const n=Array.from(e.getItems()).reduce(((e,n)=>!n.is("$text")&&!n.is("$textProxy")||n.getAttribute("code")?(i=t.createPositionAfter(n),""):e+n.data),"");return{text:n,range:t.createRange(i,e.end)}}(o.createRange(o.createPositionAt(d,0),h),o),g=s(u),f=Ww(m.start,g.format,o),p=Ww(m.start,g.remove,o);f.length&&p.length&&o.enqueueChange((t=>{if(!1!==n(t,f)){for(const e of p.reverse())t.remove(e);o.enqueueChange((()=>{e.plugins.get("Delete").requestUndoOnBackspace()}))}}))}))}function Ww(e,t,i){return t.filter((e=>void 0!==e[0]&&void 0!==e[1])).map((t=>i.createRange(e.getShiftedBy(t[0]),e.getShiftedBy(t[1]))))}class $w extends ku{static get requires(){return[_w]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){const e=this.editor,t=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){const e=this.editor.commands;e.get("bulletedList")&&zw(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")&&zw(this.editor,this,/^1[.|)]\s$/,"numberedList"),e.get("todoList")&&zw(this.editor,this,/^\[\s?\]\s$/,"todoList"),e.get("checkTodoList")&&zw(this.editor,this,/^\[\s?x\s?\]\s$/,(()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")}))}_addBasicStylesAutoformats(){const e=this.editor.commands;if(e.get("bold")){const e=Uw(this.editor,"bold");Hw(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,e),Hw(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,e)}if(e.get("italic")){const e=Uw(this.editor,"italic");Hw(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,e),Hw(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,e)}if(e.get("code")){const e=Uw(this.editor,"code");Hw(this.editor,this,/(`)([^`]+)(`)$/g,e)}if(e.get("strikethrough")){const e=Uw(this.editor,"strikethrough");Hw(this.editor,this,/(~~)([^~]+)(~~)$/g,e)}}_addHeadingAutoformats(){const e=this.editor.commands.get("heading");e&&e.modelElements.filter((e=>e.match(/^heading[1-6]$/))).forEach((t=>{const i=t[7],n=new RegExp(`^(#{${i}})\\s$`);zw(this.editor,this,n,(()=>{if(!e.isEnabled||e.value===t)return!1;this.editor.execute("heading",{value:t})}))}))}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&zw(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){const e=this.editor,t=e.model.document.selection;e.commands.get("codeBlock")&&zw(e,this,/^```$/,(()=>{if(t.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})}))}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&zw(this.editor,this,/^---$/,"horizontalLine")}}function Uw(e,t){return(i,n)=>{if(!e.commands.get(t).isEnabled)return!1;const r=e.model.schema.getValidRanges(n,t);for(const e of r)i.setAttribute(t,!0,e);i.removeSelectionAttribute(t)}}class jw extends xu{attributeKey;constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,n=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(i.isCollapsed)n?e.setSelectionAttribute(this.attributeKey,!0):e.removeSelectionAttribute(this.attributeKey);else{const r=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of r)n?e.setAttribute(this.attributeKey,n,t):e.removeAttribute(this.attributeKey,t)}}))}_getValueFromFirstAllowedNode(){const e=this.editor.model,t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const e of i.getRanges())for(const i of e.getItems())if(t.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}const qw="bold";class Gw extends ku{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:qw}),e.model.schema.setAttributeProperties(qw,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:qw,view:"strong",upcastAlso:["b",e=>{const t=e.getStyle("font-weight");return t&&("bold"==t||Number(t)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(qw,new jw(e,qw)),e.keystrokes.set("CTRL+B",qw),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}}function Kw({editor:e,commandName:t,plugin:i,icon:n,label:r,keystroke:s}){return o=>{const a=e.commands.get(t),l=new o(e.locale);return l.set({label:r,icon:n,keystroke:s,isToggleable:!0}),l.bind("isEnabled").to(a,"isEnabled"),l.bind("isOn").to(a,"value"),l instanceof Vg?l.set({role:"menuitemcheckbox"}):l.set({tooltip:!0}),i.listenTo(l,"execute",(()=>{e.execute(t),e.editing.view.focus()})),l}}const Zw="bold";class Jw extends ku{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Kw({editor:e,commandName:Zw,plugin:this,icon:ju.bold,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(Zw,(()=>i(hg))),e.ui.componentFactory.add("menuBar:"+Zw,(()=>i(Vg)))}}const Qw="code";class Yw extends ku{static get pluginName(){return"CodeEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Cw]}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Qw}),e.model.schema.setAttributeProperties(Qw,{isFormatting:!0,copyOnEnter:!1}),e.conversion.attributeToElement({model:Qw,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),e.commands.add(Qw,new jw(e,Qw)),e.plugins.get(Cw).registerAttribute(Qw),Dw(e,Qw,"code","ck-code_selected"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}}const Xw="code";class eb extends ku{static get pluginName(){return"CodeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Kw({editor:e,commandName:Xw,plugin:this,icon:'',label:t("Code")});e.ui.componentFactory.add(Xw,(()=>i(hg))),e.ui.componentFactory.add("menuBar:"+Xw,(()=>i(Vg)))}}const tb="italic";class ib extends ku{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:tb}),e.model.schema.setAttributeProperties(tb,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:tb,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(tb,new jw(e,tb)),e.keystrokes.set("CTRL+I",tb),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}}const nb="italic";class rb extends ku{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Kw({editor:e,commandName:nb,plugin:this,icon:'',keystroke:"CTRL+I",label:t("Italic")});e.ui.componentFactory.add(nb,(()=>i(hg))),e.ui.componentFactory.add("menuBar:"+nb,(()=>i(Vg)))}}const sb="strikethrough";class ob extends ku{static get pluginName(){return"StrikethroughEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:sb}),e.model.schema.setAttributeProperties(sb,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:sb,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(sb,new jw(e,sb)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}}const ab="strikethrough";class lb extends ku{static get pluginName(){return"StrikethroughUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Kw({editor:e,commandName:ab,plugin:this,icon:'',keystroke:"CTRL+SHIFT+X",label:t("Strikethrough")});e.ui.componentFactory.add(ab,(()=>i(hg))),e.ui.componentFactory.add("menuBar:"+ab,(()=>i(Vg)))}}const cb="subscript";class hb extends ku{static get pluginName(){return"SubscriptEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:cb}),e.model.schema.setAttributeProperties(cb,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:cb,view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),e.commands.add(cb,new jw(e,cb))}}const db="subscript";class ub extends ku{static get pluginName(){return"SubscriptUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Kw({editor:e,commandName:db,plugin:this,icon:'',label:t("Subscript")});e.ui.componentFactory.add(db,(()=>i(hg))),e.ui.componentFactory.add("menuBar:"+db,(()=>i(Vg)))}}const mb="superscript";class gb extends ku{static get pluginName(){return"SuperscriptEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:mb}),e.model.schema.setAttributeProperties(mb,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:mb,view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),e.commands.add(mb,new jw(e,mb))}}const fb="superscript";class pb extends ku{static get pluginName(){return"SuperscriptUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Kw({editor:e,commandName:fb,plugin:this,icon:'',label:t("Superscript")});e.ui.componentFactory.add(fb,(()=>i(hg))),e.ui.componentFactory.add("menuBar:"+fb,(()=>i(Vg)))}}const wb="underline";class bb extends ku{static get pluginName(){return"UnderlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:wb}),e.model.schema.setAttributeProperties(wb,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:wb,view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),e.commands.add(wb,new jw(e,wb)),e.keystrokes.set("CTRL+U","underline"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Underline text"),keystroke:"CTRL+U"}]})}}const _b="underline";class vb extends ku{static get pluginName(){return"UnderlineUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t,i=Kw({editor:e,commandName:_b,plugin:this,icon:'',label:t("Underline"),keystroke:"CTRL+U"});e.ui.componentFactory.add(_b,(()=>i(hg))),e.ui.componentFactory.add("menuBar:"+_b,(()=>i(Vg)))}}function*yb(e,t){for(const i of t)i&&e.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class kb extends xu{execute(){this.editor.model.change((e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})}))}enterBlock(e){const t=this.editor.model,i=t.document.selection,n=t.schema,r=i.isCollapsed,s=i.getFirstRange(),o=s.start.parent,a=s.end.parent;if(n.isLimit(o)||n.isLimit(a))return r||o!=a||t.deleteContent(i),!1;if(r){const t=yb(e.model.schema,i.getAttributes());return Cb(e,s.start),e.setSelectionAttribute(t),!0}{const n=!(s.start.isAtStart&&s.end.isAtEnd),r=o==a;if(t.deleteContent(i,{leaveUnmerged:n}),n){if(r)return Cb(e,i.focus),!0;e.setSelection(a,0)}}return!1}}function Cb(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}const xb={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}};class Ab extends rl{constructor(e){super(e);const t=this.document;let i=!1;t.on("keydown",((e,t)=>{i=t.shiftKey})),t.on("beforeinput",((n,r)=>{if(!this.isEnabled)return;let s=r.inputType;Ki.isSafari&&i&&"insertParagraph"==s&&(s="insertLineBreak");const o=r.domEvent,a=xb[s];if(!a)return;const l=new sa(t,"enter",r.targetRanges[0]);t.fire(l,new sl(e,o,{isSoft:a.isSoft})),l.stop.called&&n.stop()}))}observe(){}stopObserving(){}}class Tb extends ku{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=t.document,n=this.editor.t;t.addObserver(Ab),e.commands.add("enter",new kb(e)),this.listenTo(i,"enter",((n,r)=>{i.isComposing||r.preventDefault(),r.isSoft||(e.execute("enter"),t.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}}class Eb extends xu{execute(){const e=this.editor.model,t=e.document;e.change((i=>{!function(e,t,i){const n=i.isCollapsed,r=i.getFirstRange(),s=r.start.parent,o=r.end.parent,a=s==o;if(n){const n=yb(e.schema,i.getAttributes());Sb(e,t,r.end),t.removeSelectionAttribute(i.getAttributeKeys()),t.setSelectionAttribute(n)}else{const n=!(r.start.isAtStart&&r.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:n}),a?Sb(e,t,i.focus):n&&t.setSelection(o,0)}}(e,i,t.selection),this.fire("afterExecute",{writer:i})}))}refresh(){const e=this.editor.model,t=e.document;this.isEnabled=function(e,t){if(t.rangeCount>1)return!1;const i=t.anchor;if(!i||!e.checkChild(i,"softBreak"))return!1;const n=t.getFirstRange(),r=n.start.parent,s=n.end.parent;if((Pb(r,e)||Pb(s,e))&&r!==s)return!1;return!0}(e.schema,t.selection)}}function Sb(e,t,i){const n=t.createElement("softBreak");e.insertContent(n,i),t.setSelection(n,"after")}function Pb(e,t){return!e.is("rootElement")&&(t.isLimit(e)||Pb(e.parent,t))}class Ib extends ku{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.conversion,n=e.editing.view,r=n.document,s=this.editor.t;t.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(e,{writer:t})=>t.createEmptyElement("br")}),n.addObserver(Ab),e.commands.add("shiftEnter",new Eb(e)),this.listenTo(r,"enter",((t,i)=>{r.isComposing||i.preventDefault(),i.isSoft&&(e.execute("shiftEnter"),n.scrollToTheSelection())}),{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}}class Vb extends xu{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.schema,n=t.document.selection,r=Array.from(n.getSelectedBlocks()),s=void 0===e.forceValue?!this.value:e.forceValue;t.change((e=>{if(s){const t=r.filter((e=>Rb(e)||Ob(i,e)));this._applyQuote(e,t)}else this._removeQuote(e,r.filter(Rb))}))}_getValue(){const e=ts(this.editor.model.document.selection.getSelectedBlocks());return!(!e||!Rb(e))}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=ts(e.getSelectedBlocks());return!!i&&Ob(t,i)}_removeQuote(e,t){Bb(e,t).reverse().forEach((t=>{if(t.start.isAtStart&&t.end.isAtEnd)return void e.unwrap(t.start.parent);if(t.start.isAtStart){const i=e.createPositionBefore(t.start.parent);return void e.move(t,i)}t.end.isAtEnd||e.split(t.end);const i=e.createPositionAfter(t.end.parent);e.move(t,i)}))}_applyQuote(e,t){const i=[];Bb(e,t).reverse().forEach((t=>{let n=Rb(t.start);n||(n=e.createElement("blockQuote"),e.wrap(t,n)),i.push(n)})),i.reverse().reduce(((t,i)=>t.nextSibling==i?(e.merge(e.createPositionAfter(t)),t):i))}}function Rb(e){return"blockQuote"==e.parent.name?e.parent:null}function Bb(e,t){let i,n=0;const r=[];for(;n{const n=e.model.document.differ.getChanges();for(const e of n)if("insert"==e.type){const n=e.position.nodeAfter;if(!n)continue;if(n.is("element","blockQuote")&&n.isEmpty)return i.remove(n),!0;if(n.is("element","blockQuote")&&!t.checkChild(e.position,n))return i.unwrap(n),!0;if(n.is("element")){const e=i.createRangeIn(n);for(const n of e.getItems())if(n.is("element","blockQuote")&&!t.checkChild(i.createPositionBefore(n),n))return i.unwrap(n),!0}}else if("remove"==e.type){const t=e.position.parent;if(t.is("element","blockQuote")&&t.isEmpty)return i.remove(t),!0}return!1}));const i=this.editor.editing.view.document,n=e.model.document.selection,r=e.commands.get("blockQuote");this.listenTo(i,"enter",((t,i)=>{if(!n.isCollapsed||!r.value)return;n.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"}),this.listenTo(i,"delete",((t,i)=>{if("backward"!=i.direction||!n.isCollapsed||!r.value)return;const s=n.getLastPosition().parent;s.isEmpty&&!s.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),i.preventDefault(),t.stop())}),{context:"blockquote"})}}class Mb extends ku{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("blockQuote",(()=>{const e=this._createButton(hg);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:blockQuote",(()=>{const e=this._createButton(Vg);return e.set({role:"menuitemcheckbox"}),e}))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("blockQuote"),r=new e(t.locale),s=i.t;return r.set({label:s("Block quote"),icon:ju.quote,isToggleable:!0}),r.bind("isEnabled").to(n,"isEnabled"),r.bind("isOn").to(n,"value"),this.listenTo(r,"execute",(()=>{t.execute("blockQuote"),t.editing.view.focus()})),r}}class Nb extends(xn()){_stack=[];add(e,t){const i=this._stack,n=i[0];this._insertDescriptor(e);const r=i[0];n===r||Lb(n,r)||this.fire("change:top",{oldDescriptor:n,newDescriptor:r,writer:t})}remove(e,t){const i=this._stack,n=i[0];this._removeDescriptor(e);const r=i[0];n===r||Lb(n,r)||this.fire("change:top",{oldDescriptor:n,newDescriptor:r,writer:t})}_insertDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e.id));if(Lb(e,t[i]))return;i>-1&&t.splice(i,1);let n=0;for(;t[n]&&Db(t[n],e);)n++;t.splice(n,0,e)}_removeDescriptor(e){const t=this._stack,i=t.findIndex((t=>t.id===e));i>-1&&t.splice(i,1)}}function Lb(e,t){return e&&t&&e.priority==t.priority&&zb(e.classes)==zb(t.classes)}function Db(e,t){return e.priority>t.priority||!(e.priorityzb(t.classes)}function zb(e){return Array.isArray(e)?e.sort().join(","):e}var Hb='';const Wb="ck-widget",$b="ck-widget_selected";function Ub(e){return!!e.is("element")&&!!e.getCustomProperty("widget")}function jb(e,t,i={}){if(!e.is("containerElement"))throw new gn("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass(Wb,e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=Qb,t.setCustomProperty("widgetLabel",[],e),i.label&&function(e,t){const i=e.getCustomProperty("widgetLabel");i.push(t)}(e,i.label),i.hasSelectionHandle&&function(e,t){const i=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(e){const t=this.toDomElement(e),i=new lg;return i.set("content",Hb),i.render(),t.appendChild(i.element),t}));t.insert(t.createPositionAt(e,0),i),t.addClass(["ck-widget_with-selection-handle"],e)}(e,t),Kb(e,t),e}function qb(e,t,i){if(t.classes&&i.addClass(Qr(t.classes),e),t.attributes)for(const n in t.attributes)i.setAttribute(n,t.attributes[n],e)}function Gb(e,t,i){if(t.classes&&i.removeClass(Qr(t.classes),e),t.attributes)for(const n in t.attributes)i.removeAttribute(n,e)}function Kb(e,t,i=qb,n=Gb){const r=new Nb;r.on("change:top",((t,r)=>{r.oldDescriptor&&n(e,r.oldDescriptor,r.writer),r.newDescriptor&&i(e,r.newDescriptor,r.writer)}));t.setCustomProperty("addHighlight",((e,t,i)=>r.add(t,i)),e),t.setCustomProperty("removeHighlight",((e,t,i)=>r.remove(t,i)),e)}function Zb(e,t,i={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),t.setAttribute("role","textbox",e),t.setAttribute("tabindex","-1",e),i.label&&t.setAttribute("aria-label",i.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",((i,n,r)=>{t.setAttribute("contenteditable",r?"false":"true",e)})),e.on("change:isFocused",((i,n,r)=>{r?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)})),Kb(e,t),e}function Jb(e,t){const i=e.getSelectedElement();if(i){const n=t_(e);if(n)return t.createRange(t.createPositionAt(i,n))}return t.schema.findOptimalInsertionRange(e)}function Qb(){return null}function Yb(e){const t=e=>{const{width:t,paddingLeft:i,paddingRight:n}=e.ownerDocument.defaultView.getComputedStyle(e);return parseFloat(t)-(parseFloat(i)||0)-(parseFloat(n)||0)},i=e.parentElement;if(!i)return 0;let n=t(i);let r=0,s=i;for(;isNaN(n);){if(s=s.parentElement,++r>5)return 0;n=t(s)}return n}const Xb="widget-type-around";function e_(e,t,i){return!!e&&Ub(e)&&!i.isInline(t)}function t_(e){return e.getAttribute(Xb)}const i_=["before","after"],n_=(new DOMParser).parseFromString('',"image/svg+xml").firstChild,r_="ck-widget__type-around_disabled";class s_ extends ku{_currentFakeCaretModelElement=null;static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[Tb,_w]}init(){const e=this.editor,t=e.editing.view;this.on("change:isEnabled",((i,n,r)=>{t.change((e=>{for(const i of t.document.roots)r?e.removeClass(r_,i):e.addClass(r_,i)})),r||e.model.change((e=>{e.removeSelectionAttribute(Xb)}))})),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){const i=this.editor,n=i.editing.view,r=i.model.schema.getAttributesWithProperty(e,"copyOnReplace",!0);i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:r}),n.focus(),n.scrollToTheSelection()}_listenToIfEnabled(e,t,i,n){this.listenTo(e,t,((...e)=>{this.isEnabled&&i(...e)}),n)}_insertParagraphAccordingToFakeCaretPosition(){const e=this.editor.model.document.selection,t=t_(e);if(!t)return!1;const i=e.getSelectedElement();return this._insertParagraph(i,t),!0}_enableTypeAroundUIInjection(){const e=this.editor,t=e.model.schema,i=e.locale.t,n={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",((e,r,s)=>{const o=s.mapper.toViewElement(r.item);if(o&&e_(o,r.item,t)){!function(e,t,i){const n=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(e){const i=this.toDomElement(e);return function(e,t){for(const i of i_){const n=new Mm({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i],"aria-hidden":"true"},children:[e.ownerDocument.importNode(n_,!0)]});e.appendChild(n.render())}}(i,t),function(e){const t=new Mm({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}(i),i}));e.insert(e.createPositionAt(i,"end"),n)}(s.writer,n,o);o.getCustomProperty("widgetLabel").push((()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):""))}}),{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const e=this.editor,t=e.model,i=t.document.selection,n=t.schema,r=e.editing.view;function s(e){return`ck-widget_type-around_show-fake-caret_${e}`}this._listenToIfEnabled(r.document,"arrowKey",((e,t)=>{this._handleArrowKeyPress(e,t)}),{context:[Ub,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",((t,i)=>{i.directChange&&e.model.change((e=>{e.removeSelectionAttribute(Xb)}))})),this._listenToIfEnabled(t.document,"change:data",(()=>{const t=i.getSelectedElement();if(t){if(e_(e.editing.mapper.toViewElement(t),t,n))return}e.model.change((e=>{e.removeSelectionAttribute(Xb)}))})),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",((e,t,i)=>{const r=i.writer;if(this._currentFakeCaretModelElement){const e=i.mapper.toViewElement(this._currentFakeCaretModelElement);e&&(r.removeClass(i_.map(s),e),this._currentFakeCaretModelElement=null)}const o=t.selection.getSelectedElement();if(!o)return;const a=i.mapper.toViewElement(o);if(!e_(a,o,n))return;const l=t_(t.selection);l&&(r.addClass(s(l),a),this._currentFakeCaretModelElement=o)})),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",((t,i,n)=>{n||e.model.change((e=>{e.removeSelectionAttribute(Xb)}))}))}_handleArrowKeyPress(e,t){const i=this.editor,n=i.model,r=n.document.selection,s=n.schema,o=i.editing.view,a=function(e,t){const i=Gr(e,t);return"down"===i||"right"===i}(t.keyCode,i.locale.contentLanguageDirection),l=o.document.selection.getSelectedElement();let c;e_(l,i.editing.mapper.toModelElement(l),s)?c=this._handleArrowKeyPressOnSelectedWidget(a):r.isCollapsed?c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a):t.shiftKey||(c=this._handleArrowKeyPressWhenNonCollapsedSelection(a)),c&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){const t=this.editor.model,i=t_(t.document.selection);return t.change((t=>{if(!i)return t.setSelectionAttribute(Xb,e?"after":"before"),!0;if(!(i===(e?"after":"before")))return t.removeSelectionAttribute(Xb),!0;return!1}))}_handleArrowKeyPressWhenSelectionNextToAWidget(e){const t=this.editor,i=t.model,n=i.schema,r=t.plugins.get("Widget"),s=r._getObjectElementNextToSelection(e);return!!e_(t.editing.mapper.toViewElement(s),s,n)&&(i.change((t=>{r._setSelectionOverElement(s),t.setSelectionAttribute(Xb,e?"before":"after")})),!0)}_handleArrowKeyPressWhenNonCollapsedSelection(e){const t=this.editor,i=t.model,n=i.schema,r=t.editing.mapper,s=i.document.selection,o=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter;return!!e_(r.toViewElement(o),o,n)&&(i.change((t=>{t.setSelection(o,"on"),t.setSelectionAttribute(Xb,e?"after":"before")})),!0)}_enableInsertingParagraphsOnButtonClick(){const e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",((i,n)=>{const r=n.domTarget.closest(".ck-widget__type-around__button");if(!r)return;const s=function(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(r),o=function(e,t){const i=e.closest(".ck-widget");return t.mapDomToView(i)}(r,t.domConverter),a=e.editing.mapper.toModelElement(o);this._insertParagraph(a,s),n.preventDefault(),i.stop()}))}_enableInsertingParagraphsOnEnterKeypress(){const e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",((i,n)=>{if("atTarget"!=i.eventPhase)return;const r=t.getSelectedElement(),s=e.editing.mapper.toViewElement(r),o=e.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:e_(s,r,o)&&(this._insertParagraph(r,n.isSoft?"before":"after"),a=!0),a&&(n.preventDefault(),i.stop())}),{context:Ub})}_enableInsertingParagraphsOnTypingKeystroke(){const e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",((t,i)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(i.selection=e.selection)}),{priority:"high"}),Ki.isAndroid?this._listenToIfEnabled(e,"keydown",((e,t)=>{229==t.keyCode&&this._insertParagraphAccordingToFakeCaretPosition()})):this._listenToIfEnabled(e,"compositionstart",(()=>{this._insertParagraphAccordingToFakeCaretPosition()}),{priority:"high"})}_enableDeleteIntegration(){const e=this.editor,t=e.editing.view,i=e.model,n=i.schema;this._listenToIfEnabled(t.document,"delete",((t,r)=>{if("atTarget"!=t.eventPhase)return;const s=t_(i.document.selection);if(!s)return;const o=r.direction,a=i.document.selection.getSelectedElement(),l="forward"==o;if("before"===s===l)e.execute("delete",{selection:i.createSelection(a,"on")});else{const t=n.getNearestSelectionRange(i.createPositionAt(a,s),o);if(t)if(t.isCollapsed){const r=i.createSelection(t.start);if(i.modifySelection(r,{direction:o}),r.focus.isEqual(t.start)){const e=function(e,t){let i=t;for(const n of t.getAncestors({parentFirst:!0})){if(n.childCount>1||e.isLimit(n))break;i=n}return i}(n,t.start.parent);i.deleteContent(i.createSelection(e,"on"),{doNotAutoparagraph:!0})}else i.change((i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")}))}else i.change((i=>{i.setSelection(t),e.execute(l?"deleteForward":"delete")}))}r.preventDefault(),t.stop()}),{context:Ub})}_enableInsertContentIntegration(){const e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",((e,[n,r])=>{if(r&&!r.is("documentSelection"))return;const s=t_(i);return s?(e.stop(),t.change((e=>{const r=i.getSelectedElement(),o=t.createPositionAt(r,s),a=e.createSelection(o),l=t.insertContent(n,a);return e.setSelection(a),l}))):void 0}),{priority:"high"})}_enableInsertObjectIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",((e,i)=>{const[,n,r={}]=i;if(n&&!n.is("documentSelection"))return;const s=t_(t);s&&(r.findOptimalPosition=s,i[3]=r)}),{priority:"high"})}_enableDeleteContentIntegration(){const e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",((e,[i])=>{if(i&&!i.is("documentSelection"))return;t_(t)&&e.stop()}),{priority:"high"})}}function o_(e){const t=e.model;return(i,n)=>{const r=n.keyCode==Wr.arrowup,s=n.keyCode==Wr.arrowdown,o=n.shiftKey,a=t.document.selection;if(!r&&!s)return;const l=s;if(o&&function(e,t){return!e.isCollapsed&&e.isBackward==t}(a,l))return;const c=function(e,t,i){const n=e.model;if(i){const e=t.isCollapsed?t.focus:t.getLastPosition(),i=a_(n,e,"forward");if(!i)return null;const r=n.createRange(e,i),s=l_(n.schema,r,"backward");return s?n.createRange(e,s):null}{const e=t.isCollapsed?t.focus:t.getFirstPosition(),i=a_(n,e,"backward");if(!i)return null;const r=n.createRange(i,e),s=l_(n.schema,r,"forward");return s?n.createRange(s,e):null}}(e,a,l);if(c){if(c.isCollapsed){if(a.isCollapsed)return;if(o)return}(c.isCollapsed||function(e,t,i){const n=e.model,r=e.view.domConverter;if(i){const e=n.createSelection(t.start);n.modifySelection(e),e.focus.isAtEnd||t.start.isEqual(e.focus)||(t=n.createRange(e.focus,t.end))}const s=e.mapper.toViewRange(t),o=r.viewRangeToDom(s),a=ur.getDomRangeRects(o);let l;for(const e of a)if(void 0!==l){if(Math.round(e.top)>=l)return!1;l=Math.max(l,Math.round(e.bottom))}else l=Math.round(e.bottom);return!0}(e,c,l))&&(t.change((e=>{const i=l?c.end:c.start;if(o){const n=t.createSelection(a.anchor);n.setFocus(i),e.setSelection(n)}else e.setSelection(i)})),i.stop(),n.preventDefault(),n.stopPropagation())}}}function a_(e,t,i){const n=e.schema,r=e.createRangeIn(t.root),s="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:e,item:o,type:a}of r.getWalker({startPosition:t,direction:i})){if(n.isLimit(o)&&!n.isInline(o))return e;if(a==s&&n.isBlock(o))return null}return null}function l_(e,t,i){const n="backward"==i?t.end:t.start;if(e.checkChild(n,"$text"))return n;for(const{nextPosition:n}of t.getWalker({direction:i}))if(e.checkChild(n,"$text"))return n;return null}class c_ extends ku{_previouslySelected=new Set;static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[s_,_w]}init(){const e=this.editor,t=e.editing.view,i=t.document,n=e.t;this.editor.editing.downcastDispatcher.on("selection",((t,i,n)=>{const r=n.writer,s=i.selection;if(s.isCollapsed)return;const o=s.getSelectedElement();if(!o)return;const a=e.editing.mapper.toViewElement(o);var l;Ub(a)&&(n.consumable.consume(s,"selection")&&r.setSelection(r.createRangeOn(a),{fake:!0,label:(l=a,l.getCustomProperty("widgetLabel").reduce(((e,t)=>"function"==typeof t?e?e+". "+t():t():e?e+". "+t:t),""))}))})),this.editor.editing.downcastDispatcher.on("selection",((e,t,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const n=i.writer,r=n.document.selection;let s=null;for(const e of r.getRanges())for(const t of e){const e=t.item;Ub(e)&&!h_(e,s)&&(n.addClass($b,e),this._previouslySelected.add(e),s=e)}}),{priority:"low"}),t.addObserver(Cd),this.listenTo(i,"mousedown",((...e)=>this._onMousedown(...e))),this.listenTo(i,"arrowKey",((...e)=>{this._handleSelectionChangeOnArrowKeyPress(...e)}),{context:[Ub,"$text"]}),this.listenTo(i,"arrowKey",((...e)=>{this._preventDefaultOnArrowKeyPress(...e)}),{context:"$root"}),this.listenTo(i,"arrowKey",o_(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",((e,t)=>{this._handleDelete("forward"==t.direction)&&(t.preventDefault(),e.stop())}),{context:"$root"}),this.listenTo(i,"tab",((e,t)=>{"atTarget"==e.eventPhase&&(t.shiftKey||this._selectFirstNestedEditable()&&(t.preventDefault(),e.stop()))}),{context:Ub,priority:"low"}),this.listenTo(i,"tab",((e,t)=>{t.shiftKey&&this._selectAncestorWidget()&&(t.preventDefault(),e.stop())}),{priority:"low"}),this.listenTo(i,"keydown",((e,t)=>{t.keystroke==Wr.esc&&this._selectAncestorWidget()&&(t.preventDefault(),e.stop())}),{priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:n("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:n("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:n("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:n("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:n("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:n("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){const i=this.editor,n=i.editing.view,r=n.document;let s=t.target;if(!s)return;if(t.domEvent.detail>=3)return void(this._selectBlockContent(s)&&t.preventDefault());if(!Ub(s)){const e=function(e){let t=e;for(;t;){if(t.is("editableElement")||Ub(t))return t;t=t.parent}return null}(s);if(!e)return;if(Ub(e))s=e;else{const e=function(e,t){const i=ar(t.domEvent);let n=null;n=i?e.domConverter.domRangeToView(i):e.createRange(e.createPositionAt(t.target,0));if(!n)return null;const r=n.start;if(!r.parent)return null;let s=r.parent;r.parent.is("editableElement")&&(r.isAtEnd&&r.nodeBefore?s=r.nodeBefore:r.isAtStart&&r.nodeAfter&&(s=r.nodeAfter));if(s.is("$text"))return s.parent;return s}(n,t);if(!e||!Ub(e))return;s=e}}Ki.isAndroid&&t.preventDefault(),r.isFocused||n.focus();const o=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(o)}_selectBlockContent(e){const t=this.editor,i=t.model,n=t.editing.mapper,r=i.schema,s=n.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),o=function(e,t){for(const i of e.getAncestors({includeSelf:!0,parentFirst:!0})){if(t.checkChild(i,"$text"))return i;if(t.isLimit(i)&&!t.isObject(i))break}return null}(n.toModelElement(s),i.schema);return!!o&&(i.change((e=>{const t=r.isLimit(o)?null:function(e,t){const i=new Tl({startPosition:e});for(const{item:e}of i){if(t.isLimit(e)||!e.is("element"))return null;if(t.checkChild(e,"$text"))return e}return null}(e.createPositionAfter(o),r),i=e.createPositionAt(o,0),n=t?e.createPositionAt(t,0):e.createPositionAt(o,"end");e.setSelection(e.createRange(i,n))})),!0)}_handleSelectionChangeOnArrowKeyPress(e,t){const i=t.keyCode,n=this.editor.model,r=n.schema,s=n.document.selection,o=s.getSelectedElement(),a=Gr(i,this.editor.locale.contentLanguageDirection),l="down"==a||"right"==a,c="up"==a||"down"==a;if(o&&r.isObject(o)){const i=l?s.getLastPosition():s.getFirstPosition(),o=r.getNearestSelectionRange(i,l?"forward":"backward");return void(o&&(n.change((e=>{e.setSelection(o)})),t.preventDefault(),e.stop()))}if(!s.isCollapsed&&!t.shiftKey){const i=s.getFirstPosition(),o=s.getLastPosition(),a=i.nodeAfter,c=o.nodeBefore;return void((a&&r.isObject(a)||c&&r.isObject(c))&&(n.change((e=>{e.setSelection(l?o:i)})),t.preventDefault(),e.stop()))}if(!s.isCollapsed)return;const h=this._getObjectElementNextToSelection(l);if(h&&r.isObject(h)){if(r.isInline(h)&&c)return;this._setSelectionOverElement(h),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){const i=this.editor.model,n=i.schema,r=i.document.selection.getSelectedElement();r&&n.isObject(r)&&(t.preventDefault(),e.stop())}_handleDelete(e){const t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t))return;if(!t.isCollapsed)return;const i=this._getObjectElementNextToSelection(e);return i?(this.editor.model.change((e=>{let n=t.anchor.parent;for(;n.isEmpty;){const t=n;n=t.parent,e.remove(t)}this._setSelectionOverElement(i)})),!0):void 0}_setSelectionOverElement(e){this.editor.model.change((t=>{t.setSelection(t.createRangeOn(e))}))}_getObjectElementNextToSelection(e){const t=this.editor.model,i=t.schema,n=t.document.selection,r=t.createSelection(n);if(t.modifySelection(r,{direction:e?"forward":"backward"}),r.isEqual(n))return null;const s=e?r.focus.nodeBefore:r.focus.nodeAfter;return s&&i.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(const t of this._previouslySelected)e.removeClass($b,t);this._previouslySelected.clear()}_selectFirstNestedEditable(){const e=this.editor,t=this.editor.editing.view.document;for(const i of t.selection.getFirstRange().getItems())if(i.is("editableElement")){const t=e.editing.mapper.toModelElement(i);if(!t)continue;const n=e.model.createPositionAt(t,0),r=e.model.schema.getNearestSelectionRange(n,"forward");return e.model.change((e=>{e.setSelection(r)})),!0}return!1}_selectAncestorWidget(){const e=this.editor,t=e.editing.mapper,i=e.editing.view.document.selection.getFirstPosition().parent,n=(i.is("$text")?i.parent:i).findAncestor(Ub);if(!n)return!1;const r=t.toModelElement(n);return!!r&&(e.model.change((e=>{e.setSelection(r,"on")})),!0)}}function h_(e,t){return!!t&&Array.from(e.getAncestors()).includes(t)}class d_ extends ku{_toolbarDefinitions=new Map;_balloon;static get requires(){return[Fp]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(e.plugins.has("BalloonToolbar")){const t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",(t=>{(function(e){const t=e.getSelectedElement();return!(!t||!Ub(t))})(e.editing.view.document.selection)&&t.stop()}),{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",(()=>{this._updateToolbarsVisibility()})),this.listenTo(e.ui,"update",(()=>{this._updateToolbarsVisibility()})),this.listenTo(e.ui.focusTracker,"change:isFocused",(()=>{this._updateToolbarsVisibility()}),{priority:"low"})}destroy(){super.destroy();for(const e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:n,balloonClassName:r="ck-toolbar-container"}){if(!i.length)return void fn("widget-toolbar-no-items",{toolbarId:e});const s=this.editor,o=s.t,a=new _f(s.locale);if(a.ariaLabel=t||o("Widget toolbar"),this._toolbarDefinitions.has(e))throw new gn("widget-toolbar-duplicated",this,{toolbarId:e});const l={view:a,getRelatedElement:n,balloonClassName:r,itemsConfig:i,initialized:!1};s.ui.addToolbar(a,{isContextual:!0,beforeFocus:()=>{const e=n(s.editing.view.document.selection);e&&this._showToolbar(l,e)},afterBlur:()=>{this._hideToolbar(l)}}),this._toolbarDefinitions.set(e,l)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(const n of this._toolbarDefinitions.values()){const r=n.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&r)if(this.editor.ui.focusTracker.isFocused){const s=r.getAncestors().length;s>e&&(e=s,t=r,i=n)}else this._isToolbarVisible(n)&&this._hideToolbar(n);else this._isToolbarInBalloon(n)&&this._hideToolbar(n)}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?u_(this.editor,t):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:m_(this.editor,t),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",(()=>{for(const e of this._toolbarDefinitions.values())if(this._isToolbarVisible(e)){const t=e.getRelatedElement(this.editor.editing.view.document.selection);u_(this.editor,t)}})))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}}function u_(e,t){const i=e.plugins.get("ContextualBalloon"),n=m_(e,t);i.updatePosition(n)}function m_(e,t){const i=e.editing.view,n=mf.defaultPositions;return{target:i.domConverter.mapViewToDom(t),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}class g_ extends(Ln()){_referenceCoordinates;_options;_originalWidth;_originalHeight;_originalWidthPercents;_aspectRatio;constructor(e){super(),this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,i){const n=new ur(t);this.activeHandlePosition=function(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const i of t)if(e.classList.contains(f_(i)))return i}(e),this._referenceCoordinates=function(e,t){const i=new ur(e),n=t.split("-"),r={x:"right"==n[1]?i.right:i.left,y:"bottom"==n[0]?i.bottom:i.top};return r.x+=e.ownerDocument.defaultView.scrollX,r.y+=e.ownerDocument.defaultView.scrollY,r}(t,function(e){const t=e.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[t[0]]}-${i[t[1]]}`}(this.activeHandlePosition)),this._originalWidth=n.width,this._originalHeight=n.height,this._aspectRatio=n.width/n.height;const r=i.style.width;r&&r.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(r):this._originalWidthPercents=function(e,t=new ur(e)){const i=Yb(e);return i?t.width/i*100:0}(i,n)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}}function f_(e){return`ck-widget__resizer__handle-${e}`}class p_ extends ng{constructor(){super();const e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",(e=>e?`ck-orientation-${e}`:""))],style:{display:e.if("_isVisible","none",(e=>!e))}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",((e,t)=>null!==e&&null!==t)),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",((t,i,n)=>"px"===e.unit?`${t}×${i}`:`${n}%`)),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",((e,t,i)=>t<50||i<50?"above-center":e))}_dismiss(){this.unbind(),this._isVisible=!1}}class w_ extends(Ln()){_state;_sizeView;_options;_viewResizerWrapper=null;_initialViewWidth;constructor(e){super(),this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",((e,t)=>e&&t)),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",(e=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),e.stop())}),{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change((e=>{e.removeClass("ck-hidden",this._viewResizerWrapper)}))}hide(){this._options.editor.editing.view.change((e=>{e.addClass("ck-hidden",this._viewResizerWrapper)}))}attach(){const e=this,t=this._options.viewElement;this._options.editor.editing.view.change((i=>{const n=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(t){const i=this.toDomElement(t);return e._appendHandles(i),e._appendSizeUI(i),i}));i.insert(i.createPositionAt(t,"end"),n),i.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=n,this.isVisible||this.hide()})),this.on("change:isVisible",(()=>{this.isVisible?(this.show(),this.redraw()):this.hide()}))}begin(e){this._state=new g_(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){const t=this._proposeNewSize(e);this._options.editor.editing.view.change((e=>{const i=this._options.unit||"%",n=("%"===i?t.widthPercents:t.width)+i;e.setStyle("width",n,this._options.viewElement)}));const i=this._getHandleHost(),n=new ur(i),r=Math.round(n.width),s=Math.round(n.height),o=new ur(i);t.width=Math.round(o.width),t.height=Math.round(o.height),this.redraw(n),this.state.update({...t,handleHostWidth:r,handleHostHeight:s})}commit(){const e=this._options.unit||"%",t=("%"===e?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change((()=>{this._cleanup(),this._options.onCommit(t)}))}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){const t=this._domResizerWrapper;if(!((i=t)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const n=t.parentElement,r=this._getHandleHost(),s=this._viewResizerWrapper,o=[s.getStyle("width"),s.getStyle("height"),s.getStyle("left"),s.getStyle("top")];let a;if(n.isSameNode(r)){const t=e||new ur(r);a=[t.width+"px",t.height+"px",void 0,void 0]}else a=[r.offsetWidth+"px",r.offsetHeight+"px",r.offsetLeft+"px",r.offsetTop+"px"];"same"!==qn(o,a)&&this._options.editor.editing.view.change((e=>{e.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},s)}))}containsHandle(e){return this._domResizerWrapper.contains(e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss();this._options.editor.editing.view.change((e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)}))}_proposeNewSize(e){const t=this.state,i={x:(n=e).pageX,y:n.pageY};var n;const r=!this._options.isCentered||this._options.isCentered(this),s={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};r&&t.activeHandlePosition.endsWith("-right")&&(s.x=i.x-(t._referenceCoordinates.x+t.originalWidth)),r&&(s.x*=2);let o=Math.abs(t.originalWidth+s.x),a=Math.abs(t.originalHeight+s.y);return"width"==(o/t.aspectRatio>a?"width":"height")?a=o/t.aspectRatio:o=a*t.aspectRatio,{width:Math.round(o),height:Math.round(a),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*o*100)/100,100)}}_getResizeHost(){const e=this._domResizerWrapper.parentElement;return this._options.getResizeHost(e)}_getHandleHost(){const e=this._domResizerWrapper.parentElement;return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){const t=["top-left","top-right","bottom-right","bottom-left"];for(const n of t)e.appendChild(new Mm({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(i=n,`ck-widget__resizer__handle-${i}`)}}).render());var i}_appendSizeUI(e){this._sizeView=new p_,this._sizeView.render(),e.appendChild(this._sizeView.element)}}class b_ extends ku{_resizers=new Map;_observer;_redrawSelectedResizerThrottled;static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.editing,t=ji.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(Cd),this._observer=new(tr()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=du((()=>this.redrawSelectedResizer()),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",(()=>{for(const[e,t]of this._resizers)e.isAttached()||(this._resizers.delete(e),t.destroy())}),{priority:"lowest"}),this._observer.listenTo(ji.window,"resize",this._redrawSelectedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",(()=>{const e=i.getSelectedElement(),t=this.getResizerByViewElement(e)||null;t?this.select(t):this.deselect()}))}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(const e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){const t=new w_(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){const e=i.get("WidgetToolbarRepository");t.on("begin",(()=>{e.forceDisabled("resize")}),{priority:"lowest"}),t.on("cancel",(()=>{e.clearForceDisabled("resize")}),{priority:"highest"}),t.on("commit",(()=>{e.clearForceDisabled("resize")}),{priority:"highest"})}this._resizers.set(e.viewElement,t);const n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(const t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){const i=t.domTarget;w_.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}Error;const __=function(e,t){return e&&Ai(e,t,ct)};const v_=function(e,t,i,n){var r=i.length,s=r,o=!n;if(null==e)return!s;for(e=Object(e);r--;){var a=i[r];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++r{n.preventDefault();const r=n.dropRange?[n.dropRange]:null,s=new ln(t,e);t.fire(s,{dataTransfer:n.dataTransfer,method:i.name,targetRanges:r,target:n.target,domEvent:n.domEvent}),s.stop.called&&n.stopPropagation()}}this.listenTo(t,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",i("dragging"),{priority:"low"})}onDomEvent(e){const t="clipboardData"in e?e.clipboardData:e.dataTransfer,i="drop"==e.type||"paste"==e.type,n={dataTransfer:new gl(t,{cacheFiles:i})};if("drop"==e.type||"dragover"==e.type){const t=ar(e);n.dropRange=t&&this.view.domConverter.domRangeToView(t)}this.fire(e.type,e,n)}}const F_=["figcaption","li"],M_=["ol","ul"];function N_(e){if(e.is("$text")||e.is("$textProxy"))return e.data;if(e.is("element","img")&&e.hasAttribute("alt"))return e.getAttribute("alt");if(e.is("element","br"))return"\n";let t="",i=null;for(const n of e.getChildren())t+=L_(n,i)+N_(n),i=n;return t}function L_(e,t){return t?e.is("element","li")&&!e.isEmpty&&e.getChild(0).is("containerElement")||M_.includes(e.name)&&M_.includes(t.name)?"\n\n":e.is("containerElement")||t.is("containerElement")?F_.includes(e.name)||F_.includes(t.name)?"\n":e.is("element")&&e.getCustomProperty("dataPipeline:transparentRendering")||t.is("element")&&t.getCustomProperty("dataPipeline:transparentRendering")?"":"\n\n":"":""}class D_ extends ku{_markersToCopy=new Map;static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,t){this._markersToCopy.set(e,t)}_copySelectedFragmentWithMarkers(e,t,i=(e=>e.model.getSelectedContent(e.model.document.selection))){return this.editor.model.change((n=>{const r=n.model.document.selection;n.setSelection(t);const s=this._insertFakeMarkersIntoSelection(n,n.model.document.selection,e),o=i(n),a=this._removeFakeMarkersInsideElement(n,o);for(const[e,t]of Object.entries(s)){a[e]||=n.createRangeIn(o);for(const e of t)n.remove(e)}o.markers.clear();for(const[e,t]of Object.entries(a))o.markers.set(e,t);return n.setSelection(r),o}))}_pasteMarkersIntoTransformedElement(e,t){const i=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change((e=>{const n=this._insertFakeMarkersElements(e,i),r=t(e),s=this._removeFakeMarkersInsideElement(e,r);for(const t of Object.values(n).flat())e.remove(t);for(const[t,i]of Object.entries(s))e.model.markers.has(t)||e.addMarker(t,{usingOperation:!0,affectsData:!0,range:i});return r}))}_pasteFragmentWithMarkers(e){const t=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(const i of t)e.markers.set(i.name,i.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,t,i={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){const n=this._markersToCopy.get(e);this._markersToCopy.set(e,i),t(),n?this._markersToCopy.set(e,n):this._markersToCopy.delete(e)}_isMarkerCopyable(e,t){const i=this._getMarkerClipboardConfig(e);if(!i)return!1;if(!t)return!0;const{allowedActions:n}=i;return"all"===n||n.includes(t)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){const[t]=e.split(":");return this._markersToCopy.get(t)||null}_insertFakeMarkersIntoSelection(e,t,i){const n=this._getCopyableMarkersFromSelection(e,t,i);return this._insertFakeMarkersElements(e,n)}_getCopyableMarkersFromSelection(e,t,i){const n=Array.from(t.getRanges()),r=new Set(n.flatMap((t=>Array.from(e.model.markers.getMarkersIntersectingRange(t)))));return Array.from(r).filter((e=>{if(!this._isMarkerCopyable(e.name,i))return!1;const{copyPartiallySelected:t}=this._getMarkerClipboardConfig(e.name);if(!t){const t=e.getRange();return n.some((e=>e.containsRange(t,!0)))}return!0})).map((e=>({name:"dragstart"===i?this._getUniqueMarkerName(e.name):e.name,range:e.getRange()})))}_getPasteMarkersFromRangeMap(e,t=null){const{model:i}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap((([e,n])=>{if(!this._hasMarkerConfiguration(e))return[{name:e,range:n}];if(this._isMarkerCopyable(e,t)){const t=this._getMarkerClipboardConfig(e),r=i.markers.has(e)&&"$graveyard"===i.markers.get(e).getRange().root.rootName;return(t.duplicateOnPaste||r)&&(e=this._getUniqueMarkerName(e)),[{name:e,range:n}]}return[]}))}_insertFakeMarkersElements(e,t){const i={},n=t.flatMap((e=>{const{start:t,end:i}=e.range;return[{position:t,marker:e,type:"start"},{position:i,marker:e,type:"end"}]})).sort((({position:e},{position:t})=>e.isBefore(t)?1:-1));for(const{position:t,marker:r,type:s}of n){const n=e.createElement("$marker",{"data-name":r.name,"data-type":s});i[r.name]||(i[r.name]=[]),i[r.name].push(n),e.insert(n,t)}return i}_removeFakeMarkersInsideElement(e,t){const i=this._getAllFakeMarkersFromElement(e,t).reduce(((t,i)=>{const n=i.markerElement&&e.createPositionBefore(i.markerElement);let r=t[i.name],s=!1;if(r&&r.start&&r.end){this._getMarkerClipboardConfig(i.name).duplicateOnPaste?t[this._getUniqueMarkerName(i.name)]=t[i.name]:s=!0,r=null}return s||(t[i.name]={...r,[i.type]:n}),i.markerElement&&e.remove(i.markerElement),t}),{});return B_(i,(i=>new Ol(i.start||e.createPositionFromPath(t,[0]),i.end||e.createPositionAt(t,"end"))))}_getAllFakeMarkersFromElement(e,t){const i=Array.from(e.createRangeIn(t)).flatMap((({item:e})=>{if(!e.is("element","$marker"))return[];const t=e.getAttribute("data-name"),i=e.getAttribute("data-type");return[{markerElement:e,name:t,type:i}]})),n=[],r=[];for(const e of i){if("end"===e.type){i.some((t=>t.name===e.name&&"start"===t.type))||n.push({markerElement:null,name:e.name,type:"start"})}if("start"===e.type){i.some((t=>t.name===e.name&&"end"===t.type))||r.unshift({markerElement:null,name:e.name,type:"end"})}}return[...n,...i,...r]}_getUniqueMarkerName(e){const t=e.split(":"),i=hn().substring(1,6);return 3===t.length?`${t.slice(0,2).join(":")}:${i}`:`${t.join(":")}:${i}`}}class z_ extends ku{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[D_]}init(){this.editor.editing.view.addObserver(O_),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,t,i){const n=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:"cut"===i},(()=>{const r=n._copySelectedFragmentWithMarkers(i,t);this.fire("outputTransformation",{dataTransfer:e,content:r,method:i})}))}_setupPasteDrop(){const e=this.editor,t=e.model,i=e.editing.view,n=i.document,r=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(n,"clipboardInput",((t,i)=>{"paste"!=i.method||e.model.canEditAt(e.model.document.selection)||t.stop()}),{priority:"highest"}),this.listenTo(n,"clipboardInput",((e,t)=>{const n=t.dataTransfer;let r;if(t.content)r=t.content;else{let e="";n.getData("text/html")?e=function(e){return e.replace(/(\s+)<\/span>/g,((e,t)=>1==t.length?" ":t)).replace(//g,"")}(n.getData("text/html")):n.getData("text/plain")&&(((s=(s=n.getData("text/plain")).replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

")||s.includes("
"))&&(s=`

${s}

`),e=s),r=this.editor.data.htmlProcessor.toView(e)}var s;const o=new ln(this,"inputTransformation");this.fire(o,{content:r,dataTransfer:n,targetRanges:t.targetRanges,method:t.method}),o.stop.called&&e.stop(),i.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((e,i)=>{if(i.content.isEmpty)return;const n=this.editor.data.toModel(i.content,"$clipboardHolder");0!=n.childCount&&(e.stop(),t.change((()=>{this.fire("contentInsertion",{content:n,method:i.method,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((e,t)=>{t.resultRange=r._pasteFragmentWithMarkers(t.content)}),{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,i=e.editing.view.document,n=(e,i)=>{const n=i.dataTransfer;i.preventDefault(),this._fireOutputTransformationEvent(n,t.selection,e.name)};this.listenTo(i,"copy",n,{priority:"low"}),this.listenTo(i,"cut",((t,i)=>{e.model.canEditAt(e.model.document.selection)?n(t,i):i.preventDefault()}),{priority:"low"}),this.listenTo(this,"outputTransformation",((t,n)=>{const r=e.data.toView(n.content);i.fire("clipboardOutput",{dataTransfer:n.dataTransfer,content:r,method:n.method})}),{priority:"low"}),this.listenTo(i,"clipboardOutput",((i,n)=>{n.content.isEmpty||(n.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(n.content)),n.dataTransfer.setData("text/plain",N_(n.content))),"cut"==n.method&&e.model.deleteContent(t.selection)}),{priority:"low"})}}const H_=_r("px");class W_ extends ng{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",(e=>!e))],style:{left:e.to("left",(e=>H_(e))),top:e.to("top",(e=>H_(e))),width:e.to("width",(e=>H_(e)))}}})}}class $_ extends ku{removeDropMarkerDelayed=cs((()=>this.removeDropMarker()),40);_updateDropMarkerThrottled=du((e=>this._updateDropMarker(e)),40);_reconvertMarkerThrottled=du((()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")}),0);_dropTargetLineView=new W_;_domEmitter=new(tr());_scrollables=new Map;static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,i,n,r,s){this.removeDropMarkerDelayed.cancel();const o=U_(this.editor,e,t,i,n,r,s);if(o)return s&&s.containsRange(o)?this.removeDropMarker():void this._updateDropMarkerThrottled(o)}getFinalDropRange(e,t,i,n,r,s){const o=U_(this.editor,e,t,i,n,r,s);return this.removeDropMarker(),o}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change((e=>{e.removeMarker("drop-target")}))}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:i})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const t=this.editor,i=t.model.markers;t.model.change((t=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})}))}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(e){const t=this.toDomElement(e);return t.append("⁠",e.createElement("span"),"⁠"),t}))}_updateDropTargetLine(e){const t=this.editor.editing,i=e.start.nodeBefore,n=e.start.nodeAfter,r=e.start.parent,s=i?t.mapper.toViewElement(i):null,o=s?t.view.domConverter.mapViewToDom(s):null,a=n?t.mapper.toViewElement(n):null,l=a?t.view.domConverter.mapViewToDom(a):null,c=t.mapper.toViewElement(r);if(!c)return;const h=t.view.domConverter.mapViewToDom(c),d=this._getScrollableRect(c),{scrollX:u,scrollY:m}=ji.window,g=o?new ur(o):null,f=l?new ur(l):null,p=new ur(h).excludeScrollbarsAndBorders(),w=g?g.bottom:p.top,b=f?f.top:p.bottom,_=ji.window.getComputedStyle(h),v=w<=b?(w+b)/2:b;if(d.topa.schema.checkChild(s,e)))){if(a.schema.checkChild(s,"$text"))return a.createRange(s);if(t)return q_(e,K_(e,t.parent),n,r)}}}else if(a.schema.isInline(c))return q_(e,c,n,r);if(a.schema.isBlock(c))return q_(e,c,n,r);if(a.schema.checkChild(c,"$block")){const t=Array.from(c.getChildren()).filter((t=>t.is("element")&&!j_(e,t)));let i=0,s=t.length;if(0==s)return a.createRange(a.createPositionAt(c,"end"));for(;i{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")})),Ki.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const t=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(t,"dragstart",((e,t)=>this._handleBlockDragStart(t))),this._domEmitter.listenTo(ji.document,"dragover",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(ji.document,"drop",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(ji.document,"dragend",(()=>this._handleBlockDragEnd()),{useCapture:!0}),this.isEnabled&&t.setAttribute("draggable","true"),this.on("change:isEnabled",((e,i,n)=>{t.setAttribute("draggable",n?"true":"false")}))}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const t=this.editor.model,i=t.document.selection,n=this.editor.editing.view,r=Array.from(i.getSelectedBlocks()),s=t.createRange(t.createPositionBefore(r[0]),t.createPositionAfter(r[r.length-1]));t.change((e=>e.setSelection(s))),this._isBlockDragging=!0,n.focus(),n.getObserver(O_).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const t=e.clientX+("ltr"==this.editor.locale.contentLanguageDirection?100:-100),i=e.clientY,n=document.elementFromPoint(t,i),r=this.editor.editing.view;n&&n.closest(".ck-editor__editable")&&r.getObserver(O_).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:n,clientX:t,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}}class J_ extends ku{_draggedRange;_draggingUid;_draggableElement;_clearDraggableAttributesDelayed=cs((()=>this._clearDraggableAttributes()),40);_blockMode=!1;_domEmitter=new(tr());_previewContainer;static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[z_,c_,$_,Z_]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(O_),t.addObserver(Cd),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",((e,t,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((e,t,i)=>{i||this._finalizeDragging(!1)})),Ki.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,i=e.editing.view,n=i.document,r=e.plugins.get($_);this.listenTo(n,"dragstart",((e,i)=>{if(i.target&&i.target.is("editableElement"))return void i.preventDefault();if(this._prepareDraggedRange(i.target),!this._draggedRange)return void i.preventDefault();this._draggingUid=hn(),i.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",i.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const n=t.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(i.dataTransfer,n,"dragstart");const{dataTransfer:r,domTarget:s,domEvent:o}=i,{clientX:a}=o;this._updatePreview({dataTransfer:r,domTarget:s,clientX:a}),i.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(n,"dragend",((e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)}),{priority:"low"}),this._domEmitter.listenTo(ji.document,"dragend",(()=>{this._blockMode=!1}),{useCapture:!0}),this.listenTo(n,"dragenter",(()=>{this.isEnabled&&i.focus()})),this.listenTo(n,"dragleave",(()=>{r.removeDropMarkerDelayed()})),this.listenTo(n,"dragging",((e,t)=>{if(!this.isEnabled)return void(t.dataTransfer.dropEffect="none");const{clientX:i,clientY:n}=t.domEvent;r.updateDropMarker(t.target,t.targetRanges,i,n,this._blockMode,this._draggedRange),this._draggedRange||(t.dataTransfer.dropEffect="copy"),Ki.isGecko||("copy"==t.dataTransfer.effectAllowed?t.dataTransfer.dropEffect="copy":["all","copyMove"].includes(t.dataTransfer.effectAllowed)&&(t.dataTransfer.dropEffect="move")),e.stop()}),{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get($_);this.listenTo(t,"clipboardInput",((t,n)=>{if("drop"!=n.method)return;const{clientX:r,clientY:s}=n.domEvent,o=i.getFinalDropRange(n.target,n.targetRanges,r,s,this._blockMode,this._draggedRange);if(!o)return this._finalizeDragging(!1),void t.stop();this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==Q_(n.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(o,!0))return this._finalizeDragging(!1),void t.stop();n.targetRanges=[e.editing.mapper.toViewRange(o)]}),{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(z_);e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i=t.targetRanges.map((e=>this.editor.editing.mapper.toModelRange(e)));this.editor.model.change((e=>e.setSelection(i)))}),{priority:"high"}),e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i="move"==Q_(t.dataTransfer),n=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(n&&i)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,i=t.document;this.listenTo(i,"mousedown",((n,r)=>{if(Ki.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=Y_(r.target);if(Ki.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){const e=i.selection.getSelectedElement();e&&Ub(e)||(s=i.selection.editableElement)}s&&(t.change((e=>{e.setAttribute("draggable","true",s)})),this._draggableElement=e.editing.mapper.toModelElement(s))})),this.listenTo(i,"mouseup",(()=>{Ki.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change((t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_finalizeDragging(e){const t=this.editor,i=t.model;if(t.plugins.get($_).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop")}this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change((e=>{const t=i.createSelection(this._draggedRange);i.deleteContent(t,{doNotAutoparagraph:!0});const n=t.getFirstPosition().parent;n.isEmpty&&!i.schema.checkChild(n,"$text")&&i.schema.checkChild(n,"paragraph")&&e.insertElement("paragraph",n,0)})),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const t=this.editor,i=t.model,n=i.document.selection,r=e?Y_(e):null;if(r){const e=t.editing.mapper.toModelElement(r);if(this._draggedRange=Kl.fromRange(i.createRangeOn(e)),this._blockMode=i.schema.isBlock(e),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}return}if(n.isCollapsed&&!n.getFirstPosition().parent.isEmpty)return;const s=Array.from(n.getSelectedBlocks()),o=n.getFirstRange();if(0==s.length)return void(this._draggedRange=Kl.fromRange(o));const a=X_(i,s);if(s.length>1)this._draggedRange=Kl.fromRange(a),this._blockMode=!0;else if(1==s.length){const e=o.start.isTouching(a.start)&&o.end.isTouching(a.end);this._draggedRange=Kl.fromRange(e?a:o),this._blockMode=e}i.change((e=>e.setSelection(this._draggedRange.toRange())))}_updatePreview({dataTransfer:e,domTarget:t,clientX:i}){const n=this.editor.editing.view,r=n.document.selection.editableElement,s=n.domConverter.mapViewToDom(r),o=ji.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Kn(ji.document,"div",{style:"position: fixed; left: -999999px;"}),ji.document.body.appendChild(this._previewContainer));const a=new ur(s);if(s.contains(t))return;const l=parseFloat(o.paddingLeft),c=Kn(ji.document,"div");c.className="ck ck-content",c.style.width=o.width,c.style.paddingLeft=`${a.left-i+l}px`,Ki.isiOS&&(c.style.backgroundColor="white"),n.domConverter.setContentOf(c,e.getData("text/html")),e.setDragImage(c,0,0),this._previewContainer.appendChild(c)}}function Q_(e){return Ki.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Y_(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(Ub);if(Ub(e))return e;const t=e.findAncestor((e=>Ub(e)||e.is("editableElement")));return Ub(t)?t:null}function X_(e,t){const i=t[0],n=t[t.length-1],r=i.getCommonAncestor(n),s=e.createPositionBefore(i),o=e.createPositionAfter(n);if(r&&r.is("element")&&!e.schema.isLimit(r)){const t=e.createRangeOn(r),i=s.isTouching(t.start),n=o.isTouching(t.end);if(i&&n)return X_(e,[r])}return e.createRange(s,o)}class ev extends ku{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[z_]}init(){const e=this.editor,t=e.model,i=e.editing.view,n=t.document.selection;i.addObserver(O_),e.plugins.get(z_).on("contentInsertion",((e,i)=>{(function(e,t){let i=t.createRangeIn(e);if(1==e.childCount){const n=e.getChild(0);n.is("element")&&t.schema.isBlock(n)&&!t.schema.isObject(n)&&!t.schema.isLimit(n)&&(i=t.createRangeIn(n))}for(const e of i.getItems()){if(!t.schema.isInline(e))return!1;if(Array.from(e.getAttributeKeys()).find((e=>t.schema.getAttributeProperties(e).isFormatting)))return!1}return!0})(i.content,t)&&t.change((e=>{const r=Array.from(n.getAttributes()).filter((([e])=>t.schema.getAttributeProperties(e).isFormatting));n.isCollapsed||t.deleteContent(n,{doNotAutoparagraph:!0}),r.push(...n.getAttributes());const s=e.createRangeIn(i.content);for(const i of s.getItems())for(const n of r)t.schema.checkAttribute(i,n[0])&&e.setAttribute(n[0],n[1],i)}))}))}}class tv extends ku{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[D_,z_,J_,ev]}init(){const e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}function iv(e){const t=e.t,i=e.config.get("codeBlock.languages");for(const e of i)"Plain text"===e.label&&(e.label=t("Plain text")),void 0===e.class&&(e.class=`language-${e.language}`);return i}function nv(e,t,i){const n={};for(const r of e)if("class"===t){n[r[t].split(" ").shift()]=r[i]}else n[r[t]]=r[i];return n}function rv(e){return e.data.match(/^(\s*)/)[0]}function sv(e){const t=e.document.selection,i=[];if(t.isCollapsed)return[t.anchor];const n=t.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(const{item:t}of n){let n=t.is("$textProxy")?t.textNode:t;const r=n.parent;if(!r.is("element","codeBlock")||n.is("element","softBreak"))continue;for(;n.previousSibling&&!n.previousSibling.is("element","softBreak");)n=n.previousSibling;const s=n.is("$text")?n.startOffset+rv(n).length:n.startOffset,o=e.createPositionAt(r,s);i.every((e=>!e.isEqual(o)))&&i.push(o)}return i}function ov(e){const t=ts(e.getSelectedBlocks());return!!t&&t.is("element","codeBlock")}function av(e,t){return!t.is("rootElement")&&!e.isLimit(t)&&e.checkChild(t.parent,"codeBlock")}function lv(e,t,i,n){const r=nv(t,"language","label"),s=i.getAttribute("language");if(s in r){const t=r[s];return e("enter"===n?"Entering %0 code snippet":"Leaving %0 code snippet",t)}return e("enter"===n?"Entering code snippet":"Leaving code snippet")}function cv(e,t){for(e.textNode&&(e=t.createPositionBefore(e.textNode));e.nodeBefore&&!e.nodeBefore.is("element","softBreak");)e=t.createPositionBefore(e.nodeBefore);const i=e.nodeAfter;return i&&i.is("$text")?i:null}class hv extends xu{_lastLanguage;constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor,i=t.model,n=i.document.selection,r=iv(t)[0],s=Array.from(n.getSelectedBlocks()),o=null==e.forceValue?!this.value:e.forceValue,a=function(e,t,i){if(e.language)return e.language;if(e.usePreviousLanguageChoice&&t)return t;return i}(e,this._lastLanguage,r.language);i.change((e=>{o?this._applyCodeBlock(e,s,a):this._removeCodeBlock(e,s)}))}_getValue(){const e=ts(this.editor.model.document.selection.getSelectedBlocks());return!!!(!e||!e.is("element","codeBlock"))&&e.getAttribute("language")}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=ts(e.getSelectedBlocks());return!!i&&av(t,i)}_applyCodeBlock(e,t,i){this._lastLanguage=i;const n=this.editor.model.schema,r=t.filter((e=>av(n,e)));for(const t of r)e.rename(t,"codeBlock"),e.setAttribute("language",i,t),n.removeDisallowedAttributes([t],e),Array.from(t.getChildren()).filter((e=>!n.checkChild(t,e))).forEach((t=>e.remove(t)));r.reverse().forEach(((t,i)=>{const n=r[i+1];t.previousSibling===n&&(e.appendElement("softBreak",n),e.merge(e.createPositionBefore(t)))}))}_removeCodeBlock(e,t){const i=t.filter((e=>e.is("element","codeBlock")));for(const t of i){const i=e.createRangeOn(t);for(const t of Array.from(i.getItems()).reverse())if(t.is("element","softBreak")&&t.parent.is("element","codeBlock")){const{position:i}=e.split(e.createPositionBefore(t)),n=i.nodeAfter;e.rename(n,"paragraph"),e.removeAttribute("language",n),e.remove(t)}e.rename(t,"paragraph"),e.removeAttribute("language",t)}}}class dv extends xu{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((t=>{const i=sv(e);for(const n of i){const i=t.createText(this._indentSequence);e.insertContent(i,n)}}))}_checkEnabled(){return!!this._indentSequence&&ov(this.editor.model.document.selection)}}class uv extends xu{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((()=>{const t=sv(e);for(const i of t){const t=mv(e,i,this._indentSequence);t&&e.deleteContent(e.createSelection(t))}}))}_checkEnabled(){if(!this._indentSequence)return!1;const e=this.editor.model;return!!ov(e.document.selection)&&sv(e).some((t=>mv(e,t,this._indentSequence)))}}function mv(e,t,i){const n=cv(t,e);if(!n)return null;const r=rv(n),s=r.lastIndexOf(i);if(s+i.length!==r.length)return null;if(-1===s)return null;const{parent:o,startOffset:a}=n;return e.createRange(e.createPositionAt(o,a+s),e.createPositionAt(o,a+s+i.length))}function gv(e,t,i=!1){const n=nv(t,"language","class"),r=nv(t,"language","label");return(t,s,o)=>{const{writer:a,mapper:l,consumable:c}=o;if(!c.consume(s.item,"insert"))return;const h=s.item.getAttribute("language"),d=l.toViewPosition(e.createPositionBefore(s.item)),u={};i&&(u["data-language"]=r[h],u.spellcheck="false");const m=n[h]?{class:n[h]}:void 0,g=a.createContainerElement("code",m),f=a.createContainerElement("pre",u,g);a.insert(d,f),l.bindElements(s.item,g)}}const fv="paragraph";class pv extends ku{static get pluginName(){return"CodeBlockEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Ib]}constructor(e){super(e),e.config.define("codeBlock",{languages:[{language:"plaintext",label:"Plain text"},{language:"c",label:"C"},{language:"cs",label:"C#"},{language:"cpp",label:"C++"},{language:"css",label:"CSS"},{language:"diff",label:"Diff"},{language:"html",label:"HTML"},{language:"java",label:"Java"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"python",label:"Python"},{language:"ruby",label:"Ruby"},{language:"typescript",label:"TypeScript"},{language:"xml",label:"XML"}],indentSequence:"\t"})}init(){const e=this.editor,t=e.model.schema,i=e.model,n=e.editing.view,r=iv(e);e.commands.add("codeBlock",new hv(e)),e.commands.add("indentCodeBlock",new dv(e)),e.commands.add("outdentCodeBlock",new uv(e)),this.listenTo(n.document,"tab",((t,i)=>{const n=i.shiftKey?"outdentCodeBlock":"indentCodeBlock";e.commands.get(n).isEnabled&&(e.execute(n),i.stopPropagation(),i.preventDefault(),t.stop())}),{context:"pre"}),t.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",disallowChildren:"$inlineObject",allowAttributes:["language"],allowAttributesOf:"$listItem",isBlock:!0}),t.addAttributeCheck(((e,i)=>{const n=e.getItem(e.length-2);if(t.getAttributeProperties(i).isFormatting&&n&&"codeBlock"==n.name)return!1})),e.editing.downcastDispatcher.on("insert:codeBlock",gv(i,r,!0)),e.data.downcastDispatcher.on("insert:codeBlock",gv(i,r)),e.data.downcastDispatcher.on("insert:softBreak",function(e){return(t,i,n)=>{if("codeBlock"!==i.item.parent.name)return;const{writer:r,mapper:s,consumable:o}=n;if(!o.consume(i.item,"insert"))return;const a=s.toViewPosition(e.createPositionBefore(i.item));r.insert(a,r.createText("\n"))}}(i),{priority:"high"}),e.data.upcastDispatcher.on("element:code",function(e,t){const i=nv(t,"class","language"),n=t[0].language;return(e,t,r)=>{const s=t.viewItem,o=s.parent;if(!o||!o.is("element","pre"))return;if(t.modelCursor.findAncestor("codeBlock"))return;const{consumable:a,writer:l}=r;if(!a.test(s,{name:!0}))return;const c=l.createElement("codeBlock"),h=[...s.getClassNames()];h.length||h.push("");for(const e of h){const t=i[e];if(t){l.setAttribute("language",t,c);break}}c.hasAttribute("language")||l.setAttribute("language",n,c),r.convertChildren(s,c),r.safeInsert(c,t.modelCursor)&&(a.consume(s,{name:!0}),r.updateConversionResult(c,t))}}(0,r)),e.data.upcastDispatcher.on("text",((e,t,{consumable:i,writer:n})=>{let r=t.modelCursor;if(!i.test(t.viewItem))return;if(!r.findAncestor("codeBlock"))return;i.consume(t.viewItem);const s=t.viewItem.data.split("\n").map((e=>n.createText(e))),o=s[s.length-1];for(const e of s)if(n.insert(e,r),r=r.getShiftedBy(e.offsetSize),e!==o){const e=n.createElement("softBreak");n.insert(e,r),r=n.createPositionAfter(e)}t.modelRange=n.createRange(t.modelCursor,r),t.modelCursor=r})),e.data.upcastDispatcher.on("element:pre",((e,t,{consumable:i})=>{const n=t.viewItem;if(n.findAncestor("pre"))return;const r=Array.from(n.getChildren()),s=r.find((e=>e.is("element","code")));if(s)for(const e of r)e!==s&&e.is("$text")&&i.consume(e,{name:!0})}),{priority:"high"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,n)=>{let r=i.createRange(i.document.selection.anchor);if(n.targetRanges&&(r=e.editing.mapper.toModelRange(n.targetRanges[0])),!r.start.parent.is("element","codeBlock"))return;const s=n.dataTransfer.getData("text/plain"),o=new xd(e.editing.view.document);n.content=function(e,t){const i=e.createDocumentFragment(),n=t.split("\n"),r=n.reduce(((t,i,r)=>(t.push(i),r{const r=e.model,s=r.document.selection;s.anchor.parent.is("element","codeBlock")&&r.change((e=>{const i=e.createRangeIn(n.content);for(const n of[...i.getItems()])n.is("node")&&!t.checkChild(s.anchor,n)&&e.remove(n)}))})),this.listenTo(i,"getSelectedContent",((e,[n])=>{const r=n.anchor;!n.isCollapsed&&r.parent.is("element","codeBlock")&&r.hasSameParentAs(n.focus)&&i.change((i=>{const s=e.return;if(r.parent.is("element")&&(s.childCount>1||n.containsEntireContent(r.parent))){const t=i.createElement("codeBlock",r.parent.getAttributes());i.append(s,t);const n=i.createDocumentFragment();return i.append(t,n),void(e.return=n)}const o=s.getChild(0);t.checkAttribute(o,"code")&&i.setAttribute("code",!0,o)}))}))}afterInit(){const e=this.editor,t=e.commands,i=t.get("indent"),n=t.get("outdent");i&&i.registerChildCommand(t.get("indentCodeBlock"),{priority:"highest"}),n&&n.registerChildCommand(t.get("outdentCodeBlock")),this.listenTo(e.editing.view.document,"enter",((t,i)=>{e.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(function(e,t){const i=e.model,n=i.document,r=e.editing.view,s=n.selection.getLastPosition(),o=s.nodeAfter;if(t||!n.selection.isCollapsed||!s.isAtStart)return!1;if(!bv(o))return!1;return e.model.change((t=>{e.execute("enter");const i=n.selection.anchor.parent.previousSibling;t.rename(i,fv),t.setSelection(i,"in"),e.model.schema.removeDisallowedAttributes([i],t),t.remove(o)})),r.scrollToTheSelection(),!0}(e,i.isSoft)||function(e,t){const i=e.model,n=i.document,r=e.editing.view,s=n.selection.getLastPosition(),o=s.nodeBefore;let a;if(t||!n.selection.isCollapsed||!s.isAtEnd||!o||!o.previousSibling)return!1;if(bv(o)&&bv(o.previousSibling))a=i.createRange(i.createPositionBefore(o.previousSibling),i.createPositionAfter(o));else if(wv(o)&&bv(o.previousSibling)&&bv(o.previousSibling.previousSibling))a=i.createRange(i.createPositionBefore(o.previousSibling.previousSibling),i.createPositionAfter(o));else{if(!(wv(o)&&bv(o.previousSibling)&&wv(o.previousSibling.previousSibling)&&o.previousSibling.previousSibling&&bv(o.previousSibling.previousSibling.previousSibling)))return!1;a=i.createRange(i.createPositionBefore(o.previousSibling.previousSibling.previousSibling),i.createPositionAfter(o))}return e.model.change((t=>{t.remove(a),e.execute("enter");const i=n.selection.anchor.parent;t.rename(i,fv),e.model.schema.removeDisallowedAttributes([i],t)})),r.scrollToTheSelection(),!0}(e,i.isSoft)||function(e){const t=e.model,i=t.document;let n;const r=cv(i.selection.getLastPosition(),t);r&&r.is("$text")&&(n=rv(r));e.model.change((t=>{e.execute("shiftEnter"),n&&t.insertText(n,i.selection.anchor)}))}(e),i.preventDefault(),t.stop())}),{context:"pre"}),this._initAriaAnnouncements()}_initAriaAnnouncements(){const{model:e,ui:t,t:i}=this.editor,n=iv(this.editor);let r=null;e.document.selection.on("change:range",(()=>{const s=e.document.selection.focus.parent;t&&r!==s&&s.is("element")&&(r&&r.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(lv(i,n,r,"leave")),s.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(lv(i,n,s,"enter")),r=s)}))}}function wv(e){return e&&e.is("$text")&&!e.data.match(/\S/)}function bv(e){return e&&e.is("element","softBreak")}class _v extends ku{static get pluginName(){return"CodeBlockUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=e.ui.componentFactory,n=iv(e),r=this._getLanguageListItemDefinitions(n),s=e.commands.get("codeBlock");i.add("codeBlock",(i=>{const n=xf(i,Cf),o=n.buttonView,a=t("Insert code block");return o.set({label:a,tooltip:!0,icon:ju.codeBlock,isToggleable:!0}),o.bind("isOn").to(s,"value",(e=>!!e)),o.on("execute",(()=>{e.execute("codeBlock",{usePreviousLanguageChoice:!0}),e.editing.view.focus()})),n.on("execute",(t=>{e.execute("codeBlock",{language:t.source._codeBlockLanguage,forceValue:!0}),e.editing.view.focus()})),n.class="ck-code-block-dropdown",n.bind("isEnabled").to(s),Ef(n,r,{role:"menu",ariaLabel:a}),n})),i.add("menuBar:codeBlock",(i=>{const n=new Wp(i);n.buttonView.set({role:"menuitem",label:t("Code block"),icon:ju.codeBlock}),n.bind("isEnabled").to(s);const o=new $p(i);o.set({ariaLabel:t("Insert code block")});for(const t of r){const r=new hp(i,n),a=new Vg(i);a.bind(...Object.keys(t.model)).to(t.model),a.set({isToggleable:!0,role:"menuitemcheckbox"}),a.delegate("execute").to(n),a.on("execute",(()=>{e.execute("codeBlock",{language:t.model._codeBlockLanguage,forceValue:s.value!=t.model._codeBlockLanguage}),e.editing.view.focus()})),r.children.add(a),o.items.add(r)}return n.panelView.children.add(o),n}))}_getLanguageListItemDefinitions(e){const t=this.editor.commands.get("codeBlock"),i=new es;for(const n of e){const e={type:"button",model:new Bp({_codeBlockLanguage:n.language,label:n.label,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(t=>t===e.model._codeBlockLanguage)),i.add(e)}return i}}class vv extends Tp{view;_toolbarConfig;_elementReplacer;constructor(e,t){super(e),this.view=t,this._toolbarConfig=wf(e.config.get("toolbar")),this._elementReplacer=new Un,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(e){const t=this.editor,i=this.view,n=t.editing.view,r=i.editable,s=n.document.getRoot();r.name=s.rootName,i.render();const o=r.element;this.setEditableElement(r.name,o),i.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(o),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),i.menuBarView&&this._initMenuBar(i.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.getDomRoot(e.editable.name)&&t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:e})=>e||0)),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,t=e.editing.view,i=t.document.getRoot(),n=e.sourceElement;let r;const s=e.config.get("placeholder");s&&(r="string"==typeof s?s:s[this.view.editable.name]),!r&&n&&"textarea"===n.tagName.toLowerCase()&&(r=n.getAttribute("placeholder")),r&&(i.placeholder=r),Io({view:t,element:i,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:e}=this.view,t=this.editor.plugins.get("ContextualBalloon");t.on("getPositionOptions",(t=>{const i=t.return;if(!i||!e.isSticky||!e.element)return;const n=new ur(e.element).height,r="function"==typeof i.target?i.target():i.target,s="function"==typeof i.limiter?i.limiter():i.limiter;if(r&&s&&new ur(r).height>=new ur(s).height-n)return;const o={...i.viewportOffsetConfig},a=(o.top||0)+n;t.return={...i,viewportOffsetConfig:{...o,top:a}}}),{priority:"low"});const i=()=>{t.visibleView&&t.updatePosition()};this.listenTo(e,"change:isSticky",i),this.listenTo(this.editor.ui,"change:viewportOffset",i)}_handleScrollToTheSelectionWithStickyPanel(e,t,i){const n=this.view.stickyPanel;if(n.isSticky){const e=new ur(n.element).height;t.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(n,"change:isSticky",e),setTimeout((()=>{this.stopListening(n,"change:isSticky",e)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,t=this.editor.plugins.get("Dialog");t.on("show",(()=>{const i=t.view;i.on("moveTo",((t,n)=>{if(!e.isSticky||i.wasMoved||i.isModal)return;const r=new ur(e.contentPanelElement);n[1]{const n=new this(e,t);i(n.initPlugins().then((()=>n.ui.init(Cv(e)?e:null))).then((()=>n.data.init(n.config.get("initialData")))).then((()=>n.fire("ready"))).then((()=>n)))}))}}function Cv(e){return Ci(e)}class xv extends xu{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!Av(e.schema,i))do{if(i=i.parent,!i)return}while(!Av(e.schema,i));e.change((e=>{e.setSelection(i,"in")}))}}function Av(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const Tv=jr("Ctrl+A");class Ev extends ku{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=e.editing.view.document;e.commands.add("selectAll",new xv(e)),this.listenTo(i,"keydown",((t,i)=>{Ur(i)===Tv&&(e.execute("selectAll"),i.preventDefault())})),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class Sv extends ku{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",(()=>{const e=this._createButton(hg);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:selectAll",(()=>this._createButton(Vg)))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("selectAll"),r=new e(t.locale),s=i.t;return r.set({label:s("Select all"),icon:'',keystroke:"Ctrl+A"}),r.bind("isEnabled").to(n,"isEnabled"),this.listenTo(r,"execute",(()=>{t.execute("selectAll"),t.editing.view.focus()})),r}}class Pv extends ku{static get requires(){return[Ev,Sv]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}class Iv extends xu{_stack=[];_createdBatches=new WeakSet;constructor(e){super(e),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",((e,t)=>{t[1]={...t[1]};const i=t[1];i.batchType||(i.batchType={isUndoable:!1})}),{priority:"high"}),this.listenTo(e.data,"set",((e,t)=>{t[1].batchType.isUndoable||this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){const n=this.editor.model,r=n.document,s=[],o=e.map((e=>e.getTransformedByOperations(i))),a=o.flat();for(const e of o){const t=e.filter((e=>e.root!=r.graveyard)).filter((e=>!Rv(e,a)));t.length&&(Vv(t),s.push(t[0]))}s.length&&n.change((e=>{e.setSelection(s,{backward:t})}))}_undo(e,t){const i=this.editor.model,n=i.document;this._createdBatches.add(t);const r=e.operations.slice().filter((e=>e.isDocumentOperation));r.reverse();for(const e of r){const r=e.baseVersion+1,s=Array.from(n.history.getOperations(r)),o=Sh([e.getReversed()],s,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let r of o){const s=r.affectedSelectable;s&&!i.canEditAt(s)&&(r=new bh(r.baseVersion)),t.addOperation(r),i.applyOperation(r),n.history.setOperationAsUndone(e,r)}}}}function Vv(e){e.sort(((e,t)=>e.start.isBefore(t.start)?-1:1));for(let t=1;tt!==e&&t.containsRange(e,!0)))}class Bv extends Iv{execute(e=null){const t=e?this._stack.findIndex((t=>t.batch==e)):this._stack.length-1,i=this._stack.splice(t,1)[0],n=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(n,(()=>{this._undo(i.batch,n);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e)})),this.fire("revert",i.batch,n),this.refresh()}}class Ov extends Iv{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,(()=>{const i=e.batch.operations[e.batch.operations.length-1].baseVersion+1,n=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,n),this._undo(e.batch,t)})),this.refresh()}}class Fv extends ku{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;this._undoCommand=new Bv(e),this._redoCommand=new Ov(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",((e,t)=>{const i=t[0];if(!i.isDocumentOperation)return;const n=i.batch,r=this._redoCommand.createdBatches.has(n),s=this._undoCommand.createdBatches.has(n);this._batchRegistry.has(n)||(this._batchRegistry.add(n),n.isUndoable&&(r?this._undoCommand.addBatch(n):s||(this._undoCommand.addBatch(n),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((e,t,i)=>{this._redoCommand.addBatch(i)})),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class Mv extends ku{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,i=e.t,n="ltr"==t.uiLanguageDirection?ju.undo:ju.redo,r="ltr"==t.uiLanguageDirection?ju.redo:ju.undo;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",n),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",r)}_addButtonsToFactory(e,t,i,n){const r=this.editor;r.ui.componentFactory.add(e,(()=>{const r=this._createButton(hg,e,t,i,n);return r.set({tooltip:!0}),r})),r.ui.componentFactory.add("menuBar:"+e,(()=>this._createButton(Vg,e,t,i,n)))}_createButton(e,t,i,n,r){const s=this.editor,o=s.locale,a=s.commands.get(t),l=new e(o);return l.set({label:i,icon:r,keystroke:n}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",(()=>{s.execute(t),s.editing.view.focus()})),l}}class Nv extends ku{static get requires(){return[Fv,Mv]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}class Lv extends ng{children;_findInputView;_replaceInputView;_findButtonView;_findPrevButtonView;_findNextButtonView;_advancedOptionsCollapsibleView;_matchCaseSwitchView;_wholeWordsOnlySwitchView;_replaceButtonView;_replaceAllButtonView;_inputsDivView;_actionButtonsDivView;_focusTracker;_keystrokes;_focusables;focusCycler;constructor(e){super(e);const t=e.t;this.children=this.createCollection(),this.set("matchCount",0),this.set("highlightOffset",0),this.set("isDirty",!1),this.set("_areCommandsEnabled",{}),this.set("_resultsCounterText",""),this.set("_matchCase",!1),this.set("_wholeWordsOnly",!1),this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",((e,t)=>e>0&&!t)),this._findInputView=this._createInputField(t("Find in text…")),this._findPrevButtonView=this._createButton({label:t("Previous result"),class:"ck-button-prev",icon:ju.previousArrow,keystroke:"Shift+F3",tooltip:!0}),this._findNextButtonView=this._createButton({label:t("Next result"),class:"ck-button-next",icon:ju.previousArrow,keystroke:"F3",tooltip:!0}),this._replaceInputView=this._createInputField(t("Replace with…"),"ck-labeled-field-replace"),this._inputsDivView=this._createInputsDiv(),this._matchCaseSwitchView=this._createMatchCaseSwitch(),this._wholeWordsOnlySwitchView=this._createWholeWordsOnlySwitch(),this._advancedOptionsCollapsibleView=this._createAdvancedOptionsCollapsible(),this._replaceAllButtonView=this._createButton({label:t("Replace all"),class:"ck-button-replaceall",withText:!0}),this._replaceButtonView=this._createButton({label:t("Replace"),class:"ck-button-replace",withText:!0}),this._findButtonView=this._createButton({label:t("Find"),class:"ck-button-find ck-button-action",withText:!0}),this._actionButtonsDivView=this._createActionButtonsDiv(),this._focusTracker=new is,this._keystrokes=new os,this._focusables=new Fm,this.focusCycler=new mg({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.addMany([this._inputsDivView,this._advancedOptionsCollapsibleView,this._actionButtonsDivView]),this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:this.children})}render(){super.render(),og({view:this}),this._initFocusCycling(),this._initKeystrokeHandling()}destroy(){super.destroy(),this._focusTracker.destroy(),this._keystrokes.destroy()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}reset(){this._findInputView.errorText=null,this.isDirty=!0}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createInputsDiv(){const e=this.locale,t=e.t,i=new ng(e);return this._findInputView.fieldView.on("input",(()=>{this.isDirty=!0})),this._findPrevButtonView.delegate("execute").to(this,"findPrevious"),this._findNextButtonView.delegate("execute").to(this,"findNext"),this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findPrevious:e})=>e)),this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findNext:e})=>e)),this._injectFindResultsCounter(),this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:e},t)=>e&&t)),this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",((e,i)=>e||!i?"":t("Tip: Find some text first in order to replace it."))),i.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__inputs"]},children:[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView]}),i}_onFindButtonExecute(){if(this._textToFind)this.isDirty=!1,this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly});else{const e=this.t;this._findInputView.errorText=e("Text to find must not be empty.")}}_injectFindResultsCounter(){const e=this.locale,t=e.t,i=this.bindTemplate,n=new ng(this.locale);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",((e,i)=>t("%0 of %1",[e,i]))),n.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",i.if("isDirty","ck-hidden")]},children:[{text:i.to("_resultsCounterText")}]});const r=()=>{const t=this._findInputView.fieldView.element;if(!t||!xr(t))return;const i=new ur(n.element).width,r="ltr"===e.uiLanguageDirection?"paddingRight":"paddingLeft";t.style[r]=i?`calc( 2 * var(--ck-spacing-standard) + ${i}px )`:""};this.on("change:_resultsCounterText",r,{priority:"low"}),this.on("change:isDirty",r,{priority:"low"}),this._findInputView.template.children[0].children.push(n)}_createAdvancedOptionsCollapsible(){const e=this.locale.t,t=new Ug(this.locale,[this._matchCaseSwitchView,this._wholeWordsOnlySwitchView]);return t.set({label:e("Advanced options"),isCollapsed:!0}),t}_createActionButtonsDiv(){const e=new ng(this.locale);return this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:e},t)=>e&&t)),this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replaceAll:e},t)=>e&&t)),this._replaceButtonView.on("execute",(()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})})),this._replaceAllButtonView.on("execute",(()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace}),this.focus()})),this._findButtonView.on("execute",this._onFindButtonExecute.bind(this)),e.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__actions"]},children:[this._replaceAllButtonView,this._replaceButtonView,this._findButtonView]}),e}_createMatchCaseSwitch(){const e=this.locale.t,t=new Lg(this.locale);return t.set({label:e("Match case"),withText:!0}),t.bind("isOn").to(this,"_matchCase"),t.on("execute",(()=>{this._matchCase=!this._matchCase,this.isDirty=!0})),t}_createWholeWordsOnlySwitch(){const e=this.locale.t,t=new Lg(this.locale);return t.set({label:e("Whole words only"),withText:!0}),t.bind("isOn").to(this,"_wholeWordsOnly"),t.on("execute",(()=>{this._wholeWordsOnly=!this._wholeWordsOnly,this.isDirty=!0})),t}_initFocusCycling(){[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._advancedOptionsCollapsibleView.buttonView,this._matchCaseSwitchView,this._wholeWordsOnlySwitchView,this._replaceAllButtonView,this._replaceButtonView,this._findButtonView].forEach((e=>{this._focusables.add(e),this._focusTracker.add(e.element)}))}_initKeystrokeHandling(){const e=e=>e.stopPropagation(),t=e=>{e.stopPropagation(),e.preventDefault()};this._keystrokes.listenTo(this.element),this._keystrokes.set("f3",(e=>{t(e),this._findNextButtonView.fire("execute")})),this._keystrokes.set("shift+f3",(e=>{t(e),this._findPrevButtonView.fire("execute")})),this._keystrokes.set("enter",(e=>{const i=e.target;i===this._findInputView.fieldView.element?(this._areCommandsEnabled.findNext?this._findNextButtonView.fire("execute"):this._findButtonView.fire("execute"),t(e)):i!==this._replaceInputView.fieldView.element||this.isDirty||(this._replaceButtonView.fire("execute"),t(e))})),this._keystrokes.set("shift+enter",(e=>{e.target===this._findInputView.fieldView.element&&(this._areCommandsEnabled.findPrevious?this._findPrevButtonView.fire("execute"):this._findButtonView.fire("execute"),t(e))})),this._keystrokes.set("arrowright",e),this._keystrokes.set("arrowleft",e),this._keystrokes.set("arrowup",e),this._keystrokes.set("arrowdown",e)}_createButton(e){const t=new hg(this.locale);return t.set(e),t}_createInputField(e,t){const i=new Yg(this.locale,Rf);return i.label=e,i.class=t,i}}var Dv='';class zv extends ku{static get requires(){return[Sg]}static get pluginName(){return"FindAndReplaceUI"}static get isOfficialPlugin(){return!0}formView;constructor(e){super(e),e.config.define("findAndReplace.uiType","dialog"),this.formView=null}init(){const e=this.editor,t="dropdown"===e.config.get("findAndReplace.uiType"),i=e.commands.get("find"),n=this.editor.t;e.ui.componentFactory.add("findAndReplace",(()=>{let n;return t?(n=this._createDropdown(),n.bind("isEnabled").to(i)):n=this._createDialogButtonForToolbar(),e.keystrokes.set("Ctrl+F",((t,r)=>{if(i.isEnabled){if(n instanceof sf){const e=n.buttonView;e.isOn||e.fire("execute")}else n.isOn?e.plugins.get("Dialog").view.focus():n.fire("execute");r()}})),n})),t||e.ui.componentFactory.add("menuBar:findAndReplace",(()=>this._createDialogButtonForMenuBar())),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Find in the document"),keystroke:"CTRL+F"}]})}_createDropdown(){const e=this.editor,t=e.locale.t,i=xf(e.locale);return i.once("change:isOpen",(()=>{this.formView=this._createFormView(),this.formView.children.add(new ug(e.locale,{label:t("Find and replace")}),0),i.panelView.children.add(this.formView)})),i.on("change:isOpen",((e,t,i)=>{i?this._setupFormView():this.fire("searchReseted")}),{priority:"low"}),i.buttonView.set({icon:Dv,label:t("Find and replace"),keystroke:"CTRL+F",tooltip:!0}),i}_createDialogButtonForToolbar(){const e=this.editor,t=this._createButton(hg),i=e.plugins.get("Dialog");return t.set({tooltip:!0}),t.bind("isOn").to(i,"id",(e=>"findAndReplace"===e)),t.on("execute",(()=>{t.isOn?i.hide():this._showDialog()})),t}_createDialogButtonForMenuBar(){const e=this._createButton(Vg),t=this.editor.plugins.get("Dialog"),i=this.editor.plugins.get("Dialog");return e.set({role:"menuitemcheckbox",isToggleable:!0}),e.bind("isOn").to(i,"id",(e=>"findAndReplace"===e)),e.on("execute",(()=>{"findAndReplace"!==t.id?this._showDialog():t.hide()})),e}_createButton(e){const t=this.editor,i=t.commands.get("find"),n=new e(t.locale),r=t.locale.t;return n.bind("isEnabled").to(i),n.set({icon:Dv,label:r("Find and replace"),keystroke:"CTRL+F"}),n}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.formView||(this.formView=this._createFormView()),t.show({id:"findAndReplace",title:i("Find and replace"),content:this.formView,position:yg,onShow:()=>{this._setupFormView()},onHide:()=>{this.fire("searchReseted")}})}_createFormView(){const e=this.editor,t=new(sg(Lv))(e.locale),i=e.commands,n=this.editor.plugins.get("FindAndReplaceEditing").state;t.bind("highlightOffset").to(n,"highlightedOffset"),t.listenTo(n.results,"change",(()=>{t.matchCount=n.results.length}));const r=i.get("findNext"),s=i.get("findPrevious"),o=i.get("replace"),a=i.get("replaceAll");return t.bind("_areCommandsEnabled").to(r,"isEnabled",s,"isEnabled",o,"isEnabled",a,"isEnabled",((e,t,i,n)=>({findNext:e,findPrevious:t,replace:i,replaceAll:n}))),t.delegate("findNext","findPrevious","replace","replaceAll").to(this),t.on("change:isDirty",((e,t,i)=>{i&&this.fire("searchReseted")})),t}_setupFormView(){this.formView.disableCssTransitions(),this.formView.reset(),this.formView._findInputView.fieldView.select(),this.formView.enableCssTransitions()}}class Hv extends xu{_state;constructor(e,t){super(e),this.isEnabled=!0,this.affectsData=!1,this._state=t}execute(e,{matchCase:t,wholeWords:i}={}){const{editor:n}=this,{model:r}=n,s=n.plugins.get("FindAndReplaceUtils");let o,a="";o="string"==typeof e?(...n)=>({results:s.findByTextCallback(e,{matchCase:t,wholeWords:i})(...n),searchText:e}):e;const l=o;o=(...e)=>{const t=l(...e);return t&&"searchText"in t&&(a=t.searchText),t};const c=r.document.getRootNames().reduce(((e,t)=>s.updateFindResultFromRange(r.createRangeIn(r.document.getRoot(t)),r,o,e)),null);return this._state.clear(r),this._state.results.addMany(c),this._state.highlightedResult=c.get(0),this._state.searchText=a,o&&(this._state.lastSearchCallback=o),this._state.matchCase=!!t,this._state.matchWholeWords=!!i,{results:c,findCallback:o}}}class Wv extends(Ln()){constructor(e){super(),this.set("results",new es),this.set("highlightedResult",null),this.set("highlightedOffset",0),this.set("searchText",""),this.set("replaceText",""),this.set("lastSearchCallback",null),this.set("matchCase",!1),this.set("matchWholeWords",!1),this.results.on("change",((t,{removed:i,index:n})=>{if(Array.from(i).length){let t=!1;if(e.change((n=>{for(const r of i)this.highlightedResult===r&&(t=!0),e.markers.has(r.marker.name)&&n.removeMarker(r.marker)})),t){const e=n>=this.results.length?0:n;this.highlightedResult=this.results.get(e)}}})),this.on("change:highlightedResult",(()=>{this.refreshHighlightOffset(e)}))}clear(e){this.searchText="",e.change((t=>{if(this.highlightedResult){const i=this.highlightedResult.marker.name.split(":")[1],n=e.markers.get(`findResultHighlighted:${i}`);n&&t.removeMarker(n)}[...this.results].forEach((({marker:e})=>{t.removeMarker(e)}))})),this.results.clear()}refreshHighlightOffset(e){const{highlightedResult:t,results:i}=this;this.highlightedOffset=t?$v(e,[...i]).indexOf(t)+1:0}}function $v(e,t){const i={before:-1,same:0,after:1,different:1};return e.document.getRootNames().flatMap((e=>t.filter((t=>t.marker.getStart().root.rootName===e)).sort(((e,t)=>i[e.marker.getStart().compareWith(t.marker.getStart())]))))}class Uv extends xu{_state;constructor(e,t){super(e),this.isEnabled=!0,this._state=t,this._isEnabledBasedOnSelection=!1}_replace(e,t){const{model:i}=this.editor,n=t.marker.getRange();i.canEditAt(n)&&i.change((r=>{if("$graveyard"===n.root.rootName)return void this._state.results.remove(t);let s={};for(const e of n.getItems())if(e.is("$text")||e.is("$textProxy")){s=e.getAttributes();break}i.insertContent(r.createText(e,s),n),this._state.results.has(t)&&this._state.results.remove(t)}))}}class jv extends Uv{execute(e,t){const i=Math.max(this._state.highlightedOffset-1,0);if(this._replace(e,t),this._state.results.length){const e=$v(this.editor.model,[...this._state.results]);this._state.highlightedResult=e[i%e.length]}}}class qv extends Uv{execute(e,t){const{editor:i}=this,{model:n}=i,r=i.plugins.get("FindAndReplaceUtils"),s=t instanceof es?t:n.document.getRootNames().reduce(((e,i)=>r.updateFindResultFromRange(n.createRangeIn(n.document.getRoot(i)),n,r.findByTextCallback(t,this._state),e)),null);s.length&&n.change((()=>{[...s].forEach((t=>{this._replace(e,t)}))}))}}class Gv extends xu{_state;constructor(e,t){super(e),this.affectsData=!1,this._state=t,this.isEnabled=!1,this.listenTo(this._state.results,"change",(()=>{this.isEnabled=this._state.results.length>1}))}refresh(){this.isEnabled=this._state.results.length>1}execute(){const e=this._state.results,t=e.getIndex(this._state.highlightedResult),i=t+1>=e.length?0:t+1;this._state.highlightedResult=this._state.results.get(i)}}class Kv extends Gv{execute(){const e=this._state.results.getIndex(this._state.highlightedResult),t=e-1<0?this._state.results.length-1:e-1;this._state.highlightedResult=this._state.results.get(t)}}class Zv extends ku{static get pluginName(){return"FindAndReplaceUtils"}static get isOfficialPlugin(){return!0}updateFindResultFromRange(e,t,i,n){const r=n||new es;return t.change((n=>{[...e].forEach((({type:e,item:s})=>{if("elementStart"===e&&t.schema.checkChild(s,"$text")){let e=i({item:s,text:this.rangeToText(t.createRangeIn(s))});if(!e)return;"results"in e&&(e=e.results),e.forEach((e=>{const t=`findResult:${hn()}`,i=n.addMarker(t,{usingOperation:!1,affectsData:!1,range:n.createRange(n.createPositionAt(s,e.start),n.createPositionAt(s,e.end))}),o=function(e,t){const i=e.find((({marker:e})=>t.getStart().isBefore(e.getStart())));return i?e.getIndex(i):e.length}(r,i);(e=>r.find((t=>{const{marker:i}=t,n=i.getRange(),r=e.getRange();return n.isEqual(r)})))(i)||r.add({id:t,label:e.label,marker:i},o)}))}}))})),r}rangeToText(e){return Array.from(e.getItems()).reduce(((e,t)=>t.is("$text")||t.is("$textProxy")?e+t.data:`${e}\n`),"")}findByTextCallback(e,t){let i="gu";t.matchCase||(i+="i");let n=`(${Yu(e)})`;if(t.wholeWords){const t="[^a-zA-ZÀ-ɏḀ-ỿ]";new RegExp("^"+t).test(e)||(n=`(^|${t}|_)${n}`),new RegExp(t+"$").test(e)||(n=`${n}(?=_|${t}|$)`)}const r=new RegExp(n,i);return function({text:e}){return[...e.matchAll(r)].map(Jv)}}}function Jv(e){const t=e.length-1;let i=e.index;return 3===e.length&&(i+=e[1].length),{label:e[t],start:i,end:i+e[t].length}}class Qv extends ku{static get requires(){return[Zv]}static get pluginName(){return"FindAndReplaceEditing"}static get isOfficialPlugin(){return!0}state;init(){this.state=new Wv(this.editor.model),this.set("_isSearchActive",!1),this._defineConverters(),this._defineCommands(),this.listenTo(this.state,"change:highlightedResult",((e,t,i,n)=>{const{model:r}=this.editor;r.change((e=>{if(n){const t=n.marker.name.split(":")[1],i=r.markers.get(`findResultHighlighted:${t}`);i&&e.removeMarker(i)}if(i){const t=i.marker.name.split(":")[1];e.addMarker(`findResultHighlighted:${t}`,{usingOperation:!1,affectsData:!1,range:i.marker.getRange()})}}))}));const e=no(((e,t,i)=>{if(i){const e=this.editor.editing.view.domConverter,t=this.editor.editing.mapper.toViewRange(i.marker.getRange());Pr({target:e.viewRangeToDom(t),viewportOffset:40})}}).bind(this),32);this.listenTo(this.state,"change:highlightedResult",e,{priority:"low"}),this.listenTo(this.editor,"destroy",e.cancel),this.on("change:_isSearchActive",((e,t,i)=>{i?this.listenTo(this.editor.model.document,"change:data",this._onDocumentChange):this.stopListening(this.editor.model.document,"change:data",this._onDocumentChange)}))}find(e,t){return this._isSearchActive=!0,this.editor.execute("find",e,t),this.state.results}stop(){this.state.clear(this.editor.model),this._isSearchActive=!1}_defineCommands(){this.editor.commands.add("find",new Hv(this.editor,this.state)),this.editor.commands.add("findNext",new Gv(this.editor,this.state)),this.editor.commands.add("findPrevious",new Kv(this.editor,this.state)),this.editor.commands.add("replace",new jv(this.editor,this.state)),this.editor.commands.add("replaceAll",new qv(this.editor,this.state))}_defineConverters(){const{editor:e}=this;e.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:e})=>{const[,t]=e.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":t}}}}),e.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:e})=>{const[,t]=e.split(":");return{name:"span",classes:["ck-find-result_selected"],attributes:{"data-find-result":t}}}})}_onDocumentChange=()=>{const e=new Set,t=new Set,i=this.editor.model,{results:n}=this.state,r=i.document.differ.getChanges(),s=i.document.differ.getChangedMarkers();r.forEach((n=>{n.position&&("$text"===n.name||n.position.nodeAfter&&i.schema.isInline(n.position.nodeAfter)?(e.add(n.position.parent),[...i.markers.getMarkersAtPosition(n.position)].forEach((e=>{t.add(e.name)}))):"insert"===n.type&&n.position.nodeAfter&&e.add(n.position.nodeAfter))})),s.forEach((({name:e,data:{newRange:i}})=>{i&&"$graveyard"===i.start.root.rootName&&t.add(e)})),e.forEach((e=>{[...i.markers.getMarkersIntersectingRange(i.createRangeIn(e))].forEach((e=>t.add(e.name)))})),t.forEach((e=>{n.has(e)&&(n.get(e)===this.state.highlightedResult&&(this.state.highlightedResult=null),n.remove(e))}));const o=[],a=this.editor.plugins.get("FindAndReplaceUtils");e.forEach((e=>{const t=a.updateFindResultFromRange(i.createRangeOn(e),i,this.state.lastSearchCallback,n);o.push(...t)})),s.forEach((e=>{if(e.data.newRange){const t=a.updateFindResultFromRange(e.data.newRange,i,this.state.lastSearchCallback,n);o.push(...t)}})),!this.state.highlightedResult&&o.length?this.state.highlightedResult=o[0]:this.state.refreshHighlightOffset(i)}}class Yv extends xu{attributeKey;constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,n=e.value,r=e.batch,s=e=>{if(i.isCollapsed)n?e.setSelectionAttribute(this.attributeKey,n):e.removeSelectionAttribute(this.attributeKey);else{const r=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of r)n?e.setAttribute(this.attributeKey,n,t):e.removeAttribute(this.attributeKey,t)}};r?t.enqueueChange(r,(e=>{s(e)})):t.change((e=>{s(e)}))}}const Xv="fontSize",ey="fontFamily",ty="fontColor",iy="fontBackgroundColor";function ny(e,t){const i={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t)i.model.values.push(e.model),i.view[e.model]=e.view,e.upcastAlso&&(i.upcastAlso[e.model]=e.upcastAlso);return i}function ry(e){return t=>t.getStyle(e).replace(/\s/g,"")}function sy(e){return(t,{writer:i})=>i.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class oy extends Yv{constructor(e){super(e,ey)}}function ay(e){return e.map(ly).filter((e=>void 0!==e))}function ly(e){return"object"==typeof e?e:"default"===e?{title:"Default",model:void 0}:"string"==typeof e?function(e){const t=e.replace(/"|'/g,"").split(","),i=t[0],n=t.map(cy).join(", ");return{title:i,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}(e):void 0}function cy(e){return(e=e.trim()).indexOf(" ")>0&&(e=`'${e}'`),e}class hy extends ku{static get pluginName(){return"FontFamilyEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(ey,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:ey}),e.model.schema.setAttributeProperties(ey,{isFormatting:!0,copyOnEnter:!0});const t=ay(e.config.get("fontFamily.options")).filter((e=>e.model)),i=ny(ey,t);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(i),e.commands.add(ey,new oy(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:ey,view:(e,{writer:t})=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:ey,value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:ey,value:e=>e.getAttribute("face")}})}}var dy='';class uy extends ku{static get pluginName(){return"FontFamilyUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=this._getLocalizedOptions(),n=e.commands.get(ey),r=t("Font Family"),s=function(e,t){const i=new es;for(const n of e){const e={type:"button",model:new Bp({commandName:ey,commandParam:n.model,label:n.title,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(e=>e===n.model||!(!e||!n.model)&&e.split(",")[0].replace(/'/g,"").toLowerCase()===n.model.toLowerCase())),n.view&&"string"!=typeof n.view&&n.view.styles&&e.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`),i.add(e)}return i}(i,n);e.ui.componentFactory.add(ey,(t=>{const i=xf(t);return Ef(i,s,{role:"menu",ariaLabel:r}),i.buttonView.set({label:r,icon:dy,tooltip:!0}),i.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),i.bind("isEnabled").to(n),this.listenTo(i,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),i})),e.ui.componentFactory.add(`menuBar:${ey}`,(t=>{const i=new Wp(t);i.buttonView.set({label:r,icon:dy}),i.bind("isEnabled").to(n);const o=new $p(t);for(const n of s){const r=new hp(t,i),s=new Vg(t);s.set({role:"menuitemradio",isToggleable:!0}),s.bind(...Object.keys(n.model)).to(n.model),s.delegate("execute").to(i),s.on("execute",(()=>{e.execute(n.model.commandName,{value:n.model.commandParam}),e.editing.view.focus()})),r.children.add(s),o.items.add(r)}return i.panelView.children.add(o),i}))}_getLocalizedOptions(){const e=this.editor,t=e.t;return ay(e.config.get(ey).options).map((e=>("Default"===e.title&&(e.title=t("Default")),e)))}}class my extends ku{static get requires(){return[hy,uy]}static get pluginName(){return"FontFamily"}static get isOfficialPlugin(){return!0}}class gy extends Yv{constructor(e){super(e,Xv)}}function fy(e){return e.map((e=>function(e){"number"==typeof e&&(e=String(e));if("object"==typeof e&&(t=e,t.title&&t.model&&t.view))return wy(e);var t;const i=function(e){return"string"==typeof e?py[e]:py[e.model]}(e);if(i)return wy(i);if("default"===e)return{model:void 0,title:"Default"};if(function(e){let t;if("object"==typeof e){if(!e.model)throw new gn("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e))return;return function(e){"string"==typeof e&&(e={title:e,model:`${parseFloat(e)}px`});return e.view={name:"span",styles:{"font-size":e.model}},wy(e)}(e)}(e))).filter((e=>void 0!==e))}const py={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function wy(e){return e.view&&"string"!=typeof e.view&&!e.view.priority&&(e.view.priority=7),e}const by=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class _y extends ku{static get pluginName(){return"FontSizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(Xv,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Xv}),e.model.schema.setAttributeProperties(Xv,{isFormatting:!0,copyOnEnter:!0});const t=e.config.get("fontSize.supportAllValues"),i=fy(this.editor.config.get("fontSize.options")).filter((e=>e.model)),n=ny(Xv,i);t?(this._prepareAnyValueConverters(n),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(n),e.commands.add(Xv,new gy(e))}_prepareAnyValueConverters(e){const t=this.editor,i=e.model.values.filter((e=>!Md(String(e))&&!Ld(String(e))));if(i.length)throw new gn("font-size-invalid-use-of-named-presets",null,{presets:i});t.conversion.for("downcast").attributeToElement({model:Xv,view:(e,{writer:t})=>{if(e)return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}}),t.conversion.for("upcast").elementToAttribute({model:{key:Xv,value:e=>e.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:Xv,value:e=>{const t=e.getAttribute("size"),i="-"===t[0]||"+"===t[0];let n=parseInt(t,10);i&&(n=3+n);const r=by.length-1,s=Math.min(Math.max(n,0),r);return by[s]}}})}}var vy='';class yy extends ku{static get pluginName(){return"FontSizeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=this._getLocalizedOptions(),n=e.commands.get(Xv),r=t("Font Size"),s=function(e,t){const i=new es;for(const n of e){const e={type:"button",model:new Bp({commandName:Xv,commandParam:n.model,label:n.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};n.view&&"string"!=typeof n.view&&(n.view.styles&&e.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`),n.view.classes&&e.model.set("class",`${e.model.class} ${n.view.classes}`)),e.model.bind("isOn").to(t,"value",(e=>e===n.model)),i.add(e)}return i}(i,n);e.ui.componentFactory.add(Xv,(t=>{const i=xf(t);return Ef(i,s,{role:"menu",ariaLabel:r}),i.buttonView.set({label:r,icon:vy,tooltip:!0}),i.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),i.bind("isEnabled").to(n),this.listenTo(i,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),i})),e.ui.componentFactory.add(`menuBar:${Xv}`,(t=>{const i=new Wp(t);i.buttonView.set({label:r,icon:vy}),i.bind("isEnabled").to(n);const o=new $p(t);for(const n of s){const r=new hp(t,i),s=new Vg(t);s.set({role:"menuitemradio",isToggleable:!0}),s.bind(...Object.keys(n.model)).to(n.model),s.delegate("execute").to(i),s.on("execute",(()=>{e.execute(n.model.commandName,{value:n.model.commandParam}),e.editing.view.focus()})),r.children.add(s),o.items.add(r)}return i.panelView.children.add(o),i}))}_getLocalizedOptions(){const e=this.editor,t=e.t,i={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};return fy(e.config.get(Xv).options).map((e=>{const t=i[e.title];return t&&t!=e.title&&(e=Object.assign({},e,{title:t})),e}))}}class ky extends ku{static get requires(){return[_y,yy]}static get pluginName(){return"FontSize"}static get isOfficialPlugin(){return!0}normalizeSizeOptions(e){return fy(e)}}class Cy extends Yv{constructor(e){super(e,ty)}}class xy extends ku{static get pluginName(){return"FontColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(ty,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:ty,value:ry("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:ty,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:ty,view:sy("color")}),e.commands.add(ty,new Cy(e)),e.model.schema.extend("$text",{allowAttributes:ty}),e.model.schema.setAttributeProperties(ty,{isFormatting:!0,copyOnEnter:!0})}}class Ay extends ku{commandName;componentName;icon;dropdownLabel;columns;constructor(e,{commandName:t,componentName:i,icon:n,dropdownLabel:r}){super(e),this.commandName=t,this.componentName=i,this.icon=n,this.dropdownLabel=r,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,t=e.locale,i=t.t,n=e.commands.get(this.commandName),r=e.config.get(this.componentName),s=jg(t,qg(r.colors)),o=r.documentColors,a=!1!==r.colorPicker;e.ui.componentFactory.add(this.componentName,(t=>{const l=xf(t);let c=!1;const h=function({dropdownView:e,colors:t,columns:i,removeButtonLabel:n,colorPickerLabel:r,documentColorsLabel:s,documentColorsCount:o,colorPickerViewConfig:a}){const l=e.locale,c=new Uf(l,{colors:t,columns:i,removeButtonLabel:n,colorPickerLabel:r,documentColorsLabel:s,documentColorsCount:o,colorPickerViewConfig:a});return e.colorSelectorView=c,e.panelView.children.add(c),c}({dropdownView:l,colors:s.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:0!==o?i("Document colors"):"",documentColorsCount:void 0===o?this.columns:o,colorPickerViewConfig:!!a&&(r.colorPicker||{})});return h.bind("selectedColor").to(n,"value"),l.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),l.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),l.bind("isEnabled").to(n),h.on("execute",((t,i)=>{l.isOpen&&e.execute(this.commandName,{value:i.value,batch:this._undoStepBatch}),"colorPicker"!==i.source&&e.editing.view.focus(),"colorPickerSaveButton"===i.source&&(l.isOpen=!1)})),h.on("colorPicker:show",(()=>{this._undoStepBatch=e.model.createBatch()})),h.on("colorPicker:cancel",(()=>{this._undoStepBatch.operations.length&&(l.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()})),l.on("change:isOpen",((t,i,n)=>{c||(c=!0,l.colorSelectorView.appendUI()),n&&(0!==o&&h.updateDocumentColors(e.model,this.componentName),h.updateSelectedColors(),h.showColorGridsFragment())})),Pf(l,(()=>l.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find((e=>e.isOn)))),l})),e.ui.componentFactory.add(`menuBar:${this.componentName}`,(t=>{const r=new Wp(t);r.buttonView.set({label:this.dropdownLabel,icon:this.icon}),r.bind("isEnabled").to(n);let a=!1;const l=new Uf(t,{colors:s.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:0!==o?i("Document colors"):"",documentColorsCount:void 0===o?this.columns:o,colorPickerViewConfig:!1});return l.bind("selectedColor").to(n,"value"),l.delegate("execute").to(r),l.on("execute",((t,i)=>{e.execute(this.commandName,{value:i.value,batch:this._undoStepBatch}),e.editing.view.focus()})),r.on("change:isOpen",((t,i,n)=>{a||(a=!0,l.appendUI()),n&&(0!==o&&l.updateDocumentColors(e.model,this.componentName),l.updateSelectedColors(),l.showColorGridsFragment())})),r.panelView.children.add(l),r}))}}class Ty extends Ay{constructor(e){const t=e.locale.t;super(e,{commandName:ty,componentName:ty,icon:'',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class Ey extends ku{static get requires(){return[xy,Ty]}static get pluginName(){return"FontColor"}static get isOfficialPlugin(){return!0}}class Sy extends Yv{constructor(e){super(e,iy)}}class Py extends ku{static get pluginName(){return"FontBackgroundColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(iy,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(Yd),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:iy,value:ry("background-color")}}),e.conversion.for("downcast").attributeToElement({model:iy,view:sy("background-color")}),e.commands.add(iy,new Sy(e)),e.model.schema.extend("$text",{allowAttributes:iy}),e.model.schema.setAttributeProperties(iy,{isFormatting:!0,copyOnEnter:!0})}}class Iy extends Ay{constructor(e){const t=e.locale.t;super(e,{commandName:iy,componentName:iy,icon:'',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Vy extends ku{static get requires(){return[Py,Iy]}static get pluginName(){return"FontBackgroundColor"}static get isOfficialPlugin(){return!0}}class Ry extends xu{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=ts(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&By(t,e.schema)}execute(e={}){const t=this.editor.model,i=t.document,n=e.selection||i.selection;t.canEditAt(n)&&t.change((e=>{const i=n.getSelectedBlocks();for(const n of i)!n.is("element","paragraph")&&By(n,t.schema)&&e.rename(n,"paragraph")}))}}function By(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class Oy extends xu{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,i=e.attributes;let n=e.position;return t.canEditAt(n)?t.change((e=>{if(n=this._findPositionToInsertParagraph(n,e),!n)return null;const r=e.createElement("paragraph");return i&&t.schema.setAllowedAttributes(r,i,e),t.insertContent(r,n),e.setSelection(r,"in"),e.createPositionAt(r,0)})):null}_findPositionToInsertParagraph(e,t){const i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;const n=i.schema.findAllowedParent(e,"paragraph");if(!n)return null;const r=e.parent,s=i.schema.checkChild(r,"$text");return r.isEmpty||s&&e.isAtEnd?i.createPositionAfter(r):!r.isEmpty&&s&&e.isAtStart?i.createPositionBefore(r):t.split(e,n).position}}class Fy extends ku{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Ry(e)),e.commands.add("insertParagraph",new Oy(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>Fy.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])}class My extends xu{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){const e=ts(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t=>Ny(e,t,this.editor.model.schema)))}execute(e){const t=this.editor.model,i=t.document,n=e.value;t.change((e=>{const r=Array.from(i.selection.getSelectedBlocks()).filter((e=>Ny(e,n,t.schema)));for(const t of r)t.is("element",n)||e.rename(t,n)}))}}function Ny(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const Ly="paragraph";class Dy extends ku{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Fy]}init(){const e=this.editor,t=e.config.get("heading.options"),i=[];for(const n of t)"paragraph"!==n.model&&(e.model.schema.register(n.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(n),i.push(n.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new My(e,i))}afterInit(){const e=this.editor,t=e.commands.get("enter"),i=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",((t,n)=>{const r=e.model.document.selection.getFirstPosition().parent;i.some((e=>r.is("element",e.model)))&&!r.is("element",Ly)&&0===r.childCount&&n.writer.rename(r,Ly)}))}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:dn.low+1})}}function zy(e){const t=e.t,i={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map((e=>{const t=i[e.title];return t&&t!=e.title&&(e.title=t),e}))}class Hy extends ku{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=zy(e),n=t("Choose heading"),r=t("Heading");e.ui.componentFactory.add("heading",(t=>{const s={},o=new es,a=e.commands.get("heading"),l=e.commands.get("paragraph"),c=[a];for(const e of i){const t={type:"button",model:new Bp({label:e.title,class:e.class,role:"menuitemradio",withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),c.push(l)):(t.model.bind("isOn").to(a,"value",(t=>t===e.model)),t.model.set({commandName:"heading",commandValue:e.model})),o.add(t),s[e.model]=e.title}const h=xf(t);return Ef(h,o,{ariaLabel:r,role:"menu"}),h.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),h.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),h.bind("isEnabled").toMany(c,"isEnabled",((...e)=>e.some((e=>e)))),h.buttonView.bind("label").to(a,"value",l,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?n:s[i]?s[i]:n})),h.buttonView.bind("ariaLabel").to(a,"value",l,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?r:s[i]?`${s[i]}, ${r}`:r})),this.listenTo(h,"execute",(t=>{const{commandName:i,commandValue:n}=t.source;e.execute(i,n?{value:n}:void 0),e.editing.view.focus()})),h})),e.ui.componentFactory.add("menuBar:heading",(n=>{const r=new Wp(n),s=e.commands.get("heading"),o=e.commands.get("paragraph"),a=[s],l=new $p(n);r.set({class:"ck-heading-dropdown"}),l.set({ariaLabel:t("Heading"),role:"menu"}),r.buttonView.set({label:t("Heading")}),r.panelView.children.add(l);for(const t of i){const i=new hp(n,r),c=new Vg(n);i.children.add(c),l.items.add(i),c.set({isToggleable:!0,label:t.title,role:"menuitemradio",class:t.class}),c.delegate("execute").to(r),c.on("execute",(()=>{const i="paragraph"===t.model?"paragraph":"heading";e.execute(i,{value:t.model}),e.editing.view.focus()})),"paragraph"===t.model?(c.bind("isOn").to(o,"value"),a.push(o)):c.bind("isOn").to(s,"value",(e=>e===t.model))}return r.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),r}))}}new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class Wy extends xu{refresh(){const e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=function(e,t,i){const n=function(e,t){const i=Jb(e,t),n=i.start.parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(e,i);return t.checkChild(n,"horizontalLine")}(i,t,e)}execute(){const e=this.editor.model;e.change((t=>{const i=t.createElement("horizontalLine");e.insertObject(i,null,null,{setSelection:"after"})}))}}class $y extends ku{static get pluginName(){return"HorizontalLineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.t,n=e.conversion;t.register("horizontalLine",{inheritAllFrom:"$blockObject"}),n.for("dataDowncast").elementToElement({model:"horizontalLine",view:(e,{writer:t})=>t.createEmptyElement("hr")}),n.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(e,{writer:t})=>{const n=i("Horizontal line"),r=t.createContainerElement("div",null,t.createEmptyElement("hr"));return t.addClass("ck-horizontal-line",r),t.setCustomProperty("hr",!0,r),function(e,t,i){return t.setCustomProperty("horizontalLine",!0,e),jb(e,t,{label:i})}(r,t,n)}}),n.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),e.commands.add("horizontalLine",new Wy(e))}}class Uy extends ku{static get pluginName(){return"HorizontalLineUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("horizontalLine",(()=>{const e=this._createButton(hg);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:horizontalLine",(()=>this._createButton(Vg)))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("horizontalLine"),r=new e(t.locale),s=i.t;return r.set({label:s("Horizontal line"),icon:ju.horizontalLine}),r.bind("isEnabled").to(n,"isEnabled"),this.listenTo(r,"execute",(()=>{t.execute("horizontalLine"),t.editing.view.focus()})),r}}const jy=function(e,t,i,n){var r=-1,s=null==e?0:e.length;for(n&&s&&(i=e[++r]);++r=n?e:zs(e,t,i)};var Ek=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const Sk=function(e){return Ek.test(e)};const Pk=function(e){return e.split("")};var Ik="\\ud800-\\udfff",Vk="["+Ik+"]",Rk="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Bk="\\ud83c[\\udffb-\\udfff]",Ok="[^"+Ik+"]",Fk="(?:\\ud83c[\\udde6-\\uddff]){2}",Mk="[\\ud800-\\udbff][\\udc00-\\udfff]",Nk="(?:"+Rk+"|"+Bk+")"+"?",Lk="[\\ufe0e\\ufe0f]?",Dk=Lk+Nk+("(?:\\u200d(?:"+[Ok,Fk,Mk].join("|")+")"+Lk+Nk+")*"),zk="(?:"+[Ok+Rk+"?",Rk,Fk,Mk,Vk].join("|")+")",Hk=RegExp(Bk+"(?="+Bk+")|"+zk+Dk,"g");const Wk=function(e){return e.match(Hk)||[]};const $k=function(e){return Sk(e)?Wk(e):Pk(e)};const Uk=function(e){return function(t){t=Vs(t);var i=Sk(t)?$k(t):void 0,n=i?i[0]:t.charAt(0),r=i?Tk(i,1).join(""):t.slice(1);return n[e]()+r}}("toUpperCase");const jk=Ak((function(e,t,i){return e+(i?" ":"")+Uk(t)}));const qk=Wi((function(e,t,i,n){Ii(e,t,i,n)}));function Gk(e,t,i,n){t&&function(e,t,i){if(t.attributes)for(const[n]of Object.entries(t.attributes))e.removeAttribute(n,i);if(t.styles)for(const n of Object.keys(t.styles))e.removeStyle(n,i);t.classes&&e.removeClass(t.classes,i)}(e,t,n),i&&Kk(e,i,n)}function Kk(e,t,i){if(t.attributes)for(const[n,r]of Object.entries(t.attributes))e.setAttribute(n,r,i);t.styles&&e.setStyle(t.styles,i),t.classes&&e.addClass(t.classes,i)}function Zk(e,t,i,n,r){const s=t.getAttribute(i),o={};for(const e of["attributes","styles","classes"]){if(e!=n){s&&s[e]&&(o[e]=s[e]);continue}if("classes"==n){const t=new Set(s&&s.classes||[]);r(t),t.size&&(o[e]=Array.from(t));continue}const t=new Map(Object.entries(s&&s[e]||{}));r(t),t.size&&(o[e]=Object.fromEntries(t))}Object.keys(o).length?t.is("documentSelection")?e.setSelectionAttribute(i,o):e.setAttribute(i,o,t):s&&(t.is("documentSelection")?e.removeSelectionAttribute(i):e.removeAttribute(i,t))}function Jk(e){return`html${t=e,jk(t).replace(/ /g,"")}Attributes`;var t}function Qk({model:e}){return(t,i)=>i.writer.createElement(e,{htmlContent:t.getCustomProperty("$rawContent")})}function Yk(e,{view:t,isInline:i}){const n=e.t;return(e,{writer:r})=>{const s=n("HTML object"),o=Xk(t,e,r),a=e.getAttribute(Jk(t));r.addClass("html-object-embed__content",o),a&&Kk(r,a,o);return jb(r.createContainerElement(i?"span":"div",{class:"html-object-embed","data-html-object-embed-label":s},o),r,{label:s})}}function Xk(e,t,i){return i.createRawElement(e,null,((e,i)=>{i.setContentOf(e,t.getAttribute("htmlContent"))}))}function eC({view:e,model:t,allowEmpty:i},n){return t=>{t.on(`element:${e}`,((e,t,s)=>{let o=n.processViewAttributes(t.viewItem,s);if(o||s.consumable.test(t.viewItem,{name:!0})){if(o=o||{},s.consumable.consume(t.viewItem,{name:!0}),t.modelRange||(t=Object.assign(t,s.convertChildren(t.viewItem,t.modelCursor))),i&&t.modelRange.isCollapsed&&Object.keys(o).length){const e=s.writer.createElement("htmlEmptyElement");if(!s.safeInsert(e,t.modelCursor))return;const i=s.getSplitParts(e);return t.modelRange=s.writer.createRange(t.modelRange.start,s.writer.createPositionAfter(i[i.length-1])),s.updateConversionResult(e,t),void r(e,o,s)}for(const e of t.modelRange.getItems())r(e,o,s)}}),{priority:"low"})};function r(e,i,n){if(n.schema.checkAttribute(e,t)){const r=function(e,t){const i=To(e);let n="attributes";for(n in t)i[n]="classes"==n?Array.from(new Set([...e[n]||[],...t[n]])):{...e[n],...t[n]};return i}(i,e.getAttribute(t)||{});n.writer.setAttribute(t,r,e)}}}function tC({model:e,view:t},i){return(n,{writer:r,consumable:s})=>{if(!n.hasAttribute(e))return null;const o=r.createContainerElement(t),a=n.getAttribute(e);return s.consume(n,`attribute:${e}`),Kk(r,a,o),o.getFillerOffset=()=>null,i?jb(o,r):o}}function iC({priority:e,view:t}){return(i,n)=>{if(!i)return;const{writer:r}=n,s=r.createAttributeElement(t,null,{priority:e});return Kk(r,i,s),s}}function nC({view:e},t){return i=>{i.on(`element:${e}`,((e,i,n)=>{if(!i.modelRange||i.modelRange.isCollapsed)return;const r=t.processViewAttributes(i.viewItem,n);r&&n.writer.setAttribute(Jk(i.viewItem.name),r,i.modelRange)}),{priority:"low"})}}function rC({view:e,model:t}){return i=>{i.on(`attribute:${Jk(e)}:${t}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:n,attributeNewValue:r}=t;Gk(i.writer,n,r,i.mapper.toViewElement(t.item))}))}}var sC=[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6","$text"],allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowIn:["$root","$container"],allowChildren:["paragraph","htmlP","htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}}],oC=[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref"},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:!0}}];class aC extends ku{_definitions=[];static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const e of sC)this.registerBlockElement(e);for(const e of oC)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push({...e,isBlock:!0})}registerInlineElement(e){this._definitions.push({...e,isInline:!0})}extendBlockElement(e){this._extendDefinition({...e,isBlock:!0})}extendInlineElement(e){this._extendDefinition({...e,isInline:!0})}getDefinitionsForView(e,t=!1){const i=new Set;for(const n of this._getMatchingViewDefinitions(e)){if(t)for(const e of this._getReferences(n.model))i.add(e);i.add(n)}return i}getDefinitionsForModel(e){return this._definitions.filter((t=>t.model==e))}_getMatchingViewDefinitions(e){return this._definitions.filter((t=>t.view&&function(e,t){if("string"==typeof e)return e===t;if(e instanceof RegExp)return e.test(t);return!1}(e,t.view)))}*_getReferences(e){const t=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],i=this._definitions.filter((t=>t.model==e));for(const{modelSchema:n}of i)if(n)for(const i of t)for(const t of Qr(n[i]||[])){const i=this._definitions.filter((e=>e.model==t));for(const n of i)t!==e&&(yield*this._getReferences(n.model),yield n)}}_extendDefinition(e){const t=Array.from(this._definitions.entries()).filter((([,t])=>t.model==e.model));if(0!=t.length)for(const[i,n]of t)this._definitions[i]=qk({},n,e,((e,t)=>Array.isArray(e)?e.concat(t):void 0));else this._definitions.push(e)}}class lC extends ku{_dataSchema;_allowedAttributes;_disallowedAttributes;_allowedElements;_disallowedElements;_dataInitialized;_coupledAttributes;constructor(e){super(e),this._dataSchema=e.plugins.get("DataSchema"),this._allowedAttributes=new Do,this._disallowedAttributes=new Do,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerCoupledAttributesPostFixer(),this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get isOfficialPlugin(){return!0}static get requires(){return[aC,c_]}loadAllowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=mC(t);this.allowElement(e),i.forEach((e=>this.allowAttributes(e)))}}loadDisallowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=mC(t);0==i.length?this.disallowElement(e):i.forEach((e=>this.disallowAttributes(e)))}}loadAllowedEmptyElementsConfig(e){for(const t of e)this.allowEmptyElement(t)}allowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(t),this._coupledAttributes=null}disallowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(t.view)}allowEmptyElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))t.isInline&&this._dataSchema.extendInlineElement({...t,allowEmpty:!0})}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,t){const{consumable:i}=t;return cC(e,this._disallowedAttributes,i),function(e,{attributes:t,classes:i,styles:n}){if(!t.length&&!i.length&&!n.length)return null;return{...t.length&&{attributes:hC(e,t)},...n.length&&{styles:dC(e,n)},...i.length&&{classes:i}}}(e,cC(e,this._allowedAttributes,i))}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&"string"==typeof e.appliesToBlock)for(const t of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))t.isBlock&&this._addAllowedElement(t);this._dataInitialized&&this.editor.data.once("set",(()=>{this._fireRegisterEvent(e)}),{priority:dn.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)}),{priority:dn.highest+1})}_registerElementHandlers(){this.on("register",((e,t)=>{const i=this.editor.model.schema;if(t.isObject&&!i.isRegistered(t.model))this._registerObjectElement(t);else if(t.isBlock)this._registerBlockElement(t);else{if(!t.isInline)throw new gn("data-filter-invalid-definition",null,t);this._registerInlineElement(t)}e.stop()}),{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const e=this.editor.model,t=e.document.selection;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges();let n=!1;const r=this._getCoupledAttributesMap();for(const e of i){if("attribute"!=e.type||null!==e.attributeNewValue)continue;const i=r.get(e.attributeKey);if(i)for(const{item:r}of e.range.getWalker())for(const e of i)r.hasAttribute(e)&&(t.removeAttribute(e,r),n=!0)}return n})),this.listenTo(t,"change:attribute",((i,{attributeKeys:n})=>{const r=new Set,s=this._getCoupledAttributesMap();for(const e of n){if(t.hasAttribute(e))continue;const i=s.get(e);if(i)for(const e of i)t.hasAttribute(e)&&r.add(e)}0!=r.size&&e.change((e=>{for(const t of r)e.removeSelectionAttribute(t)}))}))}_registerAssociatedHtmlAttributesPostFixer(){const e=this.editor.model;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges();let n=!1;for(const r of i)if("insert"===r.type&&"$text"!==r.name)for(const i of r.attributes.keys())i.startsWith("html")&&i.endsWith("Attributes")&&(e.schema.checkAttribute(r.name,i)||(t.removeAttribute(i,r.position.nodeAfter),n=!0));return n}))}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const t=this._coupledAttributes.get(e.coupledAttribute);t?t.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const t=this.editor,i=t.model.schema,n=t.conversion,{view:r,model:s}=e;i.register(s,e.modelSchema),r&&(i.extend(e.model,{allowAttributes:[Jk(r),"htmlContent"]}),t.data.registerRawContentMatcher({name:r}),n.for("upcast").elementToElement({view:r,model:Qk(e),converterPriority:dn.low+2}),n.for("upcast").add(nC(e,this)),n.for("editingDowncast").elementToStructure({model:{name:s,attributes:[Jk(r)]},view:Yk(t,e)}),n.for("dataDowncast").elementToElement({model:s,view:(e,{writer:t})=>Xk(r,e,t)}),n.for("dataDowncast").add(rC(e)))}_registerBlockElement(e){const t=this.editor,i=t.model.schema,n=t.conversion,{view:r,model:s}=e;if(!i.isRegistered(e.model)){if(i.register(e.model,e.modelSchema),!r)return;n.for("upcast").elementToElement({model:s,view:r,converterPriority:dn.low+2}),n.for("downcast").elementToElement({model:s,view:r})}r&&(i.extend(e.model,{allowAttributes:Jk(r)}),n.for("upcast").add(nC(e,this)),n.for("downcast").add(rC(e)))}_registerInlineElement(e){const t=this.editor,i=t.model.schema,n=t.conversion,r=e.model;e.appliesToBlock||(i.extend("$text",{allowAttributes:r}),e.attributeProperties&&i.setAttributeProperties(r,e.attributeProperties),n.for("upcast").add(eC(e,this)),n.for("downcast").attributeToElement({model:r,view:iC(e)}),e.allowEmpty&&(i.setAttributeProperties(r,{copyFromObject:!1}),i.isRegistered("htmlEmptyElement")||i.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"}),t.data.htmlProcessor.domConverter.registerInlineObjectMatcher((t=>t.name==e.view&&t.isEmpty&&Array.from(t.getAttributeKeys()).length?{name:!0}:null)),n.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:tC(e,!0)}),n.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:tC(e)})))}}function cC(e,t,i){const n=t.matchAll(e)||[],r=e.document.stylesProcessor;return n.reduce(((t,{match:n})=>{for(const s of n.styles||[]){const n=r.getRelatedStyles(s).filter((e=>e.split("-").length>s.split("-").length)).sort(((e,t)=>t.split("-").length-e.split("-").length));for(const r of n)i.consume(e,{styles:[r]})&&t.styles.push(r);i.consume(e,{styles:[s]})&&t.styles.push(s)}for(const r of n.classes||[])i.consume(e,{classes:[r]})&&t.classes.push(r);for(const r of n.attributes||[])i.consume(e,{attributes:[r]})&&t.attributes.push(r);return t}),{attributes:[],classes:[],styles:[]})}function hC(e,t){const i={};for(const n of t){const t=e.getAttribute(n);void 0!==t&&Cr(n)&&(i[n]=t)}return i}function dC(e,t){const i=new Wo(e.document.stylesProcessor);for(const n of t){const t=e.getStyle(n);void 0!==t&&i.set(n,t)}return Object.fromEntries(i.getStylesEntries())}function uC(e,t){const{name:i}=e,n=e[t];return T(n)?Object.entries(n).map((([e,n])=>({name:i,[t]:{[e]:n}}))):Array.isArray(n)?n.map((e=>({name:i,[t]:[e]}))):[e]}function mC(e){const{name:t,attributes:i,classes:n,styles:r}=e,s=[];return i&&s.push(...uC({name:t,attributes:i},"attributes")),n&&s.push(...uC({name:t,classes:n},"classes")),r&&s.push(...uC({name:t,styles:r},"styles")),s}class gC extends ku{static get requires(){return[lC]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const e=this.editor.plugins.get(lC);e.on("register:pre",((t,i)=>{if("codeBlock"!==i.model)return;const n=this.editor,r=n.model.schema,s=n.conversion;r.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),s.for("upcast").add(function(e){return t=>{t.on("element:code",((t,i,n)=>{const r=i.viewItem,s=r.parent;function o(t,r){const s=e.processViewAttributes(t,n);s&&n.writer.setAttribute(r,s,i.modelRange)}s&&s.is("element","pre")&&(o(s,"htmlPreAttributes"),o(r,"htmlContentAttributes"))}),{priority:"low"})}}(e)),s.for("downcast").add((e=>{e.on("attribute:htmlPreAttributes:codeBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:n,attributeNewValue:r}=t,s=i.mapper.toViewElement(t.item).parent;Gk(i.writer,n,r,s)})),e.on("attribute:htmlContentAttributes:codeBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:n,attributeNewValue:r}=t,s=i.mapper.toViewElement(t.item);Gk(i.writer,n,r,s)}))})),t.stop()}))}}class fC extends ku{static get requires(){return[lC]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(lC).on("register",((e,t)=>{const i=t,n=this.editor,r=n.model.schema,s=n.conversion;if(!i.paragraphLikeModel)return;if(r.isRegistered(i.model)||r.isRegistered(i.paragraphLikeModel))return;const o={model:i.paragraphLikeModel,view:i.view};r.register(i.model,i.modelSchema),r.register(o.model,{inheritAllFrom:"$block"}),s.for("upcast").elementToElement({view:i.view,model:(e,{writer:t})=>this._hasBlockContent(e)?t.createElement(i.model):t.createElement(o.model),converterPriority:dn.low+.5}),s.for("downcast").elementToElement({view:i.view,model:i.model}),this._addAttributeConversion(i),s.for("downcast").elementToElement({view:o.view,model:o.model}),this._addAttributeConversion(o),e.stop()}))}_hasBlockContent(e){const t=this.editor.editing.view,i=t.domConverter.blockElements;for(const n of t.createRangeIn(e).getItems())if(n.is("element")&&i.includes(n.name))return!0;return!1}_addAttributeConversion(e){const t=this.editor,i=t.conversion,n=t.plugins.get(lC);t.model.schema.extend(e.model,{allowAttributes:Jk(e.view)}),i.for("upcast").add(nC(e,n)),i.for("downcast").add(rC(e))}}class pC extends ku{static get requires(){return[aC,Tb]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HeadingEditing"))return;const t=e.config.get("heading.options");this.registerHeadingElements(e,t)}registerHeadingElements(e,t){const i=e.plugins.get(aC),n=[];for(const e of t)"model"in e&&"view"in e&&(i.registerBlockElement({view:e.view,model:e.model}),n.push(e.model));i.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:n}}),i.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:n}})}}function wC(e,t,i){const n=e.createRangeOn(t);for(const{item:e}of n.getWalker())if(e.is("element",i))return e}class bC extends ku{static get requires(){return[lC]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ImageInlineEditing")&&!e.plugins.has("ImageBlockEditing"))return;const t=e.model.schema,i=e.conversion,n=e.plugins.get(lC);n.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,n)=>{const r=i.viewItem;if(!i.modelRange||!r.hasClass("image"))return;const s=e.processViewAttributes(r,n);s&&n.writer.setAttribute("htmlFigureAttributes",s,i.modelRange)}),{priority:"low"})}}(n))})),n.on("register:img",((r,s)=>{"imageBlock"!==s.model&&"imageInline"!==s.model||(t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:img",((t,i,n)=>{if(!i.modelRange)return;const r=i.viewItem,s=e.processViewAttributes(r,n);s&&n.writer.setAttribute("htmlImgAttributes",s,i.modelRange)}),{priority:"low"})}}(n)),i.for("downcast").add((e=>{function t(t){e.on(`attribute:${t}:imageInline`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:n,attributeNewValue:r}=t,s=i.mapper.toViewElement(t.item);Gk(i.writer,n,r,s)}),{priority:"low"})}function i(t,i){e.on(`attribute:${i}:imageBlock`,((e,i,n)=>{if(!n.consumable.test(i.item,e.name))return;const{attributeOldValue:r,attributeNewValue:s}=i,o=n.mapper.toViewElement(i.item),a=wC(n.writer,o,t);a&&(Gk(n.writer,r,s,a),n.consumable.consume(i.item,e.name))}),{priority:"low"}),"a"===t&&e.on("attribute:linkHref:imageBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,"attribute:htmlLinkAttributes:imageBlock"))return;const n=i.mapper.toViewElement(t.item),r=wC(i.writer,n,"a");Kk(i.writer,t.item.getAttribute("htmlLinkAttributes"),r)}),{priority:"low"})}t("htmlImgAttributes"),i("img","htmlImgAttributes"),i("figure","htmlFigureAttributes"),i("a","htmlLinkAttributes")})),e.plugins.has("LinkImage")&&i.for("upcast").add(function(e,t){const i=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,n,r)=>{const s=n.viewItem;if(!i.findViewImgElement(s))return;const o=n.modelCursor.parent;if(!o.is("element","imageBlock"))return;const a=e.processViewAttributes(s,r);a&&r.writer.setAttribute("htmlLinkAttributes",a,o)}),{priority:"low"})}}(n,e)),r.stop())}))}}class _C extends ku{static get requires(){return[lC]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("MediaEmbed")||e.config.get("mediaEmbed.previewsInData"))return;const t=e.model.schema,i=e.conversion,n=this.editor.plugins.get(lC),r=this.editor.plugins.get(aC),s=e.config.get("mediaEmbed.elementName");r.registerBlockElement({model:"media",view:s}),n.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,n)=>{const r=i.viewItem;if(!i.modelRange||!r.hasClass("media"))return;const s=e.processViewAttributes(r,n);s&&n.writer.setAttribute("htmlFigureAttributes",s,i.modelRange)}),{priority:"low"})}}(n))})),n.on(`register:${s}`,((e,r)=>{"media"===r.model&&(t.extend("media",{allowAttributes:[Jk(s),"htmlFigureAttributes"]}),i.for("upcast").add(function(e,t){const i=(i,n,r)=>{function s(t,i){const s=e.processViewAttributes(t,r);s&&r.writer.setAttribute(i,s,n.modelRange)}s(n.viewItem,Jk(t))};return e=>{e.on(`element:${t}`,i,{priority:"low"})}}(n,s)),i.for("dataDowncast").add(function(e){return t=>{function i(e,i){t.on(`attribute:${i}:media`,((t,i,n)=>{if(!n.consumable.consume(i.item,t.name))return;const{attributeOldValue:r,attributeNewValue:s}=i,o=n.mapper.toViewElement(i.item),a=wC(n.writer,o,e);Gk(n.writer,r,s,a)}))}i(e,Jk(e)),i("figure","htmlFigureAttributes")}}(s)),e.stop())}))}}class vC extends ku{static get requires(){return[lC]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(lC);e.on("register:script",((t,i)=>{const n=this.editor,r=n.model.schema,s=n.conversion;r.register("htmlScript",i.modelSchema),r.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),n.data.registerRawContentMatcher({name:"script"}),s.for("upcast").elementToElement({view:"script",model:Qk(i)}),s.for("upcast").add(nC(i,e)),s.for("downcast").elementToElement({model:"htmlScript",view:(e,{writer:t})=>Xk("script",e,t)}),s.for("downcast").add(rC(i)),t.stop()}))}}class yC extends ku{static get requires(){return[lC]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const t=e.model.schema,i=e.conversion,n=e.plugins.get(lC),r=e.plugins.get("TableUtils");n.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,n)=>{const r=i.viewItem;if(!i.modelRange||!r.hasClass("table"))return;const s=e.processViewAttributes(r,n);s&&n.writer.setAttribute("htmlFigureAttributes",s,i.modelRange)}),{priority:"low"})}}(n))})),n.on("register:table",((s,o)=>{"table"===o.model&&(t.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:table",((t,i,n)=>{if(!i.modelRange)return;const r=i.viewItem;s(r,"htmlTableAttributes");for(const e of r.getChildren())e.is("element","thead")&&s(e,"htmlTheadAttributes"),e.is("element","tbody")&&s(e,"htmlTbodyAttributes");function s(t,r){const s=e.processViewAttributes(t,n);s&&n.writer.setAttribute(r,s,i.modelRange)}}),{priority:"low"})}}(n)),i.for("downcast").add((e=>{function t(t,i){e.on(`attribute:${i}:table`,((e,i,n)=>{if(!n.consumable.test(i.item,e.name))return;const r=n.mapper.toViewElement(i.item),s=wC(n.writer,r,t);s&&(n.consumable.consume(i.item,e.name),Gk(n.writer,i.attributeOldValue,i.attributeNewValue,s))}))}t("table","htmlTableAttributes"),t("figure","htmlFigureAttributes"),t("thead","htmlTheadAttributes"),t("tbody","htmlTbodyAttributes")})),e.model.document.registerPostFixer(function(e,t){return i=>{const n=e.document.differ.getChanges();let r=!1;for(const e of n){if("attribute"!=e.type||"headingRows"!=e.attributeKey)continue;const n=e.range.start.nodeAfter,s=n.getAttribute("htmlTheadAttributes"),o=n.getAttribute("htmlTbodyAttributes");s&&!e.attributeNewValue?(i.removeAttribute("htmlTheadAttributes",n),r=!0):o&&e.attributeNewValue==t.getRows(n)&&(i.removeAttribute("htmlTbodyAttributes",n),r=!0)}return r}}(e.model,r)),s.stop())}))}}class kC extends ku{static get requires(){return[lC]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(lC);e.on("register:style",((t,i)=>{const n=this.editor,r=n.model.schema,s=n.conversion;r.register("htmlStyle",i.modelSchema),r.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),n.data.registerRawContentMatcher({name:"style"}),s.for("upcast").elementToElement({view:"style",model:Qk(i)}),s.for("upcast").add(nC(i,e)),s.for("downcast").elementToElement({model:"htmlStyle",view:(e,{writer:t})=>Xk("style",e,t)}),s.for("downcast").add(rC(i)),t.stop()}))}}class CC extends ku{static get requires(){return[lC]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ListEditing"))return;const t=e.model.schema,i=e.conversion,n=e.plugins.get(lC),r=e.plugins.get("ListEditing"),s=e.plugins.get("ListUtils"),o=["ul","ol","li"];r.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:Kk}),r.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:Kk}),r.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:Kk}),n.on("register",((e,r)=>{if(!o.includes(r.view))return;if(e.stop(),t.checkAttribute("$block","htmlLiAttributes"))return;const s=o.map((e=>Jk(e)));t.extend("$listItem",{allowAttributes:s}),i.for("upcast").add((e=>{e.on("element:ul",xC("htmlUlAttributes",n),{priority:"low"}),e.on("element:ol",xC("htmlOlAttributes",n),{priority:"low"}),e.on("element:li",xC("htmlLiAttributes",n),{priority:"low"})}))})),r.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:n,previousNodeInList:r}of t)if(r){if(r.getAttribute("listType")==n.getAttribute("listType")){const t=AC(r.getAttribute("listType")),s=r.getAttribute(t);!Eo(n.getAttribute(t),s)&&i.model.schema.checkAttribute(n,t)&&(i.setAttribute(t,s,n),e.return=!0)}if(r.getAttribute("listItemId")==n.getAttribute("listItemId")){const t=r.getAttribute("htmlLiAttributes");!Eo(n.getAttribute("htmlLiAttributes"),t)&&i.model.schema.checkAttribute(n,"htmlLiAttributes")&&(i.setAttribute("htmlLiAttributes",t,n),e.return=!0)}}})),r.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:n}of t){const t=n.getAttribute("listType");!s.isNumberedListType(t)&&n.getAttribute("htmlOlAttributes")&&(i.removeAttribute("htmlOlAttributes",n),e.return=!0),s.isNumberedListType(t)&&n.getAttribute("htmlUlAttributes")&&(i.removeAttribute("htmlUlAttributes",n),e.return=!0)}}))}afterInit(){const e=this.editor;if(!e.commands.get("indentList"))return;const t=e.commands.get("indentList");this.listenTo(t,"afterExecute",((t,i)=>{e.model.change((t=>{for(const n of i){const i=AC(n.getAttribute("listType"));e.model.schema.checkAttribute(n,i)&&t.setAttribute(i,{},n)}}))}))}}function xC(e,t){return(i,n,r)=>{const s=n.viewItem;n.modelRange||Object.assign(n,r.convertChildren(n.viewItem,n.modelCursor));const o=t.processViewAttributes(s,r);for(const t of n.modelRange.getItems({shallow:!0}))t.hasAttribute("listItemId")&&(t.hasAttribute("htmlUlAttributes")||t.hasAttribute("htmlOlAttributes")||r.writer.model.schema.checkAttribute(t,e)&&r.writer.setAttribute(e,o||{},t))}}function AC(e){return"numbered"===e||"customNumbered"==e?"htmlOlAttributes":"htmlUlAttributes"}class TC extends ku{static get requires(){return[lC,aC]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(lC),t=this.editor.plugins.get(aC);e.on("register:$customElement",((i,n)=>{i.stop();const r=this.editor,s=r.model.schema,o=r.conversion,a=r.editing.view.domConverter.unsafeElements,l=r.data.htmlProcessor.domConverter.preElements;s.register(n.model,n.modelSchema),s.extend(n.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),r.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),o.for("upcast").elementToElement({view:/.*/,model:(i,s)=>{if("$comment"==i.name)return null;if(!function(e){try{document.createElement(e)}catch(e){return!1}return!0}(i.name))return null;if(t.getDefinitionsForView(i.name).size)return null;a.includes(i.name)||a.push(i.name),l.includes(i.name)||l.push(i.name);const o=s.writer.createElement(n.model,{htmlElementName:i.name}),c=e.processViewAttributes(i,s);let h;if(c&&s.writer.setAttribute("htmlCustomElementAttributes",c,o),i.is("element","template")&&i.getCustomProperty("$rawContent"))h=i.getCustomProperty("$rawContent");else{const e=new xd(i.document).createDocumentFragment(i),t=r.data.htmlProcessor.domConverter.viewToDom(e),n=t.firstChild;for(;n.firstChild;)t.appendChild(n.firstChild);n.remove(),h=r.data.htmlProcessor.htmlWriter.getHtml(t)}s.writer.setAttribute("htmlContent",h,o);for(const{item:e}of r.editing.view.createRangeIn(i))s.consumable.consume(e,{name:!0});return o},converterPriority:"low"}),o.for("editingDowncast").elementToElement({model:{name:n.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),n=t.createRawElement(i);return e.hasAttribute("htmlCustomElementAttributes")&&Kk(t,e.getAttribute("htmlCustomElementAttributes"),n),n}}),o.for("dataDowncast").elementToElement({model:{name:n.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),n=e.getAttribute("htmlContent"),r=t.createRawElement(i,null,((e,t)=>{t.setContentOf(e,n)}));return e.hasAttribute("htmlCustomElementAttributes")&&Kk(t,e.getAttribute("htmlCustomElementAttributes"),r),r}})}))}}function*EC(e,t,i){if(t)if(!(Symbol.iterator in t)&&t.is("documentSelection")&&t.isCollapsed)e.schema.checkAttributeInSelection(t,i)&&(yield t);else for(const n of function(e,t,i){return!(Symbol.iterator in t)&&(t.is("node")||t.is("$text")||t.is("$textProxy"))?e.schema.checkAttribute(t,i)?[e.createRangeOn(t)]:[]:e.schema.getValidRanges(e.createSelection(t).getRanges(),i)}(e,t,i))yield*n.getItems({shallow:!0})}const SC=function(e,t){return function(i,n){if(null==i)return i;if(!lt(i))return e(i,n);for(var r=i.length,s=t?r:-1,o=Object(i);(t?s--:++s{if(!i.isInlineImageView(e))return null;if(!n)return r(e);return("block"==e.getStyle("display")||e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:r(e)};function r(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}}function BC(e,t){const i=ts(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}function OC(e){return e&&e.endsWith("px")?parseInt(e):null}function FC(e){const t=OC(e.getStyle("width")),i=OC(e.getStyle("height"));return!(!t||!i)}const MC=/^(image|image-inline)$/;class NC extends ku{_domEmitter=new(tr());static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null,n={}){const r=this.editor,s=r.model,o=s.document.selection,a=LC(r,t||o,i);e={...Object.fromEntries(o.getAttributes()),...e};for(const t in e)s.schema.checkAttribute(a,t)||delete e[t];return s.change((i=>{const{setImageSizes:r=!0}=n,o=i.createElement(a,e);return s.insertObject(o,t,null,{setSelection:"on",findOptimalPosition:t||"imageInline"==a?void 0:"auto"}),o.parent?(r&&this.setImageNaturalSizeAttributes(o),o):null}))}setImageNaturalSizeAttributes(e){const t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change((i=>{const n=new ji.window.Image;this._domEmitter.listenTo(n,"load",(()=>{e.getAttribute("width")||e.getAttribute("height")||this.editor.model.enqueueChange(i.batch,(t=>{t.setAttribute("width",n.naturalWidth,e),t.setAttribute("height",n.naturalHeight,e)})),this._domEmitter.stopListening(n,"load")})),n.src=t})))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let n=t.parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:MC})}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){const i=LC(e,t,null);if("imageBlock"==i){const i=function(e,t){const i=Jb(e,t),n=i.start.parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(t,e.model);if(e.model.schema.checkChild(i,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every((e=>!e.is("element","imageBlock")))}(e)}toImageWidget(e,t,i){t.setCustomProperty("image",!0,e);return jb(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&Ub(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function LC(e,t,i){const n=e.model.schema,r=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===r?"imageInline":"auto"!==r?"imageBlock":t.is("selection")?BC(n,t):n.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const DC=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class zC extends xu{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,i=t.plugins.get("ImageUtils"),n=t.model,r=i.getClosestSelectedImageElement(n.document.selection);n.change((t=>{t.setAttribute("alt",e.newValue,r)}))}}class HC extends ku{static get requires(){return[NC]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new zC(this.editor))}}class WC extends ng{focusTracker;keystrokes;labeledInput;saveButtonView;cancelButtonView;_focusables;_focusCycler;constructor(e){super(e);const t=this.locale.t;this.focusTracker=new is,this.keystrokes=new os,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),ju.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),ju.cancel,"ck-button-cancel","cancel"),this._focusables=new Fm,this._focusCycler=new mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),og({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,i,n){const r=new hg(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:i}}),n&&r.delegate("execute").to(this,n),r}_createLabeledInputView(){const e=this.locale.t,t=new Yg(this.locale,Rf);return t.label=e("Text alternative"),t}}function $C(e){const t=e.editing.view,i=mf.defaultPositions,n=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class UC extends ku{_balloon;_form;static get requires(){return[Fp]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",(i=>{const n=e.commands.get("imageTextAlternative"),r=new hg(i);return r.set({label:t("Change image text alternative"),icon:ju.textAlternative,tooltip:!0}),r.bind("isEnabled").to(n,"isEnabled"),r.bind("isOn").to(n,"value",(e=>!!e)),this.listenTo(r,"execute",(()=>{this._showForm()})),r}))}_createForm(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(sg(WC))(e.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((e,t)=>{this._hideForm(!0),t()})),this.listenTo(e.ui,"update",(()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const i=$C(e);t.updatePosition(i)}}(e):this._hideForm(!0)})),rg({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:$C(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class jC extends ku{static get requires(){return[HC,UC]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function qC(e,t){const i=(t,i,n)=>{if(!n.consumable.consume(i.item,t.name))return;const r=n.writer,s=n.mapper.toViewElement(i.item),o=e.findViewImgElement(s);null===i.attributeNewValue?(r.removeAttribute("srcset",o),r.removeAttribute("sizes",o)):i.attributeNewValue&&(r.setAttribute("srcset",i.attributeNewValue,o),r.setAttribute("sizes","100vw",o))};return e=>{e.on(`attribute:srcset:${t}`,i)}}function GC(e,t,i){const n=(t,i,n)=>{if(!n.consumable.consume(i.item,t.name))return;const r=n.writer,s=n.mapper.toViewElement(i.item),o=e.findViewImgElement(s);r.setAttribute(i.attributeKey,i.attributeNewValue||"",o)};return e=>{e.on(`attribute:${i}:${t}`,n)}}class KC extends rl{observe(e){this.listenTo(e,"load",((e,t)=>{const i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)}),{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class ZC extends xu{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&fn("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&fn("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Qr(e.source),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(i.getAttributes());t.forEach(((t,s)=>{const o=i.getSelectedElement();if("string"==typeof t&&(t={src:t}),s&&o&&n.isImage(o)){const i=this.editor.model.createPositionAfter(o);n.insertImage({...t,...r},i,e.imageType)}else n.insertImage({...t,...r},null,e.imageType)}))}}class JC extends xu{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change((n=>{n.setAttribute("src",e.source,t),this.cleanupImage(n,t),i.setImageNaturalSizeAttributes(t)}))}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}}class QC extends ku{static get requires(){return[NC]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(KC),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new ZC(e),n=new JC(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",n),e.commands.add("imageInsert",i)}}class YC extends ku{static get requires(){return[NC]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils"),n="imageBlock"===e?"figure":"img";function r(t,n,r,s){t.on(`attribute:${n}:${e}`,((t,n,o)=>{if(!o.consumable.consume(n.item,t.name))return;const a=o.writer,l=o.mapper.toViewElement(n.item),c=i.findViewImgElement(l);if(null!==n.attributeNewValue?a.setAttribute(r,n.attributeNewValue,c):a.removeAttribute(r,c),n.item.hasAttribute("sources"))return;const h=n.item.hasAttribute("resizedWidth");if("imageInline"===e&&!h&&!s)return;const d=n.item.getAttribute("width"),u=n.item.getAttribute("height");d&&u&&a.setStyle("aspect-ratio",`${d}/${u}`,c)}))}t.conversion.for("upcast").attributeToAttribute({view:{name:n,styles:{width:/.+/}},model:{key:"width",value:e=>FC(e)?OC(e.getStyle("width")):null}}).attributeToAttribute({view:{name:n,key:"width"},model:"width"}).attributeToAttribute({view:{name:n,styles:{height:/.+/}},model:{key:"height",value:e=>FC(e)?OC(e.getStyle("height")):null}}).attributeToAttribute({view:{name:n,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add((e=>{r(e,"width","width",!0),r(e,"height","height",!0)})),t.conversion.for("dataDowncast").add((e=>{r(e,"width","width",!1),r(e,"height","height",!1)}))}}class XC extends xu{_modelElementName;constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(e={}){const t=this.editor,i=this.editor.model,n=t.plugins.get("ImageUtils"),r=n.getClosestSelectedImageElement(i.document.selection),s=Object.fromEntries(r.getAttributes());return s.src||s.uploadId?i.change((t=>{const{setImageSizes:o=!0}=e,a=Array.from(i.markers).filter((e=>e.getRange().containsItem(r))),l=n.insertImage(s,i.createSelection(r,"on"),this._modelElementName,{setImageSizes:o});if(!l)return null;const c=t.createRangeOn(l);for(const e of a){const i=e.getRange(),n="$graveyard"!=i.root.rootName?i.getJoined(c,!0):c;t.updateMarker(e,{range:n})}return{oldElement:r,newElement:l}})):null}}class ex extends ku{static get requires(){return[NC]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add((e=>{e.on("attribute:placeholder",((e,t,n)=>{if(!n.consumable.test(t.item,e.name))return;if(!t.item.is("element","imageBlock")&&!t.item.is("element","imageInline"))return;n.consumable.consume(t.item,e.name);const r=n.writer,s=n.mapper.toViewElement(t.item),o=i.findViewImgElement(s);t.attributeNewValue?(r.addClass("image_placeholder",o),r.setStyle("background-image",`url(${t.attributeNewValue})`,o),r.setCustomProperty("editingPipeline:doNotReuseOnce",!0,o)):(r.removeClass("image_placeholder",o),r.removeStyle("background-image",o))}))}))}_setupLoadListener(){const e=this.editor,t=e.model,i=e.editing,n=i.view,r=e.plugins.get("ImageUtils");n.addObserver(KC),this.listenTo(n.document,"imageLoaded",((e,s)=>{const o=n.domConverter.mapDomToView(s.target);if(!o)return;const a=r.getImageWidgetFromImageView(o);if(!a)return;const l=i.mapper.toModelElement(a);l&&l.hasAttribute("placeholder")&&t.enqueueChange({isUndoable:!1},(e=>{e.removeAttribute("placeholder",l)}))}))}}class tx extends ku{static get requires(){return[QC,YC,NC,ex,z_]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new XC(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>VC(t)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:i})=>n.toImageWidget(VC(i),i,t("image widget"))}),i.for("downcast").add(GC(n,"imageBlock","src")).add(GC(n,"imageBlock","alt")).add(qC(n,"imageBlock")),i.for("upcast").elementToElement({view:RC(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)}).add(function(e){const t=(t,i,n)=>{if(!n.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const r=e.findViewImgElement(i.viewItem);if(!r||!n.consumable.test(r,{name:!0}))return;n.consumable.consume(i.viewItem,{name:!0,classes:"image"});const s=ts(n.convertItem(r,i.modelCursor).modelRange.getItems());s?(n.convertChildren(i.viewItem,s),n.updateConversionResult(s,i)):n.consumable.revert(i.viewItem,{name:!0,classes:"image"})};return e=>{e.on("element:figure",t)}}(n))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",((r,s)=>{const o=Array.from(s.content.getChildren());let a;if(!o.every(n.isInlineImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===BC(t.schema,l)){const e=new xd(i.document),t=o.map((t=>e.createElement("figure",{class:"image"},t)));s.content=e.createDocumentFragment(t)}})),this.listenTo(r,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageBlock")&&n.setImageNaturalSizeAttributes(e)}))}))}}class ix extends ng{focusTracker;keystrokes;_focusables;_focusCycler;children;constructor(e,t=[]){super(e),this.focusTracker=new is,this.keystrokes=new os,this._focusables=new Fm,this.children=this.createCollection(),this._focusCycler=new mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const e of t)this.children.add(e),this._focusables.add(e),e instanceof Ug&&this._focusables.addMany(e.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),og({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class nx extends ku{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[NC]}dropdownView;_integrations=new Map;constructor(e){super(e),e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",(()=>{this.isImageSelected=i.isImage(t.getSelectedElement())}));const n=e=>this._createToolbarComponent(e);e.ui.componentFactory.add("insertImage",n),e.ui.componentFactory.add("imageInsert",n),e.ui.componentFactory.add("menuBar:insertImage",(e=>this._createMenuBarComponent(e)))}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:n,menuBarButtonViewCreator:r,requiresForm:s=!1}){this._integrations.has(e)&&fn("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,menuBarButtonViewCreator:r,formViewCreator:n,requiresForm:s})}_createToolbarComponent(e){const t=this.editor,i=e.t,n=this._prepareIntegrations();if(!n.length)return null;let r;const s=n[0];if(1==n.length){if(!s.requiresForm)return s.buttonViewCreator(!0);r=s.buttonViewCreator(!0)}else{const t=s.buttonViewCreator(!1);r=new Cf(e,t),r.tooltip=!0,r.bind("label").to(this,"isImageSelected",(e=>i(e?"Replace image":"Insert image")))}const o=this.dropdownView=xf(e,r),a=n.map((({observable:e})=>"function"==typeof e?e():e));return o.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),o.once("change:isOpen",(()=>{const e=n.map((({formViewCreator:e})=>e(1==n.length))),i=new ix(t.locale,e);o.panelView.children.add(i)})),o}_createMenuBarComponent(e){const t=e.t,i=this._prepareIntegrations();if(!i.length)return null;let n;const r=i[0];if(1==i.length)n=r.menuBarButtonViewCreator(!0);else{n=new Wp(e);const r=new $p(e);n.panelView.children.add(r),n.buttonView.set({icon:ju.image,label:t("Image")});for(const t of i){const i=new hp(e,n),s=t.menuBarButtonViewCreator(!1);i.children.add(s),r.items.add(i)}}return n}_prepareIntegrations(){const e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return fn("image-insert-integrations-not-specified"),t;for(const i of e)this._integrations.has(i)?t.push(this._integrations.get(i)):["upload","assetManager","url"].includes(i)||fn("image-insert-unknown-integration",{item:i});return t.length||fn("image-insert-integrations-not-registered"),t}}class rx extends ku{static get requires(){return[tx,c_,jC,nx]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class sx extends ku{static get requires(){return[QC,YC,NC,ex,z_]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new XC(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:i})=>n.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(i),i,t("image widget"))}),i.for("downcast").add(GC(n,"imageInline","src")).add(GC(n,"imageInline","alt")).add(qC(n,"imageInline")),i.for("upcast").elementToElement({view:RC(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",((r,s)=>{const o=Array.from(s.content.getChildren());let a;if(!o.every(n.isBlockImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===BC(t.schema,l)){const e=new xd(i.document),t=o.map((t=>1===t.childCount?(Array.from(t.getAttributes()).forEach((i=>e.setAttribute(...i,n.findViewImgElement(t)))),t.getChild(0)):t));s.content=e.createDocumentFragment(t)}})),this.listenTo(r,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageInline")&&n.setImageNaturalSizeAttributes(e)}))}))}}class ox extends ku{static get requires(){return[sx,c_,jC,nx]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}class ax extends ku{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[NC]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return"figcaption"==e.name&&t.isBlockImageView(e.parent)?{name:!0}:null}}class lx extends xu{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(tx))return this.isEnabled=!1,void(this.value=!1);const n=e.model.document.selection,r=n.getSelectedElement();if(!r){const e=t.getCaptionFromModelSelection(n);return this.isEnabled=!!e,void(this.value=!!e)}this.isEnabled=i.isImage(r),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(r):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change((e=>{this.value?this._hideImageCaption(e):this._showImageCaption(e,t)}))}_showImageCaption(e,t){const i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageCaptionEditing"),r=this.editor.plugins.get("ImageUtils");let s=i.getSelectedElement();const o=n._getSavedCaption(s);r.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=i.getSelectedElement());const a=o||e.createElement("caption");e.append(a,s),t&&e.setSelection(a,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,n=t.plugins.get("ImageCaptionEditing"),r=t.plugins.get("ImageCaptionUtils");let s,o=i.getSelectedElement();o?s=r.getCaptionFromImageModelElement(o):(s=r.getCaptionFromModelSelection(i),o=s.parent),n._saveCaption(o,s),e.setSelection(o,"on"),e.remove(s)}}class cx extends ku{static get requires(){return[NC,ax]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}_savedCaptionsMap;constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new lx(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils"),r=e.t;e.conversion.for("upcast").elementToElement({view:e=>n.matchImageCaptionViewElement(e),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>i.isBlockImage(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:n})=>{if(!i.isBlockImage(e.parent))return null;const s=n.createEditableElement("figcaption");n.setCustomProperty("imageCaption",!0,s),s.placeholder=r("Enter image caption"),Io({view:t,element:s,keepOnFocus:!0});const o=e.parent.getAttribute("alt");return Zb(s,n,{label:o?r("Caption for image: %0",[o]):r("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),n=e.commands.get("imageTypeInline"),r=e.commands.get("imageTypeBlock"),s=e=>{if(!e.return)return;const{oldElement:n,newElement:r}=e.return;if(!n)return;if(t.isBlockImage(n)){const e=i.getCaptionFromImageModelElement(n);if(e)return void this._saveCaption(r,e)}const s=this._getSavedCaption(n);s&&this._saveCaption(r,s)};n&&this.listenTo(n,"execute",s,{priority:"low"}),r&&this.listenTo(r,"execute",s,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Al.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",(()=>{const r=t.document.differ.getChanges();for(const t of r){if("alt"!==t.attributeKey)continue;const r=t.range.start.nodeAfter;if(i.isBlockImage(r)){const t=n.getCaptionFromImageModelElement(r);if(!t)return;e.editing.reconvertItem(t)}}}))}}class hx extends ku{static get requires(){return[ax]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),n=e.t;e.ui.componentFactory.add("toggleImageCaption",(r=>{const s=e.commands.get("toggleImageCaption"),o=new hg(r);return o.set({icon:ju.caption,tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(s,"value","isEnabled"),o.bind("label").to(s,"value",(e=>n(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(o,"execute",(()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const n=i.getCaptionFromModelSelection(e.model.document.selection);if(n){const i=e.editing.mapper.toViewElement(n);t.scrollToTheSelection(),t.change((e=>{e.addClass("image__caption_highlighted",i)}))}e.editing.view.focus()})),o}))}}function dx(e){const t=e.map((e=>e.replace("+","\\+")));return new RegExp(`^image\\/(${t.join("|")})$`)}function ux(e){return new Promise(((t,i)=>{const n=e.getAttribute("src");fetch(n).then((e=>e.blob())).then((e=>{const i=mx(e,n),r=i.replace("image/",""),s=new File([e],`image.${r}`,{type:i});t(s)})).catch((e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise(((t,i)=>{const n=ji.document.createElement("img");n.addEventListener("load",(()=>{const e=ji.document.createElement("canvas");e.width=n.width,e.height=n.height;e.getContext("2d").drawImage(n,0,0),e.toBlob((e=>e?t(e):i()))})),n.addEventListener("error",(()=>i())),n.src=e}))}(e).then((t=>{const i=mx(t,e),n=i.replace("image/","");return new File([t],`image.${n}`,{type:i})}))}(n).then(t).catch(i):i(e)))}))}function mx(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class gx extends ku{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("uploadImage",(()=>this._createToolbarButton())),e.ui.componentFactory.add("imageUpload",(()=>this._createToolbarButton())),e.ui.componentFactory.add("menuBar:uploadImage",(()=>this._createMenuBarButton("standalone"))),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("uploadImage"),r=t.config.get("image.upload.types"),s=dx(r),o=new e(t.locale),a=i.t;return o.set({acceptedType:r.map((e=>`image/${e}`)).join(","),allowMultipleFiles:!0,label:a("Upload from computer"),icon:ju.imageUpload}),o.bind("isEnabled").to(n),o.on("done",((e,i)=>{const n=Array.from(i).filter((e=>s.test(e.type)));n.length&&(t.execute("uploadImage",{file:n}),t.editing.view.focus())})),o}_createToolbarButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),n=this._createButton(Dg);return n.tooltip=!0,n.bind("label").to(t,"isImageSelected",i,"isAccessAllowed",((t,i)=>e(i?t?"Replace image from computer":"Upload image from computer":"You have no image upload permissions."))),n}_createDropdownButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(Dg);return i.withText=!0,i.bind("label").to(t,"isImageSelected",(t=>e(t?"Replace from computer":"Upload from computer"))),i.on("execute",(()=>{t.dropdownView.isOpen=!1})),i}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createButton(jp);switch(i.withText=!0,e){case"standalone":i.label=t("Image from computer");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("From computer")}return i}}class fx extends ku{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}placeholder;constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}uploadStatusChange=(e,t,i)=>{const n=this.editor,r=t.item,s=r.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const o=n.plugins.get("ImageUtils"),a=n.plugins.get(Gu),l=s?t.attributeNewValue:null,c=this.placeholder,h=n.editing.mapper.toViewElement(r),d=i.writer;if("reading"==l)return px(h,d),void wx(o,c,h,d);if("uploading"==l){const e=a.loaders.get(s);return px(h,d),void(e?(bx(h,d),function(e,t,i,n){const r=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),r),i.on("change:uploadedPercent",((e,t,i)=>{n.change((e=>{e.setStyle("width",i+"%",r)}))}))}(h,d,e,n.editing.view),function(e,t,i,n){if(n.data){const r=e.findViewImgElement(t);i.setAttribute("src",n.data,r)}}(o,h,d,e)):wx(o,c,h,d))}"complete"==l&&a.loaders.get(s)&&function(e,t,i){const n=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),n),setTimeout((()=>{i.change((e=>e.remove(e.createRangeOn(n))))}),3e3)}(h,d,n.editing.view),function(e,t){vx(e,t,"progressBar")}(h,d),bx(h,d),function(e,t){t.removeClass("ck-appear",e)}(h,d)}}function px(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function wx(e,t,i,n){i.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",i);const r=e.findViewImgElement(i);r.getAttribute("src")!==t&&n.setAttribute("src",t,r),_x(i,"placeholder")||n.insert(n.createPositionAfter(r),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(n))}function bx(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),vx(e,t,"placeholder")}function _x(e,t){for(const i of e.getChildren())if(i.getCustomProperty(t))return i}function vx(e,t,i){const n=_x(e,i);n&&t.remove(t.createRangeOn(n))}class yx extends xu{constructor(e){super(e),this.set("isAccessAllowed",!0)}refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){const t=Qr(e.file),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const s=i.getSelectedElement();if(t&&s&&n.isImage(s)){const t=this.editor.model.createPositionAfter(s);this._uploadImage(e,r,t)}else this._uploadImage(e,r)}))}_uploadImage(e,t,i){const n=this.editor,r=n.plugins.get(Gu).createLoader(e),s=n.plugins.get("ImageUtils");r&&s.insertImage({...t,uploadId:r.id},i)}}class kx extends ku{static get requires(){return[Gu,Rp,z_,NC]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}_uploadImageElements;constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,i=e.conversion,n=e.plugins.get(Gu),r=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),o=dx(e.config.get("image.upload.types")),a=new yx(e);e.commands.add("uploadImage",a),e.commands.add("imageUpload",a),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,i)=>{if(n=i.dataTransfer,Array.from(n.types).includes("text/html")&&""!==n.getData("text/html"))return;var n;const r=Array.from(i.dataTransfer.files).filter((e=>!!e&&o.test(e.type)));if(!r.length)return;t.stop(),e.model.change((t=>{i.targetRanges&&t.setSelection(i.targetRanges.map((t=>e.editing.mapper.toModelRange(t)))),e.execute("uploadImage",{file:r})}));if(!e.commands.get("uploadImage").isAccessAllowed){const t=e.plugins.get("Notification"),i=e.locale.t;t.showWarning(i("You have no image upload permissions."),{namespace:"image"})}})),this.listenTo(s,"inputTransformation",((t,i)=>{const s=Array.from(e.editing.view.createRangeIn(i.content)).map((e=>e.item)).filter((e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src")||!t.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!t.getAttribute("src").match(/^blob:/g))}(r,e)&&!e.getAttribute("uploadProcessed"))).map((e=>({promise:ux(e),imageElement:e})));if(!s.length)return;const o=new xd(e.editing.view.document);for(const e of s){o.setAttribute("uploadProcessed",!0,e.imageElement);const t=n.createLoader(e.promise);t&&(o.setAttribute("src","",e.imageElement),o.setAttribute("uploadId",t.id,e.imageElement))}})),e.editing.view.document.on("dragover",((e,t)=>{t.preventDefault()})),t.on("change",(()=>{const i=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),r=new Set;for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter,s="$graveyard"==t.position.root.rootName;for(const t of Cx(e,i)){const e=t.getAttribute("uploadId");if(!e)continue;const i=n.loaders.get(e);i&&(s?r.has(e)||i.abort():(r.add(e),this._uploadImageElements.set(e,t),"idle"==i.status&&this._readAndUpload(i)))}}})),this.on("uploadComplete",((e,{imageElement:t,data:i})=>{const n=i.urls?i.urls:i;this.editor.model.change((e=>{e.setAttribute("src",n.default,t),this._parseAndSetSrcsetAttributeOnImage(n,t,e),r.setImageNaturalSizeAttributes(t)}))}),{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]})}_readAndUpload(e){const t=this.editor,i=t.model,n=t.locale.t,r=t.plugins.get(Gu),s=t.plugins.get(Rp),o=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},(t=>{t.setAttribute("uploadStatus","reading",a.get(e.id))})),e.read().then((()=>{const r=e.upload(),s=a.get(e.id);if(Ki.isSafari){const e=t.editing.mapper.toViewElement(s),i=o.findViewImgElement(e);t.editing.view.once("render",(()=>{if(!i.parent)return;const e=t.editing.view.domConverter.mapViewToDom(i.parent);if(!e)return;const n=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=n}))}return t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Uploading image")),i.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","uploading",s)})),r})).then((r=>{i.enqueueChange({isUndoable:!1},(i=>{const s=a.get(e.id);i.setAttribute("uploadStatus","complete",s),t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Image upload complete")),this.fire("uploadComplete",{data:r,imageElement:s})})),l()})).catch((r=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Error during image upload")),"error"!==e.status&&"aborted"!==e.status)throw r;"error"==e.status&&r&&s.showWarning(r,{title:n("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},(t=>{const i=a.get(e.id);i&&"$graveyard"!==i.root.rootName&&t.remove(i)})),l()}));function l(){i.enqueueChange({isUndoable:!1},(t=>{const i=a.get(e.id);t.removeAttribute("uploadId",i),t.removeAttribute("uploadStatus",i),a.delete(e.id)})),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const r=Object.keys(e).filter((e=>{const t=parseInt(e,10);if(!isNaN(t))return n=Math.max(n,t),!0})).map((t=>`${e[t]} ${t}w`)).join(", ");if(""!=r){const e={srcset:r};t.hasAttribute("width")||t.hasAttribute("height")||(e.width=n),i.setAttributes(e,t)}}}function Cx(e,t){const i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter((e=>i.isImage(e.item))).map((e=>e.item))}class xx extends ku{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[kx,gx,fx]}}class Ax extends ng{urlInputView;keystrokes;constructor(e){super(e),this.set("imageURLInputValue",""),this.set("isImageSelected",!1),this.set("isEnabled",!0),this.keystrokes=new os,this.urlInputView=this._createUrlInputView(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-image-insert-url"]},children:[this.urlInputView,{tag:"div",attributes:{class:["ck","ck-image-insert-url__action-row"]}}]})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}_createUrlInputView(){const e=this.locale,t=e.t,i=new Yg(e,Rf);return i.bind("label").to(this,"isImageSelected",(e=>t(e?"Update image URL":"Insert image via URL"))),i.bind("isEnabled").to(this),i.fieldView.inputMode="url",i.fieldView.placeholder="https://example.com/image.png",i.fieldView.bind("value").to(this,"imageURLInputValue",(e=>e||"")),i.fieldView.on("input",(()=>{this.imageURLInputValue=i.fieldView.element.value.trim()})),i}focus(){this.urlInputView.focus()}}class Tx extends ku{_imageInsertUI;_formView;static get pluginName(){return"ImageInsertViaUrlUI"}static get isOfficialPlugin(){return!0}static get requires(){return[nx,Sg]}init(){this.editor.ui.componentFactory.add("insertImageViaUrl",(()=>this._createToolbarButton())),this.editor.ui.componentFactory.add("menuBar:insertImageViaUrl",(()=>this._createMenuBarButton("standalone")))}afterInit(){this._imageInsertUI=this.editor.plugins.get("ImageInsertUI"),this._imageInsertUI.registerIntegration({name:"url",observable:()=>this.editor.commands.get("insertImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createInsertUrlButton(e){const t=new e(this.editor.locale);return t.icon=ju.imageUrl,t.on("execute",(()=>{this._showModal()})),t}_createToolbarButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(hg);return t.tooltip=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",(t=>e(t?"Update image URL":"Insert image via URL"))),t}_createDropdownButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(hg);return t.withText=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",(t=>e(t?"Update image URL":"Insert via URL"))),t}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createInsertUrlButton(Vg);switch(i.withText=!0,e){case"standalone":i.label=t("Image via URL");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("Via URL")}return i}_createInsertUrlView(){const e=this.editor,t=e.locale,i=e.commands.get("replaceImageSource"),n=e.commands.get("insertImage"),r=new Ax(t);return r.bind("isImageSelected").to(this._imageInsertUI),r.bind("isEnabled").toMany([n,i],"isEnabled",((...e)=>e.some((e=>e)))),r}_showModal(){const e=this.editor,t=e.locale.t,i=e.plugins.get("Dialog");this._formView||(this._formView=this._createInsertUrlView(),this._formView.on("submit",(()=>this._handleSave())));const n=e.commands.get("replaceImageSource");this._formView.imageURLInputValue=n.value||"",i.show({id:"insertImageViaUrl",title:this._imageInsertUI.isImageSelected?t("Update image URL"):t("Insert image via URL"),isModal:!0,content:this._formView,actionButtons:[{label:t("Cancel"),withText:!0,onExecute:()=>i.hide()},{label:t("Accept"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSave()}]})}_handleSave(){this.editor.commands.get("replaceImageSource").isEnabled?this.editor.execute("replaceImageSource",{source:this._formView.imageURLInputValue}):this.editor.execute("insertImage",{source:this._formView.imageURLInputValue}),this.editor.plugins.get("Dialog").hide()}}class Ex extends ku{static get pluginName(){return"ImageInsertViaUrl"}static get isOfficialPlugin(){return!0}static get requires(){return[Tx,nx]}}class Sx extends xu{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("resizedWidth")?this.value={width:t.getAttribute("resizedWidth"),height:null}:this.value=null}execute(e){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils"),r=n.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},r&&i.change((t=>{t.setAttribute("resizedWidth",e.width,r),t.removeAttribute("resizedHeight",r),n.setImageNaturalSizeAttributes(r)}))}}class Px extends ku{static get requires(){return[NC]}static get pluginName(){return"ImageResizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Sx(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}afterInit(){this._registerSchema()}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils");t.conversion.for("downcast").add((t=>t.on(`attribute:resizedWidth:${e}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=i.writer,r=i.mapper.toViewElement(t.item);null!==t.attributeNewValue?(n.setStyle("width",t.attributeNewValue,r),n.addClass("image_resized",r)):(n.removeStyle("width",r),n.removeClass("image_resized",r))})))),t.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:e=>({key:"style",value:{height:e}})}),t.conversion.for("editingDowncast").add((t=>t.on(`attribute:resizedHeight:${e}`,((t,n,r)=>{if(!r.consumable.consume(n.item,t.name))return;const s=r.writer,o=r.mapper.toViewElement(n.item),a="imageInline"===e?i.findViewImgElement(o):o;null!==n.attributeNewValue?s.setStyle("height",n.attributeNewValue,a):s.removeStyle("height",a)})))),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:e=>FC(e)?null:e.getStyle("width")}}),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:e=>FC(e)?null:e.getStyle("height")}})}}const Ix=(()=>({small:ju.objectSizeSmall,medium:ju.objectSizeMedium,large:ju.objectSizeLarge,custom:ju.objectSizeCustom,original:ju.objectSizeFull}))();class Vx extends ku{static get requires(){return[Px]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}_resizeUnit;constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:i,value:n,icon:r}=e;t.ui.componentFactory.add(i,(i=>{const s=new hg(i),o=t.commands.get("resizeImage"),a=this._getOptionLabelValue(e,!0);if(!Ix[r])throw new gn("imageresizebuttons-missing-icon",t,e);if(s.set({label:a,icon:Ix[r],tooltip:a,isToggleable:!0}),s.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&Rx(e)){const e=t.plugins.get("ImageCustomResizeUI");this.listenTo(s,"execute",(()=>{e._showForm(this._resizeUnit)}))}else{const e=n?n+this._resizeUnit:null;s.bind("isOn").to(o,"value",Bx(e)),this.listenTo(s,"execute",(()=>{t.execute("resizeImage",{width:e})}))}return s}))}_registerImageResizeDropdown(e){const t=this.editor,i=t.t,n=e.find((e=>!e.value)),r=r=>{const s=t.commands.get("resizeImage"),o=xf(r,of),a=o.buttonView,l=i("Resize image");return a.set({tooltip:l,commandValue:n.value,icon:Ix.medium,isToggleable:!0,label:this._getOptionLabelValue(n),withText:!0,class:"ck-resize-image-button",ariaLabel:l,ariaLabelledBy:void 0}),a.bind("label").to(s,"value",(e=>e&&e.width?e.width:this._getOptionLabelValue(n))),o.bind("isEnabled").to(this),Ef(o,(()=>this._getResizeDropdownListItemDefinitions(e,s)),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(o,"execute",(e=>{"onClick"in e.source?e.source.onClick():(t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus())})),o};t.ui.componentFactory.add("resizeImage",r),t.ui.componentFactory.add("imageResize",r)}_getOptionLabelValue(e,t=!1){const i=this.editor.t;return e.label?e.label:t?Rx(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):Rx(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){const{editor:i}=this,n=new es,r=e.map((e=>Rx(e)?{...e,valueWithUnits:"custom"}:e.value?{...e,valueWithUnits:`${e.value}${this._resizeUnit}`}:{...e,valueWithUnits:null}));for(const e of r){let s=null;if(i.plugins.has("ImageCustomResizeUI")&&Rx(e)){const n=i.plugins.get("ImageCustomResizeUI");s={type:"button",model:new Bp({label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{n._showForm(this._resizeUnit)}})};const o=IC(r,"valueWithUnits");s.model.bind("isOn").to(t,"value",Ox(o))}else s={type:"button",model:new Bp({commandName:"resizeImage",commandValue:e.valueWithUnits,label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null})},s.model.bind("isOn").to(t,"value",Bx(e.valueWithUnits));s.model.bind("isEnabled").to(t,"isEnabled"),n.add(s)}return n}}function Rx(e){return"custom"===e.value}function Bx(e){return t=>null===e&&t===e||null!==t&&t.width===e}function Ox(e){return t=>!e.some((e=>Bx(e)(t)))}const Fx="image_resized";class Mx extends ku{static get requires(){return[b_,NC]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils");t.addObserver(KC),this.listenTo(t.document,"imageLoaded",((n,r)=>{if(!r.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const s=e.editing.view.domConverter,o=s.domToView(r.target),a=i.getImageWidgetFromImageView(o);let l=this.editor.plugins.get(b_).getResizerByViewElement(a);if(l)return void l.redraw();const c=e.editing.mapper,h=c.toModelElement(a);l=e.plugins.get(b_).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:h,viewElement:a,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>s.mapViewToDom(c.toViewElement(h)),isCentered:()=>"alignCenter"==h.getAttribute("imageStyle"),onCommit(i){t.change((e=>{e.removeClass(Fx,a)})),e.execute("resizeImage",{width:i})}}),l.on("updateSize",(()=>{a.hasClass(Fx)||t.change((e=>{e.addClass(Fx,a)}));const e="imageInline"===h.name?o:a;e.getStyle("height")&&t.change((t=>{t.removeStyle("height",e)}))})),l.bind("isEnabled").to(this)}))}}function Nx(e){if(!e)return null;const[,t,i]=e.trim().match(/([.,\d]+)(%|px)$/)||[],n=Number.parseFloat(t);return Number.isNaN(n)?null:{value:n,unit:i}}function Lx(e,t,i){return"px"===i?{value:t.value,unit:"px"}:{value:t.value/e*100,unit:"%"}}function Dx(e){const{editing:t}=e,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);if(!i)return null;const n=t.mapper.toViewElement(i);return{model:i,view:n,dom:t.view.domConverter.mapViewToDom(n)}}class zx extends ng{focusTracker;keystrokes;unit;labeledInput;saveButtonView;cancelButtonView;_focusables;_focusCycler;_validators;constructor(e,t,i){super(e);const n=this.locale.t;this.focusTracker=new is,this.keystrokes=new os,this.unit=t,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(n("Save"),ju.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),ju.cancel,"ck-button-cancel","cancel"),this._focusables=new Fm,this._validators=i,this._focusCycler=new mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),og({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,i,n){const r=new hg(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:i}}),n&&r.delegate("execute").to(this,n),r}_createLabeledInputView(){const e=this.locale.t,t=new Yg(this.locale,Bf);return t.label=e("Resize image (in %0)",this.unit),t.fieldView.set({step:.1}),t}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(null===e)return null;const t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){const{parsedSize:e,unit:t}=this;return null===e?null:`${e}${t}`}}class Hx extends ku{_balloon;_form;static get requires(){return[Fp]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(sg(zx))(t.locale,e,function(e){const t=e.t;return[e=>""===e.rawSize.trim()?t("The value must not be empty."):null===e.parsedSize?t("The value should be a plain number."):void 0]}(t)),this._form.render(),this.listenTo(this._form,"submit",(()=>{this._form.isValid()&&(t.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))})),this.listenTo(this._form.labeledInput,"change:errorText",(()=>{t.ui.update()})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((e,t)=>{this._hideForm(!0),t()})),rg({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);const t=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:$C(t)});const n=function(e,t){const i=Dx(e);if(!i)return null;const n=Nx(i.model.getAttribute("resizedWidth")||null);return n?n.unit===t?n:Lx(Yb(i.dom),{unit:"px",value:new ur(i.dom).width},t):null}(t,e),r=n?n.value.toFixed(1):"",s=function(e,t){const i=Dx(e);if(!i)return null;const n=Yb(i.dom),r=Nx(window.getComputedStyle(i.dom).minWidth)||{value:1,unit:"px"};return{unit:t,lower:Math.max(.1,Lx(n,r,t).value),upper:"px"===t?n:100}}(t,e);i.fieldView.value=i.fieldView.element.value=r,s&&Object.assign(i.fieldView,{min:s.lower.toFixed(1),max:Math.ceil(s.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class Wx extends xu{_defaultStyles;_styles;constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map((e=>{if(e.isDefault)for(const t of e.modelElements)this._defaultStyles[t]=e.name;return[e.name,e]})))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils");i.change((t=>{const r=e.value,{setImageSizes:s=!0}=e;let o=n.getClosestSelectedImageElement(i.document.selection);r&&this.shouldConvertImageType(r,o)&&(this.editor.execute(n.isBlockImage(o)?"imageTypeInline":"imageTypeBlock",{setImageSizes:s}),o=n.getClosestSelectedImageElement(i.document.selection)),!r||this._styles.get(r).isDefault?t.removeAttribute("imageStyle",o):t.setAttribute("imageStyle",r,o),s&&n.setImageNaturalSizeAttributes(o)}))}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const $x={get inline(){return{name:"inline",title:"In line",icon:ju.objectInline,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:ju.objectLeft,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:ju.objectBlockLeft,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:ju.objectCenter,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:ju.objectRight,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:ju.objectBlockRight,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:ju.objectCenter,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:ju.objectRight,modelElements:["imageBlock"],className:"image-style-side"}}},Ux=(()=>({full:ju.objectFullWidth,left:ju.objectBlockLeft,right:ju.objectBlockRight,center:ju.objectCenter,inlineLeft:ju.objectLeft,inlineRight:ju.objectRight,inline:ju.objectInline}))(),jx=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function qx(e){fn("image-style-configuration-definition-invalid",e)}var Gx={normalizeStyles:function(e){return(e.configuredStyles.options||[]).map((e=>function(e){e="string"==typeof e?$x[e]?{...$x[e]}:{name:e}:function(e,t){const i={...t};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)||(i[n]=e[n]);return i}($x[e.name],e);"string"==typeof e.icon&&(e.icon=Ux[e.icon]||e.icon);return e}(e))).filter((t=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:n,name:r}=e;if(!(n&&n.length&&r))return qx({style:e}),!1;{const r=[t?"imageBlock":null,i?"imageInline":null];if(!n.some((e=>r.includes(e))))return fn("image-style-missing-dependency",{style:e,missingPlugins:n.map((e=>"imageBlock"===e?"ImageBlockEditing":"ImageInlineEditing"))}),!1}return!0}(t,e)))},getDefaultStylesConfiguration:function(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...jx]:[]},warnInvalidStyle:qx,DEFAULT_OPTIONS:$x,DEFAULT_ICONS:Ux,DEFAULT_DROPDOWN_DEFINITIONS:jx};function Kx(e,t){for(const i of t)if(i.name===e)return i}class Zx extends ku{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[NC]}normalizedStyles;init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=Gx,i=this.editor,n=i.plugins.has("ImageBlockEditing"),r=i.plugins.has("ImageInlineEditing");i.config.define("image.styles",t(n,r)),this.normalizedStyles=e({configuredStyles:i.config.get("image.styles"),isBlockPluginLoaded:n,isInlinePluginLoaded:r}),this._setupConversion(n,r),this._setupPostFixer(),i.commands.add("imageStyle",new Wx(i,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,n=i.model.schema,r=(s=this.normalizedStyles,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=Kx(t.attributeNewValue,s),r=Kx(t.attributeOldValue,s),o=i.mapper.toViewElement(t.item),a=i.writer;r&&a.removeClass(r.className,o),n&&a.addClass(n.className,o)});var s;const o=function(e){const t={imageInline:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageInline"))),imageBlock:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageBlock")))};return(e,i,n)=>{if(!i.modelRange)return;const r=i.viewItem,s=ts(i.modelRange.getItems());if(s&&n.schema.checkAttribute(s,"imageStyle"))for(const e of t[s.name])n.consumable.consume(r,{classes:e.className})&&n.writer.setAttribute("imageStyle",e.name,s)}}(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",r),i.data.downcastDispatcher.on("attribute:imageStyle",r),e&&(n.extend("imageBlock",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:figure",o,{priority:"low"})),t&&(n.extend("imageInline",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:img",o,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,i=e.plugins.get(NC),n=new Map(this.normalizedStyles.map((e=>[e.name,e])));t.registerPostFixer((e=>{let r=!1;for(const s of t.differ.getChanges())if("insert"==s.type||"attribute"==s.type&&"imageStyle"==s.attributeKey){let t="insert"==s.type?s.position.nodeAfter:s.range.start.nodeAfter;if(t&&t.is("element","paragraph")&&t.childCount>0&&(t=t.getChild(0)),!i.isImage(t))continue;const o=t.getAttribute("imageStyle");if(!o)continue;const a=n.get(o);a&&a.modelElements.includes(t.name)||(e.removeAttribute("imageStyle",t),r=!0)}return r}))}}class Jx extends ku{static get requires(){return[Zx]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const t=this.editor.plugins,i=this.editor.config.get("image.toolbar")||[],n=Qx(t.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const e of n)this._createButton(e);const r=Qx([...i.filter(e),...Gx.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const e of r)this._createDropdown(e,n)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,(n=>{let r;const{defaultItem:s,items:o,title:a}=e,l=o.filter((e=>t.find((({name:t})=>Yx(t)===e)))).map((e=>{const t=i.create(e);return e===s&&(r=t),t}));o.length!==l.length&&Gx.warnInvalidStyle({dropdown:e});const c=xf(n,Cf),h=c.buttonView,d=h.arrowView;return Af(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),h.set({label:Xx(a,r.label),class:null,tooltip:!0}),d.unbind("label"),d.set({label:a}),h.bind("icon").toMany(l,"isOn",((...e)=>{const t=e.findIndex(Vi);return t<0?r.icon:l[t].icon})),h.bind("label").toMany(l,"isOn",((...e)=>{const t=e.findIndex(Vi);return Xx(a,t<0?r.label:l[t].label)})),h.bind("isOn").toMany(l,"isOn",((...e)=>e.some(Vi))),h.bind("class").toMany(l,"isOn",((...e)=>e.some(Vi)?"ck-splitbutton_flatten":void 0)),h.on("execute",(()=>{l.some((({isOn:e})=>e))?c.isOpen=!c.isOpen:r.fire("execute")})),c.bind("isEnabled").toMany(l,"isEnabled",((...e)=>e.some(Vi))),this.listenTo(c,"execute",(()=>{this.editor.editing.view.focus()})),c}))}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(Yx(t),(i=>{const n=this.editor.commands.get("imageStyle"),r=new hg(i);return r.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(n,"isEnabled"),r.bind("isOn").to(n,"value",(e=>e===t)),r.on("execute",this._executeCommand.bind(this,t)),r}))}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function Qx(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function Yx(e){return`imageStyle:${e}`}function Xx(e,t){return(e?e+": ":"")+t}class eA extends ku{static get pluginName(){return"IndentEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.commands.add("indent",new Tu(e)),e.commands.add("outdent",new Tu(e))}}class tA extends ku{static get pluginName(){return"IndentUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,i=e.t,n="ltr"==t.uiLanguageDirection?ju.indent:ju.outdent,r="ltr"==t.uiLanguageDirection?ju.outdent:ju.indent;this._defineButton("indent",i("Increase indent"),n),this._defineButton("outdent",i("Decrease indent"),r)}_defineButton(e,t,i){const n=this.editor;n.ui.componentFactory.add(e,(()=>{const n=this._createButton(hg,e,t,i);return n.set({tooltip:!0}),n})),n.ui.componentFactory.add("menuBar:"+e,(()=>this._createButton(Vg,e,t,i)))}_createButton(e,t,i,n){const r=this.editor,s=r.commands.get(t),o=new e(r.locale);return o.set({label:i,icon:n}),o.bind("isEnabled").to(s,"isEnabled"),this.listenTo(o,"execute",(()=>{r.execute(t),r.editing.view.focus()})),o}}class iA extends xu{_indentBehavior;constructor(e,t){super(e),this._indentBehavior=t}refresh(){const e=ts(this.editor.model.document.selection.getSelectedBlocks());e&&this._isIndentationChangeAllowed(e)?this.isEnabled=this._indentBehavior.checkEnabled(e.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const e=this.editor.model,t=this._getBlocksToChange();e.change((e=>{for(const i of t){const t=i.getAttribute("blockIndent"),n=this._indentBehavior.getNextIndent(t);n?e.setAttribute("blockIndent",n,i):e.removeAttribute("blockIndent",i)}}))}_getBlocksToChange(){const e=this.editor.model.document.selection;return Array.from(e.getSelectedBlocks()).filter((e=>this._isIndentationChangeAllowed(e)))}_isIndentationChangeAllowed(e){const t=this.editor;if(!t.model.schema.checkAttribute(e,"blockIndent"))return!1;if(!t.plugins.has("ListUtils"))return!0;if(!this._indentBehavior.isForward)return!0;return!t.plugins.get("ListUtils").isListItemBlock(e)}}class nA{isForward;offset;unit;constructor(e){this.isForward="forward"===e.direction,this.offset=e.offset,this.unit=e.unit}checkEnabled(e){const t=parseFloat(e||"0");return this.isForward||t>0}getNextIndent(e){const t=parseFloat(e||"0");if(!(!e||e.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const i=t+(this.isForward?this.offset:-this.offset);return i>0?i+this.unit:void 0}}class rA{isForward;classes;constructor(e){this.isForward="forward"===e.direction,this.classes=e.classes}checkEnabled(e){const t=this.classes.indexOf(e);return this.isForward?t=0}getNextIndent(e){const t=this.classes.indexOf(e),i=this.isForward?1:-1;return this.classes[t+i]}}const sA=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class oA{_definitions=new Set;get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach((e=>this._definitions.add(e))):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",((e,t,i)=>{if(!i.consumable.test(t.item,"attribute:linkHref"))return;if(!t.item.is("selection")&&!i.schema.isInline(t.item))return;const n=i.writer,r=n.document.selection;for(const e of this._definitions){const s=n.createAttributeElement("a",e.attributes,{priority:5});e.classes&&n.addClass(e.classes,s);for(const t in e.styles)n.setStyle(t,e.styles[t],s);n.setCustomProperty("link",!0,s),e.callback(t.attributeNewValue)?t.item.is("selection")?n.wrap(r.getFirstRange(),s):n.wrap(i.mapper.toViewRange(t.range),s):n.unwrap(i.mapper.toViewRange(t.range),s)}}),{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",((e,t,{writer:i,mapper:n})=>{const r=n.toViewElement(t.item),s=Array.from(r.getChildren()).find((e=>e.is("element","a")));if(s)for(const e of this._definitions){const n=as(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of n)"class"===e?i.addClass(t,s):i.setAttribute(e,t,s);e.classes&&i.addClass(e.classes,s);for(const t in e.styles)i.setStyle(t,e.styles[t],s)}else{for(const[e,t]of n)"class"===e?i.removeClass(t,s):i.removeAttribute(e,s);e.classes&&i.removeClass(e.classes,s);for(const t in e.styles)i.removeStyle(t,s)}}}))}}}const aA=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,lA=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,cA=/^((\w+:(\/{2,})?)|(\W))/i,hA=["https?","ftps?","mailto"],dA="Ctrl+K";function uA(e,{writer:t}){const i=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,i),i}function mA(e,t=hA){const i=String(e),n=t.join("|");return function(e,t){const i=e.replace(aA,"");return!!i.match(t)}(i,new RegExp(`${"^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("",n)}`,"i"))?i:"#"}function gA(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function fA(e,t){const i=(n=e,lA.test(n)?"mailto:":t);var n;const r=!!i&&!pA(e);return e&&r?i+e:e}function pA(e){return cA.test(e)}function wA(e){window.open(e,"_blank","noopener")}function bA(e){const t=e.plugins.has("BookmarkEditing")?e.plugins.get("BookmarkEditing"):null;return{isScrollableToTarget:function(e){return!!e&&e.startsWith("#")&&!!t&&!!t.getElementForBookmarkId(e.slice(1))},scrollToTarget:function(i){const n=i.slice(1),r=t.getElementForBookmarkId(n);e.model.change((e=>{e.setSelection(r,"on")})),e.editing.view.scrollToTheSelection({alignToTop:!0,forceScroll:!0})}}}class _A extends xu{manualDecorators=new es;automaticDecorators=new oA;restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||ts(t.getSelectedBlocks());gA(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={}){const i=this.editor.model,n=i.document.selection,r=[],s=[];for(const e in t)t[e]?r.push(e):s.push(e);i.change((t=>{if(n.isCollapsed){const o=n.getFirstPosition();if(n.hasAttribute("linkHref")){const a=vA(n);let l=Nw(o,"linkHref",n.getAttribute("linkHref"),i);n.getAttribute("linkHref")===a&&(l=this._updateLinkContent(i,t,l,e)),t.setAttribute("linkHref",e,l),r.forEach((e=>{t.setAttribute(e,!0,l)})),s.forEach((e=>{t.removeAttribute(e,l)})),t.setSelection(t.createPositionAfter(l.end.nodeBefore))}else if(""!==e){const s=as(n.getAttributes());s.set("linkHref",e),r.forEach((e=>{s.set(e,!0)}));const{end:a}=i.insertContent(t.createText(e,s),o);t.setSelection(a)}["linkHref",...r,...s].forEach((e=>{t.removeSelectionAttribute(e)}))}else{const o=i.schema.getValidRanges(n.getRanges(),"linkHref"),a=[];for(const e of n.getSelectedBlocks())i.schema.checkAttribute(e,"linkHref")&&a.push(t.createRangeOn(e));const l=a.slice();for(const e of o)this._isRangeToUpdate(e,a)&&l.push(e);for(const o of l){let a=o;if(1===l.length){const r=vA(n);n.getAttribute("linkHref")===r&&(a=this._updateLinkContent(i,t,o,e),t.setSelection(t.createSelection(a)))}t.setAttribute("linkHref",e,a),r.forEach((e=>{t.setAttribute(e,!0,a)})),s.forEach((e=>{t.removeAttribute(e,a)}))}}}))}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,n=i.getSelectedElement();return gA(n,t.schema)?n.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}_updateLinkContent(e,t,i,n){const r=t.createText(n,{linkHref:n});return e.insertContent(r,i)}}function vA(e){if(e.isCollapsed){const t=e.getFirstPosition();return t.textNode&&t.textNode.data}{const t=Array.from(e.getFirstRange().getItems());if(t.length>1)return null;const i=t[0];return i.is("$text")||i.is("$textProxy")?i.data:null}}class yA extends xu{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();gA(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,i=t.document.selection,n=e.commands.get("link");t.change((e=>{const r=i.isCollapsed?[Nw(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const t of r)if(e.removeAttribute("linkHref",t),n)for(const i of n.manualDecorators)e.removeAttribute(i.id,t)}))}}class kA extends(Ln()){id;defaultValue;label;attributes;classes;styles;constructor({id:e,label:t,attributes:i,classes:n,styles:r,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=i,this.classes=n,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}const CA="automatic",xA=/^(https?:)?\/\//;class AA extends ku{static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Cw,lw,z_]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:uA}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,i)=>uA(mA(e,t),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new _A(e)),e.commands.add("unlink",new yA(e));const i=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach((e=>("label"in e&&i[e.label]&&(e.label=i[e.label]),e))),t}(e.t,function(e){const t=[];if(e)for(const[i,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${Uk(i)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter((e=>e.mode===CA))),this._enableManualDecorators(i.filter((e=>"manual"===e.mode)));e.plugins.get(Cw).registerAttribute("linkHref"),Dw(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(e){const t=this.editor,i=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:CA,callback:e=>!!e&&xA.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(e),i.length&&t.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach((e=>{t.model.schema.extend("$text",{allowAttributes:e.id});const n=new kA(e);i.add(n),t.conversion.for("downcast").attributeToElement({model:n.id,view:(e,{writer:t,schema:i},{item:r})=>{if((r.is("selection")||i.isInline(r))&&e){const e=t.createAttributeElement("a",n.attributes,{priority:5});n.classes&&t.addClass(n.classes,e);for(const i in n.styles)t.setStyle(i,n.styles[i],e);return t.setCustomProperty("link",!0,e),e}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...n._createPattern()},model:{key:n.id}})}))}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document,i=bA(e);function n(e){i.isScrollableToTarget(e)?i.scrollToTarget(e):wA(e)}this.listenTo(t,"click",((e,t)=>{if(!(Ki.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let i=t.domTarget;if("a"!=i.tagName.toLowerCase()&&(i=i.closest("a")),!i)return;const r=i.getAttribute("href");r&&(e.stop(),t.preventDefault(),n(r))}),{context:"$capture"}),this.listenTo(t,"keydown",((t,i)=>{const r=e.commands.get("link").value;!!r&&i.keyCode===Wr.enter&&i.altKey&&(t.stop(),n(r))}))}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",((i,{attributeKeys:n})=>{n.includes("linkHref")&&!t.hasAttribute("linkHref")&&e.change((t=>{var i;!function(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}(t,(i=e.schema,i.getDefinition("$text").allowAttributes.filter((e=>e.startsWith("link")))))}))}))}_enableClipboardIntegration(){const e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",((e,n)=>{t.change((e=>{const t=e.createRangeIn(n.content);for(const n of t.getItems())if(n.hasAttribute("linkHref")){const t=fA(n.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,n)}}))}))}}class TA extends ng{focusTracker=new is;keystrokes=new os;urlInputView;saveButtonView;cancelButtonView;_manualDecoratorSwitches;children;_validators;_focusables=new Fm;_focusCycler;constructor(e,t,i){super(e);const n=e.t;this._validators=i,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),ju.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),ju.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusCycler=new mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const r=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&r.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:r,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((e,t)=>(e[t.name]=t.isOn,e)),{})}render(){super.render(),og({view:this});[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createUrlInput(){const e=this.locale.t,t=new Yg(this.locale,Rf);return t.fieldView.inputMode="url",t.label=e("Link URL"),t}_createButton(e,t,i,n){const r=new hg(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:i}}),n&&r.delegate("execute").to(this,n),r}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e.manualDecorators){const n=new Lg(this.locale);n.set({name:i.id,label:i.label,withText:!0}),n.bind("isOn").toMany([i,e],"value",((e,t)=>void 0===t&&void 0===e?!!i.defaultValue:!!e)),n.on("execute",(()=>{i.set("value",!n.isOn)})),t.add(n)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new ng;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map((e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}}))),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(e)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}class EA extends ng{focusTracker=new is;keystrokes=new os;previewButtonView;unlinkButtonView;editButtonView;_focusables=new Fm;_focusCycler;_linkConfig;_options;constructor(e,t={},i){super(e);const n=e.t;this._options=i,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(n("Unlink"),'',"unlink"),this.editButtonView=this._createButton(n("Edit link"),ju.pencil,"edit"),this.set("href",void 0),this._linkConfig=t,this._focusCycler=new mg({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,i){const n=new hg(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.delegate("execute").to(this,i),n}_createPreviewButton(){const e=new hg(this.locale),t=this.bindTemplate,i=this.t;return e.set({withText:!0}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",(e=>e&&mA(e,this._linkConfig.allowedProtocols))),target:"_blank",rel:"noopener noreferrer"},on:{click:t.to((e=>{this._options&&this._options.isScrollableToTarget(this.href)?(e.preventDefault(),this._options.scrollToTarget(this.href)):wA(this.href)}))}}),e.bind("tooltip").to(this,"href",(e=>this._options&&this._options.isScrollableToTarget(e)?i("Scroll to target"):i("Open link in new tab"))),e.bind("label").to(this,"href",(e=>e||i("This link has no URL"))),e.bind("isEnabled").to(this,"href",(e=>!!e)),e.template.tag="a",e}}var SA='';const PA="link-ui";class IA extends ku{actionsView=null;formView=null;_balloon;static get requires(){return[Fp]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.editing.view.addObserver(kd),this._balloon=e.plugins.get(Fp),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:PA,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:PA,view:(e,{writer:t})=>{if(!e.markerRange.isCollapsed)return null;const i=t.createUIElement("span");return t.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],i),i}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:dA},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new EA(e.locale,e.config.get("link"),bA(e)),i=e.commands.get("link"),n=e.commands.get("unlink");return t.bind("href").to(i,"value"),t.editButtonView.bind("isEnabled").to(i),t.unlinkButtonView.bind("isEnabled").to(n),this.listenTo(t,"edit",(()=>{this._addFormView()})),this.listenTo(t,"unlink",(()=>{e.execute("unlink"),this._hideUI()})),t.keystrokes.set("Esc",((e,t)=>{this._hideUI(),t()})),t.keystrokes.set(dA,((e,t)=>{this._addFormView(),t()})),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),i=e.config.get("link.defaultProtocol"),n=new(sg(TA))(e.locale,t,function(e){const t=e.t,i=e.config.get("link.allowCreatingEmptyLinks");return[e=>{if(!i&&!e.url.length)return t("Link URL must not be empty.")}]}(e));return n.urlInputView.fieldView.bind("value").to(t,"value"),n.urlInputView.bind("isEnabled").to(t,"isEnabled"),n.saveButtonView.bind("isEnabled").to(t,"isEnabled"),this.listenTo(n,"submit",(()=>{if(n.isValid()){const{value:t}=n.urlInputView.fieldView.element,r=fA(t,i);e.execute("link",r,n.getDecoratorSwitchesState()),this._closeFormView()}})),this.listenTo(n.urlInputView,"change:errorText",(()=>{e.ui.update()})),this.listenTo(n,"cancel",(()=>{this._closeFormView()})),n.keystrokes.set("Esc",((e,t)=>{this._closeFormView(),t()})),n}_createToolbarLinkButton(){const e=this.editor;e.ui.componentFactory.add("link",(()=>{const e=this._createButton(hg);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:link",(()=>{const e=this._createButton(Vg);return e.set({role:"menuitemcheckbox"}),e}))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("link"),r=new e(t.locale),s=i.t;return r.set({label:s("Link"),icon:SA,keystroke:dA,isToggleable:!0}),r.bind("isEnabled").to(n,"isEnabled"),r.bind("isOn").to(n,"value",(e=>!!e)),this.listenTo(r,"execute",(()=>this._showUI(!0))),r}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(()=>{this._getSelectedLinkElement()&&this._showUI()})),e.keystrokes.set(dA,((t,i)=>{i(),e.commands.get("link").isEnabled&&this._showUI(!0)}))}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",((e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())}),{priority:"high"}),this.editor.keystrokes.set("Esc",((e,t)=>{this._isUIVisible&&(this._hideUI(),t())})),rg({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let i=this._getSelectedLinkElement(),n=s();const r=()=>{const e=this._getSelectedLinkElement(),t=s();i&&!e||!i&&t!==n?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,n=t};function s(){return t.selection.focus.getAncestors().reverse().find((e=>e.is("element")))}this.listenTo(e.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return!!this.formView&&e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,i=e.document;let n;if(t.markers.has(PA)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(PA)),i=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));n=e.domConverter.viewRangeToDom(i)}else n=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(i.selection.getFirstRange())};return{target:n}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&Ub(i))return VA(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),n=VA(i.start),r=VA(i.end);return n&&n==r&&e.createRangeIn(n).getTrimmed().isEqual(i)?n:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(PA))t.updateMarker(PA,{range:i});else if(i.start.isAtEnd){const n=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(PA,{usingOperation:!1,affectsData:!1,range:t.createRange(n,i.end)})}else t.addMarker(PA,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(PA)&&e.change((e=>{e.removeMarker(PA)}))}}function VA(e){return e.getAncestors().find((e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t}))||null}const RA=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class BA extends ku{static get requires(){return[_w,AA]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?Nw(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const i=this.editor.model,n=i.document.selection,r=n.getFirstPosition(),s=n.getLastPosition();let o=t.getJoined(this._expandLinkRange(i,r)||t);o&&(o=o.getJoined(this._expandLinkRange(i,s)||t)),o&&(o.start.isBefore(r)||o.end.isAfter(s))&&e.setSelection(o)}_enablePasteLinking(){const e=this.editor,t=e.model,i=t.document.selection,n=e.plugins.get("ClipboardPipeline"),r=e.commands.get("link");n.on("inputTransformation",((e,n)=>{if(!this.isEnabled||!r.isEnabled||i.isCollapsed||"paste"!==n.method)return;if(i.rangeCount>1)return;const s=i.getFirstRange(),o=n.dataTransfer.getData("text/plain");if(!o)return;const a=o.match(RA);a&&a[2]===o&&(t.change((e=>{this._selectEntireLinks(e,s),r.execute(o)})),e.stop())}),{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new kw(e.model,(e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=OA(e.substr(0,e.length-1));return t?{url:t}:void 0}));t.on("matched:data",((t,i)=>{const{batch:n,range:r,url:s}=i;if(!n.isTyping)return;const o=r.end.getShiftedBy(-1),a=o.getShiftedBy(-s.length),l=e.model.createRange(a,o);this._applyAutoLink(s,l)})),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const i=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)}))}_enableShiftEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition(),i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)}))}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:n}=yw(e,t),r=OA(i);if(r){const e=t.createRange(n.end.getShiftedBy(-r.length),n.end);this._applyAutoLink(r,e)}}_applyAutoLink(e,t){const i=this.editor.model,n=fA(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,i)&&pA(n)&&!function(e){const t=e.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}(t)&&this._persistAutoLink(n,t)}_persistAutoLink(e,t){const i=this.editor.model,n=this.editor.plugins.get("Delete");i.enqueueChange((r=>{r.setAttribute("linkHref",e,t),i.enqueueChange((()=>{n.requestUndoOnBackspace()}))}))}}function OA(e){const t=RA.exec(e);return t?t[2]:null}class FA{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward="forward"==t.direction,this._includeSelf=!!t.includeSelf,this._sameAttributes=Qr(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){return ts(new this(e,t)[Symbol.iterator]())}*[Symbol.iterator](){const e=[];for(const{node:t}of MA(this._getStartNode(),this._isForward?"forward":"backward")){const i=t.getAttribute("listIndent");if(ithis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some((e=>t.getAttribute(e)!==this._startElement.getAttribute(e))))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}function*MA(e,t="forward"){const i="forward"==t,n=[];let r=null;for(;DA(e);){let t=null;if(r){const i=e.getAttribute("listIndent"),s=r.getAttribute("listIndent");i>s?n[s]=r:ie.getAttribute("listItemId")!=t))}function YA(e){return Array.from(e).filter((e=>"$graveyard"!==e.root.rootName)).sort(((e,t)=>e.index-t.index))}function XA(e){const t=e.document.selection.getSelectedElement();return t&&e.schema.isObject(t)&&e.schema.isBlock(t)?t:null}function eT(e,t){return t.checkChild(e.parent,"listItem")&&t.checkChild(e,"$text")&&!t.isObject(e)}function tT(e){return"numbered"==e||"customNumbered"==e}function iT(e,t,i){return HA(t,{direction:"forward"}).pop().index>e.index?KA(e,t,i):[]}class nT extends xu{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=rT(e.document.selection);e.change((e=>{const i=[];QA(t)&&!$A(t[0])?("forward"==this._direction&&i.push(...ZA(t,e)),i.push(...GA(t[0],e))):"forward"==this._direction?i.push(...ZA(t,e,{expand:!0})):i.push(...function(e,t){const i=jA(e=Qr(e)),n=new Set,r=Math.min(...i.map((e=>e.getAttribute("listIndent")))),s=new Map;for(const e of i)s.set(e,FA.first(e,{lowerIndent:!0}));for(const e of i){if(n.has(e))continue;n.add(e);const i=e.getAttribute("listIndent")-1;if(i<0)JA(e,t);else{if(e.getAttribute("listIndent")==r){const i=iT(e,s.get(e),t);for(const e of i)n.add(e);if(i.length)continue}t.setAttribute("listIndent",i,e)}}return YA(n)}(t,e));for(const t of i){if(!t.hasAttribute("listType"))continue;const i=FA.first(t,{sameIndent:!0});i&&e.setAttribute("listType",i.getAttribute("listType"),t)}this._fireAfterExecute(i)}))}_fireAfterExecute(e){this.fire("afterExecute",YA(new Set(e)))}_checkEnabled(){let e=rT(this.editor.model.document.selection),t=e[0];if(!t)return!1;if("backward"==this._direction)return!0;if(QA(e)&&!$A(e[0]))return!0;e=jA(e),t=e[0];const i=FA.first(t,{sameIndent:!0});return!!i&&i.getAttribute("listType")==t.getAttribute("listType")}}function rT(e){const t=Array.from(e.getSelectedBlocks()),i=t.findIndex((e=>!DA(e)));return-1!=i&&(t.length=i),t}class sT extends xu{type;_listWalkerOptions;constructor(e,t,i={}){super(e),this.type=t,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.document,n=XA(t),r=Array.from(i.selection.getSelectedBlocks()).filter((e=>t.schema.checkAttribute(e,"listType")||eT(e,t.schema))),s=void 0!==e.forceValue?!e.forceValue:this.value;t.change((o=>{if(s){const e=r[r.length-1],t=HA(e,{direction:"forward"}),i=[];t.length>1&&i.push(...GA(t[1],o)),i.push(...JA(r,o)),i.push(...function(e,t){const i=[];let n=Number.POSITIVE_INFINITY;for(const{node:r}of MA(e.nextSibling,"forward")){const e=r.getAttribute("listIndent");if(0==e)break;e{const{firstElement:s,lastElement:o}=this._getMergeSubjectElements(i,e),a=s.getAttribute("listIndent")||0,l=o.getAttribute("listIndent"),c=o.getAttribute("listItemId");if(a!=l){const e=(h=o,Array.from(new FA(h,{direction:"forward",higherIndent:!0})));n.push(...ZA([o,...e],r,{indentBy:a-l,expand:a{const t=GA(this._getStartBlock(),e);this._fireAfterExecute(t)}))}_fireAfterExecute(e){this.fire("afterExecute",YA(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&DA(t)&&!$A(t)}_getStartBlock(){const e=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?e:e.nextSibling}}class lT extends ku{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(e){return qA(e)}isFirstBlockOfListItem(e){return $A(e)}isListItemBlock(e){return DA(e)}expandListBlocksToCompleteItems(e,t={}){return jA(e,t)}isNumberedListType(e){return tT(e)}}function cT(e){return e.is("element","ol")||e.is("element","ul")}function hT(e){return e.is("element","li")}function dT(e,t,i,n=gT(i,t)){return e.createAttributeElement(mT(i),null,{priority:2*t/100-100,id:n})}function uT(e,t,i){return e.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:i})}function mT(e){return"numbered"==e||"customNumbered"==e?"ol":"ul"}function gT(e,t){return`list-${e}-${t}`}function fT(e,t){const i=e.nodeBefore;if(DA(i)){let e=i;for(const{node:i}of MA(e,"backward"))if(e=i,t.has(e))return;t.set(i,e)}else{const i=e.nodeAfter;DA(i)&&t.set(i,i)}}function pT(){return(e,t,i)=>{const{writer:n,schema:r}=i;if(!t.modelRange)return;const s=Array.from(t.modelRange.getItems({shallow:!0})).filter((e=>r.checkAttribute(e,"listItemId")));if(!s.length)return;const o=LA.next(),a=function(e){let t=0,i=e.parent;for(;i;){if(hT(i))t++;else{const e=i.previousSibling;e&&hT(e)&&t++}i=i.parent}return t}(t.viewItem);let l=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const c=s[0].getAttribute("listType");c&&(l=c);const h={listItemId:o,listIndent:a,listType:l};for(const e of s)e.hasAttribute("listItemId")||n.setAttributes(h,e);s.length>1&&s[1].getAttribute("listItemId")!=h.listItemId&&i.keepEmptyElement(s[0])}}function wT(e,t,i,{dataPipeline:n}={}){const r=function(e){return(t,i)=>{const n=[];for(const i of e)t.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every((e=>!1!==i.test(t,e)))&&(n.forEach((e=>i.consume(t,e))),!0)}}(e);return(s,o,a)=>{const{writer:l,mapper:c,consumable:h}=a,d=o.item;if(!e.includes(o.attributeKey))return;if(!r(d,h))return;const u=function(e,t,i){const n=i.createRangeOn(e),r=t.toViewRange(n).getTrimmed();return r.end.nodeBefore}(d,c,i);_T(u,l,c),function(e,t){let i=e.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const n=i.parent;t.unwrap(t.createRangeOn(e),i),i=n}}(u,l);const m=function(e,t,i,n,{dataPipeline:r}){let s=n.createRangeOn(t);if(!$A(e))return s;for(const o of i){if("itemMarker"!=o.scope)continue;const i=o.createElement(n,e,{dataPipeline:r});if(!i)continue;if(n.setCustomProperty("listItemMarker",!0,i),o.canInjectMarkerIntoElement&&o.canInjectMarkerIntoElement(e)?n.insert(n.createPositionAt(t,0),i):(n.insert(s.start,i),s=n.createRange(n.createPositionBefore(i),n.createPositionAfter(t))),!o.createWrapperElement||!o.canWrapElement)continue;const a=o.createWrapperElement(n,e,{dataPipeline:r});n.setCustomProperty("listItemWrapper",!0,a),o.canWrapElement(e)?s=n.wrap(s,a):(s=n.wrap(n.createRangeOn(i),a),s=n.createRange(s.start,n.createPositionAfter(t)))}return s}(d,u,t,l,{dataPipeline:n});!function(e,t,i,n){if(!e.hasAttribute("listIndent"))return;const r=e.getAttribute("listIndent");let s=e;for(let e=r;e>=0;e--){const r=uT(n,e,s.getAttribute("listItemId")),o=dT(n,e,s.getAttribute("listType"));for(const e of i)"list"!=e.scope&&"item"!=e.scope||!s.hasAttribute(e.attributeName)||e.setAttributeOnDowncast(n,s.getAttribute(e.attributeName),"list"==e.scope?o:r);if(t=n.wrap(t,r),t=n.wrap(t,o),0==e)break;if(s=FA.first(s,{lowerIndent:!0}),!s)break}}(d,m,t,l)}}function bT(e,{dataPipeline:t}={}){return(i,{writer:n})=>{if(!vT(i,e))return null;if(!t)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const r=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,r),r}}function _T(e,t,i){for(;e.parent.is("attributeElement")&&e.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(e),e.parent);const n=[];r(t.createPositionBefore(e).getWalker({direction:"backward"})),r(t.createRangeIn(e).getWalker());for(const e of n)t.remove(e);function r(e){for(const{item:t}of e){if(t.is("element")&&i.toModelElement(t))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&n.push(t)}}}function vT(e,t,i=zA(e)){if(!DA(e))return!1;for(const i of e.getAttributeKeys())if(!i.startsWith("selection:")&&!t.includes(i))return!1;return i.length<2}const yT=["listType","listIndent","listItemId"];class kT extends ku{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Tb,_w,lT,z_]}constructor(e){super(e),e.config.define("list.multiBlock",!0)}init(){const e=this.editor,t=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new gn("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:yT}),i?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const e of yT)t.schema.setAttributeProperties(e,{copyOnReplace:!0});e.commands.add("numberedList",new sT(e,"numbered")),e.commands.add("bulletedList",new sT(e,"bulleted")),e.commands.add("customNumberedList",new sT(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new sT(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new nT(e,"forward")),e.commands.add("outdentList",new nT(e,"backward")),e.commands.add("splitListItemBefore",new aT(e,"before")),e.commands.add("splitListItemAfter",new aT(e,"after")),i&&(e.commands.add("mergeListItemBackward",new oT(e,"backward")),e.commands.add("mergeListItemForward",new oT(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...yT,...this._downcastStrategies.map((e=>e.attributeName))]}_setupDeleteIntegration(){const e=this.editor,t=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",((n,r)=>{const s=e.model.document.selection;XA(e.model)||e.model.change((()=>{const o=s.getFirstPosition();if(s.isCollapsed&&"backward"==r.direction){if(!o.isAtStart)return;const i=o.parent;if(!DA(i))return;if(FA.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:CT(e.model,"backward")})}else UA(i)||e.execute("splitListItemAfter"),e.execute("outdentList");r.preventDefault(),n.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd)return;if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:CT(e.model,"forward")}),r.preventDefault(),n.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const e=this.editor,t=e.model,i=e.commands,n=i.get("enter");this.listenTo(e.editing.view.document,"enter",((i,n)=>{const r=t.document,s=r.selection.getFirstPosition().parent;if(r.selection.isCollapsed&&DA(s)&&s.isEmpty&&!n.isSoft){const t=$A(s),r=UA(s);t&&r?(e.execute("outdentList"),n.preventDefault(),i.stop()):t&&!r?(e.execute("splitListItemAfter"),n.preventDefault(),i.stop()):r&&(e.execute("splitListItemBefore"),n.preventDefault(),i.stop())}}),{context:"li"}),this.listenTo(n,"afterExecute",(()=>{const t=i.get("splitListItemBefore");if(t.refresh(),!t.isEnabled)return;2===zA(e.model.document.selection.getLastPosition().parent).length&&t.execute()}))}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",((t,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(e.execute(n),i.stopPropagation(),i.preventDefault(),t.stop())}),{context:"li"})}_setupConversion(){const e=this.editor,t=e.model,i=this.getListAttributeNames(),n=e.config.get("list.multiBlock"),r=n?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(e,{writer:t})=>t.createElement(r,{listType:""})}).elementToElement({view:"p",model:(e,{writer:t})=>e.parent&&e.parent.is("element","li")?t.createElement(r,{listType:""}):null,converterPriority:"high"}).add((e=>{e.on("element:li",pT())})),n||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:r,view:bT(i),converterPriority:"high"}).add((e=>{var n;e.on("attribute",wT(i,this._downcastStrategies,t)),e.on("remove",(n=t.schema,(e,t,i)=>{const{writer:r,mapper:s}=i,o=e.name.split(":")[1];if(!n.checkAttribute(o,"listItemId"))return;const a=s.toViewPosition(t.position),l=t.position.getShiftedBy(t.length),c=s.toViewPosition(l,{isPhantom:!0}),h=r.createRange(a,c).getTrimmed().end.nodeBefore;h&&_T(h,r,s)}))})),e.conversion.for("dataDowncast").elementToElement({model:r,view:bT(i,{dataPipeline:!0}),converterPriority:"high"}).add((e=>{e.on("attribute",wT(i,this._downcastStrategies,t,{dataPipeline:!0}))}));const s=(o=this._downcastStrategies,a=e.editing.view,(e,t)=>{if(t.modelPosition.offset>0)return;const i=t.modelPosition.parent;if(!DA(i))return;if(!o.some((e=>"itemMarker"==e.scope&&e.canInjectMarkerIntoElement&&e.canInjectMarkerIntoElement(i))))return;const n=t.mapper.toViewElement(i),r=a.createRangeIn(n),s=r.getWalker();let l=r.start;for(const{item:e}of s){if(e.is("element")&&t.mapper.toModelElement(e)||e.is("$textProxy"))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&(l=a.createPositionAfter(e),s.skip((({previousPosition:e})=>!e.isEqual(l))))}t.viewPosition=l});var o,a;e.editing.mapper.on("modelToViewPosition",s),e.data.mapper.on("modelToViewPosition",s),this.listenTo(t.document,"change:data",function(e,t,i,n){return()=>{const n=e.document.differ.getChanges(),o=[],a=new Map,l=new Set;for(const e of n)if("insert"==e.type&&"$text"!=e.name)fT(e.position,a),e.attributes.has("listItemId")?l.add(e.position.nodeAfter):fT(e.position.getShiftedBy(e.length),a);else if("remove"==e.type&&e.attributes.has("listItemId"))fT(e.position,a);else if("attribute"==e.type){const t=e.range.start.nodeAfter;i.includes(e.attributeKey)?(fT(e.range.start,a),null===e.attributeNewValue?(fT(e.range.start.getShiftedBy(1),a),s(t)&&o.push(t)):l.add(t)):DA(t)&&s(t)&&o.push(t)}for(const e of a.values())o.push(...r(e,l));for(const e of new Set(o))t.reconvertItem(e)};function r(e,t){const n=[],r=new Set,a=[];for(const{node:l,previous:c}of MA(e,"forward")){if(r.has(l))continue;const e=l.getAttribute("listIndent");c&&ei.includes(e))));const h=HA(l,{direction:"forward"});for(const e of h)r.add(e),(s(e,h)||o(e,a,t))&&n.push(e)}return n}function s(e,r){const s=t.mapper.toViewElement(e);if(!s)return!1;if(n.fire("checkElement",{modelElement:e,viewElement:s}))return!0;if(!e.is("element","paragraph")&&!e.is("element","listItem"))return!1;const o=vT(e,i,r);return!(!o||!s.is("element","p"))||!(o||!s.is("element","span"))}function o(e,i,r){if(r.has(e))return!1;const s=t.mapper.toViewElement(e);let o=i.length-1;for(let e=s.parent;!e.is("editableElement");e=e.parent){const t=hT(e),r=cT(e);if(!r&&!t)continue;const s="checkAttributes:"+(t?"item":"list");if(n.fire(s,{viewElement:e,modelAttributes:i[o]}))break;if(r&&(o--,o<0))return!1}return!0}}(t,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",((e,{viewElement:t,modelAttributes:i})=>{t.id!=i.listItemId&&(e.return=!0,e.stop())})),this.on("checkAttributes:list",((e,{viewElement:t,modelAttributes:i})=>{t.name==mT(i.listType)&&t.id==gT(i.listType,i.listIndent)||(e.return=!0,e.stop())}))}_setupModelPostFixing(){const e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer((i=>function(e,t,i,n){const r=e.document.differ.getChanges(),s=new Map,o=n.editor.config.get("list.multiBlock");let a=!1;for(const n of r){if("insert"==n.type&&"$text"!=n.name){const r=n.position.nodeAfter;if(!e.schema.checkAttribute(r,"listItemId"))for(const e of Array.from(r.getAttributeKeys()))i.includes(e)&&(t.removeAttribute(e,r),a=!0);fT(n.position,s),n.attributes.has("listItemId")||fT(n.position.getShiftedBy(n.length),s);for(const{item:t,previousPosition:i}of e.createRangeIn(r))DA(t)&&fT(i,s)}else"remove"==n.type?fT(n.position,s):"attribute"==n.type&&i.includes(n.attributeKey)&&(fT(n.range.start,s),null===n.attributeNewValue&&fT(n.range.start.getShiftedBy(1),s));if(!o&&"attribute"==n.type&&yT.includes(n.attributeKey)){const e=n.range.start.nodeAfter;null===n.attributeNewValue&&e&&e.is("element","listItem")?(t.rename(e,"paragraph"),a=!0):null===n.attributeOldValue&&e&&e.is("element")&&"listItem"!=e.name&&(t.rename(e,"listItem"),a=!0)}}const l=new Set;for(const e of s.values())a=n.fire("postFixer",{listNodes:new NA(e),listHead:e,writer:t,seenIds:l})||a;return a}(e,i,t,this))),this.on("postFixer",((e,{listNodes:t,writer:i})=>{e.return=function(e,t){let i=0,n=-1,r=null,s=!1;for(const{node:o}of e){const e=o.getAttribute("listIndent");if(e>i){let a;null===r?(r=e-i,a=i):(r>e&&(r=e),a=e-r),a>n+1&&(a=n+1),t.setAttribute("listIndent",a,o),s=!0,n=a}else r=null,i=e+1,n=e}return s}(t,i)||e.return}),{priority:"high"}),this.on("postFixer",((e,{listNodes:t,writer:i,seenIds:n})=>{e.return=function(e,t,i){const n=new Set;let r=!1;for(const{node:s}of e){if(n.has(s))continue;let e=s.getAttribute("listType"),o=s.getAttribute("listItemId");if(t.has(o)&&(o=LA.next()),t.add(o),s.is("element","listItem"))s.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,s),r=!0);else for(const t of HA(s,{direction:"forward"}))n.add(t),t.getAttribute("listType")!=e&&(o=LA.next(),e=t.getAttribute("listType")),t.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,t),r=!0)}return r}(t,n,i)||e.return}),{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",function(e){return(t,[i,n])=>{const r=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!r.length)return;const s=(n?e.createSelection(n):e.document.selection).getFirstPosition();let o;if(DA(s.parent))o=s.parent;else{if(!DA(s.nodeBefore)||!DA(s.nodeAfter))return;o=s.nodeBefore}e.change((e=>{const t=o.getAttribute("listType"),i=o.getAttribute("listIndent"),n=r[0].getAttribute("listIndent")||0,s=Math.max(i-n,0);for(const i of r){const n=DA(i);o.is("element","listItem")&&i.is("element","paragraph")&&e.rename(i,"listItem"),e.setAttributes({listIndent:(n?i.getAttribute("listIndent"):0)+s,listItemId:n?i.getAttribute("listItemId"):LA.next(),listType:t},i)}}))}}(e),{priority:"high"}),this.listenTo(t,"outputTransformation",((t,i)=>{e.change((e=>{const t=Array.from(i.content.getChildren()),n=t[t.length-1];if(t.length>1&&n.is("element")&&n.isEmpty){t.slice(0,-1).every(DA)&&e.remove(n)}if("copy"==i.method||"cut"==i.method){const t=Array.from(i.content.getChildren());QA(t)&&JA(t,e)}}))}))}_setupAccessibilityIntegration(){const e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function CT(e,t){const i=e.document.selection;if(!i.isCollapsed)return!XA(e);if("forward"===t)return!0;const n=i.getFirstPosition().parent,r=n.previousSibling;return!e.schema.isObject(r)&&(!!r.isEmpty||QA([n,r]))}function xT(e,t,i,n){e.ui.componentFactory.add(t,(()=>{const r=AT(hg,e,t,i,n);return r.set({tooltip:!0,isToggleable:!0}),r})),e.ui.componentFactory.add(`menuBar:${t}`,(()=>{const r=AT(Vg,e,t,i,n);return r.set({role:"menuitemcheckbox",isToggleable:!0}),r}))}function AT(e,t,i,n,r){const s=t.commands.get(i),o=new e(t.locale);return o.set({label:n,icon:r}),o.bind("isOn","isEnabled").to(s,"value","isEnabled"),o.on("execute",(()=>{t.execute(i),t.editing.view.focus()})),o}class TT extends ku{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||xT(this.editor,"numberedList",e("Numbered List"),ju.numberedList),this.editor.ui.componentFactory.has("bulletedList")||xT(this.editor,"bulletedList",e("Bulleted List"),ju.bulletedList)}}class ET extends ku{static get requires(){return[kT,TT]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}const ST={},PT={},IT={},VT=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:e,typeAttribute:t,listType:i}of VT)ST[e]=i,PT[e]=t,t&&(IT[t]=e);function RT(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let BT={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const OT=/[&<>"']/,FT=/[&<>"']/g,MT=/[<>"']|&(?!#?\w+;)/,NT=/[<>"']|&(?!#?\w+;)/g,LT={"&":"&","<":"<",">":">",'"':""","'":"'"},DT=e=>LT[e];function zT(e,t){if(t){if(OT.test(e))return e.replace(FT,DT)}else if(MT.test(e))return e.replace(NT,DT);return e}const HT=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function WT(e){return e.replace(HT,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const $T=/(^|[^\[])\^/g;function UT(e,t){e=e.source||e,t=t||"";const i={replace:(t,n)=>(n=(n=n.source||n).replace($T,"$1"),e=e.replace(t,n),i),getRegex:()=>new RegExp(e,t)};return i}const jT=/[^\w:]/g,qT=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function GT(e,t,i){if(e){let e;try{e=decodeURIComponent(WT(i)).replace(jT,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!qT.test(i)&&(i=function(e,t){KT[" "+e]||(ZT.test(e)?KT[" "+e]=e+"/":KT[" "+e]=tE(e,"/",!0));e=KT[" "+e];const i=-1===e.indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(JT,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(QT,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}const KT={},ZT=/^[^:]+:\/*[^/]*$/,JT=/^([^:]+:)[\s\S]*$/,QT=/^([^:]+:\/*[^/]*)[\s\S]*$/;const YT={exec:function(){}};function XT(e){let t,i,n=1;for(;n{let n=!1,r=t;for(;--r>=0&&"\\"===i[r];)n=!n;return n?"|":" |"})).split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function rE(e,t,i,n){const r=t.href,s=t.title?zT(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:i,href:r,title:s,text:o,tokens:n.inlineTokens(o,[])};return n.state.inLink=!1,e}return{type:"image",raw:i,href:r,title:s,text:zT(o)}}class sE{constructor(e){this.options=e||BT}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:tE(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],i=function(e,t){const i=e.match(/^(\s+)(?:```)/);if(null===i)return t;const n=i[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[i]=t;return i.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=tE(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const i={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,n,r,s,o,a,l,c,h,d,u,m,g=t[1].trim();const f=g.length>1,p={type:"list",raw:"",ordered:f,start:f?+g.slice(0,-1):"",loose:!1,items:[]};g=f?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=f?g:"[*+-]");const w=new RegExp(`^( {0,3}${g})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(m=!1,t=w.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),c=t[2].split("\n",1)[0],h=e.split("\n",1)[0],this.options.pedantic?(s=2,u=c.trimLeft()):(s=t[2].search(/[^ ]/),s=s>4?1:s,u=c.slice(s),s+=t[1].length),a=!1,!c&&/^ *$/.test(h)&&(i+=h+"\n",e=e.substring(h.length+1),m=!0),!m){const t=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(d=e.split("\n",1)[0],c=d,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(c));){if(c.search(/[^ ]/)>=s||!c.trim())u+="\n"+c.slice(s);else{if(a)break;u+="\n"+c}a||c.trim()||(a=!0),i+=d+"\n",e=e.substring(d.length+1)}}p.loose||(l?p.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(u),n&&(r="[ ] "!==n[0],u=u.replace(/^\[[ xX]\] +/,""))),p.items.push({type:"list_item",raw:i,task:!!n,checked:r,loose:!1,text:u}),p.raw+=i}p.items[p.items.length-1].raw=i.trimRight(),p.items[p.items.length-1].text=u.trimRight(),p.raw=p.raw.trimRight();const b=p.items.length;for(o=0;o"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let i=0;for(const e of t)if("\n"===e&&(i+=1),i>1)return!0;return!1}));!p.loose&&e.length&&t&&(p.loose=!0,p.items[o].loose=!0)}return p}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):zT(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:eE(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let i,n,r,s,o=e.align.length;for(i=0;i({text:e})));for(o=e.header.length,n=0;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):zT(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=tE(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const i=e.length;let n=0,r=0;for(;r-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e&&(i=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^$/.test(e)?i.slice(1):i.slice(1,-1)),rE(t,{href:i?i.replace(this.rules.inline._escapes,"$1"):i,title:n?n.replace(this.rules.inline._escapes,"$1"):n},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let e=(i[2]||i[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return rE(i,e,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n)return;if(n[3]&&i.match(/[\p{L}\p{N}]/u))return;const r=n[1]||n[2]||"";if(!r||r&&(""===i||this.rules.inline.punctuation.exec(i))){const i=n[0].length-1;let r,s,o=i,a=0;const l="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!=(n=l.exec(t));){if(r=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!r)continue;if(s=r.length,n[3]||n[4]){o+=s;continue}if((n[5]||n[6])&&i%3&&!((i+s)%3)){a+=s;continue}if(o-=s,o>0)continue;if(s=Math.min(s,s+o+a),Math.min(i,s)%2){const t=e.slice(1,i+n.index+s);return{type:"em",raw:e.slice(0,i+n.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,i+n.index+s-1);return{type:"strong",raw:e.slice(0,i+n.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const i=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return i&&n&&(e=e.substring(1,e.length-1)),e=zT(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let e,n;return"@"===i[2]?(e=zT(this.options.mangle?t(i[1]):i[1]),n="mailto:"+e):(e=zT(i[1]),n=e),{type:"link",raw:i[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let e,n;if("@"===i[2])e=zT(this.options.mangle?t(i[0]):i[0]),n="mailto:"+e;else{let t;do{t=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(t!==i[0]);e=zT(i[0]),n="www."===i[1]?"http://"+e:e}return{type:"link",raw:i[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):zT(i[0]):i[0]:zT(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:e}}}}const oE={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:YT,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};oE.def=UT(oE.def).replace("label",oE._label).replace("title",oE._title).getRegex(),oE.bullet=/(?:[*+-]|\d{1,9}[.)])/,oE.listItemStart=UT(/^( *)(bull) */).replace("bull",oE.bullet).getRegex(),oE.list=UT(oE.list).replace(/bull/g,oE.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+oE.def.source+")").getRegex(),oE._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",oE._comment=/|$)/,oE.html=UT(oE.html,"i").replace("comment",oE._comment).replace("tag",oE._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oE.paragraph=UT(oE._paragraph).replace("hr",oE.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oE._tag).getRegex(),oE.blockquote=UT(oE.blockquote).replace("paragraph",oE.paragraph).getRegex(),oE.normal=XT({},oE),oE.gfm=XT({},oE.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),oE.gfm.table=UT(oE.gfm.table).replace("hr",oE.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oE._tag).getRegex(),oE.gfm.paragraph=UT(oE._paragraph).replace("hr",oE.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",oE.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",oE._tag).getRegex(),oE.pedantic=XT({},oE.normal,{html:UT("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",oE._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:YT,paragraph:UT(oE.normal._paragraph).replace("hr",oE.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",oE.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const aE={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:YT,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:YT,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}aE._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",aE.punctuation=UT(aE.punctuation).replace(/punctuation/g,aE._punctuation).getRegex(),aE.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,aE.escapedEmSt=/\\\*|\\_/g,aE._comment=UT(oE._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),aE.emStrong.lDelim=UT(aE.emStrong.lDelim).replace(/punct/g,aE._punctuation).getRegex(),aE.emStrong.rDelimAst=UT(aE.emStrong.rDelimAst,"g").replace(/punct/g,aE._punctuation).getRegex(),aE.emStrong.rDelimUnd=UT(aE.emStrong.rDelimUnd,"g").replace(/punct/g,aE._punctuation).getRegex(),aE._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,aE._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,aE._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,aE.autolink=UT(aE.autolink).replace("scheme",aE._scheme).replace("email",aE._email).getRegex(),aE._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,aE.tag=UT(aE.tag).replace("comment",aE._comment).replace("attribute",aE._attribute).getRegex(),aE._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,aE._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,aE._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,aE.link=UT(aE.link).replace("label",aE._label).replace("href",aE._href).replace("title",aE._title).getRegex(),aE.reflink=UT(aE.reflink).replace("label",aE._label).replace("ref",oE._label).getRegex(),aE.nolink=UT(aE.nolink).replace("ref",oE._label).getRegex(),aE.reflinkSearch=UT(aE.reflinkSearch,"g").replace("reflink",aE.reflink).replace("nolink",aE.nolink).getRegex(),aE.normal=XT({},aE),aE.pedantic=XT({},aE.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:UT(/^!?\[(label)\]\((.*?)\)/).replace("label",aE._label).getRegex(),reflink:UT(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",aE._label).getRegex()}),aE.gfm=XT({},aE.normal,{escape:UT(aE.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startBlock.forEach((function(e){n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(r)))n=t[t.length-1],s&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),s=r.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,n,r,s,o,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+nE("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,s.index)+"["+nE("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,s.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,l,a))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,cE))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,cE))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startInline.forEach((function(e){n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(i=this.tokenizer.inlineText(r,lE))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(a=i.raw.slice(-1)),o=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(i.raw.length),t.push(i);return t}}class dE{constructor(e){this.options=e||BT}code(e,t,i){const n=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,n);null!=t&&t!==e&&(i=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",n?'
'+(i?e:zT(e,!0))+"
\n":"
"+(i?e:zT(e,!0))+"
\n"}blockquote(e){return"
\n"+e+"
\n"}html(e){return e}heading(e,t,i,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,i){const n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,i){if(null===(e=GT(this.options.sanitize,this.options.baseUrl,e)))return i;let n='",n}image(e,t,i){if(null===(e=GT(this.options.sanitize,this.options.baseUrl,e)))return i;let n=''+i+'":">",n}text(e){return e}}class uE{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}class mE{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{n++,i=e+"-"+n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i}slug(e,t={}){const i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}}class gE{constructor(e){this.options=e||BT,this.options.renderer=this.options.renderer||new dE,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new uE,this.slugger=new mE}static parse(e,t){return new gE(t).parse(e)}static parseInline(e,t){return new gE(t).parseInline(e)}parse(e,t=!0){let i,n,r,s,o,a,l,c,h,d,u,m,g,f,p,w,b,_,v,y="";const k=e.length;for(i=0;i0&&"paragraph"===p.tokens[0].type?(p.tokens[0].text=_+" "+p.tokens[0].text,p.tokens[0].tokens&&p.tokens[0].tokens.length>0&&"text"===p.tokens[0].tokens[0].type&&(p.tokens[0].tokens[0].text=_+" "+p.tokens[0].tokens[0].text)):p.tokens.unshift({type:"text",text:_}):f+=_),f+=this.parse(p.tokens,g),h+=this.renderer.listitem(f,b,w);y+=this.renderer.list(h,u,m);continue;case"html":y+=this.renderer.html(d.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(h=d.tokens?this.parseInline(d.tokens):d.text;i+1{n(e.text,e.lang,(function(t,i){if(t)return s(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),o--,0===o&&s()}))}),0))})),void(0===o&&s())}try{const i=hE.lex(e,t);return t.walkTokens&&fE.walkTokens(i,t.walkTokens),gE.parse(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+zT(e.message+"",!0)+"
    ";throw e}}fE.options=fE.setOptions=function(e){var t;return XT(fE.defaults,e),t=fE.defaults,BT=t,fE},fE.getDefaults=RT,fE.defaults=BT,fE.use=function(...e){const t=XT({},...e),i=fE.defaults.extensions||{renderers:{},childTokens:{}};let n;e.forEach((e=>{if(e.extensions&&(n=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=i.renderers?i.renderers[e.name]:null;i.renderers[e.name]=t?function(...i){let n=e.renderer.apply(this,i);return!1===n&&(n=t.apply(this,i)),n}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");i[e.level]?i[e.level].unshift(e.tokenizer):i[e.level]=[e.tokenizer],e.start&&("block"===e.level?i.startBlock?i.startBlock.push(e.start):i.startBlock=[e.start]:"inline"===e.level&&(i.startInline?i.startInline.push(e.start):i.startInline=[e.start]))}e.childTokens&&(i.childTokens[e.name]=e.childTokens)}))),e.renderer){const i=fE.defaults.renderer||new dE;for(const t in e.renderer){const n=i[t];i[t]=(...r)=>{let s=e.renderer[t].apply(i,r);return!1===s&&(s=n.apply(i,r)),s}}t.renderer=i}if(e.tokenizer){const i=fE.defaults.tokenizer||new sE;for(const t in e.tokenizer){const n=i[t];i[t]=(...r)=>{let s=e.tokenizer[t].apply(i,r);return!1===s&&(s=n.apply(i,r)),s}}t.tokenizer=i}if(e.walkTokens){const i=fE.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),i&&i.call(this,t)}}n&&(t.extensions=i),fE.setOptions(t)}))},fE.walkTokens=function(e,t){for(const i of e)switch(t.call(fE,i),i.type){case"table":for(const e of i.header)fE.walkTokens(e.tokens,t);for(const e of i.rows)for(const i of e)fE.walkTokens(i.tokens,t);break;case"list":fE.walkTokens(i.items,t);break;default:fE.defaults.extensions&&fE.defaults.extensions.childTokens&&fE.defaults.extensions.childTokens[i.type]?fE.defaults.extensions.childTokens[i.type].forEach((function(e){fE.walkTokens(i[e],t)})):i.tokens&&fE.walkTokens(i.tokens,t)}},fE.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");iE(t=XT({},fE.defaults,t||{}));try{const i=hE.lexInline(e,t);return t.walkTokens&&fE.walkTokens(i,t.walkTokens),gE.parseInline(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+zT(e.message+"",!0)+"
    ";throw e}},fE.Parser=gE,fE.parser=gE.parse,fE.Renderer=dE,fE.TextRenderer=uE,fE.Lexer=hE,fE.lexer=hE.lex,fE.Tokenizer=sE,fE.Slugger=mE,fE.parse=fE;fE.options,fE.setOptions,fE.use,fE.walkTokens,fE.parseInline,gE.parse,hE.lex;function pE(e,t){return Array(t+1).join(e)}var wE=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function bE(e){return kE(e,wE)}var _E=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function vE(e){return kE(e,_E)}var yE=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function kE(e,t){return t.indexOf(e.nodeName)>=0}function CE(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var xE={};function AE(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function TE(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function EE(e,t,i){for(var n=0;n-1)return!0}else{if("function"!=typeof n)throw new TypeError("`filter` needs to be a string, array, or function");if(n.call(e,t,i))return!0}}function PE(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function IE(e,t,i){return e&&e.parentNode===t||i(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}xE.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},xE.lineBreak={filter:"br",replacement:function(e,t,i){return i.br+"\n"}},xE.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,i){var n=Number(t.nodeName.charAt(1));return"setext"===i.headingStyle&&n<3?"\n\n"+e+"\n"+pE(1===n?"=":"-",e.length)+"\n\n":"\n\n"+pE("#",n)+" "+e+"\n\n"}},xE.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},xE.list={filter:["ul","ol"],replacement:function(e,t){var i=t.parentNode;return"LI"===i.nodeName&&i.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},xE.listItem={filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var n=i.bulletListMarker+" ",r=t.parentNode;if("OL"===r.nodeName){var s=r.getAttribute("start"),o=Array.prototype.indexOf.call(r.children,t);n=(s?Number(s)+o:o+1)+". "}return n+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},xE.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},xE.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){for(var n,r=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],s=t.firstChild.textContent,o=i.fence.charAt(0),a=3,l=new RegExp("^"+o+"{3,}","gm");n=l.exec(s);)n[0].length>=a&&(a=n[0].length+1);var c=pE(o,a);return"\n\n"+c+r+"\n"+s.replace(/\n$/,"")+"\n"+c+"\n\n"}},xE.horizontalRule={filter:"hr",replacement:function(e,t,i){return"\n\n"+i.hr+"\n\n"}},xE.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var i=t.getAttribute("href");i&&(i=i.replace(/([()])/g,"\\$1"));var n=AE(t.getAttribute("title"));return n&&(n=' "'+n.replace(/"/g,'\\"')+'"'),"["+e+"]("+i+n+")"}},xE.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,i){var n,r,s=t.getAttribute("href"),o=AE(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),i.linkReferenceStyle){case"collapsed":n="["+e+"][]",r="["+e+"]: "+s+o;break;case"shortcut":n="["+e+"]",r="["+e+"]: "+s+o;break;default:var a=this.references.length+1;n="["+e+"]["+a+"]",r="["+a+"]: "+s+o}return this.references.push(r),n},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},xE.emphasis={filter:["em","i"],replacement:function(e,t,i){return e.trim()?i.emDelimiter+e+i.emDelimiter:""}},xE.strong={filter:["strong","b"],replacement:function(e,t,i){return e.trim()?i.strongDelimiter+e+i.strongDelimiter:""}},xE.code={filter:function(e){var t=e.previousSibling||e.nextSibling,i="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!i},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",i="`",n=e.match(/`+/gm)||[];-1!==n.indexOf(i);)i+="`";return i+t+e+t+i}},xE.image={filter:"img",replacement:function(e,t){var i=AE(t.getAttribute("alt")),n=t.getAttribute("src")||"",r=AE(t.getAttribute("title"));return n?"!["+i+"]("+n+(r?' "'+r+'"':"")+")":""}},TE.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=EE(this.array,e,this.options))||(t=EE(this._keep,e,this.options))||(t=EE(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t'+e+"","text/html").getElementById("turndown-root"):i=e.cloneNode(!0);return function(e){var t=e.element,i=e.isBlock,n=e.isVoid,r=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!r(t)){for(var s=null,o=!1,a=null,l=IE(a,t,r);l!==t;){if(3===l.nodeType||4===l.nodeType){var c=l.data.replace(/[ \r\n\t]+/g," ");if(s&&!/ $/.test(s.data)||o||" "!==c[0]||(c=c.substr(1)),!c){l=PE(l);continue}l.data=c,s=l}else{if(1!==l.nodeType){l=PE(l);continue}i(l)||"BR"===l.nodeName?(s&&(s.data=s.data.replace(/ $/,"")),s=null,o=!1):n(l)||r(l)?(s=null,o=!0):s&&(o=!1)}var h=IE(a,l,r);a=l,l=h}s&&(s.data=s.data.replace(/ $/,""),s.data||PE(s))}}({element:i,isBlock:bE,isVoid:vE,isPre:t.preformattedCode?FE:null}),i}function FE(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function ME(e,t){return e.isBlock=bE(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!vE(e)&&!function(e){return kE(e,yE)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return CE(e,_E)}(e)&&!function(e){return CE(e,yE)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var i=(n=e.textContent,r=n.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/),{leading:r[1],leadingAscii:r[2],leadingNonAscii:r[3],trailing:r[4],trailingNonAscii:r[5],trailingAscii:r[6]});var n,r;i.leadingAscii&&NE("left",e,t)&&(i.leading=i.leadingNonAscii);i.trailingAscii&&NE("right",e,t)&&(i.trailing=i.trailingNonAscii);return{leading:i.leading,trailing:i.trailing}}(e,t),e}function NE(e,t,i){var n,r,s;return"left"===e?(n=t.previousSibling,r=/ $/):(n=t.nextSibling,r=/^ /),n&&(3===n.nodeType?s=r.test(n.nodeValue):i.preformattedCode&&"CODE"===n.nodeName?s=!1:1!==n.nodeType||bE(n)||(s=r.test(n.textContent))),s}var LE=Array.prototype.reduce,DE=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function zE(e){if(!(this instanceof zE))return new zE(e);var t={rules:xE,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),n=t.replace(/^\n*/,""),r=Math.max(e.length-i.length,t.length-n.length);return i+"\n\n".substring(0,r)+n}zE.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=HE.call(this,new OE(e,this.options));return WE.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t{if(!r.consumable.consume(n.item,i.name))return;const s=n.attributeNewValue,o=r.writer,a=r.mapper.toViewElement(n.item),l=[...a.getChildren()].find((e=>e.getCustomProperty("media-content")));o.remove(l);const c=e.getMediaViewElement(o,s,t);o.insert(o.createPositionAt(a,0),c)};return e=>{e.on("attribute:url:media",i)}}function QE(e,t,i,n){return e.createContainerElement("figure",{class:"media"},[t.getMediaViewElement(e,i,n),e.createSlot()])}function YE(e){const t=e.getSelectedElement();return t&&t.is("element","media")?t:null}function XE(e,t,i,n){e.change((r=>{const s=r.createElement("media",{url:t});e.insertObject(s,i,null,{setSelection:"on",findOptimalPosition:n?"auto":void 0})}))}class eS extends xu{refresh(){const e=this.editor.model,t=e.document.selection,i=YE(t);this.value=i?i.getAttribute("url"):void 0,this.isEnabled=function(e){const t=e.getSelectedElement();return!!t&&"media"===t.name}(t)||function(e,t){const i=Jb(e,t);let n=i.start.parent;n.isEmpty&&!t.schema.isLimit(n)&&(n=n.parent);return t.schema.checkChild(n,"media")}(t,e)}execute(e){const t=this.editor.model,i=t.document.selection,n=YE(i);n?t.change((t=>{t.setAttribute("url",e,n)})):XE(t,e,i,!0)}}class tS{locale;providerDefinitions;constructor(e,t){const i=t.providers,n=t.extraProviders||[],r=new Set(t.removeProviders),s=i.concat(n).filter((e=>{const t=e.name;return t?!r.has(t):(fn("media-embed-no-provider-name",{provider:e}),!1)}));this.locale=e,this.providerDefinitions=s}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e)return new iS(this.locale);e=e.trim();for(const t of this.providerDefinitions){const i=t.html,n=Qr(t.url);for(const t of n){const n=this._getUrlMatches(e,t);if(n)return new iS(this.locale,e,n,i)}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i)return i;let n=e.replace(/^https?:\/\//,"");return i=n.match(t),i||(n=n.replace(/^www\./,""),i=n.match(t),i||null)}}class iS{url;_locale;_match;_previewRenderer;constructor(e,t,i,n){this.url=this._getValidUrl(t),this._locale=e,this._match=i,this._previewRenderer=n}getViewElement(e,t){const i={};let n;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),t.renderForEditingView&&(i.class="ck-media__wrapper");const r=this._getPreviewHtml(t);n=e.createRawElement("div",i,((e,t)=>{t.setContentOf(e,r)}))}else this.url&&(i.url=this.url),n=e.createEmptyElement(t.elementName,i);return e.setCustomProperty("media-content",!0,n),n}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new lg,t=this._locale.t;e.content='',e.viewBox="0 0 64 42";return new Mm({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}class nS extends ku{static get pluginName(){return"MediaEmbedEditing"}static get isOfficialPlugin(){return!0}registry;constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:e=>`
    `},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`
    `},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:e=>{const t=e[1],i=e[2];return`
    `}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`
    `},{name:"instagram",url:[/^instagram\.com\/p\/(\w+)/,/^instagram\.com\/reel\/(\w+)/]},{name:"twitter",url:[/^twitter\.com/,/^x\.com/]},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new tS(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,i=e.t,n=e.conversion,r=e.config.get("mediaEmbed.previewsInData"),s=e.config.get("mediaEmbed.elementName"),o=this.registry;e.commands.add("mediaEmbed",new eS(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),n.for("dataDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const i=e.getAttribute("url");return QE(t,o,i,{elementName:s,renderMediaPreview:!!i&&r})}}),n.for("dataDowncast").add(JE(o,{elementName:s,renderMediaPreview:r})),n.for("editingDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const n=e.getAttribute("url");return function(e,t,i){return t.setCustomProperty("media",!0,e),jb(e,t,{label:i})}(QE(t,o,n,{elementName:s,renderForEditingView:!0}),t,i("media widget"))}}),n.for("editingDowncast").add(JE(o,{elementName:s,renderForEditingView:!0})),n.for("upcast").elementToElement({view:e=>["oembed",s].includes(e.name)&&e.getAttribute("url")?{name:!0}:null,model:(e,{writer:t})=>{const i=e.getAttribute("url");return o.hasMedia(i)?t.createElement("media",{url:i}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(e,{writer:t})=>{const i=e.getAttribute("data-oembed-url");return o.hasMedia(i)?t.createElement("media",{url:i}):null}}).add((e=>{e.on("element:figure",((e,t,i)=>{if(!i.consumable.consume(t.viewItem,{name:!0,classes:"media"}))return;const{modelRange:n,modelCursor:r}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=n,t.modelCursor=r;ts(n.getItems())||i.consumable.revert(t.viewItem,{name:!0,classes:"media"})}))}))}}const rS=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class sS extends ku{static get requires(){return[tv,_w,Nv]}static get pluginName(){return"AutoMediaEmbed"}static get isOfficialPlugin(){return!0}_timeoutId;_positionToInsert;constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document,i=e.plugins.get("ClipboardPipeline");this.listenTo(i,"inputTransformation",(()=>{const e=t.selection.getFirstRange(),i=Mh.fromPosition(e.start);i.stickiness="toPrevious";const n=Mh.fromPosition(e.end);n.stickiness="toNext",t.once("change:data",(()=>{this._embedMediaBetweenPositions(i,n),i.detach(),n.detach()}),{priority:"high"})}));e.commands.get("undo").on("execute",(()=>{this._timeoutId&&(ji.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)}),{priority:"high"})}_embedMediaBetweenPositions(e,t){const i=this.editor,n=i.plugins.get(nS).registry,r=new Kl(e,t),s=r.getWalker({ignoreElementEnd:!0});let o="";for(const e of s)e.item.is("$textProxy")&&(o+=e.item.data);if(o=o.trim(),!o.match(rS))return void r.detach();if(!n.hasMedia(o))return void r.detach();i.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Mh.fromPosition(e),this._timeoutId=ji.window.setTimeout((()=>{i.model.change((e=>{this._timeoutId=null,e.remove(r),r.detach();let t=null;"$graveyard"!==this._positionToInsert.root.rootName&&(t=this._positionToInsert),XE(i.model,o,t,!1),this._positionToInsert.detach(),this._positionToInsert=null})),i.plugins.get(_w).requestUndoOnBackspace()}),100)):r.detach()}}class oS extends ng{focusTracker;keystrokes;urlInputView;_validators;_urlInputViewInfoDefault;_urlInputViewInfoTip;constructor(e,t){super(t),this.focusTracker=new is,this.keystrokes=new os,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView]})}render(){super.render(),og({view:this}),this.focusTracker.add(this.urlInputView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.urlInputView.focus()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new Yg(this.locale,Rf),i=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,i.inputMode="url",i.on("input",(()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()})),t}}class aS extends ku{static get requires(){return[nS,Sg]}static get pluginName(){return"MediaEmbedUI"}static get isOfficialPlugin(){return!0}_formView;init(){const e=this.editor;e.ui.componentFactory.add("mediaEmbed",(()=>{const e=this.editor.locale.t,t=this._createDialogButton(hg);return t.tooltip=!0,t.label=e("Insert media"),t})),e.ui.componentFactory.add("menuBar:mediaEmbed",(()=>{const e=this.editor.locale.t,t=this._createDialogButton(Vg);return t.label=e("Media"),t}))}_createDialogButton(e){const t=this.editor,i=new e(t.locale),n=t.commands.get("mediaEmbed"),r=this.editor.plugins.get("Dialog");return i.icon='',i.bind("isEnabled").to(n,"isEnabled"),i.on("execute",(()=>{"mediaEmbed"===r.id?r.hide():this._showDialog()})),i}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.commands.get("mediaEmbed"),n=e.locale.t;if(!this._formView){const t=e.plugins.get(nS).registry;this._formView=new(sg(oS))(function(e,t){return[t=>{if(!t.url.length)return e("The URL must not be empty.")},i=>{if(!t.hasMedia(i.url))return e("This media URL is not supported.")}]}(e.t,t),e.locale),this._formView.on("submit",(()=>this._handleSubmitForm()))}t.show({id:"mediaEmbed",title:n("Insert media"),content:this._formView,isModal:!0,onShow:()=>{this._formView.url=i.value||"",this._formView.resetFormStatus(),this._formView.urlInputView.fieldView.select()},actionButtons:[{label:n("Cancel"),withText:!0,onExecute:()=>t.hide()},{label:n("Accept"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSubmitForm()}]})}_handleSubmitForm(){const e=this.editor,t=e.plugins.get("Dialog");this._formView.isValid()&&(e.execute("mediaEmbed",this._formView.url),t.hide(),e.editing.view.focus())}}Wr.arrowup,Wr.arrowdown,Wr.esc,Wr.enter,Wr.tab;function lS(e){return void 0!==e&&e.endsWith("px")}function cS(e){return e.toFixed(2).replace(/\.?0+$/,"")+"px"}function hS(e,t,i){if(!e.childCount)return;const n=new xd(e.document),r=function(e,t){const i=t.createRangeIn(e),n=[],r=new Set;for(const e of i.getItems()){if(!e.is("element")||!e.name.match(/^(p|h\d+|li|div)$/))continue;let t=bS(e);if(void 0===t||0!=parseFloat(t)||Array.from(e.getClassNames()).find((e=>e.startsWith("MsoList")))||(t=void 0),e.hasStyle("mso-list")||void 0!==t&&r.has(t)){const i=pS(e);n.push({element:e,id:i.id,order:i.order,indent:i.indent,marginLeft:t}),void 0!==t&&r.add(t)}else r.clear()}return n}(e,n);if(!r.length)return;const s={},o=[];for(const e of r)if(void 0!==e.indent){dS(e)||(o.length=0);const r=`${e.id}:${e.indent}`,a=Math.min(e.indent-1,o.length);if(ao.length-1||o[a].listElement.name!=l.type){0==a&&"ol"==l.type&&void 0!==e.id&&s[r]&&(l.startIndex=s[r]);const t=fS(l,n,i);if(lS(e.marginLeft)&&(0==a||lS(o[a-1].marginLeft))){let i=e.marginLeft;a>0&&(i=cS(parseFloat(i)-parseFloat(o[a-1].marginLeft))),n.setStyle("padding-left",i,t)}if(0==o.length){const i=e.element.parent,r=i.getChildIndex(e.element)+1;n.insertChild(r,t,i)}else{const e=o[a-1].listItemElements;n.appendChild(t,e[e.length-1])}o[a]={...e,listElement:t,listItemElements:[]},0==a&&void 0!==e.id&&(s[r]=l.startIndex||1)}}const l="li"==e.element.name?e.element:n.createElement("li");n.appendChild(l,o[a].listElement),o[a].listItemElements.push(l),0==a&&void 0!==e.id&&s[r]++,e.element!=l&&n.appendChild(e.element,l),wS(e.element,n),n.removeStyle("text-indent",e.element),n.removeStyle("margin-left",e.element)}else{const t=o.find((t=>t.marginLeft==e.marginLeft));if(t){const i=t.listItemElements;n.appendChild(e.element,i[i.length-1]),n.removeStyle("margin-left",e.element)}else o.length=0}}function dS(e){const t=e.element.previousSibling;return uS(t||e.element.parent)}function uS(e){return e.is("element","ol")||e.is("element","ul")}function mS(e,t){const i=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),n=/mso-level-number-format:([^;]{0,100});/gi,r=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,s=new RegExp(`@list\\s+l${e.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),o=new RegExp(`@list l${e.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=s.exec(t),l=o.exec(t),c=a&&!l,h=i.exec(t);let d="decimal",u="ol",m=null;if(h&&h[1]){const t=n.exec(h[1]);if(t&&t[1]&&(d=t[1].trim(),u="bullet"!==d&&"image"!==d?"ol":"ul"),"bullet"===d){const t=function(e){if("li"==e.name&&"ul"==e.parent.name&&e.parent.hasAttribute("type"))return e.parent.getAttribute("type");const t=function(e){if(e.getChild(0).is("$text"))return null;for(const t of e.getChildren()){if(!t.is("element","span"))continue;const e=t.getChild(0);if(e)return e.is("$text")?e:e.getChild(0)}return null}(e);if(!t)return null;const i=t._data;if("o"===i)return"circle";if("·"===i)return"disc";if("§"===i)return"square";return null}(e.element);t&&(d=t)}else{const e=r.exec(h[1]);e&&e[1]&&(m=parseInt(e[1]))}c&&(u="ol")}return{type:u,startIndex:m,style:gS(d),isLegalStyleList:c}}function gS(e){if(e.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(e){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return e;default:return null}}function fS(e,t,i){const n=t.createElement(e.type);return e.style&&t.setStyle("list-style-type",e.style,n),e.startIndex&&e.startIndex>1&&t.setAttribute("start",e.startIndex,n),e.isLegalStyleList&&i&&t.addClass("legal-list",n),n}function pS(e){const t=e.getStyle("mso-list");if(void 0===t)return{};const i=t.match(/(^|\s{1,100})l(\d+)/i),n=t.match(/\s{0,100}lfo(\d+)/i),r=t.match(/\s{0,100}level(\d+)/i);return i&&n&&r?{id:i[2],order:n[1],indent:parseInt(r[1])}:{indent:1}}function wS(e,t){const i=new Do({name:"span",styles:{"mso-list":"Ignore"}}),n=t.createRangeIn(e);for(const e of n)"elementStart"===e.type&&i.match(e.item)&&t.remove(e.item)}function bS(e){const t=e.getStyle("margin-left");return void 0===t||t.endsWith("px")?t:function(e){const t=parseFloat(e);return e.endsWith("pt")?cS(96*t/72):e.endsWith("pc")?cS(12*t*96/72):e.endsWith("in")?cS(96*t):e.endsWith("cm")?cS(96*t/2.54):e.endsWith("mm")?cS(t/10*96/2.54):e}(t)}function _S(e,t){if(!e.childCount)return;const i=new xd(e.document),n=function(e,t){const i=t.createRangeIn(e),n=new Do({name:/v:(.+)/}),r=[];for(const e of i){if("elementStart"!=e.type)continue;const t=e.item,i=t.previousSibling,s=i&&i.is("element")?i.name:null,o=["Chart"],a=n.match(t),l=t.getAttribute("o:gfxdata"),c="v:shapetype"===s,h=l&&o.some((e=>t.getAttribute("id").includes(e)));a&&l&&!c&&!h&&r.push(e.item.getAttribute("id"))}return r}(e,i);!function(e,t,i){const n=i.createRangeIn(t),r=new Do({name:"img"}),s=[];for(const t of n)if(t.item.is("element")&&r.match(t.item)){const i=t.item,n=i.getAttribute("v:shapes")?i.getAttribute("v:shapes").split(" "):[];n.length&&n.every((t=>e.indexOf(t)>-1))?s.push(i):i.getAttribute("src")||s.push(i)}for(const e of s)i.remove(e)}(n,e,i),function(e,t,i){const n=i.createRangeIn(t),r=[];for(const t of n)if("elementStart"==t.type&&t.item.is("element","v:shape")){const i=t.item.getAttribute("id");if(e.includes(i))continue;s(t.item.parent.getChildren(),i)||r.push(t.item)}for(const e of r){const t={src:o(e)};e.hasAttribute("alt")&&(t.alt=e.getAttribute("alt"));const n=i.createElement("img",t);i.insertChild(e.index+1,n,e.parent)}function s(e,t){for(const i of e)if(i.is("element")){if("img"==i.name&&i.getAttribute("v:shapes")==t)return!0;if(s(i.getChildren(),t))return!0}return!1}function o(e){for(const t of e.getChildren())if(t.is("element")&&t.getAttribute("src"))return t.getAttribute("src")}}(n,e,i),function(e,t){const i=t.createRangeIn(e),n=new Do({name:/v:(.+)/}),r=[];for(const e of i)"elementStart"==e.type&&n.match(e.item)&&r.push(e.item);for(const e of r)t.remove(e)}(e,i);const r=function(e,t){const i=t.createRangeIn(e),n=new Do({name:"img"}),r=[];for(const e of i)e.item.is("element")&&n.match(e.item)&&e.item.getAttribute("src").startsWith("file://")&&r.push(e.item);return r}(e,i);r.length&&function(e,t,i){if(e.length===t.length)for(let n=0;nString.fromCharCode(parseInt(e,16)))).join(""))}const yS=//i,kS=/xmlns:o="urn:schemas-microsoft-com/i;class CS{document;hasMultiLevelListPlugin;constructor(e,t=!1){this.document=e,this.hasMultiLevelListPlugin=t}isActive(e){return yS.test(e)||kS.test(e)}execute(e){const t=new xd(this.document),{body:i,stylesString:n}=e._parsedData;!function(e,t){const i=[];for(const n of t.createRangeIn(e)){const e=n.item;e.is("element","a")&&!e.hasAttribute("href")&&(e.hasAttribute("id")||e.hasAttribute("name"))&&i.push(e)}for(const e of i){const i=e.parent.getChildIndex(e)+1,n=e.getChildren();t.insertChild(i,n,e.parent)}}(i,t),hS(i,n,this.hasMultiLevelListPlugin),_S(i,e.dataTransfer.getData("text/rtf")),function(e){const t=[],i=new xd(e.document);for(const{item:n}of i.createRangeIn(e))if(n.is("element")){for(const e of n.getClassNames())/\bmso/gi.exec(e)&&i.removeClass(e,n);for(const e of n.getStyleNames())/\bmso/gi.exec(e)&&i.removeStyle(e,n);(n.is("element","w:sdt")||n.is("element","w:sdtpr")&&n.isEmpty||n.is("element","o:p")&&n.isEmpty)&&t.push(n)}for(const e of t){const t=e.parent,n=t.getChildIndex(e);i.insertChild(n,e.getChildren(),t),i.remove(e)}}(i),e.content=i}}function xS(e,t,i,{blockElements:n,inlineObjectElements:r}){let s=i.createPositionAt(e,"forward"==t?"after":"before");return s=s.getLastMatchingPosition((({item:e})=>e.is("element")&&!n.includes(e.name)&&!r.includes(e.name)),{direction:t}),"forward"==t?s.nodeAfter:s.nodeBefore}function AS(e,t){return!!e&&e.is("element")&&t.includes(e.name)}const TS=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class ES{document;constructor(e){this.document=e}isActive(e){return TS.test(e)}execute(e){const t=new xd(this.document),{body:i}=e._parsedData;!function(e,t){for(const i of e.getChildren())if(i.is("element","b")&&"normal"===i.getStyle("font-weight")){const n=e.getChildIndex(i);t.remove(i),t.insertChild(n,i.getChildren(),e)}}(i,t),function(e,t){for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","li")){const i=e.getChild(0);i&&i.is("element","p")&&t.unwrapElement(i)}}}(i,t),function(e,t){const i=new ua(t.document.stylesProcessor),n=new el(i,{renderingMode:"data"}),r=n.blockElements,s=n.inlineObjectElements,o=[];for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","br")){const i=xS(e,"forward",t,{blockElements:r,inlineObjectElements:s}),n=xS(e,"backward",t,{blockElements:r,inlineObjectElements:s}),a=AS(i,r);(AS(n,r)||a)&&o.push(e)}}for(const e of o)e.hasClass("Apple-interchange-newline")?t.remove(e):t.replace(e,t.createElement("p"))}(i,t),e.content=i}}const SS=/(\s+)<\/span>/g,((e,t)=>1===t.length?" ":Array(t.length+1).join("  ").substr(0,t.length)))}function VS(e,t){const i=new DOMParser,n=function(e){return IS(IS(e)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(e){const t="",i="",n=e.indexOf(t);if(n<0)return e;const r=e.indexOf(i,n+t.length);return e.substring(0,n+t.length)+(r>=0?e.substring(r):"")}(e=(e=e.replace(//g,"")}(n.getData("text/html")):n.getData("text/plain")&&(((s=(s=n.getData("text/plain")).replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

    ").replace(/\r?\n/g,"
    ").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).includes("

    ")||s.includes("
    "))&&(s=`

    ${s}

    `),e=s),r=this.editor.data.htmlProcessor.toView(e)}var s;const o=new ln(this,"inputTransformation");this.fire(o,{content:r,dataTransfer:n,targetRanges:t.targetRanges,method:t.method}),o.stop.called&&e.stop(),i.scrollToTheSelection()}),{priority:"low"}),this.listenTo(this,"inputTransformation",((e,i)=>{if(i.content.isEmpty)return;const n=this.editor.data.toModel(i.content,"$clipboardHolder");0!=n.childCount&&(e.stop(),t.change((()=>{this.fire("contentInsertion",{content:n,method:i.method,dataTransfer:i.dataTransfer,targetRanges:i.targetRanges})})))}),{priority:"low"}),this.listenTo(this,"contentInsertion",((e,t)=>{t.resultRange=r._pasteFragmentWithMarkers(t.content)}),{priority:"low"})}_setupCopyCut(){const e=this.editor,t=e.model.document,i=e.editing.view.document,n=(e,i)=>{const n=i.dataTransfer;i.preventDefault(),this._fireOutputTransformationEvent(n,t.selection,e.name)};this.listenTo(i,"copy",n,{priority:"low"}),this.listenTo(i,"cut",((t,i)=>{e.model.canEditAt(e.model.document.selection)?n(t,i):i.preventDefault()}),{priority:"low"}),this.listenTo(this,"outputTransformation",((t,n)=>{const r=e.data.toView(n.content);i.fire("clipboardOutput",{dataTransfer:n.dataTransfer,content:r,method:n.method})}),{priority:"low"}),this.listenTo(i,"clipboardOutput",((i,n)=>{n.content.isEmpty||(n.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(n.content)),n.dataTransfer.setData("text/plain",M_(n.content))),"cut"==n.method&&e.model.deleteContent(t.selection)}),{priority:"low"})}}const z_=br("px");class H_ extends ig{constructor(){super();const e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",(e=>!e))],style:{left:e.to("left",(e=>z_(e))),top:e.to("top",(e=>z_(e))),width:e.to("width",(e=>z_(e)))}}})}}class W_ extends yu{removeDropMarkerDelayed=ls((()=>this.removeDropMarker()),40);_updateDropMarkerThrottled=hu((e=>this._updateDropMarker(e)),40);_reconvertMarkerThrottled=hu((()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")}),0);_dropTargetLineView=new H_;_domEmitter=new(er());_scrollables=new Map;static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(const{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,i,n,r,s){this.removeDropMarkerDelayed.cancel();const o=$_(this.editor,e,t,i,n,r,s);if(o)return s&&s.containsRange(o)?this.removeDropMarker():void this._updateDropMarkerThrottled(o)}getFinalDropRange(e,t,i,n,r,s){const o=$_(this.editor,e,t,i,n,r,s);return this.removeDropMarker(),o}removeDropMarker(){const e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change((e=>{e.removeMarker("drop-target")}))}_setupDropMarker(){const e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:i})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){const t=this.editor,i=t.model.markers;t.model.change((t=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||t.updateMarker("drop-target",{range:e}):t.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})}))}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(e){const t=this.toDomElement(e);return t.append("⁠",e.createElement("span"),"⁠"),t}))}_updateDropTargetLine(e){const t=this.editor.editing,i=e.start.nodeBefore,n=e.start.nodeAfter,r=e.start.parent,s=i?t.mapper.toViewElement(i):null,o=s?t.view.domConverter.mapViewToDom(s):null,a=n?t.mapper.toViewElement(n):null,l=a?t.view.domConverter.mapViewToDom(a):null,c=t.mapper.toViewElement(r);if(!c)return;const h=t.view.domConverter.mapViewToDom(c),d=this._getScrollableRect(c),{scrollX:u,scrollY:m}=ji.window,g=o?new dr(o):null,f=l?new dr(l):null,p=new dr(h).excludeScrollbarsAndBorders(),w=g?g.bottom:p.top,b=f?f.top:p.bottom,_=ji.window.getComputedStyle(h),v=w<=b?(w+b)/2:b;if(d.topa.schema.checkChild(s,e)))){if(a.schema.checkChild(s,"$text"))return a.createRange(s);if(t)return j_(e,G_(e,t.parent),n,r)}}}else if(a.schema.isInline(c))return j_(e,c,n,r);if(a.schema.isBlock(c))return j_(e,c,n,r);if(a.schema.checkChild(c,"$block")){const t=Array.from(c.getChildren()).filter((t=>t.is("element")&&!U_(e,t)));let i=0,s=t.length;if(0==s)return a.createRange(a.createPositionAt(c,"end"));for(;i{i?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")})),Ki.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){const t=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(t,"dragstart",((e,t)=>this._handleBlockDragStart(t))),this._domEmitter.listenTo(ji.document,"dragover",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(ji.document,"drop",((e,t)=>this._handleBlockDragging(t))),this._domEmitter.listenTo(ji.document,"dragend",(()=>this._handleBlockDragEnd()),{useCapture:!0}),this.isEnabled&&t.setAttribute("draggable","true"),this.on("change:isEnabled",((e,i,n)=>{t.setAttribute("draggable",n?"true":"false")}))}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;const t=this.editor.model,i=t.document.selection,n=this.editor.editing.view,r=Array.from(i.getSelectedBlocks()),s=t.createRange(t.createPositionBefore(r[0]),t.createPositionAfter(r[r.length-1]));t.change((e=>e.setSelection(s))),this._isBlockDragging=!0,n.focus(),n.getObserver(B_).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;const t=e.clientX+("ltr"==this.editor.locale.contentLanguageDirection?100:-100),i=e.clientY,n=document.elementFromPoint(t,i),r=this.editor.editing.view;n&&n.closest(".ck-editor__editable")&&r.getObserver(B_).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:n,clientX:t,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}}class Z_ extends yu{_draggedRange;_draggingUid;_draggableElement;_clearDraggableAttributesDelayed=ls((()=>this._clearDraggableAttributes()),40);_blockMode=!1;_domEmitter=new(er());_previewContainer;static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[D_,l_,W_,K_]}init(){const e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(B_),t.addObserver(kd),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",((e,t,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})),this.on("change:isEnabled",((e,t,i)=>{i||this._finalizeDragging(!1)})),Ki.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const e=this.editor,t=e.model,i=e.editing.view,n=i.document,r=e.plugins.get(W_);this.listenTo(n,"dragstart",((e,i)=>{if(i.target&&i.target.is("editableElement"))return void i.preventDefault();if(this._prepareDraggedRange(i.target),!this._draggedRange)return void i.preventDefault();this._draggingUid=hn(),i.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",i.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const n=t.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(i.dataTransfer,n,"dragstart");const{dataTransfer:r,domTarget:s,domEvent:o}=i,{clientX:a}=o;this._updatePreview({dataTransfer:r,domTarget:s,clientX:a}),i.stopPropagation(),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")}),{priority:"low"}),this.listenTo(n,"dragend",((e,t)=>{this._finalizeDragging(!t.dataTransfer.isCanceled&&"move"==t.dataTransfer.dropEffect)}),{priority:"low"}),this._domEmitter.listenTo(ji.document,"dragend",(()=>{this._blockMode=!1}),{useCapture:!0}),this.listenTo(n,"dragenter",(()=>{this.isEnabled&&i.focus()})),this.listenTo(n,"dragleave",(()=>{r.removeDropMarkerDelayed()})),this.listenTo(n,"dragging",((e,t)=>{if(!this.isEnabled)return void(t.dataTransfer.dropEffect="none");const{clientX:i,clientY:n}=t.domEvent;r.updateDropMarker(t.target,t.targetRanges,i,n,this._blockMode,this._draggedRange),this._draggedRange||(t.dataTransfer.dropEffect="copy"),Ki.isGecko||("copy"==t.dataTransfer.effectAllowed?t.dataTransfer.dropEffect="copy":["all","copyMove"].includes(t.dataTransfer.effectAllowed)&&(t.dataTransfer.dropEffect="move")),e.stop()}),{priority:"low"})}_setupClipboardInputIntegration(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get(W_);this.listenTo(t,"clipboardInput",((t,n)=>{if("drop"!=n.method)return;const{clientX:r,clientY:s}=n.domEvent,o=i.getFinalDropRange(n.target,n.targetRanges,r,s,this._blockMode,this._draggedRange);if(!o)return this._finalizeDragging(!1),void t.stop();this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==J_(n.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(o,!0))return this._finalizeDragging(!1),void t.stop();n.targetRanges=[e.editing.mapper.toViewRange(o)]}),{priority:"high"})}_setupContentInsertionIntegration(){const e=this.editor.plugins.get(D_);e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i=t.targetRanges.map((e=>this.editor.editing.mapper.toModelRange(e)));this.editor.model.change((e=>e.setSelection(i)))}),{priority:"high"}),e.on("contentInsertion",((e,t)=>{if(!this.isEnabled||"drop"!==t.method)return;const i="move"==J_(t.dataTransfer),n=!t.resultRange||!t.resultRange.isCollapsed;this._finalizeDragging(n&&i)}),{priority:"lowest"})}_setupDraggableAttributeHandling(){const e=this.editor,t=e.editing.view,i=t.document;this.listenTo(i,"mousedown",((n,r)=>{if(Ki.isAndroid||!r)return;this._clearDraggableAttributesDelayed.cancel();let s=Q_(r.target);if(Ki.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){const e=i.selection.getSelectedElement();e&&$b(e)||(s=i.selection.editableElement)}s&&(t.change((e=>{e.setAttribute("draggable","true",s)})),this._draggableElement=e.editing.mapper.toModelElement(s))})),this.listenTo(i,"mouseup",(()=>{Ki.isAndroid||this._clearDraggableAttributesDelayed()}))}_clearDraggableAttributes(){const e=this.editor.editing;e.view.change((t=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null}))}_finalizeDragging(e){const t=this.editor,i=t.model;if(t.plugins.get(W_).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop")}this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change((e=>{const t=i.createSelection(this._draggedRange);i.deleteContent(t,{doNotAutoparagraph:!0});const n=t.getFirstPosition().parent;n.isEmpty&&!i.schema.checkChild(n,"$text")&&i.schema.checkChild(n,"paragraph")&&e.insertElement("paragraph",n,0)})),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){const t=this.editor,i=t.model,n=i.document.selection,r=e?Q_(e):null;if(r){const e=t.editing.mapper.toModelElement(r);if(this._draggedRange=Ul.fromRange(i.createRangeOn(e)),this._blockMode=i.schema.isBlock(e),t.plugins.has("WidgetToolbarRepository")){t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop")}return}if(n.isCollapsed&&!n.getFirstPosition().parent.isEmpty)return;const s=Array.from(n.getSelectedBlocks()),o=n.getFirstRange();if(0==s.length)return void(this._draggedRange=Ul.fromRange(o));const a=Y_(i,s);if(s.length>1)this._draggedRange=Ul.fromRange(a),this._blockMode=!0;else if(1==s.length){const e=o.start.isTouching(a.start)&&o.end.isTouching(a.end);this._draggedRange=Ul.fromRange(e?a:o),this._blockMode=e}i.change((e=>e.setSelection(this._draggedRange.toRange())))}_updatePreview({dataTransfer:e,domTarget:t,clientX:i}){const n=this.editor.editing.view,r=n.document.selection.editableElement,s=n.domConverter.mapViewToDom(r),o=ji.window.getComputedStyle(s);this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):(this._previewContainer=Gn(ji.document,"div",{style:"position: fixed; left: -999999px;"}),ji.document.body.appendChild(this._previewContainer));const a=new dr(s);if(s.contains(t))return;const l=parseFloat(o.paddingLeft),c=Gn(ji.document,"div");c.className="ck ck-content",c.style.width=o.width,c.style.paddingLeft=`${a.left-i+l}px`,Ki.isiOS&&(c.style.backgroundColor="white"),n.domConverter.setContentOf(c,e.getData("text/html")),e.setDragImage(c,0,0),this._previewContainer.appendChild(c)}}function J_(e){return Ki.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function Q_(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor($b);if($b(e))return e;const t=e.findAncestor((e=>$b(e)||e.is("editableElement")));return $b(t)?t:null}function Y_(e,t){const i=t[0],n=t[t.length-1],r=i.getCommonAncestor(n),s=e.createPositionBefore(i),o=e.createPositionAfter(n);if(r&&r.is("element")&&!e.schema.isLimit(r)){const t=e.createRangeOn(r),i=s.isTouching(t.start),n=o.isTouching(t.end);if(i&&n)return Y_(e,[r])}return e.createRange(s,o)}class X_ extends yu{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[D_]}init(){const e=this.editor,t=e.model,i=e.editing.view,n=t.document.selection;i.addObserver(B_),e.plugins.get(D_).on("contentInsertion",((e,i)=>{(function(e,t){let i=t.createRangeIn(e);if(1==e.childCount){const n=e.getChild(0);n.is("element")&&t.schema.isBlock(n)&&!t.schema.isObject(n)&&!t.schema.isLimit(n)&&(i=t.createRangeIn(n))}for(const e of i.getItems()){if(!t.schema.isInline(e))return!1;if(Array.from(e.getAttributeKeys()).find((e=>t.schema.getAttributeProperties(e).isFormatting)))return!1}return!0})(i.content,t)&&t.change((e=>{const r=Array.from(n.getAttributes()).filter((([e])=>t.schema.getAttributeProperties(e).isFormatting));n.isCollapsed||t.deleteContent(n,{doNotAutoparagraph:!0}),r.push(...n.getAttributes());const s=e.createRangeIn(i.content);for(const i of s.getItems())for(const n of r)t.schema.checkAttribute(i,n[0])&&e.setAttribute(n[0],n[1],i)}))}))}}class ev extends yu{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[L_,D_,Z_,X_]}init(){const e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}}function tv(e){const t=e.t,i=e.config.get("codeBlock.languages");for(const e of i)"Plain text"===e.label&&(e.label=t("Plain text")),void 0===e.class&&(e.class=`language-${e.language}`);return i}function iv(e,t,i){const n={};for(const r of e)if("class"===t){n[r[t].split(" ").shift()]=r[i]}else n[r[t]]=r[i];return n}function nv(e){return e.data.match(/^(\s*)/)[0]}function rv(e){const t=e.document.selection,i=[];if(t.isCollapsed)return[t.anchor];const n=t.getFirstRange().getWalker({ignoreElementEnd:!0,direction:"backward"});for(const{item:t}of n){let n=t.is("$textProxy")?t.textNode:t;const r=n.parent;if(!r.is("element","codeBlock")||n.is("element","softBreak"))continue;for(;n.previousSibling&&!n.previousSibling.is("element","softBreak");)n=n.previousSibling;const s=n.is("$text")?n.startOffset+nv(n).length:n.startOffset,o=e.createPositionAt(r,s);i.every((e=>!e.isEqual(o)))&&i.push(o)}return i}function sv(e){const t=es(e.getSelectedBlocks());return!!t&&t.is("element","codeBlock")}function ov(e,t){return!t.is("rootElement")&&!e.isLimit(t)&&e.checkChild(t.parent,"codeBlock")}function av(e,t,i,n){const r=iv(t,"language","label"),s=i.getAttribute("language");if(s in r){const t=r[s];return e("enter"===n?"Entering %0 code snippet":"Leaving %0 code snippet",t)}return e("enter"===n?"Entering code snippet":"Leaving code snippet")}function lv(e,t){for(e.textNode&&(e=t.createPositionBefore(e.textNode));e.nodeBefore&&!e.nodeBefore.is("element","softBreak");)e=t.createPositionBefore(e.nodeBefore);const i=e.nodeAfter;return i&&i.is("$text")?i:null}class cv extends Cu{_lastLanguage;constructor(e){super(e),this._lastLanguage=null}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor,i=t.model,n=i.document.selection,r=tv(t)[0],s=Array.from(n.getSelectedBlocks()),o=null==e.forceValue?!this.value:e.forceValue,a=function(e,t,i){if(e.language)return e.language;if(e.usePreviousLanguageChoice&&t)return t;return i}(e,this._lastLanguage,r.language);i.change((e=>{o?this._applyCodeBlock(e,s,a):this._removeCodeBlock(e,s)}))}_getValue(){const e=es(this.editor.model.document.selection.getSelectedBlocks());return!!!(!e||!e.is("element","codeBlock"))&&e.getAttribute("language")}_checkEnabled(){if(this.value)return!0;const e=this.editor.model.document.selection,t=this.editor.model.schema,i=es(e.getSelectedBlocks());return!!i&&ov(t,i)}_applyCodeBlock(e,t,i){this._lastLanguage=i;const n=this.editor.model.schema,r=t.filter((e=>ov(n,e)));for(const t of r)e.rename(t,"codeBlock"),e.setAttribute("language",i,t),n.removeDisallowedAttributes([t],e),Array.from(t.getChildren()).filter((e=>!n.checkChild(t,e))).forEach((t=>e.remove(t)));r.reverse().forEach(((t,i)=>{const n=r[i+1];t.previousSibling===n&&(e.appendElement("softBreak",n),e.merge(e.createPositionBefore(t)))}))}_removeCodeBlock(e,t){const i=t.filter((e=>e.is("element","codeBlock")));for(const t of i){const i=e.createRangeOn(t);for(const t of Array.from(i.getItems()).reverse())if(t.is("element","softBreak")&&t.parent.is("element","codeBlock")){const{position:i}=e.split(e.createPositionBefore(t)),n=i.nodeAfter;e.rename(n,"paragraph"),e.removeAttribute("language",n),e.remove(t)}e.rename(t,"paragraph"),e.removeAttribute("language",t)}}}class hv extends Cu{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((t=>{const i=rv(e);for(const n of i){const i=t.createText(this._indentSequence);e.insertContent(i,n)}}))}_checkEnabled(){return!!this._indentSequence&&sv(this.editor.model.document.selection)}}class dv extends Cu{_indentSequence;constructor(e){super(e),this._indentSequence=e.config.get("codeBlock.indentSequence")}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model;e.change((()=>{const t=rv(e);for(const i of t){const t=uv(e,i,this._indentSequence);t&&e.deleteContent(e.createSelection(t))}}))}_checkEnabled(){if(!this._indentSequence)return!1;const e=this.editor.model;return!!sv(e.document.selection)&&rv(e).some((t=>uv(e,t,this._indentSequence)))}}function uv(e,t,i){const n=lv(t,e);if(!n)return null;const r=nv(n),s=r.lastIndexOf(i);if(s+i.length!==r.length)return null;if(-1===s)return null;const{parent:o,startOffset:a}=n;return e.createRange(e.createPositionAt(o,a+s),e.createPositionAt(o,a+s+i.length))}function mv(e,t,i=!1){const n=iv(t,"language","class"),r=iv(t,"language","label");return(t,s,o)=>{const{writer:a,mapper:l,consumable:c}=o;if(!c.consume(s.item,"insert"))return;const h=s.item.getAttribute("language"),d=l.toViewPosition(e.createPositionBefore(s.item)),u={};i&&(u["data-language"]=r[h],u.spellcheck="false");const m=n[h]?{class:n[h]}:void 0,g=a.createContainerElement("code",m),f=a.createContainerElement("pre",u,g);a.insert(d,f),l.bindElements(s.item,g)}}const gv="paragraph";class fv extends yu{static get pluginName(){return"CodeBlockEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Pb]}constructor(e){super(e),e.config.define("codeBlock",{languages:[{language:"plaintext",label:"Plain text"},{language:"c",label:"C"},{language:"cs",label:"C#"},{language:"cpp",label:"C++"},{language:"css",label:"CSS"},{language:"diff",label:"Diff"},{language:"html",label:"HTML"},{language:"java",label:"Java"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"python",label:"Python"},{language:"ruby",label:"Ruby"},{language:"typescript",label:"TypeScript"},{language:"xml",label:"XML"}],indentSequence:"\t"})}init(){const e=this.editor,t=e.model.schema,i=e.model,n=e.editing.view,r=tv(e);e.commands.add("codeBlock",new cv(e)),e.commands.add("indentCodeBlock",new hv(e)),e.commands.add("outdentCodeBlock",new dv(e)),this.listenTo(n.document,"tab",((t,i)=>{const n=i.shiftKey?"outdentCodeBlock":"indentCodeBlock";e.commands.get(n).isEnabled&&(e.execute(n),i.stopPropagation(),i.preventDefault(),t.stop())}),{context:"pre"}),t.register("codeBlock",{allowWhere:"$block",allowChildren:"$text",disallowChildren:"$inlineObject",allowAttributes:["language"],allowAttributesOf:"$listItem",isBlock:!0}),t.addAttributeCheck(((e,i)=>{const n=e.getItem(e.length-2);if(t.getAttributeProperties(i).isFormatting&&n&&"codeBlock"==n.name)return!1})),e.editing.downcastDispatcher.on("insert:codeBlock",mv(i,r,!0)),e.data.downcastDispatcher.on("insert:codeBlock",mv(i,r)),e.data.downcastDispatcher.on("insert:softBreak",function(e){return(t,i,n)=>{if("codeBlock"!==i.item.parent.name)return;const{writer:r,mapper:s,consumable:o}=n;if(!o.consume(i.item,"insert"))return;const a=s.toViewPosition(e.createPositionBefore(i.item));r.insert(a,r.createText("\n"))}}(i),{priority:"high"}),e.data.upcastDispatcher.on("element:code",function(e,t){const i=iv(t,"class","language"),n=t[0].language;return(e,t,r)=>{const s=t.viewItem,o=s.parent;if(!o||!o.is("element","pre"))return;if(t.modelCursor.findAncestor("codeBlock"))return;const{consumable:a,writer:l}=r;if(!a.test(s,{name:!0}))return;const c=l.createElement("codeBlock"),h=[...s.getClassNames()];h.length||h.push("");for(const e of h){const t=i[e];if(t){l.setAttribute("language",t,c);break}}c.hasAttribute("language")||l.setAttribute("language",n,c),r.convertChildren(s,c),r.safeInsert(c,t.modelCursor)&&(a.consume(s,{name:!0}),r.updateConversionResult(c,t))}}(0,r)),e.data.upcastDispatcher.on("text",((e,t,{consumable:i,writer:n})=>{let r=t.modelCursor;if(!i.test(t.viewItem))return;if(!r.findAncestor("codeBlock"))return;i.consume(t.viewItem);const s=t.viewItem.data.split("\n").map((e=>n.createText(e))),o=s[s.length-1];for(const e of s)if(n.insert(e,r),r=r.getShiftedBy(e.offsetSize),e!==o){const e=n.createElement("softBreak");n.insert(e,r),r=n.createPositionAfter(e)}t.modelRange=n.createRange(t.modelCursor,r),t.modelCursor=r})),e.data.upcastDispatcher.on("element:pre",((e,t,{consumable:i})=>{const n=t.viewItem;if(n.findAncestor("pre"))return;const r=Array.from(n.getChildren()),s=r.find((e=>e.is("element","code")));if(s)for(const e of r)e!==s&&e.is("$text")&&i.consume(e,{name:!0})}),{priority:"high"}),this.listenTo(e.editing.view.document,"clipboardInput",((t,n)=>{let r=i.createRange(i.document.selection.anchor);if(n.targetRanges&&(r=e.editing.mapper.toModelRange(n.targetRanges[0])),!r.start.parent.is("element","codeBlock"))return;const s=n.dataTransfer.getData("text/plain"),o=new Cd(e.editing.view.document);n.content=function(e,t){const i=e.createDocumentFragment(),n=t.split("\n"),r=n.reduce(((t,i,r)=>(t.push(i),r{const r=e.model,s=r.document.selection;s.anchor.parent.is("element","codeBlock")&&r.change((e=>{const i=e.createRangeIn(n.content);for(const n of[...i.getItems()])n.is("node")&&!t.checkChild(s.anchor,n)&&e.remove(n)}))})),this.listenTo(i,"getSelectedContent",((e,[n])=>{const r=n.anchor;!n.isCollapsed&&r.parent.is("element","codeBlock")&&r.hasSameParentAs(n.focus)&&i.change((i=>{const s=e.return;if(r.parent.is("element")&&(s.childCount>1||n.containsEntireContent(r.parent))){const t=i.createElement("codeBlock",r.parent.getAttributes());i.append(s,t);const n=i.createDocumentFragment();return i.append(t,n),void(e.return=n)}const o=s.getChild(0);t.checkAttribute(o,"code")&&i.setAttribute("code",!0,o)}))}))}afterInit(){const e=this.editor,t=e.commands,i=t.get("indent"),n=t.get("outdent");i&&i.registerChildCommand(t.get("indentCodeBlock"),{priority:"highest"}),n&&n.registerChildCommand(t.get("outdentCodeBlock")),this.listenTo(e.editing.view.document,"enter",((t,i)=>{e.model.document.selection.getLastPosition().parent.is("element","codeBlock")&&(function(e,t){const i=e.model,n=i.document,r=e.editing.view,s=n.selection.getLastPosition(),o=s.nodeAfter;if(t||!n.selection.isCollapsed||!s.isAtStart)return!1;if(!wv(o))return!1;return e.model.change((t=>{e.execute("enter");const i=n.selection.anchor.parent.previousSibling;t.rename(i,gv),t.setSelection(i,"in"),e.model.schema.removeDisallowedAttributes([i],t),t.remove(o)})),r.scrollToTheSelection(),!0}(e,i.isSoft)||function(e,t){const i=e.model,n=i.document,r=e.editing.view,s=n.selection.getLastPosition(),o=s.nodeBefore;let a;if(t||!n.selection.isCollapsed||!s.isAtEnd||!o||!o.previousSibling)return!1;if(wv(o)&&wv(o.previousSibling))a=i.createRange(i.createPositionBefore(o.previousSibling),i.createPositionAfter(o));else if(pv(o)&&wv(o.previousSibling)&&wv(o.previousSibling.previousSibling))a=i.createRange(i.createPositionBefore(o.previousSibling.previousSibling),i.createPositionAfter(o));else{if(!(pv(o)&&wv(o.previousSibling)&&pv(o.previousSibling.previousSibling)&&o.previousSibling.previousSibling&&wv(o.previousSibling.previousSibling.previousSibling)))return!1;a=i.createRange(i.createPositionBefore(o.previousSibling.previousSibling.previousSibling),i.createPositionAfter(o))}return e.model.change((t=>{t.remove(a),e.execute("enter");const i=n.selection.anchor.parent;t.rename(i,gv),e.model.schema.removeDisallowedAttributes([i],t)})),r.scrollToTheSelection(),!0}(e,i.isSoft)||function(e){const t=e.model,i=t.document;let n;const r=lv(i.selection.getLastPosition(),t);r&&r.is("$text")&&(n=nv(r));e.model.change((t=>{e.execute("shiftEnter"),n&&t.insertText(n,i.selection.anchor)}))}(e),i.preventDefault(),t.stop())}),{context:"pre"}),this._initAriaAnnouncements()}_initAriaAnnouncements(){const{model:e,ui:t,t:i}=this.editor,n=tv(this.editor);let r=null;e.document.selection.on("change:range",(()=>{const s=e.document.selection.focus.parent;t&&r!==s&&s.is("element")&&(r&&r.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(av(i,n,r,"leave")),s.is("element","codeBlock")&&t.ariaLiveAnnouncer.announce(av(i,n,s,"enter")),r=s)}))}}function pv(e){return e&&e.is("$text")&&!e.data.match(/\S/)}function wv(e){return e&&e.is("element","softBreak")}class bv extends yu{static get pluginName(){return"CodeBlockUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=e.ui.componentFactory,n=tv(e),r=this._getLanguageListItemDefinitions(n),s=e.commands.get("codeBlock");i.add("codeBlock",(i=>{const n=Cf(i,kf),o=n.buttonView,a=t("Insert code block");return o.set({label:a,tooltip:!0,icon:Uu.codeBlock,isToggleable:!0}),o.bind("isOn").to(s,"value",(e=>!!e)),o.on("execute",(()=>{e.execute("codeBlock",{usePreviousLanguageChoice:!0}),e.editing.view.focus()})),n.on("execute",(t=>{e.execute("codeBlock",{language:t.source._codeBlockLanguage,forceValue:!0}),e.editing.view.focus()})),n.class="ck-code-block-dropdown",n.bind("isEnabled").to(s),Tf(n,r,{role:"menu",ariaLabel:a}),n})),i.add("menuBar:codeBlock",(i=>{const n=new Hp(i);n.buttonView.set({role:"menuitem",label:t("Code block"),icon:Uu.codeBlock}),n.bind("isEnabled").to(s);const o=new Wp(i);o.set({ariaLabel:t("Insert code block")});for(const t of r){const r=new cp(i,n),a=new Ig(i);a.bind(...Object.keys(t.model)).to(t.model),a.set({isToggleable:!0,role:"menuitemcheckbox"}),a.delegate("execute").to(n),a.on("execute",(()=>{e.execute("codeBlock",{language:t.model._codeBlockLanguage,forceValue:s.value!=t.model._codeBlockLanguage}),e.editing.view.focus()})),r.children.add(a),o.items.add(r)}return n.panelView.children.add(o),n}))}_getLanguageListItemDefinitions(e){const t=this.editor.commands.get("codeBlock"),i=new Xr;for(const n of e){const e={type:"button",model:new Rp({_codeBlockLanguage:n.language,label:n.label,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(t=>t===e.model._codeBlockLanguage)),i.add(e)}return i}}class _v extends Ap{view;_toolbarConfig;_elementReplacer;constructor(e,t){super(e),this.view=t,this._toolbarConfig=pf(e.config.get("toolbar")),this._elementReplacer=new $n,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(e){const t=this.editor,i=this.view,n=t.editing.view,r=i.editable,s=n.document.getRoot();r.name=s.rootName,i.render();const o=r.element;this.setEditableElement(r.name,o),i.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(o),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),i.menuBarView&&this._initMenuBar(i.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.getDomRoot(e.editable.name)&&t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:e})=>e||0)),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,t=e.editing.view,i=t.document.getRoot(),n=e.sourceElement;let r;const s=e.config.get("placeholder");s&&(r="string"==typeof s?s:s[this.view.editable.name]),!r&&n&&"textarea"===n.tagName.toLowerCase()&&(r=n.getAttribute("placeholder")),r&&(i.placeholder=r),Po({view:t,element:i,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:e}=this.view,t=this.editor.plugins.get("ContextualBalloon");t.on("getPositionOptions",(t=>{const i=t.return;if(!i||!e.isSticky||!e.element)return;const n=new dr(e.element).height,r="function"==typeof i.target?i.target():i.target,s="function"==typeof i.limiter?i.limiter():i.limiter;if(r&&s&&new dr(r).height>=new dr(s).height-n)return;const o={...i.viewportOffsetConfig},a=(o.top||0)+n;t.return={...i,viewportOffsetConfig:{...o,top:a}}}),{priority:"low"});const i=()=>{t.visibleView&&t.updatePosition()};this.listenTo(e,"change:isSticky",i),this.listenTo(this.editor.ui,"change:viewportOffset",i)}_handleScrollToTheSelectionWithStickyPanel(e,t,i){const n=this.view.stickyPanel;if(n.isSticky){const e=new dr(n.element).height;t.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(n,"change:isSticky",e),setTimeout((()=>{this.stopListening(n,"change:isSticky",e)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,t=this.editor.plugins.get("Dialog");t.on("show",(()=>{const i=t.view;i.on("moveTo",((t,n)=>{if(!e.isSticky||i.wasMoved||i.isModal)return;const r=new dr(e.contentPanelElement);n[1]{const n=new this(e,t);i(n.initPlugins().then((()=>n.ui.init(kv(e)?e:null))).then((()=>n.data.init(n.config.get("initialData")))).then((()=>n.fire("ready"))).then((()=>n)))}))}}function kv(e){return Ci(e)}class Cv extends Cu{constructor(e){super(e),this.affectsData=!1}execute(){const e=this.editor.model,t=e.document.selection;let i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!xv(e.schema,i))do{if(i=i.parent,!i)return}while(!xv(e.schema,i));e.change((e=>{e.setSelection(i,"in")}))}}function xv(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}const Av=Ur("Ctrl+A");class Tv extends yu{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=e.editing.view.document;e.commands.add("selectAll",new Cv(e)),this.listenTo(i,"keydown",((t,i)=>{$r(i)===Av&&(e.execute("selectAll"),i.preventDefault())})),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}}class Ev extends yu{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("selectAll",(()=>{const e=this._createButton(cg);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:selectAll",(()=>this._createButton(Ig)))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("selectAll"),r=new e(t.locale),s=i.t;return r.set({label:s("Select all"),icon:'',keystroke:"Ctrl+A"}),r.bind("isEnabled").to(n,"isEnabled"),this.listenTo(r,"execute",(()=>{t.execute("selectAll"),t.editing.view.focus()})),r}}class Sv extends yu{static get requires(){return[Tv,Ev]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}}class Pv extends Cu{_stack=[];_createdBatches=new WeakSet;constructor(e){super(e),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",((e,t)=>{t[1]={...t[1]};const i=t[1];i.batchType||(i.batchType={isUndoable:!1})}),{priority:"high"}),this.listenTo(e.data,"set",((e,t)=>{t[1].batchType.isUndoable||this.clearStack()}))}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){const t=this.editor.model.document.selection,i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){const n=this.editor.model,r=n.document,s=[],o=e.map((e=>e.getTransformedByOperations(i))),a=o.flat();for(const e of o){const t=e.filter((e=>e.root!=r.graveyard)).filter((e=>!Vv(e,a)));t.length&&(Iv(t),s.push(t[0]))}s.length&&n.change((e=>{e.setSelection(s,{backward:t})}))}_undo(e,t){const i=this.editor.model,n=i.document;this._createdBatches.add(t);const r=e.operations.slice().filter((e=>e.isDocumentOperation));r.reverse();for(const e of r){const r=e.baseVersion+1,s=Array.from(n.history.getOperations(r)),o=Eh([e.getReversed()],s,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let r of o){const s=r.affectedSelectable;s&&!i.canEditAt(s)&&(r=new wh(r.baseVersion)),t.addOperation(r),i.applyOperation(r),n.history.setOperationAsUndone(e,r)}}}}function Iv(e){e.sort(((e,t)=>e.start.isBefore(t.start)?-1:1));for(let t=1;tt!==e&&t.containsRange(e,!0)))}class Rv extends Pv{execute(e=null){const t=e?this._stack.findIndex((t=>t.batch==e)):this._stack.length-1,i=this._stack.splice(t,1)[0],n=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(n,(()=>{this._undo(i.batch,n);const e=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,e)})),this.fire("revert",i.batch,n),this.refresh()}}class Bv extends Pv{execute(){const e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,(()=>{const i=e.batch.operations[e.batch.operations.length-1].baseVersion+1,n=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,n),this._undo(e.batch,t)})),this.refresh()}}class Ov extends yu{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t;this._undoCommand=new Rv(e),this._redoCommand=new Bv(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",((e,t)=>{const i=t[0];if(!i.isDocumentOperation)return;const n=i.batch,r=this._redoCommand.createdBatches.has(n),s=this._undoCommand.createdBatches.has(n);this._batchRegistry.has(n)||(this._batchRegistry.add(n),n.isUndoable&&(r?this._undoCommand.addBatch(n):s||(this._undoCommand.addBatch(n),this._redoCommand.clearStack())))}),{priority:"highest"}),this.listenTo(this._undoCommand,"revert",((e,t,i)=>{this._redoCommand.addBatch(i)})),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}}class Fv extends yu{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,i=e.t,n="ltr"==t.uiLanguageDirection?Uu.undo:Uu.redo,r="ltr"==t.uiLanguageDirection?Uu.redo:Uu.undo;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",n),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",r)}_addButtonsToFactory(e,t,i,n){const r=this.editor;r.ui.componentFactory.add(e,(()=>{const r=this._createButton(cg,e,t,i,n);return r.set({tooltip:!0}),r})),r.ui.componentFactory.add("menuBar:"+e,(()=>this._createButton(Ig,e,t,i,n)))}_createButton(e,t,i,n,r){const s=this.editor,o=s.locale,a=s.commands.get(t),l=new e(o);return l.set({label:i,icon:r,keystroke:n}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",(()=>{s.execute(t),s.editing.view.focus()})),l}}class Mv extends yu{static get requires(){return[Ov,Fv]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}}class Nv extends ig{children;_findInputView;_replaceInputView;_findButtonView;_findPrevButtonView;_findNextButtonView;_advancedOptionsCollapsibleView;_matchCaseSwitchView;_wholeWordsOnlySwitchView;_replaceButtonView;_replaceAllButtonView;_inputsDivView;_actionButtonsDivView;_focusTracker;_keystrokes;_focusables;focusCycler;constructor(e){super(e);const t=e.t;this.children=this.createCollection(),this.set("matchCount",0),this.set("highlightOffset",0),this.set("isDirty",!1),this.set("_areCommandsEnabled",{}),this.set("_resultsCounterText",""),this.set("_matchCase",!1),this.set("_wholeWordsOnly",!1),this.bind("_searchResultsFound").to(this,"matchCount",this,"isDirty",((e,t)=>e>0&&!t)),this._findInputView=this._createInputField(t("Find in text…")),this._findPrevButtonView=this._createButton({label:t("Previous result"),class:"ck-button-prev",icon:Uu.previousArrow,keystroke:"Shift+F3",tooltip:!0}),this._findNextButtonView=this._createButton({label:t("Next result"),class:"ck-button-next",icon:Uu.previousArrow,keystroke:"F3",tooltip:!0}),this._replaceInputView=this._createInputField(t("Replace with…"),"ck-labeled-field-replace"),this._inputsDivView=this._createInputsDiv(),this._matchCaseSwitchView=this._createMatchCaseSwitch(),this._wholeWordsOnlySwitchView=this._createWholeWordsOnlySwitch(),this._advancedOptionsCollapsibleView=this._createAdvancedOptionsCollapsible(),this._replaceAllButtonView=this._createButton({label:t("Replace all"),class:"ck-button-replaceall",withText:!0}),this._replaceButtonView=this._createButton({label:t("Replace"),class:"ck-button-replace",withText:!0}),this._findButtonView=this._createButton({label:t("Find"),class:"ck-button-find ck-button-action",withText:!0}),this._actionButtonsDivView=this._createActionButtonsDiv(),this._focusTracker=new ts,this._keystrokes=new ss,this._focusables=new Om,this.focusCycler=new ug({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this._keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.children.addMany([this._inputsDivView,this._advancedOptionsCollapsibleView,this._actionButtonsDivView]),this.setTemplate({tag:"form",attributes:{class:["ck","ck-find-and-replace-form"],tabindex:"-1"},children:this.children})}render(){super.render(),sg({view:this}),this._initFocusCycling(),this._initKeystrokeHandling()}destroy(){super.destroy(),this._focusTracker.destroy(),this._keystrokes.destroy()}focus(e){-1===e?this.focusCycler.focusLast():this.focusCycler.focusFirst()}reset(){this._findInputView.errorText=null,this.isDirty=!0}get _textToFind(){return this._findInputView.fieldView.element.value}get _textToReplace(){return this._replaceInputView.fieldView.element.value}_createInputsDiv(){const e=this.locale,t=e.t,i=new ig(e);return this._findInputView.fieldView.on("input",(()=>{this.isDirty=!0})),this._findPrevButtonView.delegate("execute").to(this,"findPrevious"),this._findNextButtonView.delegate("execute").to(this,"findNext"),this._findPrevButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findPrevious:e})=>e)),this._findNextButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",(({findNext:e})=>e)),this._injectFindResultsCounter(),this._replaceInputView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:e},t)=>e&&t)),this._replaceInputView.bind("infoText").to(this._replaceInputView,"isEnabled",this._replaceInputView,"isFocused",((e,i)=>e||!i?"":t("Tip: Find some text first in order to replace it."))),i.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__inputs"]},children:[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView]}),i}_onFindButtonExecute(){if(this._textToFind)this.isDirty=!1,this.fire("findNext",{searchText:this._textToFind,matchCase:this._matchCase,wholeWords:this._wholeWordsOnly});else{const e=this.t;this._findInputView.errorText=e("Text to find must not be empty.")}}_injectFindResultsCounter(){const e=this.locale,t=e.t,i=this.bindTemplate,n=new ig(this.locale);this.bind("_resultsCounterText").to(this,"highlightOffset",this,"matchCount",((e,i)=>t("%0 of %1",[e,i]))),n.setTemplate({tag:"span",attributes:{class:["ck","ck-results-counter",i.if("isDirty","ck-hidden")]},children:[{text:i.to("_resultsCounterText")}]});const r=()=>{const t=this._findInputView.fieldView.element;if(!t||!Cr(t))return;const i=new dr(n.element).width,r="ltr"===e.uiLanguageDirection?"paddingRight":"paddingLeft";t.style[r]=i?`calc( 2 * var(--ck-spacing-standard) + ${i}px )`:""};this.on("change:_resultsCounterText",r,{priority:"low"}),this.on("change:isDirty",r,{priority:"low"}),this._findInputView.template.children[0].children.push(n)}_createAdvancedOptionsCollapsible(){const e=this.locale.t,t=new $g(this.locale,[this._matchCaseSwitchView,this._wholeWordsOnlySwitchView]);return t.set({label:e("Advanced options"),isCollapsed:!0}),t}_createActionButtonsDiv(){const e=new ig(this.locale);return this._replaceButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replace:e},t)=>e&&t)),this._replaceAllButtonView.bind("isEnabled").to(this,"_areCommandsEnabled",this,"_searchResultsFound",(({replaceAll:e},t)=>e&&t)),this._replaceButtonView.on("execute",(()=>{this.fire("replace",{searchText:this._textToFind,replaceText:this._textToReplace})})),this._replaceAllButtonView.on("execute",(()=>{this.fire("replaceAll",{searchText:this._textToFind,replaceText:this._textToReplace}),this.focus()})),this._findButtonView.on("execute",this._onFindButtonExecute.bind(this)),e.setTemplate({tag:"div",attributes:{class:["ck","ck-find-and-replace-form__actions"]},children:[this._replaceAllButtonView,this._replaceButtonView,this._findButtonView]}),e}_createMatchCaseSwitch(){const e=this.locale.t,t=new Ng(this.locale);return t.set({label:e("Match case"),withText:!0}),t.bind("isOn").to(this,"_matchCase"),t.on("execute",(()=>{this._matchCase=!this._matchCase,this.isDirty=!0})),t}_createWholeWordsOnlySwitch(){const e=this.locale.t,t=new Ng(this.locale);return t.set({label:e("Whole words only"),withText:!0}),t.bind("isOn").to(this,"_wholeWordsOnly"),t.on("execute",(()=>{this._wholeWordsOnly=!this._wholeWordsOnly,this.isDirty=!0})),t}_initFocusCycling(){[this._findInputView,this._findPrevButtonView,this._findNextButtonView,this._replaceInputView,this._advancedOptionsCollapsibleView.buttonView,this._matchCaseSwitchView,this._wholeWordsOnlySwitchView,this._replaceAllButtonView,this._replaceButtonView,this._findButtonView].forEach((e=>{this._focusables.add(e),this._focusTracker.add(e.element)}))}_initKeystrokeHandling(){const e=e=>e.stopPropagation(),t=e=>{e.stopPropagation(),e.preventDefault()};this._keystrokes.listenTo(this.element),this._keystrokes.set("f3",(e=>{t(e),this._findNextButtonView.fire("execute")})),this._keystrokes.set("shift+f3",(e=>{t(e),this._findPrevButtonView.fire("execute")})),this._keystrokes.set("enter",(e=>{const i=e.target;i===this._findInputView.fieldView.element?(this._areCommandsEnabled.findNext?this._findNextButtonView.fire("execute"):this._findButtonView.fire("execute"),t(e)):i!==this._replaceInputView.fieldView.element||this.isDirty||(this._replaceButtonView.fire("execute"),t(e))})),this._keystrokes.set("shift+enter",(e=>{e.target===this._findInputView.fieldView.element&&(this._areCommandsEnabled.findPrevious?this._findPrevButtonView.fire("execute"):this._findButtonView.fire("execute"),t(e))})),this._keystrokes.set("arrowright",e),this._keystrokes.set("arrowleft",e),this._keystrokes.set("arrowup",e),this._keystrokes.set("arrowdown",e)}_createButton(e){const t=new cg(this.locale);return t.set(e),t}_createInputField(e,t){const i=new Qg(this.locale,Vf);return i.label=e,i.class=t,i}}var Lv='';class Dv extends yu{static get requires(){return[Eg]}static get pluginName(){return"FindAndReplaceUI"}static get isOfficialPlugin(){return!0}formView;constructor(e){super(e),e.config.define("findAndReplace.uiType","dialog"),this.formView=null}init(){const e=this.editor,t="dropdown"===e.config.get("findAndReplace.uiType"),i=e.commands.get("find"),n=this.editor.t;e.ui.componentFactory.add("findAndReplace",(()=>{let n;return t?(n=this._createDropdown(),n.bind("isEnabled").to(i)):n=this._createDialogButtonForToolbar(),e.keystrokes.set("Ctrl+F",((t,r)=>{if(i.isEnabled){if(n instanceof rf){const e=n.buttonView;e.isOn||e.fire("execute")}else n.isOn?e.plugins.get("Dialog").view.focus():n.fire("execute");r()}})),n})),t||e.ui.componentFactory.add("menuBar:findAndReplace",(()=>this._createDialogButtonForMenuBar())),e.accessibility.addKeystrokeInfos({keystrokes:[{label:n("Find in the document"),keystroke:"CTRL+F"}]})}_createDropdown(){const e=this.editor,t=e.locale.t,i=Cf(e.locale);return i.once("change:isOpen",(()=>{this.formView=this._createFormView(),this.formView.children.add(new dg(e.locale,{label:t("Find and replace")}),0),i.panelView.children.add(this.formView)})),i.on("change:isOpen",((e,t,i)=>{i?this._setupFormView():this.fire("searchReseted")}),{priority:"low"}),i.buttonView.set({icon:Lv,label:t("Find and replace"),keystroke:"CTRL+F",tooltip:!0}),i}_createDialogButtonForToolbar(){const e=this.editor,t=this._createButton(cg),i=e.plugins.get("Dialog");return t.set({tooltip:!0}),t.bind("isOn").to(i,"id",(e=>"findAndReplace"===e)),t.on("execute",(()=>{t.isOn?i.hide():this._showDialog()})),t}_createDialogButtonForMenuBar(){const e=this._createButton(Ig),t=this.editor.plugins.get("Dialog"),i=this.editor.plugins.get("Dialog");return e.set({role:"menuitemcheckbox",isToggleable:!0}),e.bind("isOn").to(i,"id",(e=>"findAndReplace"===e)),e.on("execute",(()=>{"findAndReplace"!==t.id?this._showDialog():t.hide()})),e}_createButton(e){const t=this.editor,i=t.commands.get("find"),n=new e(t.locale),r=t.locale.t;return n.bind("isEnabled").to(i),n.set({icon:Lv,label:r("Find and replace"),keystroke:"CTRL+F"}),n}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.formView||(this.formView=this._createFormView()),t.show({id:"findAndReplace",title:i("Find and replace"),content:this.formView,position:vg,onShow:()=>{this._setupFormView()},onHide:()=>{this.fire("searchReseted")}})}_createFormView(){const e=this.editor,t=new(rg(Nv))(e.locale),i=e.commands,n=this.editor.plugins.get("FindAndReplaceEditing").state;t.bind("highlightOffset").to(n,"highlightedOffset"),t.listenTo(n.results,"change",(()=>{t.matchCount=n.results.length}));const r=i.get("findNext"),s=i.get("findPrevious"),o=i.get("replace"),a=i.get("replaceAll");return t.bind("_areCommandsEnabled").to(r,"isEnabled",s,"isEnabled",o,"isEnabled",a,"isEnabled",((e,t,i,n)=>({findNext:e,findPrevious:t,replace:i,replaceAll:n}))),t.delegate("findNext","findPrevious","replace","replaceAll").to(this),t.on("change:isDirty",((e,t,i)=>{i&&this.fire("searchReseted")})),t}_setupFormView(){this.formView.disableCssTransitions(),this.formView.reset(),this.formView._findInputView.fieldView.select(),this.formView.enableCssTransitions()}}class zv extends Cu{_state;constructor(e,t){super(e),this.isEnabled=!0,this.affectsData=!1,this._state=t}execute(e,{matchCase:t,wholeWords:i}={}){const{editor:n}=this,{model:r}=n,s=n.plugins.get("FindAndReplaceUtils");let o,a="";o="string"==typeof e?(...n)=>({results:s.findByTextCallback(e,{matchCase:t,wholeWords:i})(...n),searchText:e}):e;const l=o;o=(...e)=>{const t=l(...e);return t&&"searchText"in t&&(a=t.searchText),t};const c=r.document.getRootNames().reduce(((e,t)=>s.updateFindResultFromRange(r.createRangeIn(r.document.getRoot(t)),r,o,e)),null);return this._state.clear(r),this._state.results.addMany(c),this._state.highlightedResult=c.get(0),this._state.searchText=a,o&&(this._state.lastSearchCallback=o),this._state.matchCase=!!t,this._state.matchWholeWords=!!i,{results:c,findCallback:o}}}class Hv extends(Nn()){constructor(e){super(),this.set("results",new Xr),this.set("highlightedResult",null),this.set("highlightedOffset",0),this.set("searchText",""),this.set("replaceText",""),this.set("lastSearchCallback",null),this.set("matchCase",!1),this.set("matchWholeWords",!1),this.results.on("change",((t,{removed:i,index:n})=>{if(Array.from(i).length){let t=!1;if(e.change((n=>{for(const r of i)this.highlightedResult===r&&(t=!0),e.markers.has(r.marker.name)&&n.removeMarker(r.marker)})),t){const e=n>=this.results.length?0:n;this.highlightedResult=this.results.get(e)}}})),this.on("change:highlightedResult",(()=>{this.refreshHighlightOffset(e)}))}clear(e){this.searchText="",e.change((t=>{if(this.highlightedResult){const i=this.highlightedResult.marker.name.split(":")[1],n=e.markers.get(`findResultHighlighted:${i}`);n&&t.removeMarker(n)}[...this.results].forEach((({marker:e})=>{t.removeMarker(e)}))})),this.results.clear()}refreshHighlightOffset(e){const{highlightedResult:t,results:i}=this;this.highlightedOffset=t?Wv(e,[...i]).indexOf(t)+1:0}}function Wv(e,t){const i={before:-1,same:0,after:1,different:1};return e.document.getRootNames().flatMap((e=>t.filter((t=>t.marker.getStart().root.rootName===e)).sort(((e,t)=>i[e.marker.getStart().compareWith(t.marker.getStart())]))))}class $v extends Cu{_state;constructor(e,t){super(e),this.isEnabled=!0,this._state=t,this._isEnabledBasedOnSelection=!1}_replace(e,t){const{model:i}=this.editor,n=t.marker.getRange();i.canEditAt(n)&&i.change((r=>{if("$graveyard"===n.root.rootName)return void this._state.results.remove(t);let s={};for(const e of n.getItems())if(e.is("$text")||e.is("$textProxy")){s=e.getAttributes();break}i.insertContent(r.createText(e,s),n),this._state.results.has(t)&&this._state.results.remove(t)}))}}class Uv extends $v{execute(e,t){const i=Math.max(this._state.highlightedOffset-1,0);if(this._replace(e,t),this._state.results.length){const e=Wv(this.editor.model,[...this._state.results]);this._state.highlightedResult=e[i%e.length]}}}class jv extends $v{execute(e,t){const{editor:i}=this,{model:n}=i,r=i.plugins.get("FindAndReplaceUtils"),s=t instanceof Xr?t:n.document.getRootNames().reduce(((e,i)=>r.updateFindResultFromRange(n.createRangeIn(n.document.getRoot(i)),n,r.findByTextCallback(t,this._state),e)),null);s.length&&n.change((()=>{[...s].forEach((t=>{this._replace(e,t)}))}))}}class qv extends Cu{_state;constructor(e,t){super(e),this.affectsData=!1,this._state=t,this.isEnabled=!1,this.listenTo(this._state.results,"change",(()=>{this.isEnabled=this._state.results.length>1}))}refresh(){this.isEnabled=this._state.results.length>1}execute(){const e=this._state.results,t=e.getIndex(this._state.highlightedResult),i=t+1>=e.length?0:t+1;this._state.highlightedResult=this._state.results.get(i)}}class Gv extends qv{execute(){const e=this._state.results.getIndex(this._state.highlightedResult),t=e-1<0?this._state.results.length-1:e-1;this._state.highlightedResult=this._state.results.get(t)}}class Kv extends yu{static get pluginName(){return"FindAndReplaceUtils"}static get isOfficialPlugin(){return!0}updateFindResultFromRange(e,t,i,n){const r=n||new Xr;return t.change((n=>{[...e].forEach((({type:e,item:s})=>{if("elementStart"===e&&t.schema.checkChild(s,"$text")){let e=i({item:s,text:this.rangeToText(t.createRangeIn(s))});if(!e)return;"results"in e&&(e=e.results),e.forEach((e=>{const t=`findResult:${hn()}`,i=n.addMarker(t,{usingOperation:!1,affectsData:!1,range:n.createRange(n.createPositionAt(s,e.start),n.createPositionAt(s,e.end))}),o=function(e,t){const i=e.find((({marker:e})=>t.getStart().isBefore(e.getStart())));return i?e.getIndex(i):e.length}(r,i);(e=>r.find((t=>{const{marker:i}=t,n=i.getRange(),r=e.getRange();return n.isEqual(r)})))(i)||r.add({id:t,label:e.label,marker:i},o)}))}}))})),r}rangeToText(e){return Array.from(e.getItems({shallow:!0})).reduce(((e,t)=>t.is("$text")||t.is("$textProxy")?e+t.data:`${e}\n`),"")}findByTextCallback(e,t){let i="gu";t.matchCase||(i+="i");let n=`(${Qu(e)})`;if(t.wholeWords){const t="[^a-zA-ZÀ-ɏḀ-ỿ]";new RegExp("^"+t).test(e)||(n=`(^|${t}|_)${n}`),new RegExp(t+"$").test(e)||(n=`${n}(?=_|${t}|$)`)}const r=new RegExp(n,i);return function({text:e}){return[...e.matchAll(r)].map(Zv)}}}function Zv(e){const t=e.length-1;let i=e.index;return 3===e.length&&(i+=e[1].length),{label:e[t],start:i,end:i+e[t].length}}class Jv extends yu{static get requires(){return[Kv]}static get pluginName(){return"FindAndReplaceEditing"}static get isOfficialPlugin(){return!0}state;init(){this.state=new Hv(this.editor.model),this.set("_isSearchActive",!1),this._defineConverters(),this._defineCommands(),this.listenTo(this.state,"change:highlightedResult",((e,t,i,n)=>{const{model:r}=this.editor;r.change((e=>{if(n){const t=n.marker.name.split(":")[1],i=r.markers.get(`findResultHighlighted:${t}`);i&&e.removeMarker(i)}if(i){const t=i.marker.name.split(":")[1];e.addMarker(`findResultHighlighted:${t}`,{usingOperation:!1,affectsData:!1,range:i.marker.getRange()})}}))}));const e=io(((e,t,i)=>{if(i){const e=this.editor.editing.view.domConverter,t=this.editor.editing.mapper.toViewRange(i.marker.getRange());Sr({target:e.viewRangeToDom(t),viewportOffset:40})}}).bind(this),32);this.listenTo(this.state,"change:highlightedResult",e,{priority:"low"}),this.listenTo(this.editor,"destroy",e.cancel),this.on("change:_isSearchActive",((e,t,i)=>{i?this.listenTo(this.editor.model.document,"change:data",this._onDocumentChange):this.stopListening(this.editor.model.document,"change:data",this._onDocumentChange)}))}find(e,t){return this._isSearchActive=!0,this.editor.execute("find",e,t),this.state.results}stop(){this.state.clear(this.editor.model),this._isSearchActive=!1}_defineCommands(){this.editor.commands.add("find",new zv(this.editor,this.state)),this.editor.commands.add("findNext",new qv(this.editor,this.state)),this.editor.commands.add("findPrevious",new Gv(this.editor,this.state)),this.editor.commands.add("replace",new Uv(this.editor,this.state)),this.editor.commands.add("replaceAll",new jv(this.editor,this.state))}_defineConverters(){const{editor:e}=this;e.conversion.for("editingDowncast").markerToHighlight({model:"findResult",view:({markerName:e})=>{const[,t]=e.split(":");return{name:"span",classes:["ck-find-result"],attributes:{"data-find-result":t}}}}),e.conversion.for("editingDowncast").markerToHighlight({model:"findResultHighlighted",view:({markerName:e})=>{const[,t]=e.split(":");return{name:"span",classes:["ck-find-result_selected"],attributes:{"data-find-result":t}}}})}_onDocumentChange=()=>{const e=new Set,t=new Set,i=this.editor.model,{results:n}=this.state,r=i.document.differ.getChanges(),s=i.document.differ.getChangedMarkers();r.forEach((n=>{n.position&&("$text"===n.name||n.position.nodeAfter&&i.schema.isInline(n.position.nodeAfter)?(e.add(n.position.parent),[...i.markers.getMarkersAtPosition(n.position)].forEach((e=>{t.add(e.name)}))):"insert"===n.type&&n.position.nodeAfter&&e.add(n.position.nodeAfter))})),s.forEach((({name:e,data:{newRange:i}})=>{i&&"$graveyard"===i.start.root.rootName&&t.add(e)})),e.forEach((e=>{[...i.markers.getMarkersIntersectingRange(i.createRangeIn(e))].forEach((e=>t.add(e.name)))})),t.forEach((e=>{n.has(e)&&(n.get(e)===this.state.highlightedResult&&(this.state.highlightedResult=null),n.remove(e))}));const o=[],a=this.editor.plugins.get("FindAndReplaceUtils");e.forEach((e=>{const t=a.updateFindResultFromRange(i.createRangeOn(e),i,this.state.lastSearchCallback,n);o.push(...t)})),s.forEach((e=>{if(e.data.newRange){const t=a.updateFindResultFromRange(e.data.newRange,i,this.state.lastSearchCallback,n);o.push(...t)}})),!this.state.highlightedResult&&o.length?this.state.highlightedResult=o[0]:this.state.refreshHighlightOffset(i)}}class Qv extends Cu{attributeKey;constructor(e,t){super(e),this.attributeKey=t}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute(this.attributeKey),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){const t=this.editor.model,i=t.document.selection,n=e.value,r=e.batch,s=e=>{if(i.isCollapsed)n?e.setSelectionAttribute(this.attributeKey,n):e.removeSelectionAttribute(this.attributeKey);else{const r=t.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const t of r)n?e.setAttribute(this.attributeKey,n,t):e.removeAttribute(this.attributeKey,t)}};r?t.enqueueChange(r,(e=>{s(e)})):t.change((e=>{s(e)}))}}const Yv="fontSize",Xv="fontFamily",ey="fontColor",ty="fontBackgroundColor";function iy(e,t){const i={model:{key:e,values:[]},view:{},upcastAlso:{}};for(const e of t)i.model.values.push(e.model),i.view[e.model]=e.view,e.upcastAlso&&(i.upcastAlso[e.model]=e.upcastAlso);return i}function ny(e){return t=>t.getStyle(e).replace(/\s/g,"")}function ry(e){return(t,{writer:i})=>i.createAttributeElement("span",{style:`${e}:${t}`},{priority:7})}class sy extends Qv{constructor(e){super(e,Xv)}}function oy(e){return e.map(ay).filter((e=>void 0!==e))}function ay(e){return"object"==typeof e?e:"default"===e?{title:"Default",model:void 0}:"string"==typeof e?function(e){const t=e.replace(/"|'/g,"").split(","),i=t[0],n=t.map(ly).join(", ");return{title:i,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}(e):void 0}function ly(e){return(e=e.trim()).indexOf(" ")>0&&(e=`'${e}'`),e}class cy extends yu{static get pluginName(){return"FontFamilyEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(Xv,{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Xv}),e.model.schema.setAttributeProperties(Xv,{isFormatting:!0,copyOnEnter:!0});const t=oy(e.config.get("fontFamily.options")).filter((e=>e.model)),i=iy(Xv,t);e.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(i),e.commands.add(Xv,new sy(e))}_prepareAnyValueConverters(){const e=this.editor;e.conversion.for("downcast").attributeToElement({model:Xv,view:(e,{writer:t})=>t.createAttributeElement("span",{style:"font-family:"+e},{priority:7})}),e.conversion.for("upcast").elementToAttribute({model:{key:Xv,value:e=>e.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:Xv,value:e=>e.getAttribute("face")}})}}var hy='';class dy extends yu{static get pluginName(){return"FontFamilyUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=this._getLocalizedOptions(),n=e.commands.get(Xv),r=t("Font Family"),s=function(e,t){const i=new Xr;for(const n of e){const e={type:"button",model:new Rp({commandName:Xv,commandParam:n.model,label:n.title,role:"menuitemradio",withText:!0})};e.model.bind("isOn").to(t,"value",(e=>e===n.model||!(!e||!n.model)&&e.split(",")[0].replace(/'/g,"").toLowerCase()===n.model.toLowerCase())),n.view&&"string"!=typeof n.view&&n.view.styles&&e.model.set("labelStyle",`font-family: ${n.view.styles["font-family"]}`),i.add(e)}return i}(i,n);e.ui.componentFactory.add(Xv,(t=>{const i=Cf(t);return Tf(i,s,{role:"menu",ariaLabel:r}),i.buttonView.set({label:r,icon:hy,tooltip:!0}),i.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),i.bind("isEnabled").to(n),this.listenTo(i,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),i})),e.ui.componentFactory.add(`menuBar:${Xv}`,(t=>{const i=new Hp(t);i.buttonView.set({label:r,icon:hy}),i.bind("isEnabled").to(n);const o=new Wp(t);for(const n of s){const r=new cp(t,i),s=new Ig(t);s.set({role:"menuitemradio",isToggleable:!0}),s.bind(...Object.keys(n.model)).to(n.model),s.delegate("execute").to(i),s.on("execute",(()=>{e.execute(n.model.commandName,{value:n.model.commandParam}),e.editing.view.focus()})),r.children.add(s),o.items.add(r)}return i.panelView.children.add(o),i}))}_getLocalizedOptions(){const e=this.editor,t=e.t;return oy(e.config.get(Xv).options).map((e=>("Default"===e.title&&(e.title=t("Default")),e)))}}class uy extends yu{static get requires(){return[cy,dy]}static get pluginName(){return"FontFamily"}static get isOfficialPlugin(){return!0}}class my extends Qv{constructor(e){super(e,Yv)}}function gy(e){return e.map((e=>function(e){"number"==typeof e&&(e=String(e));if("object"==typeof e&&(t=e,t.title&&t.model&&t.view))return py(e);var t;const i=function(e){return"string"==typeof e?fy[e]:fy[e.model]}(e);if(i)return py(i);if("default"===e)return{model:void 0,title:"Default"};if(function(e){let t;if("object"==typeof e){if(!e.model)throw new gn("font-size-invalid-definition",null,e);t=parseFloat(e.model)}else t=parseFloat(e);return isNaN(t)}(e))return;return function(e){"string"==typeof e&&(e={title:e,model:`${parseFloat(e)}px`});return e.view={name:"span",styles:{"font-size":e.model}},py(e)}(e)}(e))).filter((e=>void 0!==e))}const fy={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function py(e){return e.view&&"string"!=typeof e.view&&!e.view.priority&&(e.view.priority=7),e}const wy=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class by extends yu{static get pluginName(){return"FontSizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(Yv,{options:["tiny","small","default","big","huge"],supportAllValues:!1})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:Yv}),e.model.schema.setAttributeProperties(Yv,{isFormatting:!0,copyOnEnter:!0});const t=e.config.get("fontSize.supportAllValues"),i=gy(this.editor.config.get("fontSize.options")).filter((e=>e.model)),n=iy(Yv,i);t?(this._prepareAnyValueConverters(n),this._prepareCompatibilityConverter()):e.conversion.attributeToElement(n),e.commands.add(Yv,new my(e))}_prepareAnyValueConverters(e){const t=this.editor,i=e.model.values.filter((e=>!Fd(String(e))&&!Nd(String(e))));if(i.length)throw new gn("font-size-invalid-use-of-named-presets",null,{presets:i});t.conversion.for("downcast").attributeToElement({model:Yv,view:(e,{writer:t})=>{if(e)return t.createAttributeElement("span",{style:"font-size:"+e},{priority:7})}}),t.conversion.for("upcast").elementToAttribute({model:{key:Yv,value:e=>e.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:Yv,value:e=>{const t=e.getAttribute("size"),i="-"===t[0]||"+"===t[0];let n=parseInt(t,10);i&&(n=3+n);const r=wy.length-1,s=Math.min(Math.max(n,0),r);return wy[s]}}})}}var _y='';class vy extends yu{static get pluginName(){return"FontSizeUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=this._getLocalizedOptions(),n=e.commands.get(Yv),r=t("Font Size"),s=function(e,t){const i=new Xr;for(const n of e){const e={type:"button",model:new Rp({commandName:Yv,commandParam:n.model,label:n.title,class:"ck-fontsize-option",role:"menuitemradio",withText:!0})};n.view&&"string"!=typeof n.view&&(n.view.styles&&e.model.set("labelStyle",`font-size:${n.view.styles["font-size"]}`),n.view.classes&&e.model.set("class",`${e.model.class} ${n.view.classes}`)),e.model.bind("isOn").to(t,"value",(e=>e===n.model)),i.add(e)}return i}(i,n);e.ui.componentFactory.add(Yv,(t=>{const i=Cf(t);return Tf(i,s,{role:"menu",ariaLabel:r}),i.buttonView.set({label:r,icon:_y,tooltip:!0}),i.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),i.bind("isEnabled").to(n),this.listenTo(i,"execute",(t=>{e.execute(t.source.commandName,{value:t.source.commandParam}),e.editing.view.focus()})),i})),e.ui.componentFactory.add(`menuBar:${Yv}`,(t=>{const i=new Hp(t);i.buttonView.set({label:r,icon:_y}),i.bind("isEnabled").to(n);const o=new Wp(t);for(const n of s){const r=new cp(t,i),s=new Ig(t);s.set({role:"menuitemradio",isToggleable:!0}),s.bind(...Object.keys(n.model)).to(n.model),s.delegate("execute").to(i),s.on("execute",(()=>{e.execute(n.model.commandName,{value:n.model.commandParam}),e.editing.view.focus()})),r.children.add(s),o.items.add(r)}return i.panelView.children.add(o),i}))}_getLocalizedOptions(){const e=this.editor,t=e.t,i={Default:t("Default"),Tiny:t("Tiny"),Small:t("Small"),Big:t("Big"),Huge:t("Huge")};return gy(e.config.get(Yv).options).map((e=>{const t=i[e.title];return t&&t!=e.title&&(e=Object.assign({},e,{title:t})),e}))}}class yy extends yu{static get requires(){return[by,vy]}static get pluginName(){return"FontSize"}static get isOfficialPlugin(){return!0}normalizeSizeOptions(e){return gy(e)}}class ky extends Qv{constructor(e){super(e,ey)}}class Cy extends yu{static get pluginName(){return"FontColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(ey,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:ey,value:ny("color")}}),e.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:ey,value:e=>e.getAttribute("color")}}),e.conversion.for("downcast").attributeToElement({model:ey,view:ry("color")}),e.commands.add(ey,new ky(e)),e.model.schema.extend("$text",{allowAttributes:ey}),e.model.schema.setAttributeProperties(ey,{isFormatting:!0,copyOnEnter:!0})}}class xy extends yu{commandName;componentName;icon;dropdownLabel;columns;constructor(e,{commandName:t,componentName:i,icon:n,dropdownLabel:r}){super(e),this.commandName=t,this.componentName=i,this.icon=n,this.dropdownLabel=r,this.columns=e.config.get(`${this.componentName}.columns`)}init(){const e=this.editor,t=e.locale,i=t.t,n=e.commands.get(this.commandName),r=e.config.get(this.componentName),s=Ug(t,jg(r.colors)),o=r.documentColors,a=!1!==r.colorPicker;e.ui.componentFactory.add(this.componentName,(t=>{const l=Cf(t);let c=!1;const h=function({dropdownView:e,colors:t,columns:i,removeButtonLabel:n,colorPickerLabel:r,documentColorsLabel:s,documentColorsCount:o,colorPickerViewConfig:a}){const l=e.locale,c=new $f(l,{colors:t,columns:i,removeButtonLabel:n,colorPickerLabel:r,documentColorsLabel:s,documentColorsCount:o,colorPickerViewConfig:a});return e.colorSelectorView=c,e.panelView.children.add(c),c}({dropdownView:l,colors:s.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:0!==o?i("Document colors"):"",documentColorsCount:void 0===o?this.columns:o,colorPickerViewConfig:!!a&&(r.colorPicker||{})});return h.bind("selectedColor").to(n,"value"),l.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),l.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),l.bind("isEnabled").to(n),h.on("execute",((t,i)=>{l.isOpen&&e.execute(this.commandName,{value:i.value,batch:this._undoStepBatch}),"colorPicker"!==i.source&&e.editing.view.focus(),"colorPickerSaveButton"===i.source&&(l.isOpen=!1)})),h.on("colorPicker:show",(()=>{this._undoStepBatch=e.model.createBatch()})),h.on("colorPicker:cancel",(()=>{this._undoStepBatch.operations.length&&(l.isOpen=!1,e.execute("undo",this._undoStepBatch)),e.editing.view.focus()})),l.on("change:isOpen",((t,i,n)=>{c||(c=!0,l.colorSelectorView.appendUI()),n&&(0!==o&&h.updateDocumentColors(e.model,this.componentName),h.updateSelectedColors(),h.showColorGridsFragment())})),Sf(l,(()=>l.colorSelectorView.colorGridsFragmentView.staticColorsGrid.items.find((e=>e.isOn)))),l})),e.ui.componentFactory.add(`menuBar:${this.componentName}`,(t=>{const r=new Hp(t);r.buttonView.set({label:this.dropdownLabel,icon:this.icon}),r.bind("isEnabled").to(n);let a=!1;const l=new $f(t,{colors:s.map((e=>({label:e.label,color:e.model,options:{hasBorder:e.hasBorder}}))),columns:this.columns,removeButtonLabel:i("Remove color"),colorPickerLabel:i("Color picker"),documentColorsLabel:0!==o?i("Document colors"):"",documentColorsCount:void 0===o?this.columns:o,colorPickerViewConfig:!1});return l.bind("selectedColor").to(n,"value"),l.delegate("execute").to(r),l.on("execute",((t,i)=>{e.execute(this.commandName,{value:i.value,batch:this._undoStepBatch}),e.editing.view.focus()})),r.on("change:isOpen",((t,i,n)=>{a||(a=!0,l.appendUI()),n&&(0!==o&&l.updateDocumentColors(e.model,this.componentName),l.updateSelectedColors(),l.showColorGridsFragment())})),r.panelView.children.add(l),r}))}}class Ay extends xy{constructor(e){const t=e.locale.t;super(e,{commandName:ey,componentName:ey,icon:'',dropdownLabel:t("Font Color")})}static get pluginName(){return"FontColorUI"}}class Ty extends yu{static get requires(){return[Cy,Ay]}static get pluginName(){return"FontColor"}static get isOfficialPlugin(){return!0}}class Ey extends Qv{constructor(e){super(e,ty)}}class Sy extends yu{static get pluginName(){return"FontBackgroundColorEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define(ty,{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),e.data.addStyleProcessorRules(Qd),e.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:ty,value:ny("background-color")}}),e.conversion.for("downcast").attributeToElement({model:ty,view:ry("background-color")}),e.commands.add(ty,new Ey(e)),e.model.schema.extend("$text",{allowAttributes:ty}),e.model.schema.setAttributeProperties(ty,{isFormatting:!0,copyOnEnter:!0})}}class Py extends xy{constructor(e){const t=e.locale.t;super(e,{commandName:ty,componentName:ty,icon:'',dropdownLabel:t("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class Iy extends yu{static get requires(){return[Sy,Py]}static get pluginName(){return"FontBackgroundColor"}static get isOfficialPlugin(){return!0}}class Vy extends Cu{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){const e=this.editor.model,t=es(e.document.selection.getSelectedBlocks());this.value=!!t&&t.is("element","paragraph"),this.isEnabled=!!t&&Ry(t,e.schema)}execute(e={}){const t=this.editor.model,i=t.document,n=e.selection||i.selection;t.canEditAt(n)&&t.change((e=>{const i=n.getSelectedBlocks();for(const n of i)!n.is("element","paragraph")&&Ry(n,t.schema)&&e.rename(n,"paragraph")}))}}function Ry(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}class By extends Cu{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){const t=this.editor.model,i=e.attributes;let n=e.position;return t.canEditAt(n)?t.change((e=>{if(n=this._findPositionToInsertParagraph(n,e),!n)return null;const r=e.createElement("paragraph");return i&&t.schema.setAllowedAttributes(r,i,e),t.insertContent(r,n),e.setSelection(r,"in"),e.createPositionAt(r,0)})):null}_findPositionToInsertParagraph(e,t){const i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;const n=i.schema.findAllowedParent(e,"paragraph");if(!n)return null;const r=e.parent,s=i.schema.checkChild(r,"$text");return r.isEmpty||s&&e.isAtEnd?i.createPositionAfter(r):!r.isEmpty&&s&&e.isAtStart?i.createPositionBefore(r):t.split(e,n).position}}class Oy extends yu{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model;e.commands.add("paragraph",new Vy(e)),e.commands.add("insertParagraph",new By(e)),t.schema.register("paragraph",{inheritAllFrom:"$block"}),e.conversion.elementToElement({model:"paragraph",view:"p"}),e.conversion.for("upcast").elementToElement({model:(e,{writer:t})=>Oy.paragraphLikeElements.has(e.name)?e.isEmpty?null:t.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])}class Fy extends Cu{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){const e=es(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some((t=>My(e,t,this.editor.model.schema)))}execute(e){const t=this.editor.model,i=t.document,n=e.value;t.change((e=>{const r=Array.from(i.selection.getSelectedBlocks()).filter((e=>My(e,n,t.schema)));for(const t of r)t.is("element",n)||e.rename(t,n)}))}}function My(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}const Ny="paragraph";class Ly extends yu{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Oy]}init(){const e=this.editor,t=e.config.get("heading.options"),i=[];for(const n of t)"paragraph"!==n.model&&(e.model.schema.register(n.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(n),i.push(n.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new Fy(e,i))}afterInit(){const e=this.editor,t=e.commands.get("enter"),i=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",((t,n)=>{const r=e.model.document.selection.getFirstPosition().parent;i.some((e=>r.is("element",e.model)))&&!r.is("element",Ny)&&0===r.childCount&&n.writer.rename(r,Ny)}))}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:dn.low+1})}}function Dy(e){const t=e.t,i={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map((e=>{const t=i[e.title];return t&&t!=e.title&&(e.title=t),e}))}class zy extends yu{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.t,i=Dy(e),n=t("Choose heading"),r=t("Heading");e.ui.componentFactory.add("heading",(t=>{const s={},o=new Xr,a=e.commands.get("heading"),l=e.commands.get("paragraph"),c=[a];for(const e of i){const t={type:"button",model:new Rp({label:e.title,class:e.class,role:"menuitemradio",withText:!0})};"paragraph"===e.model?(t.model.bind("isOn").to(l,"value"),t.model.set("commandName","paragraph"),c.push(l)):(t.model.bind("isOn").to(a,"value",(t=>t===e.model)),t.model.set({commandName:"heading",commandValue:e.model})),o.add(t),s[e.model]=e.title}const h=Cf(t);return Tf(h,o,{ariaLabel:r,role:"menu"}),h.buttonView.set({ariaLabel:r,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:r}),h.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),h.bind("isEnabled").toMany(c,"isEnabled",((...e)=>e.some((e=>e)))),h.buttonView.bind("label").to(a,"value",l,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?n:s[i]?s[i]:n})),h.buttonView.bind("ariaLabel").to(a,"value",l,"value",((e,t)=>{const i=t?"paragraph":e;return"boolean"==typeof i?r:s[i]?`${s[i]}, ${r}`:r})),this.listenTo(h,"execute",(t=>{const{commandName:i,commandValue:n}=t.source;e.execute(i,n?{value:n}:void 0),e.editing.view.focus()})),h})),e.ui.componentFactory.add("menuBar:heading",(n=>{const r=new Hp(n),s=e.commands.get("heading"),o=e.commands.get("paragraph"),a=[s],l=new Wp(n);r.set({class:"ck-heading-dropdown"}),l.set({ariaLabel:t("Heading"),role:"menu"}),r.buttonView.set({label:t("Heading")}),r.panelView.children.add(l);for(const t of i){const i=new cp(n,r),c=new Ig(n);i.children.add(c),l.items.add(i),c.set({isToggleable:!0,label:t.title,role:"menuitemradio",class:t.class}),c.delegate("execute").to(r),c.on("execute",(()=>{const i="paragraph"===t.model?"paragraph":"heading";e.execute(i,{value:t.model}),e.editing.view.focus()})),"paragraph"===t.model?(c.bind("isOn").to(o,"value"),a.push(o)):c.bind("isOn").to(s,"value",(e=>e===t.model))}return r.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),r}))}}new Set(["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"]);class Hy extends Cu{refresh(){const e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=function(e,t,i){const n=function(e,t){const i=Zb(e,t),n=i.start.parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(e,i);return t.checkChild(n,"horizontalLine")}(i,t,e)}execute(){const e=this.editor.model;e.change((t=>{const i=t.createElement("horizontalLine");e.insertObject(i,null,null,{setSelection:"after"})}))}}class Wy extends yu{static get pluginName(){return"HorizontalLineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.model.schema,i=e.t,n=e.conversion;t.register("horizontalLine",{inheritAllFrom:"$blockObject"}),n.for("dataDowncast").elementToElement({model:"horizontalLine",view:(e,{writer:t})=>t.createEmptyElement("hr")}),n.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(e,{writer:t})=>{const n=i("Horizontal line"),r=t.createContainerElement("div",null,t.createEmptyElement("hr"));return t.addClass("ck-horizontal-line",r),t.setCustomProperty("hr",!0,r),function(e,t,i){return t.setCustomProperty("horizontalLine",!0,e),Ub(e,t,{label:i})}(r,t,n)}}),n.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),e.commands.add("horizontalLine",new Hy(e))}}class $y extends yu{static get pluginName(){return"HorizontalLineUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("horizontalLine",(()=>{const e=this._createButton(cg);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:horizontalLine",(()=>this._createButton(Ig)))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("horizontalLine"),r=new e(t.locale),s=i.t;return r.set({label:s("Horizontal line"),icon:Uu.horizontalLine}),r.bind("isEnabled").to(n,"isEnabled"),this.listenTo(r,"execute",(()=>{t.execute("horizontalLine"),t.editing.view.focus()})),r}}const Uy=function(e,t,i,n){var r=-1,s=null==e?0:e.length;for(n&&s&&(i=e[++r]);++r=n?e:Ds(e,t,i)};var Tk=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const Ek=function(e){return Tk.test(e)};const Sk=function(e){return e.split("")};var Pk="\\ud800-\\udfff",Ik="["+Pk+"]",Vk="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Rk="\\ud83c[\\udffb-\\udfff]",Bk="[^"+Pk+"]",Ok="(?:\\ud83c[\\udde6-\\uddff]){2}",Fk="[\\ud800-\\udbff][\\udc00-\\udfff]",Mk="(?:"+Vk+"|"+Rk+")"+"?",Nk="[\\ufe0e\\ufe0f]?",Lk=Nk+Mk+("(?:\\u200d(?:"+[Bk,Ok,Fk].join("|")+")"+Nk+Mk+")*"),Dk="(?:"+[Bk+Vk+"?",Vk,Ok,Fk,Ik].join("|")+")",zk=RegExp(Rk+"(?="+Rk+")|"+Dk+Lk,"g");const Hk=function(e){return e.match(zk)||[]};const Wk=function(e){return Ek(e)?Hk(e):Sk(e)};const $k=function(e){return function(t){t=Is(t);var i=Ek(t)?Wk(t):void 0,n=i?i[0]:t.charAt(0),r=i?Ak(i,1).join(""):t.slice(1);return n[e]()+r}}("toUpperCase");const Uk=xk((function(e,t,i){return e+(i?" ":"")+$k(t)}));const jk=Wi((function(e,t,i,n){Ii(e,t,i,n)}));function qk(e,t,i,n){t&&function(e,t,i){if(t.attributes)for(const[n]of Object.entries(t.attributes))e.removeAttribute(n,i);if(t.styles)for(const n of Object.keys(t.styles))e.removeStyle(n,i);t.classes&&e.removeClass(t.classes,i)}(e,t,n),i&&Gk(e,i,n)}function Gk(e,t,i){if(t.attributes)for(const[n,r]of Object.entries(t.attributes))e.setAttribute(n,r,i);t.styles&&e.setStyle(t.styles,i),t.classes&&e.addClass(t.classes,i)}function Kk(e,t,i,n,r){const s=t.getAttribute(i),o={};for(const e of["attributes","styles","classes"]){if(e!=n){s&&s[e]&&(o[e]=s[e]);continue}if("classes"==n){const t=new Set(s&&s.classes||[]);r(t),t.size&&(o[e]=Array.from(t));continue}const t=new Map(Object.entries(s&&s[e]||{}));r(t),t.size&&(o[e]=Object.fromEntries(t))}Object.keys(o).length?t.is("documentSelection")?e.setSelectionAttribute(i,o):e.setAttribute(i,o,t):s&&(t.is("documentSelection")?e.removeSelectionAttribute(i):e.removeAttribute(i,t))}function Zk(e){return`html${t=e,Uk(t).replace(/ /g,"")}Attributes`;var t}function Jk({model:e}){return(t,i)=>i.writer.createElement(e,{htmlContent:t.getCustomProperty("$rawContent")})}function Qk(e,{view:t,isInline:i}){const n=e.t;return(e,{writer:r})=>{const s=n("HTML object"),o=Yk(t,e,r),a=e.getAttribute(Zk(t));r.addClass("html-object-embed__content",o),a&&Gk(r,a,o);return Ub(r.createContainerElement(i?"span":"div",{class:"html-object-embed","data-html-object-embed-label":s},o),r,{label:s})}}function Yk(e,t,i){return i.createRawElement(e,null,((e,i)=>{i.setContentOf(e,t.getAttribute("htmlContent"))}))}function Xk({view:e,model:t,allowEmpty:i},n){return t=>{t.on(`element:${e}`,((e,t,s)=>{let o=n.processViewAttributes(t.viewItem,s);if(o||s.consumable.test(t.viewItem,{name:!0})){if(o=o||{},s.consumable.consume(t.viewItem,{name:!0}),t.modelRange||(t=Object.assign(t,s.convertChildren(t.viewItem,t.modelCursor))),i&&t.modelRange.isCollapsed&&Object.keys(o).length){const e=s.writer.createElement("htmlEmptyElement");if(!s.safeInsert(e,t.modelCursor))return;const i=s.getSplitParts(e);return t.modelRange=s.writer.createRange(t.modelRange.start,s.writer.createPositionAfter(i[i.length-1])),s.updateConversionResult(e,t),void r(e,o,s)}for(const e of t.modelRange.getItems())r(e,o,s)}}),{priority:"low"})};function r(e,i,n){if(n.schema.checkAttribute(e,t)){const r=function(e,t){const i=Ao(e);let n="attributes";for(n in t)i[n]="classes"==n?Array.from(new Set([...e[n]||[],...t[n]])):{...e[n],...t[n]};return i}(i,e.getAttribute(t)||{});n.writer.setAttribute(t,r,e)}}}function eC({model:e,view:t},i){return(n,{writer:r,consumable:s})=>{if(!n.hasAttribute(e))return null;const o=r.createContainerElement(t),a=n.getAttribute(e);return s.consume(n,`attribute:${e}`),Gk(r,a,o),o.getFillerOffset=()=>null,i?Ub(o,r):o}}function tC({priority:e,view:t}){return(i,n)=>{if(!i)return;const{writer:r}=n,s=r.createAttributeElement(t,null,{priority:e});return Gk(r,i,s),s}}function iC({view:e},t){return i=>{i.on(`element:${e}`,((e,i,n)=>{if(!i.modelRange||i.modelRange.isCollapsed)return;const r=t.processViewAttributes(i.viewItem,n);r&&n.writer.setAttribute(Zk(i.viewItem.name),r,i.modelRange)}),{priority:"low"})}}function nC({view:e,model:t}){return i=>{i.on(`attribute:${Zk(e)}:${t}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:n,attributeNewValue:r}=t;qk(i.writer,n,r,i.mapper.toViewElement(t.item))}))}}var rC=[{model:"codeBlock",view:"pre"},{model:"paragraph",view:"p"},{model:"blockQuote",view:"blockquote"},{model:"listItem",view:"li"},{model:"pageBreak",view:"div"},{model:"rawHtml",view:"div"},{model:"table",view:"table"},{model:"tableRow",view:"tr"},{model:"tableCell",view:"td"},{model:"tableCell",view:"th"},{model:"tableColumnGroup",view:"colgroup"},{model:"tableColumn",view:"col"},{model:"caption",view:"caption"},{model:"caption",view:"figcaption"},{model:"imageBlock",view:"img"},{model:"imageInline",view:"img"},{model:"htmlP",view:"p",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlBlockquote",view:"blockquote",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlTable",view:"table",modelSchema:{allowWhere:"$block",isBlock:!0}},{model:"htmlTbody",view:"tbody",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlThead",view:"thead",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlTfoot",view:"tfoot",modelSchema:{allowIn:"htmlTable",isBlock:!1}},{model:"htmlCaption",view:"caption",modelSchema:{allowIn:"htmlTable",allowChildren:"$text",isBlock:!1}},{model:"htmlColgroup",view:"colgroup",modelSchema:{allowIn:"htmlTable",allowChildren:"col",isBlock:!1}},{model:"htmlCol",view:"col",modelSchema:{allowIn:"htmlColgroup",isBlock:!1}},{model:"htmlTr",view:"tr",modelSchema:{allowIn:["htmlTable","htmlThead","htmlTbody"],isLimit:!0}},{model:"htmlTd",view:"td",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlTh",view:"th",modelSchema:{allowIn:"htmlTr",allowContentOf:"$container",isLimit:!0,isBlock:!1}},{model:"htmlFigure",view:"figure",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFigcaption",view:"figcaption",modelSchema:{allowIn:"htmlFigure",allowChildren:"$text",isBlock:!1}},{model:"htmlAddress",view:"address",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlAside",view:"aside",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlMain",view:"main",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDetails",view:"details",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSummary",view:"summary",modelSchema:{allowChildren:["htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6","$text"],allowIn:"htmlDetails",isBlock:!1}},{model:"htmlDiv",view:"div",paragraphLikeModel:"htmlDivParagraph",modelSchema:{inheritAllFrom:"$container"}},{model:"htmlFieldset",view:"fieldset",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlLegend",view:"legend",modelSchema:{allowIn:"htmlFieldset",allowChildren:"$text"}},{model:"htmlHeader",view:"header",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlFooter",view:"footer",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlForm",view:"form",modelSchema:{inheritAllFrom:"$container",isBlock:!0}},{model:"htmlHgroup",view:"hgroup",modelSchema:{allowIn:["$root","$container"],allowChildren:["paragraph","htmlP","htmlH1","htmlH2","htmlH3","htmlH4","htmlH5","htmlH6"],isBlock:!1}},{model:"htmlH1",view:"h1",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH2",view:"h2",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH3",view:"h3",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH4",view:"h4",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH5",view:"h5",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlH6",view:"h6",modelSchema:{inheritAllFrom:"$block"}},{model:"$htmlList",modelSchema:{allowWhere:"$container",allowChildren:["$htmlList","htmlLi"],isBlock:!1}},{model:"htmlDir",view:"dir",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlMenu",view:"menu",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlUl",view:"ul",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlOl",view:"ol",modelSchema:{inheritAllFrom:"$htmlList"}},{model:"htmlLi",view:"li",modelSchema:{allowIn:"$htmlList",allowChildren:"$text",isBlock:!1}},{model:"htmlPre",view:"pre",modelSchema:{inheritAllFrom:"$block"}},{model:"htmlArticle",view:"article",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlSection",view:"section",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlNav",view:"nav",modelSchema:{inheritAllFrom:"$container",isBlock:!1}},{model:"htmlDivDl",view:"div",modelSchema:{allowChildren:["htmlDt","htmlDd"],allowIn:"htmlDl"}},{model:"htmlDl",view:"dl",modelSchema:{allowWhere:"$container",allowChildren:["htmlDt","htmlDd","htmlDivDl"],isBlock:!1}},{model:"htmlDt",view:"dt",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlDd",view:"dd",modelSchema:{allowChildren:"$block",isBlock:!1}},{model:"htmlCenter",view:"center",modelSchema:{inheritAllFrom:"$container",isBlock:!1}}],sC=[{model:"htmlLiAttributes",view:"li",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlOlAttributes",view:"ol",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlUlAttributes",view:"ul",appliesToBlock:!0,coupledAttribute:"listItemId"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"table"},{model:"htmlTheadAttributes",view:"thead",appliesToBlock:"table"},{model:"htmlTbodyAttributes",view:"tbody",appliesToBlock:"table"},{model:"htmlFigureAttributes",view:"figure",appliesToBlock:"imageBlock"},{model:"htmlAcronym",view:"acronym",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTt",view:"tt",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlFont",view:"font",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlTime",view:"time",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlVar",view:"var",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBig",view:"big",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSmall",view:"small",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSamp",view:"samp",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlQ",view:"q",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlOutput",view:"output",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlKbd",view:"kbd",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdi",view:"bdi",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlBdo",view:"bdo",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlAbbr",view:"abbr",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlA",view:"a",priority:5,coupledAttribute:"linkHref"},{model:"htmlStrong",view:"strong",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlB",view:"b",coupledAttribute:"bold",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlI",view:"i",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlEm",view:"em",coupledAttribute:"italic",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlS",view:"s",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDel",view:"del",coupledAttribute:"strikethrough",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlIns",view:"ins",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlU",view:"u",coupledAttribute:"underline",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSub",view:"sub",coupledAttribute:"subscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSup",view:"sup",coupledAttribute:"superscript",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCode",view:"code",coupledAttribute:"code",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlMark",view:"mark",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlSpan",view:"span",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlCite",view:"cite",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlLabel",view:"label",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlDfn",view:"dfn",attributeProperties:{copyOnEnter:!0,isFormatting:!0}},{model:"htmlObject",view:"object",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlIframe",view:"iframe",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlInput",view:"input",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlButton",view:"button",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlTextarea",view:"textarea",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlSelect",view:"select",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlVideo",view:"video",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlEmbed",view:"embed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlOembed",view:"oembed",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlAudio",view:"audio",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlImg",view:"img",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlCanvas",view:"canvas",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlMeter",view:"meter",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlProgress",view:"progress",isObject:!0,modelSchema:{inheritAllFrom:"$inlineObject"}},{model:"htmlScript",view:"script",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlStyle",view:"style",modelSchema:{allowWhere:["$text","$block"],isInline:!0}},{model:"htmlCustomElement",view:"$customElement",modelSchema:{allowWhere:["$text","$block"],allowAttributesOf:"$inlineObject",isInline:!0}}];class oC extends yu{_definitions=[];static get pluginName(){return"DataSchema"}static get isOfficialPlugin(){return!0}init(){for(const e of rC)this.registerBlockElement(e);for(const e of sC)this.registerInlineElement(e)}registerBlockElement(e){this._definitions.push({...e,isBlock:!0})}registerInlineElement(e){this._definitions.push({...e,isInline:!0})}extendBlockElement(e){this._extendDefinition({...e,isBlock:!0})}extendInlineElement(e){this._extendDefinition({...e,isInline:!0})}getDefinitionsForView(e,t=!1){const i=new Set;for(const n of this._getMatchingViewDefinitions(e)){if(t)for(const e of this._getReferences(n.model))i.add(e);i.add(n)}return i}getDefinitionsForModel(e){return this._definitions.filter((t=>t.model==e))}_getMatchingViewDefinitions(e){return this._definitions.filter((t=>t.view&&function(e,t){if("string"==typeof e)return e===t;if(e instanceof RegExp)return e.test(t);return!1}(e,t.view)))}*_getReferences(e){const t=["inheritAllFrom","inheritTypesFrom","allowWhere","allowContentOf","allowAttributesOf"],i=this._definitions.filter((t=>t.model==e));for(const{modelSchema:n}of i)if(n)for(const i of t)for(const t of Jr(n[i]||[])){const i=this._definitions.filter((e=>e.model==t));for(const n of i)t!==e&&(yield*this._getReferences(n.model),yield n)}}_extendDefinition(e){const t=Array.from(this._definitions.entries()).filter((([,t])=>t.model==e.model));if(0!=t.length)for(const[i,n]of t)this._definitions[i]=jk({},n,e,((e,t)=>Array.isArray(e)?e.concat(t):void 0));else this._definitions.push(e)}}class aC extends yu{_dataSchema;_allowedAttributes;_disallowedAttributes;_allowedElements;_disallowedElements;_dataInitialized;_coupledAttributes;constructor(e){super(e),this._dataSchema=e.plugins.get("DataSchema"),this._allowedAttributes=new Lo,this._disallowedAttributes=new Lo,this._allowedElements=new Set,this._disallowedElements=new Set,this._dataInitialized=!1,this._coupledAttributes=null,this._registerElementsAfterInit(),this._registerElementHandlers(),this._registerCoupledAttributesPostFixer(),this._registerAssociatedHtmlAttributesPostFixer()}static get pluginName(){return"DataFilter"}static get isOfficialPlugin(){return!0}static get requires(){return[oC,l_]}loadAllowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=uC(t);this.allowElement(e),i.forEach((e=>this.allowAttributes(e)))}}loadDisallowedConfig(e){for(const t of e){const e=t.name||/[\s\S]+/,i=uC(t);0==i.length?this.disallowElement(e):i.forEach((e=>this.disallowAttributes(e)))}}loadAllowedEmptyElementsConfig(e){for(const t of e)this.allowEmptyElement(t)}allowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))this._addAllowedElement(t),this._coupledAttributes=null}disallowElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!1))this._disallowedElements.add(t.view)}allowEmptyElement(e){for(const t of this._dataSchema.getDefinitionsForView(e,!0))t.isInline&&this._dataSchema.extendInlineElement({...t,allowEmpty:!0})}allowAttributes(e){this._allowedAttributes.add(e)}disallowAttributes(e){this._disallowedAttributes.add(e)}processViewAttributes(e,t){const{consumable:i}=t;return lC(e,this._disallowedAttributes,i),function(e,{attributes:t,classes:i,styles:n}){if(!t.length&&!i.length&&!n.length)return null;return{...t.length&&{attributes:cC(e,t)},...n.length&&{styles:hC(e,n)},...i.length&&{classes:i}}}(e,lC(e,this._allowedAttributes,i))}_addAllowedElement(e){if(!this._allowedElements.has(e)){if(this._allowedElements.add(e),"appliesToBlock"in e&&"string"==typeof e.appliesToBlock)for(const t of this._dataSchema.getDefinitionsForModel(e.appliesToBlock))t.isBlock&&this._addAllowedElement(t);this._dataInitialized&&this.editor.data.once("set",(()=>{this._fireRegisterEvent(e)}),{priority:dn.highest+1})}}_registerElementsAfterInit(){this.editor.data.on("init",(()=>{this._dataInitialized=!0;for(const e of this._allowedElements)this._fireRegisterEvent(e)}),{priority:dn.highest+1})}_registerElementHandlers(){this.on("register",((e,t)=>{const i=this.editor.model.schema;if(t.isObject&&!i.isRegistered(t.model))this._registerObjectElement(t);else if(t.isBlock)this._registerBlockElement(t);else{if(!t.isInline)throw new gn("data-filter-invalid-definition",null,t);this._registerInlineElement(t)}e.stop()}),{priority:"lowest"})}_registerCoupledAttributesPostFixer(){const e=this.editor.model,t=e.document.selection;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges();let n=!1;const r=this._getCoupledAttributesMap();for(const e of i){if("attribute"!=e.type||null!==e.attributeNewValue)continue;const i=r.get(e.attributeKey);if(i)for(const{item:r}of e.range.getWalker())for(const e of i)r.hasAttribute(e)&&(t.removeAttribute(e,r),n=!0)}return n})),this.listenTo(t,"change:attribute",((i,{attributeKeys:n})=>{const r=new Set,s=this._getCoupledAttributesMap();for(const e of n){if(t.hasAttribute(e))continue;const i=s.get(e);if(i)for(const e of i)t.hasAttribute(e)&&r.add(e)}0!=r.size&&e.change((e=>{for(const t of r)e.removeSelectionAttribute(t)}))}))}_registerAssociatedHtmlAttributesPostFixer(){const e=this.editor.model;e.document.registerPostFixer((t=>{const i=e.document.differ.getChanges();let n=!1;for(const r of i)if("insert"===r.type&&"$text"!==r.name)for(const i of r.attributes.keys())i.startsWith("html")&&i.endsWith("Attributes")&&(e.schema.checkAttribute(r.name,i)||(t.removeAttribute(i,r.position.nodeAfter),n=!0));return n}))}_getCoupledAttributesMap(){if(this._coupledAttributes)return this._coupledAttributes;this._coupledAttributes=new Map;for(const e of this._allowedElements)if(e.coupledAttribute&&e.model){const t=this._coupledAttributes.get(e.coupledAttribute);t?t.push(e.model):this._coupledAttributes.set(e.coupledAttribute,[e.model])}return this._coupledAttributes}_fireRegisterEvent(e){e.view&&this._disallowedElements.has(e.view)||this.fire(e.view?`register:${e.view}`:"register",e)}_registerObjectElement(e){const t=this.editor,i=t.model.schema,n=t.conversion,{view:r,model:s}=e;i.register(s,e.modelSchema),r&&(i.extend(e.model,{allowAttributes:[Zk(r),"htmlContent"]}),t.data.registerRawContentMatcher({name:r}),n.for("upcast").elementToElement({view:r,model:Jk(e),converterPriority:dn.low+2}),n.for("upcast").add(iC(e,this)),n.for("editingDowncast").elementToStructure({model:{name:s,attributes:[Zk(r)]},view:Qk(t,e)}),n.for("dataDowncast").elementToElement({model:s,view:(e,{writer:t})=>Yk(r,e,t)}),n.for("dataDowncast").add(nC(e)))}_registerBlockElement(e){const t=this.editor,i=t.model.schema,n=t.conversion,{view:r,model:s}=e;if(!i.isRegistered(e.model)){if(i.register(e.model,e.modelSchema),!r)return;n.for("upcast").elementToElement({model:s,view:r,converterPriority:dn.low+2}),n.for("downcast").elementToElement({model:s,view:r})}r&&(i.extend(e.model,{allowAttributes:Zk(r)}),n.for("upcast").add(iC(e,this)),n.for("downcast").add(nC(e)))}_registerInlineElement(e){const t=this.editor,i=t.model.schema,n=t.conversion,r=e.model;e.appliesToBlock||(i.extend("$text",{allowAttributes:r}),e.attributeProperties&&i.setAttributeProperties(r,e.attributeProperties),n.for("upcast").add(Xk(e,this)),n.for("downcast").attributeToElement({model:r,view:tC(e)}),e.allowEmpty&&(i.setAttributeProperties(r,{copyFromObject:!1}),i.isRegistered("htmlEmptyElement")||i.register("htmlEmptyElement",{inheritAllFrom:"$inlineObject"}),t.data.htmlProcessor.domConverter.registerInlineObjectMatcher((t=>t.name==e.view&&t.isEmpty&&Array.from(t.getAttributeKeys()).length?{name:!0}:null)),n.for("editingDowncast").elementToElement({model:"htmlEmptyElement",view:eC(e,!0)}),n.for("dataDowncast").elementToElement({model:"htmlEmptyElement",view:eC(e)})))}}function lC(e,t,i){const n=t.matchAll(e)||[],r=e.document.stylesProcessor;return n.reduce(((t,{match:n})=>{for(const s of n.styles||[]){const n=r.getRelatedStyles(s).filter((e=>e.split("-").length>s.split("-").length)).sort(((e,t)=>t.split("-").length-e.split("-").length));for(const r of n)i.consume(e,{styles:[r]})&&t.styles.push(r);i.consume(e,{styles:[s]})&&t.styles.push(s)}for(const r of n.classes||[])i.consume(e,{classes:[r]})&&t.classes.push(r);for(const r of n.attributes||[])i.consume(e,{attributes:[r]})&&t.attributes.push(r);return t}),{attributes:[],classes:[],styles:[]})}function cC(e,t){const i={};for(const n of t){const t=e.getAttribute(n);void 0!==t&&kr(n)&&(i[n]=t)}return i}function hC(e,t){const i=new Ho(e.document.stylesProcessor);for(const n of t){const t=e.getStyle(n);void 0!==t&&i.set(n,t)}return Object.fromEntries(i.getStylesEntries())}function dC(e,t){const{name:i}=e,n=e[t];return T(n)?Object.entries(n).map((([e,n])=>({name:i,[t]:{[e]:n}}))):Array.isArray(n)?n.map((e=>({name:i,[t]:[e]}))):[e]}function uC(e){const{name:t,attributes:i,classes:n,styles:r}=e,s=[];return i&&s.push(...dC({name:t,attributes:i},"attributes")),n&&s.push(...dC({name:t,classes:n},"classes")),r&&s.push(...dC({name:t,styles:r},"styles")),s}class mC extends yu{static get requires(){return[aC]}static get pluginName(){return"CodeBlockElementSupport"}static get isOfficialPlugin(){return!0}init(){if(!this.editor.plugins.has("CodeBlockEditing"))return;const e=this.editor.plugins.get(aC);e.on("register:pre",((t,i)=>{if("codeBlock"!==i.model)return;const n=this.editor,r=n.model.schema,s=n.conversion;r.extend("codeBlock",{allowAttributes:["htmlPreAttributes","htmlContentAttributes"]}),s.for("upcast").add(function(e){return t=>{t.on("element:code",((t,i,n)=>{const r=i.viewItem,s=r.parent;function o(t,r){const s=e.processViewAttributes(t,n);s&&n.writer.setAttribute(r,s,i.modelRange)}s&&s.is("element","pre")&&(o(s,"htmlPreAttributes"),o(r,"htmlContentAttributes"))}),{priority:"low"})}}(e)),s.for("downcast").add((e=>{e.on("attribute:htmlPreAttributes:codeBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:n,attributeNewValue:r}=t,s=i.mapper.toViewElement(t.item).parent;qk(i.writer,n,r,s)})),e.on("attribute:htmlContentAttributes:codeBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:n,attributeNewValue:r}=t,s=i.mapper.toViewElement(t.item);qk(i.writer,n,r,s)}))})),t.stop()}))}}class gC extends yu{static get requires(){return[aC]}static get pluginName(){return"DualContentModelElementSupport"}static get isOfficialPlugin(){return!0}init(){this.editor.plugins.get(aC).on("register",((e,t)=>{const i=t,n=this.editor,r=n.model.schema,s=n.conversion;if(!i.paragraphLikeModel)return;if(r.isRegistered(i.model)||r.isRegistered(i.paragraphLikeModel))return;const o={model:i.paragraphLikeModel,view:i.view};r.register(i.model,i.modelSchema),r.register(o.model,{inheritAllFrom:"$block"}),s.for("upcast").elementToElement({view:i.view,model:(e,{writer:t})=>this._hasBlockContent(e)?t.createElement(i.model):t.createElement(o.model),converterPriority:dn.low+.5}),s.for("downcast").elementToElement({view:i.view,model:i.model}),this._addAttributeConversion(i),s.for("downcast").elementToElement({view:o.view,model:o.model}),this._addAttributeConversion(o),e.stop()}))}_hasBlockContent(e){const t=this.editor.editing.view,i=t.domConverter.blockElements;for(const n of t.createRangeIn(e).getItems())if(n.is("element")&&i.includes(n.name))return!0;return!1}_addAttributeConversion(e){const t=this.editor,i=t.conversion,n=t.plugins.get(aC);t.model.schema.extend(e.model,{allowAttributes:Zk(e.view)}),i.for("upcast").add(iC(e,n)),i.for("downcast").add(nC(e))}}class fC extends yu{static get requires(){return[oC,Ab]}static get pluginName(){return"HeadingElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("HeadingEditing"))return;const t=e.config.get("heading.options");this.registerHeadingElements(e,t)}registerHeadingElements(e,t){const i=e.plugins.get(oC),n=[];for(const e of t)"model"in e&&"view"in e&&(i.registerBlockElement({view:e.view,model:e.model}),n.push(e.model));i.extendBlockElement({model:"htmlHgroup",modelSchema:{allowChildren:n}}),i.extendBlockElement({model:"htmlSummary",modelSchema:{allowChildren:n}})}}function pC(e,t,i){const n=e.createRangeOn(t);for(const{item:e}of n.getWalker())if(e.is("element",i))return e}class wC extends yu{static get requires(){return[aC]}static get pluginName(){return"ImageElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ImageInlineEditing")&&!e.plugins.has("ImageBlockEditing"))return;const t=e.model.schema,i=e.conversion,n=e.plugins.get(aC);n.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,n)=>{const r=i.viewItem;if(!i.modelRange||!r.hasClass("image"))return;const s=e.processViewAttributes(r,n);s&&n.writer.setAttribute("htmlFigureAttributes",s,i.modelRange)}),{priority:"low"})}}(n))})),n.on("register:img",((r,s)=>{"imageBlock"!==s.model&&"imageInline"!==s.model||(t.isRegistered("imageBlock")&&t.extend("imageBlock",{allowAttributes:["htmlImgAttributes","htmlFigureAttributes","htmlLinkAttributes"]}),t.isRegistered("imageInline")&&t.extend("imageInline",{allowAttributes:["htmlA","htmlImgAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:img",((t,i,n)=>{if(!i.modelRange)return;const r=i.viewItem,s=e.processViewAttributes(r,n);s&&n.writer.setAttribute("htmlImgAttributes",s,i.modelRange)}),{priority:"low"})}}(n)),i.for("downcast").add((e=>{function t(t){e.on(`attribute:${t}:imageInline`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const{attributeOldValue:n,attributeNewValue:r}=t,s=i.mapper.toViewElement(t.item);qk(i.writer,n,r,s)}),{priority:"low"})}function i(t,i){e.on(`attribute:${i}:imageBlock`,((e,i,n)=>{if(!n.consumable.test(i.item,e.name))return;const{attributeOldValue:r,attributeNewValue:s}=i,o=n.mapper.toViewElement(i.item),a=pC(n.writer,o,t);a&&(qk(n.writer,r,s,a),n.consumable.consume(i.item,e.name))}),{priority:"low"}),"a"===t&&e.on("attribute:linkHref:imageBlock",((e,t,i)=>{if(!i.consumable.consume(t.item,"attribute:htmlLinkAttributes:imageBlock"))return;const n=i.mapper.toViewElement(t.item),r=pC(i.writer,n,"a");Gk(i.writer,t.item.getAttribute("htmlLinkAttributes"),r)}),{priority:"low"})}t("htmlImgAttributes"),i("img","htmlImgAttributes"),i("figure","htmlFigureAttributes"),i("a","htmlLinkAttributes")})),e.plugins.has("LinkImage")&&i.for("upcast").add(function(e,t){const i=t.plugins.get("ImageUtils");return t=>{t.on("element:a",((t,n,r)=>{const s=n.viewItem;if(!i.findViewImgElement(s))return;const o=n.modelCursor.parent;if(!o.is("element","imageBlock"))return;const a=e.processViewAttributes(s,r);a&&r.writer.setAttribute("htmlLinkAttributes",a,o)}),{priority:"low"})}}(n,e)),r.stop())}))}}class bC extends yu{static get requires(){return[aC]}static get pluginName(){return"MediaEmbedElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("MediaEmbed")||e.config.get("mediaEmbed.previewsInData"))return;const t=e.model.schema,i=e.conversion,n=this.editor.plugins.get(aC),r=this.editor.plugins.get(oC),s=e.config.get("mediaEmbed.elementName");r.registerBlockElement({model:"media",view:s}),n.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,n)=>{const r=i.viewItem;if(!i.modelRange||!r.hasClass("media"))return;const s=e.processViewAttributes(r,n);s&&n.writer.setAttribute("htmlFigureAttributes",s,i.modelRange)}),{priority:"low"})}}(n))})),n.on(`register:${s}`,((e,r)=>{"media"===r.model&&(t.extend("media",{allowAttributes:[Zk(s),"htmlFigureAttributes"]}),i.for("upcast").add(function(e,t){const i=(i,n,r)=>{function s(t,i){const s=e.processViewAttributes(t,r);s&&r.writer.setAttribute(i,s,n.modelRange)}s(n.viewItem,Zk(t))};return e=>{e.on(`element:${t}`,i,{priority:"low"})}}(n,s)),i.for("dataDowncast").add(function(e){return t=>{function i(e,i){t.on(`attribute:${i}:media`,((t,i,n)=>{if(!n.consumable.consume(i.item,t.name))return;const{attributeOldValue:r,attributeNewValue:s}=i,o=n.mapper.toViewElement(i.item),a=pC(n.writer,o,e);qk(n.writer,r,s,a)}))}i(e,Zk(e)),i("figure","htmlFigureAttributes")}}(s)),e.stop())}))}}class _C extends yu{static get requires(){return[aC]}static get pluginName(){return"ScriptElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(aC);e.on("register:script",((t,i)=>{const n=this.editor,r=n.model.schema,s=n.conversion;r.register("htmlScript",i.modelSchema),r.extend("htmlScript",{allowAttributes:["htmlScriptAttributes","htmlContent"],isContent:!0}),n.data.registerRawContentMatcher({name:"script"}),s.for("upcast").elementToElement({view:"script",model:Jk(i)}),s.for("upcast").add(iC(i,e)),s.for("downcast").elementToElement({model:"htmlScript",view:(e,{writer:t})=>Yk("script",e,t)}),s.for("downcast").add(nC(i)),t.stop()}))}}class vC extends yu{static get requires(){return[aC]}static get pluginName(){return"TableElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("TableEditing"))return;const t=e.model.schema,i=e.conversion,n=e.plugins.get(aC),r=e.plugins.get("TableUtils");n.on("register:figure",(()=>{i.for("upcast").add(function(e){return t=>{t.on("element:figure",((t,i,n)=>{const r=i.viewItem;if(!i.modelRange||!r.hasClass("table"))return;const s=e.processViewAttributes(r,n);s&&n.writer.setAttribute("htmlFigureAttributes",s,i.modelRange)}),{priority:"low"})}}(n))})),n.on("register:table",((s,o)=>{"table"===o.model&&(t.extend("table",{allowAttributes:["htmlTableAttributes","htmlFigureAttributes","htmlTheadAttributes","htmlTbodyAttributes"]}),i.for("upcast").add(function(e){return t=>{t.on("element:table",((t,i,n)=>{if(!i.modelRange)return;const r=i.viewItem;s(r,"htmlTableAttributes");for(const e of r.getChildren())e.is("element","thead")&&s(e,"htmlTheadAttributes"),e.is("element","tbody")&&s(e,"htmlTbodyAttributes");function s(t,r){const s=e.processViewAttributes(t,n);s&&n.writer.setAttribute(r,s,i.modelRange)}}),{priority:"low"})}}(n)),i.for("downcast").add((e=>{function t(t,i){e.on(`attribute:${i}:table`,((e,i,n)=>{if(!n.consumable.test(i.item,e.name))return;const r=n.mapper.toViewElement(i.item),s=pC(n.writer,r,t);s&&(n.consumable.consume(i.item,e.name),qk(n.writer,i.attributeOldValue,i.attributeNewValue,s))}))}t("table","htmlTableAttributes"),t("figure","htmlFigureAttributes"),t("thead","htmlTheadAttributes"),t("tbody","htmlTbodyAttributes")})),e.model.document.registerPostFixer(function(e,t){return i=>{const n=e.document.differ.getChanges();let r=!1;for(const e of n){if("attribute"!=e.type||"headingRows"!=e.attributeKey)continue;const n=e.range.start.nodeAfter,s=n.getAttribute("htmlTheadAttributes"),o=n.getAttribute("htmlTbodyAttributes");s&&!e.attributeNewValue?(i.removeAttribute("htmlTheadAttributes",n),r=!0):o&&e.attributeNewValue==t.getRows(n)&&(i.removeAttribute("htmlTbodyAttributes",n),r=!0)}return r}}(e.model,r)),s.stop())}))}}class yC extends yu{static get requires(){return[aC]}static get pluginName(){return"StyleElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(aC);e.on("register:style",((t,i)=>{const n=this.editor,r=n.model.schema,s=n.conversion;r.register("htmlStyle",i.modelSchema),r.extend("htmlStyle",{allowAttributes:["htmlStyleAttributes","htmlContent"],isContent:!0}),n.data.registerRawContentMatcher({name:"style"}),s.for("upcast").elementToElement({view:"style",model:Jk(i)}),s.for("upcast").add(iC(i,e)),s.for("downcast").elementToElement({model:"htmlStyle",view:(e,{writer:t})=>Yk("style",e,t)}),s.for("downcast").add(nC(i)),t.stop()}))}}class kC extends yu{static get requires(){return[aC]}static get pluginName(){return"ListElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;if(!e.plugins.has("ListEditing"))return;const t=e.model.schema,i=e.conversion,n=e.plugins.get(aC),r=e.plugins.get("ListEditing"),s=e.plugins.get("ListUtils"),o=["ul","ol","li"];r.registerDowncastStrategy({scope:"item",attributeName:"htmlLiAttributes",setAttributeOnDowncast:Gk}),r.registerDowncastStrategy({scope:"list",attributeName:"htmlUlAttributes",setAttributeOnDowncast:Gk}),r.registerDowncastStrategy({scope:"list",attributeName:"htmlOlAttributes",setAttributeOnDowncast:Gk}),n.on("register",((e,r)=>{if(!o.includes(r.view))return;if(e.stop(),t.checkAttribute("$block","htmlLiAttributes"))return;const s=o.map((e=>Zk(e)));t.extend("$listItem",{allowAttributes:s}),i.for("upcast").add((e=>{e.on("element:ul",CC("htmlUlAttributes",n),{priority:"low"}),e.on("element:ol",CC("htmlOlAttributes",n),{priority:"low"}),e.on("element:li",CC("htmlLiAttributes",n),{priority:"low"})}))})),r.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:n,previousNodeInList:r}of t)if(r){if(r.getAttribute("listType")==n.getAttribute("listType")){const t=xC(r.getAttribute("listType")),s=r.getAttribute(t);!To(n.getAttribute(t),s)&&i.model.schema.checkAttribute(n,t)&&(i.setAttribute(t,s,n),e.return=!0)}if(r.getAttribute("listItemId")==n.getAttribute("listItemId")){const t=r.getAttribute("htmlLiAttributes");!To(n.getAttribute("htmlLiAttributes"),t)&&i.model.schema.checkAttribute(n,"htmlLiAttributes")&&(i.setAttribute("htmlLiAttributes",t,n),e.return=!0)}}})),r.on("postFixer",((e,{listNodes:t,writer:i})=>{for(const{node:n}of t){const t=n.getAttribute("listType");!s.isNumberedListType(t)&&n.getAttribute("htmlOlAttributes")&&(i.removeAttribute("htmlOlAttributes",n),e.return=!0),s.isNumberedListType(t)&&n.getAttribute("htmlUlAttributes")&&(i.removeAttribute("htmlUlAttributes",n),e.return=!0)}}))}afterInit(){const e=this.editor;if(!e.commands.get("indentList"))return;const t=e.commands.get("indentList");this.listenTo(t,"afterExecute",((t,i)=>{e.model.change((t=>{for(const n of i){const i=xC(n.getAttribute("listType"));e.model.schema.checkAttribute(n,i)&&t.setAttribute(i,{},n)}}))}))}}function CC(e,t){return(i,n,r)=>{const s=n.viewItem;n.modelRange||Object.assign(n,r.convertChildren(n.viewItem,n.modelCursor));const o=t.processViewAttributes(s,r);for(const t of n.modelRange.getItems({shallow:!0}))t.hasAttribute("listItemId")&&(t.hasAttribute("htmlUlAttributes")||t.hasAttribute("htmlOlAttributes")||r.writer.model.schema.checkAttribute(t,e)&&r.writer.setAttribute(e,o||{},t))}}function xC(e){return"numbered"===e||"customNumbered"==e?"htmlOlAttributes":"htmlUlAttributes"}class AC extends yu{static get requires(){return[aC,oC]}static get pluginName(){return"CustomElementSupport"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.plugins.get(aC),t=this.editor.plugins.get(oC);e.on("register:$customElement",((i,n)=>{i.stop();const r=this.editor,s=r.model.schema,o=r.conversion,a=r.editing.view.domConverter.unsafeElements,l=r.data.htmlProcessor.domConverter.preElements;s.register(n.model,n.modelSchema),s.extend(n.model,{allowAttributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"],isContent:!0}),r.data.htmlProcessor.domConverter.registerRawContentMatcher({name:"template"}),o.for("upcast").elementToElement({view:/.*/,model:(i,s)=>{if("$comment"==i.name)return null;if(!function(e){try{document.createElement(e)}catch(e){return!1}return!0}(i.name))return null;if(t.getDefinitionsForView(i.name).size)return null;a.includes(i.name)||a.push(i.name),l.includes(i.name)||l.push(i.name);const o=s.writer.createElement(n.model,{htmlElementName:i.name}),c=e.processViewAttributes(i,s);let h;if(c&&s.writer.setAttribute("htmlCustomElementAttributes",c,o),i.is("element","template")&&i.getCustomProperty("$rawContent"))h=i.getCustomProperty("$rawContent");else{const e=new Cd(i.document).createDocumentFragment(i),t=r.data.htmlProcessor.domConverter.viewToDom(e),n=t.firstChild;for(;n.firstChild;)t.appendChild(n.firstChild);n.remove(),h=r.data.htmlProcessor.htmlWriter.getHtml(t)}s.writer.setAttribute("htmlContent",h,o);for(const{item:e}of r.editing.view.createRangeIn(i))s.consumable.consume(e,{name:!0});return o},converterPriority:"low"}),o.for("editingDowncast").elementToElement({model:{name:n.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),n=t.createRawElement(i);return e.hasAttribute("htmlCustomElementAttributes")&&Gk(t,e.getAttribute("htmlCustomElementAttributes"),n),n}}),o.for("dataDowncast").elementToElement({model:{name:n.model,attributes:["htmlElementName","htmlCustomElementAttributes","htmlContent"]},view:(e,{writer:t})=>{const i=e.getAttribute("htmlElementName"),n=e.getAttribute("htmlContent"),r=t.createRawElement(i,null,((e,t)=>{t.setContentOf(e,n)}));return e.hasAttribute("htmlCustomElementAttributes")&&Gk(t,e.getAttribute("htmlCustomElementAttributes"),r),r}})}))}}function*TC(e,t,i){if(t)if(!(Symbol.iterator in t)&&t.is("documentSelection")&&t.isCollapsed)e.schema.checkAttributeInSelection(t,i)&&(yield t);else for(const n of function(e,t,i){return!(Symbol.iterator in t)&&(t.is("node")||t.is("$text")||t.is("$textProxy"))?e.schema.checkAttribute(t,i)?[e.createRangeOn(t)]:[]:e.schema.getValidRanges(e.createSelection(t).getRanges(),i)}(e,t,i))yield*n.getItems({shallow:!0})}const EC=function(e,t){return function(i,n){if(null==i)return i;if(!lt(i))return e(i,n);for(var r=i.length,s=t?r:-1,o=Object(i);(t?s--:++s{if(!i.isInlineImageView(e))return null;if(!n)return r(e);return("block"==e.getStyle("display")||e.findAncestor(i.isBlockImageView)?"imageBlock":"imageInline")!==t?null:r(e)};function r(e){const t={name:!0};return e.hasAttribute("src")&&(t.attributes=["src"]),t}}function RC(e,t){const i=es(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&"listItem"!=i.name?"imageBlock":"imageInline"}function BC(e){return e&&e.endsWith("px")?parseInt(e):null}function OC(e){const t=BC(e.getStyle("width")),i=BC(e.getStyle("height"));return!(!t||!i)}const FC=/^(image|image-inline)$/;class MC extends yu{_domEmitter=new(er());static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null,n={}){const r=this.editor,s=r.model,o=s.document.selection,a=NC(r,t||o,i);e={...Object.fromEntries(o.getAttributes()),...e};for(const t in e)s.schema.checkAttribute(a,t)||delete e[t];return s.change((i=>{const{setImageSizes:r=!0}=n,o=i.createElement(a,e);return s.insertObject(o,t,null,{setSelection:"on",findOptimalPosition:t||"imageInline"==a?void 0:"auto"}),o.parent?(r&&this.setImageNaturalSizeAttributes(o),o):null}))}setImageNaturalSizeAttributes(e){const t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change((i=>{const n=new ji.window.Image;this._domEmitter.listenTo(n,"load",(()=>{e.getAttribute("width")||e.getAttribute("height")||this.editor.model.enqueueChange(i.batch,(t=>{t.setAttribute("width",n.naturalWidth,e),t.setAttribute("height",n.naturalHeight,e)})),this._domEmitter.stopListening(n,"load")})),n.src=t})))}getClosestSelectedImageWidget(e){const t=e.getFirstPosition();if(!t)return null;const i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let n=t.parent;for(;n;){if(n.is("element")&&this.isImageWidget(n))return n;n=n.parent}return null}getClosestSelectedImageElement(e){const t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:FC})}isImageAllowed(){const e=this.editor.model.document.selection;return function(e,t){const i=NC(e,t,null);if("imageBlock"==i){const i=function(e,t){const i=Zb(e,t),n=i.start.parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(t,e.model);if(e.model.schema.checkChild(i,"imageBlock"))return!0}else if(e.model.schema.checkChild(t.focus,"imageInline"))return!0;return!1}(this.editor,e)&&function(e){return[...e.focus.getAncestors()].every((e=>!e.is("element","imageBlock")))}(e)}toImageWidget(e,t,i){t.setCustomProperty("image",!0,e);return Ub(e,t,{label:()=>{const t=this.findViewImgElement(e).getAttribute("alt");return t?`${t} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&$b(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;const t=this.editor.editing.view;for(const{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}}function NC(e,t,i){const n=e.model.schema,r=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||("inline"===r?"imageInline":"auto"!==r?"imageBlock":t.is("selection")?RC(n,t):n.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}const LC=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));class DC extends Cu{refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){const t=this.editor,i=t.plugins.get("ImageUtils"),n=t.model,r=i.getClosestSelectedImageElement(n.document.selection);n.change((t=>{t.setAttribute("alt",e.newValue,r)}))}}class zC extends yu{static get requires(){return[MC]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new DC(this.editor))}}class HC extends ig{focusTracker;keystrokes;labeledInput;saveButtonView;cancelButtonView;_focusables;_focusCycler;constructor(e){super(e);const t=this.locale.t;this.focusTracker=new ts,this.keystrokes=new ss,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(t("Save"),Uu.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(t("Cancel"),Uu.cancel,"ck-button-cancel","cancel"),this._focusables=new Om,this._focusCycler=new ug({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),sg({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,i,n){const r=new cg(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:i}}),n&&r.delegate("execute").to(this,n),r}_createLabeledInputView(){const e=this.locale.t,t=new Qg(this.locale,Vf);return t.label=e("Text alternative"),t}}function WC(e){const t=e.editing.view,i=uf.defaultPositions,n=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(n.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast,i.viewportStickyNorth]}}class $C extends yu{_balloon;_form;static get requires(){return[Op]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){const e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",(i=>{const n=e.commands.get("imageTextAlternative"),r=new cg(i);return r.set({label:t("Change image text alternative"),icon:Uu.textAlternative,tooltip:!0}),r.bind("isEnabled").to(n,"isEnabled"),r.bind("isOn").to(n,"value",(e=>!!e)),this.listenTo(r,"execute",(()=>{this._showForm()})),r}))}_createForm(){const e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(rg(HC))(e.locale),this._form.render(),this.listenTo(this._form,"submit",(()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((e,t)=>{this._hideForm(!0),t()})),this.listenTo(e.ui,"update",(()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&function(e){const t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){const i=WC(e);t.updatePosition(i)}}(e):this._hideForm(!0)})),ng({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();const e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:WC(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class UC extends yu{static get requires(){return[zC,$C]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}}function jC(e,t){const i=(t,i,n)=>{if(!n.consumable.consume(i.item,t.name))return;const r=n.writer,s=n.mapper.toViewElement(i.item),o=e.findViewImgElement(s);null===i.attributeNewValue?(r.removeAttribute("srcset",o),r.removeAttribute("sizes",o)):i.attributeNewValue&&(r.setAttribute("srcset",i.attributeNewValue,o),r.setAttribute("sizes","100vw",o))};return e=>{e.on(`attribute:srcset:${t}`,i)}}function qC(e,t,i){const n=(t,i,n)=>{if(!n.consumable.consume(i.item,t.name))return;const r=n.writer,s=n.mapper.toViewElement(i.item),o=e.findViewImgElement(s);r.setAttribute(i.attributeKey,i.attributeNewValue||"",o)};return e=>{e.on(`attribute:${i}:${t}`,n)}}class GC extends nl{observe(e){this.listenTo(e,"load",((e,t)=>{const i=t.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(t)}),{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}}class KC extends Cu{constructor(e){super(e);const t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||"block"===t&&fn("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||"inline"===t&&fn("image-inline-plugin-required")}refresh(){const e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){const t=Jr(e.source),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(i.getAttributes());t.forEach(((t,s)=>{const o=i.getSelectedElement();if("string"==typeof t&&(t={src:t}),s&&o&&n.isImage(o)){const i=this.editor.model.createPositionAfter(o);n.insertImage({...t,...r},i,e.imageType)}else n.insertImage({...t,...r},null,e.imageType)}))}}class ZC extends Cu{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){const t=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change((n=>{n.setAttribute("src",e.source,t),this.cleanupImage(n,t),i.setImageNaturalSizeAttributes(t)}))}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}}class JC extends yu{static get requires(){return[MC]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.conversion;e.editing.view.addObserver(GC),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});const i=new KC(e),n=new ZC(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",n),e.commands.add("imageInsert",i)}}class QC extends yu{static get requires(){return[MC]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils"),n="imageBlock"===e?"figure":"img";function r(t,n,r,s){t.on(`attribute:${n}:${e}`,((t,n,o)=>{if(!o.consumable.consume(n.item,t.name))return;const a=o.writer,l=o.mapper.toViewElement(n.item),c=i.findViewImgElement(l);if(null!==n.attributeNewValue?a.setAttribute(r,n.attributeNewValue,c):a.removeAttribute(r,c),n.item.hasAttribute("sources"))return;const h=n.item.hasAttribute("resizedWidth");if("imageInline"===e&&!h&&!s)return;const d=n.item.getAttribute("width"),u=n.item.getAttribute("height");d&&u&&a.setStyle("aspect-ratio",`${d}/${u}`,c)}))}t.conversion.for("upcast").attributeToAttribute({view:{name:n,styles:{width:/.+/}},model:{key:"width",value:e=>OC(e)?BC(e.getStyle("width")):null}}).attributeToAttribute({view:{name:n,key:"width"},model:"width"}).attributeToAttribute({view:{name:n,styles:{height:/.+/}},model:{key:"height",value:e=>OC(e)?BC(e.getStyle("height")):null}}).attributeToAttribute({view:{name:n,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add((e=>{r(e,"width","width",!0),r(e,"height","height",!0)})),t.conversion.for("dataDowncast").add((e=>{r(e,"width","width",!1),r(e,"height","height",!1)}))}}class YC extends Cu{_modelElementName;constructor(e,t){super(e),this._modelElementName=t}refresh(){const e=this.editor.plugins.get("ImageUtils"),t=e.getClosestSelectedImageElement(this.editor.model.document.selection);"imageBlock"===this._modelElementName?this.isEnabled=e.isInlineImage(t):this.isEnabled=e.isBlockImage(t)}execute(e={}){const t=this.editor,i=this.editor.model,n=t.plugins.get("ImageUtils"),r=n.getClosestSelectedImageElement(i.document.selection),s=Object.fromEntries(r.getAttributes());return s.src||s.uploadId?i.change((t=>{const{setImageSizes:o=!0}=e,a=Array.from(i.markers).filter((e=>e.getRange().containsItem(r))),l=n.insertImage(s,i.createSelection(r,"on"),this._modelElementName,{setImageSizes:o});if(!l)return null;const c=t.createRangeOn(l);for(const e of a){const i=e.getRange(),n="$graveyard"!=i.root.rootName?i.getJoined(c,!0):c;t.updateMarker(e,{range:n})}return{oldElement:r,newElement:l}})):null}}class XC extends yu{static get requires(){return[MC]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){const e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){const e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add((e=>{e.on("attribute:placeholder",((e,t,n)=>{if(!n.consumable.test(t.item,e.name))return;if(!t.item.is("element","imageBlock")&&!t.item.is("element","imageInline"))return;n.consumable.consume(t.item,e.name);const r=n.writer,s=n.mapper.toViewElement(t.item),o=i.findViewImgElement(s);t.attributeNewValue?(r.addClass("image_placeholder",o),r.setStyle("background-image",`url(${t.attributeNewValue})`,o),r.setCustomProperty("editingPipeline:doNotReuseOnce",!0,o)):(r.removeClass("image_placeholder",o),r.removeStyle("background-image",o))}))}))}_setupLoadListener(){const e=this.editor,t=e.model,i=e.editing,n=i.view,r=e.plugins.get("ImageUtils");n.addObserver(GC),this.listenTo(n.document,"imageLoaded",((e,s)=>{const o=n.domConverter.mapDomToView(s.target);if(!o)return;const a=r.getImageWidgetFromImageView(o);if(!a)return;const l=i.mapper.toModelElement(a);l&&l.hasAttribute("placeholder")&&t.enqueueChange({isUndoable:!1},(e=>{e.removeAttribute("placeholder",l)}))}))}}class ex extends yu{static get requires(){return[JC,QC,MC,XC,D_]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new YC(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:t})=>IC(t)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(e,{writer:i})=>n.toImageWidget(IC(i),i,t("image widget"))}),i.for("downcast").add(qC(n,"imageBlock","src")).add(qC(n,"imageBlock","alt")).add(jC(n,"imageBlock")),i.for("upcast").elementToElement({view:VC(e,"imageBlock"),model:(e,{writer:t})=>t.createElement("imageBlock",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)}).add(function(e){const t=(t,i,n)=>{if(!n.consumable.test(i.viewItem,{name:!0,classes:"image"}))return;const r=e.findViewImgElement(i.viewItem);if(!r||!n.consumable.test(r,{name:!0}))return;n.consumable.consume(i.viewItem,{name:!0,classes:"image"});const s=es(n.convertItem(r,i.modelCursor).modelRange.getItems());s?(n.convertChildren(i.viewItem,s),n.updateConversionResult(s,i)):n.consumable.revert(i.viewItem,{name:!0,classes:"image"})};return e=>{e.on("element:figure",t)}}(n))}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",((r,s)=>{const o=Array.from(s.content.getChildren());let a;if(!o.every(n.isInlineImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageBlock"===RC(t.schema,l)){const e=new Cd(i.document),t=o.map((t=>e.createElement("figure",{class:"image"},t)));s.content=e.createDocumentFragment(t)}})),this.listenTo(r,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageBlock")&&n.setImageNaturalSizeAttributes(e)}))}))}}class tx extends ig{focusTracker;keystrokes;_focusables;_focusCycler;children;constructor(e,t=[]){super(e),this.focusTracker=new ts,this.keystrokes=new ss,this._focusables=new Om,this.children=this.createCollection(),this._focusCycler=new ug({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(const e of t)this.children.add(e),this._focusables.add(e),e instanceof $g&&this._focusables.addMany(e.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),sg({view:this});for(const e of this._focusables)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element);const e=e=>e.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}}class ix extends yu{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[MC]}dropdownView;_integrations=new Map;constructor(e){super(e),e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){const e=this.editor,t=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",(()=>{this.isImageSelected=i.isImage(t.getSelectedElement())}));const n=e=>this._createToolbarComponent(e);e.ui.componentFactory.add("insertImage",n),e.ui.componentFactory.add("imageInsert",n),e.ui.componentFactory.add("menuBar:insertImage",(e=>this._createMenuBarComponent(e)))}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:n,menuBarButtonViewCreator:r,requiresForm:s=!1}){this._integrations.has(e)&&fn("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,menuBarButtonViewCreator:r,formViewCreator:n,requiresForm:s})}_createToolbarComponent(e){const t=this.editor,i=e.t,n=this._prepareIntegrations();if(!n.length)return null;let r;const s=n[0];if(1==n.length){if(!s.requiresForm)return s.buttonViewCreator(!0);r=s.buttonViewCreator(!0)}else{const t=s.buttonViewCreator(!1);r=new kf(e,t),r.tooltip=!0,r.bind("label").to(this,"isImageSelected",(e=>i(e?"Replace image":"Insert image")))}const o=this.dropdownView=Cf(e,r),a=n.map((({observable:e})=>"function"==typeof e?e():e));return o.bind("isEnabled").toMany(a,"isEnabled",((...e)=>e.some((e=>e)))),o.once("change:isOpen",(()=>{const e=n.map((({formViewCreator:e})=>e(1==n.length))),i=new tx(t.locale,e);o.panelView.children.add(i)})),o}_createMenuBarComponent(e){const t=e.t,i=this._prepareIntegrations();if(!i.length)return null;let n;const r=i[0];if(1==i.length)n=r.menuBarButtonViewCreator(!0);else{n=new Hp(e);const r=new Wp(e);n.panelView.children.add(r),n.buttonView.set({icon:Uu.image,label:t("Image")});for(const t of i){const i=new cp(e,n),s=t.menuBarButtonViewCreator(!1);i.children.add(s),r.items.add(i)}}return n}_prepareIntegrations(){const e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return fn("image-insert-integrations-not-specified"),t;for(const i of e)this._integrations.has(i)?t.push(this._integrations.get(i)):["upload","assetManager","url"].includes(i)||fn("image-insert-unknown-integration",{item:i});return t.length||fn("image-insert-integrations-not-registered"),t}}class nx extends yu{static get requires(){return[ex,l_,UC,ix]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}}class rx extends yu{static get requires(){return[JC,QC,MC,XC,D_]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new YC(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){const e=this.editor,t=e.t,i=e.conversion,n=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(e,{writer:t})=>t.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(e,{writer:i})=>n.toImageWidget(function(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}(i),i,t("image widget"))}),i.for("downcast").add(qC(n,"imageInline","src")).add(qC(n,"imageInline","alt")).add(jC(n,"imageInline")),i.for("upcast").elementToElement({view:VC(e,"imageInline"),model:(e,{writer:t})=>t.createElement("imageInline",e.hasAttribute("src")?{src:e.getAttribute("src")}:void 0)})}_setupClipboardIntegration(){const e=this.editor,t=e.model,i=e.editing.view,n=e.plugins.get("ImageUtils"),r=e.plugins.get("ClipboardPipeline");this.listenTo(r,"inputTransformation",((r,s)=>{const o=Array.from(s.content.getChildren());let a;if(!o.every(n.isBlockImageView))return;a=s.targetRanges?e.editing.mapper.toModelRange(s.targetRanges[0]):t.document.selection.getFirstRange();const l=t.createSelection(a);if("imageInline"===RC(t.schema,l)){const e=new Cd(i.document),t=o.map((t=>1===t.childCount?(Array.from(t.getAttributes()).forEach((i=>e.setAttribute(...i,n.findViewImgElement(t)))),t.getChild(0)):t));s.content=e.createDocumentFragment(t)}})),this.listenTo(r,"contentInsertion",((e,i)=>{"paste"===i.method&&t.change((e=>{const t=e.createRangeIn(i.content);for(const e of t.getItems())e.is("element","imageInline")&&n.setImageNaturalSizeAttributes(e)}))}))}}class sx extends yu{static get requires(){return[rx,l_,UC,ix]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}}class ox extends yu{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[MC]}getCaptionFromImageModelElement(e){for(const t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){const t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){const t=this.editor.plugins.get("ImageUtils");return"figcaption"==e.name&&t.isBlockImageView(e.parent)?{name:!0}:null}}class ax extends Cu{refresh(){const e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(ex))return this.isEnabled=!1,void(this.value=!1);const n=e.model.document.selection,r=n.getSelectedElement();if(!r){const e=t.getCaptionFromModelSelection(n);return this.isEnabled=!!e,void(this.value=!!e)}this.isEnabled=i.isImage(r),this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(r):this.value=!1}execute(e={}){const{focusCaptionOnShow:t}=e;this.editor.model.change((e=>{this.value?this._hideImageCaption(e):this._showImageCaption(e,t)}))}_showImageCaption(e,t){const i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageCaptionEditing"),r=this.editor.plugins.get("ImageUtils");let s=i.getSelectedElement();const o=n._getSavedCaption(s);r.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=i.getSelectedElement());const a=o||e.createElement("caption");e.append(a,s),t&&e.setSelection(a,"in")}_hideImageCaption(e){const t=this.editor,i=t.model.document.selection,n=t.plugins.get("ImageCaptionEditing"),r=t.plugins.get("ImageCaptionUtils");let s,o=i.getSelectedElement();o?s=r.getCaptionFromImageModelElement(o):(s=r.getCaptionFromModelSelection(i),o=s.parent),n._saveCaption(o,s),e.setSelection(o,"on"),e.remove(s)}}class lx extends yu{static get requires(){return[MC,ox]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}_savedCaptionsMap;constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new ax(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils"),r=e.t;e.conversion.for("upcast").elementToElement({view:e=>n.matchImageCaptionViewElement(e),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>i.isBlockImage(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:n})=>{if(!i.isBlockImage(e.parent))return null;const s=n.createEditableElement("figcaption");n.setCustomProperty("imageCaption",!0,s),s.placeholder=r("Enter image caption"),Po({view:t,element:s,keepOnFocus:!0});const o=e.parent.getAttribute("alt");return Kb(s,n,{label:o?r("Caption for image: %0",[o]):r("Caption for the image")})}})}_setupImageTypeCommandsIntegration(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),n=e.commands.get("imageTypeInline"),r=e.commands.get("imageTypeBlock"),s=e=>{if(!e.return)return;const{oldElement:n,newElement:r}=e.return;if(!n)return;if(t.isBlockImage(n)){const e=i.getCaptionFromImageModelElement(n);if(e)return void this._saveCaption(r,e)}const s=this._getSavedCaption(n);s&&this._saveCaption(r,s)};n&&this.listenTo(n,"execute",s,{priority:"low"}),r&&this.listenTo(r,"execute",s,{priority:"low"})}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?Xl.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){const e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),n=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",(()=>{const r=t.document.differ.getChanges();for(const t of r){if("alt"!==t.attributeKey)continue;const r=t.range.start.nodeAfter;if(i.isBlockImage(r)){const t=n.getCaptionFromImageModelElement(r);if(!t)return;e.editing.reconvertItem(t)}}}))}}class cx extends yu{static get requires(){return[ox]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),n=e.t;e.ui.componentFactory.add("toggleImageCaption",(r=>{const s=e.commands.get("toggleImageCaption"),o=new cg(r);return o.set({icon:Uu.caption,tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(s,"value","isEnabled"),o.bind("label").to(s,"value",(e=>n(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(o,"execute",(()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});const n=i.getCaptionFromModelSelection(e.model.document.selection);if(n){const i=e.editing.mapper.toViewElement(n);t.scrollToTheSelection(),t.change((e=>{e.addClass("image__caption_highlighted",i)}))}e.editing.view.focus()})),o}))}}function hx(e){const t=e.map((e=>e.replace("+","\\+")));return new RegExp(`^image\\/(${t.join("|")})$`)}function dx(e){return new Promise(((t,i)=>{const n=e.getAttribute("src");fetch(n).then((e=>e.blob())).then((e=>{const i=ux(e,n),r=i.replace("image/",""),s=new File([e],`image.${r}`,{type:i});t(s)})).catch((e=>e&&"TypeError"===e.name?function(e){return function(e){return new Promise(((t,i)=>{const n=ji.document.createElement("img");n.addEventListener("load",(()=>{const e=ji.document.createElement("canvas");e.width=n.width,e.height=n.height;e.getContext("2d").drawImage(n,0,0),e.toBlob((e=>e?t(e):i()))})),n.addEventListener("error",(()=>i())),n.src=e}))}(e).then((t=>{const i=ux(t,e),n=i.replace("image/","");return new File([t],`image.${n}`,{type:i})}))}(n).then(t).catch(i):i(e)))}))}function ux(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class mx extends yu{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.ui.componentFactory.add("uploadImage",(()=>this._createToolbarButton())),e.ui.componentFactory.add("imageUpload",(()=>this._createToolbarButton())),e.ui.componentFactory.add("menuBar:uploadImage",(()=>this._createMenuBarButton("standalone"))),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("uploadImage"),r=t.config.get("image.upload.types"),s=hx(r),o=new e(t.locale),a=i.t;return o.set({acceptedType:r.map((e=>`image/${e}`)).join(","),allowMultipleFiles:!0,label:a("Upload from computer"),icon:Uu.imageUpload}),o.bind("isEnabled").to(n),o.on("done",((e,i)=>{const n=Array.from(i).filter((e=>s.test(e.type)));n.length&&(t.execute("uploadImage",{file:n}),t.editing.view.focus())})),o}_createToolbarButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),n=this._createButton(Lg);return n.tooltip=!0,n.bind("label").to(t,"isImageSelected",i,"isAccessAllowed",((t,i)=>e(i?t?"Replace image from computer":"Upload image from computer":"You have no image upload permissions."))),n}_createDropdownButton(){const e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(Lg);return i.withText=!0,i.bind("label").to(t,"isImageSelected",(t=>e(t?"Replace from computer":"Upload from computer"))),i.on("execute",(()=>{t.dropdownView.isOpen=!1})),i}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createButton(Up);switch(i.withText=!0,e){case"standalone":i.label=t("Image from computer");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("From computer")}return i}}class gx extends yu{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}placeholder;constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}uploadStatusChange=(e,t,i)=>{const n=this.editor,r=t.item,s=r.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;const o=n.plugins.get("ImageUtils"),a=n.plugins.get(qu),l=s?t.attributeNewValue:null,c=this.placeholder,h=n.editing.mapper.toViewElement(r),d=i.writer;if("reading"==l)return fx(h,d),void px(o,c,h,d);if("uploading"==l){const e=a.loaders.get(s);return fx(h,d),void(e?(wx(h,d),function(e,t,i,n){const r=function(e){const t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}(t);t.insert(t.createPositionAt(e,"end"),r),i.on("change:uploadedPercent",((e,t,i)=>{n.change((e=>{e.setStyle("width",i+"%",r)}))}))}(h,d,e,n.editing.view),function(e,t,i,n){if(n.data){const r=e.findViewImgElement(t);i.setAttribute("src",n.data,r)}}(o,h,d,e)):px(o,c,h,d))}"complete"==l&&a.loaders.get(s)&&function(e,t,i){const n=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),n),setTimeout((()=>{i.change((e=>e.remove(e.createRangeOn(n))))}),3e3)}(h,d,n.editing.view),function(e,t){_x(e,t,"progressBar")}(h,d),wx(h,d),function(e,t){t.removeClass("ck-appear",e)}(h,d)}}function fx(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function px(e,t,i,n){i.hasClass("ck-image-upload-placeholder")||n.addClass("ck-image-upload-placeholder",i);const r=e.findViewImgElement(i);r.getAttribute("src")!==t&&n.setAttribute("src",t,r),bx(i,"placeholder")||n.insert(n.createPositionAfter(r),function(e){const t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}(n))}function wx(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),_x(e,t,"placeholder")}function bx(e,t){for(const i of e.getChildren())if(i.getCustomProperty(t))return i}function _x(e,t,i){const n=bx(e,i);n&&t.remove(t.createRangeOn(n))}class vx extends Cu{constructor(e){super(e),this.set("isAccessAllowed",!0)}refresh(){const e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){const t=Jr(e.file),i=this.editor.model.document.selection,n=this.editor.plugins.get("ImageUtils"),r=Object.fromEntries(i.getAttributes());t.forEach(((e,t)=>{const s=i.getSelectedElement();if(t&&s&&n.isImage(s)){const t=this.editor.model.createPositionAfter(s);this._uploadImage(e,r,t)}else this._uploadImage(e,r)}))}_uploadImage(e,t,i){const n=this.editor,r=n.plugins.get(qu).createLoader(e),s=n.plugins.get("ImageUtils");r&&s.insertImage({...t,uploadId:r.id},i)}}class yx extends yu{static get requires(){return[qu,Vp,D_,MC]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}_uploadImageElements;_uploadedImages=new Map;constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){const e=this.editor,t=e.model.document,i=e.conversion,n=e.plugins.get(qu),r=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),o=hx(e.config.get("image.upload.types")),a=new vx(e);e.commands.add("uploadImage",a),e.commands.add("imageUpload",a),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add((e=>e.on("element:img",((e,t,i)=>{if(!i.consumable.test(t.viewItem,{attributes:["data-ck-upload-id"]}))return;const r=t.viewItem.getAttribute("data-ck-upload-id");if(!r)return;const[s]=Array.from(t.modelRange.getItems({shallow:!0})),o=n.loaders.get(r);s&&(i.writer.setAttribute("uploadId",r,s),i.consumable.consume(t.viewItem,{attributes:["data-ck-upload-id"]}),o&&o.data&&i.writer.setAttribute("uploadStatus",o.status,s))}),{priority:"low"}))),this.listenTo(e.editing.view.document,"clipboardInput",((t,i)=>{if(n=i.dataTransfer,Array.from(n.types).includes("text/html")&&""!==n.getData("text/html"))return;var n;const r=Array.from(i.dataTransfer.files).filter((e=>!!e&&o.test(e.type)));if(!r.length)return;t.stop(),e.model.change((t=>{i.targetRanges&&t.setSelection(i.targetRanges.map((t=>e.editing.mapper.toModelRange(t)))),e.execute("uploadImage",{file:r})}));if(!e.commands.get("uploadImage").isAccessAllowed){const t=e.plugins.get("Notification"),i=e.locale.t;t.showWarning(i("You have no image upload permissions."),{namespace:"image"})}})),this.listenTo(s,"inputTransformation",((t,i)=>{const s=Array.from(e.editing.view.createRangeIn(i.content)).map((e=>e.item)).filter((e=>function(e,t){return!(!e.isInlineImageView(t)||!t.getAttribute("src")||!t.getAttribute("src").match(/^data:image\/\w+;base64,/g)&&!t.getAttribute("src").match(/^blob:/g))}(r,e)&&!e.getAttribute("uploadProcessed"))).map((e=>({promise:dx(e),imageElement:e})));if(!s.length)return;const o=new Cd(e.editing.view.document);for(const e of s){o.setAttribute("uploadProcessed",!0,e.imageElement);const t=n.createLoader(e.promise);t&&(o.setAttribute("src","",e.imageElement),o.setAttribute("uploadId",t.id,e.imageElement))}})),e.editing.view.document.on("dragover",((e,t)=>{t.preventDefault()})),t.on("change",(()=>{const i=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),r=new Set;for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter,s="$graveyard"==t.position.root.rootName;for(const t of kx(e,i)){const i=t.getAttribute("uploadId");if(!i)continue;const o=n.loaders.get(i);if(o)if(s){if(!r.has(i)){Array.from(this._uploadImageElements.get(i)).every((e=>"$graveyard"==e.root.rootName))&&o.abort()}}else r.add(i),this._uploadImageElements.has(i)?this._uploadImageElements.get(i).add(t):this._uploadImageElements.set(i,new Set([t])),"idle"==o.status&&this._readAndUpload(o);else!s&&this._uploadedImages.has(i)&&e.model.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","complete",t),this.fire("uploadComplete",{data:this._uploadedImages.get(i),imageElement:t})}))}}})),this.on("uploadComplete",((e,{imageElement:t,data:i})=>{const n=i.urls?i.urls:i;this.editor.model.change((e=>{e.setAttribute("src",n.default,t),this._parseAndSetSrcsetAttributeOnImage(n,t,e),r.setImageNaturalSizeAttributes(t)}))}),{priority:"low"})}afterInit(){const e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){const t=this.editor,i=t.model,n=t.locale.t,r=t.plugins.get(qu),s=t.plugins.get(Vp),o=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},(t=>{const i=a.get(e.id);for(const e of i)t.setAttribute("uploadStatus","reading",e)})),e.read().then((()=>{const r=e.upload();t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Uploading image"));for(const n of a.get(e.id)){if(Ki.isSafari){const e=t.editing.mapper.toViewElement(n),i=o.findViewImgElement(e);t.editing.view.once("render",(()=>{if(!i.parent)return;const e=t.editing.view.domConverter.mapViewToDom(i.parent);if(!e)return;const n=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=n}))}i.enqueueChange({isUndoable:!1},(e=>{e.setAttribute("uploadStatus","uploading",n)}))}return r})).then((r=>{i.enqueueChange({isUndoable:!1},(i=>{for(const t of a.get(e.id))i.setAttribute("uploadStatus","complete",t),this.fire("uploadComplete",{data:r,imageElement:t});t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Image upload complete")),this._uploadedImages.set(e.id,r)})),l()})).catch((r=>{if(t.ui&&t.ui.ariaLiveAnnouncer.announce(n("Error during image upload")),"error"!==e.status&&"aborted"!==e.status)throw r;"error"==e.status&&r&&s.showWarning(r,{title:n("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},(t=>{for(const i of a.get(e.id))"$graveyard"!==i.root.rootName&&t.remove(i)})),l()}));function l(){i.enqueueChange({isUndoable:!1},(t=>{for(const i of a.get(e.id))t.removeAttribute("uploadId",i),t.removeAttribute("uploadStatus",i);a.delete(e.id)})),r.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let n=0;const r=Object.keys(e).filter((e=>{const t=parseInt(e,10);if(!isNaN(t))return n=Math.max(n,t),!0})).map((t=>`${e[t]} ${t}w`)).join(", ");if(""!=r){const e={srcset:r};t.hasAttribute("width")||t.hasAttribute("height")||(e.width=n),i.setAttributes(e,t)}}_registerConverters(e){const{conversion:t,plugins:i}=this.editor,n=i.get(qu),r=i.get(MC);t.for("dataDowncast").add((t=>{t.on(`attribute:uploadId:${e}`,((e,t,i)=>{if(!i.consumable.test(t.item,e.name))return;const s=n.loaders.get(t.attributeNewValue);if(!s||!s.data)return null;const o=i.mapper.toViewElement(t.item),a=r.findViewImgElement(o);a&&(i.consumable.consume(t.item,e.name),i.writer.setAttribute("data-ck-upload-id",s.id,a))}))}))}}function kx(e,t){const i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter((e=>i.isImage(e.item))).map((e=>e.item))}class Cx extends yu{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[yx,mx,gx]}}class xx extends ig{urlInputView;keystrokes;constructor(e){super(e),this.set("imageURLInputValue",""),this.set("isImageSelected",!1),this.set("isEnabled",!0),this.keystrokes=new ss,this.urlInputView=this._createUrlInputView(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-image-insert-url"]},children:[this.urlInputView,{tag:"div",attributes:{class:["ck","ck-image-insert-url__action-row"]}}]})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.keystrokes.destroy()}_createUrlInputView(){const e=this.locale,t=e.t,i=new Qg(e,Vf);return i.bind("label").to(this,"isImageSelected",(e=>t(e?"Update image URL":"Insert image via URL"))),i.bind("isEnabled").to(this),i.fieldView.inputMode="url",i.fieldView.placeholder="https://example.com/image.png",i.fieldView.bind("value").to(this,"imageURLInputValue",(e=>e||"")),i.fieldView.on("input",(()=>{this.imageURLInputValue=i.fieldView.element.value.trim()})),i}focus(){this.urlInputView.focus()}}class Ax extends yu{_imageInsertUI;_formView;static get pluginName(){return"ImageInsertViaUrlUI"}static get isOfficialPlugin(){return!0}static get requires(){return[ix,Eg]}init(){this.editor.ui.componentFactory.add("insertImageViaUrl",(()=>this._createToolbarButton())),this.editor.ui.componentFactory.add("menuBar:insertImageViaUrl",(()=>this._createMenuBarButton("standalone")))}afterInit(){this._imageInsertUI=this.editor.plugins.get("ImageInsertUI"),this._imageInsertUI.registerIntegration({name:"url",observable:()=>this.editor.commands.get("insertImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:e=>this._createMenuBarButton(e?"insertOnly":"insertNested")})}_createInsertUrlButton(e){const t=new e(this.editor.locale);return t.icon=Uu.imageUrl,t.on("execute",(()=>{this._showModal()})),t}_createToolbarButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(cg);return t.tooltip=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",(t=>e(t?"Update image URL":"Insert image via URL"))),t}_createDropdownButton(){const e=this.editor.locale.t,t=this._createInsertUrlButton(cg);return t.withText=!0,t.bind("label").to(this._imageInsertUI,"isImageSelected",(t=>e(t?"Update image URL":"Insert via URL"))),t}_createMenuBarButton(e){const t=this.editor.locale.t,i=this._createInsertUrlButton(Ig);switch(i.withText=!0,e){case"standalone":i.label=t("Image via URL");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("Via URL")}return i}_createInsertUrlView(){const e=this.editor,t=e.locale,i=e.commands.get("replaceImageSource"),n=e.commands.get("insertImage"),r=new xx(t);return r.bind("isImageSelected").to(this._imageInsertUI),r.bind("isEnabled").toMany([n,i],"isEnabled",((...e)=>e.some((e=>e)))),r}_showModal(){const e=this.editor,t=e.locale.t,i=e.plugins.get("Dialog");this._formView||(this._formView=this._createInsertUrlView(),this._formView.on("submit",(()=>this._handleSave())));const n=e.commands.get("replaceImageSource");this._formView.imageURLInputValue=n.value||"",i.show({id:"insertImageViaUrl",title:this._imageInsertUI.isImageSelected?t("Update image URL"):t("Insert image via URL"),isModal:!0,content:this._formView,actionButtons:[{label:t("Cancel"),withText:!0,onExecute:()=>i.hide()},{label:t("Accept"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSave()}]})}_handleSave(){this.editor.commands.get("replaceImageSource").isEnabled?this.editor.execute("replaceImageSource",{source:this._formView.imageURLInputValue}):this.editor.execute("insertImage",{source:this._formView.imageURLInputValue}),this.editor.plugins.get("Dialog").hide()}}class Tx extends yu{static get pluginName(){return"ImageInsertViaUrl"}static get isOfficialPlugin(){return!0}static get requires(){return[Ax,ix]}}class Ex extends Cu{refresh(){const e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,t&&t.hasAttribute("resizedWidth")?this.value={width:t.getAttribute("resizedWidth"),height:null}:this.value=null}execute(e){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils"),r=n.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},r&&i.change((t=>{t.setAttribute("resizedWidth",e.width,r),t.removeAttribute("resizedHeight",r),n.setImageNaturalSizeAttributes(r)}))}}class Sx extends yu{static get requires(){return[MC]}static get pluginName(){return"ImageResizeEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){const e=this.editor,t=new Ex(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}afterInit(){this._registerSchema()}_registerSchema(){this.editor.plugins.has("ImageBlockEditing")&&this.editor.model.schema.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),this.editor.plugins.has("ImageInlineEditing")&&this.editor.model.schema.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]})}_registerConverters(e){const t=this.editor,i=t.plugins.get("ImageUtils");t.conversion.for("downcast").add((t=>t.on(`attribute:resizedWidth:${e}`,((e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=i.writer,r=i.mapper.toViewElement(t.item);null!==t.attributeNewValue?(n.setStyle("width",t.attributeNewValue,r),n.addClass("image_resized",r)):(n.removeStyle("width",r),n.removeClass("image_resized",r))})))),t.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:e=>({key:"style",value:{height:e}})}),t.conversion.for("editingDowncast").add((t=>t.on(`attribute:resizedHeight:${e}`,((t,n,r)=>{if(!r.consumable.consume(n.item,t.name))return;const s=r.writer,o=r.mapper.toViewElement(n.item),a="imageInline"===e?i.findViewImgElement(o):o;null!==n.attributeNewValue?s.setStyle("height",n.attributeNewValue,a):s.removeStyle("height",a)})))),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:e=>OC(e)?null:e.getStyle("width")}}),t.conversion.for("upcast").attributeToAttribute({view:{name:"imageBlock"===e?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:e=>OC(e)?null:e.getStyle("height")}})}}const Px=(()=>({small:Uu.objectSizeSmall,medium:Uu.objectSizeMedium,large:Uu.objectSizeLarge,custom:Uu.objectSizeCustom,original:Uu.objectSizeFull}))();class Ix extends yu{static get requires(){return[Sx]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}_resizeUnit;constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){const e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(const e of t)this._registerImageResizeButton(e);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){const t=this.editor,{name:i,value:n,icon:r}=e;t.ui.componentFactory.add(i,(i=>{const s=new cg(i),o=t.commands.get("resizeImage"),a=this._getOptionLabelValue(e,!0);if(!Px[r])throw new gn("imageresizebuttons-missing-icon",t,e);if(s.set({label:a,icon:Px[r],tooltip:a,isToggleable:!0}),s.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&Vx(e)){const e=t.plugins.get("ImageCustomResizeUI");this.listenTo(s,"execute",(()=>{e._showForm(this._resizeUnit)}))}else{const e=n?n+this._resizeUnit:null;s.bind("isOn").to(o,"value",Rx(e)),this.listenTo(s,"execute",(()=>{t.execute("resizeImage",{width:e})}))}return s}))}_registerImageResizeDropdown(e){const t=this.editor,i=t.t,n=e.find((e=>!e.value)),r=r=>{const s=t.commands.get("resizeImage"),o=Cf(r,sf),a=o.buttonView,l=i("Resize image");return a.set({tooltip:l,commandValue:n.value,icon:Px.medium,isToggleable:!0,label:this._getOptionLabelValue(n),withText:!0,class:"ck-resize-image-button",ariaLabel:l,ariaLabelledBy:void 0}),a.bind("label").to(s,"value",(e=>e&&e.width?e.width:this._getOptionLabelValue(n))),o.bind("isEnabled").to(this),Tf(o,(()=>this._getResizeDropdownListItemDefinitions(e,s)),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(o,"execute",(e=>{"onClick"in e.source?e.source.onClick():(t.execute(e.source.commandName,{width:e.source.commandValue}),t.editing.view.focus())})),o};t.ui.componentFactory.add("resizeImage",r),t.ui.componentFactory.add("imageResize",r)}_getOptionLabelValue(e,t=!1){const i=this.editor.t;return e.label?e.label:t?Vx(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):Vx(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){const{editor:i}=this,n=new Xr,r=e.map((e=>Vx(e)?{...e,valueWithUnits:"custom"}:e.value?{...e,valueWithUnits:`${e.value}${this._resizeUnit}`}:{...e,valueWithUnits:null}));for(const e of r){let s=null;if(i.plugins.has("ImageCustomResizeUI")&&Vx(e)){const n=i.plugins.get("ImageCustomResizeUI");s={type:"button",model:new Rp({label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{n._showForm(this._resizeUnit)}})};const o=PC(r,"valueWithUnits");s.model.bind("isOn").to(t,"value",Bx(o))}else s={type:"button",model:new Rp({commandName:"resizeImage",commandValue:e.valueWithUnits,label:this._getOptionLabelValue(e),role:"menuitemradio",withText:!0,icon:null})},s.model.bind("isOn").to(t,"value",Rx(e.valueWithUnits));s.model.bind("isEnabled").to(t,"isEnabled"),n.add(s)}return n}}function Vx(e){return"custom"===e.value}function Rx(e){return t=>null===e&&t===e||null!==t&&t.width===e}function Bx(e){return t=>!e.some((e=>Rx(e)(t)))}const Ox="image_resized";class Fx extends yu{static get requires(){return[w_,MC]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){const e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils");t.addObserver(GC),this.listenTo(t.document,"imageLoaded",((n,r)=>{if(!r.target.matches("figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img"))return;const s=e.editing.view.domConverter,o=s.domToView(r.target),a=i.getImageWidgetFromImageView(o);let l=this.editor.plugins.get(w_).getResizerByViewElement(a);if(l)return void l.redraw();const c=e.editing.mapper,h=c.toModelElement(a);l=e.plugins.get(w_).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:h,viewElement:a,editor:e,getHandleHost:e=>e.querySelector("img"),getResizeHost:()=>s.mapViewToDom(c.toViewElement(h)),isCentered:()=>"alignCenter"==h.getAttribute("imageStyle"),onCommit(i){t.change((e=>{e.removeClass(Ox,a)})),e.execute("resizeImage",{width:i})}}),l.on("updateSize",(()=>{a.hasClass(Ox)||t.change((e=>{e.addClass(Ox,a)}));const e="imageInline"===h.name?o:a;e.getStyle("height")&&t.change((t=>{t.removeStyle("height",e)}))})),l.bind("isEnabled").to(this)}))}}function Mx(e){if(!e)return null;const[,t,i]=e.trim().match(/([.,\d]+)(%|px)$/)||[],n=Number.parseFloat(t);return Number.isNaN(n)?null:{value:n,unit:i}}function Nx(e,t,i){return"px"===i?{value:t.value,unit:"px"}:{value:t.value/e*100,unit:"%"}}function Lx(e){const{editing:t}=e,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);if(!i)return null;const n=t.mapper.toViewElement(i);return{model:i,view:n,dom:t.view.domConverter.mapViewToDom(n)}}class Dx extends ig{focusTracker;keystrokes;unit;labeledInput;saveButtonView;cancelButtonView;_focusables;_focusCycler;_validators;constructor(e,t,i){super(e);const n=this.locale.t;this.focusTracker=new ts,this.keystrokes=new ss,this.unit=t,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(n("Save"),Uu.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),Uu.cancel,"ck-button-cancel","cancel"),this._focusables=new Om,this._validators=i,this._focusCycler=new ug({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),sg({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)}))}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createButton(e,t,i,n){const r=new cg(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:i}}),n&&r.delegate("execute").to(this,n),r}_createLabeledInputView(){const e=this.locale.t,t=new Qg(this.locale,Rf);return t.label=e("Resize image (in %0)",this.unit),t.fieldView.set({step:.1}),t}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){const{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){const{rawSize:e}=this;if(null===e)return null;const t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){const{parsedSize:e,unit:t}=this;return null===e?null:`${e}${t}`}}class zx extends yu{_balloon;_form;static get requires(){return[Op]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){const t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(rg(Dx))(t.locale,e,function(e){const t=e.t;return[e=>""===e.rawSize.trim()?t("The value must not be empty."):null===e.parsedSize?t("The value should be a plain number."):void 0]}(t)),this._form.render(),this.listenTo(this._form,"submit",(()=>{this._form.isValid()&&(t.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))})),this.listenTo(this._form.labeledInput,"change:errorText",(()=>{t.ui.update()})),this.listenTo(this._form,"cancel",(()=>{this._hideForm(!0)})),this._form.keystrokes.set("Esc",((e,t)=>{this._hideForm(!0),t()})),ng({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);const t=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:WC(t)});const n=function(e,t){const i=Lx(e);if(!i)return null;const n=Mx(i.model.getAttribute("resizedWidth")||null);return n?n.unit===t?n:Nx(Qb(i.dom),{unit:"px",value:new dr(i.dom).width},t):null}(t,e),r=n?n.value.toFixed(1):"",s=function(e,t){const i=Lx(e);if(!i)return null;const n=Qb(i.dom),r=Mx(window.getComputedStyle(i.dom).minWidth)||{value:1,unit:"px"};return{unit:t,lower:Math.max(.1,Nx(n,r,t).value),upper:"px"===t?n:100}}(t,e);i.fieldView.value=i.fieldView.element.value=r,s&&Object.assign(i.fieldView,{min:s.lower.toFixed(1),max:Math.ceil(s.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}}class Hx extends Cu{_defaultStyles;_styles;constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map((e=>{if(e.isDefault)for(const t of e.modelElements)this._defaultStyles[t]=e.name;return[e.name,e]})))}refresh(){const e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}execute(e={}){const t=this.editor,i=t.model,n=t.plugins.get("ImageUtils");i.change((t=>{const r=e.value,{setImageSizes:s=!0}=e;let o=n.getClosestSelectedImageElement(i.document.selection);r&&this.shouldConvertImageType(r,o)&&(this.editor.execute(n.isBlockImage(o)?"imageTypeInline":"imageTypeBlock",{setImageSizes:s}),o=n.getClosestSelectedImageElement(i.document.selection)),!r||this._styles.get(r).isDefault?t.removeAttribute("imageStyle",o):t.setAttribute("imageStyle",r,o),s&&n.setImageNaturalSizeAttributes(o)}))}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}}const Wx={get inline(){return{name:"inline",title:"In line",icon:Uu.objectInline,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:Uu.objectLeft,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:Uu.objectBlockLeft,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:Uu.objectCenter,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:Uu.objectRight,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:Uu.objectBlockRight,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:Uu.objectCenter,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:Uu.objectRight,modelElements:["imageBlock"],className:"image-style-side"}}},$x=(()=>({full:Uu.objectFullWidth,left:Uu.objectBlockLeft,right:Uu.objectBlockRight,center:Uu.objectCenter,inlineLeft:Uu.objectLeft,inlineRight:Uu.objectRight,inline:Uu.objectInline}))(),Ux=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function jx(e){fn("image-style-configuration-definition-invalid",e)}var qx={normalizeStyles:function(e){return(e.configuredStyles.options||[]).map((e=>function(e){e="string"==typeof e?Wx[e]?{...Wx[e]}:{name:e}:function(e,t){const i={...t};for(const n in e)Object.prototype.hasOwnProperty.call(t,n)||(i[n]=e[n]);return i}(Wx[e.name],e);"string"==typeof e.icon&&(e.icon=$x[e.icon]||e.icon);return e}(e))).filter((t=>function(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){const{modelElements:n,name:r}=e;if(!(n&&n.length&&r))return jx({style:e}),!1;{const r=[t?"imageBlock":null,i?"imageInline":null];if(!n.some((e=>r.includes(e))))return fn("image-style-missing-dependency",{style:e,missingPlugins:n.map((e=>"imageBlock"===e?"ImageBlockEditing":"ImageInlineEditing"))}),!1}return!0}(t,e)))},getDefaultStylesConfiguration:function(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}},getDefaultDropdownDefinitions:function(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...Ux]:[]},warnInvalidStyle:jx,DEFAULT_OPTIONS:Wx,DEFAULT_ICONS:$x,DEFAULT_DROPDOWN_DEFINITIONS:Ux};function Gx(e,t){for(const i of t)if(i.name===e)return i}class Kx extends yu{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[MC]}normalizedStyles;init(){const{normalizeStyles:e,getDefaultStylesConfiguration:t}=qx,i=this.editor,n=i.plugins.has("ImageBlockEditing"),r=i.plugins.has("ImageInlineEditing");i.config.define("image.styles",t(n,r)),this.normalizedStyles=e({configuredStyles:i.config.get("image.styles"),isBlockPluginLoaded:n,isInlinePluginLoaded:r}),this._setupConversion(n,r),this._setupPostFixer(),i.commands.add("imageStyle",new Hx(i,this.normalizedStyles))}_setupConversion(e,t){const i=this.editor,n=i.model.schema,r=(s=this.normalizedStyles,(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;const n=Gx(t.attributeNewValue,s),r=Gx(t.attributeOldValue,s),o=i.mapper.toViewElement(t.item),a=i.writer;r&&a.removeClass(r.className,o),n&&a.addClass(n.className,o)});var s;const o=function(e){const t={imageInline:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageInline"))),imageBlock:e.filter((e=>!e.isDefault&&e.modelElements.includes("imageBlock")))};return(e,i,n)=>{if(!i.modelRange)return;const r=i.viewItem,s=es(i.modelRange.getItems());if(s&&n.schema.checkAttribute(s,"imageStyle"))for(const e of t[s.name])n.consumable.consume(r,{classes:e.className})&&n.writer.setAttribute("imageStyle",e.name,s)}}(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",r),i.data.downcastDispatcher.on("attribute:imageStyle",r),e&&(n.extend("imageBlock",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:figure",o,{priority:"low"})),t&&(n.extend("imageInline",{allowAttributes:"imageStyle"}),i.data.upcastDispatcher.on("element:img",o,{priority:"low"}))}_setupPostFixer(){const e=this.editor,t=e.model.document,i=e.plugins.get(MC),n=new Map(this.normalizedStyles.map((e=>[e.name,e])));t.registerPostFixer((e=>{let r=!1;for(const s of t.differ.getChanges())if("insert"==s.type||"attribute"==s.type&&"imageStyle"==s.attributeKey){let t="insert"==s.type?s.position.nodeAfter:s.range.start.nodeAfter;if(t&&t.is("element","paragraph")&&t.childCount>0&&(t=t.getChild(0)),!i.isImage(t))continue;const o=t.getAttribute("imageStyle");if(!o)continue;const a=n.get(o);a&&a.modelElements.includes(t.name)||(e.removeAttribute("imageStyle",t),r=!0)}return r}))}}class Zx extends yu{static get requires(){return[Kx]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){const e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){const t=this.editor.plugins,i=this.editor.config.get("image.toolbar")||[],n=Jx(t.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(const e of n)this._createButton(e);const r=Jx([...i.filter(e),...qx.getDefaultDropdownDefinitions(t)],this.localizedDefaultStylesTitles);for(const e of r)this._createDropdown(e,n)}_createDropdown(e,t){const i=this.editor.ui.componentFactory;i.add(e.name,(n=>{let r;const{defaultItem:s,items:o,title:a}=e,l=o.filter((e=>t.find((({name:t})=>Qx(t)===e)))).map((e=>{const t=i.create(e);return e===s&&(r=t),t}));o.length!==l.length&&qx.warnInvalidStyle({dropdown:e});const c=Cf(n,kf),h=c.buttonView,d=h.arrowView;return xf(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),h.set({label:Yx(a,r.label),class:null,tooltip:!0}),d.unbind("label"),d.set({label:a}),h.bind("icon").toMany(l,"isOn",((...e)=>{const t=e.findIndex(Vi);return t<0?r.icon:l[t].icon})),h.bind("label").toMany(l,"isOn",((...e)=>{const t=e.findIndex(Vi);return Yx(a,t<0?r.label:l[t].label)})),h.bind("isOn").toMany(l,"isOn",((...e)=>e.some(Vi))),h.bind("class").toMany(l,"isOn",((...e)=>e.some(Vi)?"ck-splitbutton_flatten":void 0)),h.on("execute",(()=>{l.some((({isOn:e})=>e))?c.isOpen=!c.isOpen:r.fire("execute")})),c.bind("isEnabled").toMany(l,"isEnabled",((...e)=>e.some(Vi))),this.listenTo(c,"execute",(()=>{this.editor.editing.view.focus()})),c}))}_createButton(e){const t=e.name;this.editor.ui.componentFactory.add(Qx(t),(i=>{const n=this.editor.commands.get("imageStyle"),r=new cg(i);return r.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0}),r.bind("isEnabled").to(n,"isEnabled"),r.bind("isOn").to(n,"value",(e=>e===t)),r.on("execute",this._executeCommand.bind(this,t)),r}))}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}}function Jx(e,t){for(const i of e)t[i.title]&&(i.title=t[i.title]);return e}function Qx(e){return`imageStyle:${e}`}function Yx(e,t){return(e?e+": ":"")+t}class Xx extends yu{static get pluginName(){return"IndentEditing"}static get isOfficialPlugin(){return!0}init(){const e=this.editor;e.commands.add("indent",new Au(e)),e.commands.add("outdent",new Au(e))}}class eA extends yu{static get pluginName(){return"IndentUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale,i=e.t,n="ltr"==t.uiLanguageDirection?Uu.indent:Uu.outdent,r="ltr"==t.uiLanguageDirection?Uu.outdent:Uu.indent;this._defineButton("indent",i("Increase indent"),n),this._defineButton("outdent",i("Decrease indent"),r)}_defineButton(e,t,i){const n=this.editor;n.ui.componentFactory.add(e,(()=>{const n=this._createButton(cg,e,t,i);return n.set({tooltip:!0}),n})),n.ui.componentFactory.add("menuBar:"+e,(()=>this._createButton(Ig,e,t,i)))}_createButton(e,t,i,n){const r=this.editor,s=r.commands.get(t),o=new e(r.locale);return o.set({label:i,icon:n}),o.bind("isEnabled").to(s,"isEnabled"),this.listenTo(o,"execute",(()=>{r.execute(t),r.editing.view.focus()})),o}}class tA extends Cu{_indentBehavior;constructor(e,t){super(e),this._indentBehavior=t}refresh(){const e=es(this.editor.model.document.selection.getSelectedBlocks());e&&this._isIndentationChangeAllowed(e)?this.isEnabled=this._indentBehavior.checkEnabled(e.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const e=this.editor.model,t=this._getBlocksToChange();e.change((e=>{for(const i of t){const t=i.getAttribute("blockIndent"),n=this._indentBehavior.getNextIndent(t);n?e.setAttribute("blockIndent",n,i):e.removeAttribute("blockIndent",i)}}))}_getBlocksToChange(){const e=this.editor.model.document.selection;return Array.from(e.getSelectedBlocks()).filter((e=>this._isIndentationChangeAllowed(e)))}_isIndentationChangeAllowed(e){const t=this.editor;if(!t.model.schema.checkAttribute(e,"blockIndent"))return!1;if(!t.plugins.has("ListUtils"))return!0;if(!this._indentBehavior.isForward)return!0;return!t.plugins.get("ListUtils").isListItemBlock(e)}}class iA{isForward;offset;unit;constructor(e){this.isForward="forward"===e.direction,this.offset=e.offset,this.unit=e.unit}checkEnabled(e){const t=parseFloat(e||"0");return this.isForward||t>0}getNextIndent(e){const t=parseFloat(e||"0");if(!(!e||e.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const i=t+(this.isForward?this.offset:-this.offset);return i>0?i+this.unit:void 0}}class nA{isForward;classes;constructor(e){this.isForward="forward"===e.direction,this.classes=e.classes}checkEnabled(e){const t=this.classes.indexOf(e);return this.isForward?t=0}getNextIndent(e){const t=this.classes.indexOf(e),i=this.isForward?1:-1;return this.classes[t+i]}}const rA=["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"];class sA{_definitions=new Set;get length(){return this._definitions.size}add(e){Array.isArray(e)?e.forEach((e=>this._definitions.add(e))):this._definitions.add(e)}getDispatcher(){return e=>{e.on("attribute:linkHref",((e,t,i)=>{if(!i.consumable.test(t.item,"attribute:linkHref"))return;if(!t.item.is("selection")&&!i.schema.isInline(t.item))return;const n=i.writer,r=n.document.selection;for(const e of this._definitions){const s=n.createAttributeElement("a",e.attributes,{priority:5});e.classes&&n.addClass(e.classes,s);for(const t in e.styles)n.setStyle(t,e.styles[t],s);n.setCustomProperty("link",!0,s),e.callback(t.attributeNewValue)?t.item.is("selection")?n.wrap(r.getFirstRange(),s):n.wrap(i.mapper.toViewRange(t.range),s):n.unwrap(i.mapper.toViewRange(t.range),s)}}),{priority:"high"})}}getDispatcherForLinkedImage(){return e=>{e.on("attribute:linkHref:imageBlock",((e,t,{writer:i,mapper:n})=>{const r=n.toViewElement(t.item),s=Array.from(r.getChildren()).find((e=>e.is("element","a")));if(s)for(const e of this._definitions){const n=os(e.attributes);if(e.callback(t.attributeNewValue)){for(const[e,t]of n)"class"===e?i.addClass(t,s):i.setAttribute(e,t,s);e.classes&&i.addClass(e.classes,s);for(const t in e.styles)i.setStyle(t,e.styles[t],s)}else{for(const[e,t]of n)"class"===e?i.removeClass(t,s):i.removeAttribute(e,s);e.classes&&i.removeClass(e.classes,s);for(const t in e.styles)i.removeStyle(t,s)}}}))}}}const oA=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,aA=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,lA=/^((\w+:(\/{2,})?)|(\W))/i,cA=["https?","ftps?","mailto"],hA="Ctrl+K";function dA(e,{writer:t}){const i=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,i),i}function uA(e,t=cA){const i=String(e),n=t.join("|");return function(e,t){const i=e.replace(oA,"");return!!i.match(t)}(i,new RegExp(`${"^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))".replace("",n)}`,"i"))?i:"#"}function mA(e,t){return!!e&&t.checkAttribute(e.name,"linkHref")}function gA(e,t){const i=(n=e,aA.test(n)?"mailto:":t);var n;const r=!!i&&!fA(e);return e&&r?i+e:e}function fA(e){return lA.test(e)}function pA(e){window.open(e,"_blank","noopener")}function wA(e){const t=e.plugins.has("BookmarkEditing")?e.plugins.get("BookmarkEditing"):null;return{isScrollableToTarget:function(e){return!!e&&e.startsWith("#")&&!!t&&!!t.getElementForBookmarkId(e.slice(1))},scrollToTarget:function(i){const n=i.slice(1),r=t.getElementForBookmarkId(n);e.model.change((e=>{e.setSelection(r,"on")})),e.editing.view.scrollToTheSelection({alignToTop:!0,forceScroll:!0})}}}class bA extends Cu{manualDecorators=new Xr;automaticDecorators=new sA;restoreManualDecoratorStates(){for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||es(t.getSelectedBlocks());mA(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(const e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}execute(e,t={}){const i=this.editor.model,n=i.document.selection,r=[],s=[];for(const e in t)t[e]?r.push(e):s.push(e);i.change((t=>{if(n.isCollapsed){const o=n.getFirstPosition();if(n.hasAttribute("linkHref")){const a=_A(n);let l=Mw(o,"linkHref",n.getAttribute("linkHref"),i);n.getAttribute("linkHref")===a&&(l=this._updateLinkContent(i,t,l,e)),t.setAttribute("linkHref",e,l),r.forEach((e=>{t.setAttribute(e,!0,l)})),s.forEach((e=>{t.removeAttribute(e,l)})),t.setSelection(t.createPositionAfter(l.end.nodeBefore))}else if(""!==e){const s=os(n.getAttributes());s.set("linkHref",e),r.forEach((e=>{s.set(e,!0)}));const{end:a}=i.insertContent(t.createText(e,s),o);t.setSelection(a)}["linkHref",...r,...s].forEach((e=>{t.removeSelectionAttribute(e)}))}else{const o=i.schema.getValidRanges(n.getRanges(),"linkHref"),a=[];for(const e of n.getSelectedBlocks())i.schema.checkAttribute(e,"linkHref")&&a.push(t.createRangeOn(e));const l=a.slice();for(const e of o)this._isRangeToUpdate(e,a)&&l.push(e);for(const o of l){let a=o;if(1===l.length){const r=_A(n);n.getAttribute("linkHref")===r&&(a=this._updateLinkContent(i,t,o,e),t.setSelection(t.createSelection(a)))}t.setAttribute("linkHref",e,a),r.forEach((e=>{t.setAttribute(e,!0,a)})),s.forEach((e=>{t.removeAttribute(e,a)}))}}}))}_getDecoratorStateFromModel(e){const t=this.editor.model,i=t.document.selection,n=i.getSelectedElement();return mA(n,t.schema)?n.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(const i of t)if(i.containsRange(e))return!1;return!0}_updateLinkContent(e,t,i,n){const r=t.createText(n,{linkHref:n});return e.insertContent(r,i)}}function _A(e){if(e.isCollapsed){const t=e.getFirstPosition();return t.textNode&&t.textNode.data}{const t=Array.from(e.getFirstRange().getItems());if(t.length>1)return null;const i=t[0];return i.is("$text")||i.is("$textProxy")?i.data:null}}class vA extends Cu{refresh(){const e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();mA(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){const e=this.editor,t=this.editor.model,i=t.document.selection,n=e.commands.get("link");t.change((e=>{const r=i.isCollapsed?[Mw(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(const t of r)if(e.removeAttribute("linkHref",t),n)for(const i of n.manualDecorators)e.removeAttribute(i.id,t)}))}}class yA extends(Nn()){id;defaultValue;label;attributes;classes;styles;constructor({id:e,label:t,attributes:i,classes:n,styles:r,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=i,this.classes=n,this.styles=r}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}}const kA="automatic",CA=/^(https?:)?\/\//;class xA extends yu{static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[kw,aw,D_]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1})}init(){const e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:dA}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(e,i)=>dA(uA(e,t),i)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:e=>e.getAttribute("href")}}),e.commands.add("link",new bA(e)),e.commands.add("unlink",new vA(e));const i=function(e,t){const i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach((e=>("label"in e&&i[e.label]&&(e.label=i[e.label]),e))),t}(e.t,function(e){const t=[];if(e)for(const[i,n]of Object.entries(e)){const e=Object.assign({},n,{id:`link${$k(i)}`});t.push(e)}return t}(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter((e=>e.mode===kA))),this._enableManualDecorators(i.filter((e=>"manual"===e.mode)));e.plugins.get(kw).registerAttribute("linkHref"),Lw(e,"linkHref","a","ck-link_selected"),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration()}_enableAutomaticDecorators(e){const t=this.editor,i=t.commands.get("link").automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:kA,callback:e=>!!e&&CA.test(e),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(e),i.length&&t.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;const t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach((e=>{t.model.schema.extend("$text",{allowAttributes:e.id});const n=new yA(e);i.add(n),t.conversion.for("downcast").attributeToElement({model:n.id,view:(e,{writer:t,schema:i},{item:r})=>{if((r.is("selection")||i.isInline(r))&&e){const e=t.createAttributeElement("a",n.attributes,{priority:5});n.classes&&t.addClass(n.classes,e);for(const i in n.styles)t.setStyle(i,n.styles[i],e);return t.setCustomProperty("link",!0,e),e}}}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...n._createPattern()},model:{key:n.id}})}))}_enableLinkOpen(){const e=this.editor,t=e.editing.view.document,i=wA(e);function n(e){i.isScrollableToTarget(e)?i.scrollToTarget(e):pA(e)}this.listenTo(t,"click",((e,t)=>{if(!(Ki.isMac?t.domEvent.metaKey:t.domEvent.ctrlKey))return;let i=t.domTarget;if("a"!=i.tagName.toLowerCase()&&(i=i.closest("a")),!i)return;const r=i.getAttribute("href");r&&(e.stop(),t.preventDefault(),n(r))}),{context:"$capture"}),this.listenTo(t,"keydown",((t,i)=>{const r=e.commands.get("link").value;!!r&&i.keyCode===Hr.enter&&i.altKey&&(t.stop(),n(r))}))}_enableSelectionAttributesFixer(){const e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",((i,{attributeKeys:n})=>{n.includes("linkHref")&&!t.hasAttribute("linkHref")&&e.change((t=>{var i;!function(e,t){e.removeSelectionAttribute("linkHref");for(const i of t)e.removeSelectionAttribute(i)}(t,(i=e.schema,i.getDefinition("$text").allowAttributes.filter((e=>e.startsWith("link")))))}))}))}_enableClipboardIntegration(){const e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",((e,n)=>{t.change((e=>{const t=e.createRangeIn(n.content);for(const n of t.getItems())if(n.hasAttribute("linkHref")){const t=gA(n.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,n)}}))}))}}class AA extends ig{focusTracker=new ts;keystrokes=new ss;urlInputView;saveButtonView;cancelButtonView;_manualDecoratorSwitches;children;_validators;_focusables=new Om;_focusCycler;constructor(e,t,i){super(e);const n=e.t;this._validators=i,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(n("Save"),Uu.check,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(n("Cancel"),Uu.cancel,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(t),this.children=this._createFormChildren(t.manualDecorators),this._focusCycler=new ug({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const r=["ck","ck-link-form","ck-responsive-form"];t.manualDecorators.length&&r.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:r,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce(((e,t)=>(e[t.name]=t.isOn,e)),{})}render(){super.render(),sg({view:this});[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createUrlInput(){const e=this.locale.t,t=new Qg(this.locale,Vf);return t.fieldView.inputMode="url",t.label=e("Link URL"),t}_createButton(e,t,i,n){const r=new cg(this.locale);return r.set({label:e,icon:t,tooltip:!0}),r.extendTemplate({attributes:{class:i}}),n&&r.delegate("execute").to(this,n),r}_createManualDecoratorSwitches(e){const t=this.createCollection();for(const i of e.manualDecorators){const n=new Ng(this.locale);n.set({name:i.id,label:i.label,withText:!0}),n.bind("isOn").toMany([i,e],"value",((e,t)=>void 0===t&&void 0===e?!!i.defaultValue:!!e)),n.on("execute",(()=>{i.set("value",!n.isOn)})),t.add(n)}return t}_createFormChildren(e){const t=this.createCollection();if(t.add(this.urlInputView),e.length){const e=new ig;e.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map((e=>({tag:"li",children:[e],attributes:{class:["ck","ck-list__item"]}}))),attributes:{class:["ck","ck-reset","ck-list"]}}),t.add(e)}return t.add(this.saveButtonView),t.add(this.cancelButtonView),t}get url(){const{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}}class TA extends ig{focusTracker=new ts;keystrokes=new ss;previewButtonView;unlinkButtonView;editButtonView;_focusables=new Om;_focusCycler;_linkConfig;_options;constructor(e,t={},i){super(e);const n=e.t;this._options=i,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(n("Unlink"),'',"unlink"),this.editButtonView=this._createButton(n("Edit link"),Uu.pencil,"edit"),this.set("href",void 0),this._linkConfig=t,this._focusCycler=new ug({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach((e=>{this._focusables.add(e),this.focusTracker.add(e.element)})),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createButton(e,t,i){const n=new cg(this.locale);return n.set({label:e,icon:t,tooltip:!0}),n.delegate("execute").to(this,i),n}_createPreviewButton(){const e=new cg(this.locale),t=this.bindTemplate,i=this.t;return e.set({withText:!0}),e.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:t.to("href",(e=>e&&uA(e,this._linkConfig.allowedProtocols))),target:"_blank",rel:"noopener noreferrer"},on:{click:t.to((e=>{this._options&&this._options.isScrollableToTarget(this.href)?(e.preventDefault(),this._options.scrollToTarget(this.href)):pA(this.href)}))}}),e.bind("tooltip").to(this,"href",(e=>this._options&&this._options.isScrollableToTarget(e)?i("Scroll to target"):i("Open link in new tab"))),e.bind("label").to(this,"href",(e=>e||i("This link has no URL"))),e.bind("isEnabled").to(this,"href",(e=>!!e)),e.template.tag="a",e}}var EA='';const SA="link-ui";class PA extends yu{actionsView=null;formView=null;_balloon;static get requires(){return[Op]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=this.editor.t;e.editing.view.addObserver(yd),this._balloon=e.plugins.get(Op),this._createToolbarLinkButton(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:SA,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:SA,view:(e,{writer:t})=>{if(!e.markerRange.isCollapsed)return null;const i=t.createUIElement("span");return t.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],i),i}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:hA},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.formView&&this.formView.destroy(),this.actionsView&&this.actionsView.destroy()}_createViews(){this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._enableUserBalloonInteractions()}_createActionsView(){const e=this.editor,t=new TA(e.locale,e.config.get("link"),wA(e)),i=e.commands.get("link"),n=e.commands.get("unlink");return t.bind("href").to(i,"value"),t.editButtonView.bind("isEnabled").to(i),t.unlinkButtonView.bind("isEnabled").to(n),this.listenTo(t,"edit",(()=>{this._addFormView()})),this.listenTo(t,"unlink",(()=>{e.execute("unlink"),this._hideUI()})),t.keystrokes.set("Esc",((e,t)=>{this._hideUI(),t()})),t.keystrokes.set(hA,((e,t)=>{this._addFormView(),t()})),t}_createFormView(){const e=this.editor,t=e.commands.get("link"),i=e.config.get("link.defaultProtocol"),n=new(rg(AA))(e.locale,t,function(e){const t=e.t,i=e.config.get("link.allowCreatingEmptyLinks");return[e=>{if(!i&&!e.url.length)return t("Link URL must not be empty.")}]}(e));return n.urlInputView.fieldView.bind("value").to(t,"value"),n.urlInputView.bind("isEnabled").to(t,"isEnabled"),n.saveButtonView.bind("isEnabled").to(t,"isEnabled"),this.listenTo(n,"submit",(()=>{if(n.isValid()){const{value:t}=n.urlInputView.fieldView.element,r=gA(t,i);e.execute("link",r,n.getDecoratorSwitchesState()),this._closeFormView()}})),this.listenTo(n.urlInputView,"change:errorText",(()=>{e.ui.update()})),this.listenTo(n,"cancel",(()=>{this._closeFormView()})),n.keystrokes.set("Esc",((e,t)=>{this._closeFormView(),t()})),n}_createToolbarLinkButton(){const e=this.editor;e.ui.componentFactory.add("link",(()=>{const e=this._createButton(cg);return e.set({tooltip:!0}),e})),e.ui.componentFactory.add("menuBar:link",(()=>{const e=this._createButton(Ig);return e.set({role:"menuitemcheckbox"}),e}))}_createButton(e){const t=this.editor,i=t.locale,n=t.commands.get("link"),r=new e(t.locale),s=i.t;return r.set({label:s("Link"),icon:EA,keystroke:hA,isToggleable:!0}),r.bind("isEnabled").to(n,"isEnabled"),r.bind("isOn").to(n,"value",(e=>!!e)),this.listenTo(r,"execute",(()=>this._showUI(!0))),r}_enableBalloonActivators(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",(()=>{this._getSelectedLinkElement()&&this._showUI()})),e.keystrokes.set(hA,((t,i)=>{i(),e.commands.get("link").isEnabled&&this._showUI(!0)}))}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",((e,t)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),t())}),{priority:"high"}),this.editor.keystrokes.set("Esc",((e,t)=>{this._isUIVisible&&(this._hideUI(),t())})),ng({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this.actionsView||this._createViews(),this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;const e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_closeFormView(){const e=this.editor.commands.get("link");e.restoreManualDecoratorStates(),void 0!==e.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this.formView.urlInputView.fieldView.reset(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const e=this.editor;this.stopListening(e.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const e=this.editor,t=e.editing.view.document;let i=this._getSelectedLinkElement(),n=s();const r=()=>{const e=this._getSelectedLinkElement(),t=s();i&&!e||!i&&t!==n?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=e,n=t};function s(){return t.selection.focus.getAncestors().reverse().find((e=>e.is("element")))}this.listenTo(e.ui,"update",r),this.listenTo(this._balloon,"change:visibleView",r)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _areActionsInPanel(){return!!this.actionsView&&this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return!!this.actionsView&&this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){const e=this._balloon.visibleView;return!!this.formView&&e==this.formView||this._areActionsVisible}_getBalloonPositionData(){const e=this.editor.editing.view,t=this.editor.model,i=e.document;let n;if(t.markers.has(SA)){const t=Array.from(this.editor.editing.mapper.markerNameToElements(SA)),i=e.createRange(e.createPositionBefore(t[0]),e.createPositionAfter(t[t.length-1]));n=e.domConverter.viewRangeToDom(i)}else n=()=>{const t=this._getSelectedLinkElement();return t?e.domConverter.mapViewToDom(t):e.domConverter.viewRangeToDom(i.selection.getFirstRange())};return{target:n}}_getSelectedLinkElement(){const e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&$b(i))return IA(t.getFirstPosition());{const i=t.getFirstRange().getTrimmed(),n=IA(i.start),r=IA(i.end);return n&&n==r&&e.createRangeIn(n).getTrimmed().isEqual(i)?n:null}}_showFakeVisualSelection(){const e=this.editor.model;e.change((t=>{const i=e.document.selection.getFirstRange();if(e.markers.has(SA))t.updateMarker(SA,{range:i});else if(i.start.isAtEnd){const n=i.start.getLastMatchingPosition((({item:t})=>!e.schema.isContent(t)),{boundaries:i});t.addMarker(SA,{usingOperation:!1,affectsData:!1,range:t.createRange(n,i.end)})}else t.addMarker(SA,{usingOperation:!1,affectsData:!1,range:i})}))}_hideFakeVisualSelection(){const e=this.editor.model;e.markers.has(SA)&&e.change((e=>{e.removeMarker(SA)}))}}function IA(e){return e.getAncestors().find((e=>{return(t=e).is("attributeElement")&&!!t.getCustomProperty("link");var t}))||null}const VA=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class RA extends yu{static get requires(){return[bw,xA]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.model.document.selection;e.on("change:range",(()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")})),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?Mw(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){const i=this.editor.model,n=i.document.selection,r=n.getFirstPosition(),s=n.getLastPosition();let o=t.getJoined(this._expandLinkRange(i,r)||t);o&&(o=o.getJoined(this._expandLinkRange(i,s)||t)),o&&(o.start.isBefore(r)||o.end.isAfter(s))&&e.setSelection(o)}_enablePasteLinking(){const e=this.editor,t=e.model,i=t.document.selection,n=e.plugins.get("ClipboardPipeline"),r=e.commands.get("link");n.on("inputTransformation",((e,n)=>{if(!this.isEnabled||!r.isEnabled||i.isCollapsed||"paste"!==n.method)return;if(i.rangeCount>1)return;const s=i.getFirstRange(),o=n.dataTransfer.getData("text/plain");if(!o)return;const a=o.match(VA);a&&a[2]===o&&(t.change((e=>{this._selectEntireLinks(e,s),r.execute(o)})),e.stop())}),{priority:"high"})}_enableTypingHandling(){const e=this.editor,t=new yw(e.model,(e=>{if(!function(e){return e.length>4&&" "===e[e.length-1]&&" "!==e[e.length-2]}(e))return;const t=BA(e.substr(0,e.length-1));return t?{url:t}:void 0}));t.on("matched:data",((t,i)=>{const{batch:n,range:r,url:s}=i;if(!n.isTyping)return;const o=r.end.getShiftedBy(-1),a=o.getShiftedBy(-s.length),l=e.model.createRange(a,o);this._applyAutoLink(s,l)})),t.bind("isEnabled").to(this)}_enableEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition();if(!e.parent.previousSibling)return;const i=t.createRangeIn(e.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)}))}_enableShiftEnterHandling(){const e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",(()=>{const e=t.document.selection.getFirstPosition(),i=t.createRange(t.createPositionAt(e.parent,0),e.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)}))}_checkAndApplyAutoLinkOnRange(e){const t=this.editor.model,{text:i,range:n}=vw(e,t),r=BA(i);if(r){const e=t.createRange(n.end.getShiftedBy(-r.length),n.end);this._applyAutoLink(r,e)}}_applyAutoLink(e,t){const i=this.editor.model,n=gA(e,this.editor.config.get("link.defaultProtocol"));this.isEnabled&&function(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}(t,i)&&fA(n)&&!function(e){const t=e.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}(t)&&this._persistAutoLink(n,t)}_persistAutoLink(e,t){const i=this.editor.model,n=this.editor.plugins.get("Delete");i.enqueueChange((r=>{r.setAttribute("linkHref",e,t),i.enqueueChange((()=>{n.requestUndoOnBackspace()}))}))}}function BA(e){const t=VA.exec(e);return t?t[2]:null}class OA{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward="forward"==t.direction,this._includeSelf=!!t.includeSelf,this._sameAttributes=Jr(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){return es(new this(e,t)[Symbol.iterator]())}*[Symbol.iterator](){const e=[];for(const{node:t}of new FA(this._getStartNode(),this._isForward?"forward":"backward")){const i=t.getAttribute("listIndent");if(ithis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some((e=>t.getAttribute(e)!==this._startElement.getAttribute(e))))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}}class FA{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(e,t="forward"){this._node=e,this._isForward="forward"===t}[Symbol.iterator](){return this}next(){if(!LA(this._node))return{done:!0,value:void 0};const e=this._node.getAttribute("listIndent");let t=null;if(this._previous){const i=this._previousNodeIndent;e>i?this._previousNodesByIndent[i]=this._previous:ee.getAttribute("listItemId")!=t))}function QA(e){return Array.from(e).filter((e=>"$graveyard"!==e.root.rootName)).sort(((e,t)=>e.index-t.index))}function YA(e){const t=e.document.selection.getSelectedElement();return t&&e.schema.isObject(t)&&e.schema.isBlock(t)?t:null}function XA(e,t){return t.checkChild(e.parent,"listItem")&&t.checkChild(e,"$text")&&!t.isObject(e)}function eT(e){return"numbered"==e||"customNumbered"==e}function tT(e,t,i){return zA(t,{direction:"forward"}).pop().index>e.index?GA(e,t,i):[]}class iT extends Cu{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){const e=this.editor.model,t=nT(e.document.selection);e.change((e=>{const i=[];JA(t)&&!WA(t[0])?("forward"==this._direction&&i.push(...KA(t,e)),i.push(...qA(t[0],e))):"forward"==this._direction?i.push(...KA(t,e,{expand:!0})):i.push(...function(e,t){const i=UA(e=Jr(e)),n=new Set,r=Math.min(...i.map((e=>e.getAttribute("listIndent")))),s=new Map;for(const e of i)s.set(e,OA.first(e,{lowerIndent:!0}));for(const e of i){if(n.has(e))continue;n.add(e);const i=e.getAttribute("listIndent")-1;if(i<0)ZA(e,t);else{if(e.getAttribute("listIndent")==r){const i=tT(e,s.get(e),t);for(const e of i)n.add(e);if(i.length)continue}t.setAttribute("listIndent",i,e)}}return QA(n)}(t,e));for(const t of i){if(!t.hasAttribute("listType"))continue;const i=OA.first(t,{sameIndent:!0});i&&e.setAttribute("listType",i.getAttribute("listType"),t)}this._fireAfterExecute(i)}))}_fireAfterExecute(e){this.fire("afterExecute",QA(new Set(e)))}_checkEnabled(){let e=nT(this.editor.model.document.selection),t=e[0];if(!t)return!1;if("backward"==this._direction)return!0;if(JA(e)&&!WA(e[0]))return!0;e=UA(e),t=e[0];const i=OA.first(t,{sameIndent:!0});return!!i&&i.getAttribute("listType")==t.getAttribute("listType")}}function nT(e){const t=Array.from(e.getSelectedBlocks()),i=t.findIndex((e=>!LA(e)));return-1!=i&&(t.length=i),t}class rT extends Cu{type;_listWalkerOptions;constructor(e,t,i={}){super(e),this.type=t,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){const t=this.editor.model,i=t.document,n=YA(t),r=Array.from(i.selection.getSelectedBlocks()).filter((e=>t.schema.checkAttribute(e,"listType")||XA(e,t.schema))),s=void 0!==e.forceValue?!e.forceValue:this.value;t.change((o=>{if(s){const e=r[r.length-1],t=zA(e,{direction:"forward"}),i=[];t.length>1&&i.push(...qA(t[1],o)),i.push(...ZA(r,o)),i.push(...function(e,t){const i=[];let n=Number.POSITIVE_INFINITY;for(const{node:r}of new FA(e.nextSibling)){const e=r.getAttribute("listIndent");if(0==e)break;e{const{firstElement:s,lastElement:o}=this._getMergeSubjectElements(i,e),a=s.getAttribute("listIndent")||0,l=o.getAttribute("listIndent"),c=o.getAttribute("listItemId");if(a!=l){const e=(h=o,Array.from(new OA(h,{direction:"forward",higherIndent:!0})));n.push(...KA([o,...e],r,{indentBy:a-l,expand:a{const t=qA(this._getStartBlock(),e);this._fireAfterExecute(t)}))}_fireAfterExecute(e){this.fire("afterExecute",QA(new Set(e)))}_checkEnabled(){const e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&LA(t)&&!WA(t)}_getStartBlock(){const e=this.editor.model.document.selection.getFirstPosition().parent;return"before"==this._direction?e:e.nextSibling}}class aT extends yu{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(e){return jA(e)}isFirstBlockOfListItem(e){return WA(e)}isListItemBlock(e){return LA(e)}expandListBlocksToCompleteItems(e,t={}){return UA(e,t)}isNumberedListType(e){return eT(e)}}function lT(e){return e.is("element","ol")||e.is("element","ul")}function cT(e){return e.is("element","li")}function hT(e,t,i,n=mT(i,t)){return e.createAttributeElement(uT(i),null,{priority:2*t/100-100,id:n})}function dT(e,t,i){return e.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:i})}function uT(e){return"numbered"==e||"customNumbered"==e?"ol":"ul"}function mT(e,t){return`list-${e}-${t}`}function gT(e,t){const i=e.nodeBefore;if(LA(i)){let e=i;for(const{node:i}of new FA(e,"backward"))if(e=i,t.has(e))return;t.set(i,e)}else{const i=e.nodeAfter;LA(i)&&t.set(i,i)}}function fT(){return(e,t,i)=>{const{writer:n,schema:r}=i;if(!t.modelRange)return;const s=Array.from(t.modelRange.getItems({shallow:!0})).filter((e=>r.checkAttribute(e,"listItemId")));if(!s.length)return;const o=NA.next(),a=function(e){let t=0,i=e.parent;for(;i;){if(cT(i))t++;else{const e=i.previousSibling;e&&cT(e)&&t++}i=i.parent}return t}(t.viewItem);let l=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted";const c=s[0].getAttribute("listType");c&&(l=c);const h={listItemId:o,listIndent:a,listType:l};for(const e of s)e.hasAttribute("listItemId")||n.setAttributes(h,e);s.length>1&&s[1].getAttribute("listItemId")!=h.listItemId&&i.keepEmptyElement(s[0])}}function pT(e,t,i,{dataPipeline:n}={}){const r=function(e){return(t,i)=>{const n=[];for(const i of e)t.hasAttribute(i)&&n.push(`attribute:${i}`);return!!n.every((e=>!1!==i.test(t,e)))&&(n.forEach((e=>i.consume(t,e))),!0)}}(e);return(s,o,a)=>{const{writer:l,mapper:c,consumable:h}=a,d=o.item;if(!e.includes(o.attributeKey))return;if(!r(d,h))return;const u=function(e,t,i){const n=i.createRangeOn(e),r=t.toViewRange(n).getTrimmed();return r.end.nodeBefore}(d,c,i);bT(u,l,c),function(e,t){let i=e.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){const n=i.parent;t.unwrap(t.createRangeOn(e),i),i=n}}(u,l);const m=function(e,t,i,n,{dataPipeline:r}){let s=n.createRangeOn(t);if(!WA(e))return s;for(const o of i){if("itemMarker"!=o.scope)continue;const i=o.createElement(n,e,{dataPipeline:r});if(!i)continue;if(n.setCustomProperty("listItemMarker",!0,i),o.canInjectMarkerIntoElement&&o.canInjectMarkerIntoElement(e)?n.insert(n.createPositionAt(t,0),i):(n.insert(s.start,i),s=n.createRange(n.createPositionBefore(i),n.createPositionAfter(t))),!o.createWrapperElement||!o.canWrapElement)continue;const a=o.createWrapperElement(n,e,{dataPipeline:r});n.setCustomProperty("listItemWrapper",!0,a),o.canWrapElement(e)?s=n.wrap(s,a):(s=n.wrap(n.createRangeOn(i),a),s=n.createRange(s.start,n.createPositionAfter(t)))}return s}(d,u,t,l,{dataPipeline:n});!function(e,t,i,n){if(!e.hasAttribute("listIndent"))return;const r=e.getAttribute("listIndent");let s=e;for(let e=r;e>=0;e--){const r=dT(n,e,s.getAttribute("listItemId")),o=hT(n,e,s.getAttribute("listType"));for(const e of i)"list"!=e.scope&&"item"!=e.scope||!s.hasAttribute(e.attributeName)||e.setAttributeOnDowncast(n,s.getAttribute(e.attributeName),"list"==e.scope?o:r);if(t=n.wrap(t,r),t=n.wrap(t,o),0==e)break;if(s=OA.first(s,{lowerIndent:!0}),!s)break}}(d,m,t,l)}}function wT(e,{dataPipeline:t}={}){return(i,{writer:n})=>{if(!_T(i,e))return null;if(!t)return n.createContainerElement("span",{class:"ck-list-bogus-paragraph"});const r=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,r),r}}function bT(e,t,i){for(;e.parent.is("attributeElement")&&e.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(e),e.parent);const n=[];r(t.createPositionBefore(e).getWalker({direction:"backward"})),r(t.createRangeIn(e).getWalker());for(const e of n)t.remove(e);function r(e){for(const{item:t}of e){if(t.is("element")&&i.toModelElement(t))break;t.is("element")&&t.getCustomProperty("listItemMarker")&&n.push(t)}}}function _T(e,t,i=DA(e)){if(!LA(e))return!1;for(const i of e.getAttributeKeys())if(!i.startsWith("selection:")&&!t.includes(i))return!1;return i.length<2}const vT=["listType","listIndent","listItemId"];class yT extends yu{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Ab,bw,aT,D_]}constructor(e){super(e),e.config.define("list.multiBlock",!0)}init(){const e=this.editor,t=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new gn("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:vT}),i?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(const e of vT)t.schema.setAttributeProperties(e,{copyOnReplace:!0});e.commands.add("numberedList",new rT(e,"numbered")),e.commands.add("bulletedList",new rT(e,"bulleted")),e.commands.add("customNumberedList",new rT(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new rT(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new iT(e,"forward")),e.commands.add("outdentList",new iT(e,"backward")),e.commands.add("splitListItemBefore",new oT(e,"before")),e.commands.add("splitListItemAfter",new oT(e,"after")),i&&(e.commands.add("mergeListItemBackward",new sT(e,"backward")),e.commands.add("mergeListItemForward",new sT(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration()}afterInit(){const e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...vT,...this._downcastStrategies.map((e=>e.attributeName))]}_setupDeleteIntegration(){const e=this.editor,t=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",((n,r)=>{const s=e.model.document.selection;YA(e.model)||e.model.change((()=>{const o=s.getFirstPosition();if(s.isCollapsed&&"backward"==r.direction){if(!o.isAtStart)return;const i=o.parent;if(!LA(i))return;if(OA.first(i,{sameAttributes:"listType",sameIndent:!0})||0!==i.getAttribute("listIndent")){if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:kT(e.model,"backward")})}else $A(i)||e.execute("splitListItemAfter"),e.execute("outdentList");r.preventDefault(),n.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd)return;if(!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:kT(e.model,"forward")}),r.preventDefault(),n.stop()}}))}),{context:"li"})}_setupEnterIntegration(){const e=this.editor,t=e.model,i=e.commands,n=i.get("enter");this.listenTo(e.editing.view.document,"enter",((i,n)=>{const r=t.document,s=r.selection.getFirstPosition().parent;if(r.selection.isCollapsed&&LA(s)&&s.isEmpty&&!n.isSoft){const t=WA(s),r=$A(s);t&&r?(e.execute("outdentList"),n.preventDefault(),i.stop()):t&&!r?(e.execute("splitListItemAfter"),n.preventDefault(),i.stop()):r&&(e.execute("splitListItemBefore"),n.preventDefault(),i.stop())}}),{context:"li"}),this.listenTo(n,"afterExecute",(()=>{const t=i.get("splitListItemBefore");if(t.refresh(),!t.isEnabled)return;2===DA(e.model.document.selection.getLastPosition().parent).length&&t.execute()}))}_setupTabIntegration(){const e=this.editor;this.listenTo(e.editing.view.document,"tab",((t,i)=>{const n=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(n).isEnabled&&(e.execute(n),i.stopPropagation(),i.preventDefault(),t.stop())}),{context:"li"})}_setupConversion(){const e=this.editor,t=e.model,i=this.getListAttributeNames(),n=e.config.get("list.multiBlock"),r=n?"paragraph":"listItem";e.conversion.for("upcast").elementToElement({view:"li",model:(e,{writer:t})=>t.createElement(r,{listType:""})}).elementToElement({view:"p",model:(e,{writer:t})=>e.parent&&e.parent.is("element","li")?t.createElement(r,{listType:""}):null,converterPriority:"high"}).add((e=>{e.on("element:li",fT())})),n||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:r,view:wT(i),converterPriority:"high"}).add((e=>{var n;e.on("attribute",pT(i,this._downcastStrategies,t)),e.on("remove",(n=t.schema,(e,t,i)=>{const{writer:r,mapper:s}=i,o=e.name.split(":")[1];if(!n.checkAttribute(o,"listItemId"))return;const a=s.toViewPosition(t.position),l=t.position.getShiftedBy(t.length),c=s.toViewPosition(l,{isPhantom:!0}),h=r.createRange(a,c).getTrimmed().end.nodeBefore;h&&bT(h,r,s)}))})),e.conversion.for("dataDowncast").elementToElement({model:r,view:wT(i,{dataPipeline:!0}),converterPriority:"high"}).add((e=>{e.on("attribute",pT(i,this._downcastStrategies,t,{dataPipeline:!0}))}));const s=(o=this._downcastStrategies,a=e.editing.view,(e,t)=>{if(t.modelPosition.offset>0)return;const i=t.modelPosition.parent;if(!LA(i))return;if(!o.some((e=>"itemMarker"==e.scope&&e.canInjectMarkerIntoElement&&e.canInjectMarkerIntoElement(i))))return;const n=t.mapper.toViewElement(i),r=a.createRangeIn(n),s=r.getWalker();let l=r.start;for(const{item:e}of s){if(e.is("element")&&t.mapper.toModelElement(e)||e.is("$textProxy"))break;e.is("element")&&e.getCustomProperty("listItemMarker")&&(l=a.createPositionAfter(e),s.skip((({previousPosition:e})=>!e.isEqual(l))))}t.viewPosition=l});var o,a;e.editing.mapper.on("modelToViewPosition",s),e.data.mapper.on("modelToViewPosition",s),this.listenTo(t.document,"change:data",function(e,t,i,n){return()=>{const n=e.document.differ.getChanges(),o=[],a=new Map,l=new Set;for(const e of n)if("insert"==e.type&&"$text"!=e.name)gT(e.position,a),e.attributes.has("listItemId")?l.add(e.position.nodeAfter):gT(e.position.getShiftedBy(e.length),a);else if("remove"==e.type&&e.attributes.has("listItemId"))gT(e.position,a);else if("attribute"==e.type){const t=e.range.start.nodeAfter;i.includes(e.attributeKey)?(gT(e.range.start,a),null===e.attributeNewValue?(gT(e.range.start.getShiftedBy(1),a),s(t)&&o.push(t)):l.add(t)):LA(t)&&s(t)&&o.push(t)}for(const e of a.values())o.push(...r(e,l));for(const e of new Set(o))t.reconvertItem(e)};function r(e,t){const n=[],r=new Set,a=[];for(const{node:l,previous:c}of new FA(e)){if(r.has(l))continue;const e=l.getAttribute("listIndent");c&&ei.includes(e))));const h=zA(l,{direction:"forward"});for(const e of h)r.add(e),(s(e,h)||o(e,a,t))&&n.push(e)}return n}function s(e,r){const s=t.mapper.toViewElement(e);if(!s)return!1;if(n.fire("checkElement",{modelElement:e,viewElement:s}))return!0;if(!e.is("element","paragraph")&&!e.is("element","listItem"))return!1;const o=_T(e,i,r);return!(!o||!s.is("element","p"))||!(o||!s.is("element","span"))}function o(e,i,r){if(r.has(e))return!1;const s=t.mapper.toViewElement(e);let o=i.length-1;for(let e=s.parent;!e.is("editableElement");e=e.parent){const t=cT(e),r=lT(e);if(!r&&!t)continue;const s="checkAttributes:"+(t?"item":"list");if(n.fire(s,{viewElement:e,modelAttributes:i[o]}))break;if(r&&(o--,o<0))return!1}return!0}}(t,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",((e,{viewElement:t,modelAttributes:i})=>{t.id!=i.listItemId&&(e.return=!0,e.stop())})),this.on("checkAttributes:list",((e,{viewElement:t,modelAttributes:i})=>{t.name==uT(i.listType)&&t.id==mT(i.listType,i.listIndent)||(e.return=!0,e.stop())}))}_setupModelPostFixing(){const e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer((i=>function(e,t,i,n){const r=e.document.differ.getChanges(),s=new Map,o=n.editor.config.get("list.multiBlock");let a=!1;for(const n of r){if("insert"==n.type&&"$text"!=n.name){const r=n.position.nodeAfter;if(!e.schema.checkAttribute(r,"listItemId"))for(const e of Array.from(r.getAttributeKeys()))i.includes(e)&&(t.removeAttribute(e,r),a=!0);gT(n.position,s),n.attributes.has("listItemId")||gT(n.position.getShiftedBy(n.length),s);for(const{item:t,previousPosition:i}of e.createRangeIn(r))LA(t)&&gT(i,s)}else"remove"==n.type?gT(n.position,s):"attribute"==n.type&&i.includes(n.attributeKey)&&(gT(n.range.start,s),null===n.attributeNewValue&&gT(n.range.start.getShiftedBy(1),s));if(!o&&"attribute"==n.type&&vT.includes(n.attributeKey)){const e=n.range.start.nodeAfter;null===n.attributeNewValue&&e&&e.is("element","listItem")?(t.rename(e,"paragraph"),a=!0):null===n.attributeOldValue&&e&&e.is("element")&&"listItem"!=e.name&&(t.rename(e,"listItem"),a=!0)}}const l=new Set;for(const e of s.values())a=n.fire("postFixer",{listNodes:new MA(e),listHead:e,writer:t,seenIds:l})||a;return a}(e,i,t,this))),this.on("postFixer",((e,{listNodes:t,writer:i})=>{e.return=function(e,t){let i=0,n=-1,r=null,s=!1;for(const{node:o}of e){const e=o.getAttribute("listIndent");if(e>i){let a;null===r?(r=e-i,a=i):(r>e&&(r=e),a=e-r),a>n+1&&(a=n+1),t.setAttribute("listIndent",a,o),s=!0,n=a}else r=null,i=e+1,n=e}return s}(t,i)||e.return}),{priority:"high"}),this.on("postFixer",((e,{listNodes:t,writer:i,seenIds:n})=>{e.return=function(e,t,i){const n=new Set;let r=!1;for(const{node:s}of e){if(n.has(s))continue;let e=s.getAttribute("listType"),o=s.getAttribute("listItemId");if(t.has(o)&&(o=NA.next()),t.add(o),s.is("element","listItem"))s.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,s),r=!0);else for(const t of zA(s,{direction:"forward"}))n.add(t),t.getAttribute("listType")!=e&&(o=NA.next(),e=t.getAttribute("listType")),t.getAttribute("listItemId")!=o&&(i.setAttribute("listItemId",o,t),r=!0)}return r}(t,n,i)||e.return}),{priority:"high"})}_setupClipboardIntegration(){const e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",function(e){return(t,[i,n])=>{const r=i.is("documentFragment")?Array.from(i.getChildren()):[i];if(!r.length)return;const s=(n?e.createSelection(n):e.document.selection).getFirstPosition();let o;if(LA(s.parent))o=s.parent;else{if(!LA(s.nodeBefore)||!LA(s.nodeAfter))return;o=s.nodeBefore}e.change((e=>{const t=o.getAttribute("listType"),i=o.getAttribute("listIndent"),n=r[0].getAttribute("listIndent")||0,s=Math.max(i-n,0);for(const i of r){const n=LA(i);o.is("element","listItem")&&i.is("element","paragraph")&&e.rename(i,"listItem"),e.setAttributes({listIndent:(n?i.getAttribute("listIndent"):0)+s,listItemId:n?i.getAttribute("listItemId"):NA.next(),listType:t},i)}}))}}(e),{priority:"high"}),this.listenTo(t,"outputTransformation",((t,i)=>{e.change((e=>{const t=Array.from(i.content.getChildren()),n=t[t.length-1];if(t.length>1&&n.is("element")&&n.isEmpty){t.slice(0,-1).every(LA)&&e.remove(n)}if("copy"==i.method||"cut"==i.method){const t=Array.from(i.content.getChildren());JA(t)&&ZA(t,e)}}))}))}_setupAccessibilityIntegration(){const e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}}function kT(e,t){const i=e.document.selection;if(!i.isCollapsed)return!YA(e);if("forward"===t)return!0;const n=i.getFirstPosition().parent,r=n.previousSibling;return!e.schema.isObject(r)&&(!!r.isEmpty||JA([n,r]))}function CT(e,t,i,n){e.ui.componentFactory.add(t,(()=>{const r=xT(cg,e,t,i,n);return r.set({tooltip:!0,isToggleable:!0}),r})),e.ui.componentFactory.add(`menuBar:${t}`,(()=>{const r=xT(Ig,e,t,i,n);return r.set({role:"menuitemcheckbox",isToggleable:!0}),r}))}function xT(e,t,i,n,r){const s=t.commands.get(i),o=new e(t.locale);return o.set({label:n,icon:r}),o.bind("isOn","isEnabled").to(s,"value","isEnabled"),o.on("execute",(()=>{t.execute(i),t.editing.view.focus()})),o}class AT extends yu{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){const e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||CT(this.editor,"numberedList",e("Numbered List"),Uu.numberedList),this.editor.ui.componentFactory.has("bulletedList")||CT(this.editor,"bulletedList",e("Bulleted List"),Uu.bulletedList)}}class TT extends yu{static get requires(){return[yT,AT]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}}const ET={},ST={},PT={},IT=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"}];for(const{listStyle:e,typeAttribute:t,listType:i}of IT)ET[e]=i,ST[e]=t,t&&(PT[t]=e);function VT(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let RT={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const BT=/[&<>"']/,OT=/[&<>"']/g,FT=/[<>"']|&(?!#?\w+;)/,MT=/[<>"']|&(?!#?\w+;)/g,NT={"&":"&","<":"<",">":">",'"':""","'":"'"},LT=e=>NT[e];function DT(e,t){if(t){if(BT.test(e))return e.replace(OT,LT)}else if(FT.test(e))return e.replace(MT,LT);return e}const zT=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function HT(e){return e.replace(zT,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const WT=/(^|[^\[])\^/g;function $T(e,t){e=e.source||e,t=t||"";const i={replace:(t,n)=>(n=(n=n.source||n).replace(WT,"$1"),e=e.replace(t,n),i),getRegex:()=>new RegExp(e,t)};return i}const UT=/[^\w:]/g,jT=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function qT(e,t,i){if(e){let e;try{e=decodeURIComponent(HT(i)).replace(UT,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!jT.test(i)&&(i=function(e,t){GT[" "+e]||(KT.test(e)?GT[" "+e]=e+"/":GT[" "+e]=eE(e,"/",!0));e=GT[" "+e];const i=-1===e.indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(ZT,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(JT,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}const GT={},KT=/^[^:]+:\/*[^/]*$/,ZT=/^([^:]+:)[\s\S]*$/,JT=/^([^:]+:\/*[^/]*)[\s\S]*$/;const QT={exec:function(){}};function YT(e){let t,i,n=1;for(;n{let n=!1,r=t;for(;--r>=0&&"\\"===i[r];)n=!n;return n?"|":" |"})).split(/ \|/);let n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function nE(e,t,i,n){const r=t.href,s=t.title?DT(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;const e={type:"link",raw:i,href:r,title:s,text:o,tokens:n.inlineTokens(o,[])};return n.state.inLink=!1,e}return{type:"image",raw:i,href:r,title:s,text:DT(o)}}class rE{constructor(e){this.options=e||RT}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:eE(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],i=function(e,t){const i=e.match(/^(\s+)(?:```)/);if(null===i)return t;const n=i[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[i]=t;return i.length>=n.length?e.slice(n.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=eE(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const i={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,n,r,s,o,a,l,c,h,d,u,m,g=t[1].trim();const f=g.length>1,p={type:"list",raw:"",ordered:f,start:f?+g.slice(0,-1):"",loose:!1,items:[]};g=f?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=f?g:"[*+-]");const w=new RegExp(`^( {0,3}${g})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(m=!1,t=w.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),c=t[2].split("\n",1)[0],h=e.split("\n",1)[0],this.options.pedantic?(s=2,u=c.trimLeft()):(s=t[2].search(/[^ ]/),s=s>4?1:s,u=c.slice(s),s+=t[1].length),a=!1,!c&&/^ *$/.test(h)&&(i+=h+"\n",e=e.substring(h.length+1),m=!0),!m){const t=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(d=e.split("\n",1)[0],c=d,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(c));){if(c.search(/[^ ]/)>=s||!c.trim())u+="\n"+c.slice(s);else{if(a)break;u+="\n"+c}a||c.trim()||(a=!0),i+=d+"\n",e=e.substring(d.length+1)}}p.loose||(l?p.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(u),n&&(r="[ ] "!==n[0],u=u.replace(/^\[[ xX]\] +/,""))),p.items.push({type:"list_item",raw:i,task:!!n,checked:r,loose:!1,text:u}),p.raw+=i}p.items[p.items.length-1].raw=i.trimRight(),p.items[p.items.length-1].text=u.trimRight(),p.raw=p.raw.trimRight();const b=p.items.length;for(o=0;o"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let i=0;for(const e of t)if("\n"===e&&(i+=1),i>1)return!0;return!1}));!p.loose&&e.length&&t&&(p.loose=!0,p.items[o].loose=!0)}return p}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):DT(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:XT(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let i,n,r,s,o=e.align.length;for(i=0;i({text:e})));for(o=e.header.length,n=0;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):DT(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=eE(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const i=e.length;let n=0,r=0;for(;r-1){const i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],n="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e&&(i=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^$/.test(e)?i.slice(1):i.slice(1,-1)),nE(t,{href:i?i.replace(this.rules.inline._escapes,"$1"):i,title:n?n.replace(this.rules.inline._escapes,"$1"):n},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let e=(i[2]||i[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return nE(i,e,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n)return;if(n[3]&&i.match(/[\p{L}\p{N}]/u))return;const r=n[1]||n[2]||"";if(!r||r&&(""===i||this.rules.inline.punctuation.exec(i))){const i=n[0].length-1;let r,s,o=i,a=0;const l="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!=(n=l.exec(t));){if(r=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!r)continue;if(s=r.length,n[3]||n[4]){o+=s;continue}if((n[5]||n[6])&&i%3&&!((i+s)%3)){a+=s;continue}if(o-=s,o>0)continue;if(s=Math.min(s,s+o+a),Math.min(i,s)%2){const t=e.slice(1,i+n.index+s);return{type:"em",raw:e.slice(0,i+n.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,i+n.index+s-1);return{type:"strong",raw:e.slice(0,i+n.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const i=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return i&&n&&(e=e.substring(1,e.length-1)),e=DT(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const i=this.rules.inline.autolink.exec(e);if(i){let e,n;return"@"===i[2]?(e=DT(this.options.mangle?t(i[1]):i[1]),n="mailto:"+e):(e=DT(i[1]),n=e),{type:"link",raw:i[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let e,n;if("@"===i[2])e=DT(this.options.mangle?t(i[0]):i[0]),n="mailto:"+e;else{let t;do{t=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(t!==i[0]);e=DT(i[0]),n="www."===i[1]?"http://"+e:e}return{type:"link",raw:i[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const i=this.rules.inline.text.exec(e);if(i){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):DT(i[0]):i[0]:DT(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:e}}}}const sE={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:QT,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};sE.def=$T(sE.def).replace("label",sE._label).replace("title",sE._title).getRegex(),sE.bullet=/(?:[*+-]|\d{1,9}[.)])/,sE.listItemStart=$T(/^( *)(bull) */).replace("bull",sE.bullet).getRegex(),sE.list=$T(sE.list).replace(/bull/g,sE.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+sE.def.source+")").getRegex(),sE._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",sE._comment=/|$)/,sE.html=$T(sE.html,"i").replace("comment",sE._comment).replace("tag",sE._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sE.paragraph=$T(sE._paragraph).replace("hr",sE.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",sE._tag).getRegex(),sE.blockquote=$T(sE.blockquote).replace("paragraph",sE.paragraph).getRegex(),sE.normal=YT({},sE),sE.gfm=YT({},sE.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),sE.gfm.table=$T(sE.gfm.table).replace("hr",sE.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",sE._tag).getRegex(),sE.gfm.paragraph=$T(sE._paragraph).replace("hr",sE.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",sE.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",sE._tag).getRegex(),sE.pedantic=YT({},sE.normal,{html:$T("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",sE._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:QT,paragraph:$T(sE.normal._paragraph).replace("hr",sE.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",sE.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const oE={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:QT,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:QT,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}oE._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",oE.punctuation=$T(oE.punctuation).replace(/punctuation/g,oE._punctuation).getRegex(),oE.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,oE.escapedEmSt=/\\\*|\\_/g,oE._comment=$T(sE._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),oE.emStrong.lDelim=$T(oE.emStrong.lDelim).replace(/punct/g,oE._punctuation).getRegex(),oE.emStrong.rDelimAst=$T(oE.emStrong.rDelimAst,"g").replace(/punct/g,oE._punctuation).getRegex(),oE.emStrong.rDelimUnd=$T(oE.emStrong.rDelimUnd,"g").replace(/punct/g,oE._punctuation).getRegex(),oE._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oE._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oE._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,oE.autolink=$T(oE.autolink).replace("scheme",oE._scheme).replace("email",oE._email).getRegex(),oE._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oE.tag=$T(oE.tag).replace("comment",oE._comment).replace("attribute",oE._attribute).getRegex(),oE._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oE._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,oE._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oE.link=$T(oE.link).replace("label",oE._label).replace("href",oE._href).replace("title",oE._title).getRegex(),oE.reflink=$T(oE.reflink).replace("label",oE._label).replace("ref",sE._label).getRegex(),oE.nolink=$T(oE.nolink).replace("ref",sE._label).getRegex(),oE.reflinkSearch=$T(oE.reflinkSearch,"g").replace("reflink",oE.reflink).replace("nolink",oE.nolink).getRegex(),oE.normal=YT({},oE),oE.pedantic=YT({},oE.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:$T(/^!?\[(label)\]\((.*?)\)/).replace("label",oE._label).getRegex(),reflink:$T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oE._label).getRegex()}),oE.gfm=YT({},oE.normal,{escape:$T(oE.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),n=t[t.length-1],!n||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startBlock.forEach((function(e){n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(r)))n=t[t.length-1],s&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),s=r.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,n,r,s,o,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+iE("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,s.index)+"["+iE("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,s.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),n=t[t.length-1],n&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,l,a))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,lE))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,lE))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const i=e.slice(1);let n;this.options.extensions.startInline.forEach((function(e){n=e.call({lexer:this},i),"number"==typeof n&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(i=this.tokenizer.inlineText(r,aE))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(a=i.raw.slice(-1)),o=!0,n=t[t.length-1],n&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(i.raw.length),t.push(i);return t}}class hE{constructor(e){this.options=e||RT}code(e,t,i){const n=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,n);null!=t&&t!==e&&(i=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",n?'
    '+(i?e:DT(e,!0))+"
    \n":"
    "+(i?e:DT(e,!0))+"
    \n"}blockquote(e){return"
    \n"+e+"
    \n"}html(e){return e}heading(e,t,i,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"}hr(){return this.options.xhtml?"
    \n":"
    \n"}list(e,t,i){const n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"}listitem(e){return"
  • "+e+"
  • \n"}checkbox(e){return" "}paragraph(e){return"

    "+e+"

    \n"}table(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return"\n"+e+"\n"}tablecell(e,t){const i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"}strong(e){return""+e+""}em(e){return""+e+""}codespan(e){return""+e+""}br(){return this.options.xhtml?"
    ":"
    "}del(e){return""+e+""}link(e,t,i){if(null===(e=qT(this.options.sanitize,this.options.baseUrl,e)))return i;let n='
    ",n}image(e,t,i){if(null===(e=qT(this.options.sanitize,this.options.baseUrl,e)))return i;let n=''+i+'":">",n}text(e){return e}}class dE{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}class uE{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{n++,i=e+"-"+n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i}slug(e,t={}){const i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}}class mE{constructor(e){this.options=e||RT,this.options.renderer=this.options.renderer||new hE,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new dE,this.slugger=new uE}static parse(e,t){return new mE(t).parse(e)}static parseInline(e,t){return new mE(t).parseInline(e)}parse(e,t=!0){let i,n,r,s,o,a,l,c,h,d,u,m,g,f,p,w,b,_,v,y="";const k=e.length;for(i=0;i0&&"paragraph"===p.tokens[0].type?(p.tokens[0].text=_+" "+p.tokens[0].text,p.tokens[0].tokens&&p.tokens[0].tokens.length>0&&"text"===p.tokens[0].tokens[0].type&&(p.tokens[0].tokens[0].text=_+" "+p.tokens[0].tokens[0].text)):p.tokens.unshift({type:"text",text:_}):f+=_),f+=this.parse(p.tokens,g),h+=this.renderer.listitem(f,b,w);y+=this.renderer.list(h,u,m);continue;case"html":y+=this.renderer.html(d.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(h=d.tokens?this.parseInline(d.tokens):d.text;i+1{n(e.text,e.lang,(function(t,i){if(t)return s(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),o--,0===o&&s()}))}),0))})),void(0===o&&s())}try{const i=cE.lex(e,t);return t.walkTokens&&gE.walkTokens(i,t.walkTokens),mE.parse(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+DT(e.message+"",!0)+"
    ";throw e}}gE.options=gE.setOptions=function(e){var t;return YT(gE.defaults,e),t=gE.defaults,RT=t,gE},gE.getDefaults=VT,gE.defaults=RT,gE.use=function(...e){const t=YT({},...e),i=gE.defaults.extensions||{renderers:{},childTokens:{}};let n;e.forEach((e=>{if(e.extensions&&(n=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=i.renderers?i.renderers[e.name]:null;i.renderers[e.name]=t?function(...i){let n=e.renderer.apply(this,i);return!1===n&&(n=t.apply(this,i)),n}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");i[e.level]?i[e.level].unshift(e.tokenizer):i[e.level]=[e.tokenizer],e.start&&("block"===e.level?i.startBlock?i.startBlock.push(e.start):i.startBlock=[e.start]:"inline"===e.level&&(i.startInline?i.startInline.push(e.start):i.startInline=[e.start]))}e.childTokens&&(i.childTokens[e.name]=e.childTokens)}))),e.renderer){const i=gE.defaults.renderer||new hE;for(const t in e.renderer){const n=i[t];i[t]=(...r)=>{let s=e.renderer[t].apply(i,r);return!1===s&&(s=n.apply(i,r)),s}}t.renderer=i}if(e.tokenizer){const i=gE.defaults.tokenizer||new rE;for(const t in e.tokenizer){const n=i[t];i[t]=(...r)=>{let s=e.tokenizer[t].apply(i,r);return!1===s&&(s=n.apply(i,r)),s}}t.tokenizer=i}if(e.walkTokens){const i=gE.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),i&&i.call(this,t)}}n&&(t.extensions=i),gE.setOptions(t)}))},gE.walkTokens=function(e,t){for(const i of e)switch(t.call(gE,i),i.type){case"table":for(const e of i.header)gE.walkTokens(e.tokens,t);for(const e of i.rows)for(const i of e)gE.walkTokens(i.tokens,t);break;case"list":gE.walkTokens(i.items,t);break;default:gE.defaults.extensions&&gE.defaults.extensions.childTokens&&gE.defaults.extensions.childTokens[i.type]?gE.defaults.extensions.childTokens[i.type].forEach((function(e){gE.walkTokens(i[e],t)})):i.tokens&&gE.walkTokens(i.tokens,t)}},gE.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");tE(t=YT({},gE.defaults,t||{}));try{const i=cE.lexInline(e,t);return t.walkTokens&&gE.walkTokens(i,t.walkTokens),mE.parseInline(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+DT(e.message+"",!0)+"
    ";throw e}},gE.Parser=mE,gE.parser=mE.parse,gE.Renderer=hE,gE.TextRenderer=dE,gE.Lexer=cE,gE.lexer=cE.lex,gE.Tokenizer=rE,gE.Slugger=uE,gE.parse=gE;gE.options,gE.setOptions,gE.use,gE.walkTokens,gE.parseInline,mE.parse,cE.lex;function fE(e,t){return Array(t+1).join(e)}var pE=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function wE(e){return yE(e,pE)}var bE=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function _E(e){return yE(e,bE)}var vE=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function yE(e,t){return t.indexOf(e.nodeName)>=0}function kE(e,t){return e.getElementsByTagName&&t.some((function(t){return e.getElementsByTagName(t).length}))}var CE={};function xE(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function AE(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function TE(e,t,i){for(var n=0;n-1)return!0}else{if("function"!=typeof n)throw new TypeError("`filter` needs to be a string, array, or function");if(n.call(e,t,i))return!0}}function SE(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function PE(e,t,i){return e&&e.parentNode===t||i(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}CE.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},CE.lineBreak={filter:"br",replacement:function(e,t,i){return i.br+"\n"}},CE.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,i){var n=Number(t.nodeName.charAt(1));return"setext"===i.headingStyle&&n<3?"\n\n"+e+"\n"+fE(1===n?"=":"-",e.length)+"\n\n":"\n\n"+fE("#",n)+" "+e+"\n\n"}},CE.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},CE.list={filter:["ul","ol"],replacement:function(e,t){var i=t.parentNode;return"LI"===i.nodeName&&i.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},CE.listItem={filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var n=i.bulletListMarker+" ",r=t.parentNode;if("OL"===r.nodeName){var s=r.getAttribute("start"),o=Array.prototype.indexOf.call(r.children,t);n=(s?Number(s)+o:o+1)+". "}return n+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},CE.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},CE.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){for(var n,r=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],s=t.firstChild.textContent,o=i.fence.charAt(0),a=3,l=new RegExp("^"+o+"{3,}","gm");n=l.exec(s);)n[0].length>=a&&(a=n[0].length+1);var c=fE(o,a);return"\n\n"+c+r+"\n"+s.replace(/\n$/,"")+"\n"+c+"\n\n"}},CE.horizontalRule={filter:"hr",replacement:function(e,t,i){return"\n\n"+i.hr+"\n\n"}},CE.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var i=t.getAttribute("href");i&&(i=i.replace(/([()])/g,"\\$1"));var n=xE(t.getAttribute("title"));return n&&(n=' "'+n.replace(/"/g,'\\"')+'"'),"["+e+"]("+i+n+")"}},CE.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,i){var n,r,s=t.getAttribute("href"),o=xE(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),i.linkReferenceStyle){case"collapsed":n="["+e+"][]",r="["+e+"]: "+s+o;break;case"shortcut":n="["+e+"]",r="["+e+"]: "+s+o;break;default:var a=this.references.length+1;n="["+e+"]["+a+"]",r="["+a+"]: "+s+o}return this.references.push(r),n},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},CE.emphasis={filter:["em","i"],replacement:function(e,t,i){return e.trim()?i.emDelimiter+e+i.emDelimiter:""}},CE.strong={filter:["strong","b"],replacement:function(e,t,i){return e.trim()?i.strongDelimiter+e+i.strongDelimiter:""}},CE.code={filter:function(e){var t=e.previousSibling||e.nextSibling,i="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!i},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",i="`",n=e.match(/`+/gm)||[];-1!==n.indexOf(i);)i+="`";return i+t+e+t+i}},CE.image={filter:"img",replacement:function(e,t){var i=xE(t.getAttribute("alt")),n=t.getAttribute("src")||"",r=xE(t.getAttribute("title"));return n?"!["+i+"]("+n+(r?' "'+r+'"':"")+")":""}},AE.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=TE(this.array,e,this.options))||(t=TE(this._keep,e,this.options))||(t=TE(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t'+e+"","text/html").getElementById("turndown-root"):i=e.cloneNode(!0);return function(e){var t=e.element,i=e.isBlock,n=e.isVoid,r=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!r(t)){for(var s=null,o=!1,a=null,l=PE(a,t,r);l!==t;){if(3===l.nodeType||4===l.nodeType){var c=l.data.replace(/[ \r\n\t]+/g," ");if(s&&!/ $/.test(s.data)||o||" "!==c[0]||(c=c.substr(1)),!c){l=SE(l);continue}l.data=c,s=l}else{if(1!==l.nodeType){l=SE(l);continue}i(l)||"BR"===l.nodeName?(s&&(s.data=s.data.replace(/ $/,"")),s=null,o=!1):n(l)||r(l)?(s=null,o=!0):s&&(o=!1)}var h=PE(a,l,r);a=l,l=h}s&&(s.data=s.data.replace(/ $/,""),s.data||SE(s))}}({element:i,isBlock:wE,isVoid:_E,isPre:t.preformattedCode?OE:null}),i}function OE(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function FE(e,t){return e.isBlock=wE(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!_E(e)&&!function(e){return yE(e,vE)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return kE(e,bE)}(e)&&!function(e){return kE(e,vE)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var i=(n=e.textContent,r=n.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/),{leading:r[1],leadingAscii:r[2],leadingNonAscii:r[3],trailing:r[4],trailingNonAscii:r[5],trailingAscii:r[6]});var n,r;i.leadingAscii&&ME("left",e,t)&&(i.leading=i.leadingNonAscii);i.trailingAscii&&ME("right",e,t)&&(i.trailing=i.trailingNonAscii);return{leading:i.leading,trailing:i.trailing}}(e,t),e}function ME(e,t,i){var n,r,s;return"left"===e?(n=t.previousSibling,r=/ $/):(n=t.nextSibling,r=/^ /),n&&(3===n.nodeType?s=r.test(n.nodeValue):i.preformattedCode&&"CODE"===n.nodeName?s=!1:1!==n.nodeType||wE(n)||(s=r.test(n.textContent))),s}var NE=Array.prototype.reduce,LE=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function DE(e){if(!(this instanceof DE))return new DE(e);var t={rules:CE,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),n=t.replace(/^\n*/,""),r=Math.max(e.length-i.length,t.length-n.length);return i+"\n\n".substring(0,r)+n}DE.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=zE.call(this,new BE(e,this.options));return HE.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t{if(!r.consumable.consume(n.item,i.name))return;const s=n.attributeNewValue,o=r.writer,a=r.mapper.toViewElement(n.item),l=[...a.getChildren()].find((e=>e.getCustomProperty("media-content")));o.remove(l);const c=e.getMediaViewElement(o,s,t);o.insert(o.createPositionAt(a,0),c)};return e=>{e.on("attribute:url:media",i)}}function JE(e,t,i,n){return e.createContainerElement("figure",{class:"media"},[t.getMediaViewElement(e,i,n),e.createSlot()])}function QE(e){const t=e.getSelectedElement();return t&&t.is("element","media")?t:null}function YE(e,t,i,n){e.change((r=>{const s=r.createElement("media",{url:t});e.insertObject(s,i,null,{setSelection:"on",findOptimalPosition:n?"auto":void 0})}))}class XE extends Cu{refresh(){const e=this.editor.model,t=e.document.selection,i=QE(t);this.value=i?i.getAttribute("url"):void 0,this.isEnabled=function(e){const t=e.getSelectedElement();return!!t&&"media"===t.name}(t)||function(e,t){const i=Zb(e,t);let n=i.start.parent;n.isEmpty&&!t.schema.isLimit(n)&&(n=n.parent);return t.schema.checkChild(n,"media")}(t,e)}execute(e){const t=this.editor.model,i=t.document.selection,n=QE(i);n?t.change((t=>{t.setAttribute("url",e,n)})):YE(t,e,i,!0)}}class eS{locale;providerDefinitions;constructor(e,t){const i=t.providers,n=t.extraProviders||[],r=new Set(t.removeProviders),s=i.concat(n).filter((e=>{const t=e.name;return t?!r.has(t):(fn("media-embed-no-provider-name",{provider:e}),!1)}));this.locale=e,this.providerDefinitions=s}hasMedia(e){return!!this._getMedia(e)}getMediaViewElement(e,t,i){return this._getMedia(t).getViewElement(e,i)}_getMedia(e){if(!e)return new tS(this.locale);e=e.trim();for(const t of this.providerDefinitions){const i=t.html,n=Jr(t.url);for(const t of n){const n=this._getUrlMatches(e,t);if(n)return new tS(this.locale,e,n,i)}}return null}_getUrlMatches(e,t){let i=e.match(t);if(i)return i;let n=e.replace(/^https?:\/\//,"");return i=n.match(t),i||(n=n.replace(/^www\./,""),i=n.match(t),i||null)}}class tS{url;_locale;_match;_previewRenderer;constructor(e,t,i,n){this.url=this._getValidUrl(t),this._locale=e,this._match=i,this._previewRenderer=n}getViewElement(e,t){const i={};let n;if(t.renderForEditingView||t.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),t.renderForEditingView&&(i.class="ck-media__wrapper");const r=this._getPreviewHtml(t);n=e.createRawElement("div",i,((e,t)=>{t.setContentOf(e,r)}))}else this.url&&(i.url=this.url),n=e.createEmptyElement(t.elementName,i);return e.setCustomProperty("media-content",!0,n),n}_getPreviewHtml(e){return this._previewRenderer?this._previewRenderer(this._match):this.url&&e.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const e=new ag,t=this._locale.t;e.content='',e.viewBox="0 0 64 42";return new Fm({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url,"data-cke-tooltip-text":t("Open media in new tab")},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]}]}]}).render().outerHTML}_getValidUrl(e){return e?e.match(/^https?/)?e:"https://"+e:null}}class iS extends yu{static get pluginName(){return"MediaEmbedEditing"}static get isOfficialPlugin(){return!0}registry;constructor(e){super(e),e.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:[/^dailymotion\.com\/video\/(\w+)/,/^dai.ly\/(\w+)/],html:e=>`
    `},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:e=>`
    `},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/],html:e=>{const t=e[1],i=e[2];return`
    `}},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:e=>`
    `},{name:"instagram",url:[/^instagram\.com\/p\/(\w+)/,/^instagram\.com\/reel\/(\w+)/]},{name:"twitter",url:[/^twitter\.com/,/^x\.com/]},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new eS(e.locale,e.config.get("mediaEmbed"))}init(){const e=this.editor,t=e.model.schema,i=e.t,n=e.conversion,r=e.config.get("mediaEmbed.previewsInData"),s=e.config.get("mediaEmbed.elementName"),o=this.registry;e.commands.add("mediaEmbed",new XE(e)),t.register("media",{inheritAllFrom:"$blockObject",allowAttributes:["url"]}),n.for("dataDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const i=e.getAttribute("url");return JE(t,o,i,{elementName:s,renderMediaPreview:!!i&&r})}}),n.for("dataDowncast").add(ZE(o,{elementName:s,renderMediaPreview:r})),n.for("editingDowncast").elementToStructure({model:"media",view:(e,{writer:t})=>{const n=e.getAttribute("url");return function(e,t,i){return t.setCustomProperty("media",!0,e),Ub(e,t,{label:i})}(JE(t,o,n,{elementName:s,renderForEditingView:!0}),t,i("media widget"))}}),n.for("editingDowncast").add(ZE(o,{elementName:s,renderForEditingView:!0})),n.for("upcast").elementToElement({view:e=>["oembed",s].includes(e.name)&&e.getAttribute("url")?{name:!0}:null,model:(e,{writer:t})=>{const i=e.getAttribute("url");return o.hasMedia(i)?t.createElement("media",{url:i}):null}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(e,{writer:t})=>{const i=e.getAttribute("data-oembed-url");return o.hasMedia(i)?t.createElement("media",{url:i}):null}}).add((e=>{e.on("element:figure",((e,t,i)=>{if(!i.consumable.consume(t.viewItem,{name:!0,classes:"media"}))return;const{modelRange:n,modelCursor:r}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=n,t.modelCursor=r;es(n.getItems())||i.consumable.revert(t.viewItem,{name:!0,classes:"media"})}))}))}}const nS=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class rS extends yu{static get requires(){return[ev,bw,Mv]}static get pluginName(){return"AutoMediaEmbed"}static get isOfficialPlugin(){return!0}_timeoutId;_positionToInsert;constructor(e){super(e),this._timeoutId=null,this._positionToInsert=null}init(){const e=this.editor,t=e.model.document,i=e.plugins.get("ClipboardPipeline");this.listenTo(i,"inputTransformation",(()=>{const e=t.selection.getFirstRange(),i=Fh.fromPosition(e.start);i.stickiness="toPrevious";const n=Fh.fromPosition(e.end);n.stickiness="toNext",t.once("change:data",(()=>{this._embedMediaBetweenPositions(i,n),i.detach(),n.detach()}),{priority:"high"})}));e.commands.get("undo").on("execute",(()=>{this._timeoutId&&(ji.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)}),{priority:"high"})}_embedMediaBetweenPositions(e,t){const i=this.editor,n=i.plugins.get(iS).registry,r=new Ul(e,t),s=r.getWalker({ignoreElementEnd:!0});let o="";for(const e of s)e.item.is("$textProxy")&&(o+=e.item.data);if(o=o.trim(),!o.match(nS))return void r.detach();if(!n.hasMedia(o))return void r.detach();i.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=Fh.fromPosition(e),this._timeoutId=ji.window.setTimeout((()=>{i.model.change((e=>{this._timeoutId=null,e.remove(r),r.detach();let t=null;"$graveyard"!==this._positionToInsert.root.rootName&&(t=this._positionToInsert),YE(i.model,o,t,!1),this._positionToInsert.detach(),this._positionToInsert=null})),i.plugins.get(bw).requestUndoOnBackspace()}),100)):r.detach()}}class sS extends ig{focusTracker;keystrokes;urlInputView;_validators;_urlInputViewInfoDefault;_urlInputViewInfoTip;constructor(e,t){super(t),this.focusTracker=new ts,this.keystrokes=new ss,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this._validators=e,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView]})}render(){super.render(),sg({view:this}),this.focusTracker.add(this.urlInputView.element),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.urlInputView.focus()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(e){this.urlInputView.fieldView.value=e.trim()}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const e=this.locale.t,t=new Qg(this.locale,Vf),i=t.fieldView;return this._urlInputViewInfoDefault=e("Paste the media URL in the input."),this._urlInputViewInfoTip=e("Tip: Paste the URL into the content to embed faster."),t.label=e("Media URL"),t.infoText=this._urlInputViewInfoDefault,i.inputMode="url",i.on("input",(()=>{t.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()})),t}}class oS extends yu{static get requires(){return[iS,Eg]}static get pluginName(){return"MediaEmbedUI"}static get isOfficialPlugin(){return!0}_formView;init(){const e=this.editor;e.ui.componentFactory.add("mediaEmbed",(()=>{const e=this.editor.locale.t,t=this._createDialogButton(cg);return t.tooltip=!0,t.label=e("Insert media"),t})),e.ui.componentFactory.add("menuBar:mediaEmbed",(()=>{const e=this.editor.locale.t,t=this._createDialogButton(Ig);return t.label=e("Media"),t}))}_createDialogButton(e){const t=this.editor,i=new e(t.locale),n=t.commands.get("mediaEmbed"),r=this.editor.plugins.get("Dialog");return i.icon='',i.bind("isEnabled").to(n,"isEnabled"),i.on("execute",(()=>{"mediaEmbed"===r.id?r.hide():this._showDialog()})),i}_showDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.commands.get("mediaEmbed"),n=e.locale.t;if(!this._formView){const t=e.plugins.get(iS).registry;this._formView=new(rg(sS))(function(e,t){return[t=>{if(!t.url.length)return e("The URL must not be empty.")},i=>{if(!t.hasMedia(i.url))return e("This media URL is not supported.")}]}(e.t,t),e.locale),this._formView.on("submit",(()=>this._handleSubmitForm()))}t.show({id:"mediaEmbed",title:n("Insert media"),content:this._formView,isModal:!0,onShow:()=>{this._formView.url=i.value||"",this._formView.resetFormStatus(),this._formView.urlInputView.fieldView.select()},actionButtons:[{label:n("Cancel"),withText:!0,onExecute:()=>t.hide()},{label:n("Accept"),class:"ck-button-action",withText:!0,onExecute:()=>this._handleSubmitForm()}]})}_handleSubmitForm(){const e=this.editor,t=e.plugins.get("Dialog");this._formView.isValid()&&(e.execute("mediaEmbed",this._formView.url),t.hide(),e.editing.view.focus())}}Hr.arrowup,Hr.arrowdown,Hr.esc,Hr.enter,Hr.tab;function aS(e){return void 0!==e&&e.endsWith("px")}function lS(e){return e.toFixed(2).replace(/\.?0+$/,"")+"px"}function cS(e,t,i){if(!e.childCount)return;const n=new Cd(e.document),r=function(e,t){const i=t.createRangeIn(e),n=[],r=new Set;for(const e of i.getItems()){if(!e.is("element")||!e.name.match(/^(p|h\d+|li|div)$/))continue;let t=wS(e);if(void 0===t||0!=parseFloat(t)||Array.from(e.getClassNames()).find((e=>e.startsWith("MsoList")))||(t=void 0),e.hasStyle("mso-list")||void 0!==t&&r.has(t)){const i=fS(e);n.push({element:e,id:i.id,order:i.order,indent:i.indent,marginLeft:t}),void 0!==t&&r.add(t)}else r.clear()}return n}(e,n);if(!r.length)return;const s={},o=[];for(const e of r)if(void 0!==e.indent){hS(e)||(o.length=0);const r=`${e.id}:${e.indent}`,a=Math.min(e.indent-1,o.length);if(ao.length-1||o[a].listElement.name!=l.type){0==a&&"ol"==l.type&&void 0!==e.id&&s[r]&&(l.startIndex=s[r]);const t=gS(l,n,i);if(aS(e.marginLeft)&&(0==a||aS(o[a-1].marginLeft))){let i=e.marginLeft;a>0&&(i=lS(parseFloat(i)-parseFloat(o[a-1].marginLeft))),n.setStyle("padding-left",i,t)}if(0==o.length){const i=e.element.parent,r=i.getChildIndex(e.element)+1;n.insertChild(r,t,i)}else{const e=o[a-1].listItemElements;n.appendChild(t,e[e.length-1])}o[a]={...e,listElement:t,listItemElements:[]},0==a&&void 0!==e.id&&(s[r]=l.startIndex||1)}}const l="li"==e.element.name?e.element:n.createElement("li");n.appendChild(l,o[a].listElement),o[a].listItemElements.push(l),0==a&&void 0!==e.id&&s[r]++,e.element!=l&&n.appendChild(e.element,l),pS(e.element,n),n.removeStyle("text-indent",e.element),n.removeStyle("margin-left",e.element)}else{const t=o.find((t=>t.marginLeft==e.marginLeft));if(t){const i=t.listItemElements;n.appendChild(e.element,i[i.length-1]),n.removeStyle("margin-left",e.element)}else o.length=0}}function hS(e){const t=e.element.previousSibling;return dS(t||e.element.parent)}function dS(e){return e.is("element","ol")||e.is("element","ul")}function uS(e,t){const i=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),n=/mso-level-number-format:([^;]{0,100});/gi,r=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,s=new RegExp(`@list\\s+l${e.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),o=new RegExp(`@list l${e.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=s.exec(t),l=o.exec(t),c=a&&!l,h=i.exec(t);let d="decimal",u="ol",m=null;if(h&&h[1]){const t=n.exec(h[1]);if(t&&t[1]&&(d=t[1].trim(),u="bullet"!==d&&"image"!==d?"ol":"ul"),"bullet"===d){const t=function(e){if("li"==e.name&&"ul"==e.parent.name&&e.parent.hasAttribute("type"))return e.parent.getAttribute("type");const t=function(e){if(e.getChild(0).is("$text"))return null;for(const t of e.getChildren()){if(!t.is("element","span"))continue;const e=t.getChild(0);if(e)return e.is("$text")?e:e.getChild(0)}return null}(e);if(!t)return null;const i=t._data;if("o"===i)return"circle";if("·"===i)return"disc";if("§"===i)return"square";return null}(e.element);t&&(d=t)}else{const e=r.exec(h[1]);e&&e[1]&&(m=parseInt(e[1]))}c&&(u="ol")}return{type:u,startIndex:m,style:mS(d),isLegalStyleList:c}}function mS(e){if(e.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(e){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return e;default:return null}}function gS(e,t,i){const n=t.createElement(e.type);return e.style&&t.setStyle("list-style-type",e.style,n),e.startIndex&&e.startIndex>1&&t.setAttribute("start",e.startIndex,n),e.isLegalStyleList&&i&&t.addClass("legal-list",n),n}function fS(e){const t=e.getStyle("mso-list");if(void 0===t)return{};const i=t.match(/(^|\s{1,100})l(\d+)/i),n=t.match(/\s{0,100}lfo(\d+)/i),r=t.match(/\s{0,100}level(\d+)/i);return i&&n&&r?{id:i[2],order:n[1],indent:parseInt(r[1])}:{indent:1}}function pS(e,t){const i=new Lo({name:"span",styles:{"mso-list":"Ignore"}}),n=t.createRangeIn(e);for(const e of n)"elementStart"===e.type&&i.match(e.item)&&t.remove(e.item)}function wS(e){const t=e.getStyle("margin-left");return void 0===t||t.endsWith("px")?t:function(e){const t=parseFloat(e);return e.endsWith("pt")?lS(96*t/72):e.endsWith("pc")?lS(12*t*96/72):e.endsWith("in")?lS(96*t):e.endsWith("cm")?lS(96*t/2.54):e.endsWith("mm")?lS(t/10*96/2.54):e}(t)}function bS(e,t){if(!e.childCount)return;const i=new Cd(e.document),n=function(e,t){const i=t.createRangeIn(e),n=new Lo({name:/v:(.+)/}),r=[];for(const e of i){if("elementStart"!=e.type)continue;const t=e.item,i=t.previousSibling,s=i&&i.is("element")?i.name:null,o=["Chart"],a=n.match(t),l=t.getAttribute("o:gfxdata"),c="v:shapetype"===s,h=l&&o.some((e=>t.getAttribute("id").includes(e)));a&&l&&!c&&!h&&r.push(e.item.getAttribute("id"))}return r}(e,i);!function(e,t,i){const n=i.createRangeIn(t),r=new Lo({name:"img"}),s=[];for(const t of n)if(t.item.is("element")&&r.match(t.item)){const i=t.item,n=i.getAttribute("v:shapes")?i.getAttribute("v:shapes").split(" "):[];n.length&&n.every((t=>e.indexOf(t)>-1))?s.push(i):i.getAttribute("src")||s.push(i)}for(const e of s)i.remove(e)}(n,e,i),function(e,t,i){const n=i.createRangeIn(t),r=[];for(const t of n)if("elementStart"==t.type&&t.item.is("element","v:shape")){const i=t.item.getAttribute("id");if(e.includes(i))continue;s(t.item.parent.getChildren(),i)||r.push(t.item)}for(const e of r){const t={src:o(e)};e.hasAttribute("alt")&&(t.alt=e.getAttribute("alt"));const n=i.createElement("img",t);i.insertChild(e.index+1,n,e.parent)}function s(e,t){for(const i of e)if(i.is("element")){if("img"==i.name&&i.getAttribute("v:shapes")==t)return!0;if(s(i.getChildren(),t))return!0}return!1}function o(e){for(const t of e.getChildren())if(t.is("element")&&t.getAttribute("src"))return t.getAttribute("src")}}(n,e,i),function(e,t){const i=t.createRangeIn(e),n=new Lo({name:/v:(.+)/}),r=[];for(const e of i)"elementStart"==e.type&&n.match(e.item)&&r.push(e.item);for(const e of r)t.remove(e)}(e,i);const r=function(e,t){const i=t.createRangeIn(e),n=new Lo({name:"img"}),r=[];for(const e of i)e.item.is("element")&&n.match(e.item)&&e.item.getAttribute("src").startsWith("file://")&&r.push(e.item);return r}(e,i);r.length&&function(e,t,i){if(e.length===t.length)for(let n=0;nString.fromCharCode(parseInt(e,16)))).join(""))}const vS=//i,yS=/xmlns:o="urn:schemas-microsoft-com/i;class kS{document;hasMultiLevelListPlugin;constructor(e,t=!1){this.document=e,this.hasMultiLevelListPlugin=t}isActive(e){return vS.test(e)||yS.test(e)}execute(e){const t=new Cd(this.document),{body:i,stylesString:n}=e._parsedData;!function(e,t){const i=[];for(const n of t.createRangeIn(e)){const e=n.item;e.is("element","a")&&!e.hasAttribute("href")&&(e.hasAttribute("id")||e.hasAttribute("name"))&&i.push(e)}for(const e of i){const i=e.parent.getChildIndex(e)+1,n=e.getChildren();t.insertChild(i,n,e.parent)}}(i,t),cS(i,n,this.hasMultiLevelListPlugin),bS(i,e.dataTransfer.getData("text/rtf")),function(e){const t=[],i=new Cd(e.document);for(const{item:n}of i.createRangeIn(e))if(n.is("element")){for(const e of n.getClassNames())/\bmso/gi.exec(e)&&i.removeClass(e,n);for(const e of n.getStyleNames())/\bmso/gi.exec(e)&&i.removeStyle(e,n);(n.is("element","w:sdt")||n.is("element","w:sdtpr")&&n.isEmpty||n.is("element","o:p")&&n.isEmpty)&&t.push(n)}for(const e of t){const t=e.parent,n=t.getChildIndex(e);i.insertChild(n,e.getChildren(),t),i.remove(e)}}(i),e.content=i}}function CS(e,t,i,{blockElements:n,inlineObjectElements:r}){let s=i.createPositionAt(e,"forward"==t?"after":"before");return s=s.getLastMatchingPosition((({item:e})=>e.is("element")&&!n.includes(e.name)&&!r.includes(e.name)),{direction:t}),"forward"==t?s.nodeAfter:s.nodeBefore}function xS(e,t){return!!e&&e.is("element")&&t.includes(e.name)}const AS=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class TS{document;constructor(e){this.document=e}isActive(e){return AS.test(e)}execute(e){const t=new Cd(this.document),{body:i}=e._parsedData;!function(e,t){for(const i of e.getChildren())if(i.is("element","b")&&"normal"===i.getStyle("font-weight")){const n=e.getChildIndex(i);t.remove(i),t.insertChild(n,i.getChildren(),e)}}(i,t),function(e,t){for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","li")){const i=e.getChild(0);i&&i.is("element","p")&&t.unwrapElement(i)}}}(i,t),function(e,t){const i=new da(t.document.stylesProcessor),n=new Xa(i,{renderingMode:"data"}),r=n.blockElements,s=n.inlineObjectElements,o=[];for(const i of t.createRangeIn(e)){const e=i.item;if(e.is("element","br")){const i=CS(e,"forward",t,{blockElements:r,inlineObjectElements:s}),n=CS(e,"backward",t,{blockElements:r,inlineObjectElements:s}),a=xS(i,r);(xS(n,r)||a)&&o.push(e)}}for(const e of o)e.hasClass("Apple-interchange-newline")?t.remove(e):t.replace(e,t.createElement("p"))}(i,t),e.content=i}}const ES=/(\s+)<\/span>/g,((e,t)=>1===t.length?" ":Array(t.length+1).join("  ").substr(0,t.length)))}function IS(e,t){const i=new DOMParser,n=function(e){return PS(PS(e)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g," <\/o:p>/g," ").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}(function(e){const t="",i="",n=e.indexOf(t);if(n<0)return e;const r=e.indexOf(i,n+t.length);return e.substring(0,n+t.length)+(r>=0?e.substring(r):"")}(e=(e=e.replace(/