From 517748c7d19dacd0daa344882b91f729c406d0a8 Mon Sep 17 00:00:00 2001 From: Juan Mitriatti Date: Tue, 24 Sep 2024 17:06:15 -0300 Subject: [PATCH 1/3] WS2-2261: Implement separate downcast for editing and data views in tableCell --- .../js/build/websparkPlugin.js | 2 +- .../tablecellwspropertiesediting.js | 34 ++++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/web/modules/webspark/webspark_ckeditor_plugins/js/build/websparkPlugin.js b/web/modules/webspark/webspark_ckeditor_plugins/js/build/websparkPlugin.js index 6aa660006..6b33297fb 100644 --- a/web/modules/webspark/webspark_ckeditor_plugins/js/build/websparkPlugin.js +++ b/web/modules/webspark/webspark_ckeditor_plugins/js/build/websparkPlugin.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.CKEditor5=t():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.websparkPlugin=t())}(self,(()=>(()=>{var e={"./node_modules/css-loader/dist/cjs.js!./js/ckeditor5_plugins/websparkPlugin/src/animatedtext/css/animatedtext.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id," :root {\n --ck-highlight-marker-yellow: #ffc627;\n}\n\n.ck-content .pen-yellow {\n background-color: var(--ck-highlight-marker-yellow);\n}\n\n\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-input-color {\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\n\t& > input.ck.ck-input-text {\n\t\tmin-width: auto;\n\t\tflex-grow: 1;\n\t}\n\n\t& > div.ck.ck-dropdown {\n\t\tmin-width: auto;\n\n\t\t/* This dropdown has no arrow but a color preview instead. */\n\t\t& > .ck-input-color__button .ck-dropdown__arrow {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t& .ck.ck-input-color__button {\n\t\t/* Resolving issue with misaligned buttons on Safari (see #10589) */\n\t\tdisplay: flex;\n\n\t\t& .ck.ck-input-color__button__preview {\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\n\t\t\t& > .ck.ck-input-color__button__preview__no-color-indicator {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t}\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/form.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/*\n * Note: This file should contain the wireframe styles only. But since there are no such styles,\n * it acts as a message to the builder telling that it should look for the corresponding styles\n * **in the theme** when compiling the editor.\n */\n\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/formrow.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-form__row {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\tjustify-content: space-between;\n\n\t/* Ignore labels that work as fieldset legends */\n\t& > *:not(.ck-label) {\n\t\tflex-grow: 1;\n\t}\n\n\t&.ck-table-form__action-row {\n\t\t& .ck-button-save,\n\t\t& .ck-button-cancel {\n\t\t\tjustify-content: center;\n\t\t}\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-insert-table-dropdown__grid {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: wrap;\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/table.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,'/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content .table {\n\t/* Give the table widget some air and center it horizontally */\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em auto;\n\tdisplay: table;\n\n\t& table {\n\t\t/* The table cells should have slight borders */\n\t\tborder-collapse: collapse;\n\t\tborder-spacing: 0;\n\n\t\t/* Table width and height are set on the parent
. Make sure the table inside stretches\n\t\tto the full dimensions of the container (https://github.com/ckeditor/ckeditor5/issues/6186). */\n\t\twidth: 100%;\n\t\theight: 100%;\n\n\t\t/* The outer border of the table should be slightly darker than the inner lines.\n\t\tAlso see https://github.com/ckeditor/ckeditor5-table/issues/50. */\n\t\tborder: 1px double hsl(0, 0%, 70%);\n\n\t\t& td,\n\t\t& th {\n\t\t\tmin-width: 2em;\n\t\t\tpadding: .4em;\n\n\t\t\t/* The border is inherited from .ck-editor__nested-editable styles, so theoretically it\'s not necessary here.\n\t\t\tHowever, the border is a content style, so it should use .ck-content (so it works outside the editor).\n\t\t\tHence, the duplication. See https://github.com/ckeditor/ckeditor5/issues/6314 */\n\t\t\tborder: 1px solid hsl(0, 0%, 75%);\n\t\t}\n\n\t\t& th {\n\t\t\tfont-weight: bold;\n\t\t\tbackground: hsla(0, 0%, 0%, 5%);\n\t\t}\n\t}\n}\n\n/* Text alignment of the table header should match the editor settings and override the native browser styling,\nwhen content is available outside the editor. See https://github.com/ckeditor/ckeditor5/issues/6638 */\n.ck-content[dir="rtl"] .table th {\n\ttext-align: right;\n}\n\n.ck-content[dir="ltr"] .table th {\n\ttext-align: left;\n}\n\n.ck-editor__editable .ck-table-bogus-paragraph {\n\t/*\n\t * Use display:inline-block to force Chrome/Safari to limit text mutations to this element.\n\t * See https://github.com/ckeditor/ckeditor5/issues/6062.\n\t */\n\tdisplay: inline-block;\n\n\t/*\n\t * Inline HTML elements nested in the span should always be dimensioned in relation to the whole cell width.\n\t * See https://github.com/ckeditor/ckeditor5/issues/9117.\n\t */\n\twidth: 100%;\n}\n',""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-selector-caption-background: hsl(0, 0%, 97%);\n\t--ck-color-selector-caption-text: hsl(0, 0%, 20%);\n\t--ck-color-selector-caption-highlighted-background: hsl(52deg 100% 50%);\n}\n\n/* Content styles */\n.ck-content .table > figcaption {\n\tdisplay: table-caption;\n\tcaption-side: top;\n\tword-break: break-word;\n\ttext-align: center;\n\tcolor: var(--ck-color-selector-caption-text);\n\tbackground-color: var(--ck-color-selector-caption-background);\n\tpadding: .6em;\n\tfont-size: .75em;\n\toutline-offset: -1px;\n}\n\n/* Editing styles */\n.ck.ck-editor__editable .table > figcaption {\n\t&.table__caption_highlighted {\n\t\tanimation: ck-table-caption-highlight .6s ease-out;\n\t}\n\n\t&.ck-placeholder::before {\n\t\tpadding-left: inherit;\n\t\tpadding-right: inherit;\n\n\t\t/*\n\t\t * Make sure the table caption placeholder doesn't overflow the placeholder area.\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\n\t\t */\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n\n@keyframes ck-table-caption-highlight {\n\t0% {\n\t\tbackground-color: var(--ck-color-selector-caption-highlighted-background);\n\t}\n\n\t100% {\n\t\tbackground-color: var(--ck-color-selector-caption-background);\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-table-cell-properties-form {\n\t& .ck-form__row {\n\t\t&.ck-table-cell-properties-form__alignment-row {\n\t\t\tflex-wrap: wrap;\n\n\t\t\t& .ck.ck-toolbar {\n\t\t\t\t&:first-of-type {\n\t\t\t\t\t/* 4 buttons out of 7 (h-alignment + v-alignment) = 0.57 */\n\t\t\t\t\tflex-grow: 0.57;\n\t\t\t\t}\n\n\t\t\t\t&:last-of-type {\n\t\t\t\t\t/* 3 buttons out of 7 (h-alignment + v-alignment) = 0.43 */\n\t\t\t\t\tflex-grow: 0.43;\n\t\t\t\t}\n\n\t\t\t\t& .ck-button {\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-selector-column-resizer-hover: var(--ck-color-base-active);\n\t--ck-table-column-resizer-width: 7px;\n\n\t/* The offset used for absolute positioning of the resizer element, so that it is placed exactly above the cell border.\n\t The value is: minus half the width of the resizer decreased additionaly by the half the width of the border (0.5px). */\n\t--ck-table-column-resizer-position-offset: calc(var(--ck-table-column-resizer-width) * -0.5 - 0.5px);\n}\n\n.ck-content .table .ck-table-resized {\n\ttable-layout: fixed;\n}\n\n.ck-content .table table {\n\toverflow: hidden;\n}\n\n.ck-content .table td,\n.ck-content .table th {\n\t/* To prevent text overflowing beyond its cell when columns are resized by resize handler\n\t(https://github.com/ckeditor/ckeditor5/pull/14379#issuecomment-1589460978). */\n\toverflow-wrap: break-word;\n\tposition: relative;\n}\n\n.ck.ck-editor__editable .table .ck-table-column-resizer {\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tright: var(--ck-table-column-resizer-position-offset);\n\twidth: var(--ck-table-column-resizer-width);\n\tcursor: col-resize;\n\tuser-select: none;\n\tz-index: var(--ck-z-default);\n}\n\n.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer {\n\tdisplay: none;\n}\n\n/* The resizer elements, which are extended to an extremely high height, break the drag & drop feature in Chrome. To make it work again,\n all resizers must be hidden while the table is dragged. */\n.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer {\n\tdisplay: none;\n}\n\n.ck.ck-editor__editable .table .ck-table-column-resizer:hover,\n.ck.ck-editor__editable .table .ck-table-column-resizer__active {\n\tbackground-color: var(--ck-color-selector-column-resizer-hover);\n\topacity: 0.25;\n\t/* The resizer element resides in each cell so to occupy the entire height of the table, which is unknown from a CSS point of view,\n\t it is extended to an extremely high height. Even for screens with a very high pixel density, the resizer will fulfill its role as\n\t it should, i.e. for a screen of 476 ppi the total height of the resizer will take over 350 sheets of A4 format, which is totally\n\t unrealistic height for a single table. */\n\ttop: -999999px;\n\tbottom: -999999px;\n}\n\n.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer {\n\tleft: var(--ck-table-column-resizer-position-offset);\n\tright: unset;\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/*\n * Note: This file should contain the wireframe styles only. But since there are no such styles,\n * it acts as a message to the builder telling that it should look for the corresponding styles\n * **in the theme** when compiling the editor.\n */\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableform.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,'/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-table-form {\n\t& .ck-form__row {\n\t\t&.ck-table-form__border-row {\n\t\t\tflex-wrap: wrap;\n\t\t}\n\n\t\t&.ck-table-form__background-row {\n\t\t\tflex-wrap: wrap;\n\t\t}\n\n\t\t&.ck-table-form__dimensions-row {\n\t\t\tflex-wrap: wrap;\n\t\t\talign-items: center;\n\n\t\t\t& .ck-labeled-field-view {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column-reverse;\n\t\t\t\talign-items: center;\n\n\t\t\t\t& .ck.ck-dropdown {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t& .ck-table-form__dimension-operator {\n\t\t\t\tflex-grow: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t& .ck.ck-labeled-field-view {\n\t\t/* Allow absolute positioning of the status (error) balloons. */\n\t\tposition: relative;\n\n\t\t& .ck.ck-labeled-field-view__status {\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\tbottom: calc( -1 * var(--ck-table-properties-error-arrow-size) );\n\t\t\ttransform: translate(-50%,100%);\n\n\t\t\t/* Make sure the balloon status stays on top of other form elements. */\n\t\t\tz-index: 1;\n\n\t\t\t/* The arrow pointing towards the field. */\n\t\t\t&::after {\n\t\t\t\tcontent: "";\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: calc( -1 * var(--ck-table-properties-error-arrow-size) );\n\t\t\t\tleft: 50%;\n\t\t\t\ttransform: translateX( -50% );\n\t\t\t}\n\t\t}\n\t}\n}\n',""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-table-properties-form {\n\t& .ck-form__row {\n\t\t&.ck-table-properties-form__alignment-row {\n\t\t\tflex-wrap: wrap;\n\t\t\tflex-basis: 0;\n\t\t\talign-content: baseline;\n\n\t\t\t& .ck.ck-toolbar .ck-toolbar__items {\n\t\t\t\tflex-wrap: nowrap;\n\t\t\t}\n\t\t}\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/*\n * Note: This file should contain the wireframe styles only. But since there are no such styles,\n * it acts as a message to the builder telling that it should look for the corresponding styles\n * **in the theme** when compiling the editor.\n */\n",""]);const r=l},"./node_modules/css-loader/dist/runtime/api.js":e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var l={};if(o)for(var r=0;r0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":e=>{"use strict";e.exports=function(e){return e[1]}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":(e,t,n)=>{"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},s=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),l=[];function r(e){for(var t=-1,n=0;n{e.exports=n("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/engine.js":(e,t,n)=>{e.exports=n("dll-reference CKEditor5.dll")("./src/engine.js")},"ckeditor5/src/ui.js":(e,t,n)=>{e.exports=n("dll-reference CKEditor5.dll")("./src/ui.js")},"ckeditor5/src/utils.js":(e,t,n)=>{e.exports=n("dll-reference CKEditor5.dll")("./src/utils.js")},"ckeditor5/src/widget.js":(e,t,n)=>{e.exports=n("dll-reference CKEditor5.dll")("./src/widget.js")},"dll-reference CKEditor5.dll":e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={id:o,exports:{}};return e[o](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0;var o={};return(()=>{"use strict";n.d(o,{default:()=>jn});var e=n("ckeditor5/src/core.js"),t=n("ckeditor5/src/widget.js");class i extends e.Command{execute({href:e,text:t,styles:n,target:o,size:i}){const{model:s}=this.editor;s.change((l=>{const r=l.createElement("websparkButton",{text:t,href:e,target:o,styles:n,size:i}),a=l.createElement("websparkButtonText"),c=l.createText(t);l.append(c,a),l.append(a,r),s.insertContent(r)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkButton");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkButton"===o?.name){let e=o?.getChild?.(0)?.getChild?.(0)?._data;void 0===e&&(e=o._attrs.get("text")),this.value={...Object.fromEntries(o.getAttributes()),text:e}}else this.value=null;setTimeout((function(){let e=document.getElementById("ckeditor5-off-canvas-reset");e&&(document.body.removeChild(e),e.textContent=e.textContent.replace("#drupal-off-canvas-wrapper [data-drupal-ck-style-fence] .ck.ck-content * {display:revert;background:revert;color:initial;padding:revert;}",""),document.body.appendChild(e))}),500)}}var s=n("ckeditor5/src/ui.js");class l extends s.InputView{constructor(e,t,n){super(e);const o=this.bindTemplate;this.set("value",t[0]?.value||n);const i=t.map((e=>({tag:"option",attributes:{value:e.value,selected:o.if("value","",(t=>t===e.value))},children:[e.title]})));this.on("select",((e,t)=>{this.set("value",t.target.value)})),this.setTemplate({tag:"select",attributes:{class:["ck-webspark-form-select"]},children:i,on:{change:o.to("select")}})}}function r(e,t=[]){return{tag:"div",attributes:{class:["ck-webspark-form-container",...t]},children:e}}function a(...e){return{tag:"div",attributes:{class:["ck-webspark-form-row"]},children:e}}function c(e,t,n){const o=new s.LabelView(n),i=new l(n,t,t[0].value);return o.text=e,r([o,i])}function d(e,t){const n=new s.LabelView(t),o=new s.InputTextView(t);return n.text=e,r([n,o])}function u(e,t,n,o){const i=new s.ButtonView(o);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),i}function h(e,t,n="default"){if(!g(t))for(const n in t)if(e.includes(n))return t[n];return n}function m(e,t){const n=new s.LabelView(t),o=new s.TextareaView(t);return n.text=e,r([n,o])}const g=e=>0===Object.keys(e).length;class p extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkButton",new i(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkButton",{isObject:!0,allowWhere:"$inlineObject",allowAttributes:["text","href","target","styles","role","size"],allowContentOf:"$block"}),e.register("websparkButtonText",{isLimit:!0,allowIn:"websparkButton",allowContentOf:"$block"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:"a",classes:["btn",/^btn-(gold|maroon|gray|dark|md|sm)$/],attributes:!0},model:(e,{writer:t})=>{const n=e.getAttribute("class");return t.createElement("websparkButton",{text:e?._children[0]?._textData,href:e.getAttribute("href"),styles:h(n,{"btn-gold":"gold","btn-maroon":"maroon","btn-gray":"gray","btn-dark":"dark"},null),size:h(n,{"btn-md":"md","btn-sm":"sm"},"default"),role:"button",target:e.getAttribute("target")||"unset"})}}),e.for("dataDowncast").elementToElement({model:"websparkButton",view:(e,{writer:t})=>{const n=e.getAttribute("target");let o=`btn btn-${e.getAttribute("styles")}`;const i=e.getAttribute("size");return"default"!==i&&(o+=` btn-${i}`),t.createContainerElement("a",{class:o,text:e.getAttribute("text"),href:e.getAttribute("href"),role:"button",..."unset"!==n&&{target:n}})}}),e.for("editingDowncast").elementToElement({model:"websparkButton",view:(e,{writer:n})=>{let o=`btn btn-${e.getAttribute("styles")}`;const i=e.getAttribute("size");"default"!==i&&(o+=` btn-${i}`);const s=n.createContainerElement("a",{class:o});return(0,t.toWidget)(s,n,{label:"Webspark button"})}}),e.for("upcast").elementToElement({model:"websparkButtonText",view:{name:"span",classes:"text"}}),e.for("dataDowncast").elementToElement({model:"websparkButtonText",view:{name:"span",classes:"text"}}),e.for("editingDowncast").elementToElement({model:"websparkButtonText",view:(e,{writer:n})=>{const o=n.createEditableElement("span",{class:"text"});return(0,t.toWidgetEditable)(o,n)}})}}var w=n("ckeditor5/src/utils.js");class b extends s.View{DEFAULT_TEXT="Button";DEFAULT_HREF="#";DEFAULT_STYLE="gold";DEFAULT_SIZE="default";DEFAULT_TARGET="unset";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputView=d(o("Text"),n),this.urlInputView=d(o("URL"),n),this.styleSelect=c(o("Style"),this._getStyleOptions(o),n),this.sizeSelect=c(o("Size"),this._getSizeOptions(o),n),this.targetSelect=c(o("Target"),this._getTargetOptions(o),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form"],tabindex:"-1"},children:[a(this.textInputView,this.urlInputView),a(this.styleSelect,this.sizeSelect,this.targetSelect),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputView.children[1],this.urlInputView.children[1],this.styleSelect.children[1],this.sizeSelect.children[1],this.targetSelect.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}get href(){return this.urlInputView.children[1].element.value.trim()}set href(e){this.urlInputView.children[1].element.value=e.trim()}get styles(){return this.styleSelect.children[1].value}set styles(e){this.styleSelect.children[1].value=e}get size(){return this.sizeSelect.children[1].value}set size(e){this.sizeSelect.children[1].value=e}get target(){return this.targetSelect.children[1].value}set target(e){this.targetSelect.children[1].value=e}setValues(e){this.text=e?.text||this.DEFAULT_TEXT,this.href=e?.href||this.DEFAULT_HREF,this.styles=e?.styles||this.DEFAULT_STYLE,this.size=e?.size||this.DEFAULT_SIZE,this.target=e?.target||this.DEFAULT_TARGET}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return t.includes("text")?this.textInputView.errorText=t:t.includes("URL")&&(this.urlInputView.errorText=t),!1}return!0}resetFormStatus(){this.textInputView.errorText=null,this.urlInputView.errorText=null}_getStyleOptions(e){return[{value:"gold",title:e("Button Gold")},{value:"maroon",title:e("Button Maroon")},{value:"gray",title:e("Button Gray 2")},{value:"dark",title:e("Button Gray 7")}]}_getSizeOptions(e){return[{value:"default",title:e("Default")},{value:"md",title:e("Medium")},{value:"sm",title:e("Small")}]}_getTargetOptions(e){return[{value:"",title:e("Not set")},{value:"_blank",title:e("New window (_blank)")},{value:"_top",title:e("Topmost window (_top)")},{value:"_self",title:e("Same window (_self)")},{value:"_parent",title:e("Parent window (_parent)")}]}}class f extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkButton");this.form=new b((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkButton",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Button"),icon:'\n\n\n',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputView.children[1].select(),t.focus()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkButton",{text:t.text,href:t.href,styles:t.styles,size:t.size,target:t.target}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class k extends e.Plugin{static get requires(){return[p,f]}}class v extends e.Command{execute(e){const{model:t}=this.editor;t.change((e=>{t.insertContent(function(e){const t=e.createElement("websparkDivider");return e.setAttribute("class","copy-divider",t),t}(e))}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"$block");this.isEnabled=null!==n}}class C extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkDivider",new v(this.editor))}_defineSchema(){this.editor.model.schema.register("websparkDivider",{isObject:!0,allowWhere:"$block"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:"hr",classes:"copy-divider"},model:(e,{writer:t})=>t.createElement("websparkDivider"),converterPriority:"high"}),e.for("dataDowncast").elementToElement({model:"websparkDivider",view:(e,{writer:t})=>t.createEmptyElement("hr",{class:"copy-divider"})}),e.for("editingDowncast").elementToElement({model:"websparkDivider",view:(e,{writer:n})=>{const o=n.createContainerElement("div",null,n.createEmptyElement("hr",{class:"copy-divider"}));return n.addClass("copy-divider",o),n.setCustomProperty("hr",!0,o),(0,t.toWidget)(o,n,{label:"Webspark divider"})}})}}class T extends e.Plugin{init(){const e=this.editor;e.t;e.ui.componentFactory.add("websparkDivider",(t=>{const n=e.commands.get("insertWebsparkDivider"),o=new s.ButtonView(t);return o.set({label:e.t("Divider"),icon:'',tooltip:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",(()=>e.execute("insertWebsparkDivider"))),o}))}}class y extends e.Plugin{static get requires(){return[C,T]}}class _ extends e.Command{execute({text:e}){const{model:t}=this.editor;t.change((n=>{const o=n.createElement("websparkLead"),i=n.createElement("websparkLeadText"),s=n.createText(e);n.append(s,i),n.append(i,o),t.insertContent(o)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkLead");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkLead"===o?.name){const e=o.getChild(0)?.getChild(0);e&&(this.value={...Object.fromEntries(e.getAttributes()),text:e._data??""})}else this.value=null}}class x extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkLead",new _(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkLead",{isObject:!0,allowWhere:"$block"}),e.register("websparkLeadText",{allowIn:"websparkLead",allowAttributes:["classes"],allowChildren:"$text"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:"p",class:"lead"},model:(e,{writer:t})=>{const n=e.getAttribute("class");return t.createElement("websparkLeadText",{classes:n})}}),e.for("dataDowncast").elementToElement({model:"websparkLeadText",view:(e,{writer:t})=>t.createContainerElement("p",{class:"lead"})}),e.for("editingDowncast").elementToElement({model:"websparkLeadText",view:(e,{writer:n})=>{const o=n.createEditableElement("p",{class:"lead"});return(0,t.toWidgetEditable)(o,n,{label:"Lead Text"})}}),e.for("upcast").elementToElement({view:{name:"div",classes:["uds-lead"]},model:(e,{writer:t})=>t.createElement("websparkLead")}),e.for("dataDowncast").elementToElement({model:"websparkLead",view:(e,{writer:t})=>t.createContainerElement("div",{class:"uds-lead"})}),e.for("editingDowncast").elementToElement({model:"websparkLead",view:(e,{writer:n})=>{const o=n.createContainerElement("div",{class:"uds-lead"});return(0,t.toWidget)(o,n,{label:"Lead"})}})}}class E extends s.View{DEFAULT_TEXT="";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputView=m(o("Content"),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-heading-dialog"],tabindex:"-1"},children:[a(this.textInputView),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputView.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}setValues(e){this.text=e?.text||this.DEFAULT_TEXT}isValid(){return!0}resetFormStatus(){this.textInputView.errorText=null}}class A extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkLead");this.form=new E((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkLead",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Lead"),icon:'',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputView.children[1].element.select()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkLead",{text:t.text}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class S extends e.Plugin{static get requires(){return[x,A]}}class V extends e.Command{execute({text:e,styles:t,heading:n}){const{model:o}=this.editor;o.change((i=>{const s=i.createElement("websparkHighlightedHeading"),l=i.createElement("websparkHighlightedHeadingHelement",{level:n}),r=i.createElement("websparkHighlightedHeadingText",{styles:t}),a=i.createText(e);i.append(a,r),i.append(r,l),i.append(l,s),o.insertContent(s)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkHighlightedHeading");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkHighlightedHeading"===o?.name){const e=o.getChild(0)?.getChild(0);e&&(this.value={...Object.fromEntries(e.getAttributes()),text:e.getChild(0)?._data??"",heading:e.parent.getAttribute("level")})}else this.value=null}}class B extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkHighlightedHeading",new V(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkHighlightedHeading",{isObject:!0,allowWhere:"$block"}),e.register("websparkHighlightedHeadingHelement",{allowIn:"websparkHighlightedHeading",allowAttributes:["level"]}),e.register("websparkHighlightedHeadingText",{allowIn:"websparkHighlightedHeadingHelement",allowAttributes:["styles"],allowChildren:"$text"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:/^(h1|h2|h3|h4)$/},model:(e,{writer:t})=>t.createElement("websparkHighlightedHeadingHelement",{level:e.name})}),e.for("downcast").elementToElement({model:{name:"websparkHighlightedHeadingHelement",attributes:["level"]},view:(e,{writer:t})=>t.createContainerElement(e.getAttribute("level"))}),e.for("upcast").elementToElement({view:{name:"span",classes:[/^highlight-(gold|black|white)$/]},model:(e,{writer:t})=>{const n=e.getAttribute("class");return t.createElement("websparkHighlightedHeadingText",{styles:h(n,{"highlight-gold":"gold","highlight-black":"black","highlight-white":"white"},null)})}}),e.for("dataDowncast").elementToElement({model:"websparkHighlightedHeadingText",view:(e,{writer:t})=>{const n=`highlight-${e.getAttribute("styles")}`;return t.createContainerElement("span",{class:n})}}),e.for("editingDowncast").elementToElement({model:"websparkHighlightedHeadingText",view:(e,{writer:n})=>{const o=`highlight-${e.getAttribute("styles")}`,i=n.createEditableElement("span",{class:o});return(0,t.toWidgetEditable)(i,n,{label:"Highlighted Text"})}}),e.for("upcast").elementToElement({view:{name:"div",classes:["uds-highlighted-heading"]},model:(e,{writer:t})=>t.createElement("websparkHighlightedHeading")}),e.for("dataDowncast").elementToElement({model:"websparkHighlightedHeading",view:(e,{writer:t})=>t.createContainerElement("div",{class:"uds-highlighted-heading"})}),e.for("editingDowncast").elementToElement({model:"websparkHighlightedHeading",view:(e,{writer:n})=>{const o=n.createContainerElement("div",{class:"uds-highlighted-heading"});return(0,t.toWidget)(o,n,{label:"Highlighted Heading"})}})}}class R extends s.View{DEFAULT_TEXT="";DEFAULT_STYLE="gold";DEFAULT_HEADING="h2";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputView=m(o("Content"),n),this.styleSelect=c(o("Style"),this._getStyleOptions(o),n),this.headingSelect=c(o("Heading"),this._getHeadingOptions(o),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-heading-dialog"],tabindex:"-1"},children:[a(this.textInputView),a(this.styleSelect,this.headingSelect),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputView.children[1],this.styleSelect.children[1],this.headingSelect.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}get styles(){return this.styleSelect.children[1].value}set styles(e){this.styleSelect.children[1].value=e}get heading(){return this.headingSelect.children[1].value}set heading(e){this.headingSelect.children[1].value=e}setValues(e){this.text=e?.text||this.DEFAULT_TEXT,this.styles=e?.styles||this.DEFAULT_STYLE,this.heading=e?.heading||this.DEFAULT_HEADING}isValid(){return!0}resetFormStatus(){this.textInputView.errorText=null}_getStyleOptions(e){return[{value:"gold",title:e("Gold Highlight")},{value:"black",title:e("Gray 7 Highlight")},{value:"white",title:e("White Highlight")}]}_getHeadingOptions(e){return[{value:"h2",title:e("H2")},{value:"h3",title:e("H3")},{value:"h4",title:e("H4")}]}}class I extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkHighlightedHeading");this.form=new R((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkHighlightedHeading",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Highlighted Heading"),icon:'',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputView.children[1].element.select()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkHighlightedHeading",{text:t.text,styles:t.styles,heading:t.heading}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class L extends e.Plugin{static get requires(){return[B,I]}}class D extends e.Command{execute({text:e,citationName:t,citationDescription:n}){const{model:o}=this.editor;o.change((i=>{const s=i.createElement("websparkBlockquote"),l=i.createElement("websparkBlockQuoteSvg"),r=i.createElement("websparkBlockQuoteContainer"),a=i.createElement("websparkBlockquoteParagraph"),c=i.createElement("websparkBlockquoteCitation"),d=i.createElement("websparkBlockquoteCitationName"),u=i.createElement("websparkBlockquoteCitationDescription"),h=i.createText(e);if(i.append(h,a),t.length>0){const e=i.createText(t);i.append(e,d),i.append(d,c)}if(n.length>0){const e=i.createText(n);i.append(e,u),i.append(u,c)}i.append(l,s),i.append(a,r),i.append(c,r),i.append(r,s),o.insertContent(s)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkBlockquote");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkBlockquote"===o?.name){const t=o?.getChild(0)?.getChild(0)?._data;e.change((e=>{e.setAttribute("text",t,o)})),this.value=Object.fromEntries(o.getAttributes())}else this.value=null}_defaultSvgPath(){return"M113.61,245.82H0V164.56q0-49.34,8.69-77.83T40.84,35.58Q64.29,12.95,100.67,0l22.24,46.9q-34,11.33-48.72,31.54T58.63,132.21h55Zm180,0H180V164.56q0-49.74,8.7-78T221,35.58Q244.65,12.95,280.63,0l22.24,46.9q-34,11.33-48.72,31.54t-15.57,53.77h55Z"}}class H extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkBlockquote",new D(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkBlockquote",{isObject:!0,allowWhere:"$block"}),e.register("websparkBlockQuoteSvg",{isObject:!0,allowIn:"websparkBlockquote",allowContentOf:"$block",allowAttributes:["role","title","viewBox","xmlns"]}),e.register("websparkBlockQuoteContainer",{isLimit:!0,allowIn:"websparkBlockquote",allowContentOf:"$block"}),e.register("websparkBlockquoteParagraph",{isLimit:!0,allowIn:"websparkBlockQuoteContainer",allowContentOf:"$block"}),e.register("websparkBlockquoteCitation",{isLimit:!0,allowIn:"websparkBlockQuoteContainer",allowContentOf:"$text"}),e.register("websparkBlockquoteCitationName",{isLimit:!0,allowIn:"websparkBlockquoteCitation",allowContentOf:"$block"}),e.register("websparkBlockquoteCitationDescription",{isLimit:!0,allowIn:"websparkBlockquoteCitation",allowContentOf:"$block"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({model:"websparkBlockquoteCitationName",view:{name:"cite",classes:"name"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteCitationName",view:{name:"cite",classes:"name"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteCitationName",view:(e,{writer:n})=>{const o=n.createEditableElement("cite",{class:"name"});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteCitationDescription",view:{name:"cite",classes:"description"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteCitationDescription",view:{name:"cite",classes:"description"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteCitationDescription",view:(e,{writer:n})=>{const o=n.createEditableElement("cite",{class:"description"});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteCitation",view:{name:"div",classes:"citation"}}),e.for("dataDowncast").elementToStructure({model:"websparkBlockquoteCitation",view:(e,t)=>{const{writer:n}=t,o=n.createContainerElement("div",{class:"citation-content"},[n.createSlot()]);return n.createContainerElement("div",{class:"citation"},[o])}}),e.for("editingDowncast").elementToStructure({model:"websparkBlockquoteCitation",view:(e,t)=>{const{writer:n}=t,o=n.createContainerElement("div",{class:"citation-content"},[n.createSlot()]);return n.createContainerElement("div",{class:"citation"},[o])}}),e.for("upcast").elementToElement({model:"websparkBlockquoteParagraph",view:{name:"p"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteParagraph",view:{name:"p"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteParagraph",view:(e,{writer:n})=>{const o=n.createEditableElement("p",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockQuoteContainer",view:{name:"blockquote"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockQuoteContainer",view:{name:"blockquote"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockQuoteContainer",view:(e,{writer:n})=>{const o=n.createEditableElement("blockquote",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({view:{name:"div",attributes:{class:"open-quote"}},model:(e,{writer:t})=>t.createElement("websparkBlockQuoteSvg",{role:"presentation",title:"Open quote",viewBox:"0 0 302.87 245.82",xmlns:"http://www.w3.org/2000/svg"})}),e.for("upcast").elementToElement({view:{name:"svg",attributes:{role:"presentation",title:"Open quote"}},model:(e,{writer:t})=>t.createElement("websparkBlockQuoteSvg",{role:"presentation",title:"Open quote",viewBox:"0 0 302.87 245.82",xmlns:"http://www.w3.org/2000/svg"})}),e.for("downcast").elementToElement({model:"websparkBlockQuoteSvg",view:(e,{writer:t})=>t.createContainerElement("div",{class:"open-quote"})}),e.for("upcast").elementToElement({view:{name:"div",classes:["uds-blockquote","accent-maroon"]},model:(e,{writer:t})=>t.createElement("websparkBlockquote",{})}),e.for("dataDowncast").elementToElement({model:"websparkBlockquote",view:(e,{writer:t})=>t.createContainerElement("div",{class:"uds-blockquote accent-maroon"})}),e.for("editingDowncast").elementToElement({model:"websparkBlockquote",view:(e,{writer:n})=>{const o=n.createContainerElement("div",{class:"uds-blockquote accent-maroon"});return(0,t.toWidget)(o,n,{label:"BlockQuote"})}})}}class P extends s.View{DEFAULT_TEXT="";DEFAULT_STYLE="";DEFAULT_HEADING="";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputView=m(o("Content"),n),this.citationNameView=d(o("Citation Name"),n),this.citationDescriptionView=d(o("Citation Description"),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-blockquote-dialog"],tabindex:"-1"},children:[a(this.textInputView),a(this.citationNameView),a(this.citationDescriptionView),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputView.children[1],this.citationNameView.children[1],this.citationDescriptionView.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}get citationName(){return this.citationNameView.children[1].element.value.trim()}set citationName(e){this.citationNameView.children[1].element.value=e.trim()}get citationDescription(){return this.citationDescriptionView.children[1].element.value.trim()}set citationDescription(e){this.citationDescriptionView.children[1].element.value=e.trim()}setValues(e){this.text=e?.text||this.DEFAULT_TEXT,this.citationName=e?.citationName||this.DEFAULT_STYLE,this.citationDescription=e?.citationDescription||this.DEFAULT_HEADING}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return t.includes("text")&&(this.textInputView.errorText=t),!1}return!0}resetFormStatus(){this.textInputView.errorText=null}}class F extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkBlockquote");this.form=new P((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkBlockquote",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Blockquote"),icon:'',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputView.children[1].element.select()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkBlockquote",{text:t.text,citationName:t.citationName,citationDescription:t.citationDescription}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class M extends e.Plugin{static get requires(){return[H,F]}}function O(e,t,n,o,i=1){null!=t&&null!=i&&t>i?o.setAttribute(e,t,n):o.removeAttribute(e,n)}function q(e,t,n={}){const o=e.createElement("tableCell",n);return e.insertElement("paragraph",o),e.insert(o,t),o}function N(e,t){const n=t.parent.parent,o=parseInt(n.getAttribute("headingColumns")||"0"),{column:i}=e.getCellLocation(t);return!!o&&i{e.on("element:table",((e,t,n)=>{const o=t.viewItem;if(!n.consumable.test(o,{name:!0}))return;const{rows:i,headingRows:s,headingColumns:l}=function(e){let t,n=0;const o=[],i=[];let s;for(const l of Array.from(e.getChildren())){if("tbody"!==l.name&&"thead"!==l.name&&"tfoot"!==l.name)continue;"thead"!==l.name||s||(s=l);const e=Array.from(l.getChildren()).filter((e=>e.is("element","tr")));for(const r of e)if(s&&l===s||"tbody"===l.name&&Array.from(r.getChildren()).length&&Array.from(r.getChildren()).every((e=>e.is("element","th"))))n++,o.push(r);else{i.push(r);const e=W(r);(!t||en.convertItem(e,n.writer.createPositionAt(a,"end")))),n.convertChildren(o,n.writer.createPositionAt(a,"end")),a.isEmpty){const e=n.writer.createElement("tableRow");n.writer.insert(e,n.writer.createPositionAt(a,"end")),q(n.writer,n.writer.createPositionAt(e,"end"))}n.updateConversionResult(a,t)}}))}}function z(e){return t=>{t.on(`element:${e}`,((e,t,{writer:n})=>{if(!t.modelRange)return;const o=t.modelRange.start.nodeAfter,i=n.createPositionAt(o,0);if(t.viewItem.isEmpty)return void n.insertElement("paragraph",i);const s=Array.from(o.getChildren());if(s.every((e=>e.is("element","$marker")))){const e=n.createElement("paragraph");n.insert(e,n.createPositionAt(o,0));for(const t of s)n.move(n.createRangeOn(t),n.createPositionAt(e,"end"))}}),{priority:"low"})}}function W(e){let t=0,n=0;const o=Array.from(e.getChildren()).filter((e=>"th"===e.name||"td"===e.name));for(;n1||i>1)&&this._recordSpans(n,i,o),this._shouldSkipSlot()||(t=this._formatOutValue(n)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,n=this._column){return{done:!1,value:new G(this,e,t,n)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||n||o}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,n){const o={cell:e,row:this._row,column:this._column};for(let e=this._row;e0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){const e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}}class G{constructor(e,t,n,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=n,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function K(e,n){return(o,{writer:i})=>{const s=o.getAttribute("headingRows")||0,l=i.createContainerElement("table",null,[]),r=i.createContainerElement("figure",{class:"table"},l);s>0&&i.insert(i.createPositionAt(l,"end"),i.createContainerElement("thead",null,i.createSlot((e=>e.is("element","tableRow")&&e.indexe.is("element","tableRow")&&e.index>=s))));for(const{positionOffset:e,filter:t}of n.additionalSlots)i.insert(i.createPositionAt(l,e),i.createSlot(t));return i.insert(i.createPositionAt(l,"after"),i.createSlot((e=>!e.is("element","tableRow")&&!n.additionalSlots.some((({filter:t})=>t(e)))))),n.asWidget?function(e,n){return n.setCustomProperty("table",!0,e),(0,t.toWidget)(e,n,{hasSelectionHandle:!0})}(r,i):r}}function $(e={}){return(n,{writer:o})=>{const i=n.parent,s=i.parent,l=s.getChildIndex(i),r=new U(s,{row:l}),a=s.getAttribute("headingRows")||0,c=s.getAttribute("headingColumns")||0;let d=null;for(const i of r)if(i.cell==n){const n=i.row{if(!t.parent.is("element","tableCell"))return null;if(!Y(t))return null;if(e.asWidget)return n.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const e=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,e),e}}}function Y(e){return 1==e.parent.childCount&&!!e.getAttributeKeys().next().done}class Q extends e.Command{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema;this.isEnabled=function(e,t){const n=e.getFirstPosition().parent,o=n===n.root?n:n.parent;return t.checkChild(o,"table")}(t,n)}execute(e={}){const t=this.editor,n=t.model,o=t.plugins.get("TableUtils"),i=t.config.get("table.defaultHeadings.rows"),s=t.config.get("table.defaultHeadings.columns");void 0===e.headingRows&&i&&(e.headingRows=i),void 0===e.headingColumns&&s&&(e.headingColumns=s),n.change((t=>{const i=o.createTable(t,e);n.insertObject(i,null,null,{findOptimalPosition:"auto"}),t.setSelection(t.createPositionAt(i.getNodeByPath([0,0,0]),0))}))}}class X extends e.Command{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),o="above"===this.order,i=n.getSelectionAffectedTableCells(t),s=n.getRowIndexes(i),l=o?s.first:s.last,r=i[0].findAncestor("table");n.insertRows(r,{at:o?l:l+1,copyStructureFromAbove:!o})}}class J extends e.Command{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),o="left"===this.order,i=n.getSelectionAffectedTableCells(t),s=n.getColumnIndexes(i),l=o?s.first:s.last,r=i[0].findAncestor("table");n.insertColumns(r,{columns:1,at:o?l:l+1})}}class ee extends e.Command{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];"horizontally"===this.direction?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}function te(e,t,n){const{startRow:o,startColumn:i,endRow:s,endColumn:l}=t,r=n.createElement("table"),a=s-o+1;for(let e=0;e0){O("headingRows",s-n,e,i,0)}const l=parseInt(t.getAttribute("headingColumns")||"0");if(l>0){O("headingColumns",l-o,e,i,0)}}(r,e,o,i,n),r}function ne(e,t,n=0){const o=[],i=new U(e,{startRow:n,endRow:t-1});for(const e of i){const{row:n,cellHeight:i}=e;n1&&(r.rowspan=a);const c=parseInt(e.getAttribute("colspan")||"1");c>1&&(r.colspan=c);const d=s+l,u=[...new U(i,{startRow:s,endRow:d,includeAllSlots:!0})];let h,m=null;for(const t of u){const{row:o,column:i,cell:s}=t;s===e&&void 0===h&&(h=i),void 0!==h&&h===i&&o===d&&(m=q(n,t.getPositionBefore(),r))}return O("rowspan",l,e,n),m}function ie(e,t){const n=[],o=new U(e);for(const e of o){const{column:o,cellWidth:i}=e;o1&&(s.colspan=l);const r=parseInt(e.getAttribute("rowspan")||"1");r>1&&(s.rowspan=r);const a=q(o,o.createPositionAfter(e),s);return O("colspan",i,e,o),a}function le(e,t,n,o,i,s){const l=parseInt(e.getAttribute("colspan")||"1"),r=parseInt(e.getAttribute("rowspan")||"1");if(n+l-1>i){O("colspan",i-n+1,e,s,1)}if(t+r-1>o){O("rowspan",o-t+1,e,s,1)}}function re(e,t){const n=t.getColumns(e),o=new Array(n).fill(0);for(const{column:t}of new U(e))o[t]++;const i=o.reduce(((e,t,n)=>t?e:[...e,n]),[]);if(i.length>0){const n=i[i.length-1];return t.removeColumns(e,{at:n}),!0}return!1}function ae(e,t){const n=[],o=t.getRows(e);for(let t=0;t0){const o=n[n.length-1];return t.removeRows(e,{at:o}),!0}return!1}function ce(e,t){re(e,t)||ae(e,t)}function de(e,t){const n=Array.from(new U(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(n.every((({cellHeight:e})=>1===e)))return t.lastRow;const o=n[0].cellHeight-1;return t.lastRow+o}function ue(e,t){const n=Array.from(new U(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(n.every((({cellWidth:e})=>1===e)))return t.lastColumn;const o=n[0].cellWidth-1;return t.lastColumn+o}class he extends e.Command{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,n=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],o=this.value,i=this.direction;e.change((e=>{const t="right"==i||"down"==i,s=t?n:o,l=t?o:n,r=l.parent;!function(e,t,n){me(e)||(me(t)&&n.remove(n.createRangeIn(t)),n.move(n.createRangeIn(e),n.createPositionAt(t,"end")));n.remove(e)}(l,s,e);const a=this.isHorizontal?"colspan":"rowspan",c=parseInt(n.getAttribute(a)||"1"),d=parseInt(o.getAttribute(a)||"1");e.setAttribute(a,c+d,s),e.setSelection(e.createRangeIn(s));const u=this.editor.plugins.get("TableUtils");ce(r.findAncestor("table"),u)}))}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),n=t.getTableCellsContainingSelection(e.selection)[0];if(!n)return;const o=this.isHorizontal?function(e,t,n){const o=e.parent,i=o.parent,s="right"==t?e.nextSibling:e.previousSibling,l=(i.getAttribute("headingColumns")||0)>0;if(!s)return;const r="right"==t?e:s,a="right"==t?s:e,{column:c}=n.getCellLocation(r),{column:d}=n.getCellLocation(a),u=parseInt(r.getAttribute("colspan")||"1"),h=N(n,r),m=N(n,a);if(l&&h!=m)return;return c+u===d?s:void 0}(n,this.direction,t):function(e,t,n){const o=e.parent,i=o.parent,s=i.getChildIndex(o);if("down"==t&&s===n.getRows(i)-1||"up"==t&&0===s)return null;const l=parseInt(e.getAttribute("rowspan")||"1"),r=i.getAttribute("headingRows")||0,a="down"==t&&s+l===r,c="up"==t&&s===r;if(r&&(a||c))return null;const d=parseInt(e.getAttribute("rowspan")||"1"),u="down"==t?s+d:s,h=[...new U(i,{endRow:u})],m=h.find((t=>t.cell===e)),g=m.column,p=h.find((({row:e,cellHeight:n,column:o})=>o===g&&("down"==t?e===u:u===e+n)));return p&&p.cell?p.cell:null}(n,this.direction,t);if(!o)return;const i=this.isHorizontal?"rowspan":"colspan",s=parseInt(n.getAttribute(i)||"1");return parseInt(o.getAttribute(i)||"1")===s?o:void 0}}function me(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}class ge extends e.Command{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),n=t[0];if(n){const o=n.findAncestor("table"),i=e.getRows(o)-1,s=e.getRowIndexes(t),l=0===s.first&&s.last===i;this.isEnabled=!l}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(n),i=n[0],s=i.findAncestor("table"),l=t.getCellLocation(i).column;e.change((e=>{const n=o.last-o.first+1;t.removeRows(s,{at:o.first,rows:n});const i=function(e,t,n,o){const i=e.getChild(Math.min(t,o-1));let s=i.getChild(0),l=0;for(const e of i.getChildren()){if(l>n)return s;s=e,l+=parseInt(e.getAttribute("colspan")||"1")}return s}(s,o.first,l,t.getRows(s));e.setSelection(e.createPositionAt(i,0))}))}}class pe extends e.Command{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),n=t[0];if(n){const o=n.findAncestor("table"),i=e.getColumns(o),{first:s,last:l}=e.getColumnIndexes(t);this.isEnabled=l-se.cell===t)).column,last:i.find((e=>e.cell===n)).column},l=function(e,t,n,o){const i=parseInt(n.getAttribute("colspan")||"1");return i>1?n:t.previousSibling||n.nextSibling?n.nextSibling||t.previousSibling:o.first?e.reverse().find((({column:e})=>ee>o.last)).cell}(i,t,n,s);this.editor.model.change((t=>{const n=s.last-s.first+1;e.removeColumns(o,{at:s.first,columns:n}),t.setSelection(t.createPositionAt(l,0))}))}}class we extends e.Command{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,n=e.getSelectionAffectedTableCells(t.document.selection),o=n.length>0;this.isEnabled=o,this.value=o&&n.every((e=>this._isInHeading(e,e.parent.parent)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),n=this.editor.model,o=t.getSelectionAffectedTableCells(n.document.selection),i=o[0].findAncestor("table"),{first:s,last:l}=t.getRowIndexes(o),r=this.value?s:l+1,a=i.getAttribute("headingRows")||0;n.change((e=>{if(r){const t=ne(i,r,r>a?a:0);for(const{cell:n}of t)oe(n,r,e)}O("headingRows",r,i,e,0)}))}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||"0");return!!n&&e.parent.index0;this.isEnabled=o,this.value=o&&n.every((e=>N(t,e)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),n=this.editor.model,o=t.getSelectionAffectedTableCells(n.document.selection),i=o[0].findAncestor("table"),{first:s,last:l}=t.getColumnIndexes(o),r=this.value?s:l+1;n.change((e=>{if(r){const t=ie(i,r);for(const{cell:n,column:o}of t)se(n,o,r,e)}O("headingColumns",r,i,e,0)}))}}function fe(e){if(e.is("element","tableColumnGroup"))return e;const t=e.getChildren();return Array.from(t).find((e=>e.is("element","tableColumnGroup")))}function ke(e){const t=fe(e);return t?Array.from(t.getChildren()):[]}class ve extends e.Plugin{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,n=t.parent,o=n.getChildIndex(t),i=new U(n,{row:o});for(const{cell:t,row:n,column:o}of i)if(t===e)return{row:n,column:o}}createTable(e,t){const n=e.createElement("table"),o=t.rows||2,i=t.columns||2;return Ce(e,n,0,o,i),t.headingRows&&O("headingRows",Math.min(t.headingRows,o),n,e,0),t.headingColumns&&O("headingColumns",Math.min(t.headingColumns,i),n,e,0),n}insertRows(e,t={}){const n=this.editor.model,o=t.at||0,i=t.rows||1,s=void 0!==t.copyStructureFromAbove,l=t.copyStructureFromAbove?o-1:o,r=this.getRows(e),a=this.getColumns(e);if(o>r)throw new w.CKEditorError("tableutils-insertrows-insert-out-of-range",this,{options:t});n.change((t=>{const n=e.getAttribute("headingRows")||0;if(n>o&&O("headingRows",n+i,e,t,0),!s&&(0===o||o===r))return void Ce(t,e,o,i,a);const c=s?Math.max(o,l):o,d=new U(e,{endRow:c}),u=new Array(a).fill(1);for(const{row:e,column:n,cellHeight:r,cellWidth:a,cell:c}of d){const d=e+r-1,h=e<=l&&l<=d;e0&&q(t,i,o>1?{colspan:o}:void 0),e+=Math.abs(o)-1}}}))}insertColumns(e,t={}){const n=this.editor.model,o=t.at||0,i=t.columns||1;n.change((t=>{const n=e.getAttribute("headingColumns");oi-1)throw new w.CKEditorError("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});n.change((t=>{const n={first:s,last:l},{cellsToMove:o,cellsToTrim:i}=function(e,{first:t,last:n}){const o=new Map,i=[];for(const{row:s,column:l,cellHeight:r,cell:a}of new U(e,{endRow:n})){const e=s+r-1;if(s>=t&&s<=n&&e>n){const e=r-(n-s+1);o.set(l,{cell:a,rowspan:e})}if(s=t){let o;o=e>=n?n-t+1:e-t+1,i.push({cell:a,rowspan:r-o})}}return{cellsToMove:o,cellsToTrim:i}}(e,n);if(o.size){!function(e,t,n,o){const i=new U(e,{includeAllSlots:!0,row:t}),s=[...i],l=e.getChild(t);let r;for(const{column:e,cell:t,isAnchor:i}of s)if(n.has(e)){const{cell:t,rowspan:i}=n.get(e),s=r?o.createPositionAfter(r):o.createPositionAt(l,0);o.move(o.createRangeOn(t),s),O("rowspan",i,t,o),r=t}else i&&(r=t)}(e,l+1,o,t)}for(let n=l;n>=s;n--)t.remove(e.getChild(n));for(const{rowspan:e,cell:n}of i)O("rowspan",e,n,t);!function(e,{first:t,last:n},o){const i=e.getAttribute("headingRows")||0;if(t{!function(e,t,n){const o=e.getAttribute("headingColumns")||0;if(o&&t.first=o;i--){for(const{cell:n,column:o,cellWidth:s}of[...new U(e)])o<=i&&s>1&&o+s>i?O("colspan",s-1,n,t):o===i&&t.remove(n);if(n[i]){const e=0===i?n[1]:n[i-1],o=parseFloat(n[i].getAttribute("columnWidth")),s=parseFloat(e.getAttribute("columnWidth"));t.remove(n[i]),t.setAttribute("columnWidth",o+s+"%",e)}}ae(e,this)||re(e,this)}))}splitCellVertically(e,t=2){const n=this.editor.model,o=e.parent.parent,i=parseInt(e.getAttribute("rowspan")||"1"),s=parseInt(e.getAttribute("colspan")||"1");n.change((n=>{if(s>1){const{newCellsSpan:o,updatedSpan:l}=ye(s,t);O("colspan",l,e,n);const r={};o>1&&(r.colspan=o),i>1&&(r.rowspan=i);Te(s>t?t-1:s-1,n,n.createPositionAfter(e),r)}if(st===e)),c=r.filter((({cell:t,cellWidth:n,column:o})=>t!==e&&o===a||oa));for(const{cell:e,cellWidth:t}of c)n.setAttribute("colspan",t+l,e);const d={};i>1&&(d.rowspan=i),Te(l,n,n.createPositionAfter(e),d);const u=o.getAttribute("headingColumns")||0;u>a&&O("headingColumns",u+l,o,n)}}))}splitCellHorizontally(e,t=2){const n=this.editor.model,o=e.parent,i=o.parent,s=i.getChildIndex(o),l=parseInt(e.getAttribute("rowspan")||"1"),r=parseInt(e.getAttribute("colspan")||"1");n.change((n=>{if(l>1){const o=[...new U(i,{startRow:s,endRow:s+l-1,includeAllSlots:!0})],{newCellsSpan:a,updatedSpan:c}=ye(l,t);O("rowspan",c,e,n);const{column:d}=o.find((({cell:t})=>t===e)),u={};a>1&&(u.rowspan=a),r>1&&(u.colspan=r);for(const e of o){const{column:t,row:o}=e;o>=s+c&&t===d&&(o+s+c)%a==0&&Te(1,n,e.getPositionBefore(),u)}}if(ls){const e=i+o;n.setAttribute("rowspan",e,t)}const c={};r>1&&(c.colspan=r),Ce(n,i,s+1,o,1,c);const d=i.getAttribute("headingRows")||0;d>s&&O("headingRows",d+o,i,n)}}))}getColumns(e){return[...e.getChild(0).getChildren()].reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}getRows(e){return Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0)}createTableWalker(e,t={}){return new U(e,t)}getSelectedTableCells(e){const t=[];for(const n of this.sortRanges(e.getRanges())){const e=n.getContainedElement();e&&e.is("element","tableCell")&&t.push(e)}return t}getTableCellsContainingSelection(e){const t=[];for(const n of e.getRanges()){const e=n.start.findAncestor("tableCell");e&&t.push(e)}return t}getSelectionAffectedTableCells(e){const t=this.getSelectedTableCells(e);return t.length?t:this.getTableCellsContainingSelection(e)}getRowIndexes(e){const t=e.map((e=>e.parent.index));return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){const t=e[0].findAncestor("table"),n=[...new U(t)].filter((t=>e.includes(t.cell))).map((e=>e.column));return this._getFirstLastIndexesObject(n)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;const t=new Set,n=new Set;let o=0;for(const i of e){const{row:e,column:s}=this.getCellLocation(i),l=parseInt(i.getAttribute("rowspan"))||1,r=parseInt(i.getAttribute("colspan"))||1;t.add(e),n.add(s),l>1&&t.add(e+l-1),r>1&&n.add(s+r-1),o+=l*r}const i=function(e,t){const n=Array.from(e.values()),o=Array.from(t.values()),i=Math.max(...n),s=Math.min(...n),l=Math.max(...o),r=Math.min(...o);return(i-s+1)*(l-r+1)}(t,n);return i==o}sortRanges(e){return Array.from(e).sort(_e)}_getFirstLastIndexesObject(e){const t=e.sort(((e,t)=>e-t));return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){const t=e[0].findAncestor("table"),n=this.getRowIndexes(e),o=parseInt(t.getAttribute("headingRows"))||0;if(!this._areIndexesInSameSection(n,o))return!1;const i=this.getColumnIndexes(e),s=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameSection(i,s)}_areIndexesInSameSection({first:e,last:t},n){return e{const o=t.getSelectedTableCells(e.document.selection),i=o.shift(),{mergeWidth:s,mergeHeight:l}=function(e,t,n){let o=0,i=0;for(const e of t){const{row:t,column:s}=n.getCellLocation(e);o=Se(e,s,o,"colspan"),i=Se(e,t,i,"rowspan")}const{row:s,column:l}=n.getCellLocation(e),r=o-l,a=i-s;return{mergeWidth:r,mergeHeight:a}}(i,o,t);O("colspan",s,i,n),O("rowspan",l,i,n);for(const e of o)Ee(e,i,n);ce(i.findAncestor("table"),t),n.setSelection(i,"in")}))}}function Ee(e,t,n){Ae(e)||(Ae(t)&&n.remove(n.createRangeIn(t)),n.move(n.createRangeIn(e),n.createPositionAt(t,"end"))),n.remove(e)}function Ae(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}function Se(e,t,n,o){const i=parseInt(e.getAttribute(o)||"1");return Math.max(n,t+i)}class Ve extends e.Command{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(n),i=n[0].findAncestor("table"),s=[];for(let t=o.first;t<=o.last;t++)for(const n of i.getChild(t).getChildren())s.push(e.createRangeOn(n));e.change((e=>{e.setSelection(s)}))}}class Be extends e.Command{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,n=e.getSelectionAffectedTableCells(t.document.selection),o=n[0],i=n.pop(),s=o.findAncestor("table"),l=e.getCellLocation(o),r=e.getCellLocation(i),a=Math.min(l.column,r.column),c=Math.max(l.column,r.column),d=[];for(const e of new U(s,{startColumn:a,endColumn:c}))d.push(t.createRangeOn(e.cell));t.change((e=>{e.setSelection(d)}))}}function Re(e){e.document.registerPostFixer((t=>function(e,t){const n=t.document.differ.getChanges();let o=!1;const i=new Set;for(const t of n){let n=null;"insert"==t.type&&"table"==t.name&&(n=t.position.nodeAfter),"insert"!=t.type&&"remove"!=t.type||"tableRow"!=t.name&&"tableCell"!=t.name||(n=t.position.findAncestor("table")),De(t)&&(n=t.range.start.findAncestor("table")),n&&!i.has(n)&&(o=Ie(n,e)||o,o=Le(n,e)||o,i.add(n))}return o}(t,e)))}function Ie(e,t){let n=!1;const o=function(e){const t=parseInt(e.getAttribute("headingRows")||"0"),n=Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0),o=[];for(const{row:i,cell:s,cellHeight:l}of new U(e)){if(l<2)continue;const e=ie){const t=e-i;o.push({cell:s,rowspan:t})}}return o}(e);if(o.length){n=!0;for(const e of o)O("rowspan",e.rowspan,e.cell,t,1)}return n}function Le(e,t){let n=!1;const o=function(e){const t=new Array(e.childCount).fill(0);for(const{rowIndex:n}of new U(e,{includeAllSlots:!0}))t[n]++;return t}(e),i=[];for(const[t,n]of o.entries())!n&&e.getChild(t).is("element","tableRow")&&i.push(t);if(i.length){n=!0;for(const n of i.reverse())t.remove(e.getChild(n)),o.splice(n,1)}const s=o.filter(((t,n)=>e.getChild(n).is("element","tableRow"))),l=s[0];if(!s.every((e=>e===l))){const o=s.reduce(((e,t)=>t>e?t:e),0);for(const[i,l]of s.entries()){const s=o-l;if(s){for(let n=0;nfunction(e,t){const n=t.document.differ.getChanges();let o=!1;for(const t of n)"insert"==t.type&&"table"==t.name&&(o=Pe(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableRow"==t.name&&(o=Fe(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableCell"==t.name&&(o=Me(t.position.nodeAfter,e)||o),"remove"!=t.type&&"insert"!=t.type||!Oe(t)||(o=Me(t.position.parent,e)||o);return o}(t,e)))}function Pe(e,t){let n=!1;for(const o of e.getChildren())o.is("element","tableRow")&&(n=Fe(o,t)||n);return n}function Fe(e,t){let n=!1;for(const o of e.getChildren())n=Me(o,t)||n;return n}function Me(e,t){if(0==e.childCount)return t.insertElement("paragraph",e),!0;const n=Array.from(e.getChildren()).filter((e=>e.is("$text")));for(const e of n)t.wrap(t.createRangeOn(e),"paragraph");return!!n.length}function Oe(e){return!!e.position.parent.is("element","tableCell")&&("insert"==e.type&&"$text"==e.name||"remove"==e.type)}function qe(e,t){if(!e.is("element","paragraph"))return!1;const n=t.toViewElement(e);return!!n&&Y(e)!==n.is("element","span")}var Ne=n("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),je=n.n(Ne),ze=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css"),We={insert:"head",singleton:!1};je()(ze.Z,We);ze.Z.locals;class Ue extends e.Plugin{static get pluginName(){return"TableEditing"}static get requires(){return[ve]}constructor(e){super(e),this._additionalSlots=[]}init(){const e=this.editor,t=e.model,n=t.schema,o=e.conversion,i=e.plugins.get(ve);n.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns"]}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add((e=>{e.on("element:figure",((e,t,n)=>{if(!n.consumable.test(t.viewItem,{name:!0,classes:"table"}))return;const o=function(e){for(const t of e.getChildren())if(t.is("element","table"))return t}(t.viewItem);if(!o||!n.consumable.test(o,{name:!0}))return;n.consumable.consume(t.viewItem,{name:!0,classes:"table"});const i=n.convertItem(o,t.modelCursor),s=(0,w.first)(i.modelRange.getItems());s?(n.convertChildren(t.viewItem,n.writer.createPositionAt(s,"end")),n.updateConversionResult(s,t)):n.consumable.revert(t.viewItem,{name:!0,classes:"table"})}))})),o.for("upcast").add(j()),o.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:K(i,{asWidget:!0,additionalSlots:this._additionalSlots})}),o.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:K(i,{additionalSlots:this._additionalSlots})}),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add((e=>{e.on("element:tr",((e,t)=>{t.viewItem.isEmpty&&0==t.modelCursor.index&&e.stop()}),{priority:"high"})})),o.for("downcast").elementToElement({model:"tableRow",view:(e,{writer:t})=>e.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(z("td")),o.for("upcast").add(z("th")),o.for("editingDowncast").elementToElement({model:"tableCell",view:$({asWidget:!0})}),o.for("dataDowncast").elementToElement({model:"tableCell",view:$()}),o.for("editingDowncast").elementToElement({model:"paragraph",view:Z({asWidget:!0}),converterPriority:"high"}),o.for("dataDowncast").elementToElement({model:"paragraph",view:Z(),converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:Ge("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:Ge("rowspan")},view:"rowspan"}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new Q(e)),e.commands.add("insertTableRowAbove",new X(e,{order:"above"})),e.commands.add("insertTableRowBelow",new X(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new J(e,{order:"left"})),e.commands.add("insertTableColumnRight",new J(e,{order:"right"})),e.commands.add("removeTableRow",new ge(e)),e.commands.add("removeTableColumn",new pe(e)),e.commands.add("splitTableCellVertically",new ee(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new ee(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new xe(e)),e.commands.add("mergeTableCellRight",new he(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new he(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new he(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new he(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new be(e)),e.commands.add("setTableRowHeader",new we(e)),e.commands.add("selectTableRow",new Ve(e)),e.commands.add("selectTableColumn",new Be(e)),Re(t),He(t),this.listenTo(t.document,"change:data",(()=>{!function(e,t){const n=e.document.differ;for(const e of n.getChanges()){let n,o=!1;if("attribute"==e.type){const t=e.range.start.nodeAfter;if(!t||!t.is("element","table"))continue;if("headingRows"!=e.attributeKey&&"headingColumns"!=e.attributeKey)continue;n=t,o="headingRows"==e.attributeKey}else"tableRow"!=e.name&&"tableCell"!=e.name||(n=e.position.findAncestor("table"),o="tableRow"==e.name);if(!n)continue;const i=n.getAttribute("headingRows")||0,s=n.getAttribute("headingColumns")||0,l=new U(n);for(const e of l){const n=e.rowqe(e,t.mapper)));for(const e of n)t.reconvertItem(e)}}(t,e.editing)}))}registerAdditionalSlot(e){this._additionalSlots.push(e)}}function Ge(e){return t=>{const n=parseInt(t.getAttribute(e));return Number.isNaN(n)||n<=0?null:n}}var Ke=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css"),$e={insert:"head",singleton:!1};je()(Ke.Z,$e);Ke.Z.locals;class Ze extends s.View{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new w.KeystrokeHandler,this.focusTracker=new w.FocusTracker,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",((e,t)=>`${t} × ${e}`)),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to((e=>{e.preventDefault()})),click:t.to((()=>{this.fire("execute")}))}}),this.on("boxover",((e,t)=>{const{row:n,column:o}=t.target.dataset;this.items.get(10*(parseInt(n,10)-1)+(parseInt(o,10)-1)).focus()})),this.focusTracker.on("change:focusedElement",((e,t,n)=>{if(!n)return;const{row:o,column:i}=n.dataset;this.set({rows:parseInt(o),columns:parseInt(i)})})),this.on("change:columns",(()=>this._highlightGridBoxes())),this.on("change:rows",(()=>this._highlightGridBoxes()))}render(){super.render(),(0,s.addKeyboardHandlingForGrid)({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map(((n,o)=>{const i=Math.floor(o/10){const o=e.commands.get("insertTable"),i=(0,s.createDropdown)(n);let l;return i.bind("isEnabled").to(o),i.buttonView.set({icon:'',label:t("Insert table"),tooltip:!0}),i.on("change:isOpen",(()=>{l||(l=new Ze(n),i.panelView.children.add(l),l.delegate("execute").to(i),i.on("execute",(()=>{e.execute("insertTable",{rows:l.rows,columns:l.columns}),e.editing.view.focus()})))})),i})),e.ui.componentFactory.add("tableColumn",(e=>{const o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:n?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:n?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'',o,e)})),e.ui.componentFactory.add("tableRow",(e=>{const n=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'',n,e)})),e.ui.componentFactory.add("mergeTableCells",(e=>{const o=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:n?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:n?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'',o,e)}))}_prepareDropdown(e,t,n,o){const i=this.editor,l=(0,s.createDropdown)(o),r=this._fillDropdownWithListOptions(l,n);return l.buttonView.set({label:e,icon:t,tooltip:!0}),l.bind("isEnabled").toMany(r,"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(l,"execute",(e=>{i.execute(e.source.commandName),e.source instanceof s.SwitchButtonView||i.editing.view.focus()})),l}_prepareMergeSplitButtonDropdown(e,t,n,o){const i=this.editor,l=(0,s.createDropdown)(o,s.SplitButtonView),r="mergeTableCells",a=i.commands.get(r),c=this._fillDropdownWithListOptions(l,n);return l.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),l.bind("isEnabled").toMany([a,...c],"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(l.buttonView,"execute",(()=>{i.execute(r),i.editing.view.focus()})),this.listenTo(l,"execute",(e=>{i.execute(e.source.commandName),i.editing.view.focus()})),l}_fillDropdownWithListOptions(e,t){const n=this.editor,o=[],i=new w.Collection;for(const e of t)Qe(e,n,o,i);return(0,s.addListToDropdown)(e,i),o}}function Qe(e,t,n,o){if("button"===e.type||"switchbutton"===e.type){const o=e.model=new s.Model(e.model),{commandName:i,bindIsOn:l}=e.model,r=t.commands.get(i);n.push(r),o.set({commandName:i}),o.bind("isEnabled").to(r),l&&o.bind("isOn").to(r,"value"),o.set({withText:!0})}o.add(e)}var Xe=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css"),Je={insert:"head",singleton:!1};je()(Xe.Z,Je);Xe.Z.locals;class et extends e.Plugin{static get pluginName(){return"TableSelection"}static get requires(){return[ve,ve]}init(){const e=this.editor,t=e.model,n=e.editing.view;this.listenTo(t,"deleteContent",((e,t)=>this._handleDeleteContent(e,t)),{priority:"high"}),this.listenTo(n.document,"insertText",((e,t)=>this._handleInsertTextEvent(e,t)),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=this.editor.plugins.get(ve),t=this.editor.model.document.selection,n=e.getSelectedTableCells(t);return 0==n.length?null:n}getSelectionAsFragment(){const e=this.editor.plugins.get(ve),t=this.getSelectedTableCells();return t?this.editor.model.change((n=>{const o=n.createDocumentFragment(),{first:i,last:s}=e.getColumnIndexes(t),{first:l,last:r}=e.getRowIndexes(t),a=t[0].findAncestor("table");let c=r,d=s;if(e.isSelectionRectangular(t)){const e={firstColumn:i,lastColumn:s,firstRow:l,lastRow:r};c=de(a,e),d=ue(a,e)}const u=te(a,{startRow:l,startColumn:i,endRow:c,endColumn:d},n);return n.insert(u,o,0),o})):null}setCellSelection(e,t){const n=this._getCellsToSelect(e,t);this.editor.model.change((e=>{e.setSelection(n.cells.map((t=>e.createRangeOn(t))),{backward:n.backward})}))}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=this.editor.model.document.selection,t=(0,w.first)(e.getRanges()).getContainedElement();return t&&t.is("element","tableCell")?t:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add((e=>e.on("selection",((e,n,o)=>{const i=o.writer;!function(e){for(const n of t)e.removeClass("ck-editor__editable_selected",n);t.clear()}(i);const s=this.getSelectedTableCells();if(!s)return;for(const e of s){const n=o.mapper.toViewElement(e);i.addClass("ck-editor__editable_selected",n),t.add(n)}const l=o.mapper.toViewElement(s[s.length-1]);i.setSelection(l,0)}),{priority:"lowest"})))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",(()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change((n=>{const o=n.createPositionAt(t[0],0),i=e.model.schema.getNearestSelectionRange(o);n.setSelection(i)}))}}))}_handleDeleteContent(e,t){const n=this.editor.plugins.get(ve),o=t[0],i=t[1],s=this.editor.model,l=!i||"backward"==i.direction,r=n.getSelectedTableCells(o);r.length&&(e.stop(),s.change((e=>{const t=r[l?r.length-1:0];s.change((e=>{for(const t of r)s.deleteContent(e.createSelection(t,"in"))}));const n=s.schema.getNearestSelectionRange(e.createPositionAt(t,0));o.is("documentSelection")?e.setSelection(n):o.setTo(n)})))}_handleInsertTextEvent(e,t){const n=this.editor,o=this.getSelectedTableCells();if(!o)return;const i=n.editing.view,s=n.editing.mapper,l=o.map((e=>i.createRangeOn(s.toViewElement(e))));t.selection=i.createSelection(l)}_getCellsToSelect(e,t){const n=this.editor.plugins.get("TableUtils"),o=n.getCellLocation(e),i=n.getCellLocation(t),s=Math.min(o.row,i.row),l=Math.max(o.row,i.row),r=Math.min(o.column,i.column),a=Math.max(o.column,i.column),c=new Array(l-s+1).fill(null).map((()=>[])),d={startRow:s,endRow:l,startColumn:r,endColumn:a};for(const{row:t,cell:n}of new U(e.findAncestor("table"),d))c[t-s].push(n);const u=i.rowe.reverse())),{cells:c.flat(),backward:u||h}}}class tt extends e.Plugin{static get pluginName(){return"TableClipboard"}static get requires(){return[et,ve]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",((e,t)=>this._onCopyCut(e,t))),this.listenTo(t,"cut",((e,t)=>this._onCopyCut(e,t))),this.listenTo(e.model,"insertContent",((e,[t,n])=>this._onInsertContent(e,t,n)),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const n=this.editor.plugins.get(et);if(!n.getSelectedTableCells())return;if("cut"==e.name&&!this.editor.model.canEditAt(this.editor.model.document.selection))return;t.preventDefault(),e.stop();const o=this.editor.data,i=this.editor.editing.view.document,s=o.toView(n.getSelectionAsFragment());i.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:s,method:e.name})}_onInsertContent(e,t,n){if(n&&!n.is("documentSelection"))return;const o=this.editor.model,i=this.editor.plugins.get(ve);let s=this.getTableIfOnlyTableInContent(t,o);if(!s)return;const l=i.getSelectionAffectedTableCells(o.document.selection);l.length?(e.stop(),o.change((e=>{const t={width:i.getColumns(s),height:i.getRows(s)},n=function(e,t,n,o){const i=e[0].findAncestor("table"),s=o.getColumnIndexes(e),l=o.getRowIndexes(e),r={firstColumn:s.first,lastColumn:s.last,firstRow:l.first,lastRow:l.last},a=1===e.length;a&&(r.lastRow+=t.height-1,r.lastColumn+=t.width-1,function(e,t,n,o){const i=o.getColumns(e),s=o.getRows(e);n>i&&o.insertColumns(e,{at:i,columns:n-i});t>s&&o.insertRows(e,{at:s,rows:t-s})}(i,r.lastRow+1,r.lastColumn+1,o));a||!o.isSelectionRectangular(e)?function(e,t,n){const{firstRow:o,lastRow:i,firstColumn:s,lastColumn:l}=t,r={first:o,last:i},a={first:s,last:l};ot(e,s,r,n),ot(e,l+1,r,n),nt(e,o,a,n),nt(e,i+1,a,n,o)}(i,r,n):(r.lastRow=de(i,r),r.lastColumn=ue(i,r));return r}(l,t,e,i),o=n.lastRow-n.firstRow+1,r=n.lastColumn-n.firstColumn+1,a={startRow:0,startColumn:0,endRow:Math.min(o,t.height)-1,endColumn:Math.min(r,t.width)-1};s=te(s,a,e);const c=l[0].findAncestor("table"),d=this._replaceSelectedCellsWithPasted(s,t,c,n,e);if(this.editor.plugins.get("TableSelection").isEnabled){const t=i.sortRanges(d.map((t=>e.createRangeOn(t))));e.setSelection(t)}else e.setSelection(d[0],0)}))):ce(s,i)}_replaceSelectedCellsWithPasted(e,t,n,o,i){const{width:s,height:l}=t,r=function(e,t,n){const o=new Array(n).fill(null).map((()=>new Array(t).fill(null)));for(const{column:t,row:n,cell:i}of new U(e))o[n][t]=i;return o}(e,s,l),a=[...new U(n,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})],c=[];let d;for(const e of a){const{row:t,column:n}=e;n===o.firstColumn&&(d=e.getPositionBefore());const a=t-o.firstRow,u=n-o.firstColumn,h=r[a%l][u%s],m=h?i.cloneElement(h):null,g=this._replaceTableSlotCell(e,m,d,i);g&&(le(g,t,n,o.lastRow,o.lastColumn,i),c.push(g),d=i.createPositionAfter(g))}const u=parseInt(n.getAttribute("headingRows")||"0"),h=parseInt(n.getAttribute("headingColumns")||"0"),m=o.firstRowit(e,t,n))).map((({cell:e})=>oe(e,t,o)))}function ot(e,t,n,o){if(t<1)return;return ie(e,t).filter((({row:e,cellHeight:t})=>it(e,t,n))).map((({cell:e,column:n})=>se(e,n,t,o)))}function it(e,t,n){const o=e+t-1,{first:i,last:s}=n;return e>=i&&e<=s||e=i}class st extends e.Plugin{static get pluginName(){return"TableKeyboard"}static get requires(){return[et,ve]}init(){const e=this.editor.editing.view.document;this.listenTo(e,"arrowKey",((...e)=>this._onArrowKey(...e)),{context:"table"}),this.listenTo(e,"tab",((...e)=>this._handleTabOnSelectedTable(...e)),{context:"figure"}),this.listenTo(e,"tab",((...e)=>this._handleTab(...e)),{context:["th","td"]})}_handleTabOnSelectedTable(e,t){const n=this.editor,o=n.model.document.selection.getSelectedElement();o&&o.is("element","table")&&(t.preventDefault(),t.stopPropagation(),e.stop(),n.model.change((e=>{e.setSelection(e.createRangeIn(o.getChild(0).getChild(0)))})))}_handleTab(e,t){const n=this.editor,o=this.editor.plugins.get(ve),i=this.editor.plugins.get("TableSelection"),s=n.model.document.selection,l=!t.shiftKey;let r=o.getTableCellsContainingSelection(s)[0];if(r||(r=i.getFocusCell()),!r)return;t.preventDefault(),t.stopPropagation(),e.stop();const a=r.parent,c=a.parent,d=c.getChildIndex(a),u=a.getChildIndex(r),h=0===u;if(!l&&h&&0===d)return void n.model.change((e=>{e.setSelection(e.createRangeOn(c))}));const m=u===a.childCount-1,g=d===o.getRows(c)-1;if(l&&g&&m&&(n.execute("insertTableRowBelow"),d===o.getRows(c)-1))return void n.model.change((e=>{e.setSelection(e.createRangeOn(c))}));let p;if(l&&m){const e=c.getChild(d+1);p=e.getChild(0)}else if(!l&&h){const e=c.getChild(d-1);p=e.getChild(e.childCount-1)}else p=a.getChild(u+(l?1:-1));n.model.change((e=>{e.setSelection(e.createRangeIn(p))}))}_onArrowKey(e,t){const n=this.editor,o=t.keyCode,i=(0,w.getLocalizedArrowKeyCodeDirection)(o,n.locale.contentLanguageDirection);this._handleArrowKeys(i,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const n=this.editor.plugins.get(ve),o=this.editor.plugins.get("TableSelection"),i=this.editor.model,s=i.document.selection,l=["right","down"].includes(e),r=n.getSelectedTableCells(s);if(r.length){let n;return n=t?o.getFocusCell():l?r[r.length-1]:r[0],this._navigateFromCellInDirection(n,e,t),!0}const a=s.focus.findAncestor("tableCell");if(!a)return!1;if(!s.isCollapsed)if(t){if(s.isBackward==l&&!s.containsEntireContent(a))return!1}else{const e=s.getSelectedElement();if(!e||!i.schema.isObject(e))return!1}return!!this._isSelectionAtCellEdge(s,a,l)&&(this._navigateFromCellInDirection(a,e,t),!0)}_isSelectionAtCellEdge(e,t,n){const o=this.editor.model,i=this.editor.model.schema,s=n?e.getLastPosition():e.getFirstPosition();if(!i.getLimitElement(s).is("element","tableCell")){return o.createPositionAt(t,n?"end":0).isTouching(s)}const l=o.createSelection(s);return o.modifySelection(l,{direction:n?"forward":"backward"}),s.isEqual(l.focus)}_navigateFromCellInDirection(e,t,n=!1){const o=this.editor.model,i=e.findAncestor("table"),s=[...new U(i,{includeAllSlots:!0})],{row:l,column:r}=s[s.length-1],a=s.find((({cell:t})=>t==e));let{row:c,column:d}=a;switch(t){case"left":d--;break;case"up":c--;break;case"right":d+=a.cellWidth;break;case"down":c+=a.cellHeight}if(c<0||c>l||d<0&&c<=0||d>r&&c>=l)return void o.change((e=>{e.setSelection(e.createRangeOn(i))}));d<0?(d=n?0:r,c--):d>r&&(d=n?r:0,c++);const u=s.find((e=>e.row==c&&e.column==d)).cell,h=["right","down"].includes(t),m=this.editor.plugins.get("TableSelection");if(n&&m.isEnabled){const t=m.getAnchorCell()||e;m.setCellSelection(t,u)}else{const e=o.createPositionAt(u,h?0:"end");o.change((t=>{t.setSelection(e)}))}}}var lt=n("ckeditor5/src/engine.js");class rt extends lt.DomEventObserver{constructor(){super(...arguments),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class at extends e.Plugin{static get pluginName(){return"TableMouse"}static get requires(){return[et,ve]}init(){this.editor.editing.view.addObserver(rt),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor,t=e.plugins.get(ve);let n=!1;const o=e.plugins.get(et);this.listenTo(e.editing.view.document,"mousedown",((i,s)=>{const l=e.model.document.selection;if(!this.isEnabled||!o.isEnabled)return;if(!s.domEvent.shiftKey)return;const r=o.getAnchorCell()||t.getTableCellsContainingSelection(l)[0];if(!r)return;const a=this._getModelTableCellFromDomEvent(s);a&&ct(r,a)&&(n=!0,o.setCellSelection(r,a),s.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{n=!1})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{n&&e.stop()}),{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,n,o=!1,i=!1;const s=e.plugins.get(et);this.listenTo(e.editing.view.document,"mousedown",((e,n)=>{this.isEnabled&&s.isEnabled&&(n.domEvent.shiftKey||n.domEvent.ctrlKey||n.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(n)))})),this.listenTo(e.editing.view.document,"mousemove",((e,l)=>{if(!l.domEvent.buttons)return;if(!t)return;const r=this._getModelTableCellFromDomEvent(l);r&&ct(t,r)&&(n=r,o||n==t||(o=!0)),o&&(i=!0,s.setCellSelection(t,n),l.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{o=!1,i=!1,t=null,n=null})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{i&&e.stop()}),{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,n=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(n).parent.findAncestor("tableCell",{includeSelf:!0})}}function ct(e,t){return e.parent.parent==t.parent.parent}var dt=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/table.css"),ut={insert:"head",singleton:!1};je()(dt.Z,ut);dt.Z.locals;class ht extends e.Plugin{static get requires(){return[Ue,Ye,et,at,st,tt,t.Widget]}static get pluginName(){return"Table"}}class mt extends e.Plugin{static get pluginName(){return"PlainTableOutput"}static get requires(){return[ht]}init(){const e=this.editor;e.conversion.for("dataDowncast").elementToStructure({model:"table",view:gt,converterPriority:"high"}),e.plugins.has("TableCaption")&&e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>{if("table"===e.parent.name)return t.createContainerElement("caption")},converterPriority:"high"}),e.plugins.has("TableProperties")&&function(e){const t={"border-width":"tableBorderWidth","border-color":"tableBorderColor","border-style":"tableBorderStyle","background-color":"tableBackgroundColor"};for(const[n,o]of Object.entries(t))e.conversion.for("dataDowncast").add((e=>e.on(`attribute:${o}:table`,((e,t,o)=>{const{item:i,attributeNewValue:s}=t,{mapper:l,writer:r}=o;if(!o.consumable.consume(i,e.name))return;const a=l.toViewElement(i);s?r.setStyle(n,s,a):r.removeStyle(n,a)}),{priority:"high"})))}(e)}}function gt(e,{writer:t}){const n=e.getAttribute("headingRows")||0,o=t.createSlot((e=>e.is("element","tableRow")&&e.indexe.is("element","tableRow")&&e.index>=n)),s=t.createSlot((e=>!e.is("element","tableRow"))),l=t.createContainerElement("thead",null,o),r=t.createContainerElement("tbody",null,i),a=[];return n&&a.push(l),n1)return{target:()=>function(e,t){const n=t.editing.mapper,o=t.editing.view.domConverter,i=Array.from(e).map((e=>{const t=Dt(e.start),i=n.toViewElement(t);return new w.Rect(o.mapViewToDom(i))}));return w.Rect.getBoundingRect(i)}(o.getRanges(),e),positions:Rt};const i=Dt(o.getFirstPosition()),s=t.toViewElement(i);return{target:n.mapViewToDom(s),positions:Rt}}function Dt(e){return e.nodeAfter&&e.nodeAfter.is("element","tableCell")?e.nodeAfter:e.findAncestor("tableCell")}class Ht extends e.Command{constructor(e,t,n){super(e),this.attributeName=t,this._defaultValue=n}refresh(){const e=this.editor,t=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e.model.document.selection);this.isEnabled=!!t.length,this.value=this._getSingleValue(t)}execute(e={}){const{value:t,batch:n}=e,o=this.editor.model,i=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(o.document.selection),s=this._getValueToSet(t);o.enqueueChange(n,(e=>{s?i.forEach((t=>e.setAttribute(this.attributeName,s,t))):i.forEach((t=>e.removeAttribute(this.attributeName,t)))}))}_getAttribute(e){if(!e)return;const t=e.getAttribute(this.attributeName);return t!==this._defaultValue?t:void 0}_getValueToSet(e){if(e!==this._defaultValue)return e}_getSingleValue(e){const t=this._getAttribute(e[0]);return e.every((e=>this._getAttribute(e)===t))?t:void 0}}var Pt=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css"),Ft={insert:"head",singleton:!1};je()(Pt.Z,Ft);Pt.Z.locals,e.icons.objectLeft,e.icons.objectCenter,e.icons.objectRight;function Mt(e){e.document.registerPostFixer((t=>function(e,t){const n=t.document.differ.getChanges();let o=!1;for(const t of n){if("insert"!=t.type)continue;const n=t.position.parent;if(n.is("element","table")||"table"==t.name){const i="table"==t.name?t.position.nodeAfter:n,s=Array.from(i.getChildren()).filter((e=>e.is("element","caption"))),l=s.shift();if(!l)continue;for(const t of s)e.move(e.createRangeIn(t),l,"end"),e.remove(t);l.nextSibling&&(e.move(e.createRangeOn(l),i,"end"),o=!0),o=!!s.length||o}}return o}(t,e)))}function Ot(e){return!!e&&e.is("element","table")}function qt(e){for(const t of e.getChildren())if(t.is("element","caption"))return t;return null}function Nt(e){const t=e.parent;return"figcaption"==e.name&&t&&t.is("element","figure")&&t.hasClass("table")||"caption"==e.name&&t&&t.is("element","table")?{name:!0}:null}function jt(e){const t=e.getSelectedElement();return t&&t.is("element","table")?t:e.getFirstPosition().findAncestor("table")}class zt extends e.Command{refresh(){const e=jt(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?this.value=!!qt(e):this.value=!1}execute({focusCaptionOnShow:e=!1}={}){this.editor.model.change((t=>{this.value?this._hideTableCaption(t):this._showTableCaption(t,e)}))}_showTableCaption(e,t){const n=this.editor.model,o=jt(n.document.selection),i=this.editor.plugins.get("TableCaptionEditing")._getSavedCaption(o)||e.createElement("caption");n.insertContent(i,o,"end"),t&&e.setSelection(i,"in")}_hideTableCaption(e){const t=this.editor.model,n=jt(t.document.selection),o=this.editor.plugins.get("TableCaptionEditing"),i=qt(n);o._saveCaption(n,i),t.deleteContent(e.createSelection(i,"on"))}}class Wt extends e.Plugin{static get pluginName(){return"TableCaptionEditing"}constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,n=e.model.schema,o=e.editing.view,i=e.t;n.isRegistered("caption")?n.extend("caption",{allowIn:"table"}):n.register("caption",{allowIn:"table",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleTableCaption",new zt(this.editor)),e.conversion.for("upcast").elementToElement({view:Nt,model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>Ot(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:n})=>{if(!Ot(e.parent))return null;const s=n.createEditableElement("figcaption");return n.setCustomProperty("tableCaption",!0,s),s.placeholder=i("Enter table caption"),(0,lt.enablePlaceholder)({view:o,element:s,keepOnFocus:!0}),(0,t.toWidgetEditable)(s,n)}}),Mt(e.model)}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?lt.Element.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}}class Ut extends e.Plugin{static get pluginName(){return"TableCaptionUI"}init(){const t=this.editor,n=t.editing.view,o=t.t;t.ui.componentFactory.add("toggleTableCaption",(i=>{const l=t.commands.get("toggleTableCaption"),r=new s.ButtonView(i);return r.set({icon:e.icons.caption,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(l,"value","isEnabled"),r.bind("label").to(l,"value",(e=>o(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(r,"execute",(()=>{if(t.execute("toggleTableCaption",{focusCaptionOnShow:!0}),l.value){const e=function(e){const t=jt(e);return t?qt(t):null}(t.model.document.selection),o=t.editing.mapper.toViewElement(e);if(!o)return;n.scrollToTheSelection(),n.change((e=>{e.addClass("table__caption_highlighted",o)}))}t.editing.view.focus()})),r}))}}var Gt=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css"),Kt={insert:"head",singleton:!1};je()(Gt.Z,Kt);Gt.Z.locals;class $t extends e.Plugin{static get pluginName(){return"TableCaption"}static get requires(){return[Wt,Ut]}}var Zt=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css"),Yt={insert:"head",singleton:!1};je()(Zt.Z,Yt);Zt.Z.locals;class Qt extends s.View{constructor(t,n){super(t);const o=t.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.classSelect=c(o("Cell WS properties"),this._getPropertiesOptions(o),t),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",t),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",t),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form"],tabindex:"-1"},children:[a(this.classSelect),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}_getPropertiesOptions(e){return[{value:"td",title:e("Data")},{value:"th",title:e("Header")},{value:"indent",title:e("Padded header")},{value:"normal",title:e("Normal text header")}]}render(){super.render(),(0,s.submitHandler)({view:this});[this.classSelect.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get classselect(){return this.classSelect.children[1].value}set classselect(e){this.classSelect.children[1].value=e}setValues(e){this.classselect=e?.classselect}isValid(){return!0}}const Xt={tableCellWsClass:"tableCellWsClass"};class Jt extends e.Plugin{static get requires(){return[s.ContextualBalloon]}static get pluginName(){return"TableCellWsPropertiesUI"}constructor(e){super(e),e.config.define("table.tableCellWsProperties",{borderColors:Ct,backgroundColors:Ct})}init(){const e=this.editor,t=e.t;this._balloon=e.plugins.get(s.ContextualBalloon),this.view=null,this._isReady=!1,e.ui.componentFactory.add("tableCellWsProperties",(n=>{const o=new s.ButtonView(n);o.set({label:t("Cell Ws properties"),icon:'',tooltip:!0}),this.listenTo(o,"execute",(()=>this._showView()));const i=Object.values(Xt).map((t=>e.commands.get(t)));return o.bind("isEnabled").toMany(i,"isEnabled",((...e)=>e.some((e=>e)))),o}))}_createPropertiesView(){const e=this.editor,t=(e.config.get("table.tableCellWsProperties"),new Qt(e.locale,{}));e.t;return this.listenTo(t,"submit",(()=>{this.editor.execute("tableCellWsClass",{value:t.classselect}),this._hideView()})),this.listenTo(t,"cancel",(()=>{this._undoStepBatch.operations.length&&e.execute("undo",this._undoStepBatch),this._hideView()})),t.keystrokes.set("Esc",((e,t)=>{this._hideView(),t()})),(0,s.clickOutsideHandler)({emitter:t,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()}),t}_showView(){const e=this.editor;this.view||(this.view=this._createPropertiesView()),this.listenTo(e.ui,"update",(()=>{this._updateView()}));let t=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());t&&t.parent&&(t=t.parent,this.view.classselect=t.getAttribute("cellType")),this._balloon.add({view:this.view,position:Lt(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){const e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){const e=this.editor;wt(e.editing.view.document.selection)?this._isViewVisible&&It(e,"cell"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}}class en extends Ht{constructor(e){super(e)}refresh(){let e=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=e,e&&e.parent&&(e=e.parent,this.value=Object.fromEntries(e.getAttributes()))}execute({value:e}){const{model:t}=this.editor;t.change((t=>{let n=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());n&&n.parent&&(n=n.parent,t.setAttribute("cellType",e,n))}))}}class tn extends e.Plugin{static get pluginName(){return"TableCellWsPropertiesEditing"}static get requires(){return[Ue]}init(){const e=this.editor,t=e.conversion;e.commands.add("tableCellWsClass",new en(e)),function(e){e.for("upcast").elementToElement({view:{name:/^(td|th)$/},model:(e,{writer:t})=>{const n=Array.from(e._classes);return n.includes("normal")?t.createElement("tableCell",{cellType:"normal"}):n.includes("indent")?t.createElement("tableCell",{cellType:"indent"}):t.createElement("tableCell",{cellType:e.name})},converterPriority:"high"}),e.for("downcast").elementToElement({model:{name:"tableCell",attributes:["cellType"]},view:(e,{writer:t})=>{switch(e.getAttribute("cellType")){case"th":return t.createEditableElement("th",{contenteditable:"true",class:"ck-editor__editable ck-editor__nested-editable",role:"textbox"},[]);case"td":return t.createEditableElement("td",{contenteditable:"true",class:"ck-editor__editable ck-editor__nested-editable",role:"textbox"},[]);case"indent":case"normal":return t.createEditableElement("th",{contenteditable:"true",class:"ck-editor__editable ck-editor__nested-editable "+e.getAttribute("cellType"),role:"textbox"},[])}},converterPriority:"high"})}(t)}}class nn extends e.Plugin{static get pluginName(){return"TableCellWsProperties"}static get requires(){return[tn,Jt]}}class on extends e.Command{execute({rows:e,cols:t,headers:n,tabletype:o,caption:i}){const{model:s}=this.editor,l=this.editor.plugins.get("TableUtils"),r="both"===n||"row"===n?1:0,a="both"===n||"column"===n?1:0;s.change((n=>{const c=l.createTable(n,{rows:e,columns:t,headingRows:r,headingColumns:a});s.insertObject(c,null,null,{findOptimalPosition:"auto"}),n.setSelection(n.createPositionAt(c.getNodeByPath([0]),0));const d=n.createRange(n.createPositionBefore(c),n.createPositionAfter(c)),u=n.createElement("websparkTable",{type:o});if(n.wrap(d,u),n.append(c,u),s.insertContent(u),i?.length){const e=n.createElement("caption");n.insertText(i,e,"end");const t=function(e){const t=e.getSelectedElement();if(t&&t.is("element","table"))return t;return e.getFirstPosition().findAncestor("table")}(s.document.selection);s.insertContent(e,t,"end")}}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkTable");this.isEnabled=null!==n}}class sn extends e.Plugin{static get requires(){return[ht,ve,ft,mt,$t,et,tt,at,st,t.Widget,nn]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkTable",new on(this.editor))}_defineSchema(){this.editor.model.schema.register("websparkTable",{isObject:!0,allowWhere:"$block",allowChildren:["table"],allowAttributes:["type"]})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:"div",classes:["uds-table"],attribute:{type:!0}},model:(e,{writer:t})=>{const n=e.getAttribute("class").includes("-fixed")?"fixed":"default";return t.createElement("websparkTable",{type:n})}}),e.for("dataDowncast").elementToElement({model:"websparkTable",view:(e,{writer:t})=>{let n="uds-table";return"fixed"===e.getAttribute("type")&&(n+=" uds-table-fixed"),t.createContainerElement("div",{class:n})}}),e.for("editingDowncast").elementToElement({model:"websparkTable",view:(e,{writer:n})=>{const o=n.createContainerElement("div");return(0,t.toWidget)(o,n,{label:"Webspark Table"})}})}}class ln extends s.View{DEFAULT_ROWS="3";DEFAULT_COLS="2";DEFAULT_HEADER="none";DEFAULT_TYPE="default";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputRowsView=d(o("Rows"),n),this.textInputColsView=d(o("Columns"),n),this.headersSelect=c(o("Headers"),this._getHeaderOptions(o),n),this.tabletypeSelect=c(o("Table Type"),this._getTableTypeOptions(o),n),this.textCaption=d(o("Caption"),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form"],tabindex:"-1"},children:[a(this.textInputRowsView),a(this.textInputColsView),a(this.headersSelect),a(this.tabletypeSelect),a(this.textCaption),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputRowsView.children[1],this.textInputColsView.children[1],this.headersSelect.children[1],this.tabletypeSelect.children[1],this.textCaption.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get rows(){return this.textInputRowsView.children[1].element.value.trim()}set rows(e){this.textInputRowsView.children[1].element.value=e.trim()}get cols(){return this.textInputColsView.children[1].element.value.trim()}set cols(e){this.textInputColsView.children[1].element.value=e.trim()}get headers(){return this.headersSelect.children[1].value}set headers(e){this.headersSelect.children[1].value=e}get tabletype(){return this.tabletypeSelect.children[1].value}set tabletype(e){this.tabletypeSelect.children[1].value=e}set caption(e){this.textCaption.children[1].element.value=e.trim()}get caption(){return this.textCaption.children[1].element.value.trim()}setValues(e){this.rows=e?.rows||this.DEFAULT_ROWS,this.cols=e?.cols||this.DEFAULT_COLS,this.headers=e?.headers||this.DEFAULT_HEADER,this.tabletype=e?.tabletype||this.DEFAULT_TYPE,this.caption=e?.caption||""}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return t.includes("text")?this.textInputRowsView.errorText=t:t.includes("URL")&&(this.textInputColsView.errorText=t),!1}return!0}resetFormStatus(){this.textInputRowsView.errorText=null,this.textInputColsView.errorText=null}_getHeaderOptions(e){return[{value:"none",title:e("None")},{value:"row",title:e("First row")},{value:"column",title:e("First column")},{value:"both",title:e("Both")}]}_getTableTypeOptions(e){return[{value:"default",title:e("Default")},{value:"fixed",title:e("Fixed")}]}}class rn extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkTable");var n;this.form=new ln((n=e.t,[e=>e.rows.length?e.cols.length?void 0:n("The cols field must not be empty."):n("The rows field must not be empty.")]),e.locale,t),e.ui.componentFactory.add("websparkTable",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;this.editor.commands.get("insertTable");function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Webspark table"),icon:'\n\n\n\n\n\n\n\n',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputRowsView.children[1].select(),t.focus()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkTable",{rows:t.rows,cols:t.cols,headers:t.headers,tabletype:t.tabletype,caption:t.caption}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class an extends e.Plugin{static get requires(){return[sn,rn]}}class cn extends e.Command{execute({spacingtop:e,spacingbottom:t,spacingleft:n,spacingright:o,roundedimage:i}){const{model:s}=this.editor;s.change((l=>{const r=s.document.selection.getSelectedElement();r&&(l.setAttribute("spacingTop",e,r),l.setAttribute("spacingBottom",t,r),l.setAttribute("spacingRight",o,r),l.setAttribute("spacingLeft",n,r),l.setAttribute("roundedImage",i,r))}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=["imageInline","imageBlock"].some((n=>e.schema.findAllowedParent(t.getFirstPosition(),n)));this.isEnabled=null!==n;const o=t.getSelectedElement();"imageBlock"===o?.name||"imageInline"===o?.name?(this.value=Object.fromEntries(o.getAttributes()),e.change((e=>{e.setAttribute("imageFluid",!0,o)}))):this.value=null}}class dn extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkAdvancedImage",new cn(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["spacingTop","spacingBottom","spacingLeft","spacingRight","roundedImage","imageFluid"]}),e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["spacingTop","spacingBottom","spacingLeft","spacingRight","roundedImage","imageFluid"]})}_defineConverters(){const{conversion:e}=this.editor;[{htmlName:"spacing-top",modelName:"spacingTop"},{htmlName:"spacing-bottom",modelName:"spacingBottom"},{htmlName:"spacing-right",modelName:"spacingRight"},{htmlName:"spacing-left",modelName:"spacingLeft"},{htmlName:"rounded-circle",modelName:"roundedImage"}].forEach((t=>{e.for("upcast").attributeToAttribute({view:{key:"class",value:new RegExp(t.htmlName+"+")},model:{key:t.modelName,value:e=>{let n=Array.from(e._classes).filter((e=>e.includes(t.htmlName)));return 0===n.length?"none":n[0]}}}),e.for("downcast").attributeToAttribute({model:{name:"imageBlock",key:t.modelName},view:e=>{if("none"!==e)return{key:"class",value:e}}}),e.for("downcast").attributeToAttribute({model:{name:"imageInline",key:t.modelName},view:e=>({key:"class",value:e})})})),e.for("downcast").attributeToAttribute({model:{name:"imageBlock",key:"imageFluid"},view:e=>({key:"class",value:"img-fluid"})}),e.for("downcast").attributeToAttribute({model:{name:"imageInline",key:"imageFluid"},view:e=>({key:"class",value:"img-fluid"})}),e.for("upcast").attributeToAttribute({view:{key:"class",value:"img-fluid"},model:{key:"imageFluid",value:e=>!0}})}}class un extends s.View{constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.spacingTopSelect=c(o("Spacing top"),this._getSpacingOptions(o,"top"),n),this.spacingBottomSelect=c(o("Spacing bottom"),this._getSpacingOptions(o,"bottom"),n),this.spacingLeftSelect=c(o("Spacing left"),this._getSpacingOptions(o,"left"),n),this.spacingRightSelect=c(o("Spacing right"),this._getSpacingOptions(o,"right"),n),this.roundedImage=c(o("Round image"),[{value:"none",title:o("No")},{value:"rounded-circle",title:o("Yes")}],n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form"],tabindex:"-1"},children:[a(this.spacingTopSelect),a(this.spacingBottomSelect),a(this.spacingLeftSelect),a(this.spacingRightSelect),a(this.roundedImage),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}_getSpacingOptions(e,t){return[{value:"none",title:e("None")},{value:`spacing-${t}-8`,title:e("8px")},{value:`spacing-${t}-16`,title:e("16px")},{value:`spacing-${t}-24`,title:e("24px")}]}render(){super.render(),(0,s.submitHandler)({view:this});[this.spacingTopSelect.children[1],this.spacingBottomSelect.children[1],this.spacingLeftSelect.children[1],this.spacingRightSelect.children[1],this.roundedImage.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get spacingtop(){return this.spacingTopSelect.children[1].value}set spacingtop(e){this.spacingTopSelect.children[1].value=e}get spacingbottom(){return this.spacingBottomSelect.children[1].value}set spacingbottom(e){this.spacingBottomSelect.children[1].value=e}get spacingright(){return this.spacingRightSelect.children[1].value}set spacingright(e){this.spacingRightSelect.children[1].value=e}get spacingleft(){return this.spacingLeftSelect.children[1].value}set spacingleft(e){this.spacingLeftSelect.children[1].value=e}get roundedimage(){return this.roundedImage.children[1].value}set roundedimage(e){this.roundedImage.children[1].value=e}setValues(e){this.spacingtop=e?.spacingTop,this.spacingbottom=e?.spacingBottom,this.spacingleft=e?.spacingLeft,this.spacingright=e?.spacingRight,this.roundedimage=e?.roundedImage}isValid(){return!0}}class hn extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkAdvancedImage");this.form=new un((e.t,[]),e.locale,t),e.ui.componentFactory.add("websparkAdvancedImage",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Image styles"),tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.focus()}),{priority:"low"}),e.on("submit",(()=>{o.execute("insertWebsparkAdvancedImage",{spacingtop:t.spacingtop,spacingbottom:t.spacingbottom,spacingright:t.spacingright,spacingleft:t.spacingleft,roundedimage:t.roundedimage}),l()})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class mn extends e.Plugin{static get requires(){return[dn,hn]}}class gn extends e.Command{refresh(){const e=this.editor.model.document.selection,t=this._getClosestSelectedDrupalMediaElement(e);this.isEnabled=!!t&&t.getAttribute("drupalMediaEntityType")&&"media"===t.getAttribute("drupalMediaEntityType")&&"METADATA_ERROR"!==t.getAttribute("drupalMediaEntityType")&&"remote_video"===t.getAttribute("drupalMediaType"),this.isEnabled&&this.editor.execute("addInlineStyle","w100")}execute(e){const{model:t}=this.editor,n=this._getClosestSelectedDrupalMediaElement(t.document.selection);t.change((t=>{t.setAttribute("dataInlineStyle",e,n)}))}_getClosestSelectedDrupalMediaElement(e){const t=e.getSelectedElement();return this._isDrupalMedia(t)?t:e.getFirstPosition().findAncestor("drupalMedia")}_isDrupalMedia(e){return!!e&&e.is("element","drupalMedia")}}class pn extends e.Plugin{static get pluginName(){return"WebsparkMediaAlterEditing"}constructor(e){super(e),this.attrs={dataInlineStyle:"data-inline-style"},this.converterAttributes=["dataInlineStyle"]}init(){const e=this.editor.model.schema,t=this.editor.conversion;e.isRegistered("drupalMedia")&&e.extend("drupalMedia",{allowAttributes:["dataInlineStyle"]}),Object.keys(this.attrs).forEach((e=>{const n={model:{key:e,name:"drupalMedia"},view:{key:"style",value:{width:"100%","max-width":"100%"}}};t.for("upcast").attributeToAttribute(n),t.for("downcast").attributeToAttribute(n)})),this.editor.commands.add("addInlineStyle",new gn(this.editor))}}class wn extends e.Plugin{static get requires(){return[pn]}}function bn(e,t,n){const o=e?e.getAttribute("listType"):"";if("forward"===n)for(;e&&e.getAttribute("listType")===o;)t.includes(e)||t.push(e),e=e.nextSibling;else for(;e&&e.getAttribute("listType")===o;)t.includes(e)||t.push(e),e=e.previousSibling}function fn(e){let t=(0,w.first)(e.document.selection.getSelectedBlocks());const n=[];e.change((e=>{bn(t,n,"backward"),bn(t,n,"forward"),n.forEach((t=>{"bulleted"===t.getAttribute("listType")?e.setAttribute("htmlUlAttributes",{classes:"uds-list"},t):"numbered"===t.getAttribute("listType")&&e.setAttribute("htmlOlAttributes",{classes:"uds-list"},t)}))}))}function kn(e,t){const n=t.commands.get("bulletedListOld").value?vn(t.t):t.commands.get("numberedListOld").value?[{value:"default-list",title:(o=t.t)("Default")},{value:"maroon",title:o("Maroon")},{value:"light-smokemode",title:o("Gray 1")},{value:"smokemode",title:o("Gray 2")},{value:"darkmode",title:o("Gray 7")},{value:"darkmode-gold",title:o("Gray 7 Gold")},{value:"stp-default",title:o("Step List Default")},{value:"stp-gold-counter",title:o("Step List Gold Counter")},{value:"stp-maroon-counter",title:o("Step List Maroon Counter")},{value:"stp-smokemode",title:o("Step List Gray 2")},{value:"stp-smokemode-gold",title:o("Step List Gray 2 Gold Counter")},{value:"stp-smokemode-maroon",title:o("Step List Gray 2 Maroon Counter")},{value:"stp-lightsmokemode",title:o("Step List Gray 1")},{value:"stp-lightsmokemode-gold",title:o("Step List Gray 1 Gold Counter")},{value:"stp-lightsmokemode-maroon",title:o("Step List Gray 1 Maroon Counter")},{value:"stp-darkmode",title:o("Step List Gray 7")},{value:"stp-darkmode-gold",title:o("Step List Gray 7 Gold Counter")}]:"";var o;if(!n)return;let i=(0,w.first)(t.model.document.selection.getSelectedBlocks());const s=[];let l=[],r="";bn(i,s,"backward"),bn(i,s,"forward"),s.forEach((e=>{if(0==e.getAttribute("listIndent"))try{"bulleted"===e.getAttribute("listType")?(l=e.getAttribute("htmlUlAttributes").classes,r=e.getAttribute("listType")):"numbered"===e.getAttribute("listType")&&(l=e.getAttribute("htmlOlAttributes").classes,r=e.getAttribute("listType"))}catch(e){}})),Array.isArray(l)||(l=l.split(" ")),e.classSelect.children[1].element.options.length=0,n.forEach((t=>{const n=document.createElement("option");n.value=t.value,n.text=t.title;let o=[];o="bulleted"===r?Cn(t.value).split(" "):Tn(t.value).split(" "),function(e,t){if(e.length!==t.length)return!1;const n=new Set(e),o=new Set(t);for(const e of n)if(!o.has(e))return!1;return!0}(o,l)&&(n.defaultSelected=!0),e.classSelect.children[1].element.appendChild(n)}))}function vn(e){return[{value:"default-list",title:e("Default")},{value:"maroon",title:e("Maroon")},{value:"light-smokemode",title:e("Gray 1")},{value:"smokemode",title:e("Gray 2")},{value:"darkmode",title:e("Gray 7")},{value:"darkmode-gold",title:e("Gray 7 Gold Bullet")},{value:"icn-default",title:e("Icon list")},{value:"icn-maroon",title:e("Icon list Maroon")},{value:"icn-darkmode",title:e("Icon list Gray 7")},{value:"icn-darkmode-gold",title:e("Icon list Gray 7 Gold")}]}function Cn(e){let t=e,n=_n(e);if(n=`wp-${e}`,t=t||"default-list",t.startsWith("icn"))switch(n+=" uds-list fa-ul fa-li",t){case"icn-maroon":n=yn(n,["darkmode","gold"]),n+=" maroon";break;case"icn-darkmode":n=yn(n,["gold","maroon"]),n+=" darkmode";break;case"icn-darkmode-gold":n=yn(n,["maroon"]),n+=" darkmode gold"}else{if(n=yn(n,["fa-ul"]),t){const e=["default-list","maroon","light-smokemode","smokemode","darkmode"];for(const o of e)n.includes(o)&&t!==o&&(n=n.replace(o,""));n.includes("darkmode")&&n.includes("gold")&&"darkmode-gold"!=t&&(n=yn(n,["darkmode","gold"])),n+="darkmode-gold"===t?" darkmode gold":" "+t}n.includes("uds-list")||(n+=" uds-list")}return n}function Tn(e){let t=e;t=t||"default-list";let n=_n(e);if(n=`wp-${e}`,t.startsWith("stp"))n+=" uds-list uds-steplist","stp-default"===t&&(n=yn(n,["uds-steplist-gold","uds-steplist-maroon","smokemode","light-smokemode","darkmode","maroon"])),"stp-gold-counter"===t&&(n=yn(n,["uds-steplist-maroon","smokemode","light-smokemode","darkmode"]),n+=" uds-steplist-gold"),"stp-maroon-counter"===t&&(n=yn(n,["uds-steplist-gold","smokemode","light-smokemode","darkmode"]),n+=" uds-steplist-maroon"),"stp-smokemode"===t&&(n=yn(n,["uds-steplist-gold","uds-steplist-maroon","light-smokemode","darkmode"]),n+=" smokemode"),"stp-smokemode-gold"===t&&(n=yn(n,["uds-steplist-maroon","light-smokemode","darkmode"]),n+=" smokemode uds-steplist-gold"),"stp-smokemode-maroon"===t&&(n=yn(n,["uds-steplist-maroon","light-smokemode","darkmode"]),n+=" smokemode uds-steplist-maroon"),"stp-lightsmokemode"===t&&(n=yn(n,["uds-steplist-gold","uds-steplist-maroon","smokemode","darkmode"]),n+=" light-smokemode"),"stp-lightsmokemode-gold"===t&&(n=yn(n,["uds-steplist-maroon","smokemode","darkmode"]),n+=" light-smokemode uds-steplist-gold"),"stp-lightsmokemode-maroon"===t&&(n=yn(n,["uds-steplist-gold","smokemode","darkmode"]),n+=" light-smokemode uds-steplist-maroon"),"stp-darkmode"===t&&(n=yn(n,["uds-steplist-gold","uds-steplist-maroon","light-smokemode","darkmode"]),n+=" darkmode"),"stp-darkmode-gold"===t&&(n=yn(n,["uds-steplist-maroon","smokemode","light-smokemode"]),n+=" darkmode uds-steplist-gold");else{if(n=yn(n,["uds-steplist","uds-steplist-maroon","uds-steplist-gold"]),t){const e=["default-list","maroon","light-smokemode","smokemode","darkmode"];for(const o of e)n.includes(o)&&t!==o&&(n=n.replace(o,""));n.includes("darkmode")&&n.includes("gold")&&"darkmode-gold"!=t&&(n=yn(n,["darkmode","gold"])),n+="darkmode-gold"===t?" darkmode gold":" "+t}n.includes("uds-list")||(n+=" uds-list")}return n}function yn(e,t){let n=e;for(const o of t){const t=new RegExp(o,"g");n=e.replace(t,"")}return n}function _n(e){return e?e.replace(/\bwp-\w+\b/g,""):""}class xn extends e.Command{execute({styleClass:e}){const t=this.editor.model;t.document.selection,t.document;let n=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());const o=[],i=this.editor.commands.get("bulletedListOld").value?Cn(e):this.editor.commands.get("numberedListOld").value?Tn(e):"";t.change((e=>{bn(n,o,"backward"),bn(n,o,"forward"),o.forEach((t=>{0==t.getAttribute("listIndent")&&("bulleted"===t.getAttribute("listType")?e.setAttribute("htmlUlAttributes",{classes:i},t):"numbered"===t.getAttribute("listType")&&e.setAttribute("htmlOlAttributes",{classes:i},t))}))}))}refresh(){this.isEnabled=this._checkEnabled();let e=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());const t=[];bn(e,t,"backward"),bn(e,t,"forward"),t.forEach((e=>{this.value=Object.fromEntries(e.getAttributes());const t=e._children._nodes;t.forEach(((e,n)=>{if(0===n&&e._attrs.delete("htmlSpan"),"softBreak"===e.name){const e=t[n+1];e&&(e._attrs||(e._attrs=new Map),e._attrs instanceof Map||(e._attrs=new Map(Object.entries(e._attrs))),e._attrs.set("htmlSpan",{}))}}))}));try{0==this.editor.model.document.selection.anchor.index&&this.editor.model.document.selection._selection._attrs.delete("htmlSpan")}catch(e){}}_checkEnabled(){const e=this.editor,t=e.commands.get("numberedListOld"),n=e.commands.get("bulletedListOld");return t.isEnabled||n.isEnabled}}class En extends e.Plugin{static get requires(){return[t.Widget,s.ContextualBalloon]}static get pluginName(){return"WebsparkListStyleEditing"}constructor(e){super(e)}init(){const e=this.editor,{model:t}=this.editor;e.commands.add("insertliststyle",new xn(e)),e.commands.add("bulletedListOld",e.commands.get("bulletedList"));const n={execute:function(n){e.execute("bulletedListOld",n),fn(t)}};e.commands.add("bulletedList",n),e.commands.get("bulletedList").isEnabled=!0,e.commands.add("numberedListOld",e.commands.get("numberedList"));const o={execute:function(n){e.execute("numberedListOld",n),fn(t)}};e.commands.add("numberedList",o),e.commands.get("numberedList").isEnabled=!0}}class An extends s.View{constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.classSelect=c(o("List properties"),vn(o),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-liststyle-dialog"],tabindex:"-1"},children:[a(this.classSelect),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.classSelect.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get classselect(){return this.classSelect.children[1].value}set classselect(e){this.classSelect.children[1].value=e}setValues(e){this.classselect=e?.classselect}isValid(){return!0}}class Sn extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertliststyle");this.form=new An((this.editor.t,[]),this.editor.locale,t);const n=this.editor.editing.view.document;this.listenTo(n,"click",(()=>{kn(this.form,this.editor)})),this.listenTo(n,"change",(()=>{kn(this.form,this.editor)})),e.ui.componentFactory.add("websparkListStyle",(()=>{const n=(0,s.createDropdown)(e.locale);this._setUpDropdown(n,this.form),this._setUpForm(this.form,n,t);const o=this.editor.commands.get("bulletedListOld"),i=this.editor.commands.get("numberedListOld");return n.bind("isEnabled").toMany([o,i],"value",(e=>o.value||i.value)),n}))}_findUlParent(e){return e&&e.parent?"ul"===e.name?e:this._findUlParent(e.parent):null}_setUpDropdown(e,t){const n=this.editor,o=n.t,i=e.buttonView;function s(){n.editing.view.focus(),e.isOpen=!1}e.panelView.children.add(t),i.set({label:o("List Properties"),icon:'\x3c!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --\x3e\n',tooltip:!0}),i.on("open",(()=>{try{t.classselect&&t.classselect.children[1].select()}catch(e){}t.focus()}),{priority:"low"}),e.on("submit",(()=>{n.execute("insertliststyle",{styleClass:t.classselect}),s()})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>s()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class Vn extends e.Plugin{static get requires(){return[En,Sn]}}class Bn extends e.Command{constructor(e){super(e),this.value=void 0}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute("highlight"),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"highlight")}execute(e={}){const t=this.editor.model,n=t.document.selection,o=e.value;t.change((e=>{if(n.isCollapsed){const t=n.getFirstPosition();if(n.hasAttribute("highlight")){const n=e=>e.item.hasAttribute("highlight")&&e.item.getAttribute("highlight")===this.value,i=t.getLastMatchingPosition(n,{direction:"backward"}),s=t.getLastMatchingPosition(n),l=e.createRange(i,s);o&&this.value!==o?(t.isEqual(s)||e.setAttribute("highlight",o,l),e.setSelectionAttribute("highlight",o)):(t.isEqual(s)||e.removeAttribute("highlight",l),e.removeSelectionAttribute("highlight"))}else o&&e.setSelectionAttribute("highlight",o)}else{const i=t.schema.getValidRanges(n.getRanges(),"highlight");for(const t of i)o?e.setAttribute("highlight",o,t):e.removeAttribute("highlight",t)}}))}}class Rn extends e.Plugin{static get pluginName(){return"WebsparkAnimatedTextEditing"}constructor(e){super(e),e.config.define("highlight",{options:[{model:"yellowPen",class:"pen-yellow",title:"Yellow animated",color:"var(--ck-highlight-marker-yellow)",type:"pen"}]})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"highlight"}),e.model.schema.addAttributeCheck(((e,t)=>{if("highlight"===t)return!!e.endsWith("websparkBlockquoteAnimatedParagraph $text")}));const t=e.config.get("highlight.options");e.conversion.attributeToElement(function(e){const t={model:{key:"highlight",values:[]},view:{}};for(const n of e)t.model.values.push(n.model),t.view[n.model]={name:"mark",classes:n.class};return t}(t)),e.commands.add("highlight",new Bn(e))}}var In=n("./node_modules/css-loader/dist/cjs.js!./js/ckeditor5_plugins/websparkPlugin/src/animatedtext/css/animatedtext.css"),Ln={insert:"head",singleton:!1};je()(In.Z,Ln);In.Z.locals;class Dn extends e.Plugin{get localizedOptionTitles(){return{"Yellow pen":(0,this.editor.t)("Yellow pen")}}static get pluginName(){return"HighlightUI"}init(){const e=this.editor.config.get("highlight.options");for(const t of e)this._addHighlighterButton(t);this._addRemoveHighlightButton(),this._addDropdown(e),this._addMenuBarButton(e)}_addRemoveHighlightButton(){const t=this.editor.t,n=this.editor.commands.get("highlight");this._addButton("removeHighlight",t("Remove highlight"),e.icons.eraser,null,(e=>{e.bind("isEnabled").to(n,"isEnabled")}))}_addHighlighterButton(e){const t=this.editor.commands.get("highlight");this._addButton("highlight:"+e.model,e.title,Hn(e.type),e.model,(function(n){n.bind("isEnabled").to(t,"isEnabled"),n.bind("isOn").to(t,"value",(t=>t===e.model)),n.iconView.fillColor=e.color,n.isToggleable=!0}))}_addButton(e,t,n,o,i){const l=this.editor;l.ui.componentFactory.add(e,(e=>{const r=new s.ButtonView(e),a=this.localizedOptionTitles[t]?this.localizedOptionTitles[t]:t;return r.set({label:a,icon:n,tooltip:!0}),r.on("execute",(()=>{l.execute("highlight",{value:o}),l.editing.view.focus()})),i(r),r}))}_addDropdown(e){const t=this.editor,n=t.t,o=t.ui.componentFactory,i=e[0],l=e.reduce(((e,t)=>(e[t.model]=t,e)),{});o.add("websparkAnimatedText",(r=>{const a=t.commands.get("highlight"),c=(0,s.createDropdown)(r,s.SplitButtonView),d=c.buttonView;d.set({label:n("Highlight"),tooltip:!0,lastExecuted:i.model,commandValue:i.model,isToggleable:!0}),d.bind("icon").to(a,"value",(e=>Hn(u(e,"type")))),d.bind("color").to(a,"value",(e=>u(e,"color"))),d.bind("commandValue").to(a,"value",(e=>u(e,"model"))),d.bind("isOn").to(a,"value",(e=>!!e)),d.delegate("execute").to(c);function u(e,t){const n=e&&e!==d.lastExecuted?e:d.lastExecuted;return l[n][t]}return c.bind("isEnabled").to(a,"isEnabled"),(0,s.addToolbarToDropdown)(c,(()=>{const t=e.map((e=>{const t=o.create("highlight:"+e.model);return this.listenTo(t,"execute",(()=>{c.buttonView.set({lastExecuted:e.model})})),t}));return t.push(new s.ToolbarSeparatorView),t.push(o.create("removeHighlight")),t}),{enableActiveItemFocusOnDropdownOpen:!0,ariaLabel:n("Text highlight toolbar")}),function(e){const t=e.buttonView.actionView;t.iconView.bind("fillColor").to(e.buttonView,"color")}(c),d.on("execute",(()=>{t.execute("highlight",{value:d.commandValue})})),this.listenTo(c,"execute",(()=>{t.editing.view.focus()})),c}))}_addMenuBarButton(t){const n=this.editor,o=n.t,i=n.commands.get("highlight");n.ui.componentFactory.add("menuBar:highlight",(l=>{const r=new s.MenuBarMenuView(l);r.buttonView.set({label:o("Highlight"),icon:Hn("marker")}),r.bind("isEnabled").to(i),r.buttonView.iconView.fillColor="transparent";const a=new s.MenuBarMenuListView(l);for(const e of t){const t=new s.MenuBarMenuListItemView(l,r),o=new s.MenuBarMenuListItemButtonView(l);o.set({label:e.title,icon:Hn(e.type),role:"menuitemradio",isToggleable:!0}),o.iconView.fillColor=e.color,o.delegate("execute").to(r),o.bind("isOn").to(i,"value",(t=>t===e.model)),o.on("execute",(()=>{n.execute("highlight",{value:e.model}),n.editing.view.focus()})),t.children.add(o),a.items.add(t)}a.items.add(new s.ListSeparatorView(l));const c=new s.MenuBarMenuListItemView(l,r),d=new s.MenuBarMenuListItemButtonView(l);return d.set({label:o("Remove highlight"),icon:e.icons.eraser}),d.delegate("execute").to(r),d.on("execute",(()=>{n.execute("highlight",{value:null}),n.editing.view.focus()})),c.children.add(d),a.items.add(c),r.panelView.children.add(a),r}))}}function Hn(e){return"marker"===e?'':''}class Pn extends e.Plugin{static get requires(){return[Rn,Dn]}}class Fn extends e.Command{execute({text:e,citationName:t,citationDescription:n,title:o}){const{model:i}=this.editor;i.change((s=>{const l=s.createElement("websparkBlockquoteAnimated"),r=s.createElement("websparkBlockquoteAnimatedContainer"),a=s.createElement("websparkBlockquoteAnimatedTitle"),c=s.createElement("websparkBlockquoteAnimatedParagraph"),d=s.createElement("websparkBlockquoteAnimatedCitation"),u=s.createElement("websparkBlockquoteAnimatedCitationName"),h=s.createElement("websparkBlockquoteAnimatedCitationDescription"),m=s.createText(o);s.append(m,a);const g=s.createText(e);if(s.append(g,c),t.length>0){const e=s.createText(t);s.append(e,u),s.append(u,d)}if(n.length>0){const e=s.createText(n);s.append(e,h),s.append(h,d)}o.length>0&&s.append(a,r),s.append(c,r),s.append(d,r),s.append(r,l),i.insertContent(l)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkBlockquoteAnimated");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkBlockquoteAnimated"===o?.name){const t=o?.getChild(0)?.getChild(0)?._data;e.change((e=>{e.setAttribute("text",t,o)})),this.value=Object.fromEntries(o.getAttributes())}else this.value=null}}class Mn extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkBlockquoteAnimated",new Fn(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkBlockquoteAnimated",{isObject:!0,allowWhere:"$block"}),e.register("websparkBlockquoteAnimatedSvg",{isObject:!0,allowIn:"websparkBlockquoteAnimated",allowContentOf:"$block",allowAttributes:["role","title","viewBox","xmlns"]}),e.register("websparkBlockquoteAnimatedContainer",{isLimit:!0,allowIn:"websparkBlockquoteAnimated",allowContentOf:"$block"}),e.register("websparkBlockquoteAnimatedTitle",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedContainer",allowContentOf:"$block"}),e.register("websparkBlockquoteAnimatedParagraph",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedContainer",allowContentOf:"$block"}),e.register("websparkBlockquoteAnimatedCitation",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedContainer",allowContentOf:"$text"}),e.register("websparkBlockquoteAnimatedCitationName",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedCitation",allowContentOf:"$block"}),e.register("websparkBlockquoteAnimatedCitationDescription",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedCitation",allowContentOf:"$block"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedCitationName",view:{name:"cite",classes:"name"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedCitationName",view:{name:"cite",classes:"name"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedCitationName",view:(e,{writer:n})=>{const o=n.createEditableElement("cite",{class:"name"});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedCitationDescription",view:{name:"cite",classes:"description"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedCitationDescription",view:{name:"cite",classes:"description"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedCitationDescription",view:(e,{writer:n})=>{const o=n.createEditableElement("cite",{class:"description"});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedCitation",view:{name:"div",classes:"citation"}}),e.for("dataDowncast").elementToStructure({model:"websparkBlockquoteAnimatedCitation",view:(e,t)=>{const{writer:n}=t,o=n.createContainerElement("div",{class:"citation-content"},[n.createSlot()]);return n.createContainerElement("div",{class:"citation"},[o])}}),e.for("editingDowncast").elementToStructure({model:"websparkBlockquoteAnimatedCitation",view:(e,t)=>{const{writer:n}=t,o=n.createContainerElement("div",{class:"citation-content"},[n.createSlot()]);return n.createContainerElement("div",{class:"citation"},[o])}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedParagraph",view:{name:"h2"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedParagraph",view:{name:"h2"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedParagraph",view:(e,{writer:n})=>{const o=n.createEditableElement("h2",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedTitle",view:{name:"h4"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedTitle",view:{name:"h4"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedTitle",view:(e,{writer:n})=>{const o=n.createEditableElement("h4",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedContainer",view:{name:"blockquote"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedContainer",view:{name:"blockquote"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedContainer",view:(e,{writer:n})=>{const o=n.createEditableElement("blockquote",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({view:{name:"div",classes:["uds-blockquoteAnimated","accent-maroon"]},model:(e,{writer:t})=>t.createElement("websparkBlockquoteAnimated",{})}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimated",view:(e,{writer:t})=>t.createContainerElement("div",{class:"uds-blockquoteAnimated accent-maroon"})}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimated",view:(e,{writer:n})=>{const o=n.createContainerElement("div",{class:"uds-blockquoteAnimated accent-maroon"});return(0,t.toWidget)(o,n,{label:"BlockQuote Animated"})}})}}class On extends s.View{DEFAULT_TITLE="";DEFAULT_TEXT="";DEFAULT_STYLE="";DEFAULT_HEADING="";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.titleView=d(o("Title"),n),this.textInputView=m(o("Content"),n),this.citationNameView=d(o("Citation Name"),n),this.citationDescriptionView=d(o("Citation Description"),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-blockquote-dialog"],tabindex:"-1"},children:[a(this.titleView),a(this.textInputView),a(this.citationNameView),a(this.citationDescriptionView),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.titleView.children[1],this.textInputView.children[1],this.citationNameView.children[1],this.citationDescriptionView.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get title(){return this.titleView.children[1].element.value.trim()}set title(e){this.titleView.children[1].element.value=e.trim()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}get citationName(){return this.citationNameView.children[1].element.value.trim()}set citationName(e){this.citationNameView.children[1].element.value=e.trim()}get citationDescription(){return this.citationDescriptionView.children[1].element.value.trim()}set citationDescription(e){this.citationDescriptionView.children[1].element.value=e.trim()}setValues(e){this.title=e?.title||this.DEFAULT_TITLE,this.text=e?.text||this.DEFAULT_TEXT,this.citationName=e?.citationName||this.DEFAULT_STYLE,this.citationDescription=e?.citationDescription||this.DEFAULT_HEADING}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return t.includes("text")&&(this.textInputView.errorText=t),!1}return!0}resetFormStatus(){this.textInputView.errorText=null}}class qn extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkBlockquoteAnimated");this.form=new On((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkBlockquoteAnimated",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Blockquote Animated"),icon:'\x3c!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --\x3e\n\n\n\n',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.titleView.children[1].element.select()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkBlockquoteAnimated",{text:t.text,citationName:t.citationName,citationDescription:t.citationDescription,title:t.title}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class Nn extends e.Plugin{static get requires(){return[Mn,qn]}}const jn={WebsparkButton:k,WebsparkDivider:y,WebsparkLead:S,WebsparkHighlightedHeading:L,WebsparkBlockquote:M,WebsparkTable:an,WebsparkAdvancedImage:mn,WebsparkMediaAlter:wn,WebsparkListStyle:Vn,WebsparkAnimatedText:Pn,WebsparkBlockquoteAnimated:Nn}})(),o=o.default})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.CKEditor5=t():(e.CKEditor5=e.CKEditor5||{},e.CKEditor5.websparkPlugin=t())}(self,(()=>(()=>{var e={"./node_modules/css-loader/dist/cjs.js!./js/ckeditor5_plugins/websparkPlugin/src/animatedtext/css/animatedtext.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id," :root {\n --ck-highlight-marker-yellow: #ffc627;\n}\n\n.ck-content .pen-yellow {\n background-color: var(--ck-highlight-marker-yellow);\n}\n\n\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-input-color {\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\n\t& > input.ck.ck-input-text {\n\t\tmin-width: auto;\n\t\tflex-grow: 1;\n\t}\n\n\t& > div.ck.ck-dropdown {\n\t\tmin-width: auto;\n\n\t\t/* This dropdown has no arrow but a color preview instead. */\n\t\t& > .ck-input-color__button .ck-dropdown__arrow {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t& .ck.ck-input-color__button {\n\t\t/* Resolving issue with misaligned buttons on Safari (see #10589) */\n\t\tdisplay: flex;\n\n\t\t& .ck.ck-input-color__button__preview {\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\n\t\t\t& > .ck.ck-input-color__button__preview__no-color-indicator {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: block;\n\t\t\t}\n\t\t}\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/form.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/*\n * Note: This file should contain the wireframe styles only. But since there are no such styles,\n * it acts as a message to the builder telling that it should look for the corresponding styles\n * **in the theme** when compiling the editor.\n */\n\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/formrow.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-form__row {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: nowrap;\n\tjustify-content: space-between;\n\n\t/* Ignore labels that work as fieldset legends */\n\t& > *:not(.ck-label) {\n\t\tflex-grow: 1;\n\t}\n\n\t&.ck-table-form__action-row {\n\t\t& .ck-button-save,\n\t\t& .ck-button-cancel {\n\t\t\tjustify-content: center;\n\t\t}\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck .ck-insert-table-dropdown__grid {\n\tdisplay: flex;\n\tflex-direction: row;\n\tflex-wrap: wrap;\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/table.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,'/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck-content .table {\n\t/* Give the table widget some air and center it horizontally */\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em auto;\n\tdisplay: table;\n\n\t& table {\n\t\t/* The table cells should have slight borders */\n\t\tborder-collapse: collapse;\n\t\tborder-spacing: 0;\n\n\t\t/* Table width and height are set on the parent
. Make sure the table inside stretches\n\t\tto the full dimensions of the container (https://github.com/ckeditor/ckeditor5/issues/6186). */\n\t\twidth: 100%;\n\t\theight: 100%;\n\n\t\t/* The outer border of the table should be slightly darker than the inner lines.\n\t\tAlso see https://github.com/ckeditor/ckeditor5-table/issues/50. */\n\t\tborder: 1px double hsl(0, 0%, 70%);\n\n\t\t& td,\n\t\t& th {\n\t\t\tmin-width: 2em;\n\t\t\tpadding: .4em;\n\n\t\t\t/* The border is inherited from .ck-editor__nested-editable styles, so theoretically it\'s not necessary here.\n\t\t\tHowever, the border is a content style, so it should use .ck-content (so it works outside the editor).\n\t\t\tHence, the duplication. See https://github.com/ckeditor/ckeditor5/issues/6314 */\n\t\t\tborder: 1px solid hsl(0, 0%, 75%);\n\t\t}\n\n\t\t& th {\n\t\t\tfont-weight: bold;\n\t\t\tbackground: hsla(0, 0%, 0%, 5%);\n\t\t}\n\t}\n}\n\n/* Text alignment of the table header should match the editor settings and override the native browser styling,\nwhen content is available outside the editor. See https://github.com/ckeditor/ckeditor5/issues/6638 */\n.ck-content[dir="rtl"] .table th {\n\ttext-align: right;\n}\n\n.ck-content[dir="ltr"] .table th {\n\ttext-align: left;\n}\n\n.ck-editor__editable .ck-table-bogus-paragraph {\n\t/*\n\t * Use display:inline-block to force Chrome/Safari to limit text mutations to this element.\n\t * See https://github.com/ckeditor/ckeditor5/issues/6062.\n\t */\n\tdisplay: inline-block;\n\n\t/*\n\t * Inline HTML elements nested in the span should always be dimensioned in relation to the whole cell width.\n\t * See https://github.com/ckeditor/ckeditor5/issues/9117.\n\t */\n\twidth: 100%;\n}\n',""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-selector-caption-background: hsl(0, 0%, 97%);\n\t--ck-color-selector-caption-text: hsl(0, 0%, 20%);\n\t--ck-color-selector-caption-highlighted-background: hsl(52deg 100% 50%);\n}\n\n/* Content styles */\n.ck-content .table > figcaption {\n\tdisplay: table-caption;\n\tcaption-side: top;\n\tword-break: break-word;\n\ttext-align: center;\n\tcolor: var(--ck-color-selector-caption-text);\n\tbackground-color: var(--ck-color-selector-caption-background);\n\tpadding: .6em;\n\tfont-size: .75em;\n\toutline-offset: -1px;\n}\n\n/* Editing styles */\n.ck.ck-editor__editable .table > figcaption {\n\t&.table__caption_highlighted {\n\t\tanimation: ck-table-caption-highlight .6s ease-out;\n\t}\n\n\t&.ck-placeholder::before {\n\t\tpadding-left: inherit;\n\t\tpadding-right: inherit;\n\n\t\t/*\n\t\t * Make sure the table caption placeholder doesn't overflow the placeholder area.\n\t\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\n\t\t */\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n\n@keyframes ck-table-caption-highlight {\n\t0% {\n\t\tbackground-color: var(--ck-color-selector-caption-highlighted-background);\n\t}\n\n\t100% {\n\t\tbackground-color: var(--ck-color-selector-caption-background);\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-table-cell-properties-form {\n\t& .ck-form__row {\n\t\t&.ck-table-cell-properties-form__alignment-row {\n\t\t\tflex-wrap: wrap;\n\n\t\t\t& .ck.ck-toolbar {\n\t\t\t\t&:first-of-type {\n\t\t\t\t\t/* 4 buttons out of 7 (h-alignment + v-alignment) = 0.57 */\n\t\t\t\t\tflex-grow: 0.57;\n\t\t\t\t}\n\n\t\t\t\t&:last-of-type {\n\t\t\t\t\t/* 3 buttons out of 7 (h-alignment + v-alignment) = 0.43 */\n\t\t\t\t\tflex-grow: 0.43;\n\t\t\t\t}\n\n\t\t\t\t& .ck-button {\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n:root {\n\t--ck-color-selector-column-resizer-hover: var(--ck-color-base-active);\n\t--ck-table-column-resizer-width: 7px;\n\n\t/* The offset used for absolute positioning of the resizer element, so that it is placed exactly above the cell border.\n\t The value is: minus half the width of the resizer decreased additionaly by the half the width of the border (0.5px). */\n\t--ck-table-column-resizer-position-offset: calc(var(--ck-table-column-resizer-width) * -0.5 - 0.5px);\n}\n\n.ck-content .table .ck-table-resized {\n\ttable-layout: fixed;\n}\n\n.ck-content .table table {\n\toverflow: hidden;\n}\n\n.ck-content .table td,\n.ck-content .table th {\n\t/* To prevent text overflowing beyond its cell when columns are resized by resize handler\n\t(https://github.com/ckeditor/ckeditor5/pull/14379#issuecomment-1589460978). */\n\toverflow-wrap: break-word;\n\tposition: relative;\n}\n\n.ck.ck-editor__editable .table .ck-table-column-resizer {\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tright: var(--ck-table-column-resizer-position-offset);\n\twidth: var(--ck-table-column-resizer-width);\n\tcursor: col-resize;\n\tuser-select: none;\n\tz-index: var(--ck-z-default);\n}\n\n.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer {\n\tdisplay: none;\n}\n\n/* The resizer elements, which are extended to an extremely high height, break the drag & drop feature in Chrome. To make it work again,\n all resizers must be hidden while the table is dragged. */\n.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer {\n\tdisplay: none;\n}\n\n.ck.ck-editor__editable .table .ck-table-column-resizer:hover,\n.ck.ck-editor__editable .table .ck-table-column-resizer__active {\n\tbackground-color: var(--ck-color-selector-column-resizer-hover);\n\topacity: 0.25;\n\t/* The resizer element resides in each cell so to occupy the entire height of the table, which is unknown from a CSS point of view,\n\t it is extended to an extremely high height. Even for screens with a very high pixel density, the resizer will fulfill its role as\n\t it should, i.e. for a screen of 476 ppi the total height of the resizer will take over 350 sheets of A4 format, which is totally\n\t unrealistic height for a single table. */\n\ttop: -999999px;\n\tbottom: -999999px;\n}\n\n.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer {\n\tleft: var(--ck-table-column-resizer-position-offset);\n\tright: unset;\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/*\n * Note: This file should contain the wireframe styles only. But since there are no such styles,\n * it acts as a message to the builder telling that it should look for the corresponding styles\n * **in the theme** when compiling the editor.\n */\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableform.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,'/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-table-form {\n\t& .ck-form__row {\n\t\t&.ck-table-form__border-row {\n\t\t\tflex-wrap: wrap;\n\t\t}\n\n\t\t&.ck-table-form__background-row {\n\t\t\tflex-wrap: wrap;\n\t\t}\n\n\t\t&.ck-table-form__dimensions-row {\n\t\t\tflex-wrap: wrap;\n\t\t\talign-items: center;\n\n\t\t\t& .ck-labeled-field-view {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column-reverse;\n\t\t\t\talign-items: center;\n\n\t\t\t\t& .ck.ck-dropdown {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t& .ck-table-form__dimension-operator {\n\t\t\t\tflex-grow: 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t& .ck.ck-labeled-field-view {\n\t\t/* Allow absolute positioning of the status (error) balloons. */\n\t\tposition: relative;\n\n\t\t& .ck.ck-labeled-field-view__status {\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\tbottom: calc( -1 * var(--ck-table-properties-error-arrow-size) );\n\t\t\ttransform: translate(-50%,100%);\n\n\t\t\t/* Make sure the balloon status stays on top of other form elements. */\n\t\t\tz-index: 1;\n\n\t\t\t/* The arrow pointing towards the field. */\n\t\t\t&::after {\n\t\t\t\tcontent: "";\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: calc( -1 * var(--ck-table-properties-error-arrow-size) );\n\t\t\t\tleft: 50%;\n\t\t\t\ttransform: translateX( -50% );\n\t\t\t}\n\t\t}\n\t}\n}\n',""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n.ck.ck-table-properties-form {\n\t& .ck-form__row {\n\t\t&.ck-table-properties-form__alignment-row {\n\t\t\tflex-wrap: wrap;\n\t\t\tflex-basis: 0;\n\t\t\talign-content: baseline;\n\n\t\t\t& .ck.ck-toolbar .ck-toolbar__items {\n\t\t\t\tflex-wrap: nowrap;\n\t\t\t}\n\t\t}\n\t}\n}\n",""]);const r=l},"./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css":(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var o=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(o),s=n("./node_modules/css-loader/dist/runtime/api.js"),l=n.n(s)()(i());l.push([e.id,"/*\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/*\n * Note: This file should contain the wireframe styles only. But since there are no such styles,\n * it acts as a message to the builder telling that it should look for the corresponding styles\n * **in the theme** when compiling the editor.\n */\n",""]);const r=l},"./node_modules/css-loader/dist/runtime/api.js":e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,i,s){"string"==typeof e&&(e=[[null,e,void 0]]);var l={};if(o)for(var r=0;r0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=s),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":e=>{"use strict";e.exports=function(e){return e[1]}},"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":(e,t,n)=>{"use strict";var o,i=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},s=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),l=[];function r(e){for(var t=-1,n=0;n{e.exports=n("dll-reference CKEditor5.dll")("./src/core.js")},"ckeditor5/src/engine.js":(e,t,n)=>{e.exports=n("dll-reference CKEditor5.dll")("./src/engine.js")},"ckeditor5/src/ui.js":(e,t,n)=>{e.exports=n("dll-reference CKEditor5.dll")("./src/ui.js")},"ckeditor5/src/utils.js":(e,t,n)=>{e.exports=n("dll-reference CKEditor5.dll")("./src/utils.js")},"ckeditor5/src/widget.js":(e,t,n)=>{e.exports=n("dll-reference CKEditor5.dll")("./src/widget.js")},"dll-reference CKEditor5.dll":e=>{"use strict";e.exports=CKEditor5.dll}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={id:o,exports:{}};return e[o](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0;var o={};return(()=>{"use strict";n.d(o,{default:()=>jn});var e=n("ckeditor5/src/core.js"),t=n("ckeditor5/src/widget.js");class i extends e.Command{execute({href:e,text:t,styles:n,target:o,size:i}){const{model:s}=this.editor;s.change((l=>{const r=l.createElement("websparkButton",{text:t,href:e,target:o,styles:n,size:i}),a=l.createElement("websparkButtonText"),c=l.createText(t);l.append(c,a),l.append(a,r),s.insertContent(r)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkButton");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkButton"===o?.name){let e=o?.getChild?.(0)?.getChild?.(0)?._data;void 0===e&&(e=o._attrs.get("text")),this.value={...Object.fromEntries(o.getAttributes()),text:e}}else this.value=null;setTimeout((function(){let e=document.getElementById("ckeditor5-off-canvas-reset");e&&(document.body.removeChild(e),e.textContent=e.textContent.replace("#drupal-off-canvas-wrapper [data-drupal-ck-style-fence] .ck.ck-content * {display:revert;background:revert;color:initial;padding:revert;}",""),document.body.appendChild(e))}),500)}}var s=n("ckeditor5/src/ui.js");class l extends s.InputView{constructor(e,t,n){super(e);const o=this.bindTemplate;this.set("value",t[0]?.value||n);const i=t.map((e=>({tag:"option",attributes:{value:e.value,selected:o.if("value","",(t=>t===e.value))},children:[e.title]})));this.on("select",((e,t)=>{this.set("value",t.target.value)})),this.setTemplate({tag:"select",attributes:{class:["ck-webspark-form-select"]},children:i,on:{change:o.to("select")}})}}function r(e,t=[]){return{tag:"div",attributes:{class:["ck-webspark-form-container",...t]},children:e}}function a(...e){return{tag:"div",attributes:{class:["ck-webspark-form-row"]},children:e}}function c(e,t,n){const o=new s.LabelView(n),i=new l(n,t,t[0].value);return o.text=e,r([o,i])}function d(e,t){const n=new s.LabelView(t),o=new s.InputTextView(t);return n.text=e,r([n,o])}function u(e,t,n,o){const i=new s.ButtonView(o);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({attributes:{class:n}}),i}function h(e,t,n="default"){if(!g(t))for(const n in t)if(e.includes(n))return t[n];return n}function m(e,t){const n=new s.LabelView(t),o=new s.TextareaView(t);return n.text=e,r([n,o])}const g=e=>0===Object.keys(e).length;class p extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkButton",new i(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkButton",{isObject:!0,allowWhere:"$inlineObject",allowAttributes:["text","href","target","styles","role","size"],allowContentOf:"$block"}),e.register("websparkButtonText",{isLimit:!0,allowIn:"websparkButton",allowContentOf:"$block"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:"a",classes:["btn",/^btn-(gold|maroon|gray|dark|md|sm)$/],attributes:!0},model:(e,{writer:t})=>{const n=e.getAttribute("class");return t.createElement("websparkButton",{text:e?._children[0]?._textData,href:e.getAttribute("href"),styles:h(n,{"btn-gold":"gold","btn-maroon":"maroon","btn-gray":"gray","btn-dark":"dark"},null),size:h(n,{"btn-md":"md","btn-sm":"sm"},"default"),role:"button",target:e.getAttribute("target")||"unset"})}}),e.for("dataDowncast").elementToElement({model:"websparkButton",view:(e,{writer:t})=>{const n=e.getAttribute("target");let o=`btn btn-${e.getAttribute("styles")}`;const i=e.getAttribute("size");return"default"!==i&&(o+=` btn-${i}`),t.createContainerElement("a",{class:o,text:e.getAttribute("text"),href:e.getAttribute("href"),role:"button",..."unset"!==n&&{target:n}})}}),e.for("editingDowncast").elementToElement({model:"websparkButton",view:(e,{writer:n})=>{let o=`btn btn-${e.getAttribute("styles")}`;const i=e.getAttribute("size");"default"!==i&&(o+=` btn-${i}`);const s=n.createContainerElement("a",{class:o});return(0,t.toWidget)(s,n,{label:"Webspark button"})}}),e.for("upcast").elementToElement({model:"websparkButtonText",view:{name:"span",classes:"text"}}),e.for("dataDowncast").elementToElement({model:"websparkButtonText",view:{name:"span",classes:"text"}}),e.for("editingDowncast").elementToElement({model:"websparkButtonText",view:(e,{writer:n})=>{const o=n.createEditableElement("span",{class:"text"});return(0,t.toWidgetEditable)(o,n)}})}}var w=n("ckeditor5/src/utils.js");class b extends s.View{DEFAULT_TEXT="Button";DEFAULT_HREF="#";DEFAULT_STYLE="gold";DEFAULT_SIZE="default";DEFAULT_TARGET="unset";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputView=d(o("Text"),n),this.urlInputView=d(o("URL"),n),this.styleSelect=c(o("Style"),this._getStyleOptions(o),n),this.sizeSelect=c(o("Size"),this._getSizeOptions(o),n),this.targetSelect=c(o("Target"),this._getTargetOptions(o),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form"],tabindex:"-1"},children:[a(this.textInputView,this.urlInputView),a(this.styleSelect,this.sizeSelect,this.targetSelect),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputView.children[1],this.urlInputView.children[1],this.styleSelect.children[1],this.sizeSelect.children[1],this.targetSelect.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}get href(){return this.urlInputView.children[1].element.value.trim()}set href(e){this.urlInputView.children[1].element.value=e.trim()}get styles(){return this.styleSelect.children[1].value}set styles(e){this.styleSelect.children[1].value=e}get size(){return this.sizeSelect.children[1].value}set size(e){this.sizeSelect.children[1].value=e}get target(){return this.targetSelect.children[1].value}set target(e){this.targetSelect.children[1].value=e}setValues(e){this.text=e?.text||this.DEFAULT_TEXT,this.href=e?.href||this.DEFAULT_HREF,this.styles=e?.styles||this.DEFAULT_STYLE,this.size=e?.size||this.DEFAULT_SIZE,this.target=e?.target||this.DEFAULT_TARGET}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return t.includes("text")?this.textInputView.errorText=t:t.includes("URL")&&(this.urlInputView.errorText=t),!1}return!0}resetFormStatus(){this.textInputView.errorText=null,this.urlInputView.errorText=null}_getStyleOptions(e){return[{value:"gold",title:e("Button Gold")},{value:"maroon",title:e("Button Maroon")},{value:"gray",title:e("Button Gray 2")},{value:"dark",title:e("Button Gray 7")}]}_getSizeOptions(e){return[{value:"default",title:e("Default")},{value:"md",title:e("Medium")},{value:"sm",title:e("Small")}]}_getTargetOptions(e){return[{value:"",title:e("Not set")},{value:"_blank",title:e("New window (_blank)")},{value:"_top",title:e("Topmost window (_top)")},{value:"_self",title:e("Same window (_self)")},{value:"_parent",title:e("Parent window (_parent)")}]}}class f extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkButton");this.form=new b((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkButton",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Button"),icon:'\n\n\n',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputView.children[1].select(),t.focus()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkButton",{text:t.text,href:t.href,styles:t.styles,size:t.size,target:t.target}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class k extends e.Plugin{static get requires(){return[p,f]}}class v extends e.Command{execute(e){const{model:t}=this.editor;t.change((e=>{t.insertContent(function(e){const t=e.createElement("websparkDivider");return e.setAttribute("class","copy-divider",t),t}(e))}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"$block");this.isEnabled=null!==n}}class C extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkDivider",new v(this.editor))}_defineSchema(){this.editor.model.schema.register("websparkDivider",{isObject:!0,allowWhere:"$block"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:"hr",classes:"copy-divider"},model:(e,{writer:t})=>t.createElement("websparkDivider"),converterPriority:"high"}),e.for("dataDowncast").elementToElement({model:"websparkDivider",view:(e,{writer:t})=>t.createEmptyElement("hr",{class:"copy-divider"})}),e.for("editingDowncast").elementToElement({model:"websparkDivider",view:(e,{writer:n})=>{const o=n.createContainerElement("div",null,n.createEmptyElement("hr",{class:"copy-divider"}));return n.addClass("copy-divider",o),n.setCustomProperty("hr",!0,o),(0,t.toWidget)(o,n,{label:"Webspark divider"})}})}}class T extends e.Plugin{init(){const e=this.editor;e.t;e.ui.componentFactory.add("websparkDivider",(t=>{const n=e.commands.get("insertWebsparkDivider"),o=new s.ButtonView(t);return o.set({label:e.t("Divider"),icon:'',tooltip:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",(()=>e.execute("insertWebsparkDivider"))),o}))}}class y extends e.Plugin{static get requires(){return[C,T]}}class _ extends e.Command{execute({text:e}){const{model:t}=this.editor;t.change((n=>{const o=n.createElement("websparkLead"),i=n.createElement("websparkLeadText"),s=n.createText(e);n.append(s,i),n.append(i,o),t.insertContent(o)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkLead");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkLead"===o?.name){const e=o.getChild(0)?.getChild(0);e&&(this.value={...Object.fromEntries(e.getAttributes()),text:e._data??""})}else this.value=null}}class x extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkLead",new _(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkLead",{isObject:!0,allowWhere:"$block"}),e.register("websparkLeadText",{allowIn:"websparkLead",allowAttributes:["classes"],allowChildren:"$text"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:"p",class:"lead"},model:(e,{writer:t})=>{const n=e.getAttribute("class");return t.createElement("websparkLeadText",{classes:n})}}),e.for("dataDowncast").elementToElement({model:"websparkLeadText",view:(e,{writer:t})=>t.createContainerElement("p",{class:"lead"})}),e.for("editingDowncast").elementToElement({model:"websparkLeadText",view:(e,{writer:n})=>{const o=n.createEditableElement("p",{class:"lead"});return(0,t.toWidgetEditable)(o,n,{label:"Lead Text"})}}),e.for("upcast").elementToElement({view:{name:"div",classes:["uds-lead"]},model:(e,{writer:t})=>t.createElement("websparkLead")}),e.for("dataDowncast").elementToElement({model:"websparkLead",view:(e,{writer:t})=>t.createContainerElement("div",{class:"uds-lead"})}),e.for("editingDowncast").elementToElement({model:"websparkLead",view:(e,{writer:n})=>{const o=n.createContainerElement("div",{class:"uds-lead"});return(0,t.toWidget)(o,n,{label:"Lead"})}})}}class E extends s.View{DEFAULT_TEXT="";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputView=m(o("Content"),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-heading-dialog"],tabindex:"-1"},children:[a(this.textInputView),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputView.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}setValues(e){this.text=e?.text||this.DEFAULT_TEXT}isValid(){return!0}resetFormStatus(){this.textInputView.errorText=null}}class A extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkLead");this.form=new E((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkLead",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Lead"),icon:'',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputView.children[1].element.select()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkLead",{text:t.text}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class S extends e.Plugin{static get requires(){return[x,A]}}class V extends e.Command{execute({text:e,styles:t,heading:n}){const{model:o}=this.editor;o.change((i=>{const s=i.createElement("websparkHighlightedHeading"),l=i.createElement("websparkHighlightedHeadingHelement",{level:n}),r=i.createElement("websparkHighlightedHeadingText",{styles:t}),a=i.createText(e);i.append(a,r),i.append(r,l),i.append(l,s),o.insertContent(s)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkHighlightedHeading");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkHighlightedHeading"===o?.name){const e=o.getChild(0)?.getChild(0);e&&(this.value={...Object.fromEntries(e.getAttributes()),text:e.getChild(0)?._data??"",heading:e.parent.getAttribute("level")})}else this.value=null}}class B extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkHighlightedHeading",new V(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkHighlightedHeading",{isObject:!0,allowWhere:"$block"}),e.register("websparkHighlightedHeadingHelement",{allowIn:"websparkHighlightedHeading",allowAttributes:["level"]}),e.register("websparkHighlightedHeadingText",{allowIn:"websparkHighlightedHeadingHelement",allowAttributes:["styles"],allowChildren:"$text"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:/^(h1|h2|h3|h4)$/},model:(e,{writer:t})=>t.createElement("websparkHighlightedHeadingHelement",{level:e.name})}),e.for("downcast").elementToElement({model:{name:"websparkHighlightedHeadingHelement",attributes:["level"]},view:(e,{writer:t})=>t.createContainerElement(e.getAttribute("level"))}),e.for("upcast").elementToElement({view:{name:"span",classes:[/^highlight-(gold|black|white)$/]},model:(e,{writer:t})=>{const n=e.getAttribute("class");return t.createElement("websparkHighlightedHeadingText",{styles:h(n,{"highlight-gold":"gold","highlight-black":"black","highlight-white":"white"},null)})}}),e.for("dataDowncast").elementToElement({model:"websparkHighlightedHeadingText",view:(e,{writer:t})=>{const n=`highlight-${e.getAttribute("styles")}`;return t.createContainerElement("span",{class:n})}}),e.for("editingDowncast").elementToElement({model:"websparkHighlightedHeadingText",view:(e,{writer:n})=>{const o=`highlight-${e.getAttribute("styles")}`,i=n.createEditableElement("span",{class:o});return(0,t.toWidgetEditable)(i,n,{label:"Highlighted Text"})}}),e.for("upcast").elementToElement({view:{name:"div",classes:["uds-highlighted-heading"]},model:(e,{writer:t})=>t.createElement("websparkHighlightedHeading")}),e.for("dataDowncast").elementToElement({model:"websparkHighlightedHeading",view:(e,{writer:t})=>t.createContainerElement("div",{class:"uds-highlighted-heading"})}),e.for("editingDowncast").elementToElement({model:"websparkHighlightedHeading",view:(e,{writer:n})=>{const o=n.createContainerElement("div",{class:"uds-highlighted-heading"});return(0,t.toWidget)(o,n,{label:"Highlighted Heading"})}})}}class R extends s.View{DEFAULT_TEXT="";DEFAULT_STYLE="gold";DEFAULT_HEADING="h2";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputView=m(o("Content"),n),this.styleSelect=c(o("Style"),this._getStyleOptions(o),n),this.headingSelect=c(o("Heading"),this._getHeadingOptions(o),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-heading-dialog"],tabindex:"-1"},children:[a(this.textInputView),a(this.styleSelect,this.headingSelect),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputView.children[1],this.styleSelect.children[1],this.headingSelect.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}get styles(){return this.styleSelect.children[1].value}set styles(e){this.styleSelect.children[1].value=e}get heading(){return this.headingSelect.children[1].value}set heading(e){this.headingSelect.children[1].value=e}setValues(e){this.text=e?.text||this.DEFAULT_TEXT,this.styles=e?.styles||this.DEFAULT_STYLE,this.heading=e?.heading||this.DEFAULT_HEADING}isValid(){return!0}resetFormStatus(){this.textInputView.errorText=null}_getStyleOptions(e){return[{value:"gold",title:e("Gold Highlight")},{value:"black",title:e("Gray 7 Highlight")},{value:"white",title:e("White Highlight")}]}_getHeadingOptions(e){return[{value:"h2",title:e("H2")},{value:"h3",title:e("H3")},{value:"h4",title:e("H4")}]}}class I extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkHighlightedHeading");this.form=new R((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkHighlightedHeading",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Highlighted Heading"),icon:'',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputView.children[1].element.select()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkHighlightedHeading",{text:t.text,styles:t.styles,heading:t.heading}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class L extends e.Plugin{static get requires(){return[B,I]}}class D extends e.Command{execute({text:e,citationName:t,citationDescription:n}){const{model:o}=this.editor;o.change((i=>{const s=i.createElement("websparkBlockquote"),l=i.createElement("websparkBlockQuoteSvg"),r=i.createElement("websparkBlockQuoteContainer"),a=i.createElement("websparkBlockquoteParagraph"),c=i.createElement("websparkBlockquoteCitation"),d=i.createElement("websparkBlockquoteCitationName"),u=i.createElement("websparkBlockquoteCitationDescription"),h=i.createText(e);if(i.append(h,a),t.length>0){const e=i.createText(t);i.append(e,d),i.append(d,c)}if(n.length>0){const e=i.createText(n);i.append(e,u),i.append(u,c)}i.append(l,s),i.append(a,r),i.append(c,r),i.append(r,s),o.insertContent(s)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkBlockquote");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkBlockquote"===o?.name){const t=o?.getChild(0)?.getChild(0)?._data;e.change((e=>{e.setAttribute("text",t,o)})),this.value=Object.fromEntries(o.getAttributes())}else this.value=null}_defaultSvgPath(){return"M113.61,245.82H0V164.56q0-49.34,8.69-77.83T40.84,35.58Q64.29,12.95,100.67,0l22.24,46.9q-34,11.33-48.72,31.54T58.63,132.21h55Zm180,0H180V164.56q0-49.74,8.7-78T221,35.58Q244.65,12.95,280.63,0l22.24,46.9q-34,11.33-48.72,31.54t-15.57,53.77h55Z"}}class H extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkBlockquote",new D(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkBlockquote",{isObject:!0,allowWhere:"$block"}),e.register("websparkBlockQuoteSvg",{isObject:!0,allowIn:"websparkBlockquote",allowContentOf:"$block",allowAttributes:["role","title","viewBox","xmlns"]}),e.register("websparkBlockQuoteContainer",{isLimit:!0,allowIn:"websparkBlockquote",allowContentOf:"$block"}),e.register("websparkBlockquoteParagraph",{isLimit:!0,allowIn:"websparkBlockQuoteContainer",allowContentOf:"$block"}),e.register("websparkBlockquoteCitation",{isLimit:!0,allowIn:"websparkBlockQuoteContainer",allowContentOf:"$text"}),e.register("websparkBlockquoteCitationName",{isLimit:!0,allowIn:"websparkBlockquoteCitation",allowContentOf:"$block"}),e.register("websparkBlockquoteCitationDescription",{isLimit:!0,allowIn:"websparkBlockquoteCitation",allowContentOf:"$block"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({model:"websparkBlockquoteCitationName",view:{name:"cite",classes:"name"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteCitationName",view:{name:"cite",classes:"name"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteCitationName",view:(e,{writer:n})=>{const o=n.createEditableElement("cite",{class:"name"});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteCitationDescription",view:{name:"cite",classes:"description"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteCitationDescription",view:{name:"cite",classes:"description"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteCitationDescription",view:(e,{writer:n})=>{const o=n.createEditableElement("cite",{class:"description"});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteCitation",view:{name:"div",classes:"citation"}}),e.for("dataDowncast").elementToStructure({model:"websparkBlockquoteCitation",view:(e,t)=>{const{writer:n}=t,o=n.createContainerElement("div",{class:"citation-content"},[n.createSlot()]);return n.createContainerElement("div",{class:"citation"},[o])}}),e.for("editingDowncast").elementToStructure({model:"websparkBlockquoteCitation",view:(e,t)=>{const{writer:n}=t,o=n.createContainerElement("div",{class:"citation-content"},[n.createSlot()]);return n.createContainerElement("div",{class:"citation"},[o])}}),e.for("upcast").elementToElement({model:"websparkBlockquoteParagraph",view:{name:"p"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteParagraph",view:{name:"p"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteParagraph",view:(e,{writer:n})=>{const o=n.createEditableElement("p",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockQuoteContainer",view:{name:"blockquote"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockQuoteContainer",view:{name:"blockquote"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockQuoteContainer",view:(e,{writer:n})=>{const o=n.createEditableElement("blockquote",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({view:{name:"div",attributes:{class:"open-quote"}},model:(e,{writer:t})=>t.createElement("websparkBlockQuoteSvg",{role:"presentation",title:"Open quote",viewBox:"0 0 302.87 245.82",xmlns:"http://www.w3.org/2000/svg"})}),e.for("upcast").elementToElement({view:{name:"svg",attributes:{role:"presentation",title:"Open quote"}},model:(e,{writer:t})=>t.createElement("websparkBlockQuoteSvg",{role:"presentation",title:"Open quote",viewBox:"0 0 302.87 245.82",xmlns:"http://www.w3.org/2000/svg"})}),e.for("downcast").elementToElement({model:"websparkBlockQuoteSvg",view:(e,{writer:t})=>t.createContainerElement("div",{class:"open-quote"})}),e.for("upcast").elementToElement({view:{name:"div",classes:["uds-blockquote","accent-maroon"]},model:(e,{writer:t})=>t.createElement("websparkBlockquote",{})}),e.for("dataDowncast").elementToElement({model:"websparkBlockquote",view:(e,{writer:t})=>t.createContainerElement("div",{class:"uds-blockquote accent-maroon"})}),e.for("editingDowncast").elementToElement({model:"websparkBlockquote",view:(e,{writer:n})=>{const o=n.createContainerElement("div",{class:"uds-blockquote accent-maroon"});return(0,t.toWidget)(o,n,{label:"BlockQuote"})}})}}class P extends s.View{DEFAULT_TEXT="";DEFAULT_STYLE="";DEFAULT_HEADING="";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputView=m(o("Content"),n),this.citationNameView=d(o("Citation Name"),n),this.citationDescriptionView=d(o("Citation Description"),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-blockquote-dialog"],tabindex:"-1"},children:[a(this.textInputView),a(this.citationNameView),a(this.citationDescriptionView),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputView.children[1],this.citationNameView.children[1],this.citationDescriptionView.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}get citationName(){return this.citationNameView.children[1].element.value.trim()}set citationName(e){this.citationNameView.children[1].element.value=e.trim()}get citationDescription(){return this.citationDescriptionView.children[1].element.value.trim()}set citationDescription(e){this.citationDescriptionView.children[1].element.value=e.trim()}setValues(e){this.text=e?.text||this.DEFAULT_TEXT,this.citationName=e?.citationName||this.DEFAULT_STYLE,this.citationDescription=e?.citationDescription||this.DEFAULT_HEADING}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return t.includes("text")&&(this.textInputView.errorText=t),!1}return!0}resetFormStatus(){this.textInputView.errorText=null}}class F extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkBlockquote");this.form=new P((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkBlockquote",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Blockquote"),icon:'',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputView.children[1].element.select()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkBlockquote",{text:t.text,citationName:t.citationName,citationDescription:t.citationDescription}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class M extends e.Plugin{static get requires(){return[H,F]}}function O(e,t,n,o,i=1){null!=t&&null!=i&&t>i?o.setAttribute(e,t,n):o.removeAttribute(e,n)}function q(e,t,n={}){const o=e.createElement("tableCell",n);return e.insertElement("paragraph",o),e.insert(o,t),o}function N(e,t){const n=t.parent.parent,o=parseInt(n.getAttribute("headingColumns")||"0"),{column:i}=e.getCellLocation(t);return!!o&&i{e.on("element:table",((e,t,n)=>{const o=t.viewItem;if(!n.consumable.test(o,{name:!0}))return;const{rows:i,headingRows:s,headingColumns:l}=function(e){let t,n=0;const o=[],i=[];let s;for(const l of Array.from(e.getChildren())){if("tbody"!==l.name&&"thead"!==l.name&&"tfoot"!==l.name)continue;"thead"!==l.name||s||(s=l);const e=Array.from(l.getChildren()).filter((e=>e.is("element","tr")));for(const r of e)if(s&&l===s||"tbody"===l.name&&Array.from(r.getChildren()).length&&Array.from(r.getChildren()).every((e=>e.is("element","th"))))n++,o.push(r);else{i.push(r);const e=W(r);(!t||en.convertItem(e,n.writer.createPositionAt(a,"end")))),n.convertChildren(o,n.writer.createPositionAt(a,"end")),a.isEmpty){const e=n.writer.createElement("tableRow");n.writer.insert(e,n.writer.createPositionAt(a,"end")),q(n.writer,n.writer.createPositionAt(e,"end"))}n.updateConversionResult(a,t)}}))}}function z(e){return t=>{t.on(`element:${e}`,((e,t,{writer:n})=>{if(!t.modelRange)return;const o=t.modelRange.start.nodeAfter,i=n.createPositionAt(o,0);if(t.viewItem.isEmpty)return void n.insertElement("paragraph",i);const s=Array.from(o.getChildren());if(s.every((e=>e.is("element","$marker")))){const e=n.createElement("paragraph");n.insert(e,n.createPositionAt(o,0));for(const t of s)n.move(n.createRangeOn(t),n.createPositionAt(e,"end"))}}),{priority:"low"})}}function W(e){let t=0,n=0;const o=Array.from(e.getChildren()).filter((e=>"th"===e.name||"td"===e.name));for(;n1||i>1)&&this._recordSpans(n,i,o),this._shouldSkipSlot()||(t=this._formatOutValue(n)),this._nextCellAtColumn=this._column+o}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(e,t=this._row,n=this._column){return{done:!1,value:new G(this,e,t,n)}}_shouldSkipSlot(){const e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||n||o}_getSpanned(){const e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,n){const o={cell:e,row:this._row,column:this._column};for(let e=this._row;e0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){const e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}}class G{constructor(e,t,n,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=n,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function K(e,n){return(o,{writer:i})=>{const s=o.getAttribute("headingRows")||0,l=i.createContainerElement("table",null,[]),r=i.createContainerElement("figure",{class:"table"},l);s>0&&i.insert(i.createPositionAt(l,"end"),i.createContainerElement("thead",null,i.createSlot((e=>e.is("element","tableRow")&&e.indexe.is("element","tableRow")&&e.index>=s))));for(const{positionOffset:e,filter:t}of n.additionalSlots)i.insert(i.createPositionAt(l,e),i.createSlot(t));return i.insert(i.createPositionAt(l,"after"),i.createSlot((e=>!e.is("element","tableRow")&&!n.additionalSlots.some((({filter:t})=>t(e)))))),n.asWidget?function(e,n){return n.setCustomProperty("table",!0,e),(0,t.toWidget)(e,n,{hasSelectionHandle:!0})}(r,i):r}}function $(e={}){return(n,{writer:o})=>{const i=n.parent,s=i.parent,l=s.getChildIndex(i),r=new U(s,{row:l}),a=s.getAttribute("headingRows")||0,c=s.getAttribute("headingColumns")||0;let d=null;for(const i of r)if(i.cell==n){const n=i.row{if(!t.parent.is("element","tableCell"))return null;if(!Y(t))return null;if(e.asWidget)return n.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{const e=n.createContainerElement("p");return n.setCustomProperty("dataPipeline:transparentRendering",!0,e),e}}}function Y(e){return 1==e.parent.childCount&&!!e.getAttributeKeys().next().done}class Q extends e.Command{refresh(){const e=this.editor.model,t=e.document.selection,n=e.schema;this.isEnabled=function(e,t){const n=e.getFirstPosition().parent,o=n===n.root?n:n.parent;return t.checkChild(o,"table")}(t,n)}execute(e={}){const t=this.editor,n=t.model,o=t.plugins.get("TableUtils"),i=t.config.get("table.defaultHeadings.rows"),s=t.config.get("table.defaultHeadings.columns");void 0===e.headingRows&&i&&(e.headingRows=i),void 0===e.headingColumns&&s&&(e.headingColumns=s),n.change((t=>{const i=o.createTable(t,e);n.insertObject(i,null,null,{findOptimalPosition:"auto"}),t.setSelection(t.createPositionAt(i.getNodeByPath([0,0,0]),0))}))}}class X extends e.Command{constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),o="above"===this.order,i=n.getSelectionAffectedTableCells(t),s=n.getRowIndexes(i),l=o?s.first:s.last,r=i[0].findAncestor("table");n.insertRows(r,{at:o?l:l+1,copyStructureFromAbove:!o})}}class J extends e.Command{constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){const e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){const e=this.editor,t=e.model.document.selection,n=e.plugins.get("TableUtils"),o="left"===this.order,i=n.getSelectionAffectedTableCells(t),s=n.getColumnIndexes(i),l=o?s.first:s.last,r=i[0].findAncestor("table");n.insertColumns(r,{columns:1,at:o?l:l+1})}}class ee extends e.Command{constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=1===e.length}execute(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];"horizontally"===this.direction?e.splitCellHorizontally(t,2):e.splitCellVertically(t,2)}}function te(e,t,n){const{startRow:o,startColumn:i,endRow:s,endColumn:l}=t,r=n.createElement("table"),a=s-o+1;for(let e=0;e0){O("headingRows",s-n,e,i,0)}const l=parseInt(t.getAttribute("headingColumns")||"0");if(l>0){O("headingColumns",l-o,e,i,0)}}(r,e,o,i,n),r}function ne(e,t,n=0){const o=[],i=new U(e,{startRow:n,endRow:t-1});for(const e of i){const{row:n,cellHeight:i}=e;n1&&(r.rowspan=a);const c=parseInt(e.getAttribute("colspan")||"1");c>1&&(r.colspan=c);const d=s+l,u=[...new U(i,{startRow:s,endRow:d,includeAllSlots:!0})];let h,m=null;for(const t of u){const{row:o,column:i,cell:s}=t;s===e&&void 0===h&&(h=i),void 0!==h&&h===i&&o===d&&(m=q(n,t.getPositionBefore(),r))}return O("rowspan",l,e,n),m}function ie(e,t){const n=[],o=new U(e);for(const e of o){const{column:o,cellWidth:i}=e;o1&&(s.colspan=l);const r=parseInt(e.getAttribute("rowspan")||"1");r>1&&(s.rowspan=r);const a=q(o,o.createPositionAfter(e),s);return O("colspan",i,e,o),a}function le(e,t,n,o,i,s){const l=parseInt(e.getAttribute("colspan")||"1"),r=parseInt(e.getAttribute("rowspan")||"1");if(n+l-1>i){O("colspan",i-n+1,e,s,1)}if(t+r-1>o){O("rowspan",o-t+1,e,s,1)}}function re(e,t){const n=t.getColumns(e),o=new Array(n).fill(0);for(const{column:t}of new U(e))o[t]++;const i=o.reduce(((e,t,n)=>t?e:[...e,n]),[]);if(i.length>0){const n=i[i.length-1];return t.removeColumns(e,{at:n}),!0}return!1}function ae(e,t){const n=[],o=t.getRows(e);for(let t=0;t0){const o=n[n.length-1];return t.removeRows(e,{at:o}),!0}return!1}function ce(e,t){re(e,t)||ae(e,t)}function de(e,t){const n=Array.from(new U(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(n.every((({cellHeight:e})=>1===e)))return t.lastRow;const o=n[0].cellHeight-1;return t.lastRow+o}function ue(e,t){const n=Array.from(new U(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(n.every((({cellWidth:e})=>1===e)))return t.lastColumn;const o=n[0].cellWidth-1;return t.lastColumn+o}class he extends e.Command{constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){const e=this.editor.model,t=e.document,n=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],o=this.value,i=this.direction;e.change((e=>{const t="right"==i||"down"==i,s=t?n:o,l=t?o:n,r=l.parent;!function(e,t,n){me(e)||(me(t)&&n.remove(n.createRangeIn(t)),n.move(n.createRangeIn(e),n.createPositionAt(t,"end")));n.remove(e)}(l,s,e);const a=this.isHorizontal?"colspan":"rowspan",c=parseInt(n.getAttribute(a)||"1"),d=parseInt(o.getAttribute(a)||"1");e.setAttribute(a,c+d,s),e.setSelection(e.createRangeIn(s));const u=this.editor.plugins.get("TableUtils");ce(r.findAncestor("table"),u)}))}_getMergeableCell(){const e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),n=t.getTableCellsContainingSelection(e.selection)[0];if(!n)return;const o=this.isHorizontal?function(e,t,n){const o=e.parent,i=o.parent,s="right"==t?e.nextSibling:e.previousSibling,l=(i.getAttribute("headingColumns")||0)>0;if(!s)return;const r="right"==t?e:s,a="right"==t?s:e,{column:c}=n.getCellLocation(r),{column:d}=n.getCellLocation(a),u=parseInt(r.getAttribute("colspan")||"1"),h=N(n,r),m=N(n,a);if(l&&h!=m)return;return c+u===d?s:void 0}(n,this.direction,t):function(e,t,n){const o=e.parent,i=o.parent,s=i.getChildIndex(o);if("down"==t&&s===n.getRows(i)-1||"up"==t&&0===s)return null;const l=parseInt(e.getAttribute("rowspan")||"1"),r=i.getAttribute("headingRows")||0,a="down"==t&&s+l===r,c="up"==t&&s===r;if(r&&(a||c))return null;const d=parseInt(e.getAttribute("rowspan")||"1"),u="down"==t?s+d:s,h=[...new U(i,{endRow:u})],m=h.find((t=>t.cell===e)),g=m.column,p=h.find((({row:e,cellHeight:n,column:o})=>o===g&&("down"==t?e===u:u===e+n)));return p&&p.cell?p.cell:null}(n,this.direction,t);if(!o)return;const i=this.isHorizontal?"rowspan":"colspan",s=parseInt(n.getAttribute(i)||"1");return parseInt(o.getAttribute(i)||"1")===s?o:void 0}}function me(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}class ge extends e.Command{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),n=t[0];if(n){const o=n.findAncestor("table"),i=e.getRows(o)-1,s=e.getRowIndexes(t),l=0===s.first&&s.last===i;this.isEnabled=!l}else this.isEnabled=!1}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(n),i=n[0],s=i.findAncestor("table"),l=t.getCellLocation(i).column;e.change((e=>{const n=o.last-o.first+1;t.removeRows(s,{at:o.first,rows:n});const i=function(e,t,n,o){const i=e.getChild(Math.min(t,o-1));let s=i.getChild(0),l=0;for(const e of i.getChildren()){if(l>n)return s;s=e,l+=parseInt(e.getAttribute("colspan")||"1")}return s}(s,o.first,l,t.getRows(s));e.setSelection(e.createPositionAt(i,0))}))}}class pe extends e.Command{refresh(){const e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),n=t[0];if(n){const o=n.findAncestor("table"),i=e.getColumns(o),{first:s,last:l}=e.getColumnIndexes(t);this.isEnabled=l-se.cell===t)).column,last:i.find((e=>e.cell===n)).column},l=function(e,t,n,o){const i=parseInt(n.getAttribute("colspan")||"1");return i>1?n:t.previousSibling||n.nextSibling?n.nextSibling||t.previousSibling:o.first?e.reverse().find((({column:e})=>ee>o.last)).cell}(i,t,n,s);this.editor.model.change((t=>{const n=s.last-s.first+1;e.removeColumns(o,{at:s.first,columns:n}),t.setSelection(t.createPositionAt(l,0))}))}}class we extends e.Command{refresh(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,n=e.getSelectionAffectedTableCells(t.document.selection),o=n.length>0;this.isEnabled=o,this.value=o&&n.every((e=>this._isInHeading(e,e.parent.parent)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),n=this.editor.model,o=t.getSelectionAffectedTableCells(n.document.selection),i=o[0].findAncestor("table"),{first:s,last:l}=t.getRowIndexes(o),r=this.value?s:l+1,a=i.getAttribute("headingRows")||0;n.change((e=>{if(r){const t=ne(i,r,r>a?a:0);for(const{cell:n}of t)oe(n,r,e)}O("headingRows",r,i,e,0)}))}_isInHeading(e,t){const n=parseInt(t.getAttribute("headingRows")||"0");return!!n&&e.parent.index0;this.isEnabled=o,this.value=o&&n.every((e=>N(t,e)))}execute(e={}){if(e.forceValue===this.value)return;const t=this.editor.plugins.get("TableUtils"),n=this.editor.model,o=t.getSelectionAffectedTableCells(n.document.selection),i=o[0].findAncestor("table"),{first:s,last:l}=t.getColumnIndexes(o),r=this.value?s:l+1;n.change((e=>{if(r){const t=ie(i,r);for(const{cell:n,column:o}of t)se(n,o,r,e)}O("headingColumns",r,i,e,0)}))}}function fe(e){if(e.is("element","tableColumnGroup"))return e;const t=e.getChildren();return Array.from(t).find((e=>e.is("element","tableColumnGroup")))}function ke(e){const t=fe(e);return t?Array.from(t.getChildren()):[]}class ve extends e.Plugin{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){const t=e.parent,n=t.parent,o=n.getChildIndex(t),i=new U(n,{row:o});for(const{cell:t,row:n,column:o}of i)if(t===e)return{row:n,column:o}}createTable(e,t){const n=e.createElement("table"),o=t.rows||2,i=t.columns||2;return Ce(e,n,0,o,i),t.headingRows&&O("headingRows",Math.min(t.headingRows,o),n,e,0),t.headingColumns&&O("headingColumns",Math.min(t.headingColumns,i),n,e,0),n}insertRows(e,t={}){const n=this.editor.model,o=t.at||0,i=t.rows||1,s=void 0!==t.copyStructureFromAbove,l=t.copyStructureFromAbove?o-1:o,r=this.getRows(e),a=this.getColumns(e);if(o>r)throw new w.CKEditorError("tableutils-insertrows-insert-out-of-range",this,{options:t});n.change((t=>{const n=e.getAttribute("headingRows")||0;if(n>o&&O("headingRows",n+i,e,t,0),!s&&(0===o||o===r))return void Ce(t,e,o,i,a);const c=s?Math.max(o,l):o,d=new U(e,{endRow:c}),u=new Array(a).fill(1);for(const{row:e,column:n,cellHeight:r,cellWidth:a,cell:c}of d){const d=e+r-1,h=e<=l&&l<=d;e0&&q(t,i,o>1?{colspan:o}:void 0),e+=Math.abs(o)-1}}}))}insertColumns(e,t={}){const n=this.editor.model,o=t.at||0,i=t.columns||1;n.change((t=>{const n=e.getAttribute("headingColumns");oi-1)throw new w.CKEditorError("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});n.change((t=>{const n={first:s,last:l},{cellsToMove:o,cellsToTrim:i}=function(e,{first:t,last:n}){const o=new Map,i=[];for(const{row:s,column:l,cellHeight:r,cell:a}of new U(e,{endRow:n})){const e=s+r-1;if(s>=t&&s<=n&&e>n){const e=r-(n-s+1);o.set(l,{cell:a,rowspan:e})}if(s=t){let o;o=e>=n?n-t+1:e-t+1,i.push({cell:a,rowspan:r-o})}}return{cellsToMove:o,cellsToTrim:i}}(e,n);if(o.size){!function(e,t,n,o){const i=new U(e,{includeAllSlots:!0,row:t}),s=[...i],l=e.getChild(t);let r;for(const{column:e,cell:t,isAnchor:i}of s)if(n.has(e)){const{cell:t,rowspan:i}=n.get(e),s=r?o.createPositionAfter(r):o.createPositionAt(l,0);o.move(o.createRangeOn(t),s),O("rowspan",i,t,o),r=t}else i&&(r=t)}(e,l+1,o,t)}for(let n=l;n>=s;n--)t.remove(e.getChild(n));for(const{rowspan:e,cell:n}of i)O("rowspan",e,n,t);!function(e,{first:t,last:n},o){const i=e.getAttribute("headingRows")||0;if(t{!function(e,t,n){const o=e.getAttribute("headingColumns")||0;if(o&&t.first=o;i--){for(const{cell:n,column:o,cellWidth:s}of[...new U(e)])o<=i&&s>1&&o+s>i?O("colspan",s-1,n,t):o===i&&t.remove(n);if(n[i]){const e=0===i?n[1]:n[i-1],o=parseFloat(n[i].getAttribute("columnWidth")),s=parseFloat(e.getAttribute("columnWidth"));t.remove(n[i]),t.setAttribute("columnWidth",o+s+"%",e)}}ae(e,this)||re(e,this)}))}splitCellVertically(e,t=2){const n=this.editor.model,o=e.parent.parent,i=parseInt(e.getAttribute("rowspan")||"1"),s=parseInt(e.getAttribute("colspan")||"1");n.change((n=>{if(s>1){const{newCellsSpan:o,updatedSpan:l}=ye(s,t);O("colspan",l,e,n);const r={};o>1&&(r.colspan=o),i>1&&(r.rowspan=i);Te(s>t?t-1:s-1,n,n.createPositionAfter(e),r)}if(st===e)),c=r.filter((({cell:t,cellWidth:n,column:o})=>t!==e&&o===a||oa));for(const{cell:e,cellWidth:t}of c)n.setAttribute("colspan",t+l,e);const d={};i>1&&(d.rowspan=i),Te(l,n,n.createPositionAfter(e),d);const u=o.getAttribute("headingColumns")||0;u>a&&O("headingColumns",u+l,o,n)}}))}splitCellHorizontally(e,t=2){const n=this.editor.model,o=e.parent,i=o.parent,s=i.getChildIndex(o),l=parseInt(e.getAttribute("rowspan")||"1"),r=parseInt(e.getAttribute("colspan")||"1");n.change((n=>{if(l>1){const o=[...new U(i,{startRow:s,endRow:s+l-1,includeAllSlots:!0})],{newCellsSpan:a,updatedSpan:c}=ye(l,t);O("rowspan",c,e,n);const{column:d}=o.find((({cell:t})=>t===e)),u={};a>1&&(u.rowspan=a),r>1&&(u.colspan=r);for(const e of o){const{column:t,row:o}=e;o>=s+c&&t===d&&(o+s+c)%a==0&&Te(1,n,e.getPositionBefore(),u)}}if(ls){const e=i+o;n.setAttribute("rowspan",e,t)}const c={};r>1&&(c.colspan=r),Ce(n,i,s+1,o,1,c);const d=i.getAttribute("headingRows")||0;d>s&&O("headingRows",d+o,i,n)}}))}getColumns(e){return[...e.getChild(0).getChildren()].reduce(((e,t)=>e+parseInt(t.getAttribute("colspan")||"1")),0)}getRows(e){return Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0)}createTableWalker(e,t={}){return new U(e,t)}getSelectedTableCells(e){const t=[];for(const n of this.sortRanges(e.getRanges())){const e=n.getContainedElement();e&&e.is("element","tableCell")&&t.push(e)}return t}getTableCellsContainingSelection(e){const t=[];for(const n of e.getRanges()){const e=n.start.findAncestor("tableCell");e&&t.push(e)}return t}getSelectionAffectedTableCells(e){const t=this.getSelectedTableCells(e);return t.length?t:this.getTableCellsContainingSelection(e)}getRowIndexes(e){const t=e.map((e=>e.parent.index));return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){const t=e[0].findAncestor("table"),n=[...new U(t)].filter((t=>e.includes(t.cell))).map((e=>e.column));return this._getFirstLastIndexesObject(n)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;const t=new Set,n=new Set;let o=0;for(const i of e){const{row:e,column:s}=this.getCellLocation(i),l=parseInt(i.getAttribute("rowspan"))||1,r=parseInt(i.getAttribute("colspan"))||1;t.add(e),n.add(s),l>1&&t.add(e+l-1),r>1&&n.add(s+r-1),o+=l*r}const i=function(e,t){const n=Array.from(e.values()),o=Array.from(t.values()),i=Math.max(...n),s=Math.min(...n),l=Math.max(...o),r=Math.min(...o);return(i-s+1)*(l-r+1)}(t,n);return i==o}sortRanges(e){return Array.from(e).sort(_e)}_getFirstLastIndexesObject(e){const t=e.sort(((e,t)=>e-t));return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){const t=e[0].findAncestor("table"),n=this.getRowIndexes(e),o=parseInt(t.getAttribute("headingRows"))||0;if(!this._areIndexesInSameSection(n,o))return!1;const i=this.getColumnIndexes(e),s=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameSection(i,s)}_areIndexesInSameSection({first:e,last:t},n){return e{const o=t.getSelectedTableCells(e.document.selection),i=o.shift(),{mergeWidth:s,mergeHeight:l}=function(e,t,n){let o=0,i=0;for(const e of t){const{row:t,column:s}=n.getCellLocation(e);o=Se(e,s,o,"colspan"),i=Se(e,t,i,"rowspan")}const{row:s,column:l}=n.getCellLocation(e),r=o-l,a=i-s;return{mergeWidth:r,mergeHeight:a}}(i,o,t);O("colspan",s,i,n),O("rowspan",l,i,n);for(const e of o)Ee(e,i,n);ce(i.findAncestor("table"),t),n.setSelection(i,"in")}))}}function Ee(e,t,n){Ae(e)||(Ae(t)&&n.remove(n.createRangeIn(t)),n.move(n.createRangeIn(e),n.createPositionAt(t,"end"))),n.remove(e)}function Ae(e){const t=e.getChild(0);return 1==e.childCount&&t.is("element","paragraph")&&t.isEmpty}function Se(e,t,n,o){const i=parseInt(e.getAttribute(o)||"1");return Math.max(n,t+i)}class Ve extends e.Command{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.model,t=this.editor.plugins.get("TableUtils"),n=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(n),i=n[0].findAncestor("table"),s=[];for(let t=o.first;t<=o.last;t++)for(const n of i.getChild(t).getChildren())s.push(e.createRangeOn(n));e.change((e=>{e.setSelection(s)}))}}class Be extends e.Command{constructor(e){super(e),this.affectsData=!1}refresh(){const e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){const e=this.editor.plugins.get("TableUtils"),t=this.editor.model,n=e.getSelectionAffectedTableCells(t.document.selection),o=n[0],i=n.pop(),s=o.findAncestor("table"),l=e.getCellLocation(o),r=e.getCellLocation(i),a=Math.min(l.column,r.column),c=Math.max(l.column,r.column),d=[];for(const e of new U(s,{startColumn:a,endColumn:c}))d.push(t.createRangeOn(e.cell));t.change((e=>{e.setSelection(d)}))}}function Re(e){e.document.registerPostFixer((t=>function(e,t){const n=t.document.differ.getChanges();let o=!1;const i=new Set;for(const t of n){let n=null;"insert"==t.type&&"table"==t.name&&(n=t.position.nodeAfter),"insert"!=t.type&&"remove"!=t.type||"tableRow"!=t.name&&"tableCell"!=t.name||(n=t.position.findAncestor("table")),De(t)&&(n=t.range.start.findAncestor("table")),n&&!i.has(n)&&(o=Ie(n,e)||o,o=Le(n,e)||o,i.add(n))}return o}(t,e)))}function Ie(e,t){let n=!1;const o=function(e){const t=parseInt(e.getAttribute("headingRows")||"0"),n=Array.from(e.getChildren()).reduce(((e,t)=>t.is("element","tableRow")?e+1:e),0),o=[];for(const{row:i,cell:s,cellHeight:l}of new U(e)){if(l<2)continue;const e=ie){const t=e-i;o.push({cell:s,rowspan:t})}}return o}(e);if(o.length){n=!0;for(const e of o)O("rowspan",e.rowspan,e.cell,t,1)}return n}function Le(e,t){let n=!1;const o=function(e){const t=new Array(e.childCount).fill(0);for(const{rowIndex:n}of new U(e,{includeAllSlots:!0}))t[n]++;return t}(e),i=[];for(const[t,n]of o.entries())!n&&e.getChild(t).is("element","tableRow")&&i.push(t);if(i.length){n=!0;for(const n of i.reverse())t.remove(e.getChild(n)),o.splice(n,1)}const s=o.filter(((t,n)=>e.getChild(n).is("element","tableRow"))),l=s[0];if(!s.every((e=>e===l))){const o=s.reduce(((e,t)=>t>e?t:e),0);for(const[i,l]of s.entries()){const s=o-l;if(s){for(let n=0;nfunction(e,t){const n=t.document.differ.getChanges();let o=!1;for(const t of n)"insert"==t.type&&"table"==t.name&&(o=Pe(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableRow"==t.name&&(o=Fe(t.position.nodeAfter,e)||o),"insert"==t.type&&"tableCell"==t.name&&(o=Me(t.position.nodeAfter,e)||o),"remove"!=t.type&&"insert"!=t.type||!Oe(t)||(o=Me(t.position.parent,e)||o);return o}(t,e)))}function Pe(e,t){let n=!1;for(const o of e.getChildren())o.is("element","tableRow")&&(n=Fe(o,t)||n);return n}function Fe(e,t){let n=!1;for(const o of e.getChildren())n=Me(o,t)||n;return n}function Me(e,t){if(0==e.childCount)return t.insertElement("paragraph",e),!0;const n=Array.from(e.getChildren()).filter((e=>e.is("$text")));for(const e of n)t.wrap(t.createRangeOn(e),"paragraph");return!!n.length}function Oe(e){return!!e.position.parent.is("element","tableCell")&&("insert"==e.type&&"$text"==e.name||"remove"==e.type)}function qe(e,t){if(!e.is("element","paragraph"))return!1;const n=t.toViewElement(e);return!!n&&Y(e)!==n.is("element","span")}var Ne=n("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),je=n.n(Ne),ze=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css"),We={insert:"head",singleton:!1};je()(ze.Z,We);ze.Z.locals;class Ue extends e.Plugin{static get pluginName(){return"TableEditing"}static get requires(){return[ve]}constructor(e){super(e),this._additionalSlots=[]}init(){const e=this.editor,t=e.model,n=t.schema,o=e.conversion,i=e.plugins.get(ve);n.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns"]}),n.register("tableRow",{allowIn:"table",isLimit:!0}),n.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add((e=>{e.on("element:figure",((e,t,n)=>{if(!n.consumable.test(t.viewItem,{name:!0,classes:"table"}))return;const o=function(e){for(const t of e.getChildren())if(t.is("element","table"))return t}(t.viewItem);if(!o||!n.consumable.test(o,{name:!0}))return;n.consumable.consume(t.viewItem,{name:!0,classes:"table"});const i=n.convertItem(o,t.modelCursor),s=(0,w.first)(i.modelRange.getItems());s?(n.convertChildren(t.viewItem,n.writer.createPositionAt(s,"end")),n.updateConversionResult(s,t)):n.consumable.revert(t.viewItem,{name:!0,classes:"table"})}))})),o.for("upcast").add(j()),o.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:K(i,{asWidget:!0,additionalSlots:this._additionalSlots})}),o.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows"]},view:K(i,{additionalSlots:this._additionalSlots})}),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add((e=>{e.on("element:tr",((e,t)=>{t.viewItem.isEmpty&&0==t.modelCursor.index&&e.stop()}),{priority:"high"})})),o.for("downcast").elementToElement({model:"tableRow",view:(e,{writer:t})=>e.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(z("td")),o.for("upcast").add(z("th")),o.for("editingDowncast").elementToElement({model:"tableCell",view:$({asWidget:!0})}),o.for("dataDowncast").elementToElement({model:"tableCell",view:$()}),o.for("editingDowncast").elementToElement({model:"paragraph",view:Z({asWidget:!0}),converterPriority:"high"}),o.for("dataDowncast").elementToElement({model:"paragraph",view:Z(),converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:Ge("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:Ge("rowspan")},view:"rowspan"}),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.commands.add("insertTable",new Q(e)),e.commands.add("insertTableRowAbove",new X(e,{order:"above"})),e.commands.add("insertTableRowBelow",new X(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new J(e,{order:"left"})),e.commands.add("insertTableColumnRight",new J(e,{order:"right"})),e.commands.add("removeTableRow",new ge(e)),e.commands.add("removeTableColumn",new pe(e)),e.commands.add("splitTableCellVertically",new ee(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new ee(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new xe(e)),e.commands.add("mergeTableCellRight",new he(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new he(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new he(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new he(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new be(e)),e.commands.add("setTableRowHeader",new we(e)),e.commands.add("selectTableRow",new Ve(e)),e.commands.add("selectTableColumn",new Be(e)),Re(t),He(t),this.listenTo(t.document,"change:data",(()=>{!function(e,t){const n=e.document.differ;for(const e of n.getChanges()){let n,o=!1;if("attribute"==e.type){const t=e.range.start.nodeAfter;if(!t||!t.is("element","table"))continue;if("headingRows"!=e.attributeKey&&"headingColumns"!=e.attributeKey)continue;n=t,o="headingRows"==e.attributeKey}else"tableRow"!=e.name&&"tableCell"!=e.name||(n=e.position.findAncestor("table"),o="tableRow"==e.name);if(!n)continue;const i=n.getAttribute("headingRows")||0,s=n.getAttribute("headingColumns")||0,l=new U(n);for(const e of l){const n=e.rowqe(e,t.mapper)));for(const e of n)t.reconvertItem(e)}}(t,e.editing)}))}registerAdditionalSlot(e){this._additionalSlots.push(e)}}function Ge(e){return t=>{const n=parseInt(t.getAttribute(e));return Number.isNaN(n)||n<=0?null:n}}var Ke=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css"),$e={insert:"head",singleton:!1};je()(Ke.Z,$e);Ke.Z.locals;class Ze extends s.View{constructor(e){super(e);const t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new w.KeystrokeHandler,this.focusTracker=new w.FocusTracker,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",((e,t)=>`${t} × ${e}`)),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to((e=>{e.preventDefault()})),click:t.to((()=>{this.fire("execute")}))}}),this.on("boxover",((e,t)=>{const{row:n,column:o}=t.target.dataset;this.items.get(10*(parseInt(n,10)-1)+(parseInt(o,10)-1)).focus()})),this.focusTracker.on("change:focusedElement",((e,t,n)=>{if(!n)return;const{row:o,column:i}=n.dataset;this.set({rows:parseInt(o),columns:parseInt(i)})})),this.on("change:columns",(()=>this._highlightGridBoxes())),this.on("change:rows",(()=>this._highlightGridBoxes()))}render(){super.render(),(0,s.addKeyboardHandlingForGrid)({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(const e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){const e=this.rows,t=this.columns;this.items.map(((n,o)=>{const i=Math.floor(o/10){const o=e.commands.get("insertTable"),i=(0,s.createDropdown)(n);let l;return i.bind("isEnabled").to(o),i.buttonView.set({icon:'',label:t("Insert table"),tooltip:!0}),i.on("change:isOpen",(()=>{l||(l=new Ze(n),i.panelView.children.add(l),l.delegate("execute").to(i),i.on("execute",(()=>{e.execute("insertTable",{rows:l.rows,columns:l.columns}),e.editing.view.focus()})))})),i})),e.ui.componentFactory.add("tableColumn",(e=>{const o=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:n?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:n?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),'',o,e)})),e.ui.componentFactory.add("tableRow",(e=>{const n=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}];return this._prepareDropdown(t("Row"),'',n,e)})),e.ui.componentFactory.add("mergeTableCells",(e=>{const o=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:n?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:n?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),'',o,e)}))}_prepareDropdown(e,t,n,o){const i=this.editor,l=(0,s.createDropdown)(o),r=this._fillDropdownWithListOptions(l,n);return l.buttonView.set({label:e,icon:t,tooltip:!0}),l.bind("isEnabled").toMany(r,"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(l,"execute",(e=>{i.execute(e.source.commandName),e.source instanceof s.SwitchButtonView||i.editing.view.focus()})),l}_prepareMergeSplitButtonDropdown(e,t,n,o){const i=this.editor,l=(0,s.createDropdown)(o,s.SplitButtonView),r="mergeTableCells",a=i.commands.get(r),c=this._fillDropdownWithListOptions(l,n);return l.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),l.bind("isEnabled").toMany([a,...c],"isEnabled",((...e)=>e.some((e=>e)))),this.listenTo(l.buttonView,"execute",(()=>{i.execute(r),i.editing.view.focus()})),this.listenTo(l,"execute",(e=>{i.execute(e.source.commandName),i.editing.view.focus()})),l}_fillDropdownWithListOptions(e,t){const n=this.editor,o=[],i=new w.Collection;for(const e of t)Qe(e,n,o,i);return(0,s.addListToDropdown)(e,i),o}}function Qe(e,t,n,o){if("button"===e.type||"switchbutton"===e.type){const o=e.model=new s.Model(e.model),{commandName:i,bindIsOn:l}=e.model,r=t.commands.get(i);n.push(r),o.set({commandName:i}),o.bind("isEnabled").to(r),l&&o.bind("isOn").to(r,"value"),o.set({withText:!0})}o.add(e)}var Xe=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css"),Je={insert:"head",singleton:!1};je()(Xe.Z,Je);Xe.Z.locals;class et extends e.Plugin{static get pluginName(){return"TableSelection"}static get requires(){return[ve,ve]}init(){const e=this.editor,t=e.model,n=e.editing.view;this.listenTo(t,"deleteContent",((e,t)=>this._handleDeleteContent(e,t)),{priority:"high"}),this.listenTo(n.document,"insertText",((e,t)=>this._handleInsertTextEvent(e,t)),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const e=this.editor.plugins.get(ve),t=this.editor.model.document.selection,n=e.getSelectedTableCells(t);return 0==n.length?null:n}getSelectionAsFragment(){const e=this.editor.plugins.get(ve),t=this.getSelectedTableCells();return t?this.editor.model.change((n=>{const o=n.createDocumentFragment(),{first:i,last:s}=e.getColumnIndexes(t),{first:l,last:r}=e.getRowIndexes(t),a=t[0].findAncestor("table");let c=r,d=s;if(e.isSelectionRectangular(t)){const e={firstColumn:i,lastColumn:s,firstRow:l,lastRow:r};c=de(a,e),d=ue(a,e)}const u=te(a,{startRow:l,startColumn:i,endRow:c,endColumn:d},n);return n.insert(u,o,0),o})):null}setCellSelection(e,t){const n=this._getCellsToSelect(e,t);this.editor.model.change((e=>{e.setSelection(n.cells.map((t=>e.createRangeOn(t))),{backward:n.backward})}))}getFocusCell(){const e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){const e=this.editor.model.document.selection,t=(0,w.first)(e.getRanges()).getContainedElement();return t&&t.is("element","tableCell")?t:null}_defineSelectionConverter(){const e=this.editor,t=new Set;e.conversion.for("editingDowncast").add((e=>e.on("selection",((e,n,o)=>{const i=o.writer;!function(e){for(const n of t)e.removeClass("ck-editor__editable_selected",n);t.clear()}(i);const s=this.getSelectedTableCells();if(!s)return;for(const e of s){const n=o.mapper.toViewElement(e);i.addClass("ck-editor__editable_selected",n),t.add(n)}const l=o.mapper.toViewElement(s[s.length-1]);i.setSelection(l,0)}),{priority:"lowest"})))}_enablePluginDisabling(){const e=this.editor;this.on("change:isEnabled",(()=>{if(!this.isEnabled){const t=this.getSelectedTableCells();if(!t)return;e.model.change((n=>{const o=n.createPositionAt(t[0],0),i=e.model.schema.getNearestSelectionRange(o);n.setSelection(i)}))}}))}_handleDeleteContent(e,t){const n=this.editor.plugins.get(ve),o=t[0],i=t[1],s=this.editor.model,l=!i||"backward"==i.direction,r=n.getSelectedTableCells(o);r.length&&(e.stop(),s.change((e=>{const t=r[l?r.length-1:0];s.change((e=>{for(const t of r)s.deleteContent(e.createSelection(t,"in"))}));const n=s.schema.getNearestSelectionRange(e.createPositionAt(t,0));o.is("documentSelection")?e.setSelection(n):o.setTo(n)})))}_handleInsertTextEvent(e,t){const n=this.editor,o=this.getSelectedTableCells();if(!o)return;const i=n.editing.view,s=n.editing.mapper,l=o.map((e=>i.createRangeOn(s.toViewElement(e))));t.selection=i.createSelection(l)}_getCellsToSelect(e,t){const n=this.editor.plugins.get("TableUtils"),o=n.getCellLocation(e),i=n.getCellLocation(t),s=Math.min(o.row,i.row),l=Math.max(o.row,i.row),r=Math.min(o.column,i.column),a=Math.max(o.column,i.column),c=new Array(l-s+1).fill(null).map((()=>[])),d={startRow:s,endRow:l,startColumn:r,endColumn:a};for(const{row:t,cell:n}of new U(e.findAncestor("table"),d))c[t-s].push(n);const u=i.rowe.reverse())),{cells:c.flat(),backward:u||h}}}class tt extends e.Plugin{static get pluginName(){return"TableClipboard"}static get requires(){return[et,ve]}init(){const e=this.editor,t=e.editing.view.document;this.listenTo(t,"copy",((e,t)=>this._onCopyCut(e,t))),this.listenTo(t,"cut",((e,t)=>this._onCopyCut(e,t))),this.listenTo(e.model,"insertContent",((e,[t,n])=>this._onInsertContent(e,t,n)),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(e,t){const n=this.editor.plugins.get(et);if(!n.getSelectedTableCells())return;if("cut"==e.name&&!this.editor.model.canEditAt(this.editor.model.document.selection))return;t.preventDefault(),e.stop();const o=this.editor.data,i=this.editor.editing.view.document,s=o.toView(n.getSelectionAsFragment());i.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:s,method:e.name})}_onInsertContent(e,t,n){if(n&&!n.is("documentSelection"))return;const o=this.editor.model,i=this.editor.plugins.get(ve);let s=this.getTableIfOnlyTableInContent(t,o);if(!s)return;const l=i.getSelectionAffectedTableCells(o.document.selection);l.length?(e.stop(),o.change((e=>{const t={width:i.getColumns(s),height:i.getRows(s)},n=function(e,t,n,o){const i=e[0].findAncestor("table"),s=o.getColumnIndexes(e),l=o.getRowIndexes(e),r={firstColumn:s.first,lastColumn:s.last,firstRow:l.first,lastRow:l.last},a=1===e.length;a&&(r.lastRow+=t.height-1,r.lastColumn+=t.width-1,function(e,t,n,o){const i=o.getColumns(e),s=o.getRows(e);n>i&&o.insertColumns(e,{at:i,columns:n-i});t>s&&o.insertRows(e,{at:s,rows:t-s})}(i,r.lastRow+1,r.lastColumn+1,o));a||!o.isSelectionRectangular(e)?function(e,t,n){const{firstRow:o,lastRow:i,firstColumn:s,lastColumn:l}=t,r={first:o,last:i},a={first:s,last:l};ot(e,s,r,n),ot(e,l+1,r,n),nt(e,o,a,n),nt(e,i+1,a,n,o)}(i,r,n):(r.lastRow=de(i,r),r.lastColumn=ue(i,r));return r}(l,t,e,i),o=n.lastRow-n.firstRow+1,r=n.lastColumn-n.firstColumn+1,a={startRow:0,startColumn:0,endRow:Math.min(o,t.height)-1,endColumn:Math.min(r,t.width)-1};s=te(s,a,e);const c=l[0].findAncestor("table"),d=this._replaceSelectedCellsWithPasted(s,t,c,n,e);if(this.editor.plugins.get("TableSelection").isEnabled){const t=i.sortRanges(d.map((t=>e.createRangeOn(t))));e.setSelection(t)}else e.setSelection(d[0],0)}))):ce(s,i)}_replaceSelectedCellsWithPasted(e,t,n,o,i){const{width:s,height:l}=t,r=function(e,t,n){const o=new Array(n).fill(null).map((()=>new Array(t).fill(null)));for(const{column:t,row:n,cell:i}of new U(e))o[n][t]=i;return o}(e,s,l),a=[...new U(n,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})],c=[];let d;for(const e of a){const{row:t,column:n}=e;n===o.firstColumn&&(d=e.getPositionBefore());const a=t-o.firstRow,u=n-o.firstColumn,h=r[a%l][u%s],m=h?i.cloneElement(h):null,g=this._replaceTableSlotCell(e,m,d,i);g&&(le(g,t,n,o.lastRow,o.lastColumn,i),c.push(g),d=i.createPositionAfter(g))}const u=parseInt(n.getAttribute("headingRows")||"0"),h=parseInt(n.getAttribute("headingColumns")||"0"),m=o.firstRowit(e,t,n))).map((({cell:e})=>oe(e,t,o)))}function ot(e,t,n,o){if(t<1)return;return ie(e,t).filter((({row:e,cellHeight:t})=>it(e,t,n))).map((({cell:e,column:n})=>se(e,n,t,o)))}function it(e,t,n){const o=e+t-1,{first:i,last:s}=n;return e>=i&&e<=s||e=i}class st extends e.Plugin{static get pluginName(){return"TableKeyboard"}static get requires(){return[et,ve]}init(){const e=this.editor.editing.view.document;this.listenTo(e,"arrowKey",((...e)=>this._onArrowKey(...e)),{context:"table"}),this.listenTo(e,"tab",((...e)=>this._handleTabOnSelectedTable(...e)),{context:"figure"}),this.listenTo(e,"tab",((...e)=>this._handleTab(...e)),{context:["th","td"]})}_handleTabOnSelectedTable(e,t){const n=this.editor,o=n.model.document.selection.getSelectedElement();o&&o.is("element","table")&&(t.preventDefault(),t.stopPropagation(),e.stop(),n.model.change((e=>{e.setSelection(e.createRangeIn(o.getChild(0).getChild(0)))})))}_handleTab(e,t){const n=this.editor,o=this.editor.plugins.get(ve),i=this.editor.plugins.get("TableSelection"),s=n.model.document.selection,l=!t.shiftKey;let r=o.getTableCellsContainingSelection(s)[0];if(r||(r=i.getFocusCell()),!r)return;t.preventDefault(),t.stopPropagation(),e.stop();const a=r.parent,c=a.parent,d=c.getChildIndex(a),u=a.getChildIndex(r),h=0===u;if(!l&&h&&0===d)return void n.model.change((e=>{e.setSelection(e.createRangeOn(c))}));const m=u===a.childCount-1,g=d===o.getRows(c)-1;if(l&&g&&m&&(n.execute("insertTableRowBelow"),d===o.getRows(c)-1))return void n.model.change((e=>{e.setSelection(e.createRangeOn(c))}));let p;if(l&&m){const e=c.getChild(d+1);p=e.getChild(0)}else if(!l&&h){const e=c.getChild(d-1);p=e.getChild(e.childCount-1)}else p=a.getChild(u+(l?1:-1));n.model.change((e=>{e.setSelection(e.createRangeIn(p))}))}_onArrowKey(e,t){const n=this.editor,o=t.keyCode,i=(0,w.getLocalizedArrowKeyCodeDirection)(o,n.locale.contentLanguageDirection);this._handleArrowKeys(i,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){const n=this.editor.plugins.get(ve),o=this.editor.plugins.get("TableSelection"),i=this.editor.model,s=i.document.selection,l=["right","down"].includes(e),r=n.getSelectedTableCells(s);if(r.length){let n;return n=t?o.getFocusCell():l?r[r.length-1]:r[0],this._navigateFromCellInDirection(n,e,t),!0}const a=s.focus.findAncestor("tableCell");if(!a)return!1;if(!s.isCollapsed)if(t){if(s.isBackward==l&&!s.containsEntireContent(a))return!1}else{const e=s.getSelectedElement();if(!e||!i.schema.isObject(e))return!1}return!!this._isSelectionAtCellEdge(s,a,l)&&(this._navigateFromCellInDirection(a,e,t),!0)}_isSelectionAtCellEdge(e,t,n){const o=this.editor.model,i=this.editor.model.schema,s=n?e.getLastPosition():e.getFirstPosition();if(!i.getLimitElement(s).is("element","tableCell")){return o.createPositionAt(t,n?"end":0).isTouching(s)}const l=o.createSelection(s);return o.modifySelection(l,{direction:n?"forward":"backward"}),s.isEqual(l.focus)}_navigateFromCellInDirection(e,t,n=!1){const o=this.editor.model,i=e.findAncestor("table"),s=[...new U(i,{includeAllSlots:!0})],{row:l,column:r}=s[s.length-1],a=s.find((({cell:t})=>t==e));let{row:c,column:d}=a;switch(t){case"left":d--;break;case"up":c--;break;case"right":d+=a.cellWidth;break;case"down":c+=a.cellHeight}if(c<0||c>l||d<0&&c<=0||d>r&&c>=l)return void o.change((e=>{e.setSelection(e.createRangeOn(i))}));d<0?(d=n?0:r,c--):d>r&&(d=n?r:0,c++);const u=s.find((e=>e.row==c&&e.column==d)).cell,h=["right","down"].includes(t),m=this.editor.plugins.get("TableSelection");if(n&&m.isEnabled){const t=m.getAnchorCell()||e;m.setCellSelection(t,u)}else{const e=o.createPositionAt(u,h?0:"end");o.change((t=>{t.setSelection(e)}))}}}var lt=n("ckeditor5/src/engine.js");class rt extends lt.DomEventObserver{constructor(){super(...arguments),this.domEventType=["mousemove","mouseleave"]}onDomEvent(e){this.fire(e.type,e)}}class at extends e.Plugin{static get pluginName(){return"TableMouse"}static get requires(){return[et,ve]}init(){this.editor.editing.view.addObserver(rt),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const e=this.editor,t=e.plugins.get(ve);let n=!1;const o=e.plugins.get(et);this.listenTo(e.editing.view.document,"mousedown",((i,s)=>{const l=e.model.document.selection;if(!this.isEnabled||!o.isEnabled)return;if(!s.domEvent.shiftKey)return;const r=o.getAnchorCell()||t.getTableCellsContainingSelection(l)[0];if(!r)return;const a=this._getModelTableCellFromDomEvent(s);a&&ct(r,a)&&(n=!0,o.setCellSelection(r,a),s.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{n=!1})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{n&&e.stop()}),{priority:"highest"})}_enableMouseDragSelection(){const e=this.editor;let t,n,o=!1,i=!1;const s=e.plugins.get(et);this.listenTo(e.editing.view.document,"mousedown",((e,n)=>{this.isEnabled&&s.isEnabled&&(n.domEvent.shiftKey||n.domEvent.ctrlKey||n.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(n)))})),this.listenTo(e.editing.view.document,"mousemove",((e,l)=>{if(!l.domEvent.buttons)return;if(!t)return;const r=this._getModelTableCellFromDomEvent(l);r&&ct(t,r)&&(n=r,o||n==t||(o=!0)),o&&(i=!0,s.setCellSelection(t,n),l.preventDefault())})),this.listenTo(e.editing.view.document,"mouseup",(()=>{o=!1,i=!1,t=null,n=null})),this.listenTo(e.editing.view.document,"selectionChange",(e=>{i&&e.stop()}),{priority:"highest"})}_getModelTableCellFromDomEvent(e){const t=e.target,n=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(n).parent.findAncestor("tableCell",{includeSelf:!0})}}function ct(e,t){return e.parent.parent==t.parent.parent}var dt=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/table.css"),ut={insert:"head",singleton:!1};je()(dt.Z,ut);dt.Z.locals;class ht extends e.Plugin{static get requires(){return[Ue,Ye,et,at,st,tt,t.Widget]}static get pluginName(){return"Table"}}class mt extends e.Plugin{static get pluginName(){return"PlainTableOutput"}static get requires(){return[ht]}init(){const e=this.editor;e.conversion.for("dataDowncast").elementToStructure({model:"table",view:gt,converterPriority:"high"}),e.plugins.has("TableCaption")&&e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>{if("table"===e.parent.name)return t.createContainerElement("caption")},converterPriority:"high"}),e.plugins.has("TableProperties")&&function(e){const t={"border-width":"tableBorderWidth","border-color":"tableBorderColor","border-style":"tableBorderStyle","background-color":"tableBackgroundColor"};for(const[n,o]of Object.entries(t))e.conversion.for("dataDowncast").add((e=>e.on(`attribute:${o}:table`,((e,t,o)=>{const{item:i,attributeNewValue:s}=t,{mapper:l,writer:r}=o;if(!o.consumable.consume(i,e.name))return;const a=l.toViewElement(i);s?r.setStyle(n,s,a):r.removeStyle(n,a)}),{priority:"high"})))}(e)}}function gt(e,{writer:t}){const n=e.getAttribute("headingRows")||0,o=t.createSlot((e=>e.is("element","tableRow")&&e.indexe.is("element","tableRow")&&e.index>=n)),s=t.createSlot((e=>!e.is("element","tableRow"))),l=t.createContainerElement("thead",null,o),r=t.createContainerElement("tbody",null,i),a=[];return n&&a.push(l),n1)return{target:()=>function(e,t){const n=t.editing.mapper,o=t.editing.view.domConverter,i=Array.from(e).map((e=>{const t=Dt(e.start),i=n.toViewElement(t);return new w.Rect(o.mapViewToDom(i))}));return w.Rect.getBoundingRect(i)}(o.getRanges(),e),positions:Rt};const i=Dt(o.getFirstPosition()),s=t.toViewElement(i);return{target:n.mapViewToDom(s),positions:Rt}}function Dt(e){return e.nodeAfter&&e.nodeAfter.is("element","tableCell")?e.nodeAfter:e.findAncestor("tableCell")}class Ht extends e.Command{constructor(e,t,n){super(e),this.attributeName=t,this._defaultValue=n}refresh(){const e=this.editor,t=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e.model.document.selection);this.isEnabled=!!t.length,this.value=this._getSingleValue(t)}execute(e={}){const{value:t,batch:n}=e,o=this.editor.model,i=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(o.document.selection),s=this._getValueToSet(t);o.enqueueChange(n,(e=>{s?i.forEach((t=>e.setAttribute(this.attributeName,s,t))):i.forEach((t=>e.removeAttribute(this.attributeName,t)))}))}_getAttribute(e){if(!e)return;const t=e.getAttribute(this.attributeName);return t!==this._defaultValue?t:void 0}_getValueToSet(e){if(e!==this._defaultValue)return e}_getSingleValue(e){const t=this._getAttribute(e[0]);return e.every((e=>this._getAttribute(e)===t))?t:void 0}}var Pt=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css"),Ft={insert:"head",singleton:!1};je()(Pt.Z,Ft);Pt.Z.locals,e.icons.objectLeft,e.icons.objectCenter,e.icons.objectRight;function Mt(e){e.document.registerPostFixer((t=>function(e,t){const n=t.document.differ.getChanges();let o=!1;for(const t of n){if("insert"!=t.type)continue;const n=t.position.parent;if(n.is("element","table")||"table"==t.name){const i="table"==t.name?t.position.nodeAfter:n,s=Array.from(i.getChildren()).filter((e=>e.is("element","caption"))),l=s.shift();if(!l)continue;for(const t of s)e.move(e.createRangeIn(t),l,"end"),e.remove(t);l.nextSibling&&(e.move(e.createRangeOn(l),i,"end"),o=!0),o=!!s.length||o}}return o}(t,e)))}function Ot(e){return!!e&&e.is("element","table")}function qt(e){for(const t of e.getChildren())if(t.is("element","caption"))return t;return null}function Nt(e){const t=e.parent;return"figcaption"==e.name&&t&&t.is("element","figure")&&t.hasClass("table")||"caption"==e.name&&t&&t.is("element","table")?{name:!0}:null}function jt(e){const t=e.getSelectedElement();return t&&t.is("element","table")?t:e.getFirstPosition().findAncestor("table")}class zt extends e.Command{refresh(){const e=jt(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?this.value=!!qt(e):this.value=!1}execute({focusCaptionOnShow:e=!1}={}){this.editor.model.change((t=>{this.value?this._hideTableCaption(t):this._showTableCaption(t,e)}))}_showTableCaption(e,t){const n=this.editor.model,o=jt(n.document.selection),i=this.editor.plugins.get("TableCaptionEditing")._getSavedCaption(o)||e.createElement("caption");n.insertContent(i,o,"end"),t&&e.setSelection(i,"in")}_hideTableCaption(e){const t=this.editor.model,n=jt(t.document.selection),o=this.editor.plugins.get("TableCaptionEditing"),i=qt(n);o._saveCaption(n,i),t.deleteContent(e.createSelection(i,"on"))}}class Wt extends e.Plugin{static get pluginName(){return"TableCaptionEditing"}constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){const e=this.editor,n=e.model.schema,o=e.editing.view,i=e.t;n.isRegistered("caption")?n.extend("caption",{allowIn:"table"}):n.register("caption",{allowIn:"table",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleTableCaption",new zt(this.editor)),e.conversion.for("upcast").elementToElement({view:Nt,model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(e,{writer:t})=>Ot(e.parent)?t.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(e,{writer:n})=>{if(!Ot(e.parent))return null;const s=n.createEditableElement("figcaption");return n.setCustomProperty("tableCaption",!0,s),s.placeholder=i("Enter table caption"),(0,lt.enablePlaceholder)({view:o,element:s,keepOnFocus:!0}),(0,t.toWidgetEditable)(s,n)}}),Mt(e.model)}_getSavedCaption(e){const t=this._savedCaptionsMap.get(e);return t?lt.Element.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}}class Ut extends e.Plugin{static get pluginName(){return"TableCaptionUI"}init(){const t=this.editor,n=t.editing.view,o=t.t;t.ui.componentFactory.add("toggleTableCaption",(i=>{const l=t.commands.get("toggleTableCaption"),r=new s.ButtonView(i);return r.set({icon:e.icons.caption,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(l,"value","isEnabled"),r.bind("label").to(l,"value",(e=>o(e?"Toggle caption off":"Toggle caption on"))),this.listenTo(r,"execute",(()=>{if(t.execute("toggleTableCaption",{focusCaptionOnShow:!0}),l.value){const e=function(e){const t=jt(e);return t?qt(t):null}(t.model.document.selection),o=t.editing.mapper.toViewElement(e);if(!o)return;n.scrollToTheSelection(),n.change((e=>{e.addClass("table__caption_highlighted",o)}))}t.editing.view.focus()})),r}))}}var Gt=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css"),Kt={insert:"head",singleton:!1};je()(Gt.Z,Kt);Gt.Z.locals;class $t extends e.Plugin{static get pluginName(){return"TableCaption"}static get requires(){return[Wt,Ut]}}var Zt=n("./node_modules/css-loader/dist/cjs.js!./node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css"),Yt={insert:"head",singleton:!1};je()(Zt.Z,Yt);Zt.Z.locals;class Qt extends s.View{constructor(t,n){super(t);const o=t.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.classSelect=c(o("Cell WS properties"),this._getPropertiesOptions(o),t),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",t),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",t),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form"],tabindex:"-1"},children:[a(this.classSelect),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}_getPropertiesOptions(e){return[{value:"td",title:e("Data")},{value:"th",title:e("Header")},{value:"indent",title:e("Padded header")},{value:"normal",title:e("Normal text header")}]}render(){super.render(),(0,s.submitHandler)({view:this});[this.classSelect.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get classselect(){return this.classSelect.children[1].value}set classselect(e){this.classSelect.children[1].value=e}setValues(e){this.classselect=e?.classselect}isValid(){return!0}}const Xt={tableCellWsClass:"tableCellWsClass"};class Jt extends e.Plugin{static get requires(){return[s.ContextualBalloon]}static get pluginName(){return"TableCellWsPropertiesUI"}constructor(e){super(e),e.config.define("table.tableCellWsProperties",{borderColors:Ct,backgroundColors:Ct})}init(){const e=this.editor,t=e.t;this._balloon=e.plugins.get(s.ContextualBalloon),this.view=null,this._isReady=!1,e.ui.componentFactory.add("tableCellWsProperties",(n=>{const o=new s.ButtonView(n);o.set({label:t("Cell Ws properties"),icon:'',tooltip:!0}),this.listenTo(o,"execute",(()=>this._showView()));const i=Object.values(Xt).map((t=>e.commands.get(t)));return o.bind("isEnabled").toMany(i,"isEnabled",((...e)=>e.some((e=>e)))),o}))}_createPropertiesView(){const e=this.editor,t=(e.config.get("table.tableCellWsProperties"),new Qt(e.locale,{}));e.t;return this.listenTo(t,"submit",(()=>{this.editor.execute("tableCellWsClass",{value:t.classselect}),this._hideView()})),this.listenTo(t,"cancel",(()=>{this._undoStepBatch.operations.length&&e.execute("undo",this._undoStepBatch),this._hideView()})),t.keystrokes.set("Esc",((e,t)=>{this._hideView(),t()})),(0,s.clickOutsideHandler)({emitter:t,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()}),t}_showView(){const e=this.editor;this.view||(this.view=this._createPropertiesView()),this.listenTo(e.ui,"update",(()=>{this._updateView()}));let t=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());t&&t.parent&&(t=t.parent,this.view.classselect=t.getAttribute("cellType")),this._balloon.add({view:this.view,position:Lt(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){const e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){const e=this.editor;wt(e.editing.view.document.selection)?this._isViewVisible&&It(e,"cell"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}}class en extends Ht{constructor(e){super(e)}refresh(){let e=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=e,e&&e.parent&&(e=e.parent,this.value=Object.fromEntries(e.getAttributes()))}execute({value:e}){const{model:t}=this.editor;t.change((t=>{let n=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());n&&n.parent&&(n=n.parent,t.setAttribute("cellType",e,n))}))}}class tn extends e.Plugin{static get pluginName(){return"TableCellWsPropertiesEditing"}static get requires(){return[Ue]}init(){const e=this.editor,t=e.conversion;e.commands.add("tableCellWsClass",new en(e)),function(e){e.for("upcast").elementToElement({view:{name:/^(td|th)$/},model:(e,{writer:t})=>{const n=Array.from(e._classes);return n.includes("normal")?t.createElement("tableCell",{cellType:"normal"}):n.includes("indent")?t.createElement("tableCell",{cellType:"indent"}):t.createElement("tableCell",{cellType:e.name})},converterPriority:"high"}),e.for("editingDowncast").elementToElement({model:{name:"tableCell",attributes:["cellType"]},view:(e,{writer:t})=>{switch(e.getAttribute("cellType")){case"th":return t.createEditableElement("th",{contenteditable:"true",class:"ck-editor__editable ck-editor__nested-editable",role:"textbox"},[]);case"td":return t.createEditableElement("td",{contenteditable:"true",class:"ck-editor__editable ck-editor__nested-editable",role:"textbox"},[]);case"indent":case"normal":return t.createEditableElement("th",{contenteditable:"true",class:"ck-editor__editable ck-editor__nested-editable "+e.getAttribute("cellType"),role:"textbox"},[])}},converterPriority:"high"}),e.for("dataDowncast").elementToElement({model:{name:"tableCell",attributes:["cellType"]},view:(e,{writer:t})=>{switch(e.getAttribute("cellType")){case"th":return t.createContainerElement("th",{});case"td":return t.createContainerElement("td",{});case"indent":case"normal":return t.createContainerElement("th",{class:e.getAttribute("cellType")})}},converterPriority:"high"})}(t)}}class nn extends e.Plugin{static get pluginName(){return"TableCellWsProperties"}static get requires(){return[tn,Jt]}}class on extends e.Command{execute({rows:e,cols:t,headers:n,tabletype:o,caption:i}){const{model:s}=this.editor,l=this.editor.plugins.get("TableUtils"),r="both"===n||"row"===n?1:0,a="both"===n||"column"===n?1:0;s.change((n=>{const c=l.createTable(n,{rows:e,columns:t,headingRows:r,headingColumns:a});s.insertObject(c,null,null,{findOptimalPosition:"auto"}),n.setSelection(n.createPositionAt(c.getNodeByPath([0]),0));const d=n.createRange(n.createPositionBefore(c),n.createPositionAfter(c)),u=n.createElement("websparkTable",{type:o});if(n.wrap(d,u),n.append(c,u),s.insertContent(u),i?.length){const e=n.createElement("caption");n.insertText(i,e,"end");const t=function(e){const t=e.getSelectedElement();if(t&&t.is("element","table"))return t;return e.getFirstPosition().findAncestor("table")}(s.document.selection);s.insertContent(e,t,"end")}}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkTable");this.isEnabled=null!==n}}class sn extends e.Plugin{static get requires(){return[ht,ve,ft,mt,$t,et,tt,at,st,t.Widget,nn]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkTable",new on(this.editor))}_defineSchema(){this.editor.model.schema.register("websparkTable",{isObject:!0,allowWhere:"$block",allowChildren:["table"],allowAttributes:["type"]})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({view:{name:"div",classes:["uds-table"],attribute:{type:!0}},model:(e,{writer:t})=>{const n=e.getAttribute("class").includes("-fixed")?"fixed":"default";return t.createElement("websparkTable",{type:n})}}),e.for("dataDowncast").elementToElement({model:"websparkTable",view:(e,{writer:t})=>{let n="uds-table";return"fixed"===e.getAttribute("type")&&(n+=" uds-table-fixed"),t.createContainerElement("div",{class:n})}}),e.for("editingDowncast").elementToElement({model:"websparkTable",view:(e,{writer:n})=>{const o=n.createContainerElement("div");return(0,t.toWidget)(o,n,{label:"Webspark Table"})}})}}class ln extends s.View{DEFAULT_ROWS="3";DEFAULT_COLS="2";DEFAULT_HEADER="none";DEFAULT_TYPE="default";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.textInputRowsView=d(o("Rows"),n),this.textInputColsView=d(o("Columns"),n),this.headersSelect=c(o("Headers"),this._getHeaderOptions(o),n),this.tabletypeSelect=c(o("Table Type"),this._getTableTypeOptions(o),n),this.textCaption=d(o("Caption"),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form"],tabindex:"-1"},children:[a(this.textInputRowsView),a(this.textInputColsView),a(this.headersSelect),a(this.tabletypeSelect),a(this.textCaption),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.textInputRowsView.children[1],this.textInputColsView.children[1],this.headersSelect.children[1],this.tabletypeSelect.children[1],this.textCaption.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get rows(){return this.textInputRowsView.children[1].element.value.trim()}set rows(e){this.textInputRowsView.children[1].element.value=e.trim()}get cols(){return this.textInputColsView.children[1].element.value.trim()}set cols(e){this.textInputColsView.children[1].element.value=e.trim()}get headers(){return this.headersSelect.children[1].value}set headers(e){this.headersSelect.children[1].value=e}get tabletype(){return this.tabletypeSelect.children[1].value}set tabletype(e){this.tabletypeSelect.children[1].value=e}set caption(e){this.textCaption.children[1].element.value=e.trim()}get caption(){return this.textCaption.children[1].element.value.trim()}setValues(e){this.rows=e?.rows||this.DEFAULT_ROWS,this.cols=e?.cols||this.DEFAULT_COLS,this.headers=e?.headers||this.DEFAULT_HEADER,this.tabletype=e?.tabletype||this.DEFAULT_TYPE,this.caption=e?.caption||""}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return t.includes("text")?this.textInputRowsView.errorText=t:t.includes("URL")&&(this.textInputColsView.errorText=t),!1}return!0}resetFormStatus(){this.textInputRowsView.errorText=null,this.textInputColsView.errorText=null}_getHeaderOptions(e){return[{value:"none",title:e("None")},{value:"row",title:e("First row")},{value:"column",title:e("First column")},{value:"both",title:e("Both")}]}_getTableTypeOptions(e){return[{value:"default",title:e("Default")},{value:"fixed",title:e("Fixed")}]}}class rn extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkTable");var n;this.form=new ln((n=e.t,[e=>e.rows.length?e.cols.length?void 0:n("The cols field must not be empty."):n("The rows field must not be empty.")]),e.locale,t),e.ui.componentFactory.add("websparkTable",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;this.editor.commands.get("insertTable");function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Webspark table"),icon:'\n\n\n\n\n\n\n\n',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.textInputRowsView.children[1].select(),t.focus()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkTable",{rows:t.rows,cols:t.cols,headers:t.headers,tabletype:t.tabletype,caption:t.caption}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class an extends e.Plugin{static get requires(){return[sn,rn]}}class cn extends e.Command{execute({spacingtop:e,spacingbottom:t,spacingleft:n,spacingright:o,roundedimage:i}){const{model:s}=this.editor;s.change((l=>{const r=s.document.selection.getSelectedElement();r&&(l.setAttribute("spacingTop",e,r),l.setAttribute("spacingBottom",t,r),l.setAttribute("spacingRight",o,r),l.setAttribute("spacingLeft",n,r),l.setAttribute("roundedImage",i,r))}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=["imageInline","imageBlock"].some((n=>e.schema.findAllowedParent(t.getFirstPosition(),n)));this.isEnabled=null!==n;const o=t.getSelectedElement();"imageBlock"===o?.name||"imageInline"===o?.name?(this.value=Object.fromEntries(o.getAttributes()),e.change((e=>{e.setAttribute("imageFluid",!0,o)}))):this.value=null}}class dn extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkAdvancedImage",new cn(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["spacingTop","spacingBottom","spacingLeft","spacingRight","roundedImage","imageFluid"]}),e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["spacingTop","spacingBottom","spacingLeft","spacingRight","roundedImage","imageFluid"]})}_defineConverters(){const{conversion:e}=this.editor;[{htmlName:"spacing-top",modelName:"spacingTop"},{htmlName:"spacing-bottom",modelName:"spacingBottom"},{htmlName:"spacing-right",modelName:"spacingRight"},{htmlName:"spacing-left",modelName:"spacingLeft"},{htmlName:"rounded-circle",modelName:"roundedImage"}].forEach((t=>{e.for("upcast").attributeToAttribute({view:{key:"class",value:new RegExp(t.htmlName+"+")},model:{key:t.modelName,value:e=>{let n=Array.from(e._classes).filter((e=>e.includes(t.htmlName)));return 0===n.length?"none":n[0]}}}),e.for("downcast").attributeToAttribute({model:{name:"imageBlock",key:t.modelName},view:e=>{if("none"!==e)return{key:"class",value:e}}}),e.for("downcast").attributeToAttribute({model:{name:"imageInline",key:t.modelName},view:e=>({key:"class",value:e})})})),e.for("downcast").attributeToAttribute({model:{name:"imageBlock",key:"imageFluid"},view:e=>({key:"class",value:"img-fluid"})}),e.for("downcast").attributeToAttribute({model:{name:"imageInline",key:"imageFluid"},view:e=>({key:"class",value:"img-fluid"})}),e.for("upcast").attributeToAttribute({view:{key:"class",value:"img-fluid"},model:{key:"imageFluid",value:e=>!0}})}}class un extends s.View{constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.spacingTopSelect=c(o("Spacing top"),this._getSpacingOptions(o,"top"),n),this.spacingBottomSelect=c(o("Spacing bottom"),this._getSpacingOptions(o,"bottom"),n),this.spacingLeftSelect=c(o("Spacing left"),this._getSpacingOptions(o,"left"),n),this.spacingRightSelect=c(o("Spacing right"),this._getSpacingOptions(o,"right"),n),this.roundedImage=c(o("Round image"),[{value:"none",title:o("No")},{value:"rounded-circle",title:o("Yes")}],n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form"],tabindex:"-1"},children:[a(this.spacingTopSelect),a(this.spacingBottomSelect),a(this.spacingLeftSelect),a(this.spacingRightSelect),a(this.roundedImage),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}_getSpacingOptions(e,t){return[{value:"none",title:e("None")},{value:`spacing-${t}-8`,title:e("8px")},{value:`spacing-${t}-16`,title:e("16px")},{value:`spacing-${t}-24`,title:e("24px")}]}render(){super.render(),(0,s.submitHandler)({view:this});[this.spacingTopSelect.children[1],this.spacingBottomSelect.children[1],this.spacingLeftSelect.children[1],this.spacingRightSelect.children[1],this.roundedImage.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get spacingtop(){return this.spacingTopSelect.children[1].value}set spacingtop(e){this.spacingTopSelect.children[1].value=e}get spacingbottom(){return this.spacingBottomSelect.children[1].value}set spacingbottom(e){this.spacingBottomSelect.children[1].value=e}get spacingright(){return this.spacingRightSelect.children[1].value}set spacingright(e){this.spacingRightSelect.children[1].value=e}get spacingleft(){return this.spacingLeftSelect.children[1].value}set spacingleft(e){this.spacingLeftSelect.children[1].value=e}get roundedimage(){return this.roundedImage.children[1].value}set roundedimage(e){this.roundedImage.children[1].value=e}setValues(e){this.spacingtop=e?.spacingTop,this.spacingbottom=e?.spacingBottom,this.spacingleft=e?.spacingLeft,this.spacingright=e?.spacingRight,this.roundedimage=e?.roundedImage}isValid(){return!0}}class hn extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkAdvancedImage");this.form=new un((e.t,[]),e.locale,t),e.ui.componentFactory.add("websparkAdvancedImage",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Image styles"),tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.focus()}),{priority:"low"}),e.on("submit",(()=>{o.execute("insertWebsparkAdvancedImage",{spacingtop:t.spacingtop,spacingbottom:t.spacingbottom,spacingright:t.spacingright,spacingleft:t.spacingleft,roundedimage:t.roundedimage}),l()})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class mn extends e.Plugin{static get requires(){return[dn,hn]}}class gn extends e.Command{refresh(){const e=this.editor.model.document.selection,t=this._getClosestSelectedDrupalMediaElement(e);this.isEnabled=!!t&&t.getAttribute("drupalMediaEntityType")&&"media"===t.getAttribute("drupalMediaEntityType")&&"METADATA_ERROR"!==t.getAttribute("drupalMediaEntityType")&&"remote_video"===t.getAttribute("drupalMediaType"),this.isEnabled&&this.editor.execute("addInlineStyle","w100")}execute(e){const{model:t}=this.editor,n=this._getClosestSelectedDrupalMediaElement(t.document.selection);t.change((t=>{t.setAttribute("dataInlineStyle",e,n)}))}_getClosestSelectedDrupalMediaElement(e){const t=e.getSelectedElement();return this._isDrupalMedia(t)?t:e.getFirstPosition().findAncestor("drupalMedia")}_isDrupalMedia(e){return!!e&&e.is("element","drupalMedia")}}class pn extends e.Plugin{static get pluginName(){return"WebsparkMediaAlterEditing"}constructor(e){super(e),this.attrs={dataInlineStyle:"data-inline-style"},this.converterAttributes=["dataInlineStyle"]}init(){const e=this.editor.model.schema,t=this.editor.conversion;e.isRegistered("drupalMedia")&&e.extend("drupalMedia",{allowAttributes:["dataInlineStyle"]}),Object.keys(this.attrs).forEach((e=>{const n={model:{key:e,name:"drupalMedia"},view:{key:"style",value:{width:"100%","max-width":"100%"}}};t.for("upcast").attributeToAttribute(n),t.for("downcast").attributeToAttribute(n)})),this.editor.commands.add("addInlineStyle",new gn(this.editor))}}class wn extends e.Plugin{static get requires(){return[pn]}}function bn(e,t,n){const o=e?e.getAttribute("listType"):"";if("forward"===n)for(;e&&e.getAttribute("listType")===o;)t.includes(e)||t.push(e),e=e.nextSibling;else for(;e&&e.getAttribute("listType")===o;)t.includes(e)||t.push(e),e=e.previousSibling}function fn(e){let t=(0,w.first)(e.document.selection.getSelectedBlocks());const n=[];e.change((e=>{bn(t,n,"backward"),bn(t,n,"forward"),n.forEach((t=>{"bulleted"===t.getAttribute("listType")?e.setAttribute("htmlUlAttributes",{classes:"uds-list"},t):"numbered"===t.getAttribute("listType")&&e.setAttribute("htmlOlAttributes",{classes:"uds-list"},t)}))}))}function kn(e,t){const n=t.commands.get("bulletedListOld").value?vn(t.t):t.commands.get("numberedListOld").value?[{value:"default-list",title:(o=t.t)("Default")},{value:"maroon",title:o("Maroon")},{value:"light-smokemode",title:o("Gray 1")},{value:"smokemode",title:o("Gray 2")},{value:"darkmode",title:o("Gray 7")},{value:"darkmode-gold",title:o("Gray 7 Gold")},{value:"stp-default",title:o("Step List Default")},{value:"stp-gold-counter",title:o("Step List Gold Counter")},{value:"stp-maroon-counter",title:o("Step List Maroon Counter")},{value:"stp-smokemode",title:o("Step List Gray 2")},{value:"stp-smokemode-gold",title:o("Step List Gray 2 Gold Counter")},{value:"stp-smokemode-maroon",title:o("Step List Gray 2 Maroon Counter")},{value:"stp-lightsmokemode",title:o("Step List Gray 1")},{value:"stp-lightsmokemode-gold",title:o("Step List Gray 1 Gold Counter")},{value:"stp-lightsmokemode-maroon",title:o("Step List Gray 1 Maroon Counter")},{value:"stp-darkmode",title:o("Step List Gray 7")},{value:"stp-darkmode-gold",title:o("Step List Gray 7 Gold Counter")}]:"";var o;if(!n)return;let i=(0,w.first)(t.model.document.selection.getSelectedBlocks());const s=[];let l=[],r="";bn(i,s,"backward"),bn(i,s,"forward"),s.forEach((e=>{if(0==e.getAttribute("listIndent"))try{"bulleted"===e.getAttribute("listType")?(l=e.getAttribute("htmlUlAttributes").classes,r=e.getAttribute("listType")):"numbered"===e.getAttribute("listType")&&(l=e.getAttribute("htmlOlAttributes").classes,r=e.getAttribute("listType"))}catch(e){}})),Array.isArray(l)||(l=l.split(" ")),e.classSelect.children[1].element.options.length=0,n.forEach((t=>{const n=document.createElement("option");n.value=t.value,n.text=t.title;let o=[];o="bulleted"===r?Cn(t.value).split(" "):Tn(t.value).split(" "),function(e,t){if(e.length!==t.length)return!1;const n=new Set(e),o=new Set(t);for(const e of n)if(!o.has(e))return!1;return!0}(o,l)&&(n.defaultSelected=!0),e.classSelect.children[1].element.appendChild(n)}))}function vn(e){return[{value:"default-list",title:e("Default")},{value:"maroon",title:e("Maroon")},{value:"light-smokemode",title:e("Gray 1")},{value:"smokemode",title:e("Gray 2")},{value:"darkmode",title:e("Gray 7")},{value:"darkmode-gold",title:e("Gray 7 Gold Bullet")},{value:"icn-default",title:e("Icon list")},{value:"icn-maroon",title:e("Icon list Maroon")},{value:"icn-darkmode",title:e("Icon list Gray 7")},{value:"icn-darkmode-gold",title:e("Icon list Gray 7 Gold")}]}function Cn(e){let t=e,n=_n(e);if(n=`wp-${e}`,t=t||"default-list",t.startsWith("icn"))switch(n+=" uds-list fa-ul fa-li",t){case"icn-maroon":n=yn(n,["darkmode","gold"]),n+=" maroon";break;case"icn-darkmode":n=yn(n,["gold","maroon"]),n+=" darkmode";break;case"icn-darkmode-gold":n=yn(n,["maroon"]),n+=" darkmode gold"}else{if(n=yn(n,["fa-ul"]),t){const e=["default-list","maroon","light-smokemode","smokemode","darkmode"];for(const o of e)n.includes(o)&&t!==o&&(n=n.replace(o,""));n.includes("darkmode")&&n.includes("gold")&&"darkmode-gold"!=t&&(n=yn(n,["darkmode","gold"])),n+="darkmode-gold"===t?" darkmode gold":" "+t}n.includes("uds-list")||(n+=" uds-list")}return n}function Tn(e){let t=e;t=t||"default-list";let n=_n(e);if(n=`wp-${e}`,t.startsWith("stp"))n+=" uds-list uds-steplist","stp-default"===t&&(n=yn(n,["uds-steplist-gold","uds-steplist-maroon","smokemode","light-smokemode","darkmode","maroon"])),"stp-gold-counter"===t&&(n=yn(n,["uds-steplist-maroon","smokemode","light-smokemode","darkmode"]),n+=" uds-steplist-gold"),"stp-maroon-counter"===t&&(n=yn(n,["uds-steplist-gold","smokemode","light-smokemode","darkmode"]),n+=" uds-steplist-maroon"),"stp-smokemode"===t&&(n=yn(n,["uds-steplist-gold","uds-steplist-maroon","light-smokemode","darkmode"]),n+=" smokemode"),"stp-smokemode-gold"===t&&(n=yn(n,["uds-steplist-maroon","light-smokemode","darkmode"]),n+=" smokemode uds-steplist-gold"),"stp-smokemode-maroon"===t&&(n=yn(n,["uds-steplist-maroon","light-smokemode","darkmode"]),n+=" smokemode uds-steplist-maroon"),"stp-lightsmokemode"===t&&(n=yn(n,["uds-steplist-gold","uds-steplist-maroon","smokemode","darkmode"]),n+=" light-smokemode"),"stp-lightsmokemode-gold"===t&&(n=yn(n,["uds-steplist-maroon","smokemode","darkmode"]),n+=" light-smokemode uds-steplist-gold"),"stp-lightsmokemode-maroon"===t&&(n=yn(n,["uds-steplist-gold","smokemode","darkmode"]),n+=" light-smokemode uds-steplist-maroon"),"stp-darkmode"===t&&(n=yn(n,["uds-steplist-gold","uds-steplist-maroon","light-smokemode","darkmode"]),n+=" darkmode"),"stp-darkmode-gold"===t&&(n=yn(n,["uds-steplist-maroon","smokemode","light-smokemode"]),n+=" darkmode uds-steplist-gold");else{if(n=yn(n,["uds-steplist","uds-steplist-maroon","uds-steplist-gold"]),t){const e=["default-list","maroon","light-smokemode","smokemode","darkmode"];for(const o of e)n.includes(o)&&t!==o&&(n=n.replace(o,""));n.includes("darkmode")&&n.includes("gold")&&"darkmode-gold"!=t&&(n=yn(n,["darkmode","gold"])),n+="darkmode-gold"===t?" darkmode gold":" "+t}n.includes("uds-list")||(n+=" uds-list")}return n}function yn(e,t){let n=e;for(const o of t){const t=new RegExp(o,"g");n=e.replace(t,"")}return n}function _n(e){return e?e.replace(/\bwp-\w+\b/g,""):""}class xn extends e.Command{execute({styleClass:e}){const t=this.editor.model;t.document.selection,t.document;let n=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());const o=[],i=this.editor.commands.get("bulletedListOld").value?Cn(e):this.editor.commands.get("numberedListOld").value?Tn(e):"";t.change((e=>{bn(n,o,"backward"),bn(n,o,"forward"),o.forEach((t=>{0==t.getAttribute("listIndent")&&("bulleted"===t.getAttribute("listType")?e.setAttribute("htmlUlAttributes",{classes:i},t):"numbered"===t.getAttribute("listType")&&e.setAttribute("htmlOlAttributes",{classes:i},t))}))}))}refresh(){this.isEnabled=this._checkEnabled();let e=(0,w.first)(this.editor.model.document.selection.getSelectedBlocks());const t=[];bn(e,t,"backward"),bn(e,t,"forward"),t.forEach((e=>{this.value=Object.fromEntries(e.getAttributes());const t=e._children._nodes;t.forEach(((e,n)=>{if(0===n&&e._attrs.delete("htmlSpan"),"softBreak"===e.name){const e=t[n+1];e&&(e._attrs||(e._attrs=new Map),e._attrs instanceof Map||(e._attrs=new Map(Object.entries(e._attrs))),e._attrs.set("htmlSpan",{}))}}))}));try{0==this.editor.model.document.selection.anchor.index&&this.editor.model.document.selection._selection._attrs.delete("htmlSpan")}catch(e){}}_checkEnabled(){const e=this.editor,t=e.commands.get("numberedListOld"),n=e.commands.get("bulletedListOld");return t.isEnabled||n.isEnabled}}class En extends e.Plugin{static get requires(){return[t.Widget,s.ContextualBalloon]}static get pluginName(){return"WebsparkListStyleEditing"}constructor(e){super(e)}init(){const e=this.editor,{model:t}=this.editor;e.commands.add("insertliststyle",new xn(e)),e.commands.add("bulletedListOld",e.commands.get("bulletedList"));const n={execute:function(n){e.execute("bulletedListOld",n),fn(t)}};e.commands.add("bulletedList",n),e.commands.get("bulletedList").isEnabled=!0,e.commands.add("numberedListOld",e.commands.get("numberedList"));const o={execute:function(n){e.execute("numberedListOld",n),fn(t)}};e.commands.add("numberedList",o),e.commands.get("numberedList").isEnabled=!0}}class An extends s.View{constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.classSelect=c(o("List properties"),vn(o),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-liststyle-dialog"],tabindex:"-1"},children:[a(this.classSelect),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.classSelect.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get classselect(){return this.classSelect.children[1].value}set classselect(e){this.classSelect.children[1].value=e}setValues(e){this.classselect=e?.classselect}isValid(){return!0}}class Sn extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertliststyle");this.form=new An((this.editor.t,[]),this.editor.locale,t);const n=this.editor.editing.view.document;this.listenTo(n,"click",(()=>{kn(this.form,this.editor)})),this.listenTo(n,"change",(()=>{kn(this.form,this.editor)})),e.ui.componentFactory.add("websparkListStyle",(()=>{const n=(0,s.createDropdown)(e.locale);this._setUpDropdown(n,this.form),this._setUpForm(this.form,n,t);const o=this.editor.commands.get("bulletedListOld"),i=this.editor.commands.get("numberedListOld");return n.bind("isEnabled").toMany([o,i],"value",(e=>o.value||i.value)),n}))}_findUlParent(e){return e&&e.parent?"ul"===e.name?e:this._findUlParent(e.parent):null}_setUpDropdown(e,t){const n=this.editor,o=n.t,i=e.buttonView;function s(){n.editing.view.focus(),e.isOpen=!1}e.panelView.children.add(t),i.set({label:o("List Properties"),icon:'\x3c!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --\x3e\n',tooltip:!0}),i.on("open",(()=>{try{t.classselect&&t.classselect.children[1].select()}catch(e){}t.focus()}),{priority:"low"}),e.on("submit",(()=>{n.execute("insertliststyle",{styleClass:t.classselect}),s()})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>s()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class Vn extends e.Plugin{static get requires(){return[En,Sn]}}class Bn extends e.Command{constructor(e){super(e),this.value=void 0}refresh(){const e=this.editor.model,t=e.document;this.value=t.selection.getAttribute("highlight"),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"highlight")}execute(e={}){const t=this.editor.model,n=t.document.selection,o=e.value;t.change((e=>{if(n.isCollapsed){const t=n.getFirstPosition();if(n.hasAttribute("highlight")){const n=e=>e.item.hasAttribute("highlight")&&e.item.getAttribute("highlight")===this.value,i=t.getLastMatchingPosition(n,{direction:"backward"}),s=t.getLastMatchingPosition(n),l=e.createRange(i,s);o&&this.value!==o?(t.isEqual(s)||e.setAttribute("highlight",o,l),e.setSelectionAttribute("highlight",o)):(t.isEqual(s)||e.removeAttribute("highlight",l),e.removeSelectionAttribute("highlight"))}else o&&e.setSelectionAttribute("highlight",o)}else{const i=t.schema.getValidRanges(n.getRanges(),"highlight");for(const t of i)o?e.setAttribute("highlight",o,t):e.removeAttribute("highlight",t)}}))}}class Rn extends e.Plugin{static get pluginName(){return"WebsparkAnimatedTextEditing"}constructor(e){super(e),e.config.define("highlight",{options:[{model:"yellowPen",class:"pen-yellow",title:"Yellow animated",color:"var(--ck-highlight-marker-yellow)",type:"pen"}]})}init(){const e=this.editor;e.model.schema.extend("$text",{allowAttributes:"highlight"}),e.model.schema.addAttributeCheck(((e,t)=>{if("highlight"===t)return!!e.endsWith("websparkBlockquoteAnimatedParagraph $text")}));const t=e.config.get("highlight.options");e.conversion.attributeToElement(function(e){const t={model:{key:"highlight",values:[]},view:{}};for(const n of e)t.model.values.push(n.model),t.view[n.model]={name:"mark",classes:n.class};return t}(t)),e.commands.add("highlight",new Bn(e))}}var In=n("./node_modules/css-loader/dist/cjs.js!./js/ckeditor5_plugins/websparkPlugin/src/animatedtext/css/animatedtext.css"),Ln={insert:"head",singleton:!1};je()(In.Z,Ln);In.Z.locals;class Dn extends e.Plugin{get localizedOptionTitles(){return{"Yellow pen":(0,this.editor.t)("Yellow pen")}}static get pluginName(){return"HighlightUI"}init(){const e=this.editor.config.get("highlight.options");for(const t of e)this._addHighlighterButton(t);this._addRemoveHighlightButton(),this._addDropdown(e),this._addMenuBarButton(e)}_addRemoveHighlightButton(){const t=this.editor.t,n=this.editor.commands.get("highlight");this._addButton("removeHighlight",t("Remove highlight"),e.icons.eraser,null,(e=>{e.bind("isEnabled").to(n,"isEnabled")}))}_addHighlighterButton(e){const t=this.editor.commands.get("highlight");this._addButton("highlight:"+e.model,e.title,Hn(e.type),e.model,(function(n){n.bind("isEnabled").to(t,"isEnabled"),n.bind("isOn").to(t,"value",(t=>t===e.model)),n.iconView.fillColor=e.color,n.isToggleable=!0}))}_addButton(e,t,n,o,i){const l=this.editor;l.ui.componentFactory.add(e,(e=>{const r=new s.ButtonView(e),a=this.localizedOptionTitles[t]?this.localizedOptionTitles[t]:t;return r.set({label:a,icon:n,tooltip:!0}),r.on("execute",(()=>{l.execute("highlight",{value:o}),l.editing.view.focus()})),i(r),r}))}_addDropdown(e){const t=this.editor,n=t.t,o=t.ui.componentFactory,i=e[0],l=e.reduce(((e,t)=>(e[t.model]=t,e)),{});o.add("websparkAnimatedText",(r=>{const a=t.commands.get("highlight"),c=(0,s.createDropdown)(r,s.SplitButtonView),d=c.buttonView;d.set({label:n("Highlight"),tooltip:!0,lastExecuted:i.model,commandValue:i.model,isToggleable:!0}),d.bind("icon").to(a,"value",(e=>Hn(u(e,"type")))),d.bind("color").to(a,"value",(e=>u(e,"color"))),d.bind("commandValue").to(a,"value",(e=>u(e,"model"))),d.bind("isOn").to(a,"value",(e=>!!e)),d.delegate("execute").to(c);function u(e,t){const n=e&&e!==d.lastExecuted?e:d.lastExecuted;return l[n][t]}return c.bind("isEnabled").to(a,"isEnabled"),(0,s.addToolbarToDropdown)(c,(()=>{const t=e.map((e=>{const t=o.create("highlight:"+e.model);return this.listenTo(t,"execute",(()=>{c.buttonView.set({lastExecuted:e.model})})),t}));return t.push(new s.ToolbarSeparatorView),t.push(o.create("removeHighlight")),t}),{enableActiveItemFocusOnDropdownOpen:!0,ariaLabel:n("Text highlight toolbar")}),function(e){const t=e.buttonView.actionView;t.iconView.bind("fillColor").to(e.buttonView,"color")}(c),d.on("execute",(()=>{t.execute("highlight",{value:d.commandValue})})),this.listenTo(c,"execute",(()=>{t.editing.view.focus()})),c}))}_addMenuBarButton(t){const n=this.editor,o=n.t,i=n.commands.get("highlight");n.ui.componentFactory.add("menuBar:highlight",(l=>{const r=new s.MenuBarMenuView(l);r.buttonView.set({label:o("Highlight"),icon:Hn("marker")}),r.bind("isEnabled").to(i),r.buttonView.iconView.fillColor="transparent";const a=new s.MenuBarMenuListView(l);for(const e of t){const t=new s.MenuBarMenuListItemView(l,r),o=new s.MenuBarMenuListItemButtonView(l);o.set({label:e.title,icon:Hn(e.type),role:"menuitemradio",isToggleable:!0}),o.iconView.fillColor=e.color,o.delegate("execute").to(r),o.bind("isOn").to(i,"value",(t=>t===e.model)),o.on("execute",(()=>{n.execute("highlight",{value:e.model}),n.editing.view.focus()})),t.children.add(o),a.items.add(t)}a.items.add(new s.ListSeparatorView(l));const c=new s.MenuBarMenuListItemView(l,r),d=new s.MenuBarMenuListItemButtonView(l);return d.set({label:o("Remove highlight"),icon:e.icons.eraser}),d.delegate("execute").to(r),d.on("execute",(()=>{n.execute("highlight",{value:null}),n.editing.view.focus()})),c.children.add(d),a.items.add(c),r.panelView.children.add(a),r}))}}function Hn(e){return"marker"===e?'':''}class Pn extends e.Plugin{static get requires(){return[Rn,Dn]}}class Fn extends e.Command{execute({text:e,citationName:t,citationDescription:n,title:o}){const{model:i}=this.editor;i.change((s=>{const l=s.createElement("websparkBlockquoteAnimated"),r=s.createElement("websparkBlockquoteAnimatedContainer"),a=s.createElement("websparkBlockquoteAnimatedTitle"),c=s.createElement("websparkBlockquoteAnimatedParagraph"),d=s.createElement("websparkBlockquoteAnimatedCitation"),u=s.createElement("websparkBlockquoteAnimatedCitationName"),h=s.createElement("websparkBlockquoteAnimatedCitationDescription"),m=s.createText(o);s.append(m,a);const g=s.createText(e);if(s.append(g,c),t.length>0){const e=s.createText(t);s.append(e,u),s.append(u,d)}if(n.length>0){const e=s.createText(n);s.append(e,h),s.append(h,d)}o.length>0&&s.append(a,r),s.append(c,r),s.append(d,r),s.append(r,l),i.insertContent(l)}))}refresh(){const{model:e}=this.editor,{selection:t}=e.document,n=e.schema.findAllowedParent(t.getFirstPosition(),"websparkBlockquoteAnimated");this.isEnabled=null!==n;const o=t.getSelectedElement();if("websparkBlockquoteAnimated"===o?.name){const t=o?.getChild(0)?.getChild(0)?._data;e.change((e=>{e.setAttribute("text",t,o)})),this.value=Object.fromEntries(o.getAttributes())}else this.value=null}}class Mn extends e.Plugin{static get requires(){return[t.Widget]}init(){this._defineSchema(),this._defineConverters(),this.editor.commands.add("insertWebsparkBlockquoteAnimated",new Fn(this.editor))}_defineSchema(){const e=this.editor.model.schema;e.register("websparkBlockquoteAnimated",{isObject:!0,allowWhere:"$block"}),e.register("websparkBlockquoteAnimatedSvg",{isObject:!0,allowIn:"websparkBlockquoteAnimated",allowContentOf:"$block",allowAttributes:["role","title","viewBox","xmlns"]}),e.register("websparkBlockquoteAnimatedContainer",{isLimit:!0,allowIn:"websparkBlockquoteAnimated",allowContentOf:"$block"}),e.register("websparkBlockquoteAnimatedTitle",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedContainer",allowContentOf:"$block"}),e.register("websparkBlockquoteAnimatedParagraph",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedContainer",allowContentOf:"$block"}),e.register("websparkBlockquoteAnimatedCitation",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedContainer",allowContentOf:"$text"}),e.register("websparkBlockquoteAnimatedCitationName",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedCitation",allowContentOf:"$block"}),e.register("websparkBlockquoteAnimatedCitationDescription",{isLimit:!0,allowIn:"websparkBlockquoteAnimatedCitation",allowContentOf:"$block"})}_defineConverters(){const{conversion:e}=this.editor;e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedCitationName",view:{name:"cite",classes:"name"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedCitationName",view:{name:"cite",classes:"name"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedCitationName",view:(e,{writer:n})=>{const o=n.createEditableElement("cite",{class:"name"});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedCitationDescription",view:{name:"cite",classes:"description"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedCitationDescription",view:{name:"cite",classes:"description"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedCitationDescription",view:(e,{writer:n})=>{const o=n.createEditableElement("cite",{class:"description"});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedCitation",view:{name:"div",classes:"citation"}}),e.for("dataDowncast").elementToStructure({model:"websparkBlockquoteAnimatedCitation",view:(e,t)=>{const{writer:n}=t,o=n.createContainerElement("div",{class:"citation-content"},[n.createSlot()]);return n.createContainerElement("div",{class:"citation"},[o])}}),e.for("editingDowncast").elementToStructure({model:"websparkBlockquoteAnimatedCitation",view:(e,t)=>{const{writer:n}=t,o=n.createContainerElement("div",{class:"citation-content"},[n.createSlot()]);return n.createContainerElement("div",{class:"citation"},[o])}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedParagraph",view:{name:"h2"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedParagraph",view:{name:"h2"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedParagraph",view:(e,{writer:n})=>{const o=n.createEditableElement("h2",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedTitle",view:{name:"h4"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedTitle",view:{name:"h4"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedTitle",view:(e,{writer:n})=>{const o=n.createEditableElement("h4",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({model:"websparkBlockquoteAnimatedContainer",view:{name:"blockquote"}}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimatedContainer",view:{name:"blockquote"}}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimatedContainer",view:(e,{writer:n})=>{const o=n.createEditableElement("blockquote",{});return(0,t.toWidgetEditable)(o,n)}}),e.for("upcast").elementToElement({view:{name:"div",classes:["uds-blockquoteAnimated","accent-maroon"]},model:(e,{writer:t})=>t.createElement("websparkBlockquoteAnimated",{})}),e.for("dataDowncast").elementToElement({model:"websparkBlockquoteAnimated",view:(e,{writer:t})=>t.createContainerElement("div",{class:"uds-blockquoteAnimated accent-maroon"})}),e.for("editingDowncast").elementToElement({model:"websparkBlockquoteAnimated",view:(e,{writer:n})=>{const o=n.createContainerElement("div",{class:"uds-blockquoteAnimated accent-maroon"});return(0,t.toWidget)(o,n,{label:"BlockQuote Animated"})}})}}class On extends s.View{DEFAULT_TITLE="";DEFAULT_TEXT="";DEFAULT_STYLE="";DEFAULT_HEADING="";constructor(t,n){super(n);const o=n.t;this.focusTracker=new w.FocusTracker,this.keystrokes=new w.KeystrokeHandler,this.titleView=d(o("Title"),n),this.textInputView=m(o("Content"),n),this.citationNameView=d(o("Citation Name"),n),this.citationDescriptionView=d(o("Citation Description"),n),this.saveButtonView=u(o("Save"),e.icons.check,"ck-button-save",n),this.saveButtonView.type="submit",this.cancelButtonView=u(o("Cancel"),e.icons.cancel,"ck-button-cancel",n),this.cancelButtonView.delegate("execute").to(this,"cancel"),this._focusables=new s.ViewCollection,this._focusCycler=new s.FocusCycler({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-webspark-form","webspark-blockquote-dialog"],tabindex:"-1"},children:[a(this.titleView),a(this.textInputView),a(this.citationNameView),a(this.citationDescriptionView),r([this.saveButtonView,this.cancelButtonView],["ck-webspark-form-buttons"])]})}render(){super.render(),(0,s.submitHandler)({view:this});[this.titleView.children[1],this.textInputView.children[1],this.citationNameView.children[1],this.citationDescriptionView.children[1],this.saveButtonView,this.cancelButtonView].forEach((e=>{this._focusables.add(e),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()}get title(){return this.titleView.children[1].element.value.trim()}set title(e){this.titleView.children[1].element.value=e.trim()}get text(){return this.textInputView.children[1].element.value.trim()}set text(e){this.textInputView.children[1].element.value=e.trim()}get citationName(){return this.citationNameView.children[1].element.value.trim()}set citationName(e){this.citationNameView.children[1].element.value=e.trim()}get citationDescription(){return this.citationDescriptionView.children[1].element.value.trim()}set citationDescription(e){this.citationDescriptionView.children[1].element.value=e.trim()}setValues(e){this.title=e?.title||this.DEFAULT_TITLE,this.text=e?.text||this.DEFAULT_TEXT,this.citationName=e?.citationName||this.DEFAULT_STYLE,this.citationDescription=e?.citationDescription||this.DEFAULT_HEADING}isValid(){this.resetFormStatus();for(const e of this._validators){const t=e(this);if(t)return t.includes("text")&&(this.textInputView.errorText=t),!1}return!0}resetFormStatus(){this.textInputView.errorText=null}}class qn extends e.Plugin{static get requires(){return[s.ContextualBalloon]}init(){const e=this.editor,t=e.commands.get("insertWebsparkBlockquoteAnimated");this.form=new On((e.t,[e=>{}]),e.locale,t),e.ui.componentFactory.add("websparkBlockquoteAnimated",(e=>{const n=(0,s.createDropdown)(e);return this._setUpDropdown(n,this.form,t),this._setUpForm(this.form,n,t),n}))}_setUpDropdown(e,t,n){const o=this.editor,i=o.t,s=e.buttonView;function l(){o.editing.view.focus(),e.isOpen=!1}e.bind("isEnabled").to(n),e.panelView.children.add(t),s.set({label:i("Blockquote Animated"),icon:'\x3c!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --\x3e\n\n\n\n',tooltip:!0}),s.on("open",(()=>{t.setValues(n.value),t.titleView.children[1].element.select()}),{priority:"low"}),e.on("submit",(()=>{t.isValid()&&(o.execute("insertWebsparkBlockquoteAnimated",{text:t.text,citationName:t.citationName,citationDescription:t.citationDescription,title:t.title}),l())})),e.on("change:isOpen",(()=>t.element.reset())),e.on("cancel",(()=>l()))}_setUpForm(e,t,n){e.delegate("submit","cancel").to(t),e.saveButtonView.bind("isEnabled").to(n)}}class Nn extends e.Plugin{static get requires(){return[Mn,qn]}}const jn={WebsparkButton:k,WebsparkDivider:y,WebsparkLead:S,WebsparkHighlightedHeading:L,WebsparkBlockquote:M,WebsparkTable:an,WebsparkAdvancedImage:mn,WebsparkMediaAlter:wn,WebsparkListStyle:Vn,WebsparkAnimatedText:Pn,WebsparkBlockquoteAnimated:Nn}})(),o=o.default})())); \ No newline at end of file diff --git a/web/modules/webspark/webspark_ckeditor_plugins/js/ckeditor5_plugins/websparkPlugin/src/tablecellwsproperties/tablecellwspropertiesediting.js b/web/modules/webspark/webspark_ckeditor_plugins/js/ckeditor5_plugins/websparkPlugin/src/tablecellwsproperties/tablecellwspropertiesediting.js index 216aa7a9d..cc2e8d8c2 100644 --- a/web/modules/webspark/webspark_ckeditor_plugins/js/ckeditor5_plugins/websparkPlugin/src/tablecellwsproperties/tablecellwspropertiesediting.js +++ b/web/modules/webspark/webspark_ckeditor_plugins/js/ckeditor5_plugins/websparkPlugin/src/tablecellwsproperties/tablecellwspropertiesediting.js @@ -62,7 +62,8 @@ function markerConversion(conversion) { converterPriority: "high", }); - conversion.for("downcast").elementToElement({ + // For the editing view (with contenteditable) + conversion.for("editingDowncast").elementToElement({ model: { name: "tableCell", attributes: ["cellType"], @@ -73,7 +74,7 @@ function markerConversion(conversion) { return writer.createEditableElement( "th", { - contenteditable: "true", + contenteditable: "true", // Allow editing in the editor class: "ck-editor__editable ck-editor__nested-editable", role: "textbox", }, @@ -83,7 +84,7 @@ function markerConversion(conversion) { return writer.createEditableElement( "td", { - contenteditable: "true", + contenteditable: "true", // Allow editing in the editor class: "ck-editor__editable ck-editor__nested-editable", role: "textbox", }, @@ -94,7 +95,7 @@ function markerConversion(conversion) { return writer.createEditableElement( "th", { - contenteditable: "true", + contenteditable: "true", // Allow editing in the editor class: "ck-editor__editable ck-editor__nested-editable " + modelElement.getAttribute("cellType"), @@ -104,6 +105,29 @@ function markerConversion(conversion) { ); } }, - converterPriority: "high", + converterPriority: "high", // Ensure this converter has a high priority + }); + + // For the data view (without contenteditable) + conversion.for("dataDowncast").elementToElement({ + model: { + name: "tableCell", + attributes: ["cellType"], + }, + view: (modelElement, { writer }) => { + switch (modelElement.getAttribute("cellType")) { + case "th": + return writer.createContainerElement("th", {}); // No contenteditable attribute, just a basic table header element + case "td": + return writer.createContainerElement("td", {}); // No contenteditable attribute, just a basic table data element + case "indent": + case "normal": + return writer.createContainerElement("th", { + class: modelElement.getAttribute("cellType"), + }); // Apply the custom class, but no contenteditable attribute + } + }, + converterPriority: "high", // Ensure this converter has a high priority }); + } From f6ffff04636f014fb6d9c79673f7ecb9c4d11050 Mon Sep 17 00:00:00 2001 From: Juan Mitriatti Date: Mon, 14 Oct 2024 14:58:55 -0300 Subject: [PATCH 2/3] WS2-2234: Removed title from svg blockquote and added h2 heading to Card image and contet --- .../renovation/src/components/blockquote/blockquote.twig | 2 +- .../src/components/cards/_card-image-and-content.scss | 6 ++++++ ...tent--field-heading--card-image-and-content.html.twig | 9 +++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/web/themes/webspark/renovation/src/components/blockquote/blockquote.twig b/web/themes/webspark/renovation/src/components/blockquote/blockquote.twig index fadd62084..15dce5b2e 100644 --- a/web/themes/webspark/renovation/src/components/blockquote/blockquote.twig +++ b/web/themes/webspark/renovation/src/components/blockquote/blockquote.twig @@ -1,5 +1,5 @@
- + diff --git a/web/themes/webspark/renovation/src/components/cards/_card-image-and-content.scss b/web/themes/webspark/renovation/src/components/cards/_card-image-and-content.scss index 854c78387..742ccf329 100644 --- a/web/themes/webspark/renovation/src/components/cards/_card-image-and-content.scss +++ b/web/themes/webspark/renovation/src/components/cards/_card-image-and-content.scss @@ -24,4 +24,10 @@ } } } + + &-content-container-headline { + h2 { + font-size: 3rem; + } + } } diff --git a/web/themes/webspark/renovation/templates/field/field--block-content--field-heading--card-image-and-content.html.twig b/web/themes/webspark/renovation/templates/field/field--block-content--field-heading--card-image-and-content.html.twig index 78785778c..add4f2c9c 100644 --- a/web/themes/webspark/renovation/templates/field/field--block-content--field-heading--card-image-and-content.html.twig +++ b/web/themes/webspark/renovation/templates/field/field--block-content--field-heading--card-image-and-content.html.twig @@ -1,3 +1,8 @@ {% for item in items %} - {{ item.content }} -{% endfor %} \ No newline at end of file + + {% include '@renovation/headings/heading.twig' with { + html_tag : 'h2', + heading: item.content['#context'].value, + } %} +
+{% endfor %} From f264e3c2e799f40dce7da9945576fc5b46b55322 Mon Sep 17 00:00:00 2001 From: Juan Mitriatti Date: Fri, 18 Oct 2024 08:59:08 -0300 Subject: [PATCH 3/3] WS2-1756: Upgrade unity-bootstrao-theme --- web/themes/webspark/renovation/package.json | 2 +- web/themes/webspark/renovation/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/themes/webspark/renovation/package.json b/web/themes/webspark/renovation/package.json index b27fc44dd..c3030fc1d 100644 --- a/web/themes/webspark/renovation/package.json +++ b/web/themes/webspark/renovation/package.json @@ -21,7 +21,7 @@ "sass-loader": "^12.1.0" }, "dependencies": { - "@asu/unity-bootstrap-theme": "1.14.2", + "@asu/unity-bootstrap-theme": "1.15.1", "@popperjs/core": "^2.11.8" } } diff --git a/web/themes/webspark/renovation/yarn.lock b/web/themes/webspark/renovation/yarn.lock index b010013dd..e10e58337 100644 --- a/web/themes/webspark/renovation/yarn.lock +++ b/web/themes/webspark/renovation/yarn.lock @@ -10,10 +10,10 @@ "@jridgewell/gen-mapping" "^0.1.0" "@jridgewell/trace-mapping" "^0.3.9" -"@asu/unity-bootstrap-theme@1.14.2": - version "1.14.2" - resolved "https://npm.pkg.github.com/download/@asu/unity-bootstrap-theme/1.14.2/ade482be4962d2bae774b318a0e59983be3dd18b#ade482be4962d2bae774b318a0e59983be3dd18b" - integrity sha512-FZjslQ8dviKlJ9UiDlba/uuYFYurWPi/4SjUMIU9pb+Dinp/2Co9ZbPIX2H5uSwCpn4V83S0rLcPCIBIlsw7iw== +"@asu/unity-bootstrap-theme@1.15.1": + version "1.15.1" + resolved "https://npm.pkg.github.com/download/@asu/unity-bootstrap-theme/1.15.1/f733b50680b1aded0105950ba3a99f4951356262#f733b50680b1aded0105950ba3a99f4951356262" + integrity sha512-IPLS4JmcRyJi381RcBBkMMF4FNyEx4Vm+TAnwyz7QnL21RICbfJOonJJECBxx4k0s10tvSJcXQ7F8gS5XI9lkQ== "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.22.10", "@babel/code-frame@^7.22.5": version "7.22.10"