@ncino/web-components 8.0.0 → 8.1.0-preview.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (293) hide show
  1. package/dist/_virtual/index5.js +1 -1
  2. package/dist/_virtual/index6.js +1 -1
  3. package/dist/_virtual/index_html.js +1 -1
  4. package/dist/_virtual/index_react.js +1 -1
  5. package/dist/assets/node_modules/.pnpm/ckeditor5@46.1.1/node_modules/ckeditor5/dist/ckeditor5.css +1 -4
  6. package/dist/components/accordion/gator/base/accordion.gator.js +1 -1
  7. package/dist/components/accordion/gator/group/accordion-group.gator.js +1 -1
  8. package/dist/components/alert/gator/base/alert.gator.js +1 -1
  9. package/dist/components/alert/gator/subtitle/alert-subtitle.gator.js +1 -1
  10. package/dist/components/alert/gator/title/alert-title.gator.js +1 -1
  11. package/dist/components/avatar/gator/avatar.gator.js +1 -1
  12. package/dist/components/badge/gator/badge.gator.js +1 -1
  13. package/dist/components/banner/gator/banner.gator.js +1 -1
  14. package/dist/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.js +10 -4
  15. package/dist/components/button/gator/button.gator.js +1 -1
  16. package/dist/components/button-card/gator/button-card.gator.js +1 -1
  17. package/dist/components/card/card.js +1 -1
  18. package/dist/components/card/gator/base/card.gator.js +1 -1
  19. package/dist/components/card/gator/content/card-content.gator.js +1 -1
  20. package/dist/components/card/gator/footer/card-footer.gator.js +1 -1
  21. package/dist/components/card/gator/header/card-header.gator.js +1 -1
  22. package/dist/components/checkbox/checkbox.gator.js +1 -1
  23. package/dist/components/chip/gator/chip.gator.js +1 -1
  24. package/dist/components/date-picker/base/gator/datepicker.gator.js +1 -1
  25. package/dist/components/date-picker/year-month-selector/year-month-selector.gator.js +1 -1
  26. package/dist/components/display-card/gator/display-card.gator.js +1 -1
  27. package/dist/components/divider/gator/divider.gator.js +2 -2
  28. package/dist/components/fab/gator/fab.gator.js +1 -1
  29. package/dist/components/icon-button/gator/icon-button.gator.js +1 -1
  30. package/dist/components/illustration/gator/illustration.gator.js +1 -1
  31. package/dist/components/image-card/gator/image-card.gator.js +23 -19
  32. package/dist/components/input/base/input-base.gator.js +1 -1
  33. package/dist/components/input/gator/dropdown/input-dropdown.gator.js +15 -15
  34. package/dist/components/input/gator/help-text/help-text.gator.js +1 -1
  35. package/dist/components/input/gator/input-date/input-date.gator.js +14 -17
  36. package/dist/components/input/gator/input-label/input-label.gator.js +3 -3
  37. package/dist/components/input/gator/input-phone/input-phone.gator.js +1 -1
  38. package/dist/components/loading-spinner/gator/loading-spinner.gator.js +1 -1
  39. package/dist/components/menu/base/gator/menu.gator.js +1 -1
  40. package/dist/components/modal/gator/modal.gator.js +54 -50
  41. package/dist/components/page-header/gator/page-header.gator.js +3 -3
  42. package/dist/components/panel/gator/panel.storybook-test.js +1 -1
  43. package/dist/components/popover/gator/popover.gator.js +1 -1
  44. package/dist/components/progress-bar/gator/progress-bar.gator.js +18 -12
  45. package/dist/components/progress-ring/gator/progress-ring.gator.js +1 -1
  46. package/dist/components/selection-box/selection-box.gator.js +1 -1
  47. package/dist/components/selector/gator/selector.gator.js +1 -1
  48. package/dist/components/skeleton-loader/gator/skeleton-loader.gator.js +1 -1
  49. package/dist/components/switch/gator/switch.gator.js +1 -1
  50. package/dist/components/table/gator/table.gator.js +1 -1
  51. package/dist/components/tabs/gator/tabset/tabset.gator.js +1 -1
  52. package/dist/components/text-detail/gator/text-detail.gator.js +1 -1
  53. package/dist/components/text-link/gator/text-link.gator.js +1 -1
  54. package/dist/components/toast/gator/base/toast.gator.js +1 -1
  55. package/dist/components/toast/gator/subtitle/toast-subtitle.gator.js +1 -1
  56. package/dist/components/toast/gator/title/toast-title.gator.js +1 -1
  57. package/dist/components/toast-container/gator/toast-container.gator.js +1 -1
  58. package/dist/components/toaster/gator/toaster.gator.js +1 -1
  59. package/dist/components/tooltip/gator/tooltip.gator.js +1 -1
  60. package/dist/design-tokens.source.json +1 -1
  61. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-alignment@46.1.1/node_modules/@ckeditor/ckeditor5-alignment/dist/index.js +1 -4
  62. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-autoformat@46.1.1/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js +1 -7
  63. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-autosave@46.1.1/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js +1 -4
  64. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-basic-styles@46.1.1/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js +1 -4
  65. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-block-quote@46.1.1/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js +1 -4
  66. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-clipboard@46.1.1/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js +2 -14
  67. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-cloud-services@46.1.1/node_modules/@ckeditor/ckeditor5-cloud-services/dist/index.js +1 -4
  68. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-code-block@46.1.1/node_modules/@ckeditor/ckeditor5-code-block/dist/index.js +1 -4
  69. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js +1 -4
  70. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-editor-classic@46.1.1/node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js +1 -4
  71. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js +2 -29
  72. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-enter@46.1.1/node_modules/@ckeditor/ckeditor5-enter/dist/index.js +1 -7
  73. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-essentials@46.1.1/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js +1 -4
  74. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-find-and-replace@46.1.1/node_modules/@ckeditor/ckeditor5-find-and-replace/dist/index.js +2 -5
  75. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-font@46.1.1/node_modules/@ckeditor/ckeditor5-font/dist/index.js +1 -7
  76. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-heading@46.1.1/node_modules/@ckeditor/ckeditor5-heading/dist/index.js +1 -7
  77. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-highlight@46.1.1/node_modules/@ckeditor/ckeditor5-highlight/dist/index.js +1 -4
  78. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-horizontal-line@46.1.1/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js +1 -4
  79. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-embed@46.1.1/node_modules/@ckeditor/ckeditor5-html-embed/dist/index.js +1 -4
  80. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-html-support@46.1.1/node_modules/@ckeditor/ckeditor5-html-support/dist/index.js +1 -10
  81. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js +1 -4
  82. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-image@46.1.1/node_modules/@ckeditor/ckeditor5-image/dist/index.js +1 -10
  83. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-indent@46.1.1/node_modules/@ckeditor/ckeditor5-indent/dist/index.js +1 -10
  84. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-language@46.1.1/node_modules/@ckeditor/ckeditor5-language/dist/index.js +1 -4
  85. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-link@46.1.1/node_modules/@ckeditor/ckeditor5-link/dist/index.js +1 -4
  86. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-list@46.1.1/node_modules/@ckeditor/ckeditor5-list/dist/index.js +1 -13
  87. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-markdown-gfm@46.1.1/node_modules/@ckeditor/ckeditor5-markdown-gfm/dist/index.js +2 -5
  88. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-media-embed@46.1.1/node_modules/@ckeditor/ckeditor5-media-embed/dist/index.js +1 -7
  89. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-mention@46.1.1/node_modules/@ckeditor/ckeditor5-mention/dist/index.js +1 -4
  90. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-page-break@46.1.1/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js +1 -4
  91. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paragraph@46.1.1/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js +1 -4
  92. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-paste-from-office@46.1.1/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js +1 -31
  93. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-remove-format@46.1.1/node_modules/@ckeditor/ckeditor5-remove-format/dist/index.js +1 -4
  94. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-select-all@46.1.1/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js +1 -4
  95. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-show-blocks@46.1.1/node_modules/@ckeditor/ckeditor5-show-blocks/dist/index.js +1 -4
  96. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-source-editing@46.1.1/node_modules/@ckeditor/ckeditor5-source-editing/dist/index.js +1 -4
  97. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-special-characters@46.1.1/node_modules/@ckeditor/ckeditor5-special-characters/dist/index.js +1 -4
  98. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-style@46.1.1/node_modules/@ckeditor/ckeditor5-style/dist/index.js +1 -4
  99. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-table@46.1.1/node_modules/@ckeditor/ckeditor5-table/dist/index.js +1 -16
  100. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-typing@46.1.1/node_modules/@ckeditor/ckeditor5-typing/dist/index.js +1 -13
  101. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-ui@46.1.1/node_modules/@ckeditor/ckeditor5-ui/dist/index.js +1 -25
  102. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-undo@46.1.1/node_modules/@ckeditor/ckeditor5-undo/dist/index.js +1 -4
  103. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-upload@46.1.1/node_modules/@ckeditor/ckeditor5-upload/dist/index.js +1 -4
  104. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js +3 -108
  105. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-watchdog@46.1.1/node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js +1 -10
  106. package/dist/node_modules/.pnpm/@ckeditor_ckeditor5-widget@46.1.1/node_modules/@ckeditor/ckeditor5-widget/dist/index.js +1 -4
  107. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.9/node_modules/@figma/code-connect/package.json.js +1 -0
  108. package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/init/runtime.js +1 -5
  109. package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/default-msg.js +1 -5
  110. package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/deferred.js +1 -5
  111. package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/fnv1a64.js +1 -5
  112. package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/locale-status-event.js +1 -5
  113. package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-controller.js +1 -5
  114. package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/localized-decorator.js +1 -5
  115. package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/str-tag.js +1 -5
  116. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js +1 -5
  117. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/custom-element.js +1 -5
  118. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js +1 -5
  119. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js +1 -5
  120. package/dist/node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js +1 -5
  121. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +1 -17
  122. package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +1 -7
  123. package/dist/node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +1 -1
  124. package/dist/node_modules/.pnpm/axe-core@4.11.0/node_modules/axe-core/axe.js +1 -11
  125. package/dist/node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js +1 -6
  126. package/dist/node_modules/.pnpm/chai@5.2.0/node_modules/chai/chai.js +1 -217
  127. package/dist/node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/conversions.js +1 -0
  128. package/dist/node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/index.js +1 -0
  129. package/dist/node_modules/.pnpm/color-convert@3.1.3/node_modules/color-convert/route.js +1 -0
  130. package/dist/node_modules/.pnpm/color-string@2.1.4/node_modules/color-string/index.js +1 -0
  131. package/dist/node_modules/.pnpm/{color@5.0.2 → color@5.0.3}/node_modules/color/index.js +1 -1
  132. package/dist/node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js +1 -1
  133. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.26/node_modules/libphonenumber-js/metadata.min.json.js +1 -0
  134. package/dist/node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js +1 -5
  135. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/async-directive.js +1 -5
  136. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +1 -5
  137. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +1 -5
  138. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js +1 -5
  139. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js +1 -5
  140. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js +1 -5
  141. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/ref.js +1 -5
  142. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/repeat.js +1 -5
  143. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js +1 -5
  144. package/dist/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js +1 -5
  145. package/dist/node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react.production.js +1 -9
  146. package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-JVSKG4YS.js +48 -0
  147. package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-MM7DTO55.js +1 -0
  148. package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-OPCDBBL3.js +6 -0
  149. package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-SN4J4IQ3.js +1 -0
  150. package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/_browser-chunks/chunk-VUAFL5XK.js +1 -0
  151. package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/client-logger/index.js +1 -0
  152. package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/core-events/index.js +1 -0
  153. package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/instrumenter/index.js +1 -0
  154. package/dist/node_modules/.pnpm/storybook@10.0.8_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.10.0_typescript@5_e2791259526ede65857ac65f52302a74/node_modules/storybook/dist/test/index.js +152 -0
  155. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/index.js +1 -1
  156. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/body.js +1 -1
  157. package/dist/node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/websocket/frame.js +1 -1
  158. package/dist/packages/{web-components/src/tokens/semantic.tokens.scss.js → styles/src/gator/tokens/semantic.tokens.css.js} +1 -1
  159. package/dist/packages/web-components/src/components/alert/gator/title/alert-title.gator.scss.js +1 -1
  160. package/dist/packages/web-components/src/components/badge/gator/badge.gator.scss.js +1 -1
  161. package/dist/packages/web-components/src/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.scss.js +1 -1
  162. package/dist/packages/web-components/src/components/button-card/gator/button-card.gator.scss.js +1 -1
  163. package/dist/packages/web-components/src/components/card/gator/base/card.gator.scss.js +1 -1
  164. package/dist/packages/web-components/src/components/card/gator/content/card-content.gator.scss.js +1 -1
  165. package/dist/packages/web-components/src/components/card/gator/footer/card-footer.gator.scss.js +1 -1
  166. package/dist/packages/web-components/src/components/card/gator/header/card-header.gator.scss.js +1 -1
  167. package/dist/packages/web-components/src/components/checkbox-group/checkbox-group.gator.scss.js +1 -1
  168. package/dist/packages/web-components/src/components/chip/gator/chip.gator.scss.js +1 -1
  169. package/dist/packages/web-components/src/components/date-picker/base/gator/datepicker.gator.scss.js +1 -1
  170. package/dist/packages/web-components/src/components/date-picker/year-month-selector/year-month-selector.gator.scss.js +1 -1
  171. package/dist/packages/web-components/src/components/display-card/gator/display-card.gator.scss.js +1 -1
  172. package/dist/packages/web-components/src/components/divider/gator/divider.gator.scss.js +1 -1
  173. package/dist/packages/web-components/src/components/fab/gator/fab.gator.scss.js +1 -1
  174. package/dist/packages/web-components/src/components/guided-nav/gator/guided-nav-substep/guided-nav-substep.gator.scss.js +1 -1
  175. package/dist/packages/web-components/src/components/headline-card/gator/headline-card.gator.scss.js +1 -1
  176. package/dist/packages/web-components/src/components/icon/gator/icon.gator.scss.js +1 -1
  177. package/dist/packages/web-components/src/components/illustration/gator/illustration.gator.scss.js +1 -1
  178. package/dist/packages/web-components/src/components/image-card/gator/image-card.gator.scss.js +1 -1
  179. package/dist/packages/web-components/src/components/input/gator/dropdown/input-dropdown.gator.scss.js +1 -1
  180. package/dist/packages/web-components/src/components/input/gator/help-text/help-text.gator.scss.js +1 -1
  181. package/dist/packages/web-components/src/components/input/gator/input-date/input-date.gator.scss.js +1 -1
  182. package/dist/packages/web-components/src/components/input/gator/input-file/file-uploaded-preview/file-upload-preview.gator.scss.js +1 -1
  183. package/dist/packages/web-components/src/components/input/gator/input-file/input-file.gator.scss.js +1 -1
  184. package/dist/packages/web-components/src/components/input/gator/input-label/input-label.gator.scss.js +1 -1
  185. package/dist/packages/web-components/src/components/input/gator/input-search/input-search.gator.scss.js +1 -1
  186. package/dist/packages/web-components/src/components/input/input.gator.scss.js +1 -1
  187. package/dist/packages/web-components/src/components/list/gator/list-item/list-item.gator.scss.js +1 -1
  188. package/dist/packages/web-components/src/components/menu/base/gator/menu.gator.scss.js +1 -1
  189. package/dist/packages/web-components/src/components/modal/gator/modal.gator.scss.js +1 -1
  190. package/dist/packages/web-components/src/components/page-header/gator/page-header.gator.scss.js +1 -1
  191. package/dist/packages/web-components/src/components/panel/gator/panel.gator.scss.js +1 -1
  192. package/dist/packages/web-components/src/components/popover/gator/popover.gator.scss.js +1 -1
  193. package/dist/packages/web-components/src/components/progress-bar/gator/progress-bar.gator.scss.js +1 -1
  194. package/dist/packages/web-components/src/components/selection-box/selection-box.gator.scss.js +1 -1
  195. package/dist/packages/web-components/src/components/skip-link/gator/base/skip-link.gator.scss.js +1 -1
  196. package/dist/packages/web-components/src/components/skip-link/gator/list-item/skip-link-list-item.gator.scss.js +1 -1
  197. package/dist/packages/web-components/src/components/table/gator/table-bulk-controls/table-bulk-controls.gator.scss.js +1 -1
  198. package/dist/packages/web-components/src/components/table/gator/table-controls/table-controls.gator.scss.js +1 -1
  199. package/dist/packages/web-components/src/components/table/gator/table-pagination/table-pagination.gator.scss.js +1 -1
  200. package/dist/packages/web-components/src/components/table/gator/table.gator.scss.js +1 -1
  201. package/dist/packages/web-components/src/components/tabs/gator/tabs.gator.scss.js +1 -1
  202. package/dist/packages/web-components/src/components/text-detail/gator/text-detail.gator.scss.js +1 -1
  203. package/dist/packages/web-components/src/components/text-link/gator/text-link.gator.scss.js +1 -1
  204. package/dist/packages/web-components/src/components/time-picker/gator/time-picker.gator.scss.js +1 -1
  205. package/dist/packages/web-components/src/components/toast/gator/base/toast.gator.scss.js +1 -1
  206. package/dist/packages/web-components/src/components/toast/gator/title/toast-title.gator.scss.js +1 -1
  207. package/dist/packages/web-components/src/components/toaster/gator/toaster.gator.scss.js +1 -1
  208. package/dist/packages/web-components/src/components/tooltip/gator/tooltip.gator.scss.js +1 -1
  209. package/dist/packages/web-components/src/index.slds.scss.js +1 -1
  210. package/dist/types/components/breadcrumbs/gator/breadcrumb/breadcrumb.gator.d.ts +3 -5
  211. package/dist/types/components/image-card/gator/image-card.gator.d.ts +5 -1
  212. package/dist/types/components/input/gator/input-date/input-date.gator.d.ts +7 -0
  213. package/dist/types/components/modal/gator/modal.gator.d.ts +16 -3
  214. package/dist/types/components/page-header/gator/page-header.gator.d.ts +0 -1
  215. package/dist/types/components/progress-bar/gator/progress-bar.gator.d.ts +8 -0
  216. package/dist/types/generated/locale-codes.d.ts +10 -0
  217. package/dist/types/generated/locales/es-419.d.ts +6 -1
  218. package/dist/types/generated/locales/fr-CA.d.ts +6 -1
  219. package/dist/types/generated/locales/zh-Hans.d.ts +6 -1
  220. package/dist/utils/brand-color-utils.js +1 -1
  221. package/dist/utils/components/ngc-component.js +1 -1
  222. package/dist/utils/vitest-a11y-utils.js +1 -1
  223. package/package.json +21 -21
  224. package/web-types.json +15 -5
  225. package/dist/generated/locale-codes.d.js +0 -1
  226. package/dist/generated/locales/es-419.d.js +0 -1
  227. package/dist/generated/locales/fr-CA.d.js +0 -1
  228. package/dist/generated/locales/zh-Hans.d.js +0 -1
  229. package/dist/node_modules/.pnpm/@figma_code-connect@1.3.7/node_modules/@figma/code-connect/package.json.js +0 -1
  230. package/dist/node_modules/.pnpm/color-string@2.0.1/node_modules/color-string/index.js +0 -1
  231. package/dist/node_modules/.pnpm/libphonenumber-js@1.12.24/node_modules/libphonenumber-js/metadata.min.json.js +0 -1
  232. package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.9.1_typescript@5._a0e195139f137e7eecc50e9c6275adcc/node_modules/storybook/dist/client-logger/index.js +0 -1
  233. package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.9.1_typescript@5._a0e195139f137e7eecc50e9c6275adcc/node_modules/storybook/dist/core-events/index.js +0 -1
  234. package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.9.1_typescript@5._a0e195139f137e7eecc50e9c6275adcc/node_modules/storybook/dist/instrumenter/index.js +0 -48
  235. package/dist/node_modules/.pnpm/storybook@9.1.13_@testing-library_dom@10.4.0_msw@2.7.3_@types_node@24.9.1_typescript@5._a0e195139f137e7eecc50e9c6275adcc/node_modules/storybook/dist/test/index.js +0 -217
  236. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/client/external.js +0 -0
  237. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/client/figma_client.js +0 -0
  238. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/common/fetch.js +0 -0
  239. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/common/logging.js +0 -0
  240. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/common/updates.js +0 -0
  241. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/external_types.js +0 -0
  242. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/figma_rest_api.js +0 -0
  243. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/helpers.js +0 -0
  244. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/connect/index_common.js +0 -0
  245. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/html/external.js +0 -0
  246. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/html/index_html.js +0 -0
  247. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/html/template_literal.js +0 -0
  248. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/react/external.js +0 -0
  249. /package/dist/node_modules/.pnpm/{@figma_code-connect@1.3.7 → @figma_code-connect@1.3.9}/node_modules/@figma/code-connect/dist/react/index_react.js +0 -0
  250. /package/dist/node_modules/.pnpm/{@vitest_browser@3.2.4_msw@2.7.3_@types_node@24.9.1_typescript@5.9.3__playwright@1.56.1__f267599ff27ed4cacb9e62a386256df6 → @vitest_browser@3.2.4_msw@2.7.3_@types_node@24.10.0_typescript@5.9.3__playwright@1.56.1_fa5be4b0345b48b65ec4b7072214c2b3}/node_modules/@vitest/browser/context.js +0 -0
  251. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/ParseError.js +0 -0
  252. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/PhoneNumber.js +0 -0
  253. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/constants.js +0 -0
  254. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/format.js +0 -0
  255. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/RFC3966.js +0 -0
  256. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +0 -0
  257. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js +0 -0
  258. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +0 -0
  259. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js +0 -0
  260. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +0 -0
  261. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +0 -0
  262. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +0 -0
  263. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js +0 -0
  264. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +0 -0
  265. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js +0 -0
  266. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +0 -0
  267. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +0 -0
  268. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +0 -0
  269. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js +0 -0
  270. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getNumberType.js +0 -0
  271. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +0 -0
  272. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/isObject.js +0 -0
  273. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +0 -0
  274. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js +0 -0
  275. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/parseDigits.js +0 -0
  276. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js +0 -0
  277. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/isPossible.js +0 -0
  278. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/isValid.js +0 -0
  279. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/metadata.js +0 -0
  280. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/normalizeArguments.js +0 -0
  281. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parse.js +0 -0
  282. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js +0 -0
  283. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parsePhoneNumber.js +0 -0
  284. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js +0 -0
  285. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js +0 -0
  286. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/es6/tools/semver-compare.js +0 -0
  287. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js +0 -0
  288. /package/dist/node_modules/.pnpm/{libphonenumber-js@1.12.24 → libphonenumber-js@1.12.26}/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js +0 -0
  289. /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.9.1_@vitest_browser@3.2.4_@vitest_ui@3._1eebb5b0859be5c5eee8a8981f7b0151 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -0
  290. /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.9.1_@vitest_browser@3.2.4_@vitest_ui@3._1eebb5b0859be5c5eee8a8981f7b0151 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -0
  291. /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.9.1_@vitest_browser@3.2.4_@vitest_ui@3._1eebb5b0859be5c5eee8a8981f7b0151 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -0
  292. /package/dist/node_modules/.pnpm/{vitest@3.2.4_@types_debug@4.1.12_@types_node@24.9.1_@vitest_browser@3.2.4_@vitest_ui@3._1eebb5b0859be5c5eee8a8981f7b0151 → vitest@3.2.4_@types_debug@4.1.12_@types_node@24.10.0_@vitest_browser@3.2.4_@vitest_ui@3_10880c0a9445bba638204ee93166eaed}/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -0
  293. /package/dist/packages/{web-components/src/tokens/primitive.tokens.scss.js → styles/src/gator/tokens/primitive.tokens.css.js} +0 -0
@@ -1,25 +1 @@
1
- import{getEnvKeystrokeText as Y,uid as Q,env as A,delay as Lt,createElement as x,KeystrokeHandler as E,FocusTracker as b,toUnit as te,global as d,Rect as T,DomEmitterMixin as ie,ObservableMixin as se,Collection as pe,isIterable as xe,CKEditorError as v,getOptimalPosition as me,logWarning as C,EmitterMixin as Ze,getVisualViewportOffset as K,isVisible as O,isNode as Je,priorities as Ft,isText as At,ResizeObserver as et,toArray as oe,first as Dt,parseBase64EncodedObject as tt,isRange as St}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Plugin as we,ContextPlugin as Mt}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconAccessibility as Ee,IconCancel as it,IconDropdownArrow as ne,IconDragIndicator as Nt,IconPilcrow as Wt,IconThreeVerticalDots as be,IconText as Gt,IconPlus as Rt,IconParagraph as Ht,IconImportExport as zt,IconBold as Ut,IconAlignLeft as $t,IconCheck as st,IconPreviousArrow as Kt,IconNextArrow as jt,IconColorPalette as Xt,IconEraser as qt,IconProjectLogo as Yt,IconColorTileCheck as Qt}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import Ie from"../../../../../color-parse@2.0.2/node_modules/color-parse/index.js";import ot from"../../../../../color-convert@3.1.0/node_modules/color-convert/index.js";import{HexBase as Zt}from"../../../../../vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/entrypoints/hex.js";import"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{assignIn as Jt}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/assignIn.js";import{isObject as Z}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isObject.js";import{cloneDeep as ge}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeep.js";import{debounce as fe}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/debounce.js";import{isElement as _e}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isElement.js";import{cloneDeepWith as ei}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js";import{throttle as ti}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/throttle.js";/**
2
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */class B extends pe{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,i,o)=>{this._renderViewIntoCollectionParent(i,o)}),this.on("remove",(t,i)=>{i.element&&this._parentElement&&i.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!ii(e))throw new v("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const o of e)i.delegate(o).to(t);this.on("add",(i,o)=>{for(const n of e)o.delegate(n).to(t)}),this.on("remove",(i,o)=>{for(const n of e)o.stopDelegating(n,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}function ii(s){return s.every(e=>typeof e=="string")}const si="http://www.w3.org/1999/xhtml";class V extends Ze(){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,Pe(Oe(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=Fe(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new v("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children)for(const i of t.children)J(i)?yield i:ke(i)&&(yield*e(i))}yield*e(this)}static bind(e,t){return{to(i,o){return new oi({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o})},if(i,o,n){return new nt({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:n})}}}static extend(e,t){if(e._isRendered)throw new v("template-extend-render",[this,e]);ct(e,Pe(Oe(t)))}_renderNode(e){let t;if(e.node?t=this.tag&&this.text:t=this.tag?this.text:!this.text,t)throw new v("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||si,this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),j(this.text)?this._bindToObservable({schema:this.text,updater:ri(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const o in this.attributes){const n=t.getAttribute(o),r=this.attributes[o];i&&(i.attributes[o]=n);const a=Le(r)?r[0].ns:null;if(j(r)){const l=Le(r)?r[0].value:r;i&&Ae(o)&&l.unshift(n),this._bindToObservable({schema:l,updater:li(t,o,a),data:e})}else if(o=="style"&&typeof r[0]!="string")this._renderStyleAttribute(r[0],e);else{i&&n&&Ae(o)&&r.unshift(n);const l=r.map(c=>c&&(c.value||c)).reduce((c,u)=>c.concat(u),[]).reduce(at,"");M(l)||t.setAttributeNS(a,o,l)}}}_renderStyleAttribute(e,t){const i=t.node;for(const o in e){const n=e[o];j(n)?this._bindToObservable({schema:[n],updater:ai(i,o),data:t}):i.style[o]=n}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let n=0;for(const r of this.children)if(Te(r)){if(!o){r.setParent(t);for(const a of r)i.appendChild(a.element)}}else if(J(r))o||(r.isRendered||r.render(),i.appendChild(r.element));else if(Je(r))i.appendChild(r);else if(o){const a=e.revertData,l=Fe();a.children.push(l),r._renderNode({intoFragment:!1,node:i.childNodes[n++],isApplying:!0,revertData:l})}else i.appendChild(r.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map(o=>{const[n,r]=t.split("@");return o.activateDomEventListener(n,r,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const o=i.revertData;rt(e,t,i);const n=e.filter(r=>!M(r)).filter(r=>r.observable).map(r=>r.activateAttributeListener(e,t,i));o&&o.bindings.push(n)}_revertTemplateFromNode(e,t){for(const o of t.bindings)for(const n of o)n();if(t.text){e.textContent=t.text;return}const i=e;for(const o in t.attributes){const n=t.attributes[o];n===null?i.removeAttribute(o):i.setAttribute(o,n)}for(let o=0;o<t.children.length;++o)this._revertTemplateFromNode(i.childNodes[o],t.children[o])}}class H{attribute;observable;emitter;callback;constructor(e){this.attribute=e.attribute,this.observable=e.observable,this.emitter=e.emitter,this.callback=e.callback}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){const o=()=>rt(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}}class oi extends H{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const o=(n,r)=>{(!t||r.target.matches(t))&&(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(r):this.observable.fire(this.eventNameOrFunction,r))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}}class nt extends H{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){const t=super.getValue(e);return M(t)?!1:this.valueIfTrue||!0}}function j(s){return s?(s.value&&(s=s.value),Array.isArray(s)?s.some(j):s instanceof H):!1}function ni(s,e){return s.map(t=>t instanceof H?t.getValue(e):t)}function rt(s,e,{node:t}){const i=ni(s,t);let o;s.length==1&&s[0]instanceof nt?o=i[0]:o=i.reduce(at,""),M(o)?e.remove():e.set(o)}function ri(s){return{set(e){s.textContent=e},remove(){s.textContent=""}}}function li(s,e,t){return{set(i){s.setAttributeNS(t,e,i)},remove(){s.removeAttributeNS(t,e)}}}function ai(s,e){return{set(t){s.style[e]=t},remove(){s.style[e]=null}}}function Oe(s){return ei(s,t=>{if(t&&(t instanceof H||ke(t)||J(t)||Te(t)))return t})}function Pe(s){if(typeof s=="string"?s=ui(s):s.text&&di(s),s.on&&(s.eventListeners=hi(s.on),delete s.on),!s.text){s.attributes&&ci(s.attributes);const e=[];if(s.children)if(Te(s.children))e.push(s.children);else for(const t of s.children)ke(t)||J(t)||Je(t)?e.push(t):e.push(new V(t));s.children=e}return s}function ci(s){for(const e in s)s[e].value&&(s[e].value=oe(s[e].value)),lt(s,e)}function hi(s){for(const e in s)lt(s,e);return s}function ui(s){return{text:[s]}}function di(s){s.text=oe(s.text)}function lt(s,e){s[e]=oe(s[e])}function at(s,e){return M(e)?s:M(s)?e:`${s} ${e}`}function Be(s,e){for(const t in e)s[t]?s[t].push(...e[t]):s[t]=e[t]}function ct(s,e){if(e.attributes&&(s.attributes||(s.attributes={}),Be(s.attributes,e.attributes)),e.eventListeners&&(s.eventListeners||(s.eventListeners={}),Be(s.eventListeners,e.eventListeners)),e.text&&s.text.push(...e.text),e.children&&e.children.length){if(s.children.length!=e.children.length)throw new v("ui-template-extend-children-mismatch",s);let t=0;for(const i of e.children)ct(s.children[t++],i)}}function M(s){return!s&&s!==0}function J(s){return s instanceof h}function ke(s){return s instanceof V}function Te(s){return s instanceof B}function Le(s){return Z(s[0])&&s[0].ns}function Fe(){return{children:[],bindings:[],attributes:{}}}function Ae(s){return s=="class"||s=="style"}class h extends ie(se()){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new pe,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=V.bind(this,this)}createCollection(e){const t=new B(e);return this._viewCollections.add(t),t}registerChild(e){xe(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){xe(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new V(e)}extendTemplate(e){V.extend(this.template,e)}render(){if(this.isRendered)throw new v("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}const De={POLITE:"polite",ASSERTIVE:"assertive"};class fi{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(const t of Object.values(De))this.announce("",t)})}announce(e,t=De.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new pi(i.locale),i.ui.view.body.add(this.view));const{politeness:o,isUnsafeHTML:n}=typeof t=="string"?{politeness:t}:t;let r=this.view.regionViews.find(a=>a.politeness===o);r||(r=new mi(i,o),this.view.regionViews.add(r)),r.announce({announcement:e,isUnsafeHTML:n})}}class pi extends h{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class mi extends h{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{this._pruneAnnouncementsInterval!==null&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)}),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval(()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()},5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;const i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}/**
5
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
6
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
7
- */function ht({emitter:s,activator:e,callback:t,contextElements:i,listenerOptions:o}){s.listenTo(document,"mousedown",(n,r)=>{if(!e())return;const a=typeof r.composedPath=="function"?r.composedPath():[],l=typeof i=="function"?i():i;for(const c of l)if(c.contains(r.target)||a.includes(c))return;t()},o)}/**
8
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
9
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
10
- */function to(s){class e extends s{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...i){super(...i),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return e}function wi(s){class e extends s{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...i){super(...i),this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(d.document,"mouseup",this._onDragEndBound),this.listenTo(d.document,"touchend",this._onDragEndBound),this.listenTo(d.document,"mousemove",this._onDragBound),this.listenTo(d.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(d.document,"mouseup",this._onDragEndBound),this.stopListening(d.document,"touchend",this._onDragEndBound),this.stopListening(d.document,"mousemove",this._onDragBound),this.stopListening(d.document,"touchmove",this._onDragBound)}_onDragStart(i,o){if(!this._isHandleElementPressed(o))return;this._attachDragListeners();let n=0,r=0;o instanceof MouseEvent?(n=o.clientX,r=o.clientY):(n=o.touches[0].clientX,r=o.touches[0].clientY),this._lastDraggingCoordinates={x:n,y:r},this.isDragging=!0}_onDrag(i,o){if(!this.isDragging){this._detachDragListeners();return}let n=0,r=0;o instanceof MouseEvent?(n=o.clientX,r=o.clientY):(n=o.touches[0].clientX,r=o.touches[0].clientY),o.preventDefault(),this.fire("drag",{deltaX:Math.round(n-this._lastDraggingCoordinates.x),deltaY:Math.round(r-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:n,y:r}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(i){return this.dragHandleElement?this.dragHandleElement===i.target||i.target instanceof HTMLElement&&this.dragHandleElement.contains(i.target):!1}}return e}/**
11
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
12
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
13
- */function io({view:s}){s.listenTo(s.element,"submit",(e,t)=>{t.preventDefault(),s.fire("submit")},{useCapture:!0})}/**
14
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
15
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
16
- */function bi({keystrokeHandler:s,focusTracker:e,gridItems:t,numberOfColumns:i,uiLanguageDirection:o}){const n=typeof i=="number"?()=>i:i;s.set("arrowright",r((c,u)=>o==="rtl"?l(c,u.length):a(c,u.length))),s.set("arrowleft",r((c,u)=>o==="rtl"?a(c,u.length):l(c,u.length))),s.set("arrowup",r((c,u)=>{let f=c-n();return f<0&&(f=c+n()*Math.floor(u.length/n()),f>u.length-1&&(f-=n())),f})),s.set("arrowdown",r((c,u)=>{let f=c+n();return f>u.length-1&&(f=c%n()),f}));function r(c){return u=>{const f=t.find(Bt=>Bt.element===e.focusedElement),w=t.getIndex(f),F=c(w,t);t.get(F).focus(),u.stopPropagation(),u.preventDefault()}}function a(c,u){return c===u-1?0:c+1}function l(c,u){return c===0?u-1:c-1}}class re extends h{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${Q()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class gi extends h{constructor(e,t){super(e);const i=e.t,o=new re;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[x(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map(t=>{const i=[x(document,"h3",{},t.label),...Array.from(t.groups.values()).map(o=>this._createGroup(o)).flat()];return t.description&&i.splice(1,0,x(document,"p",{},t.description)),x(document,"section",{},i)})}_createGroup(e){const t=e.keystrokes.sort((o,n)=>o.label.localeCompare(n.label)).map(o=>this._createGroupRow(o)).flat(),i=[x(document,"dl",{},t)];return e.label&&i.unshift(x(document,"h4",{},e.label)),i}_createGroupRow(e){const t=this.locale.t,i=x(document,"dt"),o=x(document,"dd"),n=ki(e.keystroke),r=[];for(const a of n)r.push(a.map(_i).join(""));return i.innerHTML=e.label,o.innerHTML=r.join(", ")+(e.mayRequireFn&&A.isMac?` ${t("(may require <kbd>Fn</kbd>)")}`:""),[i,o]}}function _i(s){return Y(s).split("+").map(e=>`<kbd>${e}</kbd>`).join("+")}function ki(s){return typeof s=="string"?[[s]]:typeof s[0]=="string"?[s]:s}class L extends h{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",t=>!t),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox"),"aria-hidden":!0}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!t)throw new v("ui-iconview-invalid-svg",this);const i=t.getAttribute("viewBox");i&&(this.viewBox=i);for(const{name:o,value:n}of Array.from(t.attributes))L.presentationalAttributeNames.includes(o)&&this.element.setAttribute(o,n);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}class ut extends h{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}class p extends h{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new ut){super(e);const i=this.bindTemplate,o=Q();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${o}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new L,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const n={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",r=>!r),i.if("isVisible","ck-hidden",r=>!r),i.to("isOn",r=>r?"ck-on":"ck-off"),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",r=>r||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,r=>!r),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(r=>{this.isEnabled?this.fire("execute"):r.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(r,a,l)=>!a||Se(l)?!1:String(!!r)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(r,a,l)=>!a||!Se(l)?!1:String(!!r)),A.isSafari&&(this._focusDelayed||(this._focusDelayed=Lt(()=>this.focus(),0)),n.on.mousedown=i.to(()=>{this._focusDelayed()}),n.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(n)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,t,i,o)=>{i&&!o?this.children.add(this.iconView,0):!i&&o&&this.children.remove(this.iconView)}),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new h;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Y(t))}]}),e}_getTooltipString(e,t,i){return e?typeof e=="string"?e:(i&&(i=Y(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}function Se(s){switch(s){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class Ti extends h{children;iconView;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new L,this.iconView.content=t.icon,this.children.add(this.iconView));const o=new h(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}}class N extends Ze(){focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let i=e.actions[t];typeof i=="string"&&(i=[i]);for(const o of i)e.keystrokeHandler.set(o,(n,r)=>{this[t](),r()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(le)||null}get last(){return this.focusables.filter(le).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,i)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=i),o}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;if(e&&this.focusables.getIndex(e)===this.current){this.fire("forwardCycle");return}e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;if(e&&this.focusables.getIndex(e)===this.current){this.fire("backwardCycle");return}e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){const t=()=>this.current===null?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",i=>{const o=t();this.focusNext(),o!==t()&&i.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",i=>{const o=t();this.focusPrevious(),o!==t()&&i.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){const t=this.focusables.length;if(!t)return null;const i=this.current;if(i===null)return this[e===1?"first":"last"];let o=this.focusables.get(i),n=(i+t+e)%t;do{const r=this.focusables.get(n);if(le(r)){o=r;break}n=(n+t+e)%t}while(n!==i);return o}}function le(s){return z(s)&&O(s.element)}function z(s){return"focus"in s&&typeof s.focus=="function"}function vi(s){return z(s)&&"focusCycler"in s&&s.focusCycler instanceof N}class yi extends h{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new E,this._focusTracker=new b,this._focusables=new B,this.focusCycler=new N({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const t of e){const i=new p(this.locale);let o;i.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(i);for(o in t)o!="onExecute"&&o!="onCreate"&&i.set(o,t[o]);this.children.add(i)}this._updateFocusCyclableItems()}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}}class Ci extends h{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}const g={SCREEN_CENTER:"screen-center",EDITOR_CENTER:"editor-center",EDITOR_TOP_SIDE:"editor-top-side",EDITOR_TOP_CENTER:"editor-top-center",EDITOR_BOTTOM_CENTER:"editor-bottom-center",EDITOR_ABOVE_CENTER:"editor-above-center",EDITOR_BELOW_CENTER:"editor-below-center"},Me=te("px");class ve extends wi(h){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i,keystrokeHandlerOptions:o}){super(e);const n=this.bindTemplate,r=e.t;this.set("className",""),this.set("ariaLabel",r("Editor dialog")),this.set("isModal",!1),this.set("position",g.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new E,this.focusTracker=new b,this._focusables=new B,this._focusCycler=new N({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:o}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",n.if("isModal","ck-dialog-overlay__transparent",a=>!a),n.if("_isVisible","ck-hidden",a=>!a)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",n.if("isModal","ck-dialog_modal"),n.to("className")],role:"dialog","aria-label":n.to("ariaLabel"),style:{top:n.to("_top",a=>Me(a)),left:n.to("_left",a=>Me(a)),visibility:n.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())}),this.on("drag",(e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)}),this.listenTo(d.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(d.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(e,t,i)=>{i&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:o,actionButtons:n}){t&&(this.headerView=new Ti(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),o&&(o instanceof h&&(o=[o]),this.contentView=new Ci(this.locale),this.contentView.children.addMany(o),this.parts.add(this.contentView)),n&&(this.actionsView=new yi(this.locale),this.actionsView.setButtons(n),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){const i=this._getViewportRect(),o=this._getDialogRect();e+o.width>i.right&&(e=i.right-o.width),e<i.left&&(e=i.left),t<i.top&&(t=i.top),this._moveTo(e,t)}_moveTo(e,t){this._left=e,this._top=t}moveBy(e,t){this.moveTo(this._left+e,this._top+t)}_moveOffScreen(){this._moveTo(-9999,-9999)}updatePosition(){if(!this.element||!this.element.parentNode)return;const e=this._getViewportRect();let t=this.position,i;this._getCurrentDomRoot()?i=this._getVisibleDomRootRect(e):t=g.SCREEN_CENTER;const o=ve.defaultOffset,n=this._getDialogRect();switch(t){case g.EDITOR_TOP_SIDE:{if(i){const r=this.locale.contentLanguageDirection==="ltr"?i.right-n.width-o:i.left+o;this.moveTo(r,i.top+o)}else this._moveOffScreen();break}case g.EDITOR_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),Math.round(i.top+i.height/2-n.height/2)):this._moveOffScreen();break}case g.SCREEN_CENTER:{this.moveTo(Math.round((e.width-n.width)/2),Math.round((e.height-n.height)/2));break}case g.EDITOR_TOP_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.top+o):this._moveOffScreen();break}case g.EDITOR_BOTTOM_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.bottom-n.height-o):this._moveOffScreen();break}case g.EDITOR_ABOVE_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.top-n.height-o):this._moveOffScreen();break}case g.EDITOR_BELOW_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.bottom+o):this._moveOffScreen();break}}}_getVisibleDomRootRect(e){let t=new T(this._getCurrentDomRoot()).getVisible();if(t){if(t=e.getIntersection(t),!t)return null}else return null;return t}_getDialogRect(){return new T(this.element.firstElementChild)}_getViewportRect(){const e=new T(d.window);if(this.isModal)return e;const t={top:0,bottom:0,left:0,right:0,...this._getViewportOffset()};return e.top+=t.top,e.height-=t.top,e.bottom-=t.bottom,e.height-=t.bottom,e.left+=t.left,e.right-=t.right,e.width-=t.left+t.right,e}_updateFocusCyclableItems(){const e=[];if(this.contentView)for(const t of this.contentView.children)z(t)&&e.push(t);this.actionsView&&e.push(this.actionsView),this.closeButtonView&&e.push(this.closeButtonView),e.forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element),vi(t)&&this._focusCycler.chain(t.focusCycler)})}_createCloseButton(){const e=new p(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:it}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}}class y extends we{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),y._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(e,t)=>{this._show(t)}),this.on("show",(e,t)=>{t.onShow&&t.onShow(this)},{priority:"low"}),this.on("hide",()=>{y._visibleDialogPlugin&&y._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",(t,i)=>{!this.isOpen||this.view.isModal||(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())})}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",()=>{if(!this.view)return;const t=e.document.differ.getChangedRoots();for(const i of t)i.state&&this.view.updatePosition()})}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:o=!0,content:n,actionButtons:r,className:a,isModal:l,position:c,onHide:u,keystrokeHandlerOptions:f}){const w=this.editor;this.view=new ve(w.locale,{getCurrentDomRoot:()=>w.editing.view.getDomRoot(w.model.document.selection.anchor.root.rootName),getViewportOffset:()=>w.ui.viewportOffset,keystrokeHandlerOptions:f});const F=this.view;F.on("close",()=>{this.hide()}),w.ui.view.body.add(F),w.keystrokes.listenTo(F.element),c||(c=l?g.SCREEN_CENTER:g.EDITOR_CENTER),l&&this._lockBodyScroll(),F.set({position:c,_isVisible:!0,className:a,isModal:l}),F.setupParts({icon:t,title:i,hasCloseButton:o,content:n,actionButtons:r}),this.id=e,u&&(this._onHide=u),this.isOpen=!0,y._visibleDialogPlugin=this}hide(){y._visibleDialogPlugin&&y._visibleDialogPlugin.fire(`hide:${y._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,y._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}class W extends p{_checkIconHolderView=new Vi;constructor(e,t=new ut){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(o,n)=>o||n)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,t,i)=>{const{children:o,_checkIconHolderView:n}=this;i?o.add(n,0):o.remove(n)})}}class Vi extends h{children;_checkIconView=this._createCheckIconView();constructor(){super();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",t=>t?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,t,i)=>{const{children:o,_checkIconView:n}=this;i&&!o.has(n)?o.add(n):!i&&o.has(n)&&o.remove(n)})}_createCheckIconView(){const e=new L;return e.content=st,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class dt extends W{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class so extends we{contentView=null;static get requires(){return[y]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{const i=this._createButton(p);return i.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),i}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{const i=this._createButton(dt);return i.label=t("Accessibility"),i}),e.keystrokes.set("Alt+0",(i,o)=>{this._toggleDialog(),o()}),this._setupRootLabels()}_createButton(e){const t=this.editor,i=t.plugins.get("Dialog"),o=t.locale,n=new e(o);return n.set({keystroke:"Alt+0",icon:Ee,isToggleable:!0}),n.on("execute",()=>this._toggleDialog()),n.bind("isOn").to(i,"id",r=>r==="accessibilityHelp"),n}_setupRootLabels(){const e=this.editor,t=e.editing.view,i=e.t;e.ui.on("ready",()=>{t.change(n=>{for(const r of t.document.roots)o(n,r)}),e.on("addRoot",(n,r)=>{const a=e.editing.view.document.getRoot(r.rootName);t.change(l=>o(l,a))},{priority:"low"})});function o(n,r){const l=[r.getAttribute("aria-label"),i("Press %0 for help.",[Y("Alt+0")])].filter(c=>c).join(". ");n.setAttribute("aria-label",l,r)}}_toggleDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new gi(e.locale,e.accessibility.keystrokeInfos)),t.id==="accessibilityHelp"?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:Ee,hasCloseButton:!0,content:this.contentView})}}class _ extends B{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new V({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),(!_._bodyWrapper||!_._bodyWrapper.isConnected)&&(_._bodyWrapper=x(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(_._bodyWrapper)),_._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),_._bodyWrapper&&!_._bodyWrapper.childElementCount&&(_._bodyWrapper.remove(),delete _._bodyWrapper)}}const Ne=te("px"),xi={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class k extends h{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",i=>`ck-balloon-panel_${i}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",Ne),left:t.to("left",Ne)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){const t=X(e.target);if(t&&!O(t))return!1;this.show();const i=k.defaultPositions,o=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:d.document.body,fitInViewport:!0},e),n=k._getOptimalPosition(o)||xi,r=parseInt(n.left),a=parseInt(n.top),l=n.name,c=n.config||{},{withArrow:u=!0}=c;return this.top=a,this.left=r,this.position=l,this.withArrow=u,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let t=X(e.target);const i=e.limiter?X(e.limiter):d.document.body;if(this.listenTo(d.document,"scroll",(o,n)=>{const r=n.target,a=t&&r.contains(t),l=i&&r.contains(i);(a||l||!t||!i)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(d.window,"resize",()=>{this.attachTo(e)}),!this._resizeObserver&&(t&&At(t)&&(t=t.parentElement),t)){const o=()=>{O(t)||this.unpin()};this._resizeObserver=new et(t,o)}return!0}_stopPinning(){this.stopListening(d.document,"scroll"),this.stopListening(d.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){const{sideOffset:t=k.arrowSideOffset,heightOffset:i=k.arrowHeightOffset,stickyVerticalOffset:o=k.stickyVerticalOffset,config:n}=e;return{northWestArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left-t,name:"arrow_sw",...n&&{config:n}}),northWestArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left-c.width*.25-t,name:"arrow_smw",...n&&{config:n}}),northWestArrowSouth:(l,c)=>({top:r(l,c),left:l.left-c.width/2,name:"arrow_s",...n&&{config:n}}),northWestArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left-c.width*.75+t,name:"arrow_sme",...n&&{config:n}}),northWestArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left-c.width+t,name:"arrow_se",...n&&{config:n}}),northArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-t,name:"arrow_sw",...n&&{config:n}}),northArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.25-t,name:"arrow_smw",...n&&{config:n}}),northArrowSouth:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width/2,name:"arrow_s",...n&&{config:n}}),northArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.75+t,name:"arrow_sme",...n&&{config:n}}),northArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width+t,name:"arrow_se",...n&&{config:n}}),northEastArrowSouthWest:(l,c)=>({top:r(l,c),left:l.right-t,name:"arrow_sw",...n&&{config:n}}),northEastArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.right-c.width*.25-t,name:"arrow_smw",...n&&{config:n}}),northEastArrowSouth:(l,c)=>({top:r(l,c),left:l.right-c.width/2,name:"arrow_s",...n&&{config:n}}),northEastArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.right-c.width*.75+t,name:"arrow_sme",...n&&{config:n}}),northEastArrowSouthEast:(l,c)=>({top:r(l,c),left:l.right-c.width+t,name:"arrow_se",...n&&{config:n}}),southWestArrowNorthWest:l=>({top:a(l),left:l.left-t,name:"arrow_nw",...n&&{config:n}}),southWestArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left-c.width*.25-t,name:"arrow_nmw",...n&&{config:n}}),southWestArrowNorth:(l,c)=>({top:a(l),left:l.left-c.width/2,name:"arrow_n",...n&&{config:n}}),southWestArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left-c.width*.75+t,name:"arrow_nme",...n&&{config:n}}),southWestArrowNorthEast:(l,c)=>({top:a(l),left:l.left-c.width+t,name:"arrow_ne",...n&&{config:n}}),southArrowNorthWest:l=>({top:a(l),left:l.left+l.width/2-t,name:"arrow_nw",...n&&{config:n}}),southArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.25-t,name:"arrow_nmw",...n&&{config:n}}),southArrowNorth:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width/2,name:"arrow_n",...n&&{config:n}}),southArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.75+t,name:"arrow_nme",...n&&{config:n}}),southArrowNorthEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width+t,name:"arrow_ne",...n&&{config:n}}),southEastArrowNorthWest:l=>({top:a(l),left:l.right-t,name:"arrow_nw",...n&&{config:n}}),southEastArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.right-c.width*.25-t,name:"arrow_nmw",...n&&{config:n}}),southEastArrowNorth:(l,c)=>({top:a(l),left:l.right-c.width/2,name:"arrow_n",...n&&{config:n}}),southEastArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.right-c.width*.75+t,name:"arrow_nme",...n&&{config:n}}),southEastArrowNorthEast:(l,c)=>({top:a(l),left:l.right-c.width+t,name:"arrow_ne",...n&&{config:n}}),westArrowEast:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.left-c.width-i,name:"arrow_e",...n&&{config:n}}),eastArrowWest:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.right+i,name:"arrow_w",...n&&{config:n}}),viewportStickyNorth:(l,c,u)=>{const f=new T(d.document.body).getIntersection(u.getVisible());if(!f)return null;const w=f.getVisible();return!l.getIntersection(w)||!(w.top-l.top-o<c.height&&w.bottom-l.bottom<c.height)?null:{top:w.top+o,left:l.left+l.width/2-c.width/2,name:"arrowless",config:{withArrow:!1,...n}}}};function r(l,c){return l.top-c.height-i}function a(l){return l.bottom+i}}static arrowSideOffset=25;static arrowHeightOffset=10;static stickyVerticalOffset=20;static _getOptimalPosition=me;static defaultPositions=k.generatePositions()}function X(s){return _e(s)?s:St(s)?s.commonAncestorContainer:typeof s=="function"?X(s()):null}const Ei=50,Ii=350;class ft extends ie(){editor;_balloonView=null;_showBalloonThrottled=ti(()=>this._showBalloon(),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",()=>this._handleEditorReady())}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(t,i,o)=>{this._updateLastFocusedEditableElement(),o?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(t,i,o)=>{this._updateLastFocusedEditableElement(),o&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:this.editor.locale.contentLanguageDirection==="ltr"?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,t=new k,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),t=e.side==="right"?Oi(this._lastFocusedEditableElement,e):Pi(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i){this._lastFocusedEditableElement=null;return}const o=Array.from(e.ui.getEditableElementsNames()).map(n=>e.ui.getEditableElement(n));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}}function Oi(s,e){return pt(s,e,(t,i)=>t.left+t.width-i.width-e.horizontalOffset)}function Pi(s,e){return pt(s,e,t=>t.left+e.horizontalOffset)}function pt(s,e,t){return(i,o)=>{const n=new T(s);if(n.width<Ii||n.height<Ei)return null;let r;e.position==="inside"?r=n.bottom-o.height:r=n.bottom-o.height/2,r-=e.verticalOffset;const a=t(n,o),c=i.clone().moveTo(a,r).getIntersection(o.clone().moveTo(a,r)).getVisible();return!c||c.getArea()<o.getArea()?null:{top:r,left:a,name:`position_${e.position}-side_${e.side}`,config:{withArrow:!1}}}}const Bi="Powered by";class Li extends ft{constructor(e){super(e,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){const e=this.editor;if(e.config.get("ui.poweredBy.forceVisible"))return!0;const i=e.config.get("licenseKey");if(i=="GPL")return!0;const o=tt(i.split(".")[1]);return o?!o.whiteLabel:!0}_createBadgeContent(){return new Fi(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o=i==="inside"?5:e.verticalOffset;return{position:i,side:t.side||e.side,label:t.label===void 0?Bi:t.label,verticalOffset:t.verticalOffset!==void 0?t.verticalOffset:o,horizontalOffset:t.horizontalOffset!==void 0?t.horizontalOffset:e.horizontalOffset,forceVisible:!!t.forceVisible}}}class Fi extends h{constructor(e,t){super(e);const i=new L,o=this.bindTemplate;i.set({content:Yt,isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:o.to(n=>n.preventDefault())}}]})}}class mt extends p{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new h;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class oo extends wt(p){}class Ai extends wt(W){}function wt(s){class e extends s{_fileInputView;constructor(...i){super(...i),this._fileInputView=new Di(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}return e}class Di extends h{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class no extends h{buttonView;children;constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new p(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:ne}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",i=>!i),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}}/**
17
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
18
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
19
- */function ro(s,e){const t=s.t,i={Black:t("Black"),"Dim grey":t("Dim grey"),Grey:t("Grey"),"Light grey":t("Light grey"),White:t("White"),Red:t("Red"),Orange:t("Orange"),Yellow:t("Yellow"),"Light green":t("Light green"),Green:t("Green"),Aquamarine:t("Aquamarine"),Turquoise:t("Turquoise"),"Light blue":t("Light blue"),Blue:t("Blue"),Purple:t("Purple")};return e.map(o=>{const n=i[o.label];return n&&n!=o.label&&(o.label=n),o})}function lo(s){return s.map(Si).filter(e=>!!e)}function Si(s){return typeof s=="string"?{model:s,label:s,hasBorder:!1,view:{name:"span",styles:{color:s}}}:{model:s.color,label:s.label||s.color,hasBorder:s.hasBorder===void 0?!1:s.hasBorder,view:{name:"span",styles:{color:`${s.color}`}}}}class bt extends p{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon=Qt,this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",i=>A.isMediaForcedColors?null:i)},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class We extends h{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);const i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t?.columns||5;const o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this.items.on("add",(n,r)=>{r.isOn=r.color===this.selectedColor}),i.forEach(n=>{const r=new bt;r.set({color:n.color,label:n.label,tooltip:!0,hasBorder:n.options.hasBorder}),r.on("execute",()=>{this.fire("execute",{value:n.color,hasBorder:n.options.hasBorder,label:n.label})}),this.items.add(r)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(n,r,a)=>{for(const l of this.items)l.isOn=l.color===a})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),bi({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale?.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}function gt(s,e){if(!s)return"";const t=_t(s);if(!t)return"";if(t.space===e)return s;if(!Gi(t))return"";const o=ot[t.space][e];if(!o)return"";const n=o(t.space==="hex"?t.hexValue:t.values);return Wi(n,e)}function Mi(s){if(!s)return"";const e=_t(s);return e?e.space==="hex"?e.hexValue:gt(s,"hex"):"#000"}function Ni(s,e){customElements.get(s)===void 0&&customElements.define(s,e)}function Wi(s,e){switch(e){case"hex":return`#${s}`;case"rgb":return`rgb(${s[0]}, ${s[1]}, ${s[2]})`;case"hsl":return`hsl(${s[0]}, ${s[1]}%, ${s[2]}%)`;case"hwb":return`hwb(${s[0]}, ${s[1]}, ${s[2]})`;case"lab":return`lab(${s[0]}% ${s[1]} ${s[2]})`;case"lch":return`lch(${s[0]}% ${s[1]} ${s[2]})`;default:return""}}function _t(s){if(s.startsWith("#")){const t=Ie(s);return{space:"hex",values:t.values,hexValue:s,alpha:t.alpha}}const e=Ie(s);return e.space?e:null}function Gi(s){return Object.keys(ot).includes(s.space)}class Ri extends h{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);const i=`ck-labeled-field-view-${Q()}`,o=`ck-labeled-field-view-status-${Q()}`;this.fieldView=t(this,i,o),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(r,a)=>r||a);const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",r=>!r),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new re(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new h(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",o=>!o)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class Hi extends h{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new b,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to((...i)=>{this.fire("input",...i),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=zi(this.element)}_setDomElementValue(e){this.element.value=!e&&e!==0?"":e}}function zi(s){return!s.value}class kt extends Hi{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class Ui extends kt{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class $i extends kt{constructor(e,{min:t,max:i,step:o}={}){super(e);const n=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",o),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:n.to("min"),max:n.to("max"),step:n.to("step")}})}}class Ki extends h{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",i=>`ck-dropdown__panel_${i}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(){if(this.children.length){const e=this.children.first;typeof e.focus=="function"?e.focus():C("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}}class ee extends h{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new E,this.focusTracker=new b,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",n=>!n)],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":o.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(t,i,o)=>{if(o)if(this.panelPosition==="auto"){const n=ee._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=n?n.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);const e=(t,i)=>{this.isOpen&&(this.isOpen=!1,i())};this.keystrokes.set("arrowdown",(t,i)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,i())}),this.keystrokes.set("arrowright",(t,i)=>{this.isOpen&&i()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:i,southWest:o,northEast:n,northWest:r,southMiddleEast:a,southMiddleWest:l,northMiddleEast:c,northMiddleWest:u}=ee.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[i,o,a,l,e,n,r,c,u,t]:[o,i,l,a,e,r,n,u,c,t]}get _defaultPanelPositionName(){return this.locale.uiLanguageDirection==="rtl"?"sw":"se"}static defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)*3/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)*3/4,name:"nmw"})};static _getOptimalPosition=me}class ji extends p{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",t=>String(t))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new L;return e.content=ne,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class P extends h{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",i=>!i)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class ye extends h{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class q extends h{labelView;items;children;constructor(e,t=new re){super(e);const i=this.bindTemplate,o=new Ce(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,o]),o.set({role:"group",ariaLabelledBy:t.id}),o.focusTracker.destroy(),o.keystrokes.destroy(),this.items=o.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",n=>!n)]},children:this.children})}focus(){if(this.items){const e=this.items.find(t=>!(t instanceof ye));e&&e.focus()}}}class Ce extends h{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);const t=this.bindTemplate;this.focusables=new B,this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this._focusCycler=new N({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof q?this._registerFocusableItemsGroup(e):e instanceof P&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(const i of t.removed)i instanceof q?this._deregisterFocusableItemsGroup(i):i instanceof P&&this._deregisterFocusableListItem(i);for(const i of Array.from(t.added).reverse())i instanceof q?this._registerFocusableItemsGroup(i,t.index):this._registerFocusableListItem(i,t.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(const o of i.removed)this._deregisterFocusableListItem(o);for(const o of Array.from(i.added).reverse())this._registerFocusableListItem(o,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach((o,n)=>{const r=typeof t<"u"?t+n:void 0;this._registerFocusableListItem(o,r)});const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}class Tt extends h{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Xi extends h{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}/**
20
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
21
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
22
- */function qi(s){return s.bindTemplate.to(e=>{e.target===s.element&&e.preventDefault()})}/**
23
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
24
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
25
- */function Yi(s){if(Array.isArray(s))return{items:s,removeItems:[]};const e={items:[],removeItems:[]};return s?{...e,...s}:e}const Qi={alignLeft:$t,bold:Ut,importExport:zt,paragraph:Ht,plus:Rt,text:Gt,threeVerticalDots:be,pilcrow:Wt,dragIndicator:Nt};class Zi extends h{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);const i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new Ji(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const n=e.uiLanguageDirection==="rtl";this._focusCycler=new N({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&r.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:r,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:qi(this)}}),this._behavior=this.options.shouldGroupWhenFull?new Re(this):new Ge(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",(e,t)=>{this.focusTracker.add(t)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),e==="dynamic"?(this._behavior=new Re(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new Ge(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){const o=Yi(e),n=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,n).map(a=>Z(a)?this._createNestedToolbarDropdown(a,t,n):a==="|"?new Tt:a==="-"?new Xi:t.create(a)).filter(a=>!!a)}_cleanItemsConfiguration(e,t,i){const o=e.filter((n,r,a)=>n==="|"?!0:i.indexOf(n)!==-1?!1:n==="-"?this.options.shouldGroupWhenFull?(C("toolbarview-line-break-ignored-when-grouping-items",a),!1):!0:!Z(n)&&!t.has(n)?(C("toolbarview-item-unavailable",{item:n}),!1):!0);return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){const t=r=>r!=="-"&&r!=="|",i=e.length,o=e.findIndex(t);if(o===-1)return[];const n=i-e.slice().reverse().findIndex(t);return e.slice(o,n).filter((r,a,l)=>t(r)?!0:!(a>0&&l[a-1]===r))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:n,items:r,tooltip:a=!0,withText:l=!1}=e;if(r=this._cleanItemsConfiguration(r,t,i),!r.length)return null;const c=this.locale,u=Ve(c);return o||C("toolbarview-nested-toolbar-dropdown-missing-label",e),u.class="ck-toolbar__nested-toolbar-dropdown",u.buttonView.set({label:o,tooltip:a,withText:!!l}),n!==!1?u.buttonView.icon=Qi[n]||n||be:u.buttonView.withText=!0,vt(u,()=>u.toolbarView._buildItemsFromConfig(r,t,i)),u}}class Ji extends h{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Ge{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(t=>t),e.focusables.bindTo(e.items).using(t=>z(t)?t:null)}render(){}destroy(){}}class Re{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(t,i)=>{const o=i.index,n=Array.from(i.added);for(const r of i.removed)o>=this.ungroupedItems.length?this.groupedItems.remove(r):this.ungroupedItems.remove(r);for(let r=o;r<o+n.length;r++){const a=n[r-o];r>this.ungroupedItems.length?this.groupedItems.add(a,r-this.ungroupedItems.length):this.ungroupedItems.add(a,r)}this._updateGrouping()})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){const e=this.view;if(e.items.length){for(let t=0;t<e.items.length;t++){const i=[...e.items][t];this.ungroupedItems.add(i,t)}this._updateGrouping()}}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!O(this.viewElement)){this.shouldUpdateGroupingOnNextResize=!0;return}const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,i=new T(e.lastChild),o=new T(e);if(!this.cachedPadding){const n=d.window.getComputedStyle(e),r=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(n[r])}return t==="ltr"?i.right>o.right-this.cachedPadding:i.left<o.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new et(this.viewElement,t=>{(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize)&&(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Tt),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,i=Ve(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",vt(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:be}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{z(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class es extends h{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new E,this.focusTracker=new b,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",o=>!o),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const t=e||new p;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const e=new p,t=e.bindTemplate;return e.icon=ne,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function Ve(s,e=ji){const t=typeof e=="function"?new e(s):e,i=new Ki(s),o=new ee(s,t,i);return t.bind("isEnabled").to(o),t instanceof es?t.arrowView.bind("isOn").to(o,"isOpen"):t.bind("isOn").to(o,"isOpen"),ts(o),o}function vt(s,e,t={}){s.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),s.isOpen?He(s,e,t):s.once("change:isOpen",()=>He(s,e,t),{priority:"highest"}),t.enableActiveItemFocusOnDropdownOpen&&yt(s,()=>s.toolbarView.items.find(i=>i.isOn))}function He(s,e,t){const i=s.locale,o=i.t,n=s.toolbarView=new Zi(i),r=typeof e=="function"?e():e;n.ariaLabel=t.ariaLabel||o("Dropdown toolbar"),t.maxWidth&&(n.maxWidth=t.maxWidth),t.class&&(n.class=t.class),t.isCompact&&(n.isCompact=t.isCompact),t.isVertical&&(n.isVertical=!0),r instanceof B?n.items.bindTo(r).using(a=>a):n.items.addMany(r),s.panelView.children.add(n),s.focusTracker.add(n),n.items.delegate("execute").to(s)}function ao(s,e,t={}){s.isOpen?ze(s,e,t):s.once("change:isOpen",()=>ze(s,e,t),{priority:"highest"}),yt(s,()=>s.listView.items.find(i=>i instanceof P?i.children.first.isOn:!1))}function ze(s,e,t){const i=s.locale,o=s.listView=new Ce(i),n=typeof e=="function"?e():e;o.ariaLabel=t.ariaLabel,o.role=t.role,Vt(s,o.items,n,i),s.panelView.children.add(o),o.items.delegate("execute").to(s)}function yt(s,e){s.on("change:isOpen",()=>{if(!s.isOpen)return;const t=e();t&&(typeof t.focus=="function"?t.focus():C("ui-dropdown-focus-child-on-open-child-missing-focus",{view:t}))},{priority:Ft.low-10})}function ts(s){is(s),ss(s),os(s),ns(s),rs(s),ls(s)}function is(s){ht({emitter:s,activator:()=>s.isRendered&&s.isOpen,callback:()=>{s.isOpen=!1},contextElements:()=>[s.element,...Ct(s.focusTracker).filter(e=>!s.element.contains(e))]})}function Ct(s){return[...s.elements,...s.externalViews.flatMap(e=>Ct(e.focusTracker))]}function ss(s){s.on("execute",e=>{e.source instanceof mt||(s.isOpen=!1)})}function os(s){s.focusTracker.on("change:isFocused",(e,t,i)=>{i||!s.isOpen||(s.isOpen=!1)})}function ns(s){s.keystrokes.set("arrowdown",(e,t)=>{s.isOpen&&(s.panelView.focus(),t())}),s.keystrokes.set("arrowup",(e,t)=>{s.isOpen&&(s.panelView.focusLast(),t())})}function rs(s){s.on("change:isOpen",(e,t,i)=>{if(i)return;s.focusTracker.elements.some(n=>n.contains(d.document.activeElement))&&s.buttonView.focus()})}function ls(s){s.on("change:isOpen",(e,t,i)=>{i&&s.panelView.focus()},{priority:"low"})}function Vt(s,e,t,i){as(e),e.bindTo(t).using(o=>{if(o.type==="separator")return new ye(i);if(o.type==="group"){const n=new q(i);return n.set({label:o.label}),Vt(s,n.items,o.items,i),n.items.delegate("execute").to(s),n}else if(o.type==="button"||o.type==="switchbutton"){const n=o.model.role==="menuitemcheckbox"||o.model.role==="menuitemradio",r=new P(i);let a;return o.type==="button"?(a=new W(i),a.set({isToggleable:n})):a=new mt(i),a.bind(...Object.keys(o.model)).to(o.model),a.delegate("execute").to(r),r.children.add(a),r}return null})}function as(s){let e=0;const t=n=>!(n instanceof P)||!(n.children.first instanceof W)?null:n.children.first,i=n=>{const r=t(n);return!r||!r.isToggleable?null:r},o=n=>{for(const r of s){const a=t(r);a&&(a.hasCheckSpace=n)}};s.on("change",(n,r)=>{const a=e>0;for(const c of r.removed)i(c)&&e--;for(const c of r.added){const u=t(c);u&&(u.isToggleable&&e++,u.hasCheckSpace=e>0)}const l=e>0;a!==l&&o(l)})}const cs=(s,e,t)=>{const i=new Ui(s.locale);return i.set({id:e,ariaDescribedById:t}),i.bind("isReadOnly").to(s,"isEnabled",o=>!o),i.bind("hasError").to(s,"errorText",o=>!!o),i.on("input",()=>{s.errorText=null}),s.bind("isEmpty","isFocused","placeholder").to(i),i},co=(s,e,t)=>{const i=new $i(s.locale);return i.set({id:e,ariaDescribedById:t,inputMode:"numeric"}),i.bind("isReadOnly").to(s,"isEnabled",o=>!o),i.bind("hasError").to(s,"errorText",o=>!!o),i.on("input",()=>{s.errorText=null}),s.bind("isEmpty","isFocused","placeholder").to(i),i},ho=(s,e,t)=>{const i=Ve(s.locale);return i.set({id:e,ariaDescribedById:t}),i.bind("isEnabled").to(s),i},hs=150;class us extends h{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=fe(o=>{this.set("color",o),this.fire("colorSelected",{color:this.color})},hs,{leading:!0}),this.on("set:color",(o,n,r)=>{o.return=gt(r,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=ae(this.color)}),this.on("change:_hexColor",()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),ae(this.color)!=ae(this._hexColor)&&(this.color=this._hexColor)})}render(){if(super.render(),Ni("hex-color-picker",Zt),this.picker=d.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);const e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",e=>{const t=e.detail.value;this._debounceColorPickerEvent(t)})}focus(){/* istanbul ignore next -- @preserve */!this._config.hideInput&&(A.isGecko||A.isiOS||A.isSafari||A.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){const i=[...this.picker.shadowRoot.children].filter(o=>o.getAttribute("role")==="slider").map(o=>new ds(o));this.slidersView=this.createCollection(),i.forEach(o=>{this.slidersView.add(o)})}_createInputRow(){const e=this._createColorInput();return new ps(this.locale,e)}_createColorInput(){const e=new Ri(this.locale,cs),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",i=>e.isFocused?e.fieldView.value:i.startsWith("#")?i.substring(1):i),e.fieldView.on("input",()=>{const i=e.fieldView.element.value;if(i){const o=xt(i);o&&this._debounceColorPickerEvent(o)}}),e}isValid(){const{t:e}=this.locale;return this._config.hideInput?!0:(this.resetValidationStatus(),this.hexInputRow.getParsedColor()?!0:(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function ae(s){let e=Mi(s);return e||(e="#000"),e.length===4&&(e="#"+[e[1],e[1],e[2],e[2],e[3],e[3]].join("")),e.toLowerCase()}class ds extends h{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class fs extends h{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class ps extends h{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new fs,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return xt(this.inputView.fieldView.element.value)}}function xt(s){if(!s)return null;const e=s.trim().replace(/^#/,"");return![3,4,6,8].includes(e.length)||!/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(e)?null:`#${e}`}class ms extends se(pe){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,t){return this.find(i=>i.color===e.color)?this:super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}class ws extends h{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:a,focusTracker:l,focusables:c}){super(e);const u=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=l,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new ms,this.documentColorsCount=r,this._focusables=c,this._removeButtonLabel=o,this._colorPickerLabel=a,this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",u.if("isVisible","ck-hidden",f=>!f)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){const i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(const n of i.getRoots()){const r=e.createRangeIn(n);for(const a of r.getItems())if(a.is("$textProxy")&&a.hasAttribute(t)&&(this._addColorToDocumentColors(a.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){const e=V.bind(this.documentColors,this.documentColors),t=new h(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new p,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:Xt,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){const e=new p;return e.set({withText:!0,icon:qt,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",()=>{this.fire("execute",{value:null,source:"removeColorButton"})}),e.render(),e}_createStaticColorsGrid(){const e=new We(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(t,i)=>{this.fire("execute",{value:i.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){const e=V.bind(this.documentColors,this.documentColors),t=new We(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(i=>{const o=new bt;return o.set({color:i.color,hasBorder:i.options?.hasBorder}),i.label&&o.set({label:i.label,tooltip:!0}),o.on("execute",()=>{this.fire("execute",{value:i.color,source:"documentColorsGrid"})}),o}),this.documentColors.on("change:isEmpty",(i,o,n)=>{n&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(i=>i.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class bs extends h{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:n}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=o,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=n;const r=this.bindTemplate,{saveButtonView:a,cancelButtonView:l}=this._createActionButtons();this.saveButtonView=a,this.cancelButtonView=l,this.actionBarView=this._createActionBarView({saveButtonView:a,cancelButtonView:l}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",r.if("isVisible","ck-hidden",c=>!c)]},children:this.items})}render(){super.render();const e=new us(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",(t,i,o)=>{e.color=o}),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())})}_stopPropagationOnArrowsKeys(){const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(const t of this.colorPickerView.slidersView)this.focusTracker.add(t.element),this._focusables.add(t);const e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){const i=new h,o=this.createCollection();return o.add(e),o.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),i}_createActionButtons(){const e=this.locale,t=e.t,i=new p(e),o=new p(e);return i.set({icon:st,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:it,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})}),o.on("execute",()=>{this.fire("colorPicker:cancel")}),{saveButtonView:i,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",(e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)})}}class uo extends h{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:a,colorPickerViewConfig:l}){super(e),this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this._focusables=new B,this._colorPickerViewConfig=l,this._focusCycler=new N({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new ws(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:a,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new bs(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:l}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",(c,u,f)=>{this.colorGridsFragmentView.set("selectedColor",f),this.colorPickerFragmentView.set("selectedColor",f)}),this.colorGridsFragmentView.on("change:selectedColor",(c,u,f)=>{this.set("selectedColor",f)}),this.colorPickerFragmentView.on("change:selectedColor",(c,u,f)=>{this.set("selectedColor",f)}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){!this.colorPickerFragmentView.colorPickerView||this._isColorPickerFragmentVisible||(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){this.items.length!==2&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",()=>{this.showColorPickerFragment()}),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class gs{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(ce(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new v("componentfactory-item-missing",this,{name:e});return this._components.get(ce(e)).callback(this.editor.locale)}has(e){return this._components.has(ce(e))}}function ce(s){return String(s).toLowerCase()}const Ue="ck-tooltip";class m extends ie(){tooltipTextView;balloonPanelView;static defaultBalloonPositions=k.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(e){if(super(),m._editors.add(e),m._instance)return m._instance;m._instance=this,this.tooltipTextView=new h(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new k(e.locale),this.balloonPanelView.class=Ue,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=_s(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=fe(this._pinTooltip,600),this._unpinTooltipDebounced=fe(this._unpinTooltip,400),this.listenTo(d.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(d.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(d.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(d.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(d.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(d.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;m._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),m._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),m._instance=null)}static getPositioningFunctions(e){const t=m.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onKeyDown(e,t){t.key==="Escape"&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){const i=he(t);if(!i){e.name==="focus"&&this._unpinTooltip();return}if(i===this._currentElementWithTooltip){this._unpinTooltipDebounced.cancel();return}this._unpinTooltip(),e.name==="focus"&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,ue(i)):this._pinTooltipDebounced(i,ue(i))}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if(e.name==="mouseleave"){if(!_e(t))return;const o=this.balloonPanelView.element,n=o&&(o===i||o.contains(i)),r=!n&&t===o;if(n){this._unpinTooltipDebounced.cancel();return}if(!r&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const a=he(t),l=he(i);(r||a&&a!==l)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||a&&a.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:i,cssClass:o}){this._unpinTooltip();const n=Dt(m._editors.values()).ui.view.body;n.has(this.balloonPanelView)||n.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[Ue,o].filter(r=>r).join(" "),this.balloonPanelView.pin({target:e,positions:m.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(const r of m._editors)this.listenTo(r.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of m._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=ue(this._currentElementWithTooltip);if(!O(this._currentElementWithTooltip)||!e.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:m.getPositioningFunctions(e.position)})}}function he(s){return _e(s)?s.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function ue(s){return{text:s.dataset.ckeTooltipText,position:s.dataset.ckeTooltipPosition||"s",cssClass:s.dataset.ckeTooltipClass||""}}function _s(s){const e=new MutationObserver(()=>{s()});return{attach(t){e.observe(t,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){e.disconnect()}}}class ks extends ft{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){const t=this.editor.config.get("licenseKey"),i=$e(t);return!!(i&&this.licenseTypeMessage[i])}_createBadgeContent(){const e=this.editor.config.get("licenseKey"),t=$e(e);return new Ts(this.editor.locale,this.licenseTypeMessage[t])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o=t.side||e.side;return{position:i,side:o==="left"?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class Ts extends h{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}}function $e(s){if(s=="GPL")return"GPL";const e=tt(s.split(".")[1]);return e?e.licenseType||"production":null}class Et extends P{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}const U=5,D={toggleMenusAndFocusItemsOnHover(s){s.on("menu:mouseenter",e=>{if(!(!s.isFocusBorderEnabled&&!s.isOpen)){if(s.isOpen)for(const t of s.menus){const i=e.path[0],o=i instanceof Et&&i.children.first===t;t.isOpen=(e.path.includes(t)||o)&&t.isEnabled}e.source.focus()}})},focusCycleMenusOnArrows(s){const e=s.locale.uiLanguageDirection==="rtl";s.on("menu:arrowright",i=>{t(i.source,e?-1:1)}),s.on("menu:arrowleft",i=>{t(i.source,e?1:-1)});function t(i,o){const n=s.children.getIndex(i),r=i.isOpen,a=s.children.length,l=s.children.get((n+a+o)%a);i.isOpen=!1,r&&(l.isOpen=!0),l.buttonView.focus()}},closeMenusWhenTheBarCloses(s){s.on("change:isOpen",()=>{s.isOpen||s.menus.forEach(e=>{e.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(s){s.on("menu:change:isOpen",(e,t,i)=>{i&&s.menus.filter(o=>e.source.parentMenuView===o.parentMenuView&&e.source!==o&&o.isOpen).forEach(o=>{o.isOpen=!1})})},closeOnClickOutside(s){ht({emitter:s,activator:()=>s.isOpen,callback:()=>s.close(),contextElements:()=>s.children.map(e=>e.element)})},enableFocusHighlightOnInteraction(s){let e=!1;s.on("change:isOpen",(t,i,o)=>{o||(e||(s.isFocusBorderEnabled=!1),e=!1)}),s.listenTo(s.element,"keydown",()=>{e=!0},{useCapture:!0}),s.listenTo(s.element,"keyup",()=>{e=!1},{useCapture:!0}),s.listenTo(s.element,"focus",()=>{e&&(s.isFocusBorderEnabled=!0)},{useCapture:!0})}},I={openAndFocusPanelOnArrowDownKey(s){s.keystrokes.set("arrowdown",(e,t)=>{s.isEnabled&&s.focusTracker.focusedElement===s.buttonView.element&&(s.isOpen||(s.isOpen=!0),s.panelView.focus(),t())})},openOnArrowRightKey(s){const e=s.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";s.keystrokes.set(e,(t,i)=>{s.focusTracker.focusedElement!==s.buttonView.element||!s.isEnabled||(s.isOpen||(s.isOpen=!0),s.panelView.focus(),i())})},openOnButtonClick(s){s.buttonView.on("execute",()=>{s.isOpen=!0})},toggleOnButtonClick(s){s.buttonView.on("execute",()=>{s.isOpen=!s.isOpen})},openAndFocusOnEnterKeyPress(s){s.keystrokes.set("enter",(e,t)=>{s.focusTracker.focusedElement===s.buttonView.element&&(s.isOpen=!0,s.panelView.focus(),t())})},closeOnArrowLeftKey(s){const e=s.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";s.keystrokes.set(e,(t,i)=>{s.isOpen&&(s.isOpen=!1,s.focus(),i())})},closeOnEscKey(s){s.keystrokes.set("esc",(e,t)=>{s.isOpen&&(s.isOpen=!1,s.focus(),t())})},closeOnParentClose(s){s.parentMenuView.on("change:isOpen",(e,t,i)=>{!i&&e.source===s.parentMenuView&&(s.isOpen=!1)})}},vs={southEast:s=>({top:s.bottom,left:s.left,name:"se"}),southWest:(s,e)=>({top:s.bottom,left:s.left-e.width+s.width,name:"sw"}),northEast:(s,e)=>({top:s.top-e.height,left:s.left,name:"ne"}),northWest:(s,e)=>({top:s.top-e.height,left:s.left-e.width+s.width,name:"nw"}),eastSouth:s=>({top:s.top,left:s.right-U,name:"es"}),eastNorth:(s,e)=>({top:s.top-e.height,left:s.right-U,name:"en"}),westSouth:(s,e)=>({top:s.top,left:s.left-e.width+U,name:"ws"}),westNorth:(s,e)=>({top:s.top-e.height,left:s.left-e.width+U,name:"wn"})},ys=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function Cs(s){let e;return!("items"in s)||!s.items?e={items:ge(ys),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...s}:e={items:s.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...s},e}function Vs({normalizedConfig:s,locale:e,componentFactory:t,extraItems:i}){const o=ge(s);return Ke(s,o,i),xs(s,o),Ke(s,o,o.addItems),Es(s,o,t),It(s,o),Is(o,e),o}function xs(s,e){const t=e.removeItems,i=[];e.items=e.items.filter(({menuId:o})=>t.includes(o)?(i.push(o),!1):!0),G(e.items,o=>{o.groups=o.groups.filter(({groupId:n})=>t.includes(n)?(i.push(n),!1):!0);for(const n of o.groups)n.items=n.items.filter(r=>{const a=Ot(r);return t.includes(a)?(i.push(a),!1):!0})});for(const o of t)i.includes(o)||C("menu-bar-item-could-not-be-removed",{menuBarConfig:s,itemName:o})}function Ke(s,e,t){const i=[];if(t.length!=0){for(const o of t){const n=Bs(o.position),r=Ls(o.position);if(Os(o))if(!r)n==="start"?(e.items.unshift(o.menu),i.push(o)):n==="end"&&(e.items.push(o.menu),i.push(o));else{const a=e.items.findIndex(l=>l.menuId===r);a!=-1?n==="before"?(e.items.splice(a,0,o.menu),i.push(o)):n==="after"&&(e.items.splice(a+1,0,o.menu),i.push(o)):je(e,o.menu,r,n)&&i.push(o)}else Ps(o)?G(e.items,a=>{if(a.menuId===r)n==="start"?(a.groups.unshift(o.group),i.push(o)):n==="end"&&(a.groups.push(o.group),i.push(o));else{const l=a.groups.findIndex(c=>c.groupId===r);l!==-1&&(n==="before"?(a.groups.splice(l,0,o.group),i.push(o)):n==="after"&&(a.groups.splice(l+1,0,o.group),i.push(o)))}}):je(e,o.item,r,n)&&i.push(o)}for(const o of t)i.includes(o)||C("menu-bar-item-could-not-be-added",{menuBarConfig:s,addedItemConfig:o})}}function je(s,e,t,i){let o=!1;return G(s.items,n=>{for(const{groupId:r,items:a}of n.groups){if(o)return;if(r===t)i==="start"?(a.unshift(e),o=!0):i==="end"&&(a.push(e),o=!0);else{const l=a.findIndex(c=>Ot(c)===t);l!==-1&&(i==="before"?(a.splice(l,0,e),o=!0):i==="after"&&(a.splice(l+1,0,e),o=!0))}}}),o}function Es(s,e,t){G(e.items,i=>{for(const o of i.groups)o.items=o.items.filter(n=>{const r=typeof n=="string"&&!t.has(n);return r&&!e.isUsingDefaultConfig&&C("menu-bar-item-unavailable",{menuBarConfig:s,parentMenuConfig:ge(i),componentName:n}),!r})})}function It(s,e){const t=e.isUsingDefaultConfig;let i=!1;if(e.items=e.items.filter(o=>o.groups.length?!0:(de(s,o,t),!1)),!e.items.length){de(s,s,t);return}G(e.items,o=>{o.groups=o.groups.filter(n=>n.items.length?!0:(i=!0,!1));for(const n of o.groups)n.items=n.items.filter(r=>Pt(r)&&!r.groups.length?(de(s,r,t),i=!0,!1):!0)}),i&&It(s,e)}function de(s,e,t){t||C("menu-bar-menu-empty",{menuBarConfig:s,emptyMenuConfig:e})}function Is(s,e){const t=e.t,i={File:t({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:t({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:t({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:t({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:t({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:t({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:t({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:t({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:t({string:"Font",id:"MENU_BAR_MENU_FONT"})};G(s.items,o=>{o.label in i&&(o.label=i[o.label])})}function G(s,e){if(Array.isArray(s))for(const i of s)t(i);function t(i){e(i);for(const o of i.groups)for(const n of o.items)Pt(n)&&t(n)}}function Os(s){return typeof s=="object"&&"menu"in s}function Ps(s){return typeof s=="object"&&"group"in s}function Bs(s){return s.startsWith("start")?"start":s.startsWith("end")?"end":s.startsWith("after")?"after":"before"}function Ls(s){const e=s.match(/^[^:]+:(.+)/);return e?e[1]:null}function Ot(s){return typeof s=="string"?s:s.menuId}function Pt(s){return typeof s=="object"&&"menuId"in s}class fo extends se(){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();const t=e.editing.view;this.editor=e,this.componentFactory=new gs(e),this.focusTracker=new b,this.tooltipManager=new m(e),this.poweredBy=new Li(e),this.evaluationBadge=new ks(e),this.ariaLiveAnnouncer=new fi(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),this.once("ready",()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0}),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){const t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);const i=Cs(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),n())}),this.editor.keystrokes.set("Alt+F9",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),n())})}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){const e=this.editor;let t;e.keystrokes.set("Alt+F10",(i,o)=>{this._saveLastFocusedForeignElement();const n=this._getCurrentFocusedToolbarDefinition();(!n||!t)&&(t=this._getFocusableCandidateToolbarDefinitions());for(let r=0;r<t.length;r++){const a=t.shift();if(t.push(a),a!==n&&this._focusFocusableCandidateToolbar(a)){n&&n.options.afterBlur&&n.options.afterBlur();break}}o()}),e.keystrokes.set("Esc",(i,o)=>{const n=this._getCurrentFocusedToolbarDefinition();n&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),n.options.afterBlur&&n.options.afterBlur(),o())})}_saveLastFocusedForeignElement(){const e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:i,options:o}=t;(O(i.element)||o.beforeFocus)&&e.push(t)}return e.sort((t,i)=>Xe(t)-Xe(i)),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),O(t.element)?(t.focus(),!0):!1}_handleScrollToTheSelection(e,t){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const t of e)this.focusTracker.add(t.element);e.on("add",(t,i)=>{this.focusTracker.add(i.element)}),e.on("remove",(t,i)=>{this.focusTracker.remove(i.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(t,i,o)=>{const n=this._getVisualViewportTopOffset(o);o.visualTop!==n&&(t.return={...o,visualTop:n})}),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!d.window.visualViewport)return;const e=()=>{const t=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==t&&(this.viewportOffset={...this.viewportOffset,visualTop:t})};this._domEmitter=new(ie()),this._domEmitter.listenTo(d.window.visualViewport,"scroll",e),this._domEmitter.listenTo(d.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){const t=K().top,i=e.top||0;return t>i?0:i-t}}function Xe(s){const{toolbarView:e,options:t}=s;let i=10;return O(e.element)&&i--,t.isContextual&&(i-=2),i}class Fs extends h{body;menuBarView;toolbar;constructor(e){super(e),this.body=new _(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class po extends Fs{top;main;_voiceLabelView;constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,t=new re;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class As extends h{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;e.isRenderingInProgress?i(this):t(this);function t(o){e.change(n=>{const r=e.document.getRoot(o.name);n.addClass(o.isFocused?"ck-focused":"ck-blurred",r),n.removeClass(o.isFocused?"ck-blurred":"ck-focused",r)})}function i(o){e.once("change:isRenderingInProgress",(n,r,a)=>{a?i(o):t(o)})}}}class mo extends As{_options;constructor(e,t,i,o={}){super(e,t,i),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change(t=>{const i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){const e=this.locale.t,t=this._options.label,i=this._editableElement,o=this.name;if(typeof t=="string")return t;if(typeof t=="object")return t[o];if(typeof t=="function")return t(this);if(i){const n=i.getAttribute("aria-label");if(n)return n}return e("Rich Text Editor. Editing area: %0",o)}}class wo extends h{children;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",["ck","ck-form__row",...oe(t.class||[])]),this.children=this.createCollection(),t.children&&t.children.forEach(o=>this.children.add(o)),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",o=>o.join(" ")),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}class bo extends Mt{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class go extends se(){constructor(e,t){super(),t&&Jt(this,t),e&&this.set(e)}}const $=te("px");class _o extends we{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{const t=this.editor.editing.view,o=t.document.selection.editableElement;return o?t.domConverter.mapViewToDom(o.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new v("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,(!this._visibleStack||e.singleViewMode)&&this.showStack(t);return}const i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new v("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(t.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),t.size===1?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new v("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new k(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(i=>i[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Ds(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(i,o)=>!o&&i>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(i,o)=>{if(o<2)return"";const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[n,o])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new Ss(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,i)=>!i&&t>=2?Math.min(t-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}}class Ds extends h{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new b,this.buttonPrevView=this._createButtonView(t("Previous"),Kt),this.buttonNextView=this._createButtonView(t("Next"),jt),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",o=>o?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new p(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class Ss extends h{content;_balloonPanelView;constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",o=>o?"":"ck-hidden")],style:{top:i.to("top",$),left:i.to("left",$),width:i.to("width",$),height:i.to("height",$)}},children:this.content}),this.on("change:numberOfPanels",(o,n,r,a)=>{r>a?this._addPanels(r-a):this._removePanels(a-r),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new h;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new T(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}}const S=te("px");class ko extends h{content;contentPanelElement;_contentPanelPlaceholder;constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new V({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",i=>i?"block":"none"),height:t.to("isSticky",i=>i?S(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new V({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",i=>i?S(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_stickyTopOffset",i=>i&&S(i)),bottom:t.to("_stickyBottomOffset",i=>i&&S(i)),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(d.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()}),d.window.visualViewport&&(this.listenTo(d.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(d.window.visualViewport,"resize",()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive){this._unstick();return}const e=new T(this.limiterElement);let t=e.getVisible();if(t){const n=new T(d.window);n.top+=this.viewportTopOffset,n.height-=this.viewportTopOffset,t=t.getIntersection(n)}const{left:i,top:o}=K();if(e.moveBy(i,o),t&&t.moveBy(i,o),t&&e.top<t.top)if(this._contentPanelRect.height+this.limiterBottomOffset>t.height){const n=Math.max(e.bottom-t.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+n+1<e.height?this._stickToBottomOfLimiter(n):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<e.height?this._stickToTopOfAncestors(t.top):this._unstick();else this._unstick()}_stickToTopOfAncestors(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=e,this._stickyBottomOffset=null,this._marginLeft=S(-d.window.scrollX+K().left)}_stickToBottomOfLimiter(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=e,this._marginLeft=S(-d.window.scrollX+K().left)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new T(this.contentPanelElement)}}class Ms extends W{arrowView;constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",i=>String(i)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new L;return e.content=ne,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class Ns extends h{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",i=>`ck-menu-bar__menu__panel_position_${i}`),t.if("isVisible","ck-hidden",i=>!i)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(e=1){this.children.length&&(e===1?this.children.first.focus():this.children.last.focus())}}class R extends h{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new Ms(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new Ns(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new E,this.focusTracker=new b,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",i=>!i),t.if("parentMenuView","ck-menu-bar__menu_top-level",i=>!i)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),I.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(I.openOnButtonClick(this),I.openOnArrowRightKey(this),I.closeOnArrowLeftKey(this),I.openAndFocusOnEnterKeyPress(this),I.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),I.openAndFocusPanelOnArrowDownKey(this),I.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(e,t)=>{this.fire("arrowright"),t()}),this.keystrokes.set("arrowleft",(e,t)=>{this.fire("arrowleft"),t()})}_repositionPanelOnOpen(){this.on("change:isOpen",(e,t,i)=>{if(!i)return;const o=R._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=o?o.name:this._defaultMenuPositionName})}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:i,northWest:o,westSouth:n,eastSouth:r,westNorth:a,eastNorth:l}=vs;return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?[r,l,n,a]:[e,t,i,o]:this.parentMenuView?[n,a,r,l]:[t,e,o,i]}get _defaultMenuPositionName(){return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=me}class qe extends Ce{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const e=Array.from(this.items).some(t=>{const i=Ye(t);return i&&i.isToggleable});this.items.forEach(t=>{const i=Ye(t);i&&(i.hasCheckSpace=e)})}}function Ye(s){return s instanceof P?s.children.map(e=>Ws(e)?e.buttonView:e).find(e=>e instanceof W):null}function Ws(s){return typeof s=="object"&&"buttonView"in s&&s.buttonView instanceof p}class Gs extends Ai{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}const Qe=["mouseenter","arrowleft","arrowright","change:isOpen"];class To extends h{children;menus=[];constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){const o=this.locale,r=Vs({normalizedConfig:e,locale:o,componentFactory:t,extraItems:i}).items.map(a=>this._createMenu({componentFactory:t,menuDefinition:a}));this.children.addMany(r)}render(){super.render(),D.toggleMenusAndFocusItemsOnHover(this),D.closeMenusWhenTheBarCloses(this),D.closeMenuWhenAnotherOnTheSameLevelOpens(this),D.focusCycleMenusOnArrows(this),D.closeOnClickOutside(this),D.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}disable(){for(const e of this.children)e.isEnabled=!1}enable(){for(const e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...Qe).to(t),e.parentMenuView=t):e.delegate(...Qe).to(this,i=>"menu:"+i),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){const o=this.locale,n=new R(o);return this.registerMenu(n,i),n.buttonView.set({label:t.label}),n.once("change:isOpen",()=>{const r=new qe(o);r.ariaLabel=t.label,n.panelView.children.add(r),r.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:n,componentFactory:e}))}),n}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){const o=this.locale,n=[];for(const r of e.groups){for(const a of r.items){const l=new Et(o,t);if(Z(a))l.children.add(this._createMenu({componentFactory:i,menuDefinition:a,parentMenuView:t}));else{const c=this._createMenuItemContentFromFactory({componentName:a,componentFactory:i,parentMenuView:t});if(!c)continue;l.children.add(c)}n.push(l)}r!==e.groups[e.groups.length-1]&&n.push(new ye(o))}return n}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){const o=i.create(e);return o instanceof R||o instanceof dt||o instanceof Gs?(this._registerMenuTree(o,t),o.on("execute",()=>{this.close()}),o):(C("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof R)){e.delegate("mouseenter").to(t);return}this.registerMenu(e,t);const i=e.panelView.children.filter(n=>n instanceof qe)[0];if(!i){e.delegate("mouseenter").to(t);return}const o=i.items.filter(n=>n instanceof P);for(const n of o)this._registerMenuTree(n.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(t,i,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(n=>n.isOpen)},0)})}}export{so as AccessibilityHelp,gi as AccessibilityHelpContentView,fi as AriaLiveAnnouncer,De as AriaLiveAnnouncerPoliteness,mi as AriaLiveAnnouncerRegionView,pi as AriaLiveAnnouncerView,ft as Badge,k as BalloonPanelView,_ as BodyCollection,po as BoxedEditorUIView,ut as ButtonLabelView,p as ButtonView,no as CollapsibleView,We as ColorGridView,ws as ColorGridsFragmentView,bs as ColorPickerFragmentView,ps as ColorPickerInputRowView,us as ColorPickerView,uo as ColorSelectorView,bt as ColorTileView,gs as ComponentFactory,_o as ContextualBalloon,to as CssTransitionDisablerMixin,ys as DefaultMenuBarItems,y as Dialog,yi as DialogActionsView,Ci as DialogContentView,ve as DialogView,g as DialogViewPosition,ms as DocumentColorCollection,wi as DraggableViewMixin,ji as DropdownButtonView,Ki as DropdownPanelView,ee as DropdownView,As as EditableUIView,fo as EditorUI,Fs as EditorUIView,ks as EvaluationBadge,oo as FileDialogButtonView,Ai as FileDialogListItemButtonView,wt as FileDialogViewMixin,N as FocusCycler,Ti as FormHeaderView,wo as FormRowView,L as IconView,mo as InlineEditableUIView,Hi as InputBase,$i as InputNumberView,Ui as InputTextView,kt as InputView,Ji as ItemsView,re as LabelView,Ri as LabeledFieldView,W as ListItemButtonView,q as ListItemGroupView,P as ListItemView,ye as ListSeparatorView,Ce as ListView,Ms as MenuBarMenuButtonView,dt as MenuBarMenuListItemButtonView,Gs as MenuBarMenuListItemFileDialogButtonView,Et as MenuBarMenuListItemView,qe as MenuBarMenuListView,Ns as MenuBarMenuPanelView,R as MenuBarMenuView,To as MenuBarView,Qi as NESTED_TOOLBAR_ICONS,bo as Notification,Li as PoweredBy,ds as SliderView,es as SplitButtonView,ko as StickyPanelView,mt as SwitchButtonView,V as Template,Xi as ToolbarLineBreakView,Tt as ToolbarSeparatorView,Zi as ToolbarView,m as TooltipManager,go as UIModel,h as View,B as ViewCollection,go as ViewModel,Vi as _CheckIconHolderView,no as _CollapsibleView,Ds as _ContextualBalloonRotatorView,D as _MenuBarBehaviors,I as _MenuBarMenuBehaviors,vs as _MenuBarMenuViewPanelPositioningFunctions,H as _TemplateBinding,nt as _TemplateIfBinding,oi as _TemplateToBinding,gt as _convertColor,Mi as _convertColorToHex,qi as _preventUiViewDefault,Vs as _processMenuBarConfig,Ni as _registerCustomElement,xt as _tryNormalizeHexColor,bi as addKeyboardHandlingForGrid,ao as addListToDropdown,vt as addToolbarToDropdown,ht as clickOutsideHandler,Ve as createDropdown,ho as createLabeledDropdown,co as createLabeledInputNumber,cs as createLabeledInputText,yt as focusChildOnDropdownOpen,ro as getLocalizedColorOptions,z as isFocusable,vi as isViewWithFocusCycler,lo as normalizeColorOptions,Cs as normalizeMenuBarConfig,Si as normalizeSingleColorDefinition,Yi as normalizeToolbarConfig,io as submitHandler};
1
+ import{getEnvKeystrokeText as Y,uid as Q,env as A,delay as Lt,createElement as x,KeystrokeHandler as E,FocusTracker as b,toUnit as te,global as d,Rect as T,DomEmitterMixin as ie,ObservableMixin as se,Collection as pe,isIterable as xe,CKEditorError as v,getOptimalPosition as me,logWarning as C,EmitterMixin as Ze,getVisualViewportOffset as K,isVisible as O,isNode as Je,priorities as Ft,isText as At,ResizeObserver as et,toArray as oe,first as Dt,parseBase64EncodedObject as tt,isRange as St}from"../../../../../@ckeditor_ckeditor5-utils@46.1.1/node_modules/@ckeditor/ckeditor5-utils/dist/index.js";import{Plugin as we,ContextPlugin as Mt}from"../../../../../@ckeditor_ckeditor5-core@46.1.1/node_modules/@ckeditor/ckeditor5-core/dist/index.js";import{IconAccessibility as Ee,IconCancel as it,IconDropdownArrow as ne,IconDragIndicator as Nt,IconPilcrow as Wt,IconThreeVerticalDots as be,IconText as Gt,IconPlus as Rt,IconParagraph as Ht,IconImportExport as zt,IconBold as Ut,IconAlignLeft as $t,IconCheck as st,IconPreviousArrow as Kt,IconNextArrow as jt,IconColorPalette as Xt,IconEraser as qt,IconProjectLogo as Yt,IconColorTileCheck as Qt}from"../../../../../@ckeditor_ckeditor5-icons@46.1.1/node_modules/@ckeditor/ckeditor5-icons/dist/index.js";import Ie from"../../../../../color-parse@2.0.2/node_modules/color-parse/index.js";import ot from"../../../../../color-convert@3.1.0/node_modules/color-convert/index.js";import{HexBase as Zt}from"../../../../../vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/entrypoints/hex.js";import"../../../../../@ckeditor_ckeditor5-engine@46.1.1/node_modules/@ckeditor/ckeditor5-engine/dist/index.js";import{assignIn as Jt}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/assignIn.js";import{isObject as Z}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isObject.js";import{cloneDeep as ge}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeep.js";import{debounce as fe}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/debounce.js";import{isElement as _e}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/predicate/isElement.js";import{cloneDeepWith as ei}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js";import{throttle as ti}from"../../../../../es-toolkit@1.39.5/node_modules/es-toolkit/dist/compat/function/throttle.js";class B extends pe{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,i,o)=>{this._renderViewIntoCollectionParent(i,o)}),this.on("remove",(t,i)=>{i.element&&this._parentElement&&i.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!ii(e))throw new v("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(const i of this)for(const o of e)i.delegate(o).to(t);this.on("add",(i,o)=>{for(const n of e)o.delegate(n).to(t)}),this.on("remove",(i,o)=>{for(const n of e)o.stopDelegating(n,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}}function ii(s){return s.every(e=>typeof e=="string")}const si="http://www.w3.org/1999/xhtml";class V extends Ze(){ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,Pe(Oe(e))),this._isRendered=!1,this._revertData=null}render(){const e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=Fe(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new v("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children)for(const i of t.children)J(i)?yield i:ke(i)&&(yield*e(i))}yield*e(this)}static bind(e,t){return{to(i,o){return new oi({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o})},if(i,o,n){return new nt({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:n})}}}static extend(e,t){if(e._isRendered)throw new v("template-extend-render",[this,e]);ct(e,Pe(Oe(t)))}_renderNode(e){let t;if(e.node?t=this.tag&&this.text:t=this.tag?this.text:!this.text,t)throw new v("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||si,this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),j(this.text)?this._bindToObservable({schema:this.text,updater:ri(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;const t=e.node,i=e.revertData;for(const o in this.attributes){const n=t.getAttribute(o),r=this.attributes[o];i&&(i.attributes[o]=n);const a=Le(r)?r[0].ns:null;if(j(r)){const l=Le(r)?r[0].value:r;i&&Ae(o)&&l.unshift(n),this._bindToObservable({schema:l,updater:li(t,o,a),data:e})}else if(o=="style"&&typeof r[0]!="string")this._renderStyleAttribute(r[0],e);else{i&&n&&Ae(o)&&r.unshift(n);const l=r.map(c=>c&&(c.value||c)).reduce((c,u)=>c.concat(u),[]).reduce(at,"");M(l)||t.setAttributeNS(a,o,l)}}}_renderStyleAttribute(e,t){const i=t.node;for(const o in e){const n=e[o];j(n)?this._bindToObservable({schema:[n],updater:ai(i,o),data:t}):i.style[o]=n}}_renderElementChildren(e){const t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying;let n=0;for(const r of this.children)if(Te(r)){if(!o){r.setParent(t);for(const a of r)i.appendChild(a.element)}}else if(J(r))o||(r.isRendered||r.render(),i.appendChild(r.element));else if(Je(r))i.appendChild(r);else if(o){const a=e.revertData,l=Fe();a.children.push(l),r._renderNode({intoFragment:!1,node:i.childNodes[n++],isApplying:!0,revertData:l})}else i.appendChild(r.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(const t in this.eventListeners){const i=this.eventListeners[t].map(o=>{const[n,r]=t.split("@");return o.activateDomEventListener(n,r,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){const o=i.revertData;rt(e,t,i);const n=e.filter(r=>!M(r)).filter(r=>r.observable).map(r=>r.activateAttributeListener(e,t,i));o&&o.bindings.push(n)}_revertTemplateFromNode(e,t){for(const o of t.bindings)for(const n of o)n();if(t.text){e.textContent=t.text;return}const i=e;for(const o in t.attributes){const n=t.attributes[o];n===null?i.removeAttribute(o):i.setAttribute(o,n)}for(let o=0;o<t.children.length;++o)this._revertTemplateFromNode(i.childNodes[o],t.children[o])}}class H{attribute;observable;emitter;callback;constructor(e){this.attribute=e.attribute,this.observable=e.observable,this.emitter=e.emitter,this.callback=e.callback}getValue(e){const t=this.observable[this.attribute];return this.callback?this.callback(t,e):t}activateAttributeListener(e,t,i){const o=()=>rt(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}}class oi extends H{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){const o=(n,r)=>{(!t||r.target.matches(t))&&(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(r):this.observable.fire(this.eventNameOrFunction,r))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}}class nt extends H{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){const t=super.getValue(e);return M(t)?!1:this.valueIfTrue||!0}}function j(s){return s?(s.value&&(s=s.value),Array.isArray(s)?s.some(j):s instanceof H):!1}function ni(s,e){return s.map(t=>t instanceof H?t.getValue(e):t)}function rt(s,e,{node:t}){const i=ni(s,t);let o;s.length==1&&s[0]instanceof nt?o=i[0]:o=i.reduce(at,""),M(o)?e.remove():e.set(o)}function ri(s){return{set(e){s.textContent=e},remove(){s.textContent=""}}}function li(s,e,t){return{set(i){s.setAttributeNS(t,e,i)},remove(){s.removeAttributeNS(t,e)}}}function ai(s,e){return{set(t){s.style[e]=t},remove(){s.style[e]=null}}}function Oe(s){return ei(s,t=>{if(t&&(t instanceof H||ke(t)||J(t)||Te(t)))return t})}function Pe(s){if(typeof s=="string"?s=ui(s):s.text&&di(s),s.on&&(s.eventListeners=hi(s.on),delete s.on),!s.text){s.attributes&&ci(s.attributes);const e=[];if(s.children)if(Te(s.children))e.push(s.children);else for(const t of s.children)ke(t)||J(t)||Je(t)?e.push(t):e.push(new V(t));s.children=e}return s}function ci(s){for(const e in s)s[e].value&&(s[e].value=oe(s[e].value)),lt(s,e)}function hi(s){for(const e in s)lt(s,e);return s}function ui(s){return{text:[s]}}function di(s){s.text=oe(s.text)}function lt(s,e){s[e]=oe(s[e])}function at(s,e){return M(e)?s:M(s)?e:`${s} ${e}`}function Be(s,e){for(const t in e)s[t]?s[t].push(...e[t]):s[t]=e[t]}function ct(s,e){if(e.attributes&&(s.attributes||(s.attributes={}),Be(s.attributes,e.attributes)),e.eventListeners&&(s.eventListeners||(s.eventListeners={}),Be(s.eventListeners,e.eventListeners)),e.text&&s.text.push(...e.text),e.children&&e.children.length){if(s.children.length!=e.children.length)throw new v("ui-template-extend-children-mismatch",s);let t=0;for(const i of e.children)ct(s.children[t++],i)}}function M(s){return!s&&s!==0}function J(s){return s instanceof h}function ke(s){return s instanceof V}function Te(s){return s instanceof B}function Le(s){return Z(s[0])&&s[0].ns}function Fe(){return{children:[],bindings:[],attributes:{}}}function Ae(s){return s=="class"||s=="style"}class h extends ie(se()){element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new pe,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=V.bind(this,this)}createCollection(e){const t=new B(e);return this._viewCollections.add(t),t}registerChild(e){xe(e)||(e=[e]);for(const t of e)this._unboundChildren.add(t)}deregisterChild(e){xe(e)||(e=[e]);for(const t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new V(e)}extendTemplate(e){V.extend(this.template,e)}render(){if(this.isRendered)throw new v("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}const De={POLITE:"polite",ASSERTIVE:"assertive"};class fi{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(const t of Object.values(De))this.announce("",t)})}announce(e,t=De.POLITE){const i=this.editor;if(!i.ui.view)return;this.view||(this.view=new pi(i.locale),i.ui.view.body.add(this.view));const{politeness:o,isUnsafeHTML:n}=typeof t=="string"?{politeness:t}:t;let r=this.view.regionViews.find(a=>a.politeness===o);r||(r=new mi(i,o),this.view.regionViews.add(r)),r.announce({announcement:e,isUnsafeHTML:n})}}class pi extends h{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}}class mi extends h{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{this._pruneAnnouncementsInterval!==null&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)}),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval(()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()},5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;const i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}}function ht({emitter:s,activator:e,callback:t,contextElements:i,listenerOptions:o}){s.listenTo(document,"mousedown",(n,r)=>{if(!e())return;const a=typeof r.composedPath=="function"?r.composedPath():[],l=typeof i=="function"?i():i;for(const c of l)if(c.contains(r.target)||a.includes(c))return;t()},o)}function to(s){class e extends s{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...i){super(...i),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return e}function wi(s){class e extends s{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...i){super(...i),this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(d.document,"mouseup",this._onDragEndBound),this.listenTo(d.document,"touchend",this._onDragEndBound),this.listenTo(d.document,"mousemove",this._onDragBound),this.listenTo(d.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(d.document,"mouseup",this._onDragEndBound),this.stopListening(d.document,"touchend",this._onDragEndBound),this.stopListening(d.document,"mousemove",this._onDragBound),this.stopListening(d.document,"touchmove",this._onDragBound)}_onDragStart(i,o){if(!this._isHandleElementPressed(o))return;this._attachDragListeners();let n=0,r=0;o instanceof MouseEvent?(n=o.clientX,r=o.clientY):(n=o.touches[0].clientX,r=o.touches[0].clientY),this._lastDraggingCoordinates={x:n,y:r},this.isDragging=!0}_onDrag(i,o){if(!this.isDragging){this._detachDragListeners();return}let n=0,r=0;o instanceof MouseEvent?(n=o.clientX,r=o.clientY):(n=o.touches[0].clientX,r=o.touches[0].clientY),o.preventDefault(),this.fire("drag",{deltaX:Math.round(n-this._lastDraggingCoordinates.x),deltaY:Math.round(r-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:n,y:r}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(i){return this.dragHandleElement?this.dragHandleElement===i.target||i.target instanceof HTMLElement&&this.dragHandleElement.contains(i.target):!1}}return e}function io({view:s}){s.listenTo(s.element,"submit",(e,t)=>{t.preventDefault(),s.fire("submit")},{useCapture:!0})}function bi({keystrokeHandler:s,focusTracker:e,gridItems:t,numberOfColumns:i,uiLanguageDirection:o}){const n=typeof i=="number"?()=>i:i;s.set("arrowright",r((c,u)=>o==="rtl"?l(c,u.length):a(c,u.length))),s.set("arrowleft",r((c,u)=>o==="rtl"?a(c,u.length):l(c,u.length))),s.set("arrowup",r((c,u)=>{let f=c-n();return f<0&&(f=c+n()*Math.floor(u.length/n()),f>u.length-1&&(f-=n())),f})),s.set("arrowdown",r((c,u)=>{let f=c+n();return f>u.length-1&&(f=c%n()),f}));function r(c){return u=>{const f=t.find(Bt=>Bt.element===e.focusedElement),w=t.getIndex(f),F=c(w,t);t.get(F).focus(),u.stopPropagation(),u.preventDefault()}}function a(c,u){return c===u-1?0:c+1}function l(c,u){return c===0?u-1:c-1}}class re extends h{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${Q()}`;const t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}}class gi extends h{constructor(e,t){super(e);const i=e.t,o=new re;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[x(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map(t=>{const i=[x(document,"h3",{},t.label),...Array.from(t.groups.values()).map(o=>this._createGroup(o)).flat()];return t.description&&i.splice(1,0,x(document,"p",{},t.description)),x(document,"section",{},i)})}_createGroup(e){const t=e.keystrokes.sort((o,n)=>o.label.localeCompare(n.label)).map(o=>this._createGroupRow(o)).flat(),i=[x(document,"dl",{},t)];return e.label&&i.unshift(x(document,"h4",{},e.label)),i}_createGroupRow(e){const t=this.locale.t,i=x(document,"dt"),o=x(document,"dd"),n=ki(e.keystroke),r=[];for(const a of n)r.push(a.map(_i).join(""));return i.innerHTML=e.label,o.innerHTML=r.join(", ")+(e.mayRequireFn&&A.isMac?` ${t("(may require <kbd>Fn</kbd>)")}`:""),[i,o]}}function _i(s){return Y(s).split("+").map(e=>`<kbd>${e}</kbd>`).join("+")}function ki(s){return typeof s=="string"?[[s]]:typeof s[0]=="string"?[s]:s}class L extends h{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();const e=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",e.if("isVisible","ck-hidden",t=>!t),"ck-reset_all-excluded",e.if("isColorInherited","ck-icon_inherit-color")],viewBox:e.to("viewBox"),"aria-hidden":!0}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=new DOMParser().parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg");if(!t)throw new v("ui-iconview-invalid-svg",this);const i=t.getAttribute("viewBox");i&&(this.viewBox=i);for(const{name:o,value:n}of Array.from(t.attributes))L.presentationalAttributeNames.includes(o)&&this.element.setAttribute(o,n);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(e=>{e.style.fill=this.fillColor})}}class ut extends h{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}}class p extends h{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new ut){super(e);const i=this.bindTemplate,o=Q();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${o}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new L,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));const n={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",r=>!r),i.if("isVisible","ck-hidden",r=>!r),i.to("isOn",r=>r?"ck-on":"ck-off"),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",r=>r||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,r=>!r),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(r=>{this.isEnabled?this.fire("execute"):r.preventDefault()})}};this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(r,a,l)=>!a||Se(l)?!1:String(!!r)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(r,a,l)=>!a||!Se(l)?!1:String(!!r)),A.isSafari&&(this._focusDelayed||(this._focusDelayed=Lt(()=>this.focus(),0)),n.on.mousedown=i.to(()=>{this._focusDelayed()}),n.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})),this.setTemplate(n)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,t,i,o)=>{i&&!o?this.children.add(this.iconView,0):!i&&o&&this.children.remove(this.iconView)}),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){const e=new h;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Y(t))}]}),e}_getTooltipString(e,t,i){return e?typeof e=="string"?e:(i&&(i=Y(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}}function Se(s){switch(s){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}class Ti extends h{children;iconView;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new L,this.iconView.content=t.icon,this.children.add(this.iconView));const o=new h(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}}class N extends Ze(){focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(const t in e.actions){let i=e.actions[t];typeof i=="string"&&(i=[i]);for(const o of i)e.keystrokeHandler.set(o,(n,r)=>{this[t](),r()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(le)||null}get last(){return this.focusables.filter(le).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,i)=>{const o=t.element===this.focusTracker.focusedElement;return o&&(e=i),o}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){const e=this.next;if(e&&this.focusables.getIndex(e)===this.current){this.fire("forwardCycle");return}e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){const e=this.previous;if(e&&this.focusables.getIndex(e)===this.current){this.fire("backwardCycle");return}e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){const t=()=>this.current===null?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",i=>{const o=t();this.focusNext(),o!==t()&&i.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",i=>{const o=t();this.focusPrevious(),o!==t()&&i.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){const t=this.focusables.length;if(!t)return null;const i=this.current;if(i===null)return this[e===1?"first":"last"];let o=this.focusables.get(i),n=(i+t+e)%t;do{const r=this.focusables.get(n);if(le(r)){o=r;break}n=(n+t+e)%t}while(n!==i);return o}}function le(s){return z(s)&&O(s.element)}function z(s){return"focus"in s&&typeof s.focus=="function"}function vi(s){return z(s)&&"focusCycler"in s&&s.focusCycler instanceof N}class yi extends h{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new E,this._focusTracker=new b,this._focusables=new B,this.focusCycler=new N({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(const t of e){const i=new p(this.locale);let o;i.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(i);for(o in t)o!="onExecute"&&o!="onCreate"&&i.set(o,t[o]);this.children.add(i)}this._updateFocusCyclableItems()}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}}class Ci extends h{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}}const g={SCREEN_CENTER:"screen-center",EDITOR_CENTER:"editor-center",EDITOR_TOP_SIDE:"editor-top-side",EDITOR_TOP_CENTER:"editor-top-center",EDITOR_BOTTOM_CENTER:"editor-bottom-center",EDITOR_ABOVE_CENTER:"editor-above-center",EDITOR_BELOW_CENTER:"editor-below-center"},Me=te("px");class ve extends wi(h){parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getCurrentDomRoot;_getViewportOffset;_focusables;_focusCycler;constructor(e,{getCurrentDomRoot:t,getViewportOffset:i,keystrokeHandlerOptions:o}){super(e);const n=this.bindTemplate,r=e.t;this.set("className",""),this.set("ariaLabel",r("Editor dialog")),this.set("isModal",!1),this.set("position",g.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getCurrentDomRoot=t,this._getViewportOffset=i,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new E,this.focusTracker=new b,this._focusables=new B,this._focusCycler=new N({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:o}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",n.if("isModal","ck-dialog-overlay__transparent",a=>!a),n.if("_isVisible","ck-hidden",a=>!a)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",n.if("isModal","ck-dialog_modal"),n.to("className")],role:"dialog","aria-label":n.to("ariaLabel"),style:{top:n.to("_top",a=>Me(a)),left:n.to("_left",a=>Me(a)),visibility:n.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(e,t)=>{e.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),t())}),this.on("drag",(e,{deltaX:t,deltaY:i})=>{this.wasMoved=!0,this.moveBy(t,i)}),this.listenTo(d.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(d.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(e,t,i)=>{i&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:e,title:t,hasCloseButton:i=!0,content:o,actionButtons:n}){t&&(this.headerView=new Ti(this.locale,{icon:e}),i&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=t,this.ariaLabel=t,this.parts.add(this.headerView,0)),o&&(o instanceof h&&(o=[o]),this.contentView=new Ci(this.locale),this.contentView.children.addMany(o),this.parts.add(this.contentView)),n&&(this.actionsView=new yi(this.locale),this.actionsView.setButtons(n),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(e,t){const i=this._getViewportRect(),o=this._getDialogRect();e+o.width>i.right&&(e=i.right-o.width),e<i.left&&(e=i.left),t<i.top&&(t=i.top),this._moveTo(e,t)}_moveTo(e,t){this._left=e,this._top=t}moveBy(e,t){this.moveTo(this._left+e,this._top+t)}_moveOffScreen(){this._moveTo(-9999,-9999)}updatePosition(){if(!this.element||!this.element.parentNode)return;const e=this._getViewportRect();let t=this.position,i;this._getCurrentDomRoot()?i=this._getVisibleDomRootRect(e):t=g.SCREEN_CENTER;const o=ve.defaultOffset,n=this._getDialogRect();switch(t){case g.EDITOR_TOP_SIDE:{if(i){const r=this.locale.contentLanguageDirection==="ltr"?i.right-n.width-o:i.left+o;this.moveTo(r,i.top+o)}else this._moveOffScreen();break}case g.EDITOR_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),Math.round(i.top+i.height/2-n.height/2)):this._moveOffScreen();break}case g.SCREEN_CENTER:{this.moveTo(Math.round((e.width-n.width)/2),Math.round((e.height-n.height)/2));break}case g.EDITOR_TOP_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.top+o):this._moveOffScreen();break}case g.EDITOR_BOTTOM_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.bottom-n.height-o):this._moveOffScreen();break}case g.EDITOR_ABOVE_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.top-n.height-o):this._moveOffScreen();break}case g.EDITOR_BELOW_CENTER:{i?this.moveTo(Math.round(i.left+i.width/2-n.width/2),i.bottom+o):this._moveOffScreen();break}}}_getVisibleDomRootRect(e){let t=new T(this._getCurrentDomRoot()).getVisible();if(t){if(t=e.getIntersection(t),!t)return null}else return null;return t}_getDialogRect(){return new T(this.element.firstElementChild)}_getViewportRect(){const e=new T(d.window);if(this.isModal)return e;const t={top:0,bottom:0,left:0,right:0,...this._getViewportOffset()};return e.top+=t.top,e.height-=t.top,e.bottom-=t.bottom,e.height-=t.bottom,e.left+=t.left,e.right-=t.right,e.width-=t.left+t.right,e}_updateFocusCyclableItems(){const e=[];if(this.contentView)for(const t of this.contentView.children)z(t)&&e.push(t);this.actionsView&&e.push(this.actionsView),this.closeButtonView&&e.push(this.closeButtonView),e.forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element),vi(t)&&this._focusCycler.chain(t.focusCycler)})}_createCloseButton(){const e=new p(this.locale),t=this.locale.t;return e.set({label:t("Close"),tooltip:!0,icon:it}),e.on("execute",()=>this.fire("close",{source:"closeButton"})),e}}class y extends we{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(e){super(e);const t=e.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),e.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:t("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),y._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(e,t)=>{this._show(t)}),this.on("show",(e,t)=>{t.onShow&&t.onShow(this)},{priority:"low"}),this.on("hide",()=>{y._visibleDialogPlugin&&y._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){const e=this.editor;e.keystrokes.set("Ctrl+F6",(t,i)=>{!this.isOpen||this.view.isModal||(this.view.focusTracker.isFocused?e.editing.view.focus():this.view.focus(),i())})}_initMultiRootIntegration(){const e=this.editor.model;e.document.on("change:data",()=>{if(!this.view)return;const t=e.document.differ.getChangedRoots();for(const i of t)i.state&&this.view.updatePosition()})}show(e){this.hide(),this.fire(`show:${e.id}`,e)}_show({id:e,icon:t,title:i,hasCloseButton:o=!0,content:n,actionButtons:r,className:a,isModal:l,position:c,onHide:u,keystrokeHandlerOptions:f}){const w=this.editor;this.view=new ve(w.locale,{getCurrentDomRoot:()=>w.editing.view.getDomRoot(w.model.document.selection.anchor.root.rootName),getViewportOffset:()=>w.ui.viewportOffset,keystrokeHandlerOptions:f});const F=this.view;F.on("close",()=>{this.hide()}),w.ui.view.body.add(F),w.keystrokes.listenTo(F.element),c||(c=l?g.SCREEN_CENTER:g.EDITOR_CENTER),l&&this._lockBodyScroll(),F.set({position:c,_isVisible:!0,className:a,isModal:l}),F.setupParts({icon:t,title:i,hasCloseButton:o,content:n,actionButtons:r}),this.id=e,u&&(this._onHide=u),this.isOpen=!0,y._visibleDialogPlugin=this}hide(){y._visibleDialogPlugin&&y._visibleDialogPlugin.fire(`hide:${y._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;const e=this.editor,t=this.view;t.isModal&&this._unlockBodyScroll(),t.contentView&&t.contentView.reset(),e.ui.view.body.remove(t),e.ui.focusTracker.remove(t.element),e.keystrokes.stopListening(t.element),t.destroy(),e.editing.view.focus(),this.id=null,this.isOpen=!1,y._visibleDialogPlugin=null}_lockBodyScroll(){document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}}class W extends p{_checkIconHolderView=new Vi;constructor(e,t=new ut){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(o,n)=>o||n)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,t,i)=>{const{children:o,_checkIconHolderView:n}=this;i?o.add(n,0):o.remove(n)})}}class Vi extends h{children;_checkIconView=this._createCheckIconView();constructor(){super();const e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",t=>t?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,t,i)=>{const{children:o,_checkIconView:n}=this;i&&!o.has(n)?o.add(n):!i&&o.has(n)&&o.remove(n)})}_createCheckIconView(){const e=new L;return e.content=st,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}}class dt extends W{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}class so extends we{contentView=null;static get requires(){return[y]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){const e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{const i=this._createButton(p);return i.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),i}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{const i=this._createButton(dt);return i.label=t("Accessibility"),i}),e.keystrokes.set("Alt+0",(i,o)=>{this._toggleDialog(),o()}),this._setupRootLabels()}_createButton(e){const t=this.editor,i=t.plugins.get("Dialog"),o=t.locale,n=new e(o);return n.set({keystroke:"Alt+0",icon:Ee,isToggleable:!0}),n.on("execute",()=>this._toggleDialog()),n.bind("isOn").to(i,"id",r=>r==="accessibilityHelp"),n}_setupRootLabels(){const e=this.editor,t=e.editing.view,i=e.t;e.ui.on("ready",()=>{t.change(n=>{for(const r of t.document.roots)o(n,r)}),e.on("addRoot",(n,r)=>{const a=e.editing.view.document.getRoot(r.rootName);t.change(l=>o(l,a))},{priority:"low"})});function o(n,r){const l=[r.getAttribute("aria-label"),i("Press %0 for help.",[Y("Alt+0")])].filter(c=>c).join(". ");n.setAttribute("aria-label",l,r)}}_toggleDialog(){const e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new gi(e.locale,e.accessibility.keystrokeInfos)),t.id==="accessibilityHelp"?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),icon:Ee,hasCloseButton:!0,content:this.contentView})}}class _ extends B{locale;_bodyCollectionContainer;static _bodyWrapper;constructor(e,t=[]){super(t),this.locale=e}get bodyCollectionContainer(){return this._bodyCollectionContainer}attachToDom(){this._bodyCollectionContainer=new V({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render(),(!_._bodyWrapper||!_._bodyWrapper.isConnected)&&(_._bodyWrapper=x(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(_._bodyWrapper)),_._bodyWrapper.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),_._bodyWrapper&&!_._bodyWrapper.childElementCount&&(_._bodyWrapper.remove(),delete _._bodyWrapper)}}const Ne=te("px"),xi={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}};class k extends h{content;_pinWhenIsVisibleCallback;_resizeObserver;constructor(e){super(e);const t=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",t.to("position",i=>`ck-balloon-panel_${i}`),t.if("isVisible","ck-balloon-panel_visible"),t.if("withArrow","ck-balloon-panel_with-arrow"),t.to("class")],style:{top:t.to("top",Ne),left:t.to("left",Ne)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(e){const t=X(e.target);if(t&&!O(t))return!1;this.show();const i=k.defaultPositions,o=Object.assign({},{element:this.element,positions:[i.southArrowNorth,i.southArrowNorthMiddleWest,i.southArrowNorthMiddleEast,i.southArrowNorthWest,i.southArrowNorthEast,i.northArrowSouth,i.northArrowSouthMiddleWest,i.northArrowSouthMiddleEast,i.northArrowSouthWest,i.northArrowSouthEast,i.viewportStickyNorth],limiter:d.document.body,fitInViewport:!0},e),n=k._getOptimalPosition(o)||xi,r=parseInt(n.left),a=parseInt(n.top),l=n.name,c=n.config||{},{withArrow:u=!0}=c;return this.top=a,this.left=r,this.position=l,this.withArrow=u,!0}pin(e){this.unpin(),this._startPinning(e)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(e):this._stopPinning()},this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback))}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(e){if(!this.attachTo(e))return!1;let t=X(e.target);const i=e.limiter?X(e.limiter):d.document.body;if(this.listenTo(d.document,"scroll",(o,n)=>{const r=n.target,a=t&&r.contains(t),l=i&&r.contains(i);(a||l||!t||!i)&&this.attachTo(e)},{useCapture:!0}),this.listenTo(d.window,"resize",()=>{this.attachTo(e)}),!this._resizeObserver&&(t&&At(t)&&(t=t.parentElement),t)){const o=()=>{O(t)||this.unpin()};this._resizeObserver=new et(t,o)}return!0}_stopPinning(){this.stopListening(d.document,"scroll"),this.stopListening(d.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(e={}){const{sideOffset:t=k.arrowSideOffset,heightOffset:i=k.arrowHeightOffset,stickyVerticalOffset:o=k.stickyVerticalOffset,config:n}=e;return{northWestArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left-t,name:"arrow_sw",...n&&{config:n}}),northWestArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left-c.width*.25-t,name:"arrow_smw",...n&&{config:n}}),northWestArrowSouth:(l,c)=>({top:r(l,c),left:l.left-c.width/2,name:"arrow_s",...n&&{config:n}}),northWestArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left-c.width*.75+t,name:"arrow_sme",...n&&{config:n}}),northWestArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left-c.width+t,name:"arrow_se",...n&&{config:n}}),northArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-t,name:"arrow_sw",...n&&{config:n}}),northArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.25-t,name:"arrow_smw",...n&&{config:n}}),northArrowSouth:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width/2,name:"arrow_s",...n&&{config:n}}),northArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.75+t,name:"arrow_sme",...n&&{config:n}}),northArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width+t,name:"arrow_se",...n&&{config:n}}),northEastArrowSouthWest:(l,c)=>({top:r(l,c),left:l.right-t,name:"arrow_sw",...n&&{config:n}}),northEastArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.right-c.width*.25-t,name:"arrow_smw",...n&&{config:n}}),northEastArrowSouth:(l,c)=>({top:r(l,c),left:l.right-c.width/2,name:"arrow_s",...n&&{config:n}}),northEastArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.right-c.width*.75+t,name:"arrow_sme",...n&&{config:n}}),northEastArrowSouthEast:(l,c)=>({top:r(l,c),left:l.right-c.width+t,name:"arrow_se",...n&&{config:n}}),southWestArrowNorthWest:l=>({top:a(l),left:l.left-t,name:"arrow_nw",...n&&{config:n}}),southWestArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left-c.width*.25-t,name:"arrow_nmw",...n&&{config:n}}),southWestArrowNorth:(l,c)=>({top:a(l),left:l.left-c.width/2,name:"arrow_n",...n&&{config:n}}),southWestArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left-c.width*.75+t,name:"arrow_nme",...n&&{config:n}}),southWestArrowNorthEast:(l,c)=>({top:a(l),left:l.left-c.width+t,name:"arrow_ne",...n&&{config:n}}),southArrowNorthWest:l=>({top:a(l),left:l.left+l.width/2-t,name:"arrow_nw",...n&&{config:n}}),southArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.25-t,name:"arrow_nmw",...n&&{config:n}}),southArrowNorth:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width/2,name:"arrow_n",...n&&{config:n}}),southArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.75+t,name:"arrow_nme",...n&&{config:n}}),southArrowNorthEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width+t,name:"arrow_ne",...n&&{config:n}}),southEastArrowNorthWest:l=>({top:a(l),left:l.right-t,name:"arrow_nw",...n&&{config:n}}),southEastArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.right-c.width*.25-t,name:"arrow_nmw",...n&&{config:n}}),southEastArrowNorth:(l,c)=>({top:a(l),left:l.right-c.width/2,name:"arrow_n",...n&&{config:n}}),southEastArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.right-c.width*.75+t,name:"arrow_nme",...n&&{config:n}}),southEastArrowNorthEast:(l,c)=>({top:a(l),left:l.right-c.width+t,name:"arrow_ne",...n&&{config:n}}),westArrowEast:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.left-c.width-i,name:"arrow_e",...n&&{config:n}}),eastArrowWest:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.right+i,name:"arrow_w",...n&&{config:n}}),viewportStickyNorth:(l,c,u)=>{const f=new T(d.document.body).getIntersection(u.getVisible());if(!f)return null;const w=f.getVisible();return!l.getIntersection(w)||!(w.top-l.top-o<c.height&&w.bottom-l.bottom<c.height)?null:{top:w.top+o,left:l.left+l.width/2-c.width/2,name:"arrowless",config:{withArrow:!1,...n}}}};function r(l,c){return l.top-c.height-i}function a(l){return l.bottom+i}}static arrowSideOffset=25;static arrowHeightOffset=10;static stickyVerticalOffset=20;static _getOptimalPosition=me;static defaultPositions=k.generatePositions()}function X(s){return _e(s)?s:St(s)?s.commonAncestorContainer:typeof s=="function"?X(s()):null}const Ei=50,Ii=350;class ft extends ie(){editor;_balloonView=null;_showBalloonThrottled=ti(()=>this._showBalloon(),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",()=>this._handleEditorReady())}destroy(){const e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){const e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(t,i,o)=>{this._updateLastFocusedEditableElement(),o?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(t,i,o)=>{this._updateLastFocusedEditableElement(),o&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:this.editor.locale.contentLanguageDirection==="ltr"?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){const e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){const e=this.editor,t=new k,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;const e=this._getNormalizedConfig(),t=e.side==="right"?Oi(this._lastFocusedEditableElement,e):Pi(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){const e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i){this._lastFocusedEditableElement=null;return}const o=Array.from(e.ui.getEditableElementsNames()).map(n=>e.ui.getEditableElement(n));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}}function Oi(s,e){return pt(s,e,(t,i)=>t.left+t.width-i.width-e.horizontalOffset)}function Pi(s,e){return pt(s,e,t=>t.left+e.horizontalOffset)}function pt(s,e,t){return(i,o)=>{const n=new T(s);if(n.width<Ii||n.height<Ei)return null;let r;e.position==="inside"?r=n.bottom-o.height:r=n.bottom-o.height/2,r-=e.verticalOffset;const a=t(n,o),c=i.clone().moveTo(a,r).getIntersection(o.clone().moveTo(a,r)).getVisible();return!c||c.getArea()<o.getArea()?null:{top:r,left:a,name:`position_${e.position}-side_${e.side}`,config:{withArrow:!1}}}}const Bi="Powered by";class Li extends ft{constructor(e){super(e,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){const e=this.editor;if(e.config.get("ui.poweredBy.forceVisible"))return!0;const i=e.config.get("licenseKey");if(i=="GPL")return!0;const o=tt(i.split(".")[1]);return o?!o.whiteLabel:!0}_createBadgeContent(){return new Fi(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o=i==="inside"?5:e.verticalOffset;return{position:i,side:t.side||e.side,label:t.label===void 0?Bi:t.label,verticalOffset:t.verticalOffset!==void 0?t.verticalOffset:o,horizontalOffset:t.horizontalOffset!==void 0?t.horizontalOffset:e.horizontalOffset,forceVisible:!!t.forceVisible}}}class Fi extends h{constructor(e,t){super(e);const i=new L,o=this.bindTemplate;i.set({content:Yt,isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:o.to(n=>n.preventDefault())}}]})}}class mt extends p{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const e=new h;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}}class oo extends wt(p){}class Ai extends wt(W){}function wt(s){class e extends s{_fileInputView;constructor(...i){super(...i),this._fileInputView=new Di(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}return e}class Di extends h{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}class no extends h{buttonView;children;constructor(e,t){super(e);const i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){const e=new p(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:ne}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",i=>!i),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}}function ro(s,e){const t=s.t,i={Black:t("Black"),"Dim grey":t("Dim grey"),Grey:t("Grey"),"Light grey":t("Light grey"),White:t("White"),Red:t("Red"),Orange:t("Orange"),Yellow:t("Yellow"),"Light green":t("Light green"),Green:t("Green"),Aquamarine:t("Aquamarine"),Turquoise:t("Turquoise"),"Light blue":t("Light blue"),Blue:t("Blue"),Purple:t("Purple")};return e.map(o=>{const n=i[o.label];return n&&n!=o.label&&(o.label=n),o})}function lo(s){return s.map(Si).filter(e=>!!e)}function Si(s){return typeof s=="string"?{model:s,label:s,hasBorder:!1,view:{name:"span",styles:{color:s}}}:{model:s.color,label:s.label||s.color,hasBorder:s.hasBorder===void 0?!1:s.hasBorder,view:{name:"span",styles:{color:`${s.color}`}}}}class bt extends p{constructor(e){super(e);const t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon=Qt,this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",i=>A.isMediaForcedColors?null:i)},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class We extends h{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);const i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t?.columns||5;const o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this.items.on("add",(n,r)=>{r.isOn=r.color===this.selectedColor}),i.forEach(n=>{const r=new bt;r.set({color:n.color,label:n.label,tooltip:!0,hasBorder:n.options.hasBorder}),r.on("execute",()=>{this.fire("execute",{value:n.color,hasBorder:n.options.hasBorder,label:n.label})}),this.items.add(r)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(n,r,a)=>{for(const l of this.items)l.isOn=l.color===a})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),bi({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale?.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}}function gt(s,e){if(!s)return"";const t=_t(s);if(!t)return"";if(t.space===e)return s;if(!Gi(t))return"";const o=ot[t.space][e];if(!o)return"";const n=o(t.space==="hex"?t.hexValue:t.values);return Wi(n,e)}function Mi(s){if(!s)return"";const e=_t(s);return e?e.space==="hex"?e.hexValue:gt(s,"hex"):"#000"}function Ni(s,e){customElements.get(s)===void 0&&customElements.define(s,e)}function Wi(s,e){switch(e){case"hex":return`#${s}`;case"rgb":return`rgb(${s[0]}, ${s[1]}, ${s[2]})`;case"hsl":return`hsl(${s[0]}, ${s[1]}%, ${s[2]}%)`;case"hwb":return`hwb(${s[0]}, ${s[1]}, ${s[2]})`;case"lab":return`lab(${s[0]}% ${s[1]} ${s[2]})`;case"lch":return`lch(${s[0]}% ${s[1]} ${s[2]})`;default:return""}}function _t(s){if(s.startsWith("#")){const t=Ie(s);return{space:"hex",values:t.values,hexValue:s,alpha:t.alpha}}const e=Ie(s);return e.space?e:null}function Gi(s){return Object.keys(ot).includes(s.space)}class Ri extends h{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);const i=`ck-labeled-field-view-${Q()}`,o=`ck-labeled-field-view-status-${Q()}`;this.fieldView=t(this,i,o),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(r,a)=>r||a);const n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",r=>!r),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){const t=new re(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){const t=new h(this.locale),i=this.bindTemplate;return t.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",o=>!o)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}}class Hi extends h{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new b,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to((...i)=>{this.fire("input",...i),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=zi(this.element)}_setDomElementValue(e){this.element.value=!e&&e!==0?"":e}}function zi(s){return!s.value}class kt extends Hi{constructor(e){super(e),this.set("inputMode","text");const t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}}class Ui extends kt{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}}class $i extends kt{constructor(e,{min:t,max:i,step:o}={}){super(e);const n=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",o),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:n.to("min"),max:n.to("max"),step:n.to("step")}})}}class Ki extends h{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",t.to("position",i=>`ck-dropdown__panel_${i}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(){if(this.children.length){const e=this.children.first;typeof e.focus=="function"?e.focus():C("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){const e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}}class ee extends h{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;constructor(e,t,i){super(e);const o=this.bindTemplate;this.buttonView=t,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new E,this.focusTracker=new b,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",o.to("class"),o.if("isEnabled","ck-disabled",n=>!n)],id:o.to("id"),"aria-describedby":o.to("ariaDescribedById")},children:[t,i]}),t.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":o.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(t,i,o)=>{if(o)if(this.panelPosition==="auto"){const n=ee._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=n?n.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);const e=(t,i)=>{this.isOpen&&(this.isOpen=!1,i())};this.keystrokes.set("arrowdown",(t,i)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,i())}),this.keystrokes.set("arrowright",(t,i)=>{this.isOpen&&i()}),this.keystrokes.set("arrowleft",e),this.keystrokes.set("esc",e)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:e,north:t,southEast:i,southWest:o,northEast:n,northWest:r,southMiddleEast:a,southMiddleWest:l,northMiddleEast:c,northMiddleWest:u}=ee.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[i,o,a,l,e,n,r,c,u,t]:[o,i,l,a,e,r,n,u,c,t]}get _defaultPanelPositionName(){return this.locale.uiLanguageDirection==="rtl"?"sw":"se"}static defaultPanelPositions={south:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/2,name:"s"}),southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),southMiddleEast:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)/4,name:"sme"}),southMiddleWest:(e,t)=>({top:e.bottom,left:e.left-(t.width-e.width)*3/4,name:"smw"}),north:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/2,name:"n"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),northMiddleEast:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)/4,name:"nme"}),northMiddleWest:(e,t)=>({top:e.top-t.height,left:e.left-(t.width-e.width)*3/4,name:"nmw"})};static _getOptimalPosition=me}class ji extends p{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",t=>String(t))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new L;return e.content=ne,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}}class P extends h{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",i=>!i)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}}class ye extends h{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}class q extends h{labelView;items;children;constructor(e,t=new re){super(e);const i=this.bindTemplate,o=new Ce(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,o]),o.set({role:"group",ariaLabelledBy:t.id}),o.focusTracker.destroy(),o.keystrokes.destroy(),this.items=o.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",n=>!n)]},children:this.children})}focus(){if(this.items){const e=this.items.find(t=>!(t instanceof ye));e&&e.focus()}}}class Ce extends h{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);const t=this.bindTemplate;this.focusables=new B,this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this._focusCycler=new N({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(const e of this.items)e instanceof q?this._registerFocusableItemsGroup(e):e instanceof P&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(const i of t.removed)i instanceof q?this._deregisterFocusableItemsGroup(i):i instanceof P&&this._deregisterFocusableListItem(i);for(const i of Array.from(t.added).reverse())i instanceof q?this._registerFocusableItemsGroup(i,t.index):this._registerFocusableListItem(i,t.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(const o of i.removed)this._deregisterFocusableListItem(o);for(const o of Array.from(i.added).reverse())this._registerFocusableListItem(o,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach((o,n)=>{const r=typeof t<"u"?t+n:void 0;this._registerFocusableListItem(o,r)});const i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(const t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}}class Tt extends h{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Xi extends h{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function qi(s){return s.bindTemplate.to(e=>{e.target===s.element&&e.preventDefault()})}function Yi(s){if(Array.isArray(s))return{items:s,removeItems:[]};const e={items:[],removeItems:[]};return s?{...e,...s}:e}const Qi={alignLeft:$t,bold:Ut,importExport:zt,paragraph:Ht,plus:Rt,text:Gt,threeVerticalDots:be,pilcrow:Wt,dragIndicator:Nt};class Zi extends h{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);const i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new Ji(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const n=e.uiLanguageDirection==="rtl";this._focusCycler=new N({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&r.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:r,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:qi(this)}}),this._behavior=this.options.shouldGroupWhenFull?new Re(this):new Ge(this)}render(){super.render(),this.focusTracker.add(this.element);for(const e of this.items)this.focusTracker.add(e);this.items.on("add",(e,t)=>{this.focusTracker.add(t)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),e==="dynamic"?(this._behavior=new Re(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new Ge(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){const o=Yi(e),n=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,n).map(a=>Z(a)?this._createNestedToolbarDropdown(a,t,n):a==="|"?new Tt:a==="-"?new Xi:t.create(a)).filter(a=>!!a)}_cleanItemsConfiguration(e,t,i){const o=e.filter((n,r,a)=>n==="|"?!0:i.indexOf(n)!==-1?!1:n==="-"?this.options.shouldGroupWhenFull?(C("toolbarview-line-break-ignored-when-grouping-items",a),!1):!0:!Z(n)&&!t.has(n)?(C("toolbarview-item-unavailable",{item:n}),!1):!0);return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){const t=r=>r!=="-"&&r!=="|",i=e.length,o=e.findIndex(t);if(o===-1)return[];const n=i-e.slice().reverse().findIndex(t);return e.slice(o,n).filter((r,a,l)=>t(r)?!0:!(a>0&&l[a-1]===r))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:n,items:r,tooltip:a=!0,withText:l=!1}=e;if(r=this._cleanItemsConfiguration(r,t,i),!r.length)return null;const c=this.locale,u=Ve(c);return o||C("toolbarview-nested-toolbar-dropdown-missing-label",e),u.class="ck-toolbar__nested-toolbar-dropdown",u.buttonView.set({label:o,tooltip:a,withText:!!l}),n!==!1?u.buttonView.icon=Qi[n]||n||be:u.buttonView.withText=!0,vt(u,()=>u.toolbarView._buildItemsFromConfig(r,t,i)),u}}class Ji extends h{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class Ge{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(t=>t),e.focusables.bindTo(e.items).using(t=>z(t)?t:null)}render(){}destroy(){}}class Re{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(t,i)=>{const o=i.index,n=Array.from(i.added);for(const r of i.removed)o>=this.ungroupedItems.length?this.groupedItems.remove(r):this.ungroupedItems.remove(r);for(let r=o;r<o+n.length;r++){const a=n[r-o];r>this.ungroupedItems.length?this.groupedItems.add(a,r-this.ungroupedItems.length):this.ungroupedItems.add(a,r)}this._updateGrouping()})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){const e=this.view;if(e.items.length){for(let t=0;t<e.items.length;t++){const i=[...e.items][t];this.ungroupedItems.add(i,t)}this._updateGrouping()}}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!O(this.viewElement)){this.shouldUpdateGroupingOnNextResize=!0;return}const e=this.groupedItems.length;let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==e&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const e=this.viewElement,t=this.viewLocale.uiLanguageDirection,i=new T(e.lastChild),o=new T(e);if(!this.cachedPadding){const n=d.window.getComputedStyle(e),r=t==="ltr"?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(n[r])}return t==="ltr"?i.right>o.right-this.cachedPadding:i.left<o.left+this.cachedPadding}_enableGroupingOnResize(){let e;this.resizeObserver=new et(this.viewElement,t=>{(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize)&&(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Tt),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const e=this.viewLocale,t=e.t,i=Ve(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",vt(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:be}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{z(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}class es extends h{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);const i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new E,this.focusTracker=new b,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",o=>!o),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){const t=e||new p;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){const e=new p,t=e.bindTemplate;return e.icon=ne,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}}function Ve(s,e=ji){const t=typeof e=="function"?new e(s):e,i=new Ki(s),o=new ee(s,t,i);return t.bind("isEnabled").to(o),t instanceof es?t.arrowView.bind("isOn").to(o,"isOpen"):t.bind("isOn").to(o,"isOpen"),ts(o),o}function vt(s,e,t={}){s.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),s.isOpen?He(s,e,t):s.once("change:isOpen",()=>He(s,e,t),{priority:"highest"}),t.enableActiveItemFocusOnDropdownOpen&&yt(s,()=>s.toolbarView.items.find(i=>i.isOn))}function He(s,e,t){const i=s.locale,o=i.t,n=s.toolbarView=new Zi(i),r=typeof e=="function"?e():e;n.ariaLabel=t.ariaLabel||o("Dropdown toolbar"),t.maxWidth&&(n.maxWidth=t.maxWidth),t.class&&(n.class=t.class),t.isCompact&&(n.isCompact=t.isCompact),t.isVertical&&(n.isVertical=!0),r instanceof B?n.items.bindTo(r).using(a=>a):n.items.addMany(r),s.panelView.children.add(n),s.focusTracker.add(n),n.items.delegate("execute").to(s)}function ao(s,e,t={}){s.isOpen?ze(s,e,t):s.once("change:isOpen",()=>ze(s,e,t),{priority:"highest"}),yt(s,()=>s.listView.items.find(i=>i instanceof P?i.children.first.isOn:!1))}function ze(s,e,t){const i=s.locale,o=s.listView=new Ce(i),n=typeof e=="function"?e():e;o.ariaLabel=t.ariaLabel,o.role=t.role,Vt(s,o.items,n,i),s.panelView.children.add(o),o.items.delegate("execute").to(s)}function yt(s,e){s.on("change:isOpen",()=>{if(!s.isOpen)return;const t=e();t&&(typeof t.focus=="function"?t.focus():C("ui-dropdown-focus-child-on-open-child-missing-focus",{view:t}))},{priority:Ft.low-10})}function ts(s){is(s),ss(s),os(s),ns(s),rs(s),ls(s)}function is(s){ht({emitter:s,activator:()=>s.isRendered&&s.isOpen,callback:()=>{s.isOpen=!1},contextElements:()=>[s.element,...Ct(s.focusTracker).filter(e=>!s.element.contains(e))]})}function Ct(s){return[...s.elements,...s.externalViews.flatMap(e=>Ct(e.focusTracker))]}function ss(s){s.on("execute",e=>{e.source instanceof mt||(s.isOpen=!1)})}function os(s){s.focusTracker.on("change:isFocused",(e,t,i)=>{i||!s.isOpen||(s.isOpen=!1)})}function ns(s){s.keystrokes.set("arrowdown",(e,t)=>{s.isOpen&&(s.panelView.focus(),t())}),s.keystrokes.set("arrowup",(e,t)=>{s.isOpen&&(s.panelView.focusLast(),t())})}function rs(s){s.on("change:isOpen",(e,t,i)=>{if(i)return;s.focusTracker.elements.some(n=>n.contains(d.document.activeElement))&&s.buttonView.focus()})}function ls(s){s.on("change:isOpen",(e,t,i)=>{i&&s.panelView.focus()},{priority:"low"})}function Vt(s,e,t,i){as(e),e.bindTo(t).using(o=>{if(o.type==="separator")return new ye(i);if(o.type==="group"){const n=new q(i);return n.set({label:o.label}),Vt(s,n.items,o.items,i),n.items.delegate("execute").to(s),n}else if(o.type==="button"||o.type==="switchbutton"){const n=o.model.role==="menuitemcheckbox"||o.model.role==="menuitemradio",r=new P(i);let a;return o.type==="button"?(a=new W(i),a.set({isToggleable:n})):a=new mt(i),a.bind(...Object.keys(o.model)).to(o.model),a.delegate("execute").to(r),r.children.add(a),r}return null})}function as(s){let e=0;const t=n=>!(n instanceof P)||!(n.children.first instanceof W)?null:n.children.first,i=n=>{const r=t(n);return!r||!r.isToggleable?null:r},o=n=>{for(const r of s){const a=t(r);a&&(a.hasCheckSpace=n)}};s.on("change",(n,r)=>{const a=e>0;for(const c of r.removed)i(c)&&e--;for(const c of r.added){const u=t(c);u&&(u.isToggleable&&e++,u.hasCheckSpace=e>0)}const l=e>0;a!==l&&o(l)})}const cs=(s,e,t)=>{const i=new Ui(s.locale);return i.set({id:e,ariaDescribedById:t}),i.bind("isReadOnly").to(s,"isEnabled",o=>!o),i.bind("hasError").to(s,"errorText",o=>!!o),i.on("input",()=>{s.errorText=null}),s.bind("isEmpty","isFocused","placeholder").to(i),i},co=(s,e,t)=>{const i=new $i(s.locale);return i.set({id:e,ariaDescribedById:t,inputMode:"numeric"}),i.bind("isReadOnly").to(s,"isEnabled",o=>!o),i.bind("hasError").to(s,"errorText",o=>!!o),i.on("input",()=>{s.errorText=null}),s.bind("isEmpty","isFocused","placeholder").to(i),i},ho=(s,e,t)=>{const i=Ve(s.locale);return i.set({id:e,ariaDescribedById:t}),i.bind("isEnabled").to(s),i},hs=150;class us extends h{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();const i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=fe(o=>{this.set("color",o),this.fire("colorSelected",{color:this.color})},hs,{leading:!0}),this.on("set:color",(o,n,r)=>{o.return=gt(r,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=ae(this.color)}),this.on("change:_hexColor",()=>{document.activeElement!==this.picker&&this.picker.setAttribute("color",this._hexColor),ae(this.color)!=ae(this._hexColor)&&(this.color=this._hexColor)})}render(){if(super.render(),Ni("hex-color-picker",Zt),this.picker=d.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView(),this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);const e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",e=>{const t=e.detail.value;this._debounceColorPickerEvent(t)})}focus(){!this._config.hideInput&&(A.isGecko||A.isiOS||A.isSafari||A.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){const i=[...this.picker.shadowRoot.children].filter(o=>o.getAttribute("role")==="slider").map(o=>new ds(o));this.slidersView=this.createCollection(),i.forEach(o=>{this.slidersView.add(o)})}_createInputRow(){const e=this._createColorInput();return new ps(this.locale,e)}_createColorInput(){const e=new Ri(this.locale,cs),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",i=>e.isFocused?e.fieldView.value:i.startsWith("#")?i.substring(1):i),e.fieldView.on("input",()=>{const i=e.fieldView.element.value;if(i){const o=xt(i);o&&this._debounceColorPickerEvent(o)}}),e}isValid(){const{t:e}=this.locale;return this._config.hideInput?!0:(this.resetValidationStatus(),this.hexInputRow.getParsedColor()?!0:(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}}function ae(s){let e=Mi(s);return e||(e="#000"),e.length===4&&(e="#"+[e[1],e[1],e[2],e[2],e[3],e[3]].join("")),e.toLowerCase()}class ds extends h{constructor(e){super(),this.element=e}focus(){this.element.focus()}}class fs extends h{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}}class ps extends h{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new fs,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return xt(this.inputView.fieldView.element.value)}}function xt(s){if(!s)return null;const e=s.trim().replace(/^#/,"");return![3,4,6,8].includes(e.length)||!/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(e)?null:`#${e}`}class ms extends se(pe){constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,t){return this.find(i=>i.color===e.color)?this:super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}}class ws extends h{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:a,focusTracker:l,focusables:c}){super(e);const u=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=l,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new ms,this.documentColorsCount=r,this._focusables=c,this._removeButtonLabel=o,this._colorPickerLabel=a,this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",u.if("isVisible","ck-hidden",f=>!f)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){const i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(const n of i.getRoots()){const r=e.createRangeIn(n);for(const a of r.getItems())if(a.is("$textProxy")&&a.hasAttribute(t)&&(this._addColorToDocumentColors(a.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){const e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){const e=V.bind(this.documentColors,this.documentColors),t=new h(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView),this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new p,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:Xt,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){const e=new p;return e.set({withText:!0,icon:qt,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",()=>{this.fire("execute",{value:null,source:"removeColorButton"})}),e.render(),e}_createStaticColorsGrid(){const e=new We(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(t,i)=>{this.fire("execute",{value:i.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){const e=V.bind(this.documentColors,this.documentColors),t=new We(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(i=>{const o=new bt;return o.set({color:i.color,hasBorder:i.options?.hasBorder}),i.label&&o.set({label:i.label,tooltip:!0}),o.on("execute",()=>{this.fire("execute",{value:i.color,source:"documentColorsGrid"})}),o}),this.documentColors.on("change:isEmpty",(i,o,n)=>{n&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){const t=this.colorDefinitions.find(i=>i.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}}class bs extends h{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:n}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=o,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=n;const r=this.bindTemplate,{saveButtonView:a,cancelButtonView:l}=this._createActionButtons();this.saveButtonView=a,this.cancelButtonView=l,this.actionBarView=this._createActionBarView({saveButtonView:a,cancelButtonView:l}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",r.if("isVisible","ck-hidden",c=>!c)]},children:this.items})}render(){super.render();const e=new us(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",(t,i,o)=>{e.color=o}),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())})}_stopPropagationOnArrowsKeys(){const e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(const t of this.colorPickerView.slidersView)this.focusTracker.add(t.element),this._focusables.add(t);const e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){const i=new h,o=this.createCollection();return o.add(e),o.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),i}_createActionButtons(){const e=this.locale,t=e.t,i=new p(e),o=new p(e);return i.set({icon:st,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:it,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})}),o.on("execute",()=>{this.fire("colorPicker:cancel")}),{saveButtonView:i,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",(e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)})}}class uo extends h{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:a,colorPickerViewConfig:l}){super(e),this.items=this.createCollection(),this.focusTracker=new b,this.keystrokes=new E,this._focusables=new B,this._colorPickerViewConfig=l,this._focusCycler=new N({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new ws(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:r,colorPickerLabel:a,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new bs(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:l}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",(c,u,f)=>{this.colorGridsFragmentView.set("selectedColor",f),this.colorPickerFragmentView.set("selectedColor",f)}),this.colorGridsFragmentView.on("change:selectedColor",(c,u,f)=>{this.set("selectedColor",f)}),this.colorPickerFragmentView.on("change:selectedColor",(c,u,f)=>{this.set("selectedColor",f)}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){!this.colorPickerFragmentView.colorPickerView||this._isColorPickerFragmentVisible||(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){this.items.length!==2&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",()=>{this.showColorPickerFragment()}),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}}class gs{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(const e of this._components.values())yield e.originalName}add(e,t){this._components.set(ce(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new v("componentfactory-item-missing",this,{name:e});return this._components.get(ce(e)).callback(this.editor.locale)}has(e){return this._components.has(ce(e))}}function ce(s){return String(s).toLowerCase()}const Ue="ck-tooltip";class m extends ie(){tooltipTextView;balloonPanelView;static defaultBalloonPositions=k.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_watchdogExcluded;static _editors=new Set;static _instance=null;constructor(e){if(super(),m._editors.add(e),m._instance)return m._instance;m._instance=this,this.tooltipTextView=new h(e.locale),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new k(e.locale),this.balloonPanelView.class=Ue,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=_s(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=fe(this._pinTooltip,600),this._unpinTooltipDebounced=fe(this._unpinTooltip,400),this.listenTo(d.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(d.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(d.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(d.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(d.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(d.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}destroy(e){const t=e.ui.view&&e.ui.view.body;m._editors.delete(e),this.stopListening(e.ui),t&&t.has(this.balloonPanelView)&&t.remove(this.balloonPanelView),m._editors.size||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),m._instance=null)}static getPositioningFunctions(e){const t=m.defaultBalloonPositions;return{s:[t.southArrowNorth,t.southArrowNorthEast,t.southArrowNorthWest],n:[t.northArrowSouth],e:[t.eastArrowWest],w:[t.westArrowEast],sw:[t.southArrowNorthEast],se:[t.southArrowNorthWest]}[e]}_onKeyDown(e,t){t.key==="Escape"&&this._currentElementWithTooltip&&(this._unpinTooltip(),t.stopPropagation())}_onEnterOrFocus(e,{target:t}){const i=he(t);if(!i){e.name==="focus"&&this._unpinTooltip();return}if(i===this._currentElementWithTooltip){this._unpinTooltipDebounced.cancel();return}this._unpinTooltip(),e.name==="focus"&&!i.matches(":hover")||i.matches("[data-cke-tooltip-instant]")?this._pinTooltip(i,ue(i)):this._pinTooltipDebounced(i,ue(i))}_onLeaveOrBlur(e,{target:t,relatedTarget:i}){if(e.name==="mouseleave"){if(!_e(t))return;const o=this.balloonPanelView.element,n=o&&(o===i||o.contains(i)),r=!n&&t===o;if(n){this._unpinTooltipDebounced.cancel();return}if(!r&&this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;const a=he(t),l=he(i);(r||a&&a!==l)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||a&&a.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&t!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_onScroll(e,{target:t}){this._currentElementWithTooltip&&(t.contains(this.balloonPanelView.element)&&t.contains(this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(e,{text:t,position:i,cssClass:o}){this._unpinTooltip();const n=Dt(m._editors.values()).ui.view.body;n.has(this.balloonPanelView)||n.add(this.balloonPanelView),this.tooltipTextView.text=t,this.balloonPanelView.class=[Ue,o].filter(r=>r).join(" "),this.balloonPanelView.pin({target:e,positions:m.getPositioningFunctions(i)}),this._mutationObserver.attach(e);for(const r of m._editors)this.listenTo(r.ui,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=e,this._currentTooltipPosition=i}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(const e of m._editors)this.stopListening(e.ui,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;const e=ue(this._currentElementWithTooltip);if(!O(this._currentElementWithTooltip)||!e.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:m.getPositioningFunctions(e.position)})}}function he(s){return _e(s)?s.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function ue(s){return{text:s.dataset.ckeTooltipText,position:s.dataset.ckeTooltipPosition||"s",cssClass:s.dataset.ckeTooltipClass||""}}function _s(s){const e=new MutationObserver(()=>{s()});return{attach(t){e.observe(t,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){e.disconnect()}}}class ks extends ft{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){const t=this.editor.config.get("licenseKey"),i=$e(t);return!!(i&&this.licenseTypeMessage[i])}_createBadgeContent(){const e=this.editor.config.get("licenseKey"),t=$e(e);return new Ts(this.editor.locale,this.licenseTypeMessage[t])}_getNormalizedConfig(){const e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o=t.side||e.side;return{position:i,side:o==="left"?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}}class Ts extends h{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}}function $e(s){if(s=="GPL")return"GPL";const e=tt(s.split(".")[1]);return e?e.licenseType||"production":null}class Et extends P{constructor(e,t){super(e);const i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}}const U=5,D={toggleMenusAndFocusItemsOnHover(s){s.on("menu:mouseenter",e=>{if(!(!s.isFocusBorderEnabled&&!s.isOpen)){if(s.isOpen)for(const t of s.menus){const i=e.path[0],o=i instanceof Et&&i.children.first===t;t.isOpen=(e.path.includes(t)||o)&&t.isEnabled}e.source.focus()}})},focusCycleMenusOnArrows(s){const e=s.locale.uiLanguageDirection==="rtl";s.on("menu:arrowright",i=>{t(i.source,e?-1:1)}),s.on("menu:arrowleft",i=>{t(i.source,e?1:-1)});function t(i,o){const n=s.children.getIndex(i),r=i.isOpen,a=s.children.length,l=s.children.get((n+a+o)%a);i.isOpen=!1,r&&(l.isOpen=!0),l.buttonView.focus()}},closeMenusWhenTheBarCloses(s){s.on("change:isOpen",()=>{s.isOpen||s.menus.forEach(e=>{e.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(s){s.on("menu:change:isOpen",(e,t,i)=>{i&&s.menus.filter(o=>e.source.parentMenuView===o.parentMenuView&&e.source!==o&&o.isOpen).forEach(o=>{o.isOpen=!1})})},closeOnClickOutside(s){ht({emitter:s,activator:()=>s.isOpen,callback:()=>s.close(),contextElements:()=>s.children.map(e=>e.element)})},enableFocusHighlightOnInteraction(s){let e=!1;s.on("change:isOpen",(t,i,o)=>{o||(e||(s.isFocusBorderEnabled=!1),e=!1)}),s.listenTo(s.element,"keydown",()=>{e=!0},{useCapture:!0}),s.listenTo(s.element,"keyup",()=>{e=!1},{useCapture:!0}),s.listenTo(s.element,"focus",()=>{e&&(s.isFocusBorderEnabled=!0)},{useCapture:!0})}},I={openAndFocusPanelOnArrowDownKey(s){s.keystrokes.set("arrowdown",(e,t)=>{s.isEnabled&&s.focusTracker.focusedElement===s.buttonView.element&&(s.isOpen||(s.isOpen=!0),s.panelView.focus(),t())})},openOnArrowRightKey(s){const e=s.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";s.keystrokes.set(e,(t,i)=>{s.focusTracker.focusedElement!==s.buttonView.element||!s.isEnabled||(s.isOpen||(s.isOpen=!0),s.panelView.focus(),i())})},openOnButtonClick(s){s.buttonView.on("execute",()=>{s.isOpen=!0})},toggleOnButtonClick(s){s.buttonView.on("execute",()=>{s.isOpen=!s.isOpen})},openAndFocusOnEnterKeyPress(s){s.keystrokes.set("enter",(e,t)=>{s.focusTracker.focusedElement===s.buttonView.element&&(s.isOpen=!0,s.panelView.focus(),t())})},closeOnArrowLeftKey(s){const e=s.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";s.keystrokes.set(e,(t,i)=>{s.isOpen&&(s.isOpen=!1,s.focus(),i())})},closeOnEscKey(s){s.keystrokes.set("esc",(e,t)=>{s.isOpen&&(s.isOpen=!1,s.focus(),t())})},closeOnParentClose(s){s.parentMenuView.on("change:isOpen",(e,t,i)=>{!i&&e.source===s.parentMenuView&&(s.isOpen=!1)})}},vs={southEast:s=>({top:s.bottom,left:s.left,name:"se"}),southWest:(s,e)=>({top:s.bottom,left:s.left-e.width+s.width,name:"sw"}),northEast:(s,e)=>({top:s.top-e.height,left:s.left,name:"ne"}),northWest:(s,e)=>({top:s.top-e.height,left:s.left-e.width+s.width,name:"nw"}),eastSouth:s=>({top:s.top,left:s.right-U,name:"es"}),eastNorth:(s,e)=>({top:s.top-e.height,left:s.right-U,name:"en"}),westSouth:(s,e)=>({top:s.top,left:s.left-e.width+U,name:"ws"}),westNorth:(s,e)=>({top:s.top-e.height,left:s.left-e.width+U,name:"wn"})},ys=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function Cs(s){let e;return!("items"in s)||!s.items?e={items:ge(ys),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...s}:e={items:s.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...s},e}function Vs({normalizedConfig:s,locale:e,componentFactory:t,extraItems:i}){const o=ge(s);return Ke(s,o,i),xs(s,o),Ke(s,o,o.addItems),Es(s,o,t),It(s,o),Is(o,e),o}function xs(s,e){const t=e.removeItems,i=[];e.items=e.items.filter(({menuId:o})=>t.includes(o)?(i.push(o),!1):!0),G(e.items,o=>{o.groups=o.groups.filter(({groupId:n})=>t.includes(n)?(i.push(n),!1):!0);for(const n of o.groups)n.items=n.items.filter(r=>{const a=Ot(r);return t.includes(a)?(i.push(a),!1):!0})});for(const o of t)i.includes(o)||C("menu-bar-item-could-not-be-removed",{menuBarConfig:s,itemName:o})}function Ke(s,e,t){const i=[];if(t.length!=0){for(const o of t){const n=Bs(o.position),r=Ls(o.position);if(Os(o))if(!r)n==="start"?(e.items.unshift(o.menu),i.push(o)):n==="end"&&(e.items.push(o.menu),i.push(o));else{const a=e.items.findIndex(l=>l.menuId===r);a!=-1?n==="before"?(e.items.splice(a,0,o.menu),i.push(o)):n==="after"&&(e.items.splice(a+1,0,o.menu),i.push(o)):je(e,o.menu,r,n)&&i.push(o)}else Ps(o)?G(e.items,a=>{if(a.menuId===r)n==="start"?(a.groups.unshift(o.group),i.push(o)):n==="end"&&(a.groups.push(o.group),i.push(o));else{const l=a.groups.findIndex(c=>c.groupId===r);l!==-1&&(n==="before"?(a.groups.splice(l,0,o.group),i.push(o)):n==="after"&&(a.groups.splice(l+1,0,o.group),i.push(o)))}}):je(e,o.item,r,n)&&i.push(o)}for(const o of t)i.includes(o)||C("menu-bar-item-could-not-be-added",{menuBarConfig:s,addedItemConfig:o})}}function je(s,e,t,i){let o=!1;return G(s.items,n=>{for(const{groupId:r,items:a}of n.groups){if(o)return;if(r===t)i==="start"?(a.unshift(e),o=!0):i==="end"&&(a.push(e),o=!0);else{const l=a.findIndex(c=>Ot(c)===t);l!==-1&&(i==="before"?(a.splice(l,0,e),o=!0):i==="after"&&(a.splice(l+1,0,e),o=!0))}}}),o}function Es(s,e,t){G(e.items,i=>{for(const o of i.groups)o.items=o.items.filter(n=>{const r=typeof n=="string"&&!t.has(n);return r&&!e.isUsingDefaultConfig&&C("menu-bar-item-unavailable",{menuBarConfig:s,parentMenuConfig:ge(i),componentName:n}),!r})})}function It(s,e){const t=e.isUsingDefaultConfig;let i=!1;if(e.items=e.items.filter(o=>o.groups.length?!0:(de(s,o,t),!1)),!e.items.length){de(s,s,t);return}G(e.items,o=>{o.groups=o.groups.filter(n=>n.items.length?!0:(i=!0,!1));for(const n of o.groups)n.items=n.items.filter(r=>Pt(r)&&!r.groups.length?(de(s,r,t),i=!0,!1):!0)}),i&&It(s,e)}function de(s,e,t){t||C("menu-bar-menu-empty",{menuBarConfig:s,emptyMenuConfig:e})}function Is(s,e){const t=e.t,i={File:t({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:t({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:t({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:t({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:t({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:t({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:t({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:t({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:t({string:"Font",id:"MENU_BAR_MENU_FONT"})};G(s.items,o=>{o.label in i&&(o.label=i[o.label])})}function G(s,e){if(Array.isArray(s))for(const i of s)t(i);function t(i){e(i);for(const o of i.groups)for(const n of o.items)Pt(n)&&t(n)}}function Os(s){return typeof s=="object"&&"menu"in s}function Ps(s){return typeof s=="object"&&"group"in s}function Bs(s){return s.startsWith("start")?"start":s.startsWith("end")?"end":s.startsWith("after")?"after":"before"}function Ls(s){const e=s.match(/^[^:]+:(.+)/);return e?e[1]:null}function Ot(s){return typeof s=="string"?s:s.menuId}function Pt(s){return typeof s=="object"&&"menuId"in s}class fo extends se(){editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();const t=e.editing.view;this.editor=e,this.componentFactory=new gs(e),this.focusTracker=new b,this.tooltipManager=new m(e),this.poweredBy=new Li(e),this.evaluationBadge=new ks(e),this.ariaLiveAnnouncer=new fi(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),this.once("ready",()=>{this._bindBodyCollectionWithFocusTracker(),this.isReady=!0}),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this.tooltipManager.destroy(this.editor),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(const e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t);const i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){const t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){e.isRendered?(this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)):e.once("render",()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element)}),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){const t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t);const i=Cs(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),n())}),this.editor.keystrokes.set("Alt+F9",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),n())})}_readViewportOffsetFromConfig(){const e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;const i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){const e=this.editor;let t;e.keystrokes.set("Alt+F10",(i,o)=>{this._saveLastFocusedForeignElement();const n=this._getCurrentFocusedToolbarDefinition();(!n||!t)&&(t=this._getFocusableCandidateToolbarDefinitions());for(let r=0;r<t.length;r++){const a=t.shift();if(t.push(a),a!==n&&this._focusFocusableCandidateToolbar(a)){n&&n.options.afterBlur&&n.options.afterBlur();break}}o()}),e.keystrokes.set("Esc",(i,o)=>{const n=this._getCurrentFocusedToolbarDefinition();n&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),n.options.afterBlur&&n.options.afterBlur(),o())})}_saveLastFocusedForeignElement(){const e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){const e=[];for(const t of this._focusableToolbarDefinitions){const{toolbarView:i,options:o}=t;(O(i.element)||o.beforeFocus)&&e.push(t)}return e.sort((t,i)=>Xe(t)-Xe(i)),e}_getCurrentFocusedToolbarDefinition(){for(const e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){const{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),O(t.element)?(t.focus(),!0):!1}_handleScrollToTheSelection(e,t){const i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_bindBodyCollectionWithFocusTracker(){const e=this.view.body;for(const t of e)this.focusTracker.add(t.element);e.on("add",(t,i)=>{this.focusTracker.add(i.element)}),e.on("remove",(t,i)=>{this.focusTracker.remove(i.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(t,i,o)=>{const n=this._getVisualViewportTopOffset(o);o.visualTop!==n&&(t.return={...o,visualTop:n})}),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!d.window.visualViewport)return;const e=()=>{const t=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==t&&(this.viewportOffset={...this.viewportOffset,visualTop:t})};this._domEmitter=new(ie()),this._domEmitter.listenTo(d.window.visualViewport,"scroll",e),this._domEmitter.listenTo(d.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){const t=K().top,i=e.top||0;return t>i?0:i-t}}function Xe(s){const{toolbarView:e,options:t}=s;let i=10;return O(e.element)&&i--,t.isContextual&&(i-=2),i}class Fs extends h{body;menuBarView;toolbar;constructor(e){super(e),this.body=new _(e)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}class po extends Fs{top;main;_voiceLabelView;constructor(e){super(e),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:e.uiLanguageDirection,lang:e.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const e=this.t,t=new re;return t.text=e("Rich Text Editor"),t.extendTemplate({attributes:{class:"ck-voice-label"}}),t}}class As extends h{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=t}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){const e=this._editingView;e.isRenderingInProgress?i(this):t(this);function t(o){e.change(n=>{const r=e.document.getRoot(o.name);n.addClass(o.isFocused?"ck-focused":"ck-blurred",r),n.removeClass(o.isFocused?"ck-blurred":"ck-focused",r)})}function i(o){e.once("change:isRenderingInProgress",(n,r,a)=>{a?i(o):t(o)})}}}class mo extends As{_options;constructor(e,t,i,o={}){super(e,t,i),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const e=this._editingView;e.change(t=>{const i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){const e=this.locale.t,t=this._options.label,i=this._editableElement,o=this.name;if(typeof t=="string")return t;if(typeof t=="object")return t[o];if(typeof t=="function")return t(this);if(i){const n=i.getAttribute("aria-label");if(n)return n}return e("Rich Text Editor. Editing area: %0",o)}}class wo extends h{children;constructor(e,t={}){super(e);const i=this.bindTemplate;this.set("class",["ck","ck-form__row",...oe(t.class||[])]),this.children=this.createCollection(),t.children&&t.children.forEach(o=>this.children.add(o)),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",o=>o.join(" ")),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}}class bo extends Mt{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){const t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}}class go extends se(){constructor(e,t){super(),t&&Jt(this,t),e&&this.set(e)}}const $=te("px");class _o extends we{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{const t=this.editor.editing.view,o=t.document.selection.editableElement;return o?t.domConverter.mapViewToDom(o.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new v("contextualballoon-add-view-exist",[this,e]);const t=e.stackId||"main";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,(!this._visibleStack||e.singleViewMode)&&this.showStack(t);return}const i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new v("contextualballoon-remove-view-not-exist",[this,e]);const t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(t.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),t.size===1?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;const t=this._idToStack.get(e);if(!t)throw new v("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new k(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(i=>i[1]===e)[0]}_showNextStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){const e=Array.from(this._idToStack.values());let t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){const e=new Ds(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(i,o)=>!o&&i>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(i,o)=>{if(o<2)return"";const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[n,o])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){const e=new Ss(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,i)=>!i&&t>=2?Math.min(t-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}}class Ds extends h{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new b,this.buttonPrevView=this._createButtonView(t("Previous"),Kt),this.buttonNextView=this._createButtonView(t("Next"),jt),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",o=>o?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){const i=new p(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i}}class Ss extends h{content;_balloonPanelView;constructor(e,t){super(e);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",o=>o?"":"ck-hidden")],style:{top:i.to("top",$),left:i.to("left",$),width:i.to("width",$),height:i.to("height",$)}},children:this.content}),this.on("change:numberOfPanels",(o,n,r,a)=>{r>a?this._addPanels(r-a):this._removePanels(a-r),this.updatePosition()})}_addPanels(e){for(;e--;){const t=new h;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new T(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}}const S=te("px");class ko extends h{content;contentPanelElement;_contentPanelPlaceholder;constructor(e){super(e);const t=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new V({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:t.to("isSticky",i=>i?"block":"none"),height:t.to("isSticky",i=>i?S(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new V({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",t.if("isSticky","ck-sticky-panel__content_sticky"),t.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:t.to("isSticky",i=>i?S(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:t.to("_stickyTopOffset",i=>i&&S(i)),bottom:t.to("_stickyBottomOffset",i=>i&&S(i)),marginLeft:t.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(d.document,"scroll",()=>{this.checkIfShouldBeSticky()},{useCapture:!0}),this.listenTo(this,"change:isActive",()=>{this.checkIfShouldBeSticky()}),d.window.visualViewport&&(this.listenTo(d.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(d.window.visualViewport,"resize",()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive){this._unstick();return}const e=new T(this.limiterElement);let t=e.getVisible();if(t){const n=new T(d.window);n.top+=this.viewportTopOffset,n.height-=this.viewportTopOffset,t=t.getIntersection(n)}const{left:i,top:o}=K();if(e.moveBy(i,o),t&&t.moveBy(i,o),t&&e.top<t.top)if(this._contentPanelRect.height+this.limiterBottomOffset>t.height){const n=Math.max(e.bottom-t.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+n+1<e.height?this._stickToBottomOfLimiter(n):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<e.height?this._stickToTopOfAncestors(t.top):this._unstick();else this._unstick()}_stickToTopOfAncestors(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=e,this._stickyBottomOffset=null,this._marginLeft=S(-d.window.scrollX+K().left)}_stickToBottomOfLimiter(e){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=e,this._marginLeft=S(-d.window.scrollX+K().left)}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null}get _contentPanelRect(){return new T(this.contentPanelElement)}}class Ms extends W{arrowView;constructor(e){super(e);const t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",i=>String(i)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const e=new L;return e.content=ne,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}}class Ns extends h{children;constructor(e){super(e);const t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",i=>`ck-menu-bar__menu__panel_position_${i}`),t.if("isVisible","ck-hidden",i=>!i)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(e=1){this.children.length&&(e===1?this.children.first.focus():this.children.last.focus())}}class R extends h{buttonView;panelView;focusTracker;keystrokes;constructor(e){super(e);const t=this.bindTemplate;this.buttonView=new Ms(e),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new Ns(e),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new E,this.focusTracker=new b,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",t.to("class"),t.if("isEnabled","ck-disabled",i=>!i),t.if("parentMenuView","ck-menu-bar__menu_top-level",i=>!i)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),I.closeOnEscKey(this),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(I.openOnButtonClick(this),I.openOnArrowRightKey(this),I.closeOnArrowLeftKey(this),I.openAndFocusOnEnterKeyPress(this),I.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),I.openAndFocusPanelOnArrowDownKey(this),I.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(e,t)=>{this.fire("arrowright"),t()}),this.keystrokes.set("arrowleft",(e,t)=>{this.fire("arrowleft"),t()})}_repositionPanelOnOpen(){this.on("change:isOpen",(e,t,i)=>{if(!i)return;const o=R._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=o?o.name:this._defaultMenuPositionName})}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:e,southWest:t,northEast:i,northWest:o,westSouth:n,eastSouth:r,westNorth:a,eastNorth:l}=vs;return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?[r,l,n,a]:[e,t,i,o]:this.parentMenuView?[n,a,r,l]:[t,e,o,i]}get _defaultMenuPositionName(){return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=me}class qe extends Ce{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){const e=Array.from(this.items).some(t=>{const i=Ye(t);return i&&i.isToggleable});this.items.forEach(t=>{const i=Ye(t);i&&(i.hasCheckSpace=e)})}}function Ye(s){return s instanceof P?s.children.map(e=>Ws(e)?e.buttonView:e).find(e=>e instanceof W):null}function Ws(s){return typeof s=="object"&&"buttonView"in s&&s.buttonView instanceof p}class Gs extends Ai{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}}const Qe=["mouseenter","arrowleft","arrowright","change:isOpen"];class To extends h{children;menus=[];constructor(e){super(e);const t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){const o=this.locale,r=Vs({normalizedConfig:e,locale:o,componentFactory:t,extraItems:i}).items.map(a=>this._createMenu({componentFactory:t,menuDefinition:a}));this.children.addMany(r)}render(){super.render(),D.toggleMenusAndFocusItemsOnHover(this),D.closeMenusWhenTheBarCloses(this),D.closeMenuWhenAnotherOnTheSameLevelOpens(this),D.focusCycleMenusOnArrows(this),D.closeOnClickOutside(this),D.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(const e of this.children)e.isOpen=!1}disable(){for(const e of this.children)e.isEnabled=!1}enable(){for(const e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...Qe).to(t),e.parentMenuView=t):e.delegate(...Qe).to(this,i=>"menu:"+i),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){const o=this.locale,n=new R(o);return this.registerMenu(n,i),n.buttonView.set({label:t.label}),n.once("change:isOpen",()=>{const r=new qe(o);r.ariaLabel=t.label,n.panelView.children.add(r),r.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:n,componentFactory:e}))}),n}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){const o=this.locale,n=[];for(const r of e.groups){for(const a of r.items){const l=new Et(o,t);if(Z(a))l.children.add(this._createMenu({componentFactory:i,menuDefinition:a,parentMenuView:t}));else{const c=this._createMenuItemContentFromFactory({componentName:a,componentFactory:i,parentMenuView:t});if(!c)continue;l.children.add(c)}n.push(l)}r!==e.groups[e.groups.length-1]&&n.push(new ye(o))}return n}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){const o=i.create(e);return o instanceof R||o instanceof dt||o instanceof Gs?(this._registerMenuTree(o,t),o.on("execute",()=>{this.close()}),o):(C("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof R)){e.delegate("mouseenter").to(t);return}this.registerMenu(e,t);const i=e.panelView.children.filter(n=>n instanceof qe)[0];if(!i){e.delegate("mouseenter").to(t);return}const o=i.items.filter(n=>n instanceof P);for(const n of o)this._registerMenuTree(n.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(t,i,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(n=>n.isOpen)},0)})}}export{so as AccessibilityHelp,gi as AccessibilityHelpContentView,fi as AriaLiveAnnouncer,De as AriaLiveAnnouncerPoliteness,mi as AriaLiveAnnouncerRegionView,pi as AriaLiveAnnouncerView,ft as Badge,k as BalloonPanelView,_ as BodyCollection,po as BoxedEditorUIView,ut as ButtonLabelView,p as ButtonView,no as CollapsibleView,We as ColorGridView,ws as ColorGridsFragmentView,bs as ColorPickerFragmentView,ps as ColorPickerInputRowView,us as ColorPickerView,uo as ColorSelectorView,bt as ColorTileView,gs as ComponentFactory,_o as ContextualBalloon,to as CssTransitionDisablerMixin,ys as DefaultMenuBarItems,y as Dialog,yi as DialogActionsView,Ci as DialogContentView,ve as DialogView,g as DialogViewPosition,ms as DocumentColorCollection,wi as DraggableViewMixin,ji as DropdownButtonView,Ki as DropdownPanelView,ee as DropdownView,As as EditableUIView,fo as EditorUI,Fs as EditorUIView,ks as EvaluationBadge,oo as FileDialogButtonView,Ai as FileDialogListItemButtonView,wt as FileDialogViewMixin,N as FocusCycler,Ti as FormHeaderView,wo as FormRowView,L as IconView,mo as InlineEditableUIView,Hi as InputBase,$i as InputNumberView,Ui as InputTextView,kt as InputView,Ji as ItemsView,re as LabelView,Ri as LabeledFieldView,W as ListItemButtonView,q as ListItemGroupView,P as ListItemView,ye as ListSeparatorView,Ce as ListView,Ms as MenuBarMenuButtonView,dt as MenuBarMenuListItemButtonView,Gs as MenuBarMenuListItemFileDialogButtonView,Et as MenuBarMenuListItemView,qe as MenuBarMenuListView,Ns as MenuBarMenuPanelView,R as MenuBarMenuView,To as MenuBarView,Qi as NESTED_TOOLBAR_ICONS,bo as Notification,Li as PoweredBy,ds as SliderView,es as SplitButtonView,ko as StickyPanelView,mt as SwitchButtonView,V as Template,Xi as ToolbarLineBreakView,Tt as ToolbarSeparatorView,Zi as ToolbarView,m as TooltipManager,go as UIModel,h as View,B as ViewCollection,go as ViewModel,Vi as _CheckIconHolderView,no as _CollapsibleView,Ds as _ContextualBalloonRotatorView,D as _MenuBarBehaviors,I as _MenuBarMenuBehaviors,vs as _MenuBarMenuViewPanelPositioningFunctions,H as _TemplateBinding,nt as _TemplateIfBinding,oi as _TemplateToBinding,gt as _convertColor,Mi as _convertColorToHex,qi as _preventUiViewDefault,Vs as _processMenuBarConfig,Ni as _registerCustomElement,xt as _tryNormalizeHexColor,bi as addKeyboardHandlingForGrid,ao as addListToDropdown,vt as addToolbarToDropdown,ht as clickOutsideHandler,Ve as createDropdown,ho as createLabeledDropdown,co as createLabeledInputNumber,cs as createLabeledInputText,yt as focusChildOnDropdownOpen,ro as getLocalizedColorOptions,z as isFocusable,vi as isViewWithFocusCycler,lo as normalizeColorOptions,Cs as normalizeMenuBarConfig,Si as normalizeSingleColorDefinition,Yi as normalizeToolbarConfig,io as submitHandler};