@project-sunbird/sunbird-questionset-editor-web-component-react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/dist/api/asset.d.ts +31 -0
  2. package/dist/api/categoryDefinition.d.ts +39 -0
  3. package/dist/api/channel.d.ts +13 -0
  4. package/dist/api/client.d.ts +10 -0
  5. package/dist/api/client.test.d.ts +1 -0
  6. package/dist/api/comments.d.ts +10 -0
  7. package/dist/api/content.d.ts +14 -0
  8. package/dist/api/framework.d.ts +4 -0
  9. package/dist/api/hierarchy.d.ts +13 -0
  10. package/dist/api/license.d.ts +2 -0
  11. package/dist/api/question.d.ts +13 -0
  12. package/dist/api/question.test.d.ts +1 -0
  13. package/dist/api/urls.d.ts +64 -0
  14. package/dist/assets/libs/mathEquation/plugin/mathModal/css/mathmodal.css +1 -0
  15. package/dist/assets/libs/mathEquation/plugin/mathModal/favicon.ico +0 -0
  16. package/dist/assets/libs/mathEquation/plugin/mathModal/index.html +1 -0
  17. package/dist/assets/libs/mathEquation/plugin/mathModal/js/mathmodal.js +8 -0
  18. package/dist/assets/libs/mathEquation/plugin/mathModal/katex.min.css +1 -0
  19. package/dist/assets/libs/mathEquation/plugin/mathModal/katex.min.js +1 -0
  20. package/dist/assets/libs/mathEquation/plugin/mathModal/mathquill.css +425 -0
  21. package/dist/assets/libs/mathEquation/plugin/mathModal/mathquill.js +4925 -0
  22. package/dist/ckeditor/ckeditor.js +6 -0
  23. package/dist/components/AssetBrowser/AssetBrowser.d.ts +17 -0
  24. package/dist/components/BehaviourForm/SetBehaviourForm.d.ts +8 -0
  25. package/dist/components/CKEditorField/CKEditorField.d.ts +11 -0
  26. package/dist/components/ContextualEditor/ContextualEditor.d.ts +13 -0
  27. package/dist/components/LibraryDock/LibraryDock.d.ts +8 -0
  28. package/dist/components/OutlineTree/OutlineTree.d.ts +7 -0
  29. package/dist/components/QuestionDetail/QuestionDetail.d.ts +13 -0
  30. package/dist/components/QuestionEditor/BooleanEditor/BooleanEditor.d.ts +7 -0
  31. package/dist/components/QuestionEditor/FtbEditor/FtbEditor.d.ts +8 -0
  32. package/dist/components/QuestionEditor/McqEditor/McqEditor.d.ts +7 -0
  33. package/dist/components/QuestionEditor/MtfEditor/MtfEditor.d.ts +7 -0
  34. package/dist/components/QuestionEditor/QuestionEditor.d.ts +8 -0
  35. package/dist/components/QuestionEditor/ReoEditor/ReoEditor.d.ts +7 -0
  36. package/dist/components/QuestionEditor/SaEditor/SaEditor.d.ts +7 -0
  37. package/dist/components/QuestionEditor/SeqEditor/SeqEditor.d.ts +7 -0
  38. package/dist/components/QuestionsetEditor/QuestionsetEditor.d.ts +6 -0
  39. package/dist/components/QumlPlayer/QumlPlayer.d.ts +13 -0
  40. package/dist/components/RichTextEditor/RichTextEditor.d.ts +28 -0
  41. package/dist/components/SectionBehaviourForm/SectionBehaviourForm.d.ts +8 -0
  42. package/dist/components/SparkMetaForm/SparkMetaForm.d.ts +39 -0
  43. package/dist/components/SplitEditorShell/SplitEditorShell.d.ts +8 -0
  44. package/dist/components/Topbar/Topbar.d.ts +18 -0
  45. package/dist/components/modals/ConfirmDialog.d.ts +4 -0
  46. package/dist/components/modals/ProgressStatusModal.d.ts +7 -0
  47. package/dist/components/modals/PublishChecklist.d.ts +10 -0
  48. package/dist/components/modals/QualityParamsModal.d.ts +11 -0
  49. package/dist/components/modals/QuestionTypeSelectorModal.d.ts +4 -0
  50. package/dist/components/modals/TermAndConditionModal.d.ts +8 -0
  51. package/dist/components/modals/UnsavedChangesModal.d.ts +10 -0
  52. package/dist/components/shared/Badge.d.ts +20 -0
  53. package/dist/components/shared/Button.d.ts +25 -0
  54. package/dist/components/shared/ContentEditable.d.ts +14 -0
  55. package/dist/components/shared/Icon.d.ts +11 -0
  56. package/dist/components/shared/ImagePickerModal.d.ts +15 -0
  57. package/dist/components/shared/MathModal.d.ts +10 -0
  58. package/dist/components/shared/Modal.d.ts +29 -0
  59. package/dist/components/shared/SharedRichToolbar.d.ts +5 -0
  60. package/dist/components/shared/Spinner.d.ts +15 -0
  61. package/dist/components/shared/specialCharsData.d.ts +7 -0
  62. package/dist/dev-main.d.ts +1 -0
  63. package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  64. package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  65. package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  66. package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  67. package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  68. package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  69. package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  70. package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  71. package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  72. package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  73. package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  74. package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  75. package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  76. package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  77. package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  78. package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  79. package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  80. package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  81. package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  82. package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  83. package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  84. package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  85. package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  86. package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  87. package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  88. package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  89. package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  90. package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  91. package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  92. package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  93. package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  94. package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  95. package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  96. package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  97. package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  98. package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  99. package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  100. package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  101. package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  102. package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  103. package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  104. package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  105. package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  106. package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  107. package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  108. package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  109. package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  110. package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  111. package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  112. package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  113. package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  114. package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  115. package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  116. package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  117. package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  118. package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  119. package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  120. package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  121. package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  122. package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  123. package/dist/hooks/index.d.ts +9 -0
  124. package/dist/hooks/useChannelData.d.ts +3 -0
  125. package/dist/hooks/useEditorInit.d.ts +12 -0
  126. package/dist/hooks/useFramework.d.ts +9 -0
  127. package/dist/hooks/useLabels.d.ts +4 -0
  128. package/dist/hooks/useLibrary.d.ts +18 -0
  129. package/dist/hooks/useQuestionRead.d.ts +16 -0
  130. package/dist/hooks/useSaveHierarchy.d.ts +6 -0
  131. package/dist/hooks/useSaveQuestion.d.ts +3 -0
  132. package/dist/hooks/useTelemetry.d.ts +9 -0
  133. package/dist/hooks/useToolbarActions.d.ts +5 -0
  134. package/dist/index.d.ts +19 -0
  135. package/dist/index.js +16202 -0
  136. package/dist/locales/label.config.ar.json.d.ts +344 -0
  137. package/dist/locales/label.config.fr.json.d.ts +237 -0
  138. package/dist/locales/label.config.hi.json.d.ts +51 -0
  139. package/dist/locales/label.config.json.d.ts +379 -0
  140. package/dist/locales/label.config.pt.json.d.ts +237 -0
  141. package/dist/registry/defaultQuestionTypes.d.ts +1 -0
  142. package/dist/registry/index.d.ts +9 -0
  143. package/dist/registry/questionTypeRegistry.d.ts +38 -0
  144. package/dist/store/editor.store.d.ts +66 -0
  145. package/dist/store/index.d.ts +5 -0
  146. package/dist/store/library.store.d.ts +32 -0
  147. package/dist/store/question.store.d.ts +103 -0
  148. package/dist/store/tree.store.d.ts +43 -0
  149. package/dist/store/tree.store.test.d.ts +1 -0
  150. package/dist/store/ui.store.d.ts +16 -0
  151. package/dist/style.css +1 -0
  152. package/dist/types/content.d.ts +23 -0
  153. package/dist/types/editor.d.ts +130 -0
  154. package/dist/types/framework.d.ts +40 -0
  155. package/dist/types/question.d.ts +118 -0
  156. package/dist/utils/assetUrl.d.ts +11 -0
  157. package/dist/utils/context.d.ts +10 -0
  158. package/dist/utils/context.test.d.ts +1 -0
  159. package/dist/utils/html.d.ts +12 -0
  160. package/dist/utils/i18n.test.d.ts +1 -0
  161. package/dist/utils/i18nField.d.ts +38 -0
  162. package/dist/utils/i18nSerialize.d.ts +16 -0
  163. package/dist/utils/labels.d.ts +8 -0
  164. package/dist/utils/nodeKind.d.ts +9 -0
  165. package/dist/utils/notify.d.ts +4 -0
  166. package/dist/utils/questionRead.d.ts +10 -0
  167. package/dist/utils/questionRead.test.d.ts +1 -0
  168. package/dist/utils/telemetry.d.ts +15 -0
  169. package/dist/web-component/register.d.ts +1 -0
  170. package/package.json +99 -0
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md.
4
+ */
5
+ !function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1","Align center":"Align center","Align left":"Align left","Align right":"Align right","Almost equal to":"Almost equal to",Angle:"Angle","Approximately equal to":"Approximately equal to",Aquamarine:"Aquamarine","Asterisk operator":"Asterisk operator","Austral sign":"Austral sign","back with leftwards arrow above":"back with leftwards arrow above",Big:"Big","Bitcoin sign":"Bitcoin sign",Black:"Black","Block quote":"Block quote",Blue:"Blue",Bold:"Bold","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Cedi sign":"Cedi sign","Cent sign":"Cent sign","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Character categories":"Character categories","Characters: %0":"Characters: %0","Choose heading":"Choose heading",Code:"Code","Colon sign":"Colon sign",Column:"Column","Contains as member":"Contains as member","Copyright sign":"Copyright sign","Could not insert image at the current position.":"Could not insert image at the current position.","Could not obtain resized image URL.":"Could not obtain resized image URL.","Cruzeiro sign":"Cruzeiro sign","Currency sign":"Currency sign","Decrease indent":"Decrease indent",Default:"Default","Degree sign":"Degree sign","Delete column":"Delete column","Delete row":"Delete row","Dim grey":"Dim grey","Division sign":"Division sign","Document colors":"Document colors","Dollar sign":"Dollar sign","Dong sign":"Dong sign","Double dagger":"Double dagger","Double exclamation mark":"Double exclamation mark","Double low-9 quotation mark":"Double low-9 quotation mark","Double question mark":"Double question mark",Downloadable:"Downloadable","downwards arrow to bar":"downwards arrow to bar","downwards dashed arrow":"downwards dashed arrow","downwards double arrow":"downwards double arrow","Drachma sign":"Drachma sign","Dropdown toolbar":"Dropdown toolbar","Edit block":"Edit block","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Element of":"Element of","Em dash":"Em dash","Empty set":"Empty set","En dash":"En dash","end with leftwards arrow above":"end with leftwards arrow above","Enter image caption":"Enter image caption","Euro sign":"Euro sign","Euro-currency sign":"Euro-currency sign","Exclamation question mark":"Exclamation question mark","Font Background Color":"Font Background Color","Font Color":"Font Color","Font Family":"Font Family","Font Size":"Font Size","For all":"For all","Fraction slash":"Fraction slash","French franc sign":"French franc sign","Full size image":"Full size image","German penny sign":"German penny sign","Greater-than or equal to":"Greater-than or equal to","Greater-than sign":"Greater-than sign",Green:"Green",Grey:"Grey","Guarani sign":"Guarani sign","Header column":"Header column","Header row":"Header row",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Horizontal ellipsis":"Horizontal ellipsis","Hryvnia sign":"Hryvnia sign",Huge:"Huge","Identical to":"Identical to","Image resize list":"Image resize list","Image toolbar":"Image toolbar","image widget":"image widget","Increase indent":"Increase indent","Indian rupee sign":"Indian rupee sign",Infinity:"Infinity","Insert column left":"Insert column left","Insert column right":"Insert column right","Insert image":"Insert image","Insert image or file":"Insert image or file","Insert media":"Insert media","Insert paragraph after block":"Insert paragraph after block","Insert paragraph before block":"Insert paragraph before block","Insert row above":"Insert row above","Insert row below":"Insert row below","Insert table":"Insert table","Inserting image failed":"Inserting image failed",Integral:"Integral",Intersection:"Intersection","Inverted exclamation mark":"Inverted exclamation mark","Inverted question mark":"Inverted question mark",Italic:"Italic",Justify:"Justify","Kip sign":"Kip sign","Latin capital letter a with breve":"Latin capital letter a with breve","Latin capital letter a with macron":"Latin capital letter a with macron","Latin capital letter a with ogonek":"Latin capital letter a with ogonek","Latin capital letter c with acute":"Latin capital letter c with acute","Latin capital letter c with caron":"Latin capital letter c with caron","Latin capital letter c with circumflex":"Latin capital letter c with circumflex","Latin capital letter c with dot above":"Latin capital letter c with dot above","Latin capital letter d with caron":"Latin capital letter d with caron","Latin capital letter d with stroke":"Latin capital letter d with stroke","Latin capital letter e with breve":"Latin capital letter e with breve","Latin capital letter e with caron":"Latin capital letter e with caron","Latin capital letter e with dot above":"Latin capital letter e with dot above","Latin capital letter e with macron":"Latin capital letter e with macron","Latin capital letter e with ogonek":"Latin capital letter e with ogonek","Latin capital letter eng":"Latin capital letter eng","Latin capital letter g with breve":"Latin capital letter g with breve","Latin capital letter g with cedilla":"Latin capital letter g with cedilla","Latin capital letter g with circumflex":"Latin capital letter g with circumflex","Latin capital letter g with dot above":"Latin capital letter g with dot above","Latin capital letter h with circumflex":"Latin capital letter h with circumflex","Latin capital letter h with stroke":"Latin capital letter h with stroke","Latin capital letter i with breve":"Latin capital letter i with breve","Latin capital letter i with dot above":"Latin capital letter i with dot above","Latin capital letter i with macron":"Latin capital letter i with macron","Latin capital letter i with ogonek":"Latin capital letter i with ogonek","Latin capital letter i with tilde":"Latin capital letter i with tilde","Latin capital letter j with circumflex":"Latin capital letter j with circumflex","Latin capital letter k with cedilla":"Latin capital letter k with cedilla","Latin capital letter l with acute":"Latin capital letter l with acute","Latin capital letter l with caron":"Latin capital letter l with caron","Latin capital letter l with cedilla":"Latin capital letter l with cedilla","Latin capital letter l with middle dot":"Latin capital letter l with middle dot","Latin capital letter l with stroke":"Latin capital letter l with stroke","Latin capital letter n with acute":"Latin capital letter n with acute","Latin capital letter n with caron":"Latin capital letter n with caron","Latin capital letter n with cedilla":"Latin capital letter n with cedilla","Latin capital letter o with breve":"Latin capital letter o with breve","Latin capital letter o with double acute":"Latin capital letter o with double acute","Latin capital letter o with macron":"Latin capital letter o with macron","Latin capital letter r with acute":"Latin capital letter r with acute","Latin capital letter r with caron":"Latin capital letter r with caron","Latin capital letter r with cedilla":"Latin capital letter r with cedilla","Latin capital letter s with acute":"Latin capital letter s with acute","Latin capital letter s with caron":"Latin capital letter s with caron","Latin capital letter s with cedilla":"Latin capital letter s with cedilla","Latin capital letter s with circumflex":"Latin capital letter s with circumflex","Latin capital letter t with caron":"Latin capital letter t with caron","Latin capital letter t with cedilla":"Latin capital letter t with cedilla","Latin capital letter t with stroke":"Latin capital letter t with stroke","Latin capital letter u with breve":"Latin capital letter u with breve","Latin capital letter u with double acute":"Latin capital letter u with double acute","Latin capital letter u with macron":"Latin capital letter u with macron","Latin capital letter u with ogonek":"Latin capital letter u with ogonek","Latin capital letter u with ring above":"Latin capital letter u with ring above","Latin capital letter u with tilde":"Latin capital letter u with tilde","Latin capital letter w with circumflex":"Latin capital letter w with circumflex","Latin capital letter y with circumflex":"Latin capital letter y with circumflex","Latin capital letter y with diaeresis":"Latin capital letter y with diaeresis","Latin capital letter z with acute":"Latin capital letter z with acute","Latin capital letter z with caron":"Latin capital letter z with caron","Latin capital letter z with dot above":"Latin capital letter z with dot above","Latin capital ligature ij":"Latin capital ligature ij","Latin capital ligature oe":"Latin capital ligature oe","Latin small letter a with breve":"Latin small letter a with breve","Latin small letter a with macron":"Latin small letter a with macron","Latin small letter a with ogonek":"Latin small letter a with ogonek","Latin small letter c with acute":"Latin small letter c with acute","Latin small letter c with caron":"Latin small letter c with caron","Latin small letter c with circumflex":"Latin small letter c with circumflex","Latin small letter c with dot above":"Latin small letter c with dot above","Latin small letter d with caron":"Latin small letter d with caron","Latin small letter d with stroke":"Latin small letter d with stroke","Latin small letter dotless i":"Latin small letter dotless i","Latin small letter e with breve":"Latin small letter e with breve","Latin small letter e with caron":"Latin small letter e with caron","Latin small letter e with dot above":"Latin small letter e with dot above","Latin small letter e with macron":"Latin small letter e with macron","Latin small letter e with ogonek":"Latin small letter e with ogonek","Latin small letter eng":"Latin small letter eng","Latin small letter f with hook":"Latin small letter f with hook","Latin small letter g with breve":"Latin small letter g with breve","Latin small letter g with cedilla":"Latin small letter g with cedilla","Latin small letter g with circumflex":"Latin small letter g with circumflex","Latin small letter g with dot above":"Latin small letter g with dot above","Latin small letter h with circumflex":"Latin small letter h with circumflex","Latin small letter h with stroke":"Latin small letter h with stroke","Latin small letter i with breve":"Latin small letter i with breve","Latin small letter i with macron":"Latin small letter i with macron","Latin small letter i with ogonek":"Latin small letter i with ogonek","Latin small letter i with tilde":"Latin small letter i with tilde","Latin small letter j with circumflex":"Latin small letter j with circumflex","Latin small letter k with cedilla":"Latin small letter k with cedilla","Latin small letter kra":"Latin small letter kra","Latin small letter l with acute":"Latin small letter l with acute","Latin small letter l with caron":"Latin small letter l with caron","Latin small letter l with cedilla":"Latin small letter l with cedilla","Latin small letter l with middle dot":"Latin small letter l with middle dot","Latin small letter l with stroke":"Latin small letter l with stroke","Latin small letter long s":"Latin small letter long s","Latin small letter n preceded by apostrophe":"Latin small letter n preceded by apostrophe","Latin small letter n with acute":"Latin small letter n with acute","Latin small letter n with caron":"Latin small letter n with caron","Latin small letter n with cedilla":"Latin small letter n with cedilla","Latin small letter o with breve":"Latin small letter o with breve","Latin small letter o with double acute":"Latin small letter o with double acute","Latin small letter o with macron":"Latin small letter o with macron","Latin small letter r with acute":"Latin small letter r with acute","Latin small letter r with caron":"Latin small letter r with caron","Latin small letter r with cedilla":"Latin small letter r with cedilla","Latin small letter s with acute":"Latin small letter s with acute","Latin small letter s with caron":"Latin small letter s with caron","Latin small letter s with cedilla":"Latin small letter s with cedilla","Latin small letter s with circumflex":"Latin small letter s with circumflex","Latin small letter t with caron":"Latin small letter t with caron","Latin small letter t with cedilla":"Latin small letter t with cedilla","Latin small letter t with stroke":"Latin small letter t with stroke","Latin small letter u with breve":"Latin small letter u with breve","Latin small letter u with double acute":"Latin small letter u with double acute","Latin small letter u with macron":"Latin small letter u with macron","Latin small letter u with ogonek":"Latin small letter u with ogonek","Latin small letter u with ring above":"Latin small letter u with ring above","Latin small letter u with tilde":"Latin small letter u with tilde","Latin small letter w with circumflex":"Latin small letter w with circumflex","Latin small letter y with circumflex":"Latin small letter y with circumflex","Latin small letter z with acute":"Latin small letter z with acute","Latin small letter z with caron":"Latin small letter z with caron","Latin small letter z with dot above":"Latin small letter z with dot above","Latin small ligature ij":"Latin small ligature ij","Latin small ligature oe":"Latin small ligature oe","Left aligned image":"Left aligned image","Left double quotation mark":"Left double quotation mark","Left single quotation mark":"Left single quotation mark","Left-pointing double angle quotation mark":"Left-pointing double angle quotation mark","leftwards arrow to bar":"leftwards arrow to bar","leftwards dashed arrow":"leftwards dashed arrow","leftwards double arrow":"leftwards double arrow","Less-than or equal to":"Less-than or equal to","Less-than sign":"Less-than sign","Light blue":"Light blue","Light green":"Light green","Light grey":"Light grey",Link:"Link","Link URL":"Link URL","Lira sign":"Lira sign","Livre tournois sign":"Livre tournois sign","Logical and":"Logical and","Logical or":"Logical or",Macron:"Macron","Manat sign":"Manat sign","Media URL":"Media URL","media widget":"media widget","Merge cell down":"Merge cell down","Merge cell left":"Merge cell left","Merge cell right":"Merge cell right","Merge cell up":"Merge cell up","Merge cells":"Merge cells","Mill sign":"Mill sign","Minus sign":"Minus sign","Multiplication sign":"Multiplication sign","N-ary product":"N-ary product","N-ary summation":"N-ary summation",Nabla:"Nabla","Naira sign":"Naira sign","New sheqel sign":"New sheqel sign",Next:"Next","Nordic mark sign":"Nordic mark sign","Not an element of":"Not an element of","Not equal to":"Not equal to","Not sign":"Not sign","Numbered List":"Numbered List","on with exclamation mark with left right arrow above":"on with exclamation mark with left right arrow above","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Orange:"Orange",Original:"Original",Overline:"Overline",Paragraph:"Paragraph","Paragraph sign":"Paragraph sign","Partial differential":"Partial differential","Paste the media URL in the input.":"Paste the media URL in the input.","Per mille sign":"Per mille sign","Per ten thousand sign":"Per ten thousand sign","Peseta sign":"Peseta sign","Peso sign":"Peso sign","Plus-minus sign":"Plus-minus sign","Pound sign":"Pound sign",Previous:"Previous","Proportional to":"Proportional to",Purple:"Purple","Question exclamation mark":"Question exclamation mark",Red:"Red",Redo:"Redo","Registered sign":"Registered sign","Remove color":"Remove color","Resize image":"Resize image","Resize image to %0":"Resize image to %0","Resize image to the original size":"Resize image to the original size","Reversed paragraph sign":"Reversed paragraph sign","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image","Right double quotation mark":"Right double quotation mark","Right single quotation mark":"Right single quotation mark","Right-pointing double angle quotation mark":"Right-pointing double angle quotation mark","rightwards arrow to bar":"rightwards arrow to bar","rightwards dashed arrow":"rightwards dashed arrow","rightwards double arrow":"rightwards double arrow",Row:"Row","Ruble sign":"Ruble sign","Rupee sign":"Rupee sign",Save:"Save","Section sign":"Section sign","Select all":"Select all","Select column":"Select column","Select row":"Select row","Selecting resized image failed":"Selecting resized image failed","Show more items":"Show more items","Side image":"Side image","Single left-pointing angle quotation mark":"Single left-pointing angle quotation mark","Single low-9 quotation mark":"Single low-9 quotation mark","Single right-pointing angle quotation mark":"Single right-pointing angle quotation mark",Small:"Small","soon with rightwards arrow above":"soon with rightwards arrow above","Special characters":"Special characters","Spesmilo sign":"Spesmilo sign","Split cell horizontally":"Split cell horizontally","Split cell vertically":"Split cell vertically","Square root":"Square root",Strikethrough:"Strikethrough",Subscript:"Subscript",Superscript:"Superscript","Table toolbar":"Table toolbar","Tenge sign":"Tenge sign","Text alignment":"Text alignment","Text alignment toolbar":"Text alignment toolbar","Text alternative":"Text alternative","The URL must not be empty.":"The URL must not be empty.","There exists":"There exists","This link has no URL":"This link has no URL","This media URL is not supported.":"This media URL is not supported.","Tilde operator":"Tilde operator",Tiny:"Tiny","Tip: Paste the URL into the content to embed faster.":"Tip: Paste the URL into the content to embed faster.","top with upwards arrow above":"top with upwards arrow above","Trade mark sign":"Trade mark sign","Tugrik sign":"Tugrik sign","Turkish lira sign":"Turkish lira sign",Turquoise:"Turquoise","Two dot leader":"Two dot leader",Underline:"Underline",Undo:"Undo",Union:"Union",Unlink:"Unlink","up down arrow with base":"up down arrow with base","Upload failed":"Upload failed","Upload in progress":"Upload in progress","upwards arrow to bar":"upwards arrow to bar","upwards dashed arrow":"upwards dashed arrow","upwards double arrow":"upwards double arrow","Vulgar fraction one half":"Vulgar fraction one half","Vulgar fraction one quarter":"Vulgar fraction one quarter","Vulgar fraction three quarters":"Vulgar fraction three quarters",White:"White","Widget toolbar":"Widget toolbar","Won sign":"Won sign","Words: %0":"Words: %0",Yellow:"Yellow","Yen sign":"Yen sign"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClassicEditor=e():t.ClassicEditor=e()}(self,(function(){return(()=>{var t={3752:t=>{t.exports=".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}"},2333:t=>{t.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},1785:t=>{t.exports='.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;position:relative;pointer-events:none}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);border:1px solid var(--ck-clipboard-drop-target-color);background:var(--ck-clipboard-drop-target-color);margin-left:-1px}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{content:"";width:0;height:0;display:block;position:absolute;left:50%;top:calc(var(--ck-clipboard-drop-target-dot-height)*-0.5);transform:translateX(-50%);border-left:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-bottom:0 solid transparent;border-right:calc(var(--ck-clipboard-drop-target-dot-width)*0.5) solid transparent;border-top:calc(var(--ck-clipboard-drop-target-dot-height)) solid var(--ck-clipboard-drop-target-color)}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}'},1422:t=>{t.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},800:t=>{t.exports=".ck.ck-placeholder,.ck .ck-placeholder{position:relative}.ck.ck-placeholder:before,.ck .ck-placeholder:before{position:absolute;left:0;right:0;content:attr(data-placeholder);pointer-events:none}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-placeholder:before,.ck .ck-placeholder:before{cursor:text;color:var(--ck-color-engine-placeholder-text)}"},8945:t=>{t.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},845:t=>{t.exports=".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},380:t=>{t.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},2626:t=>{t.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},3215:t=>{t.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},2704:t=>{t.exports=".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},273:t=>{t.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{height:100%;border-right:1px solid var(--ck-color-base-text);margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}"},1323:t=>{t.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}"},8283:t=>{t.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},6853:t=>{t.exports=".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}"},4852:t=>{t.exports='.ck-media__wrapper .ck-media__placeholder{display:flex;flex-direction:column;align-items:center}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:block}@media (hover:none){.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:none}}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url:hover .ck-tooltip{visibility:visible;opacity:1}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{overflow:hidden;display:block}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{padding:calc(var(--ck-spacing-standard)*3);background:var(--ck-color-base-foreground)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{min-width:var(--ck-media-embed-placeholder-icon-size);height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);background-position:50%;background-size:cover}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{width:100%;height:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);white-space:nowrap;text-align:center;font-style:italic;text-overflow:ellipsis}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*="open.spotify.com"]{max-width:300px;max-height:380px}.ck-media__wrapper[data-oembed-url*="goo.gl/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="google.com/maps"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.app.goo.gl"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*="maps.google.com"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMDAzLjc4IDEuNjFoNDkuNjIxYzEuNjk0IDAgMy4xOS0uNzk4IDQuMTQ2LTIuMDM3eiIgZmlsbD0iIzVjODhjNSIvPjxwYXRoIGQ9Ik0yMjYuNzQyIDIyMi45ODhjLTkuMjY2IDAtMTYuNzc3IDcuMTctMTYuNzc3IDE2LjAxNC4wMDcgMi43NjIuNjYzIDUuNDc0IDIuMDkzIDcuODc1LjQzLjcwMy44MyAxLjQwOCAxLjE5IDIuMTA3LjMzMy41MDIuNjUgMS4wMDUuOTUgMS41MDguMzQzLjQ3Ny42NzMuOTU3Ljk4OCAxLjQ0IDEuMzEgMS43NjkgMi41IDMuNTAyIDMuNjM3IDUuMTY4Ljc5MyAxLjI3NSAxLjY4MyAyLjY0IDIuNDY2IDMuOTkgMi4zNjMgNC4wOTQgNC4wMDcgOC4wOTIgNC42IDEzLjkxNHYuMDEyYy4xODIuNDEyLjUxNi42NjYuODc5LjY2Ny40MDMtLjAwMS43NjgtLjMxNC45My0uNzk5LjYwMy01Ljc1NiAyLjIzOC05LjcyOSA0LjU4NS0xMy43OTQuNzgyLTEuMzUgMS42NzMtMi43MTUgMi40NjUtMy45OSAxLjEzNy0xLjY2NiAyLjMyOC0zLjQgMy42MzgtNS4xNjkuMzE1LS40ODIuNjQ1LS45NjIuOTg4LTEuNDM5LjMtLjUwMy42MTctMS4wMDYuOTUtMS41MDguMzU5LS43Ljc2LTEuNDA0IDEuMTktMi4xMDcgMS40MjYtMi40MDIgMi01LjExNCAyLjAwNC03Ljg3NSAwLTguODQ0LTcuNTExLTE2LjAxNC0xNi43NzYtMTYuMDE0eiIgZmlsbD0iI2RkNGIzZSIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48ZWxsaXBzZSByeT0iNS41NjQiIHJ4PSI1LjgyOCIgY3k9IjIzOS4wMDIiIGN4PSIyMjYuNzQyIiBmaWxsPSIjODAyZDI3IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0xOTAuMzAxIDIzNy4yODNjLTQuNjcgMC04LjQ1NyAzLjg1My04LjQ1NyA4LjYwNnMzLjc4NiA4LjYwNyA4LjQ1NyA4LjYwN2MzLjA0MyAwIDQuODA2LS45NTggNi4zMzctMi41MTYgMS41My0xLjU1NyAyLjA4Ny0zLjkxMyAyLjA4Ny02LjI5IDAtLjM2Mi0uMDIzLS43MjItLjA2NC0xLjA3OWgtOC4yNTd2My4wNDNoNC44NWMtLjE5Ny43NTktLjUzMSAxLjQ1LTEuMDU4IDEuOTg2LS45NDIuOTU4LTIuMDI4IDEuNTQ4LTMuOTAxIDEuNTQ4LTIuODc2IDAtNS4yMDgtMi4zNzItNS4yMDgtNS4yOTkgMC0yLjkyNiAyLjMzMi01LjI5OSA1LjIwOC01LjI5OSAxLjM5OSAwIDIuNjE4LjQwNyAzLjU4NCAxLjI5M2wyLjM4MS0yLjM4YzAtLjAwMi0uMDAzLS4wMDQtLjAwNC0uMDA1LTEuNTg4LTEuNTI0LTMuNjItMi4yMTUtNS45NTUtMi4yMTV6bTQuNDMgNS42NmwuMDAzLjAwNnYtLjAwM3oiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxNS4xODQgMjUxLjkyOWwtNy45OCA3Ljk3OSAyOC40NzcgMjguNDc1YTUuMjMzIDUuMjMzIDAgMDAuNDQ5LTIuMTIzdi0zMS4xNjVjLS40NjkuNjc1LS45MzQgMS4zNDktMS4zODIgMi4wMDUtLjc5MiAxLjI3NS0xLjY4MiAyLjY0LTIuNDY1IDMuOTktMi4zNDcgNC4wNjUtMy45ODIgOC4wMzgtNC41ODUgMTMuNzk0LS4xNjIuNDg1LS41MjcuNzk4LS45My43OTktLjM2My0uMDAxLS42OTctLjI1NS0uODc5LS42Njd2LS4wMTJjLS41OTMtNS44MjItMi4yMzctOS44Mi00LjYtMTMuOTE0LS43ODMtMS4zNS0xLjY3My0yLjcxNS0yLjQ2Ni0zLjk5LTEuMTM3LTEuNjY2LTIuMzI3LTMuNC0zLjYzNy01LjE2OWwtLjAwMi0uMDAzeiIgZmlsbD0iI2MzYzNjMyIvPjxwYXRoIGQ9Ik0yMTIuOTgzIDI0OC40OTVsLTM2Ljk1MiAzNi45NTN2LjgxMmE1LjIyNyA1LjIyNyAwIDAwNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYuMjc1IDEzNi4yNzUgMCAwMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAwLS45ODktMS40NCAzNS4xMjcgMzUuMTI3IDAgMDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OXoiIGZpbGw9IiNmZGRjNGYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxMS45OTggMjYxLjA4M2wtNi4xNTIgNi4xNTEgMjQuMjY0IDI0LjI2NGguNzgxYTUuMjI3IDUuMjI3IDAgMDA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*="facebook.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*="instagram.com"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*="twitter.com"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}'},8842:t=>{t.exports=".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}"},2957:t=>{t.exports=".ck.ck-character-grid{max-width:100%}.ck.ck-character-grid .ck-character-grid__tiles{display:grid}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{overflow-y:auto;overflow-x:hidden;width:350px;max-height:200px}.ck.ck-character-grid .ck-character-grid__tiles{grid-template-columns:repeat(auto-fit,minmax(var(--ck-character-grid-tile-size),1fr));margin:var(--ck-spacing-standard) var(--ck-spacing-large);grid-gap:var(--ck-spacing-standard)}.ck.ck-character-grid .ck-character-grid__tile{width:var(--ck-character-grid-tile-size);height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);font-size:1.2em;padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);width:100%;text-align:center}"},1287:t=>{t.exports=".ck.ck-character-info{display:flex;justify-content:space-between;padding:var(--ck-spacing-small) var(--ck-spacing-large);border-top:1px solid var(--ck-color-base-border)}.ck.ck-character-info>*{text-transform:uppercase;font-size:var(--ck-font-size-small)}.ck.ck-character-info .ck-character-info__name{max-width:280px;text-overflow:ellipsis;overflow:hidden}.ck.ck-character-info .ck-character-info__code{opacity:.6}"},3779:t=>{t.exports=".ck.ck-special-characters-navigation>.ck-label{max-width:160px;text-overflow:ellipsis;overflow:hidden}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-y:auto;overflow-x:hidden}"},9582:t=>{t.exports=".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-color-base-border);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-color-focus-border);background:var(--ck-color-focus-outer-shadow)}"},6654:t=>{t.exports=".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;width:100%;height:100%;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.ck-content .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}"},1285:t=>{t.exports=":root{--ck-color-table-focused-cell-background:rgba(158,207,250,0.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}"},7519:t=>{t.exports=':root{--ck-table-selected-cell-background:rgba(158,207,250,0.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{position:relative;caret-color:transparent;outline:unset;box-shadow:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{content:"";pointer-events:none;background-color:var(--ck-table-selected-cell-background);position:absolute;top:0;left:0;right:0;bottom:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget_selected{outline:unset}'},3081:t=>{t.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(var(--ck-spacing-small)*-1);margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},6869:t=>{t.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - var(--ck-switch-button-toggle-spacing)*2)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*0.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var(--ck-switch-button-translation)*-1))}"},8717:t=>{t.exports=".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#000}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{width:var(--ck-color-grid-tile-size);height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;border:0}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{display:none;color:var(--ck-color-color-grid-check-icon)}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}"},4479:t=>{t.exports=":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);max-width:var(--ck-dropdown-max-width);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"},257:t=>{t.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},4963:t=>{t.exports=".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button .ck-tooltip{display:none}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-right-radius:unset;border-bottom-right-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__action{border-top-left-radius:unset;border-bottom-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-radius:0}.ck-rounded-corners [dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow,[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:unset;border-bottom-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-top-right-radius:unset;border-bottom-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-left-color:var(--ck-color-split-button-hover-border)}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled){border-right-color:var(--ck-color-split-button-hover-border)}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}"},894:t=>{t.exports=":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{width:max-content;max-width:var(--ck-toolbar-dropdown-max-width)}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},1786:t=>{t.exports=":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},3869:t=>{t.exports=".ck.ck-form__header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{padding:var(--ck-spacing-small) var(--ck-spacing-large);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-form__header .ck-form__header__label{font-weight:700}"},4473:t=>{t.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},4661:t=>{t.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},6735:t=>{t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},3259:t=>{t.exports=".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{pointer-events:none;transform-origin:0 0;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);background:var(--ck-color-labeled-field-label-background);padding:0 calc(var(--ck-font-size-tiny)*0.5);line-height:normal;font-weight:400;text-overflow:ellipsis;overflow:hidden;max-width:100%;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-spacing-medium),calc(var(--ck-font-size-base)*0.6)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-spacing-medium)*-1),calc(var(--ck-font-size-base)*0.6)) scale(1)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));background:transparent;padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}"},5057:t=>{t.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(var(--ck-line-height-base)*0.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*0.4*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},6140:t=>{t.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border);filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);bottom:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}'},2747:t=>{t.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},3715:t=>{t.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},151:t=>{t.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},9972:t=>{t.exports='.ck-vertical-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{content:"";width:0;position:absolute;right:-1px;top:var(--ck-spacing-small);bottom:var(--ck-spacing-small);z-index:1}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-text-width)*0.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-large);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after,[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}'},6438:t=>{t.exports=".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}"},168:t=>{t.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;background:var(--ck-color-toolbar-border);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},2614:t=>{t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s,.ck.ck-tooltip.ck-tooltip_se,.ck.ck-tooltip.ck-tooltip_sw{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after,.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{top:calc(var(--ck-tooltip-arrow-size)*-1 + 1px);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_sw{right:50%;left:auto}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text{left:auto;right:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_sw .ck-tooltip__text:after{left:auto;right:0}.ck.ck-tooltip.ck-tooltip_se{left:50%;right:auto}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text{right:auto;left:calc(var(--ck-tooltip-arrow-size)*-2)}.ck.ck-tooltip.ck-tooltip_se .ck-tooltip__text:after{right:auto;left:0;transform:translateX(50%)}.ck.ck-tooltip.ck-tooltip_n{top:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(var(--ck-tooltip-arrow-size)*-1);transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_e{left:calc(100% + var(--ck-tooltip-arrow-size));top:50%}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_e .ck-tooltip__text:after{left:calc(var(--ck-tooltip-arrow-size)*-1);top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:transparent;border-bottom-color:transparent;border-right-color:var(--ck-color-tooltip-background);border-top-color:transparent;border-left-width:0;border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip.ck-tooltip_w{right:calc(100% + var(--ck-tooltip-arrow-size));left:auto;top:50%}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text{left:0;transform:translateY(-50%)}.ck.ck-tooltip.ck-tooltip_w .ck-tooltip__text:after{left:100%;top:calc(50% - var(--ck-tooltip-arrow-size)*1);border-left-color:var(--ck-color-tooltip-background);border-bottom-color:transparent;border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:0;border-top-width:var(--ck-tooltip-arrow-size)}'},4777:t=>{t.exports=".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:208,79%,51%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#bcdefb;--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-off-hover-background:#a3a3a3;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#579e3d;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,0.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-color-link-fake-selection:rgba(31,177,255,0.3);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}"},2900:t=>{t.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness));top:0}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"},1163:t=>{t.exports=".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;position:absolute;pointer-events:none;left:0;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{position:absolute;pointer-events:all}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{width:var(--ck-resizer-size);height:var(--ck-resizer-size);background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{top:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{top:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}"},3228:t=>{t.exports='.ck .ck-widget .ck-widget__type-around__button{display:block;position:absolute;overflow:hidden;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{position:absolute;top:50%;left:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{top:calc(var(--ck-widget-outline-thickness)*-0.5);left:min(10%,30px);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-0.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:"";display:block;position:absolute;top:1px;left:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;position:absolute;left:0;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{top:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{width:var(--ck-widget-type-around-button-size);height:var(--ck-widget-type-around-button-size);background:var(--ck-color-widget-type-around-button);border-radius:100px;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);opacity:0;pointer-events:none}.ck .ck-widget .ck-widget__type-around__button svg{width:10px;height:8px;transform:translate(-50%,-50%);transition:transform .5s ease;margin-top:1px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{width:calc(var(--ck-widget-type-around-button-size) - 2px);height:calc(var(--ck-widget-type-around-button-size) - 2px);border-radius:100px;background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3))}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{pointer-events:none;height:1px;animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;outline:1px solid hsla(0,0%,100%,.5);background:var(--ck-color-base-text)}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}'},166:t=>{t.exports=".ck .ck-button.ck-color-table__remove-color{display:flex;align-items:center;width:100%}label.ck.ck-color-grid__label{font-weight:unset}.ck .ck-button.ck-color-table__remove-color{padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}"},8137:t=>{t.exports=".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}"},3489:t=>{t.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:50px}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{position:static}"},7132:t=>{t.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}"},8857:(t,e,i)=>{var n=i(6062),o=i(3752);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},321:(t,e,i)=>{var n=i(6062),o=i(2333);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},901:(t,e,i)=>{var n=i(6062),o=i(1785);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},6045:(t,e,i)=>{var n=i(6062),o=i(1422);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},3047:(t,e,i)=>{var n=i(6062),o=i(800);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},6846:(t,e,i)=>{var n=i(6062),o=i(8945);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},1213:(t,e,i)=>{var n=i(6062),o=i(845);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},8454:(t,e,i)=>{var n=i(6062),o=i(380);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},4919:(t,e,i)=>{var n=i(6062),o=i(2626);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},8753:(t,e,i)=>{var n=i(6062),o=i(3215);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},7800:(t,e,i)=>{var n=i(6062),o=i(2704);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},1306:(t,e,i)=>{var n=i(6062),o=i(273);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},554:(t,e,i)=>{var n=i(6062),o=i(1323);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},7512:(t,e,i)=>{var n=i(6062),o=i(8283);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},1593:(t,e,i)=>{var n=i(6062),o=i(6853);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},3841:(t,e,i)=>{var n=i(6062),o=i(4852);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},1531:(t,e,i)=>{var n=i(6062),o=i(8842);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},1626:(t,e,i)=>{var n=i(6062),o=i(2957);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},191:(t,e,i)=>{var n=i(6062),o=i(1287);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},6434:(t,e,i)=>{var n=i(6062),o=i(3779);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},28:(t,e,i)=>{var n=i(6062),o=i(9582);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},4567:(t,e,i)=>{var n=i(6062),o=i(6654);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},3275:(t,e,i)=>{var n=i(6062),o=i(1285);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},5873:(t,e,i)=>{var n=i(6062),o=i(7519);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},9852:(t,e,i)=>{var n=i(6062),o=i(3081);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},285:(t,e,i)=>{var n=i(6062),o=i(6869);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},218:(t,e,i)=>{var n=i(6062),o=i(8717);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},6775:(t,e,i)=>{var n=i(6062),o=i(4479);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},9607:(t,e,i)=>{var n=i(6062),o=i(257);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},8295:(t,e,i)=>{var n=i(6062),o=i(4963);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},6390:(t,e,i)=>{var n=i(6062),o=i(894);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},996:(t,e,i)=>{var n=i(6062),o=i(1786);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},9350:(t,e,i)=>{var n=i(6062),o=i(3869);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},7835:(t,e,i)=>{var n=i(6062),o=i(4473);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},5728:(t,e,i)=>{var n=i(6062),o=i(4661);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},480:(t,e,i)=>{var n=i(6062),o=i(6735);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},5872:(t,e,i)=>{var n=i(6062),o=i(3259);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},2547:(t,e,i)=>{var n=i(6062),o=i(5057);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},2653:(t,e,i)=>{var n=i(6062),o=i(6140);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},5165:(t,e,i)=>{var n=i(6062),o=i(2747);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},3423:(t,e,i)=>{var n=i(6062),o=i(3715);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},7372:(t,e,i)=>{var n=i(6062),o=i(151);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},49:(t,e,i)=>{var n=i(6062),o=i(9972);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},7964:(t,e,i)=>{var n=i(6062),o=i(6438);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},3171:(t,e,i)=>{var n=i(6062),o=i(168);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},9314:(t,e,i)=>{var n=i(6062),o=i(2614);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},7770:(t,e,i)=>{var n=i(6062),o=i(4777);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},4936:(t,e,i)=>{var n=i(6062),o=i(2900);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},353:(t,e,i)=>{var n=i(6062),o=i(1163);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},2928:(t,e,i)=>{var n=i(6062),o=i(3228);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},2199:(t,e,i)=>{var n=i(6062),o=i(166);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},8520:(t,e,i)=>{var n=i(6062),o=i(8137);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},8593:(t,e,i)=>{var n=i(6062),o=i(3489);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},3456:(t,e,i)=>{var n=i(6062),o=i(7132);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.id,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},6062:(t,e,i)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),s=[];function a(t){for(var e=-1,i=0;i<s.length;i++)if(s[i].identifier===t){e=i;break}return e}function l(t,e){for(var i={},n=[],o=0;o<t.length;o++){var r=t[o],l=e.base?r[0]+e.base:r[0],c=i[l]||0,d="".concat(l," ").concat(c);i[l]=c+1;var h=a(d),u={css:r[1],media:r[2],sourceMap:r[3]};-1!==h?(s[h].references++,s[h].updater(u)):s.push({identifier:d,updater:p(u,e),references:1}),n.push(d)}return n}function c(t){var e=document.createElement("style"),n=t.attributes||{};if(void 0===n.nonce){var o=i.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(t){e.setAttribute(t,n[t])})),"function"==typeof t.insert)t.insert(e);else{var s=r(t.insert||"head");if(!s)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");s.appendChild(e)}return e}var d,h=(d=[],function(t,e){return d[t]=e,d.filter(Boolean).join("\n")});function u(t,e,i,n){var o=i?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(t.styleSheet)t.styleSheet.cssText=h(e,o);else{var r=document.createTextNode(o),s=t.childNodes;s[e]&&t.removeChild(s[e]),s.length?t.insertBefore(r,s[e]):t.appendChild(r)}}function m(t,e,i){var n=i.css,o=i.media,r=i.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var g=null,f=0;function p(t,e){var i,n,o;if(e.singleton){var r=f++;i=g||(g=c(e)),n=u.bind(null,i,r,!1),o=u.bind(null,i,r,!0)}else i=c(e),n=m.bind(null,i,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(i)};return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=o());var i=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var n=0;n<i.length;n++){var o=a(i[n]);s[o].references--}for(var r=l(t,e),c=0;c<i.length;c++){var d=a(i[c]);0===s[d].references&&(s[d].updater(),s.splice(d,1))}i=r}}}}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={id:n,exports:{}};return t[n](r,r.exports,i),r.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};return(()=>{"use strict";i.d(n,{default:()=>V_});const t=function(){return function t(){t.called=!0}};class e{constructor(e,i){this.source=e,this.name=i,this.path=[],this.stop=t(),this.off=t()}}const o=new Array(256).fill().map((t,e)=>("0"+e.toString(16)).slice(-2));function r(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+o[t>>0&255]+o[t>>8&255]+o[t>>16&255]+o[t>>24&255]+o[e>>0&255]+o[e>>8&255]+o[e>>16&255]+o[e>>24&255]+o[i>>0&255]+o[i>>8&255]+o[i>>16&255]+o[i>>24&255]+o[n>>0&255]+o[n>>8&255]+o[n>>16&255]+o[n>>24&255]}const s={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};class a extends Error{constructor(t,e,i){super(`${t}${i?" "+JSON.stringify(i):""}${c(t)}`),this.name="CKEditorError",this.context=e,this.data=i}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const i=new a(t.message,e);throw i.stack=t.stack,i}}function l(t,e){console.warn(...d(t,e))}function c(t){return"\nRead more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-"+t}function d(t,e){const i=c(t);return e?[t,e,i]:[t,i]}const h="object"==typeof window?window:i.g;if(h.CKEDITOR_VERSION)throw new a("ckeditor-duplicated-modules",null);h.CKEDITOR_VERSION="28.0.0";const u=Symbol("listeningTo"),m=Symbol("emitterId"),g={on(t,e,i={}){this.listenTo(this,t,e,i)},once(t,e,i){let n=!1;this.listenTo(this,t,(function(t,...i){n||(n=!0,t.off(),e.call(this,t,...i))}),i)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,i,n={}){let o,r;this[u]||(this[u]={});const s=this[u];p(t)||f(t);const a=p(t);(o=s[a])||(o=s[a]={emitter:t,callbacks:{}}),(r=o.callbacks[e])||(r=o.callbacks[e]=[]),r.push(i),function(t,e,i,n,o){e._addEventListener?e._addEventListener(i,n,o):t._addEventListener.call(e,i,n,o)}(this,t,e,i,n)},stopListening(t,e,i){const n=this[u];let o=t&&p(t);const r=n&&o&&n[o],s=r&&e&&r.callbacks[e];if(!(!n||t&&!r||e&&!s))if(i){_(this,t,e,i);-1!==s.indexOf(i)&&(1===s.length?delete r.callbacks[e]:_(this,t,e,i))}else if(s){for(;i=s.pop();)_(this,t,e,i);delete r.callbacks[e]}else if(r){for(e in r.callbacks)this.stopListening(t,e);delete n[o]}else{for(o in n)this.stopListening(n[o].emitter);delete this[u]}},fire(t,...i){try{const n=t instanceof e?t:new e(this,t),o=n.name;let r=function t(e,i){let n;if(!e._events||!(n=e._events[i])||!n.callbacks.length)return i.indexOf(":")>-1?t(e,i.substr(0,i.lastIndexOf(":"))):null;return n.callbacks}(this,o);if(n.path.push(this),r){const t=[n,...i];r=Array.from(r);for(let e=0;e<r.length&&(r[e].callback.apply(this,t),n.off.called&&(delete n.off.called,this._removeEventListener(o,r[e].callback)),!n.stop.called);e++);}if(this._delegations){const t=this._delegations.get(o),e=this._delegations.get("*");t&&k(t,n,i),e&&k(e,n,i)}return n.return}catch(t){a.rethrowUnexpectedError(t,this)}},delegate(...t){return{to:(e,i)=>{this._delegations||(this._delegations=new Map),t.forEach(t=>{const n=this._delegations.get(t);n?n.set(e,i):this._delegations.set(t,new Map([[e,i]]))})}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const i=this._delegations.get(t);i&&i.delete(e)}else this._delegations.delete(t);else this._delegations.clear()},_addEventListener(t,e,i){!function(t,e){const i=w(t);if(i[e])return;let n=e,o=null;const r=[];for(;""!==n&&!i[n];)i[n]={callbacks:[],childEvents:[]},r.push(i[n]),o&&i[n].childEvents.push(o),o=n,n=n.substr(0,n.lastIndexOf(":"));if(""!==n){for(const t of r)t.callbacks=i[n].callbacks.slice();i[n].childEvents.push(o)}}(this,t);const n=b(this,t),o=s.get(i.priority),r={callback:e,priority:o};for(const t of n){let e=!1;for(let i=0;i<t.length;i++)if(t[i].priority<o){t.splice(i,0,r),e=!0;break}e||t.push(r)}},_removeEventListener(t,e){const i=b(this,t);for(const t of i)for(let i=0;i<t.length;i++)t[i].callback==e&&(t.splice(i,1),i--)}};function f(t,e){t[m]||(t[m]=e||r())}function p(t){return t[m]}function w(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function b(t,e){const i=w(t)[e];if(!i)return[];let n=[i.callbacks];for(let e=0;e<i.childEvents.length;e++){const o=b(t,i.childEvents[e]);n=n.concat(o)}return n}function k(t,i,n){for(let[o,r]of t){r?"function"==typeof r&&(r=r(i.name)):r=i.name;const t=new e(i.source,r);t.path=[...i.path],o.fire(t,...n)}}function _(t,e,i,n){e._removeEventListener?e._removeEventListener(i,n):t._removeEventListener.call(e,i,n)}const v=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};const y="object"==typeof global&&global&&global.Object===Object&&global;var x="object"==typeof self&&self&&self.Object===Object&&self;const A=y||x||Function("return this")();const C=A.Symbol;var T=Object.prototype,E=T.hasOwnProperty,S=T.toString,P=C?C.toStringTag:void 0;const M=function(t){var e=E.call(t,P),i=t[P];try{t[P]=void 0;var n=!0}catch(t){}var o=S.call(t);return n&&(e?t[P]=i:delete t[P]),o};var I=Object.prototype.toString;const L=function(t){return I.call(t)};var N=C?C.toStringTag:void 0;const R=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":N&&N in Object(t)?M(t):L(t)};const O=function(t){if(!v(t))return!1;var e=R(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e};const z=A["__core-js_shared__"];var D=function(){var t=/[^.]+$/.exec(z&&z.keys&&z.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();const V=function(t){return!!D&&D in t};var j=Function.prototype.toString;const B=function(t){if(null!=t){try{return j.call(t)}catch(t){}try{return t+""}catch(t){}}return""};var F=/^\[object .+?Constructor\]$/,H=Function.prototype,U=Object.prototype,q=H.toString,W=U.hasOwnProperty,$=RegExp("^"+q.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const G=function(t){return!(!v(t)||V(t))&&(O(t)?$:F).test(B(t))};const Y=function(t,e){return null==t?void 0:t[e]};const K=function(t,e){var i=Y(t,e);return G(i)?i:void 0};const Q=function(){try{var t=K(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const J=function(t,e,i){"__proto__"==e&&Q?Q(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i};const Z=function(t,e){return t===e||t!=t&&e!=e};var X=Object.prototype.hasOwnProperty;const tt=function(t,e,i){var n=t[e];X.call(t,e)&&Z(n,i)&&(void 0!==i||e in t)||J(t,e,i)};const et=function(t,e,i,n){var o=!i;i||(i={});for(var r=-1,s=e.length;++r<s;){var a=e[r],l=n?n(i[a],t[a],a,i,t):void 0;void 0===l&&(l=t[a]),o?J(i,a,l):tt(i,a,l)}return i};const it=function(t){return t};const nt=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)};var ot=Math.max;const rt=function(t,e,i){return e=ot(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,r=ot(n.length-e,0),s=Array(r);++o<r;)s[o]=n[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=n[o];return a[e]=i(s),nt(t,this,a)}};const st=function(t){return function(){return t}};const at=Q?function(t,e){return Q(t,"toString",{configurable:!0,enumerable:!1,value:st(e),writable:!0})}:it;var lt=Date.now;const ct=function(t){var e=0,i=0;return function(){var n=lt(),o=16-(n-i);if(i=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(at);const dt=function(t,e){return ct(rt(t,e,it),t+"")};const ht=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};const ut=function(t){return null!=t&&ht(t.length)&&!O(t)};var mt=/^(?:0|[1-9]\d*)$/;const gt=function(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&mt.test(t))&&t>-1&&t%1==0&&t<e};const ft=function(t,e,i){if(!v(i))return!1;var n=typeof e;return!!("number"==n?ut(i)&&gt(e,i.length):"string"==n&&e in i)&&Z(i[e],t)};const pt=function(t){return dt((function(e,i){var n=-1,o=i.length,r=o>1?i[o-1]:void 0,s=o>2?i[2]:void 0;for(r=t.length>3&&"function"==typeof r?(o--,r):void 0,s&&ft(i[0],i[1],s)&&(r=o<3?void 0:r,o=1),e=Object(e);++n<o;){var a=i[n];a&&t(e,a,n,r)}return e}))};const wt=function(t,e){for(var i=-1,n=Array(t);++i<t;)n[i]=e(i);return n};const bt=function(t){return null!=t&&"object"==typeof t};const kt=function(t){return bt(t)&&"[object Arguments]"==R(t)};var _t=Object.prototype,vt=_t.hasOwnProperty,yt=_t.propertyIsEnumerable;const xt=kt(function(){return arguments}())?kt:function(t){return bt(t)&&vt.call(t,"callee")&&!yt.call(t,"callee")};const At=Array.isArray;const Ct=function(){return!1};var Tt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Et=Tt&&"object"==typeof module&&module&&!module.nodeType&&module,St=Et&&Et.exports===Tt?A.Buffer:void 0;const Pt=(St?St.isBuffer:void 0)||Ct;var Mt={};Mt["[object Float32Array]"]=Mt["[object Float64Array]"]=Mt["[object Int8Array]"]=Mt["[object Int16Array]"]=Mt["[object Int32Array]"]=Mt["[object Uint8Array]"]=Mt["[object Uint8ClampedArray]"]=Mt["[object Uint16Array]"]=Mt["[object Uint32Array]"]=!0,Mt["[object Arguments]"]=Mt["[object Array]"]=Mt["[object ArrayBuffer]"]=Mt["[object Boolean]"]=Mt["[object DataView]"]=Mt["[object Date]"]=Mt["[object Error]"]=Mt["[object Function]"]=Mt["[object Map]"]=Mt["[object Number]"]=Mt["[object Object]"]=Mt["[object RegExp]"]=Mt["[object Set]"]=Mt["[object String]"]=Mt["[object WeakMap]"]=!1;const It=function(t){return bt(t)&&ht(t.length)&&!!Mt[R(t)]};const Lt=function(t){return function(e){return t(e)}};var Nt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Rt=Nt&&"object"==typeof module&&module&&!module.nodeType&&module,Ot=Rt&&Rt.exports===Nt&&y.process;const zt=function(){try{var t=Rt&&Rt.require&&Rt.require("util").types;return t||Ot&&Ot.binding&&Ot.binding("util")}catch(t){}}();var Dt=zt&&zt.isTypedArray;const Vt=Dt?Lt(Dt):It;var jt=Object.prototype.hasOwnProperty;const Bt=function(t,e){var i=At(t),n=!i&&xt(t),o=!i&&!n&&Pt(t),r=!i&&!n&&!o&&Vt(t),s=i||n||o||r,a=s?wt(t.length,String):[],l=a.length;for(var c in t)!e&&!jt.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||gt(c,l))||a.push(c);return a};var Ft=Object.prototype;const Ht=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ft)};const Ut=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e};var qt=Object.prototype.hasOwnProperty;const Wt=function(t){if(!v(t))return Ut(t);var e=Ht(t),i=[];for(var n in t)("constructor"!=n||!e&&qt.call(t,n))&&i.push(n);return i};const $t=function(t){return ut(t)?Bt(t,!0):Wt(t)};const Gt=pt((function(t,e){et(e,$t(e),t)})),Yt=Symbol("observableProperties"),Kt=Symbol("boundObservables"),Qt=Symbol("boundProperties"),Jt=Symbol("decoratedMethods"),Zt=Symbol("decoratedOriginal"),Xt={set(t,e){if(v(t))return void Object.keys(t).forEach(e=>{this.set(e,t[e])},this);ee(this);const i=this[Yt];if(t in this&&!i.has(t))throw new a("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>i.get(t),set(e){const n=i.get(t);let o=this.fire("set:"+t,t,e,n);void 0===o&&(o=e),n===o&&i.has(t)||(i.set(t,o),this.fire("change:"+t,t,o,n))}}),this[t]=e},bind(...t){if(!t.length||!oe(t))throw new a("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new a("observable-bind-duplicate-properties",this);ee(this);const e=this[Qt];t.forEach(t=>{if(e.has(t))throw new a("observable-bind-rebind",this)});const i=new Map;return t.forEach(t=>{const n={property:t,to:[]};e.set(t,n),i.set(t,n)}),{to:ie,toMany:ne,_observable:this,_bindProperties:t,_to:[],_bindings:i}},unbind(...t){if(!this[Yt])return;const e=this[Qt],i=this[Kt];if(t.length){if(!oe(t))throw new a("observable-unbind-wrong-properties",this);t.forEach(t=>{const n=e.get(t);if(!n)return;let o,r,s,a;n.to.forEach(t=>{o=t[0],r=t[1],s=i.get(o),a=s[r],a.delete(n),a.size||delete s[r],Object.keys(s).length||(i.delete(o),this.stopListening(o,"change"))}),e.delete(t)})}else i.forEach((t,e)=>{this.stopListening(e,"change")}),i.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new a("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,(t,i)=>{t.return=e.apply(this,i)}),this[t]=function(...e){return this.fire(t,e)},this[t][Zt]=e,this[Jt]||(this[Jt]=[]),this[Jt].push(t)}};Gt(Xt,g),Xt.stopListening=function(t,e,i){if(!t&&this[Jt]){for(const t of this[Jt])this[t]=this[t][Zt];delete this[Jt]}g.stopListening.call(this,t,e,i)};const te=Xt;function ee(t){t[Yt]||(Object.defineProperty(t,Yt,{value:new Map}),Object.defineProperty(t,Kt,{value:new Map}),Object.defineProperty(t,Qt,{value:new Map}))}function ie(...t){const e=function(...t){if(!t.length)throw new a("observable-bind-to-parse-error",null);const e={to:[]};let i;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach(t=>{if("string"==typeof t)i.properties.push(t);else{if("object"!=typeof t)throw new a("observable-bind-to-parse-error",null);i={observable:t,properties:[]},e.to.push(i)}}),e}(...t),i=Array.from(this._bindings.keys()),n=i.length;if(!e.callback&&e.to.length>1)throw new a("observable-bind-to-no-callback",this);if(n>1&&e.callback)throw new a("observable-bind-to-extra-callback",this);var o;e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==n)throw new a("observable-bind-to-properties-length",this);t.properties.length||(t.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(i[0]).callback=e.callback),o=this._observable,this._to.forEach(t=>{const e=o[Kt];let i;e.get(t.observable)||o.listenTo(t.observable,"change",(n,r)=>{i=e.get(t.observable)[r],i&&i.forEach(t=>{re(o,t.property)})})}),function(t){let e;t._bindings.forEach((i,n)=>{t._to.forEach(o=>{e=o.properties[i.callback?0:t._bindProperties.indexOf(n)],i.to.push([o.observable,e]),function(t,e,i,n){const o=t[Kt],r=o.get(i),s=r||{};s[n]||(s[n]=new Set);s[n].add(e),r||o.set(i,s)}(t._observable,i,o.observable,e)})})}(this),this._bindProperties.forEach(t=>{re(this._observable,t)})}function ne(t,e,i){if(this._bindings.size>1)throw new a("observable-bind-to-many-not-one-binding",this);this.to(...function(t,e){const i=t.map(t=>[t,e]);return Array.prototype.concat.apply([],i)}(t,e),i)}function oe(t){return t.every(t=>"string"==typeof t)}function re(t,e){const i=t[Qt].get(e);let n;i.callback?n=i.callback.apply(t,i.to.map(t=>t[0][t[1]])):(n=i.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=n:t.set(e,n)}function se(t,...e){e.forEach(e=>{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(i=>{if(i in t.prototype)return;const n=Object.getOwnPropertyDescriptor(e,i);n.enumerable=!1,Object.defineProperty(t.prototype,i,n)})})}class ae{constructor(t){this.editor=t,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",le,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",le),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function le(t){t.return=!1,t.stop()}se(ae,te);class ce{constructor(t){this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",de,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",de),this.refresh())}execute(){}destroy(){this.stopListening()}}function de(t){t.return=!1,t.stop()}se(ce,te);class he extends ce{constructor(t){super(t),this._childCommands=[]}refresh(){}execute(...t){const e=this._getFirstEnabledCommand();return null!=e&&e.execute(t)}registerChildCommand(t){this._childCommands.push(t),t.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(t=>t.isEnabled)}}const ue=function(t,e){return function(i){return t(e(i))}};const me=ue(Object.getPrototypeOf,Object);var ge=Function.prototype,fe=Object.prototype,pe=ge.toString,we=fe.hasOwnProperty,be=pe.call(Object);const ke=function(t){if(!bt(t)||"[object Object]"!=R(t))return!1;var e=me(t);if(null===e)return!0;var i=we.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&pe.call(i)==be};const _e=function(){this.__data__=[],this.size=0};const ve=function(t,e){for(var i=t.length;i--;)if(Z(t[i][0],e))return i;return-1};var ye=Array.prototype.splice;const xe=function(t){var e=this.__data__,i=ve(e,t);return!(i<0)&&(i==e.length-1?e.pop():ye.call(e,i,1),--this.size,!0)};const Ae=function(t){var e=this.__data__,i=ve(e,t);return i<0?void 0:e[i][1]};const Ce=function(t){return ve(this.__data__,t)>-1};const Te=function(t,e){var i=this.__data__,n=ve(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};function Ee(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Ee.prototype.clear=_e,Ee.prototype.delete=xe,Ee.prototype.get=Ae,Ee.prototype.has=Ce,Ee.prototype.set=Te;const Se=Ee;const Pe=function(){this.__data__=new Se,this.size=0};const Me=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i};const Ie=function(t){return this.__data__.get(t)};const Le=function(t){return this.__data__.has(t)};const Ne=K(A,"Map");const Re=K(Object,"create");const Oe=function(){this.__data__=Re?Re(null):{},this.size=0};const ze=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e};var De=Object.prototype.hasOwnProperty;const Ve=function(t){var e=this.__data__;if(Re){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return De.call(e,t)?e[t]:void 0};var je=Object.prototype.hasOwnProperty;const Be=function(t){var e=this.__data__;return Re?void 0!==e[t]:je.call(e,t)};const Fe=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Re&&void 0===e?"__lodash_hash_undefined__":e,this};function He(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}He.prototype.clear=Oe,He.prototype.delete=ze,He.prototype.get=Ve,He.prototype.has=Be,He.prototype.set=Fe;const Ue=He;const qe=function(){this.size=0,this.__data__={hash:new Ue,map:new(Ne||Se),string:new Ue}};const We=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};const $e=function(t,e){var i=t.__data__;return We(e)?i["string"==typeof e?"string":"hash"]:i.map};const Ge=function(t){var e=$e(this,t).delete(t);return this.size-=e?1:0,e};const Ye=function(t){return $e(this,t).get(t)};const Ke=function(t){return $e(this,t).has(t)};const Qe=function(t,e){var i=$e(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this};function Je(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Je.prototype.clear=qe,Je.prototype.delete=Ge,Je.prototype.get=Ye,Je.prototype.has=Ke,Je.prototype.set=Qe;const Ze=Je;const Xe=function(t,e){var i=this.__data__;if(i instanceof Se){var n=i.__data__;if(!Ne||n.length<199)return n.push([t,e]),this.size=++i.size,this;i=this.__data__=new Ze(n)}return i.set(t,e),this.size=i.size,this};function ti(t){var e=this.__data__=new Se(t);this.size=e.size}ti.prototype.clear=Pe,ti.prototype.delete=Me,ti.prototype.get=Ie,ti.prototype.has=Le,ti.prototype.set=Xe;const ei=ti;const ii=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n&&!1!==e(t[i],i,t););return t};const ni=ue(Object.keys,Object);var oi=Object.prototype.hasOwnProperty;const ri=function(t){if(!Ht(t))return ni(t);var e=[];for(var i in Object(t))oi.call(t,i)&&"constructor"!=i&&e.push(i);return e};const si=function(t){return ut(t)?Bt(t):ri(t)};const ai=function(t,e){return t&&et(e,si(e),t)};const li=function(t,e){return t&&et(e,$t(e),t)};var ci="object"==typeof exports&&exports&&!exports.nodeType&&exports,di=ci&&"object"==typeof module&&module&&!module.nodeType&&module,hi=di&&di.exports===ci?A.Buffer:void 0,ui=hi?hi.allocUnsafe:void 0;const mi=function(t,e){if(e)return t.slice();var i=t.length,n=ui?ui(i):new t.constructor(i);return t.copy(n),n};const gi=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i<n;)e[i]=t[i];return e};const fi=function(t,e){for(var i=-1,n=null==t?0:t.length,o=0,r=[];++i<n;){var s=t[i];e(s,i,t)&&(r[o++]=s)}return r};const pi=function(){return[]};var wi=Object.prototype.propertyIsEnumerable,bi=Object.getOwnPropertySymbols;const ki=bi?function(t){return null==t?[]:(t=Object(t),fi(bi(t),(function(e){return wi.call(t,e)})))}:pi;const _i=function(t,e){return et(t,ki(t),e)};const vi=function(t,e){for(var i=-1,n=e.length,o=t.length;++i<n;)t[o+i]=e[i];return t};const yi=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)vi(e,ki(t)),t=me(t);return e}:pi;const xi=function(t,e){return et(t,yi(t),e)};const Ai=function(t,e,i){var n=e(t);return At(t)?n:vi(n,i(t))};const Ci=function(t){return Ai(t,si,ki)};const Ti=function(t){return Ai(t,$t,yi)};const Ei=K(A,"DataView");const Si=K(A,"Promise");const Pi=K(A,"Set");const Mi=K(A,"WeakMap");var Ii=B(Ei),Li=B(Ne),Ni=B(Si),Ri=B(Pi),Oi=B(Mi),zi=R;(Ei&&"[object DataView]"!=zi(new Ei(new ArrayBuffer(1)))||Ne&&"[object Map]"!=zi(new Ne)||Si&&"[object Promise]"!=zi(Si.resolve())||Pi&&"[object Set]"!=zi(new Pi)||Mi&&"[object WeakMap]"!=zi(new Mi))&&(zi=function(t){var e=R(t),i="[object Object]"==e?t.constructor:void 0,n=i?B(i):"";if(n)switch(n){case Ii:return"[object DataView]";case Li:return"[object Map]";case Ni:return"[object Promise]";case Ri:return"[object Set]";case Oi:return"[object WeakMap]"}return e});const Di=zi;var Vi=Object.prototype.hasOwnProperty;const ji=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&Vi.call(t,"index")&&(i.index=t.index,i.input=t.input),i};const Bi=A.Uint8Array;const Fi=function(t){var e=new t.constructor(t.byteLength);return new Bi(e).set(new Bi(t)),e};const Hi=function(t,e){var i=e?Fi(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)};var Ui=/\w*$/;const qi=function(t){var e=new t.constructor(t.source,Ui.exec(t));return e.lastIndex=t.lastIndex,e};var Wi=C?C.prototype:void 0,$i=Wi?Wi.valueOf:void 0;const Gi=function(t){return $i?Object($i.call(t)):{}};const Yi=function(t,e){var i=e?Fi(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)};const Ki=function(t,e,i){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return Fi(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return Hi(t,i);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Yi(t,i);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return qi(t);case"[object Set]":return new n;case"[object Symbol]":return Gi(t)}};var Qi=Object.create;const Ji=function(){function t(){}return function(e){if(!v(e))return{};if(Qi)return Qi(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();const Zi=function(t){return"function"!=typeof t.constructor||Ht(t)?{}:Ji(me(t))};const Xi=function(t){return bt(t)&&"[object Map]"==Di(t)};var tn=zt&&zt.isMap;const en=tn?Lt(tn):Xi;const nn=function(t){return bt(t)&&"[object Set]"==Di(t)};var on=zt&&zt.isSet;const rn=on?Lt(on):nn;var sn={};sn["[object Arguments]"]=sn["[object Array]"]=sn["[object ArrayBuffer]"]=sn["[object DataView]"]=sn["[object Boolean]"]=sn["[object Date]"]=sn["[object Float32Array]"]=sn["[object Float64Array]"]=sn["[object Int8Array]"]=sn["[object Int16Array]"]=sn["[object Int32Array]"]=sn["[object Map]"]=sn["[object Number]"]=sn["[object Object]"]=sn["[object RegExp]"]=sn["[object Set]"]=sn["[object String]"]=sn["[object Symbol]"]=sn["[object Uint8Array]"]=sn["[object Uint8ClampedArray]"]=sn["[object Uint16Array]"]=sn["[object Uint32Array]"]=!0,sn["[object Error]"]=sn["[object Function]"]=sn["[object WeakMap]"]=!1;const an=function t(e,i,n,o,r,s){var a,l=1&i,c=2&i,d=4&i;if(n&&(a=r?n(e,o,r,s):n(e)),void 0!==a)return a;if(!v(e))return e;var h=At(e);if(h){if(a=ji(e),!l)return gi(e,a)}else{var u=Di(e),m="[object Function]"==u||"[object GeneratorFunction]"==u;if(Pt(e))return mi(e,l);if("[object Object]"==u||"[object Arguments]"==u||m&&!r){if(a=c||m?{}:Zi(e),!l)return c?xi(e,li(a,e)):_i(e,ai(a,e))}else{if(!sn[u])return r?e:{};a=Ki(e,u,l)}}s||(s=new ei);var g=s.get(e);if(g)return g;s.set(e,a),rn(e)?e.forEach((function(o){a.add(t(o,i,n,o,e,s))})):en(e)&&e.forEach((function(o,r){a.set(r,t(o,i,n,r,e,s))}));var f=h?void 0:(d?c?Ti:Ci:c?$t:si)(e);return ii(f||e,(function(o,r){f&&(o=e[r=o]),tt(a,r,t(o,i,n,r,e,s))})),a};const ln=function(t,e){return an(t,5,e="function"==typeof e?e:void 0)};const cn=function(t){return bt(t)&&1===t.nodeType&&!ke(t)};class dn{constructor(t,e){this._config={},e&&this.define(hn(e)),t&&this._setObjectToTarget(this._config,t)}set(t,e){this._setToTarget(this._config,t,e)}define(t,e){this._setToTarget(this._config,t,e,!0)}get(t){return this._getFromSource(this._config,t)}*names(){for(const t of Object.keys(this._config))yield t}_setToTarget(t,e,i,n=!1){if(ke(e))return void this._setObjectToTarget(t,e,n);const o=e.split(".");e=o.pop();for(const e of o)ke(t[e])||(t[e]={}),t=t[e];if(ke(i))return ke(t[e])||(t[e]={}),t=t[e],void this._setObjectToTarget(t,i,n);n&&void 0!==t[e]||(t[e]=i)}_getFromSource(t,e){const i=e.split(".");e=i.pop();for(const e of i){if(!ke(t[e])){t=null;break}t=t[e]}return t?hn(t[e]):void 0}_setObjectToTarget(t,e,i){Object.keys(e).forEach(n=>{this._setToTarget(t,n,e[n],i)})}}function hn(t){return ln(t,un)}function un(t){return cn(t)?t:void 0}function mn(t){return!(!t||!t[Symbol.iterator])}class gn{constructor(t={},e={}){const i=mn(t);if(i||(e=t),this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const e of t)this._items.push(e),this._itemMap.set(this._getItemIdBeforeAdding(e),e)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,e){return this.addMany([t],e)}addMany(t,e){if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new a("collection-add-item-invalid-index",this);for(let i=0;i<t.length;i++){const n=t[i],o=this._getItemIdBeforeAdding(n),r=e+i;this._items.splice(r,0,n),this._itemMap.set(o,n),this.fire("add",n,r)}return this.fire("change",{added:t,removed:[],index:e}),this}get(t){let e;if("string"==typeof t)e=this._itemMap.get(t);else{if("number"!=typeof t)throw new a("collection-get-invalid-arg",this);e=this._items[t]}return e||null}has(t){if("string"==typeof t)return this._itemMap.has(t);{const e=t[this._idProperty];return this._itemMap.has(e)}}getIndex(t){let e;return e="string"==typeof t?this._itemMap.get(t):t,this._items.indexOf(e)}remove(t){const[e,i]=this._remove(t);return this.fire("change",{added:[],removed:[e],index:i}),e}map(t,e){return this._items.map(t,e)}find(t,e){return this._items.find(t,e)}filter(t,e){return this._items.filter(t,e)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);const t=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:t,index:0})}bindTo(t){if(this._bindToCollection)throw new a("collection-bind-to-rebind",this);return this._bindToCollection=t,{as:t=>{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(t){const e=this._bindToCollection,i=(i,n,o)=>{const r=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(n);if(r&&s)this._bindToExternalToInternalMap.set(n,s),this._bindToInternalToExternalMap.set(s,n);else{const i=t(n);if(!i)return void this._skippedIndexesFromExternal.push(o);let r=o;for(const t of this._skippedIndexesFromExternal)o>t&&r--;for(const t of e._skippedIndexesFromExternal)r>=t&&r++;this._bindToExternalToInternalMap.set(n,i),this._bindToInternalToExternalMap.set(i,n),this.add(i,r);for(let t=0;t<e._skippedIndexesFromExternal.length;t++)r<=e._skippedIndexesFromExternal[t]&&e._skippedIndexesFromExternal[t]++}};for(const t of e)i(0,t,e.getIndex(t));this.listenTo(e,"add",i),this.listenTo(e,"remove",(t,e,i)=>{const n=this._bindToExternalToInternalMap.get(e);n&&this.remove(n),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((t,e)=>(i<e&&t.push(e-1),i>e&&t.push(e),t),[])})}_getItemIdBeforeAdding(t){const e=this._idProperty;let i;if(e in t){if(i=t[e],"string"!=typeof i)throw new a("collection-add-invalid-id",this);if(this.get(i))throw new a("collection-add-item-already-exists",this)}else t[e]=i=r();return i}_remove(t){let e,i,n,o=!1;const r=this._idProperty;if("string"==typeof t?(i=t,n=this._itemMap.get(i),o=!n,n&&(e=this._items.indexOf(n))):"number"==typeof t?(e=t,n=this._items[e],o=!n,n&&(i=n[r])):(n=t,i=n[r],e=this._items.indexOf(n),o=-1==e||!this._itemMap.get(i)),o)throw new a("collection-remove-404",this);this._items.splice(e,1),this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(n);return this._bindToInternalToExternalMap.delete(n),this._bindToExternalToInternalMap.delete(s),this.fire("remove",n,e),[n,e]}[Symbol.iterator](){return this._items[Symbol.iterator]()}}se(gn,g);class fn{constructor(t,e=[],i=[]){this._context=t,this._plugins=new Map,this._availablePlugins=new Map;for(const t of e)t.pluginName&&this._availablePlugins.set(t.pluginName,t);this._contextPlugins=new Map;for(const[t,e]of i)this._contextPlugins.set(t,e),this._contextPlugins.set(e,t),t.pluginName&&this._availablePlugins.set(t.pluginName,t)}*[Symbol.iterator](){for(const t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){let e=t;throw"function"==typeof t&&(e=t.pluginName||t.name),new a("plugincollection-plugin-not-loaded",this._context,{plugin:e})}return e}has(t){return this._plugins.has(t)}init(t,e=[],i=[]){const n=this,o=this._context;!function t(e,i=new Set){e.forEach(e=>{l(e)&&(i.has(e)||(i.add(e),e.pluginName&&!n._availablePlugins.has(e.pluginName)&&n._availablePlugins.set(e.pluginName,e),e.requires&&t(e.requires,i)))})}(t),u(t);const r=[...function t(e,i=new Set){return e.map(t=>l(t)?t:n._availablePlugins.get(t)).reduce((e,n)=>i.has(n)?e:(i.add(n),n.requires&&(u(n.requires,n),t(n.requires,i).forEach(t=>e.add(t))),e.add(n)),new Set)}(t.filter(t=>!d(t,e)))];!function(t,e){for(const i of e){if("function"!=typeof i)throw new a("plugincollection-replace-plugin-invalid-type",null,{pluginItem:i});const e=i.pluginName;if(!e)throw new a("plugincollection-replace-plugin-missing-name",null,{pluginItem:i});if(i.requires&&i.requires.length)throw new a("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:e});const o=n._availablePlugins.get(e);if(!o)throw new a("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:e});const r=t.indexOf(o);if(-1===r){if(n._contextPlugins.has(o))return;throw new a("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:e})}if(o.requires&&o.requires.length)throw new a("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:e});t.splice(r,1,i),n._availablePlugins.set(e,i)}}(r,i);const s=function(t){return t.map(t=>{const e=n._contextPlugins.get(t)||new t(o);return n._add(t,e),e})}(r);return m(s,"init").then(()=>m(s,"afterInit")).then(()=>s);function l(t){return"function"==typeof t}function c(t){return l(t)&&t.isContextPlugin}function d(t,e){return e.some(e=>e===t||(h(t)===e||h(e)===t))}function h(t){return l(t)?t.pluginName||t.name:t}function u(t,i=null){t.map(t=>l(t)?t:n._availablePlugins.get(t)||t).forEach(t=>{!function(t,e){if(l(t))return;if(e)throw new a("plugincollection-soft-required",o,{missingPlugin:t,requiredBy:h(e)});throw new a("plugincollection-plugin-not-found",o,{plugin:t})}(t,i),function(t,e){if(!c(e))return;if(c(t))return;throw new a("plugincollection-context-required",o,{plugin:h(t),requiredBy:h(e)})}(t,i),function(t,i){if(!i)return;if(!d(t,e))return;throw new a("plugincollection-required",o,{plugin:h(t),requiredBy:h(i)})}(t,i)})}function m(t,e){return t.reduce((t,i)=>i[e]?n._contextPlugins.has(i)?t:t.then(i[e].bind(i)):t,Promise.resolve())}}destroy(){const t=[];for(const[,e]of this)"function"!=typeof e.destroy||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const i=t.pluginName;if(i){if(this._plugins.has(i))throw new a("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:t});this._plugins.set(i,e)}}}function pn(t){return Array.isArray(t)?t:[t]}function wn(t,e,i=1){if("number"!=typeof i)throw new a("translation-service-quantity-not-a-number",null,{quantity:i});const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;1===n&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const o=e.id||e.string;if(0===n||!function(t,e){return!!window.CKEDITOR_TRANSLATIONS[t]&&!!window.CKEDITOR_TRANSLATIONS[t].dictionary[e]}(t,o))return 1!==i?e.plural:e.string;const r=window.CKEDITOR_TRANSLATIONS[t].dictionary,s=window.CKEDITOR_TRANSLATIONS[t].getPluralForm||(t=>1===t?0:1);if("string"==typeof r[o])return r[o];const l=Number(s(i));return r[o][l]}se(fn,g),window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});const bn=["ar","ara","fa","per","fas","he","heb","ku","kur","ug","uig"];function kn(t){return bn.includes(t)?"rtl":"ltr"}class _n{constructor(t={}){this.uiLanguage=t.uiLanguage||"en",this.contentLanguage=t.contentLanguage||this.uiLanguage,this.uiLanguageDirection=kn(this.uiLanguage),this.contentLanguageDirection=kn(this.contentLanguage),this.t=(t,e)=>this._t(t,e)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e=[]){e=pn(e),"string"==typeof t&&(t={string:t});const i=!!t.plural?e[0]:1;return function(t,e){return t.replace(/%(\d+)/g,(t,i)=>i<e.length?e[i]:t)}(wn(this.uiLanguage,t,i),e)}}class vn{constructor(t){this.config=new dn(t,this.constructor.defaultConfig);const e=this.constructor.builtinPlugins;this.config.define("plugins",e),this.plugins=new fn(this,e);const i=this.config.get("language")||{};this.locale=new _n({uiLanguage:"string"==typeof i?i:i.ui,contentLanguage:this.config.get("language.content")}),this.t=this.locale.t,this.editors=new gn,this._contextOwner=null}initPlugins(){const t=this.config.get("plugins")||[],e=this.config.get("substitutePlugins")||[];for(const i of t.concat(e)){if("function"!=typeof i)throw new a("context-initplugins-constructor-only",null,{Plugin:i});if(!0!==i.isContextPlugin)throw new a("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(t,[],e)}destroy(){return Promise.all(Array.from(this.editors,t=>t.destroy())).then(()=>this.plugins.destroy())}_addEditor(t,e){if(this._contextOwner)throw new a("context-addeditor-private-context");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise(e=>{const i=new this(t);e(i.initPlugins().then(()=>i))})}}class yn{constructor(t){this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}function xn(t,e){const i=Math.min(t.length,e.length);for(let n=0;n<i;n++)if(t[n]!=e[n])return n;return t.length==e.length?"same":t.length<e.length?"prefix":"extension"}se(yn,te);const An=function(t){return an(t,4)};class Cn{constructor(t){this.document=t,this.parent=null}get index(){let t;if(!this.parent)return null;if(-1==(t=this.parent.getChildIndex(this)))throw new a("view-node-not-found-in-parent",this);return t}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.index),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}getCommonAncestor(t,e={}){const i=this.getAncestors(e),n=t.getAncestors(e);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),i=t.getPath(),n=xn(e,i);switch(n){case"prefix":return!0;case"extension":return!1;default:return e[n]<i[n]}}isAfter(t){return this!=t&&(this.root===t.root&&!this.isBefore(t))}_remove(){this.parent._removeChildren(this.index)}_fireChange(t,e){this.fire("change:"+t,e),this.parent&&this.parent._fireChange(t,e)}toJSON(){const t=An(this);return delete t.parent,t}is(t){return"node"===t||"view:node"===t}}se(Cn,g);class Tn extends Cn{constructor(t,e){super(t),this._textData=e}is(t){return"$text"===t||"view:$text"===t||"text"===t||"view:text"===t||"node"===t||"view:node"===t}get data(){return this._textData}get _data(){return this.data}set _data(t){this._fireChange("text",this),this._textData=t}isSimilar(t){return t instanceof Tn&&(this===t||this.data===t.data)}_clone(){return new Tn(this.document,this.data)}}class En{constructor(t,e,i){if(this.textNode=t,e<0||e>t.data.length)throw new a("view-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.data.length)throw new a("view-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return"$textProxy"===t||"view:$textProxy"===t||"textProxy"===t||"view:textProxy"===t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this.textNode:this.parent;for(;null!==i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}}function Sn(t){return mn(t)?new Map(t):function(t){const e=new Map;for(const i in t)e.set(i,t[i]);return e}(t)}class Pn{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),e.classes&&("string"==typeof e.classes||e.classes instanceof RegExp)&&(e.classes=[e.classes]),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const i=Mn(e,t);if(i)return{element:e,pattern:t,match:i}}return null}matchAll(...t){const e=[];for(const i of t)for(const t of this._patterns){const n=Mn(i,t);n&&e.push({element:i,pattern:t,match:n})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}function Mn(t,e){if("function"==typeof e)return e(t);const i={};return e.name&&(i.name=function(t,e){if(t instanceof RegExp)return t.test(e);return t===e}(e.name,t.name),!i.name)||e.attributes&&(i.attributes=function(t,e){const i=[];for(const n in t){const o=t[n];if(!e.hasAttribute(n))return null;{const t=e.getAttribute(n);if(!0===o)i.push(n);else if(o instanceof RegExp){if(!o.test(t))return null;i.push(n)}else{if(t!==o)return null;i.push(n)}}}return i}(e.attributes,t),!i.attributes)?null:!(e.classes&&(i.classes=function(t,e){const i=[];for(const n of t)if(n instanceof RegExp){const t=e.getClassNames();for(const e of t)n.test(e)&&i.push(e);if(0===i.length)return null}else{if(!e.hasClass(n))return null;i.push(n)}return i}(e.classes,t),!i.classes))&&(!(e.styles&&(i.styles=function(t,e){const i=[];for(const n in t){const o=t[n];if(!e.hasStyle(n))return null;{const t=e.getStyle(n);if(o instanceof RegExp){if(!o.test(t))return null;i.push(n)}else{if(t!==o)return null;i.push(n)}}}return i}(e.styles,t),!i.styles))&&i)}const In=function(t){return"symbol"==typeof t||bt(t)&&"[object Symbol]"==R(t)};var Ln=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nn=/^\w*$/;const Rn=function(t,e){if(At(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!In(t))||(Nn.test(t)||!Ln.test(t)||null!=e&&t in Object(e))};function On(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,o=e?e.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var s=t.apply(this,n);return i.cache=r.set(o,s)||r,s};return i.cache=new(On.Cache||Ze),i}On.Cache=Ze;const zn=On;var Dn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vn=/\\(\\)?/g;const jn=function(t){var e=zn(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Dn,(function(t,i,n,o){e.push(n?o.replace(Vn,"$1"):i||t)})),e}));const Bn=function(t,e){for(var i=-1,n=null==t?0:t.length,o=Array(n);++i<n;)o[i]=e(t[i],i,t);return o};var Fn=C?C.prototype:void 0,Hn=Fn?Fn.toString:void 0;const Un=function t(e){if("string"==typeof e)return e;if(At(e))return Bn(e,t)+"";if(In(e))return Hn?Hn.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i};const qn=function(t){return null==t?"":Un(t)};const Wn=function(t,e){return At(t)?t:Rn(t,e)?[t]:jn(qn(t))};const $n=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0};const Gn=function(t){if("string"==typeof t||In(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};const Yn=function(t,e){for(var i=0,n=(e=Wn(e,t)).length;null!=t&&i<n;)t=t[Gn(e[i++])];return i&&i==n?t:void 0};const Kn=function(t,e,i){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(i=i>o?o:i)<0&&(i+=o),o=e>i?0:i-e>>>0,e>>>=0;for(var r=Array(o);++n<o;)r[n]=t[n+e];return r};const Qn=function(t,e){return e.length<2?t:Yn(t,Kn(e,0,-1))};const Jn=function(t,e){return e=Wn(e,t),null==(t=Qn(t,e))||delete t[Gn($n(e))]};const Zn=function(t,e){return null==t||Jn(t,e)};const Xn=function(t,e,i){var n=null==t?void 0:Yn(t,e);return void 0===n?i:n};const to=function(t,e,i){(void 0!==i&&!Z(t[e],i)||void 0===i&&!(e in t))&&J(t,e,i)};const eo=function(t){return function(e,i,n){for(var o=-1,r=Object(e),s=n(e),a=s.length;a--;){var l=s[t?a:++o];if(!1===i(r[l],l,r))break}return e}}();const io=function(t){return bt(t)&&ut(t)};const no=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};const oo=function(t){return et(t,$t(t))};const ro=function(t,e,i,n,o,r,s){var a=no(t,i),l=no(e,i),c=s.get(l);if(c)to(t,i,c);else{var d=r?r(a,l,i+"",t,e,s):void 0,h=void 0===d;if(h){var u=At(l),m=!u&&Pt(l),g=!u&&!m&&Vt(l);d=l,u||m||g?At(a)?d=a:io(a)?d=gi(a):m?(h=!1,d=mi(l,!0)):g?(h=!1,d=Yi(l,!0)):d=[]:ke(l)||xt(l)?(d=a,xt(a)?d=oo(a):v(a)&&!O(a)||(d=Zi(l))):h=!1}h&&(s.set(l,d),o(d,l,n,r,s),s.delete(l)),to(t,i,d)}};const so=function t(e,i,n,o,r){e!==i&&eo(i,(function(s,a){if(r||(r=new ei),v(s))ro(e,i,a,n,t,o,r);else{var l=o?o(no(e,a),s,a+"",e,i,r):void 0;void 0===l&&(l=s),to(e,a,l)}}),$t)};const ao=pt((function(t,e,i){so(t,e,i)}));const lo=function(t,e,i,n){if(!v(t))return t;for(var o=-1,r=(e=Wn(e,t)).length,s=r-1,a=t;null!=a&&++o<r;){var l=Gn(e[o]),c=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(o!=s){var d=a[l];void 0===(c=n?n(d,l,a):void 0)&&(c=v(d)?d:gt(e[o+1])?[]:{})}tt(a,l,c),a=a[l]}return t};const co=function(t,e,i){return null==t?t:lo(t,e,i)};class ho{constructor(t){this._styles={},this._styleProcessor=t}get isEmpty(){const t=Object.entries(this._styles);return!Array.from(t).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(t){this.clear();const e=Array.from(function(t){let e=null,i=0,n=0,o=null;const r=new Map;if(""===t)return r;";"!=t.charAt(t.length-1)&&(t+=";");for(let s=0;s<t.length;s++){const a=t.charAt(s);if(null===e)switch(a){case":":o||(o=t.substr(i,s-i),n=s+1);break;case'"':case"'":e=a;break;case";":{const e=t.substr(n,s-n);o&&r.set(o.trim(),e.trim()),o=null,i=s+1;break}}else a===e&&(e=null)}return r}(t).entries());for(const[t,i]of e)this._styleProcessor.toNormalizedForm(t,i,this._styles)}has(t){if(this.isEmpty)return!1;const e=this._styleProcessor.getReducedForm(t,this._styles).find(([e])=>e===t);return Array.isArray(e)}set(t,e){if(v(t))for(const[e,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(e,i,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=mo(t);Zn(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(t=>t.join(":")).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!v(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find(([e])=>e===t);return Array.isArray(e)?e[1]:void 0}getStyleNames(){if(this.isEmpty)return[];return this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const i of e)t.push(...this._styleProcessor.getReducedForm(i,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const i=e.splice(0,e.length-1).join("."),n=Xn(this._styles,i);if(!n)return;!Array.from(Object.keys(n)).length&&this.remove(i)}}class uo{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,i){if(v(e))go(i,mo(t),e);else if(this._normalizers.has(t)){const n=this._normalizers.get(t),{path:o,value:r}=n(e);go(i,o,r)}else go(i,t,e)}getNormalized(t,e){if(!t)return ao({},e);if(void 0!==e[t])return e[t];if(this._extractors.has(t)){const i=this._extractors.get(t);if("string"==typeof i)return Xn(e,i);const n=i(t,e);if(n)return n}return Xn(e,mo(t))}getReducedForm(t,e){const i=this.getNormalized(t,e);if(void 0===i)return[];if(this._reducers.has(t)){return this._reducers.get(t)(i)}return[[t,i]]}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const i of e)this._mapStyleNames(i,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function mo(t){return t.replace("-",".")}function go(t,e,i){let n=i;v(i)&&(n=ao({},Xn(t,e),i)),co(t,e,n)}class fo extends Cn{constructor(t,e,i,n){if(super(t),this.name=e,this._attrs=function(t){t=Sn(t);for(const[e,i]of t)null===i?t.delete(e):"string"!=typeof i&&t.set(e,String(i));return t}(i),this._children=[],n&&this._insertChild(0,n),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");po(this._classes,t),this._attrs.delete("class")}this._styles=new ho(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map,this._isAllowedInsideAttributeElement=!1}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}get isAllowedInsideAttributeElement(){return this._isAllowedInsideAttributeElement}is(t,e=null){return e?e===this.name&&("element"===t||"view:element"===t):"element"===t||"view:element"===t||"node"===t||"view:node"===t}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==t){const t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(t)}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof fo))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this.isAllowedInsideAttributeElement!=t.isAllowedInsideAttributeElement)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,i]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==i)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new Pn(...t);let i=this.parent;for(;i;){if(e.match(i))return i;i=i.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=this._styles.toString(),i=Array.from(this._attrs).map(t=>`${t[0]}="${t[1]}"`).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(e?` style="${e}"`:"")+(""==i?"":" "+i)}_clone(t=!1){const e=[];if(t)for(const i of this.getChildren())e.push(i._clone(t));const i=new this.constructor(this.document,this.name,this._attrs,e);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i._isAllowedInsideAttributeElement=this.isAllowedInsideAttributeElement,i}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let i=0;const n=function(t,e){if("string"==typeof e)return[new Tn(t,e)];mn(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new Tn(t,e):e instanceof En?new Tn(t,e.data):e)}(this.document,e);for(const e of n)null!==e.parent&&e._remove(),e.parent=this,e.document=this.document,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i<t+e;i++)this._children[i].parent=null;return this._children.splice(t,e)}_setAttribute(t,e){e=String(e),this._fireChange("attributes",this),"class"==t?po(this._classes,e):"style"==t?this._styles.setTo(e):this._attrs.set(t,e)}_removeAttribute(t){return this._fireChange("attributes",this),"class"==t?this._classes.size>0&&(this._classes.clear(),!0):"style"==t?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this);for(const e of pn(t))this._classes.add(e)}_removeClass(t){this._fireChange("attributes",this);for(const e of pn(t))this._classes.delete(e)}_setStyle(t,e){this._fireChange("attributes",this),this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this);for(const e of pn(t))this._styles.remove(e)}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function po(t,e){const i=e.split(/\s+/);t.clear(),i.forEach(e=>t.add(e))}class wo extends fo{constructor(t,e,i,n){super(t,e,i,n),this.getFillerOffset=bo}is(t,e=null){return e?e===this.name&&("containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}}function bo(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const e of t)if(!e.is("uiElement"))return null;return this.childCount}class ko extends wo{constructor(t,e,i,n){super(t,e,i,n),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}is(t,e=null){return e?e===this.name&&("editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}destroy(){this.stopListening()}}se(ko,te);const _o=Symbol("rootName");class vo extends ko{constructor(t,e){super(t,e),this.rootName="main"}is(t,e=null){return e?e===this.name&&("rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}get rootName(){return this.getCustomProperty(_o)}set rootName(t){this._setCustomProperty(_o,t)}set _name(t){this.name=t}}class yo{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new a("view-tree-walker-no-start-position",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new a("view-tree-walker-unknown-direction",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=xo._createAt(t.startPosition):this.position=xo._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,i,n;do{n=this.position,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=n)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&t.offset===i.childCount)return{done:!0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let n;if(i instanceof Tn){if(t.isAtEnd)return this.position=xo._createAfter(i),this._next();n=i.data[t.offset]}else n=i.getChild(t.offset);if(n instanceof fo)return this.shallow?t.offset++:t=new xo(n,0),this.position=t,this._formatReturnValue("elementStart",n,e,t,1);if(n instanceof Tn){if(this.singleCharacters)return t=new xo(n,0),this.position=t,this._next();{let i,o=n.data.length;return n==this._boundaryEndParent?(o=this.boundaries.end.offset,i=new En(n,0,o),t=xo._createAfter(i)):(i=new En(n,0,n.data.length),t.offset++),this.position=t,this._formatReturnValue("text",i,e,t,o)}}if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{n=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-t.offset}const o=new En(i,t.offset,n);return t.offset+=n,this.position=t,this._formatReturnValue("text",o,e,t,n)}return t=xo._createAfter(i),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,e,t)}_previous(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&0===t.offset)return{done:!0};if(i==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let n;if(i instanceof Tn){if(t.isAtStart)return this.position=xo._createBefore(i),this._previous();n=i.data[t.offset-1]}else n=i.getChild(t.offset-1);if(n instanceof fo)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",n,e,t,1)):(t=new xo(n,n.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",n,e,t));if(n instanceof Tn){if(this.singleCharacters)return t=new xo(n,n.data.length),this.position=t,this._previous();{let i,o=n.data.length;if(n==this._boundaryStartParent){const e=this.boundaries.start.offset;i=new En(n,e,n.data.length-e),o=i.data.length,t=xo._createBefore(i)}else i=new En(n,0,n.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",i,e,t,o)}}if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{const e=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=t.offset-e}t.offset-=n;const o=new En(i,t.offset,n);return this.position=t,this._formatReturnValue("text",o,e,t,n)}return t=xo._createBefore(i),this.position=t,this._formatReturnValue("elementStart",i,e,t,1)}_formatReturnValue(t,e,i,n,o){return e instanceof En&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=xo._createAfter(e.textNode):(n=xo._createAfter(e.textNode),this.position=n)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=xo._createBefore(e.textNode):(n=xo._createBefore(e.textNode),this.position=n))),{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:n,length:o}}}}class xo{constructor(t,e){this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("$text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("$text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const t=this.parent.is("$text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof ko);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=xo._createAt(this),i=e.offset+t;return e.offset=i<0?0:i,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const i=new yo(e);return i.skip(t),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),i=t.getAncestors();let n=0;for(;e[n]==i[n]&&e[n];)n++;return 0===n?null:e[n-1]}is(t){return"position"===t||"view:position"===t}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],i=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),i.push(t.offset);const n=xn(e,i);switch(n){case"prefix":return"before";case"extension":return"after";default:return e[n]<i[n]?"before":"after"}}getWalker(t={}){return t.startPosition=this,new yo(t)}clone(){return new xo(this.parent,this.offset)}static _createAt(t,e){if(t instanceof xo)return new this(t.parent,t.offset);{const i=t;if("end"==e)e=i.is("$text")?i.data.length:i.childCount;else{if("before"==e)return this._createBefore(i);if("after"==e)return this._createAfter(i);if(0!==e&&!e)throw new a("view-createpositionat-offset-required",i)}return new xo(i,e)}}static _createAfter(t){if(t.is("$textProxy"))return new xo(t.textNode,t.offsetInText+t.data.length);if(!t.parent)throw new a("view-position-after-root",t,{root:t});return new xo(t.parent,t.index+1)}static _createBefore(t){if(t.is("$textProxy"))return new xo(t.textNode,t.offsetInText);if(!t.parent)throw new a("view-position-before-root",t,{root:t});return new xo(t.parent,t.index)}}class Ao{constructor(t,e=null){this.start=t.clone(),this.end=e?e.clone():t.clone()}*[Symbol.iterator](){yield*new yo({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let t=this.start.getLastMatchingPosition(Co,{direction:"backward"}),e=this.end.getLastMatchingPosition(Co);return t.parent.is("$text")&&t.isAtStart&&(t=xo._createBefore(t.parent)),e.parent.is("$text")&&e.isAtEnd&&(e=xo._createAfter(e.parent)),new Ao(t,e)}getTrimmed(){let t=this.start.getLastMatchingPosition(Co);if(t.isAfter(this.end)||t.isEqual(this.end))return new Ao(t,t);let e=this.end.getLastMatchingPosition(Co,{direction:"backward"});const i=t.nodeAfter,n=e.nodeBefore;return i&&i.is("$text")&&(t=new xo(i,0)),n&&n.is("$text")&&(e=new xo(n,n.data.length)),new Ao(t,e)}isEqual(t){return this==t||this.start.isEqual(t.start)&&this.end.isEqual(t.end)}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const i=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),n=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return i&&n}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new Ao(this.start,t.start)),this.containsPosition(t.end)&&e.push(new Ao(t.end,this.end))):e.push(this.clone()),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,i=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(i=t.end),new Ao(e,i)}return null}getWalker(t={}){return t.boundaries=this,new yo(t)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let t=this.start.nodeAfter,e=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(t=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(e=this.end.parent.previousSibling),t&&t.is("element")&&t===e?t:null}clone(){return new Ao(this.start,this.end)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new yo(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new yo(t);yield e.position;for(const t of e)yield t.nextPosition}is(t){return"range"===t||"view:range"===t}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}static _createFromParentsAndOffsets(t,e,i,n){return new this(new xo(t,e),new xo(i,n))}static _createFromPositionAndShift(t,e){const i=t,n=t.getShiftedBy(e);return e>0?new this(i,n):new this(n,i)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(xo._createBefore(t),e)}}function Co(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))}function To(t){let e=0;for(const i of t)e++;return e}class Eo{constructor(t=null,e,i){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,i)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const n of t._ranges)if(e.isEqual(n)){i=!0;break}if(!i)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=To(this.getRanges());if(e!=To(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let i=!1;for(let n of t.getRanges())if(n=n.getTrimmed(),e.start.isEqual(n.start)&&e.end.isEqual(n.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(t,e,i){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof Eo||t instanceof So)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Ao)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof xo)this._setRanges([new Ao(t)]),this._setFakeOptions(e);else if(t instanceof Cn){const n=!!i&&!!i.backward;let o;if(void 0===e)throw new a("view-selection-setto-required-second-parameter",this);o="in"==e?Ao._createIn(t):"on"==e?Ao._createOn(t):new Ao(xo._createAt(t,e)),this._setRanges([o],n),this._setFakeOptions(i)}else{if(!mn(t))throw new a("view-selection-setto-not-selectable",this);this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new a("view-selection-setfocus-no-ranges",this);const i=xo._createAt(t,e);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.pop(),"before"==i.compareWith(n)?this._addRange(new Ao(i,n),!0):this._addRange(new Ao(n,i)),this.fire("change")}is(t){return"selection"===t||"view:selection"===t}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const e of t)this._addRange(e);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof Ao))throw new a("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new a("view-selection-range-intersects",this,{addedRange:t,intersectingRange:e});this._ranges.push(new Ao(t.start,t.end))}}se(Eo,g);class So{constructor(t=null,e,i){this._selection=new Eo,this._selection.delegate("change").to(this),this._selection.setTo(t,e,i)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}is(t){return"selection"===t||"documentSelection"==t||"view:selection"==t||"view:documentSelection"==t}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setFocus(t,e){this._selection.setFocus(t,e)}}se(So,g);class Po extends e{constructor(t,e,i){super(t,e),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}}const Mo=Symbol("bubbling contexts"),Io={fire(t,...i){try{const n=t instanceof e?t:new e(this,t),o=Oo(this);if(!o.size)return;if(Lo(n,"capturing",this),No(o,"$capture",n,...i))return n.return;const r=n.startRange||this.selection.getFirstRange(),s=r?r.getContainedElement():null,a=!!s&&Boolean(Ro(o,s));let l=s||function(t){if(!t)return null;const e=t.start.parent,i=t.end.parent,n=e.getPath(),o=i.getPath();return n.length>o.length?e:i}(r);if(Lo(n,"atTarget",l),!a){if(No(o,"$text",n,...i))return n.return;Lo(n,"bubbling",l)}for(;l;){if(l.is("rootElement")){if(No(o,"$root",n,...i))return n.return}else if(l.is("element")&&No(o,l.name,n,...i))return n.return;if(No(o,l,n,...i))return n.return;l=l.parent,Lo(n,"bubbling",l)}return Lo(n,"bubbling",this),No(o,"$document",n,...i),n.return}catch(t){a.rethrowUnexpectedError(t,this)}},_addEventListener(t,e,i){const n=pn(i.context||"$document"),o=Oo(this);for(const r of n){let n=o.get(r);n||(n=Object.create(g),o.set(r,n)),this.listenTo(n,t,e,i)}},_removeEventListener(t,e){const i=Oo(this);for(const n of i.values())this.stopListening(n,t,e)}};function Lo(t,e,i){t instanceof Po&&(t._eventPhase=e,t._currentTarget=i)}function No(t,e,i,...n){const o="string"==typeof e?t.get(e):Ro(t,e);return!!o&&(o.fire(i,...n),i.stop.called)}function Ro(t,e){for(const[i,n]of t)if("function"==typeof i&&i(e))return n;return null}function Oo(t){return t[Mo]||(t[Mo]=new Map),t[Mo]}class zo{constructor(t){this.selection=new So,this.roots=new gn({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.map(t=>t.destroy()),this.stopListening()}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(e=i(t),e)break}while(e)}}se(zo,Io),se(zo,te);class Do extends fo{constructor(t,e,i,n){super(t,e,i,n),this.getFillerOffset=Vo,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new a("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}is(t,e=null){return e?e===this.name&&("attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t):"attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function Vo(){if(jo(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(jo(t)>1)return null;t=t.parent}return!t||jo(t)>1?null:this.childCount}function jo(t){return Array.from(t.getChildren()).filter(t=>!t.is("uiElement")).length}Do.DEFAULT_PRIORITY=10;class Bo extends fo{constructor(t,e,i,n){super(t,e,i,n),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=Fo}is(t,e=null){return e?e===this.name&&("emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t):"emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Cn||Array.from(e).length>0))throw new a("view-emptyelement-cannot-add",[this,e])}}function Fo(){return null}const Ho=navigator.userAgent.toLowerCase(),Uo={isMac:function(t){return t.indexOf("macintosh")>-1}(Ho),isGecko:function(t){return!!t.match(/gecko\/\d+/)}(Ho),isSafari:function(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}(Ho),isAndroid:function(t){return t.indexOf("android")>-1}(Ho),isBlink:function(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}(Ho),features:{isRegExpUnicodePropertySupported:function(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}return t}()}};const qo={ctrl:"⌃",cmd:"⌘",alt:"⌥",shift:"⇧"},Wo={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},$o=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){const i=String.fromCharCode(e);t[i.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}(),Go=Object.fromEntries(Object.entries($o).map(([t,e])=>[e,t.charAt(0).toUpperCase()+t.slice(1)]));function Yo(t){let e;if("string"==typeof t){if(e=$o[t.toLowerCase()],!e)throw new a("keyboard-unknown-key",null,{key:t})}else e=t.keyCode+(t.altKey?$o.alt:0)+(t.ctrlKey?$o.ctrl:0)+(t.shiftKey?$o.shift:0)+(t.metaKey?$o.cmd:0);return e}function Ko(t){return"string"==typeof t&&(t=function(t){return t.split("+").map(t=>t.trim())}(t)),t.map(t=>"string"==typeof t?function(t){if(t.endsWith("!"))return Yo(t.slice(0,-1));const e=Yo(t);return Uo.isMac&&e==$o.ctrl?$o.cmd:e}(t):t).reduce((t,e)=>e+t,0)}function Qo(t){let e=Ko(t);return Object.entries(Uo.isMac?qo:Wo).reduce((t,[i,n])=>(0!=(e&$o[i])&&(e&=~$o[i],t+=n),t),"")+(e?Go[e]:"")}function Jo(t,e){const i="ltr"===e;switch(t){case $o.arrowleft:return i?"left":"right";case $o.arrowright:return i?"right":"left";case $o.arrowup:return"up";case $o.arrowdown:return"down"}}function Zo(t,e){const i=Jo(t,e);return"down"===i||"right"===i}class Xo extends fo{constructor(t,e,i,n){super(t,e,i,n),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=er}is(t,e=null){return e?e===this.name&&("uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t):"uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Cn||Array.from(e).length>0))throw new a("view-uielement-cannot-add",this)}render(t){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const t of this.getAttributeKeys())e.setAttribute(t,this.getAttribute(t));return e}}function tr(t){t.document.on("arrowKey",(e,i)=>function(t,e,i){if(e.keyCode==$o.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),n=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(n||e.shiftKey){const e=t.focusNode,o=t.focusOffset,r=i.domPositionToView(e,o);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition(t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement"))));if(s){const e=i.viewPositionToDom(a);n?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}}(0,i,t.domConverter),{priority:"low"})}function er(){return null}class ir extends fo{constructor(t,e,i,n){super(t,e,i,n),this._isAllowedInsideAttributeElement=!0,this.getFillerOffset=nr}is(t,e=null){return e?e===this.name&&("rawElement"===t||"view:rawElement"===t||"element"===t||"view:element"===t):"rawElement"===t||"view:rawElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Cn||Array.from(e).length>0))throw new a("view-rawelement-cannot-add",[this,e])}}function nr(){return null}class or{constructor(t,e){this.document=t,this._children=[],e&&this._insertChild(0,e)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"view:documentFragment"===t}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let i=0;const n=function(t,e){if("string"==typeof e)return[new Tn(t,e)];mn(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new Tn(t,e):e instanceof En?new Tn(t,e.data):e)}(this.document,e);for(const e of n)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i<t+e;i++)this._children[i].parent=null;return this._children.splice(t,e)}_fireChange(t,e){this.fire("change:"+t,e)}}se(or,g);class rr{constructor(t){this.document=t,this._cloneGroups=new Map}setSelection(t,e,i){this.document.selection._setTo(t,e,i)}setSelectionFocus(t,e){this.document.selection._setFocus(t,e)}createDocumentFragment(t){return new or(this.document,t)}createText(t){return new Tn(this.document,t)}createAttributeElement(t,e,i={}){const n=new Do(this.document,t,e);return"number"==typeof i.priority&&(n._priority=i.priority),i.id&&(n._id=i.id),n}createContainerElement(t,e,i={}){const n=new wo(this.document,t,e);return void 0!==i.isAllowedInsideAttributeElement&&(n._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),n}createEditableElement(t,e){const i=new ko(this.document,t,e);return i._document=this.document,i}createEmptyElement(t,e,i={}){const n=new Bo(this.document,t,e);return void 0!==i.isAllowedInsideAttributeElement&&(n._isAllowedInsideAttributeElement=i.isAllowedInsideAttributeElement),n}createUIElement(t,e,i,n={}){const o=new Xo(this.document,t,e);return i&&(o.render=i),void 0!==n.isAllowedInsideAttributeElement&&(o._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),o}createRawElement(t,e,i,n={}){const o=new ir(this.document,t,e);return o.render=i||(()=>{}),void 0!==n.isAllowedInsideAttributeElement&&(o._isAllowedInsideAttributeElement=n.isAllowedInsideAttributeElement),o}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){ke(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}breakAttributes(t){return t instanceof xo?this._breakAttributes(t):this._breakAttributesRange(t)}breakContainer(t){const e=t.parent;if(!e.is("containerElement"))throw new a("view-writer-break-non-container-element",this.document);if(!e.parent)throw new a("view-writer-break-root",this.document);if(t.isAtStart)return xo._createBefore(e);if(!t.isAtEnd){const i=e._clone(!1);this.insert(xo._createAfter(e),i);const n=new Ao(t,xo._createAt(e,"end")),o=new xo(i,0);this.move(n,o)}return xo._createAfter(e)}mergeAttributes(t){const e=t.offset,i=t.parent;if(i.is("$text"))return t;if(i.is("attributeElement")&&0===i.childCount){const t=i.parent,e=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new xo(t,e))}const n=i.getChild(e-1),o=i.getChild(e);if(!n||!o)return t;if(n.is("$text")&&o.is("$text"))return dr(n,o);if(n.is("attributeElement")&&o.is("attributeElement")&&n.isSimilar(o)){const t=n.childCount;return n._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new xo(n,t))}return t}mergeContainers(t){const e=t.nodeBefore,i=t.nodeAfter;if(!(e&&i&&e.is("containerElement")&&i.is("containerElement")))throw new a("view-writer-merge-containers-invalid-position",this.document);const n=e.getChild(e.childCount-1),o=n instanceof Tn?xo._createAt(n,"end"):xo._createAt(e,"end");return this.move(Ao._createIn(i),xo._createAt(e,"end")),this.remove(Ao._createOn(i)),o}insert(t,e){(function t(e,i){for(const n of e){if(!hr.some(t=>n instanceof t))throw new a("view-writer-insert-invalid-node-type",i);n.is("$text")||t(n.getChildren(),i)}})(e=mn(e)?[...e]:[e],this.document);const i=e.reduce((t,e)=>{const i=t[t.length-1],n=!(e.is("uiElement")&&e.isAllowedInsideAttributeElement);return i&&i.breakAttributes==n?i.nodes.push(e):t.push({breakAttributes:n,nodes:[e]}),t},[]);let n=null,o=t;for(const{nodes:t,breakAttributes:e}of i){const i=this._insertNodes(o,t,e);n||(n=i.start),o=i.end}return n?new Ao(n,o):new Ao(t)}remove(t){const e=t instanceof Ao?t:Ao._createOn(t);if(mr(e,this.document),e.isCollapsed)return new or(this.document);const{start:i,end:n}=this._breakAttributesRange(e,!0),o=i.parent,r=n.offset-i.offset,s=o._removeChildren(i.offset,r);for(const t of s)this._removeFromClonedElementsGroup(t);const a=this.mergeAttributes(i);return e.start=a,e.end=a.clone(),new or(this.document,s)}clear(t,e){mr(t,this.document);const i=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const n of i){const i=n.item;let o;if(i.is("element")&&e.isSimilar(i))o=Ao._createOn(i);else if(!n.nextPosition.isAfter(t.start)&&i.is("$textProxy")){const t=i.getAncestors().find(t=>t.is("element")&&e.isSimilar(t));t&&(o=Ao._createIn(t))}o&&(o.end.isAfter(t.end)&&(o.end=t.end),o.start.isBefore(t.start)&&(o.start=t.start),this.remove(o))}}move(t,e){let i;if(e.isAfter(t.end)){const n=(e=this._breakAttributes(e,!0)).parent,o=n.childCount;t=this._breakAttributesRange(t,!0),i=this.remove(t),e.offset+=n.childCount-o}else i=this.remove(t);return this.insert(e,i)}wrap(t,e){if(!(e instanceof Do))throw new a("view-writer-wrap-invalid-attribute",this.document);if(mr(t,this.document),t.isCollapsed){let n=t.start;n.parent.is("element")&&(i=n.parent,!Array.from(i.getChildren()).some(t=>!t.is("uiElement")))&&(n=n.getLastMatchingPosition(t=>t.item.is("uiElement"))),n=this._wrapPosition(n,e);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(t.start)&&this.setSelection(n),new Ao(n)}return this._wrapRange(t,e);var i}unwrap(t,e){if(!(e instanceof Do))throw new a("view-writer-unwrap-invalid-attribute",this.document);if(mr(t,this.document),t.isCollapsed)return t;const{start:i,end:n}=this._breakAttributesRange(t,!0),o=i.parent,r=this._unwrapChildren(o,i.offset,n.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const l=this.mergeAttributes(r.end);return new Ao(s,l)}rename(t,e){const i=new wo(this.document,t,e.getAttributes());return this.insert(xo._createAfter(e),i),this.move(Ao._createIn(e),xo._createAt(i,0)),this.remove(Ao._createOn(e)),i}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return xo._createAt(t,e)}createPositionAfter(t){return xo._createAfter(t)}createPositionBefore(t){return xo._createBefore(t)}createRange(t,e){return new Ao(t,e)}createRangeOn(t){return Ao._createOn(t)}createRangeIn(t){return Ao._createIn(t)}createSelection(t,e,i){return new Eo(t,e,i)}_insertNodes(t,e,i){let n,o;if(n=i?sr(t):t.parent.is("$text")?t.parent.parent:t.parent,!n)throw new a("view-writer-invalid-position-container",this.document);o=i?this._breakAttributes(t,!0):t.parent.is("$text")?cr(t):t;const r=n._insertChild(o.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const s=o.getShiftedBy(r),l=this.mergeAttributes(o);l.isEqual(o)||s.offset--;const c=this.mergeAttributes(s);return new Ao(l,c)}_wrapChildren(t,e,i,n){let o=e;const r=[];for(;o<i;){const e=t.getChild(o),i=e.is("$text"),s=e.is("attributeElement"),a=e.isAllowedInsideAttributeElement;if(s&&this._wrapAttributeElement(n,e))r.push(new xo(t,o));else if(i||a||s&&ar(n,e)){const i=n._clone();e._remove(),i._appendChild(e),t._insertChild(o,i),this._addToClonedElementsGroup(i),r.push(new xo(t,o))}else s&&this._wrapChildren(e,0,e.childCount,n);o++}let s=0;for(const t of r){if(t.offset-=s,t.offset==e)continue;this.mergeAttributes(t).isEqual(t)||(s++,i--)}return Ao._createFromParentsAndOffsets(t,e,t,i)}_unwrapChildren(t,e,i,n){let o=e;const r=[];for(;o<i;){const e=t.getChild(o);if(e.is("attributeElement"))if(e.isSimilar(n)){const n=e.getChildren(),s=e.childCount;e._remove(),t._insertChild(o,n),this._removeFromClonedElementsGroup(e),r.push(new xo(t,o),new xo(t,o+s)),o+=s,i+=s-1}else this._unwrapAttributeElement(n,e)?(r.push(new xo(t,o),new xo(t,o+1)),o++):(this._unwrapChildren(e,0,e.childCount,n),o++);else o++}let s=0;for(const t of r){if(t.offset-=s,t.offset==e||t.offset==i)continue;this.mergeAttributes(t).isEqual(t)||(s++,i--)}return Ao._createFromParentsAndOffsets(t,e,t,i)}_wrapRange(t,e){const{start:i,end:n}=this._breakAttributesRange(t,!0),o=i.parent,r=this._wrapChildren(o,i.offset,n.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new Ao(s,a)}_wrapPosition(t,e){if(e.isSimilar(t.parent))return lr(t.clone());t.parent.is("$text")&&(t=cr(t));const i=this.createAttributeElement();i._priority=Number.POSITIVE_INFINITY,i.isSimilar=()=>!1,t.parent._insertChild(t.offset,i);const n=new Ao(t,t.getShiftedBy(1));this.wrap(n,e);const o=new xo(i.parent,i.index);i._remove();const r=o.nodeBefore,s=o.nodeAfter;return r instanceof Tn&&s instanceof Tn?dr(r,s):lr(o)}_wrapAttributeElement(t,e){if(!gr(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&e.hasAttribute(i)&&e.getAttribute(i)!==t.getAttribute(i))return!1;for(const i of t.getStyleNames())if(e.hasStyle(i)&&e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&(e.hasAttribute(i)||this.setAttribute(i,t.getAttribute(i),e));for(const i of t.getStyleNames())e.hasStyle(i)||this.setStyle(i,t.getStyle(i),e);for(const i of t.getClassNames())e.hasClass(i)||this.addClass(i,e);return!0}_unwrapAttributeElement(t,e){if(!gr(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&(!e.hasAttribute(i)||e.getAttribute(i)!==t.getAttribute(i)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const i of t.getStyleNames())if(!e.hasStyle(i)||e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&this.removeAttribute(i,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const i=t.start,n=t.end;if(mr(t,this.document),t.isCollapsed){const i=this._breakAttributes(t.start,e);return new Ao(i,i)}const o=this._breakAttributes(n,e),r=o.parent.childCount,s=this._breakAttributes(i,e);return o.offset+=o.parent.childCount-r,new Ao(s,o)}_breakAttributes(t,e=!1){const i=t.offset,n=t.parent;if(t.parent.is("emptyElement"))throw new a("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new a("view-writer-cannot-break-ui-element",this.document);if(t.parent.is("rawElement"))throw new a("view-writer-cannot-break-raw-element",this.document);if(!e&&n.is("$text")&&ur(n.parent))return t.clone();if(ur(n))return t.clone();if(n.is("$text"))return this._breakAttributes(cr(t),e);if(i==n.childCount){const t=new xo(n.parent,n.index+1);return this._breakAttributes(t,e)}if(0===i){const t=new xo(n.parent,n.index);return this._breakAttributes(t,e)}{const t=n.index+1,o=n._clone();n.parent._insertChild(t,o),this._addToClonedElementsGroup(o);const r=n.childCount-i,s=n._removeChildren(i,r);o._appendChild(s);const a=new xo(n.parent,t);return this._breakAttributes(a,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);const e=t.id;if(!e)return;let i=this._cloneGroups.get(e);i||(i=new Set,this._cloneGroups.set(e,i)),i.add(t),t._clonesGroup=i}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const i=this._cloneGroups.get(e);i&&i.delete(t)}}function sr(t){let e=t.parent;for(;!ur(e);){if(!e)return;e=e.parent}return e}function ar(t,e){return t.priority<e.priority||!(t.priority>e.priority)&&t.getIdentity()<e.getIdentity()}function lr(t){const e=t.nodeBefore;if(e&&e.is("$text"))return new xo(e,e.data.length);const i=t.nodeAfter;return i&&i.is("$text")?new xo(i,0):t}function cr(t){if(t.offset==t.parent.data.length)return new xo(t.parent.parent,t.parent.index+1);if(0===t.offset)return new xo(t.parent.parent,t.parent.index);const e=t.parent.data.slice(t.offset);return t.parent._data=t.parent.data.slice(0,t.offset),t.parent.parent._insertChild(t.parent.index+1,new Tn(t.root.document,e)),new xo(t.parent.parent,t.parent.index+1)}function dr(t,e){const i=t.data.length;return t._data+=e.data,e._remove(),new xo(t,i)}const hr=[Tn,Do,wo,Bo,ir,Xo];function ur(t){return t&&(t.is("containerElement")||t.is("documentFragment"))}function mr(t,e){const i=sr(t.start),n=sr(t.end);if(!i||!n||i!==n)throw new a("view-writer-invalid-range-container",e)}function gr(t,e){return null===t.id&&null===e.id}function fr(t){return"[object Text]"==Object.prototype.toString.call(t)}const pr=t=>t.createTextNode(" "),wr=t=>{const e=t.createElement("span");return e.dataset.ckeFiller=!0,e.innerHTML=" ",e},br=t=>{const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},kr="⁠".repeat(7);function _r(t){return fr(t)&&t.data.substr(0,7)===kr}function vr(t){return 7==t.data.length&&_r(t)}function yr(t){return _r(t)?t.data.slice(7):t.data}function xr(t,e){if(e.keyCode==$o.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;_r(e)&&i<=7&&t.collapse(e,0)}}}function Ar(t,e,i,n=!1){i=i||function(t,e){return t===e},Array.isArray(t)||(t=Array.prototype.slice.call(t)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const o=function(t,e,i){const n=Cr(t,e,i);if(-1===n)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const o=Tr(t,n),r=Tr(e,n),s=Cr(o,r,i),a=t.length-s,l=e.length-s;return{firstIndex:n,lastIndexOld:a,lastIndexNew:l}}(t,e,i);return n?function(t,e){const{firstIndex:i,lastIndexOld:n,lastIndexNew:o}=t;if(-1===i)return Array(e).fill("equal");let r=[];i>0&&(r=r.concat(Array(i).fill("equal")));o-i>0&&(r=r.concat(Array(o-i).fill("insert")));n-i>0&&(r=r.concat(Array(n-i).fill("delete")));o<e&&(r=r.concat(Array(e-o).fill("equal")));return r}(o,e.length):function(t,e){const i=[],{firstIndex:n,lastIndexOld:o,lastIndexNew:r}=e;r-n>0&&i.push({index:n,type:"insert",values:t.slice(n,r)});o-n>0&&i.push({index:n+(r-n),type:"delete",howMany:o-n});return i}(e,o)}function Cr(t,e,i){for(let n=0;n<Math.max(t.length,e.length);n++)if(void 0===t[n]||void 0===e[n]||!i(t[n],e[n]))return n;return-1}function Tr(t,e){return t.slice(e).reverse()}function Er(t,e,i){i=i||function(t,e){return t===e};const n=t.length,o=e.length;if(n>200||o>200||n+o>300)return Er.fastDiff(t,e,i,!0);let r,s;if(o<n){const i=t;t=e,e=i,r="delete",s="insert"}else r="insert",s="delete";const a=t.length,l=e.length,c=l-a,d={},h={};function u(n){const o=(void 0!==h[n-1]?h[n-1]:-1)+1,c=void 0!==h[n+1]?h[n+1]:-1,u=o>c?-1:1;d[n+u]&&(d[n]=d[n+u].slice(0)),d[n]||(d[n]=[]),d[n].push(o>c?r:s);let m=Math.max(o,c),g=m-n;for(;g<a&&m<l&&i(t[g],e[m]);)g++,m++,d[n].push("equal");return m}let m,g=0;do{for(m=-g;m<c;m++)h[m]=u(m);for(m=c+g;m>c;m--)h[m]=u(m);h[c]=u(c),g++}while(h[c]!==l);return d[c].slice(1)}function Sr(t,e,i){t.insertBefore(i,t.childNodes[e]||null)}function Pr(t){const e=t.parentNode;e&&e.removeChild(t)}function Mr(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}Er.fastDiff=Ar;class Ir{constructor(t,e){this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new a("view-renderer-unknown-type",this);this.markedChildren.add(e)}}}render(){let t;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(t){const e=this.domConverter.viewPositionToDom(t),i=e.parent.ownerDocument;_r(e.parent)?this._inlineFiller=e.parent:this._inlineFiller=Lr(i,e.parent,e.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=Array.from(this.domConverter.mapViewToDom(t).childNodes),n=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),o=this._diffNodeLists(i,n),r=this._findReplaceActions(o,i,n);if(-1!==r.indexOf("replace")){const e={equal:0,insert:0,delete:0};for(const o of r)if("replace"===o){const o=e.equal+e.insert,r=e.equal+e.delete,s=t.getChild(o);!s||s.is("uiElement")||s.is("rawElement")||this._updateElementMappings(s,i[r]),Pr(n[o]),e.equal++}else e[o]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("$text")?xo._createBefore(this.selection.getFirstPosition().parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&fr(e.parent)&&_r(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!_r(t))throw new a("view-renderer-filler-was-lost",this);vr(t)?t.parentNode.removeChild(t):t.data=t.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,i=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is("element"))return!1;if(!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor(t=>t.hasAttribute("contenteditable"));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(i===e.getFillerOffset())return!1;const n=t.nodeBefore,o=t.nodeAfter;return!(n instanceof Tn||o instanceof Tn)}_updateText(t,e){const i=this.domConverter.findCorrespondingDomText(t),n=this.domConverter.viewToDom(t,i.ownerDocument),o=i.data;let r=n.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(r=kr+r),o!=r){const t=Ar(o,r);for(const e of t)"insert"===e.type?i.insertData(e.index,e.values.join("")):i.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=Array.from(e.attributes).map(t=>t.name),n=t.getAttributeKeys();for(const i of n)e.setAttribute(i,t.getAttribute(i));for(const n of i)t.hasAttribute(n)||e.removeAttribute(n)}_updateChildren(t,e){const i=this.domConverter.mapViewToDom(t);if(!i)return;const n=e.inlineFillerPosition,o=this.domConverter.mapViewToDom(t).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(t,i.ownerDocument,{bind:!0,inlineFillerPosition:n}));n&&n.parent===t&&Lr(i.ownerDocument,r,n.offset);const s=this._diffNodeLists(o,r);let a=0;const l=new Set;for(const t of s)"delete"===t?(l.add(o[a]),Pr(o[a])):"equal"===t&&a++;a=0;for(const t of s)"insert"===t?(Sr(i,a,r[a]),a++):"equal"===t&&(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);for(const t of l)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return Er(t=function(t,e){const i=Array.from(t);if(0==i.length||!e)return i;i[i.length-1]==e&&i.pop();return i}(t,this._fakeSelectionContainer),e,Rr.bind(null,this.domConverter))}_findReplaceActions(t,e,i){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let n=[],o=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?r.push(i[s.equal+s.insert]):"delete"===a?o.push(e[s.equal+s.delete]):(n=n.concat(Er(o,r,Nr).map(t=>"equal"===t?"replace":t)),n.push("equal"),o=[],r=[]),s[a]++;return n.concat(Er(o,r,Nr).map(t=>"equal"===t?"replace":t))}_markDescendantTextToSync(t){if(t)if(t.is("$text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)))}_updateFakeSelection(t){const e=t.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(t){const e=t.createElement("div");return e.className="ck-fake-selection-container",Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),e.textContent=" ",e}(e));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(t))return;i.parentElement&&i.parentElement==t||t.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const n=e.getSelection(),o=e.createRange();n.removeAllRanges(),o.selectNodeContents(i),n.addRange(o)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),n=this.domConverter.viewPositionToDom(this.selection.focus);e.collapse(i.parent,i.offset),e.extend(n.parent,n.offset),Uo.isGecko&&function(t,e){const i=t.parent;if(i.nodeType!=Node.ELEMENT_NODE||t.offset!=i.childNodes.length-1)return;const n=i.childNodes[t.offset];n&&"BR"==n.tagName&&e.addRange(e.getRangeAt(0))}(n,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,i=t.ownerDocument.getSelection();return!e||e.parentElement!==t||(i.anchorNode!==e&&!e.contains(i.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const t of this.domDocuments){if(t.getSelection().rangeCount){const e=t.activeElement,i=this.domConverter.mapDomToView(e);e&&i&&t.getSelection().removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function Lr(t,e,i){const n=e instanceof Array?e:e.childNodes,o=n[i];if(fr(o))return o.data=kr+o.data,o;{const o=t.createTextNode(kr);return Array.isArray(e)?n.splice(i,0,o):Sr(e,i,o),o}}function Nr(t,e){return Mr(t)&&Mr(e)&&!fr(t)&&!fr(e)&&t.nodeType!==Node.COMMENT_NODE&&e.nodeType!==Node.COMMENT_NODE&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function Rr(t,e,i){return e===i||(fr(e)&&fr(i)?e.data===i.data:!(!t.isBlockFiller(e)||!t.isBlockFiller(i)))}se(Ir,te);const Or={window:window,document:document};function zr(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e}function Dr(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e}const Vr=br(document),jr=pr(document),Br=wr(document);class Fr{constructor(t,e={}){this.document=t,this.blockFillerMode=e.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6","li","dd","dt","figcaption","td","th"],this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap,this._rawContentElementMatcher=new Pn,this._encounteredRawContentDomNodes=new WeakSet}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new Eo(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of t.childNodes)this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}viewToDom(t,e,i={}){if(t.is("$text")){const i=this._processDataFromViewText(t);return e.createTextNode(i)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let n;if(t.is("documentFragment"))n=e.createDocumentFragment(),i.bind&&this.bindDocumentFragments(n,t);else{if(t.is("uiElement"))return n=t.render(e),i.bind&&this.bindElements(n,t),n;n=t.hasAttribute("xmlns")?e.createElementNS(t.getAttribute("xmlns"),t.name):e.createElement(t.name),t.is("rawElement")&&t.render(n),i.bind&&this.bindElements(n,t);for(const e of t.getAttributeKeys())n.setAttribute(e,t.getAttribute(e))}if(!1!==i.withChildren)for(const o of this.viewChildrenToDom(t,e,i))n.appendChild(o);return n}}*viewChildrenToDom(t,e,i={}){const n=t.getFillerOffset&&t.getFillerOffset();let o=0;for(const r of t.getChildren())n===o&&(yield this._getBlockFiller(e)),yield this.viewToDom(r,e,i),o++;n===o&&(yield this._getBlockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),i=this.viewPositionToDom(t.end),n=document.createRange();return n.setStart(e.parent,e.offset),n.setEnd(i.parent,i.offset),n}viewPositionToDom(t){const e=t.parent;if(e.is("$text")){const i=this.findCorrespondingDomText(e);if(!i)return null;let n=t.offset;return _r(i)&&(n+=7),{parent:i,offset:n}}{let i,n,o;if(0===t.offset){if(i=this.mapViewToDom(e),!i)return null;o=i.childNodes[0]}else{const e=t.nodeBefore;if(n=e.is("$text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore),!n)return null;i=n.parentNode,o=n.nextSibling}if(fr(o)&&_r(o))return{parent:o,offset:7};return{parent:i,offset:n?zr(n)+1:0}}}domToView(t,e={}){if(this.isBlockFiller(t))return null;const i=this.getHostViewElement(t);if(i)return i;if(fr(t)){if(vr(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new Tn(this.document,e)}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);let i;if(this.isDocumentFragment(t))i=new or(this.document),e.bind&&this.bindDocumentFragments(t,i);else{const n=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();i=new fo(this.document,n),e.bind&&this.bindElements(t,i);const o=t.attributes;for(let t=o.length-1;t>=0;t--)i._setAttribute(o[t].name,o[t].value);if(!1!==e.withChildren&&this._rawContentElementMatcher.match(i))return i._setCustomProperty("$rawContent",t.innerHTML),this._encounteredRawContentDomNodes.add(t),i}if(!1!==e.withChildren)for(const n of this.domChildrenToView(t,e))i._appendChild(n);return i}}*domChildrenToView(t,e={}){for(let i=0;i<t.childNodes.length;i++){const n=t.childNodes[i],o=this.domToView(n,e);null!==o&&(yield o)}}domSelectionToView(t){if(1===t.rangeCount){let e=t.getRangeAt(0).startContainer;fr(e)&&(e=e.parentNode);const i=this.fakeSelectionToView(e);if(i)return i}const e=this.isDomSelectionBackward(t),i=[];for(let e=0;e<t.rangeCount;e++){const n=t.getRangeAt(e),o=this.domRangeToView(n);o&&i.push(o)}return new Eo(i,{backward:e})}domRangeToView(t){const e=this.domPositionToView(t.startContainer,t.startOffset),i=this.domPositionToView(t.endContainer,t.endOffset);return e&&i?new Ao(e,i):null}domPositionToView(t,e){if(this.isBlockFiller(t))return this.domPositionToView(t.parentNode,zr(t));const i=this.mapDomToView(t);if(i&&(i.is("uiElement")||i.is("rawElement")))return xo._createBefore(i);if(fr(t)){if(vr(t))return this.domPositionToView(t.parentNode,zr(t));const i=this.findCorrespondingViewText(t);let n=e;return i?(_r(t)&&(n-=7,n=n<0?0:n),new xo(i,n)):null}if(0===e){const e=this.mapDomToView(t);if(e)return new xo(e,0)}else{const i=t.childNodes[e-1],n=fr(i)?this.findCorrespondingViewText(i):this.mapDomToView(i);if(n&&n.parent)return new xo(n.parent,n.index+1)}return null}mapDomToView(t){return this.getHostViewElement(t)||this._domToViewMapping.get(t)}findCorrespondingViewText(t){if(vr(t))return null;const e=this.getHostViewElement(t);if(e)return e;const i=t.previousSibling;if(i){if(!this.isElement(i))return null;const t=this.mapDomToView(i);if(t){return t.nextSibling instanceof Tn?t.nextSibling:null}}else{const e=this.mapDomToView(t.parentNode);if(e){const t=e.getChild(0);return t instanceof Tn?t:null}}return null}mapViewToDom(t){return this._viewToDomMapping.get(t)}findCorrespondingDomText(t){const e=t.previousSibling;return e&&this.mapViewToDom(e)?this.mapViewToDom(e).nextSibling:!e&&t.parent&&this.mapViewToDom(t.parent)?this.mapViewToDom(t.parent).childNodes[0]:null}focus(t){const e=this.mapViewToDom(t);if(e&&e.ownerDocument.activeElement!==e){const{scrollX:t,scrollY:i}=Or.window,n=[];Ur(e,t=>{const{scrollLeft:e,scrollTop:i}=t;n.push([e,i])}),e.focus(),Ur(e,t=>{const[e,i]=n.shift();t.scrollLeft=e,t.scrollTop=i}),Or.window.scrollTo(t,i)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isBlockFiller(t){return"br"==this.blockFillerMode?t.isEqualNode(Vr):!("BR"!==t.tagName||!qr(t,this.blockElements)||1!==t.parentNode.childNodes.length)||(t.isEqualNode(Br)||function(t,e){return t.isEqualNode(jr)&&qr(t,e)&&1===t.parentNode.childNodes.length}(t,this.blockElements))}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const i=e.collapsed;return e.detach(),i}getHostViewElement(t){const e=Dr(t);for(e.pop();e.length;){const t=e.pop(),i=this._domToViewMapping.get(t);if(i&&(i.is("uiElement")||i.is("rawElement")))return i}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}registerRawContentMatcher(t){this._rawContentElementMatcher.add(t)}_getBlockFiller(t){switch(this.blockFillerMode){case"nbsp":return pr(t);case"markedNbsp":return wr(t);case"br":return br(t)}}_isDomSelectionPositionCorrect(t,e){if(fr(t)&&_r(t)&&e<7)return!1;if(this.isElement(t)&&_r(t.childNodes[e]))return!1;const i=this.mapDomToView(t);return!i||!i.is("uiElement")&&!i.is("rawElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return e;if(" "==e.charAt(0)){const i=this._getTouchingViewTextNode(t,!1);!(i&&this._nodeEndsWithSpace(i))&&i||(e=" "+e.substr(1))}if(" "==e.charAt(e.length-1)){const i=this._getTouchingViewTextNode(t,!0);" "!=e.charAt(e.length-2)&&i&&" "!=i.data.charAt(0)||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(Hr(t,this.preElements))return yr(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const i=this._getTouchingInlineDomNode(t,!1),n=this._getTouchingInlineDomNode(t,!0),o=this._checkShouldLeftTrimDomText(t,i),r=this._checkShouldRightTrimDomText(t,n);return o&&(e=e.replace(/^ /,"")),r&&(e=e.replace(/ $/,"")),e=yr(new Text(e)),e=e.replace(/ \u00A0/g," "),(/( |\u00A0)\u00A0$/.test(e)||!n||n.data&&" "==n.data.charAt(0))&&(e=e.replace(/\u00A0$/," ")),o&&(e=e.replace(/^\u00A0/," ")),e}_checkShouldLeftTrimDomText(t,e){return!e||(!!cn(e)||!this._encounteredRawContentDomNodes.has(t.previousSibling)&&/[^\S\u00A0]/.test(e.data.charAt(e.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!_r(t)}_getTouchingViewTextNode(t,e){const i=new yo({startPosition:e?xo._createAfter(t):xo._createBefore(t),direction:e?"forward":"backward"});for(const t of i){if(t.item.is("containerElement"))return null;if(t.item.is("element","br"))return null;if(t.item.is("$textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const i=e?"nextNode":"previousNode",n=t.ownerDocument,o=Dr(t)[0],r=n.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:t=>fr(t)||"BR"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=t;const s=r[i]();if(null!==s){const e=function(t,e){const i=Dr(t),n=Dr(e);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}(t,s);if(e&&!Hr(t,this.blockElements,e)&&!Hr(s,this.blockElements,e))return s}return null}}function Hr(t,e,i){let n=Dr(t);return i&&(n=n.slice(n.indexOf(i)+1)),n.some(t=>t.tagName&&e.includes(t.tagName.toLowerCase()))}function Ur(t,e){for(;t&&t!=Or.document;)e(t),t=t.parentNode}function qr(t,e){const i=t.parentNode;return i&&i.tagName&&e.includes(i.tagName.toLowerCase())}function Wr(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}const $r=Gt({},g,{listenTo(t,...e){if(Mr(t)||Wr(t)){const i=this._getProxyEmitter(t)||new Gr(t);i.attach(...e),t=i}g.listenTo.call(this,t,...e)},stopListening(t,e,i){if(Mr(t)||Wr(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}g.stopListening.call(this,t,e,i),t instanceof Gr&&t.detach(e)},_getProxyEmitter(t){return e=this,i=Yr(t),e[u]&&e[u][i]?e[u][i].emitter:null;var e,i}});class Gr{constructor(t){f(this,Yr(t)),this._domNode=t}}function Yr(t){return t["data-ck-expando"]||(t["data-ck-expando"]=r())}Gt(Gr.prototype,g,{attach(t,e,i={}){if(this._domListeners&&this._domListeners[t])return;const n={capture:!!i.useCapture,passive:!!i.usePassive},o=this._createDomListener(t,n);this._domNode.addEventListener(t,o,n),this._domListeners||(this._domListeners={}),this._domListeners[t]=o},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const i=e=>{this.fire(t,e)};return i.removeListener=()=>{this._domNode.removeEventListener(t,i,e),delete this._domListeners[t]},i}});class Kr{constructor(t){this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(t){return t&&3===t.nodeType&&(t=t.parentNode),!(!t||1!==t.nodeType)&&t.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}}se(Kr,$r);const Qr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};const Jr=function(t){return this.__data__.has(t)};function Zr(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new Ze;++e<i;)this.add(t[e])}Zr.prototype.add=Zr.prototype.push=Qr,Zr.prototype.has=Jr;const Xr=Zr;const ts=function(t,e){for(var i=-1,n=null==t?0:t.length;++i<n;)if(e(t[i],i,t))return!0;return!1};const es=function(t,e){return t.has(e)};const is=function(t,e,i,n,o,r){var s=1&i,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(t),d=r.get(e);if(c&&d)return c==e&&d==t;var h=-1,u=!0,m=2&i?new Xr:void 0;for(r.set(t,e),r.set(e,t);++h<a;){var g=t[h],f=e[h];if(n)var p=s?n(f,g,h,e,t,r):n(g,f,h,t,e,r);if(void 0!==p){if(p)continue;u=!1;break}if(m){if(!ts(e,(function(t,e){if(!es(m,e)&&(g===t||o(g,t,i,n,r)))return m.push(e)}))){u=!1;break}}else if(g!==f&&!o(g,f,i,n,r)){u=!1;break}}return r.delete(t),r.delete(e),u};const ns=function(t){var e=-1,i=Array(t.size);return t.forEach((function(t,n){i[++e]=[n,t]})),i};const os=function(t){var e=-1,i=Array(t.size);return t.forEach((function(t){i[++e]=t})),i};var rs=C?C.prototype:void 0,ss=rs?rs.valueOf:void 0;const as=function(t,e,i,n,o,r,s){switch(i){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!r(new Bi(t),new Bi(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Z(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=ns;case"[object Set]":var l=1&n;if(a||(a=os),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;n|=2,s.set(t,e);var d=is(a(t),a(e),n,o,r,s);return s.delete(t),d;case"[object Symbol]":if(ss)return ss.call(t)==ss.call(e)}return!1};var ls=Object.prototype.hasOwnProperty;const cs=function(t,e,i,n,o,r){var s=1&i,a=Ci(t),l=a.length;if(l!=Ci(e).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in e:ls.call(e,d)))return!1}var h=r.get(t),u=r.get(e);if(h&&u)return h==e&&u==t;var m=!0;r.set(t,e),r.set(e,t);for(var g=s;++c<l;){var f=t[d=a[c]],p=e[d];if(n)var w=s?n(p,f,d,e,t,r):n(f,p,d,t,e,r);if(!(void 0===w?f===p||o(f,p,i,n,r):w)){m=!1;break}g||(g="constructor"==d)}if(m&&!g){var b=t.constructor,k=e.constructor;b==k||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof k&&k instanceof k||(m=!1)}return r.delete(t),r.delete(e),m};var ds=Object.prototype.hasOwnProperty;const hs=function(t,e,i,n,o,r){var s=At(t),a=At(e),l=s?"[object Array]":Di(t),c=a?"[object Array]":Di(e),d="[object Object]"==(l="[object Arguments]"==l?"[object Object]":l),h="[object Object]"==(c="[object Arguments]"==c?"[object Object]":c),u=l==c;if(u&&Pt(t)){if(!Pt(e))return!1;s=!0,d=!1}if(u&&!d)return r||(r=new ei),s||Vt(t)?is(t,e,i,n,o,r):as(t,e,l,i,n,o,r);if(!(1&i)){var m=d&&ds.call(t,"__wrapped__"),g=h&&ds.call(e,"__wrapped__");if(m||g){var f=m?t.value():t,p=g?e.value():e;return r||(r=new ei),o(f,p,i,n,r)}}return!!u&&(r||(r=new ei),cs(t,e,i,n,o,r))};const us=function t(e,i,n,o,r){return e===i||(null==e||null==i||!bt(e)&&!bt(i)?e!=e&&i!=i:hs(e,i,n,o,t,r))};const ms=function(t,e,i){var n=(i="function"==typeof i?i:void 0)?i(t,e):void 0;return void 0===n?us(t,e,void 0,i):!!n};class gs extends Kr{constructor(t){super(t),this._config={childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},this.domConverter=t.domConverter,this.renderer=t._renderer,this._domElements=[],this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(t){this._domElements.push(t),this.isEnabled&&this._mutationObserver.observe(t,this._config)}enable(){super.enable();for(const t of this._domElements)this._mutationObserver.observe(t,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(t){if(0===t.length)return;const e=this.domConverter,i=new Map,n=new Set;for(const i of t)if("childList"===i.type){const t=e.mapDomToView(i.target);if(t&&(t.is("uiElement")||t.is("rawElement")))continue;t&&!this._isBogusBrMutation(i)&&n.add(t)}for(const o of t){const t=e.mapDomToView(o.target);if((!t||!t.is("uiElement")&&!t.is("rawElement"))&&"characterData"===o.type){const t=e.findCorrespondingViewText(o.target);t&&!n.has(t.parent)?i.set(t,{type:"text",oldText:t.data,newText:yr(o.target),node:t}):!t&&_r(o.target)&&n.add(e.mapDomToView(o.target.parentNode))}}const o=[];for(const t of i.values())this.renderer.markToSync("text",t.node),o.push(t);for(const t of n){const i=e.mapViewToDom(t),n=Array.from(t.getChildren()),r=Array.from(e.domChildrenToView(i,{withChildren:!1}));ms(n,r,a)||(this.renderer.markToSync("children",t),o.push({type:"children",oldChildren:n,newChildren:r,node:t}))}const r=t[0].target.ownerDocument.getSelection();let s=null;if(r&&r.anchorNode){const t=e.domPositionToView(r.anchorNode,r.anchorOffset),i=e.domPositionToView(r.focusNode,r.focusOffset);t&&i&&(s=new Eo(t),s.setFocus(i))}function a(t,e){if(!Array.isArray(t))return t===e||!(!t.is("$text")||!e.is("$text"))&&t.data===e.data}o.length&&(this.document.fire("mutations",o,s),this.view.forceRender())}_isBogusBrMutation(t){let e=null;return null===t.nextSibling&&0===t.removedNodes.length&&1==t.addedNodes.length&&(e=this.domConverter.domToView(t.addedNodes[0],{withChildren:!1})),e&&e.is("element","br")}}class fs{constructor(t,e,i){this.view=t,this.document=t.document,this.domEvent=e,this.domTarget=e.target,Gt(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}}class ps extends Kr{constructor(t){super(t),this.useCapture=!1}observe(t){("string"==typeof this.domEventType?[this.domEventType]:this.domEventType).forEach(e=>{this.listenTo(t,e,(t,e)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(e.target)&&this.onDomEvent(e)},{useCapture:this.useCapture})})}fire(t,e,i){this.isEnabled&&this.document.fire(t,new fs(this.view,e,i))}}class ws extends ps{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,get keystroke(){return Yo(this)}})}}const bs=function(){return A.Date.now()};var ks=/\s/;const _s=function(t){for(var e=t.length;e--&&ks.test(t.charAt(e)););return e};var vs=/^\s+/;const ys=function(t){return t?t.slice(0,_s(t)+1).replace(vs,""):t};var xs=/^[-+]0x[0-9a-f]+$/i,As=/^0b[01]+$/i,Cs=/^0o[0-7]+$/i,Ts=parseInt;const Es=function(t){if("number"==typeof t)return t;if(In(t))return NaN;if(v(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=v(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=ys(t);var i=As.test(t);return i||Cs.test(t)?Ts(t.slice(2),i?2:8):xs.test(t)?NaN:+t};var Ss=Math.max,Ps=Math.min;const Ms=function(t,e,i){var n,o,r,s,a,l,c=0,d=!1,h=!1,u=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var i=n,r=o;return n=o=void 0,c=e,s=t.apply(r,i)}function g(t){return c=t,a=setTimeout(p,e),d?m(t):s}function f(t){var i=t-l;return void 0===l||i>=e||i<0||h&&t-c>=r}function p(){var t=bs();if(f(t))return w(t);a=setTimeout(p,function(t){var i=e-(t-l);return h?Ps(i,r-(t-c)):i}(t))}function w(t){return a=void 0,u&&n?m(t):(n=o=void 0,s)}function b(){var t=bs(),i=f(t);if(n=arguments,o=this,l=t,i){if(void 0===a)return g(l);if(h)return clearTimeout(a),a=setTimeout(p,e),m(l)}return void 0===a&&(a=setTimeout(p,e)),s}return e=Es(e)||0,v(i)&&(d=!!i.leading,r=(h="maxWait"in i)?Ss(Es(i.maxWait)||0,e):r,u="trailing"in i?!!i.trailing:u),b.cancel=function(){void 0!==a&&clearTimeout(a),c=0,n=l=o=a=void 0},b.flush=function(){return void 0===a?s:w(bs())},b};class Is extends Kr{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=Ms(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const t=this.document;t.on("arrowKey",(e,i)=>{t.selection.isFake&&this.isEnabled&&i.preventDefault()},{context:"$capture"}),t.on("arrowKey",(e,i)=>{t.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,i=new Eo(e.getRanges(),{backward:e.isBackward,fake:!1});t!=$o.arrowleft&&t!=$o.arrowup||i.setTo(i.getFirstPosition()),t!=$o.arrowright&&t!=$o.arrowdown||i.setTo(i.getLastPosition());const n={oldSelection:e,newSelection:i,domSelection:null};this.document.fire("selectionChange",n),this._fireSelectionChangeDoneDebounced(n)}}class Ls extends Kr{constructor(t){super(t),this.mutationObserver=t.getObserver(gs),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Ms(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,"selectionchange",(t,i)=>{this._handleSelectionChange(i,e)}),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(t,e){if(!this.isEnabled)return;const i=e.defaultView.getSelection();if(this.checkShouldIgnoreEventFromTarget(i.anchorNode))return;this.mutationObserver.flush();const n=this.domConverter.domSelectionToView(i);if(0!=n.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(n)&&this.domConverter.isDomSelectionCorrect(i)||++this._loopbackCounter>60))if(this.selection.isSimilar(n))this.view.forceRender();else{const t={oldSelection:this.selection,newSelection:n,domSelection:i};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}}class Ns extends ps{constructor(t){super(t),this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",()=>{e.isFocused=!0,this._renderTimeoutId=setTimeout(()=>t.forceRender(),50)}),e.on("blur",(i,n)=>{const o=e.selection.editableElement;null!==o&&o!==n.target||(e.isFocused=!1,t.forceRender())})}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}}class Rs extends ps{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0}),e.on("compositionend",()=>{e.isComposing=!1})}onDomEvent(t){this.fire(t.type,t)}}class Os extends ps{constructor(t){super(t),this.domEventType=["beforeinput"]}onDomEvent(t){this.fire(t.type,t)}}class zs{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}}function Ds(t){return"[object Range]"==Object.prototype.toString.apply(t)}function Vs(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const js=["top","right","bottom","left","width","height"];class Bs{constructor(t){const e=Ds(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),cn(t)||e)if(e){const e=Bs.getDomRangeRects(t);Fs(this,Bs.getBoundingRect(e))}else Fs(this,t.getBoundingClientRect());else if(Wr(t)){const{innerWidth:e,innerHeight:i}=t;Fs(this,{top:0,right:e,bottom:i,left:0,width:e,height:i})}else Fs(this,t)}clone(){return new Bs(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new Bs(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!Hs(t)){let i=t.parentNode||t.commonAncestorContainer;for(;i&&!Hs(i);){const t=new Bs(i),n=e.getIntersection(t);if(!n)return null;n.getArea()<e.getArea()&&(e=n),i=i.parentNode}}return e}isEqual(t){for(const e of js)if(this[e]!==t[e])return!1;return!0}contains(t){const e=this.getIntersection(t);return!(!e||!e.isEqual(t))}excludeScrollbarsAndBorders(){const t=this._source;let e,i,n;if(Wr(t))e=t.innerWidth-t.document.documentElement.clientWidth,i=t.innerHeight-t.document.documentElement.clientHeight,n=t.getComputedStyle(t.document.documentElement).direction;else{const o=Vs(this._source);e=t.offsetWidth-t.clientWidth-o.left-o.right,i=t.offsetHeight-t.clientHeight-o.top-o.bottom,n=t.ownerDocument.defaultView.getComputedStyle(t).direction,this.left+=o.left,this.top+=o.top,this.right-=o.right,this.bottom-=o.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=e,"ltr"===n?this.right-=e:this.left+=e,this.height-=i,this.bottom-=i,this}static getDomRangeRects(t){const e=[],i=Array.from(t.getClientRects());if(i.length)for(const t of i)e.push(new Bs(t));else{let i=t.startContainer;fr(i)&&(i=i.parentNode);const n=new Bs(i.getBoundingClientRect());n.right=n.left,n.width=0,e.push(n)}return e}static getBoundingRect(t){const e={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY};let i=0;for(const n of t)i++,e.left=Math.min(e.left,n.left),e.top=Math.min(e.top,n.top),e.right=Math.max(e.right,n.right),e.bottom=Math.max(e.bottom,n.bottom);return 0==i?null:(e.width=e.right-e.left,e.height=e.bottom-e.top,new Bs(e))}}function Fs(t,e){for(const i of js)t[i]=e[i]}function Hs(t){return!!cn(t)&&t===t.ownerDocument.body}class Us{constructor(t,e){Us._observerInstance||Us._createObserver(),this._element=t,this._callback=e,Us._addElementCallback(t,e),Us._observerInstance.observe(t)}destroy(){Us._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){Us._elementCallbacks||(Us._elementCallbacks=new Map);let i=Us._elementCallbacks.get(t);i||(i=new Set,Us._elementCallbacks.set(t,i)),i.add(e)}static _deleteElementCallback(t,e){const i=Us._getElementCallbacks(t);i&&(i.delete(e),i.size||(Us._elementCallbacks.delete(t),Us._observerInstance.unobserve(t))),Us._elementCallbacks&&!Us._elementCallbacks.size&&(Us._observerInstance=null,Us._elementCallbacks=null)}static _getElementCallbacks(t){return Us._elementCallbacks?Us._elementCallbacks.get(t):null}static _createObserver(){let t;t="function"==typeof Or.window.ResizeObserver?Or.window.ResizeObserver:qs,Us._observerInstance=new t(t=>{for(const e of t){const t=Us._getElementCallbacks(e.target);if(t)for(const i of t)i(e)}})}}Us._observerInstance=null,Us._elementCallbacks=null;class qs{constructor(t){this._callback=t,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(t){this._elements.add(t),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(t){this._elements.delete(t),this._previousRects.delete(t),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const t=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(t,100)};this.listenTo(Or.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(t,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const t=[];for(const e of this._elements)this._hasRectChanged(e)&&t.push({target:e,contentRect:this._previousRects.get(e)});t.length&&this._callback(t)}_hasRectChanged(t){if(!t.ownerDocument.body.contains(t))return!1;const e=new Bs(t),i=this._previousRects.get(t),n=!i||!i.isEqual(e);return this._previousRects.set(t,e),n}}function Ws(t){const e=t.next();return e.done?null:e.value}se(qs,$r);class $s{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new a("focustracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}se($s,$r),se($s,te);class Gs{constructor(){this._listener=Object.create($r)}listenTo(t){this._listener.listenTo(t,"keydown",(t,e)=>{this._listener.fire("_keydown:"+Yo(e),e)})}set(t,e,i={}){const n=Ko(t),o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+n,(t,i)=>{e(i,()=>{i.preventDefault(),i.stopPropagation(),t.stop()}),t.return=!0},{priority:o})}press(t){return!!this._listener.fire("_keydown:"+Yo(t),t)}destroy(){this._listener.stopListening()}}class Ys extends Kr{constructor(t){super(t),this.document.on("keydown",(t,e)=>{if(this.isEnabled&&((i=e.keyCode)==$o.arrowright||i==$o.arrowleft||i==$o.arrowup||i==$o.arrowdown)){const i=new Po(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(i,e),i.stop.called&&t.stop()}var i})}observe(){}}function Ks({target:t,viewportOffset:e=0}){const i=ia(t);let n=i,o=null;for(;n;){let r;r=na(n==i?t:o),Js(r,()=>oa(t,n));const s=oa(t,n);if(Qs(n,s,e),n.parent!=n){if(o=n.frameElement,n=n.parent,!o)return}else n=null}}function Qs(t,e,i){const n=e.clone().moveBy(0,i),o=e.clone().moveBy(0,-i),r=new Bs(t).excludeScrollbarsAndBorders();if(![o,n].every(t=>r.contains(t))){let{scrollX:s,scrollY:a}=t;Xs(o,r)?a-=r.top-e.top+i:Zs(n,r)&&(a+=e.bottom-r.bottom+i),ta(e,r)?s-=r.left-e.left+i:ea(e,r)&&(s+=e.right-r.right+i),t.scrollTo(s,a)}}function Js(t,e){const i=ia(t);let n,o;for(;t!=i.document.body;)o=e(),n=new Bs(t).excludeScrollbarsAndBorders(),n.contains(o)||(Xs(o,n)?t.scrollTop-=n.top-o.top:Zs(o,n)&&(t.scrollTop+=o.bottom-n.bottom),ta(o,n)?t.scrollLeft-=n.left-o.left:ea(o,n)&&(t.scrollLeft+=o.right-n.right)),t=t.parentNode}function Zs(t,e){return t.bottom>e.bottom}function Xs(t,e){return t.top<e.top}function ta(t,e){return t.left<e.left}function ea(t,e){return t.right>e.right}function ia(t){return Ds(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function na(t){if(Ds(t)){let e=t.commonAncestorContainer;return fr(e)&&(e=e.parentNode),e}return t.parentNode}function oa(t,e){const i=ia(t),n=new Bs(t);if(i===e)return n;{let t=i;for(;t!=e;){const e=t.frameElement,i=new Bs(e).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top),t=t.parent}}return n}Object.assign({},{scrollViewportToShowTarget:Ks,scrollAncestorsToShowTarget:function(t){Js(na(t),()=>new Bs(t))}});class ra{constructor(t){this.document=new zo(t),this.domConverter=new Fr(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Ir(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new rr(this.document),this.addObserver(gs),this.addObserver(Ls),this.addObserver(Ns),this.addObserver(ws),this.addObserver(Is),this.addObserver(Rs),this.addObserver(Ys),Uo.isAndroid&&this.addObserver(Os),this.document.on("arrowKey",xr,{priority:"low"}),tr(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(t,e="main"){const i=this.document.getRoot(e);i._name=t.tagName.toLowerCase();const n={};for(const{name:e,value:o}of Array.from(t.attributes))n[e]=o,"class"===e?this._writer.addClass(o.split(" "),i):this._writer.setAttribute(e,o,i);this._initialDomRootAttributes.set(t,n);const o=()=>{this._writer.setAttribute("contenteditable",!i.isReadOnly,i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};o(),this.domRoots.set(e,t),this.domConverter.bindElements(t,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(t.ownerDocument),i.on("change:children",(t,e)=>this._renderer.markToSync("children",e)),i.on("change:attributes",(t,e)=>this._renderer.markToSync("attributes",e)),i.on("change:text",(t,e)=>this._renderer.markToSync("text",e)),i.on("change:isReadOnly",()=>this.change(o)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const i of this._observers.values())i.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach(({name:t})=>e.removeAttribute(t));const i=this._initialDomRootAttributes.get(e);for(const t in i)e.setAttribute(t,i[t]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[t,i]of this.domRoots)e.observe(i,t);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&Ks({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new a("cannot-change-view-tree",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(t){a.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return xo._createAt(t,e)}createPositionAfter(t){return xo._createAfter(t)}createPositionBefore(t){return xo._createBefore(t)}createRange(t,e){return new Ao(t,e)}createRangeOn(t){return Ao._createOn(t)}createRangeIn(t){return Ao._createIn(t)}createSelection(t,e,i){return new Eo(t,e,i)}_disableRendering(t){this._renderingDisabled=t,0==t&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}se(ra,te);class sa{constructor(t){this.parent=null,this._attrs=Sn(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new a("model-node-not-found-in-parent",this);return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new a("model-node-not-found-in-parent",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}getCommonAncestor(t,e={}){const i=this.getAncestors(e),n=t.getAncestors(e);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),i=t.getPath(),n=xn(e,i);switch(n){case"prefix":return!0;case"extension":return!1;default:return e[n]<i[n]}}isAfter(t){return this!=t&&(this.root===t.root&&!this.isBefore(t))}hasAttribute(t){return this._attrs.has(t)}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}toJSON(){const t={};return this._attrs.size&&(t.attributes=Array.from(this._attrs).reduce((t,e)=>(t[e[0]]=e[1],t),{})),t}is(t){return"node"===t||"model:node"===t}_clone(){return new sa(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=Sn(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}}class aa extends sa{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return"$text"===t||"model:$text"===t||"text"===t||"model:text"===t||"node"===t||"model:node"===t}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new aa(this.data,this.getAttributes())}static fromJSON(t){return new aa(t.data,t.attributes)}}class la{constructor(t,e,i){if(this.textNode=t,e<0||e>t.offsetSize)throw new a("model-textproxy-wrong-offsetintext",this);if(i<0||e+i>t.offsetSize)throw new a("model-textproxy-wrong-length",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(t){return"$textProxy"===t||"model:$textProxy"===t||"textProxy"===t||"model:textProxy"===t}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}}class ca{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce((t,e)=>t+e.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new a("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const i of this._nodes){if(t>=e&&t<e+i.offsetSize)return this.getNodeIndex(i);e+=i.offsetSize}if(e!=t)throw new a("model-nodelist-offset-out-of-bounds",this,{offset:t,nodeList:this});return this.length}_insertNodes(t,e){for(const t of e)if(!(t instanceof sa))throw new a("model-nodelist-insertnodes-not-node",this);this._nodes.splice(t,0,...e)}_removeNodes(t,e=1){return this._nodes.splice(t,e)}toJSON(){return this._nodes.map(t=>t.toJSON())}}class da extends sa{constructor(t,e,i){super(e),this.name=t,this._children=new ca,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(t,e=null){return e?e===this.name&&("element"===t||"model:element"===t):"element"===t||"model:element"===t||"node"===t||"model:node"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}findAncestor(t,e={includeSelf:!1}){let i=e.includeSelf?this:this.parent;for(;i;){if(i.name===t)return i;i=i.parent}return null}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(t=>t._clone(!0)):null;return new da(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new aa(t)];mn(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new aa(t):t instanceof la?new aa(t.data,t.getAttributes()):t)}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}static fromJSON(t){let e=null;if(t.children){e=[];for(const i of t.children)i.name?e.push(da.fromJSON(i)):e.push(aa.fromJSON(i))}return new da(t.name,t.attributes,e)}}class ha{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new a("model-tree-walker-no-start-position",null);const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new a("model-tree-walker-unknown-direction",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=ma._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(t){let e,i,n,o;do{n=this.position,o=this._visitedParent,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=n,this._visitedParent=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(null===i.parent&&e.offset===i.maxOffset)return{done:!0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const n=e.parent,o=ga(e,n),r=o||fa(e,n,o);if(r instanceof da)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=r),this.position=e,ua("elementStart",r,t,e,1);if(r instanceof aa){let n;if(this.singleCharacters)n=1;else{let t=r.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offset<t&&(t=this.boundaries.end.offset),n=t-e.offset}const o=e.offset-r.startOffset,s=new la(r,o,n);return e.offset+=n,this.position=e,ua("text",s,t,e,n)}return e.path.pop(),e.offset++,this.position=e,this._visitedParent=i.parent,this.ignoreElementEnd?this._next():ua("elementEnd",i,t,e)}_previous(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(null===i.parent&&0===e.offset)return{done:!0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};const n=e.parent,o=ga(e,n),r=o||pa(e,n,o);if(r instanceof da)return e.offset--,this.shallow?(this.position=e,ua("elementStart",r,t,e,1)):(e.path.push(r.maxOffset),this.position=e,this._visitedParent=r,this.ignoreElementEnd?this._previous():ua("elementEnd",r,t,e));if(r instanceof aa){let n;if(this.singleCharacters)n=1;else{let t=r.startOffset;this._boundaryStartParent==i&&this.boundaries.start.offset>t&&(t=this.boundaries.start.offset),n=e.offset-t}const o=e.offset-r.startOffset,s=new la(r,o-n,n);return e.offset-=n,this.position=e,ua("text",s,t,e,n)}return e.path.pop(),this.position=e,this._visitedParent=i.parent,ua("elementStart",i,t,e,1)}}function ua(t,e,i,n,o){return{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:n,length:o}}}class ma{constructor(t,e,i="toNone"){if(!t.is("element")&&!t.is("documentFragment"))throw new a("model-position-root-invalid",t);if(!(e instanceof Array)||0===e.length)throw new a("model-position-path-incorrect-format",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;e<this.path.length-1;e++)if(t=t.getChild(t.offsetToIndex(this.path[e])),!t)throw new a("model-position-path-incorrect",this,{position:this});if(t.is("$text"))throw new a("model-position-path-incorrect",this,{position:this});return t}get index(){return this.parent.offsetToIndex(this.offset)}get textNode(){return ga(this,this.parent)}get nodeAfter(){const t=this.parent;return fa(this,t,ga(this,t))}get nodeBefore(){const t=this.parent;return pa(this,t,ga(this,t))}get isAtStart(){return 0===this.offset}get isAtEnd(){return this.offset==this.parent.maxOffset}compareWith(t){if(this.root!=t.root)return"different";const e=xn(this.path,t.path);switch(e){case"same":return"same";case"prefix":return"before";case"extension":return"after";default:return this.path[e]<t.path[e]?"before":"after"}}getLastMatchingPosition(t,e={}){e.startPosition=this;const i=new ha(e);return i.skip(t),i.position}getParentPath(){return this.path.slice(0,-1)}getAncestors(){const t=this.parent;return t.is("documentFragment")?[t]:t.getAncestors({includeSelf:!0})}findAncestor(t){const e=this.parent;return e.is("element")?e.findAncestor(t,{includeSelf:!0}):null}getCommonPath(t){if(this.root!=t.root)return[];const e=xn(this.path,t.path),i="string"==typeof e?Math.min(this.path.length,t.path.length):e;return this.path.slice(0,i)}getCommonAncestor(t){const e=this.getAncestors(),i=t.getAncestors();let n=0;for(;e[n]==i[n]&&e[n];)n++;return 0===n?null:e[n-1]}getShiftedBy(t){const e=this.clone(),i=e.offset+t;return e.offset=i<0?0:i,e}isAfter(t){return"after"==this.compareWith(t)}isBefore(t){return"before"==this.compareWith(t)}isEqual(t){return"same"==this.compareWith(t)}isTouching(t){let e=null,i=null;switch(this.compareWith(t)){case"same":return!0;case"before":e=ma._createAt(this),i=ma._createAt(t);break;case"after":e=ma._createAt(t),i=ma._createAt(this);break;default:return!1}let n=e.parent;for(;e.path.length+i.path.length;){if(e.isEqual(i))return!0;if(e.path.length>i.path.length){if(e.offset!==n.maxOffset)return!1;e.path=e.path.slice(0,-1),n=n.parent,e.offset++}else{if(0!==i.offset)return!1;i.path=i.path.slice(0,-1)}}}is(t){return"position"===t||"model:position"===t}hasSameParentAs(t){if(this.root!==t.root)return!1;return"same"==xn(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=ma._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let i;return e.containsPosition(this)||e.start.isEqual(this)?(i=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(i=i._getTransformedByDeletion(t.deletionPosition,1))):i=this.isEqual(t.deletionPosition)?ma._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),i}_getTransformedByDeletion(t,e){const i=ma._createAt(this);if(this.root!=t.root)return i;if("same"==xn(t.getParentPath(),this.getParentPath())){if(t.offset<this.offset){if(t.offset+e>this.offset)return null;i.offset-=e}}else if("prefix"==xn(t.getParentPath(),this.getParentPath())){const n=t.path.length-1;if(t.offset<=this.path[n]){if(t.offset+e>this.path[n])return null;i.path[n]-=e}}return i}_getTransformedByInsertion(t,e){const i=ma._createAt(this);if(this.root!=t.root)return i;if("same"==xn(t.getParentPath(),this.getParentPath()))(t.offset<this.offset||t.offset==this.offset&&"toPrevious"!=this.stickiness)&&(i.offset+=e);else if("prefix"==xn(t.getParentPath(),this.getParentPath())){const n=t.path.length-1;t.offset<=this.path[n]&&(i.path[n]+=e)}return i}_getTransformedByMove(t,e,i){if(e=e._getTransformedByDeletion(t,i),t.isEqual(e))return ma._createAt(this);const n=this._getTransformedByDeletion(t,i);return null===n||t.isEqual(this)&&"toNext"==this.stickiness||t.getShiftedBy(i).isEqual(this)&&"toPrevious"==this.stickiness?this._getCombined(t,e):n._getTransformedByInsertion(e,i)}_getCombined(t,e){const i=t.path.length-1,n=ma._createAt(e);return n.stickiness=this.stickiness,n.offset=n.offset+this.path[i]-t.offset,n.path=[...n.path,...this.path.slice(i+1)],n}toJSON(){return{root:this.root.toJSON(),path:Array.from(this.path),stickiness:this.stickiness}}clone(){return new this.constructor(this.root,this.path,this.stickiness)}static _createAt(t,e,i="toNone"){if(t instanceof ma)return new ma(t.root,t.path,t.stickiness);{const n=t;if("end"==e)e=n.maxOffset;else{if("before"==e)return this._createBefore(n,i);if("after"==e)return this._createAfter(n,i);if(0!==e&&!e)throw new a("model-createpositionat-offset-required",[this,t])}if(!n.is("element")&&!n.is("documentFragment"))throw new a("model-position-parent-incorrect",[this,t]);const o=n.getPath();return o.push(e),new this(n.root,o,i)}}static _createAfter(t,e){if(!t.parent)throw new a("model-position-after-root",[this,t],{root:t});return this._createAt(t.parent,t.endOffset,e)}static _createBefore(t,e){if(!t.parent)throw new a("model-position-before-root",t,{root:t});return this._createAt(t.parent,t.startOffset,e)}static fromJSON(t,e){if("$graveyard"===t.root){const i=new ma(e.graveyard,t.path);return i.stickiness=t.stickiness,i}if(!e.getRoot(t.root))throw new a("model-position-fromjson-no-root",e,{rootName:t.root});return new ma(e.getRoot(t.root),t.path,t.stickiness)}}function ga(t,e){const i=e.getChild(e.offsetToIndex(t.offset));return i&&i.is("$text")&&i.startOffset<t.offset?i:null}function fa(t,e,i){return null!==i?null:e.getChild(e.offsetToIndex(t.offset))}function pa(t,e,i){return null!==i?null:e.getChild(e.offsetToIndex(t.offset)-1)}class wa{constructor(t,e=null){this.start=ma._createAt(t),this.end=e?ma._createAt(e):ma._createAt(t),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new ha({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return"same"==xn(this.start.getParentPath(),this.end.getParentPath())}get root(){return this.start.root}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,e=!1){t.isCollapsed&&(e=!1);const i=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),n=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return i&&n}containsItem(t){const e=ma._createBefore(t);return this.containsPosition(e)||this.start.isEqual(e)}is(t){return"range"===t||"model:range"===t}isEqual(t){return this.start.isEqual(t.start)&&this.end.isEqual(t.end)}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}getDifference(t){const e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new wa(this.start,t.start)),this.containsPosition(t.end)&&e.push(new wa(t.end,this.end))):e.push(new wa(this.start,this.end)),e}getIntersection(t){if(this.isIntersecting(t)){let e=this.start,i=this.end;return this.containsPosition(t.start)&&(e=t.start),this.containsPosition(t.end)&&(i=t.end),new wa(e,i)}return null}getJoined(t,e=!1){let i=this.isIntersecting(t);if(i||(i=this.start.isBefore(t.start)?e?this.end.isTouching(t.start):this.end.isEqual(t.start):e?t.end.isTouching(this.start):t.end.isEqual(this.start)),!i)return null;let n=this.start,o=this.end;return t.start.isBefore(n)&&(n=t.start),t.end.isAfter(o)&&(o=t.end),new wa(n,o)}getMinimalFlatRanges(){const t=[],e=this.start.getCommonPath(this.end).length,i=ma._createAt(this.start);let n=i.parent;for(;i.path.length>e+1;){const e=n.maxOffset-i.offset;0!==e&&t.push(new wa(i,i.getShiftedBy(e))),i.path=i.path.slice(0,-1),i.offset++,n=n.parent}for(;i.path.length<=this.end.path.length;){const e=this.end.path[i.path.length-1],n=e-i.offset;0!==n&&t.push(new wa(i,i.getShiftedBy(n))),i.offset=e,i.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new ha(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new ha(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new ha(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new wa(this.start,this.end)]}getTransformedByOperations(t){const e=[new wa(this.start,this.end)];for(const i of t)for(let t=0;t<e.length;t++){const n=e[t].getTransformedByOperation(i);e.splice(t,1,...n),t+=n.length-1}for(let t=0;t<e.length;t++){const i=e[t];for(let n=t+1;n<e.length;n++){const t=e[n];(i.containsRange(t)||t.containsRange(i)||i.isEqual(t))&&e.splice(n,1)}}return e}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;const t=this.start.nodeAfter,e=this.end.nodeBefore;return t&&t.is("element")&&t===e?t:null}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}clone(){return new this.constructor(this.start,this.end)}_getTransformedByInsertOperation(t,e=!1){return this._getTransformedByInsertion(t.position,t.howMany,e)}_getTransformedByMoveOperation(t,e=!1){const i=t.sourcePosition,n=t.howMany,o=t.targetPosition;return this._getTransformedByMove(i,o,n,e)}_getTransformedBySplitOperation(t){const e=this.start._getTransformedBySplitOperation(t);let i=this.end._getTransformedBySplitOperation(t);return this.end.isEqual(t.insertionPosition)&&(i=this.end.getShiftedBy(1)),e.root!=i.root&&(i=this.end.getShiftedBy(-1)),new wa(e,i)}_getTransformedByMergeOperation(t){if(this.start.isEqual(t.targetPosition)&&this.end.isEqual(t.deletionPosition))return new wa(this.start);let e=this.start._getTransformedByMergeOperation(t),i=this.end._getTransformedByMergeOperation(t);return e.root!=i.root&&(i=this.end.getShiftedBy(-1)),e.isAfter(i)?(t.sourcePosition.isBefore(t.targetPosition)?(e=ma._createAt(i),e.offset=0):(t.deletionPosition.isEqual(e)||(i=t.deletionPosition),e=t.targetPosition),new wa(e,i)):new wa(e,i)}_getTransformedByInsertion(t,e,i=!1){if(i&&this.containsPosition(t))return[new wa(this.start,t),new wa(t.getShiftedBy(e),this.end._getTransformedByInsertion(t,e))];{const i=new wa(this.start,this.end);return i.start=i.start._getTransformedByInsertion(t,e),i.end=i.end._getTransformedByInsertion(t,e),[i]}}_getTransformedByMove(t,e,i,n=!1){if(this.isCollapsed){const n=this.start._getTransformedByMove(t,e,i);return[new wa(n)]}const o=wa._createFromPositionAndShift(t,i),r=e._getTransformedByDeletion(t,i);if(this.containsPosition(e)&&!n&&(o.containsPosition(this.start)||o.containsPosition(this.end))){const n=this.start._getTransformedByMove(t,e,i),o=this.end._getTransformedByMove(t,e,i);return[new wa(n,o)]}let s;const a=this.getDifference(o);let l=null;const c=this.getIntersection(o);if(1==a.length?l=new wa(a[0].start._getTransformedByDeletion(t,i),a[0].end._getTransformedByDeletion(t,i)):2==a.length&&(l=new wa(this.start,this.end._getTransformedByDeletion(t,i))),s=l?l._getTransformedByInsertion(r,i,null!==c||n):[],c){const t=new wa(c.start._getCombined(o.start,r),c.end._getCombined(o.start,r));2==s.length?s.splice(1,0,t):s.push(t)}return s}_getTransformedByDeletion(t,e){let i=this.start._getTransformedByDeletion(t,e),n=this.end._getTransformedByDeletion(t,e);return null==i&&null==n?null:(null==i&&(i=t),null==n&&(n=t),new wa(i,n))}static _createFromPositionAndShift(t,e){const i=t,n=t.getShiftedBy(e);return e>0?new this(i,n):new this(n,i)}static _createIn(t){return new this(ma._createAt(t,0),ma._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(ma._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new a("range-create-from-ranges-empty-array",null);if(1==t.length)return t[0].clone();const e=t[0];t.sort((t,e)=>t.start.isAfter(e.start)?1:-1);const i=t.indexOf(e),n=new this(e.start,e.end);if(i>0)for(let e=i-1;t[e].end.isEqual(n.start);e++)n.start=ma._createAt(t[e].start);for(let e=i+1;e<t.length&&t[e].start.isEqual(n.end);e++)n.end=ma._createAt(t[e].end);return n}static fromJSON(t,e){return new this(ma.fromJSON(t.start,e),ma.fromJSON(t.end,e))}}class ba{constructor(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._viewToModelLengthCallbacks=new Map,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this.on("modelToViewPosition",(t,e)=>{if(e.viewPosition)return;const i=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this.findPositionIn(i,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;const i=this.findMappedViewAncestor(e.viewPosition),n=this._viewToModelMapping.get(i),o=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,i);e.modelPosition=ma._createAt(n,o)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);if(this._viewToModelMapping.delete(t),this._elementToMarkerNames.has(t))for(const e of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(e);this._modelToViewMapping.get(e)==t&&this._modelToViewMapping.delete(e)}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const i=this._markerNameToElements.get(e)||new Set;i.add(t);const n=this._elementToMarkerNames.get(t)||new Set;n.add(e),this._markerNameToElements.set(e,i),this._elementToMarkerNames.set(t,n)}unbindElementFromMarkerName(t,e){const i=this._markerNameToElements.get(e);i&&(i.delete(t),0==i.size&&this._markerNameToElements.delete(e));const n=this._elementToMarkerNames.get(t);n&&(n.delete(e),0==n.size&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new wa(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new Ao(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={isPhantom:!1}){const i={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const i=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())i.add(e);else i.add(t);return i}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,i){if(i!=t){return this._toModelOffset(t.parent,t.index,i)+this._toModelOffset(t,e,t)}if(t.is("$text"))return e;let n=0;for(let i=0;i<e;i++)n+=this.getModelLength(t.getChild(i));return n}getModelLength(t){if(this._viewToModelLengthCallbacks.get(t.name)){return this._viewToModelLengthCallbacks.get(t.name)(t)}if(this._viewToModelMapping.has(t))return 1;if(t.is("$text"))return t.data.length;if(t.is("uiElement"))return 0;{let e=0;for(const i of t.getChildren())e+=this.getModelLength(i);return e}}findPositionIn(t,e){let i,n=0,o=0,r=0;if(t.is("$text"))return new xo(t,e);for(;o<e;)i=t.getChild(r),n=this.getModelLength(i),o+=n,r++;return o==e?this._moveViewPositionToTextNode(new xo(t,r)):this.findPositionIn(i,e-(o-n))}_moveViewPositionToTextNode(t){const e=t.nodeBefore,i=t.nodeAfter;return e instanceof Tn?new xo(e,e.data.length):i instanceof Tn?new xo(i,0):t}}se(ba,g);class ka{constructor(){this._consumable=new Map,this._textProxyRegistry=new Map}add(t,e){e=_a(e),t instanceof la&&(t=this._getSymbolForTextProxy(t)),this._consumable.has(t)||this._consumable.set(t,new Map),this._consumable.get(t).set(e,!0)}consume(t,e){return e=_a(e),t instanceof la&&(t=this._getSymbolForTextProxy(t)),!!this.test(t,e)&&(this._consumable.get(t).set(e,!1),!0)}test(t,e){e=_a(e),t instanceof la&&(t=this._getSymbolForTextProxy(t));const i=this._consumable.get(t);if(void 0===i)return null;const n=i.get(e);return void 0===n?null:n}revert(t,e){e=_a(e),t instanceof la&&(t=this._getSymbolForTextProxy(t));const i=this.test(t,e);return!1===i?(this._consumable.get(t).set(e,!0),!0):!0!==i&&null}_getSymbolForTextProxy(t){let e=null;const i=this._textProxyRegistry.get(t.startOffset);if(i){const n=i.get(t.endOffset);n&&(e=n.get(t.parent))}return e||(e=this._addSymbolForTextProxy(t.startOffset,t.endOffset,t.parent)),e}_addSymbolForTextProxy(t,e,i){const n=Symbol("textProxySymbol");let o,r;return o=this._textProxyRegistry.get(t),o||(o=new Map,this._textProxyRegistry.set(t,o)),r=o.get(e),r||(r=new Map,o.set(e,r)),r.set(i,n),n}}function _a(t){const e=t.split(":");return e.length>1?e[0]+":"+e[1]:e[0]}class va{constructor(t){this.conversionApi=Object.assign({dispatcher:this},t),this._reconversionEventsMapping=new Map}convertChanges(t,e,i){for(const e of t.getMarkersToRemove())this.convertMarkerRemove(e.name,e.range,i);const n=this._mapChangesWithAutomaticReconversion(t);for(const t of n)"insert"===t.type?this.convertInsert(wa._createFromPositionAndShift(t.position,t.length),i):"remove"===t.type?this.convertRemove(t.position,t.length,t.name,i):"reconvert"===t.type?this.reconvertElement(t.element,i):this.convertAttribute(t.range,t.attributeKey,t.attributeOldValue,t.attributeNewValue,i);for(const t of this.conversionApi.mapper.flushUnboundMarkerNames()){const n=e.get(t).getRange();this.convertMarkerRemove(t,n,i),this.convertMarkerAdd(t,n,i)}for(const e of t.getMarkersToAdd())this.convertMarkerAdd(e.name,e.range,i)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of Array.from(t).map(xa))this._convertInsertWithAttributes(e);this._clearConversionApi()}convertRemove(t,e,i,n){this.conversionApi.writer=n,this.fire("remove:"+i,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,i,n,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(t,"attribute:"+e);for(const o of t){const t={item:o.item,range:wa._createFromPositionAndShift(o.previousPosition,o.length),attributeKey:e,attributeOldValue:i,attributeNewValue:n};this._testAndFire("attribute:"+e,t)}this._clearConversionApi()}reconvertElement(t,e){const i=wa._createOn(t);this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(i);const n=this.conversionApi.mapper,o=n.toViewElement(t);e.remove(o),this._convertInsertWithAttributes({item:t,range:i});const r=n.toViewElement(t);for(const i of wa._createIn(t)){const{item:t}=i,o=Aa(t,n);o?o.root!==r.root&&e.move(e.createRangeOn(o),n.toViewPosition(ma._createBefore(t))):this._convertInsertWithAttributes(xa(i))}n.unbindViewElement(o),this._clearConversionApi()}convertSelection(t,e,i){const n=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=i,this.conversionApi.consumable=this._createSelectionConsumable(t,n),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of n){const i=e.getRange();if(!ya(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const n={item:t,markerName:e.name,markerRange:i};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,n,this.conversionApi)}for(const e of t.getAttributeKeys()){const i={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+i.attributeKey)&&this.fire("attribute:"+i.attributeKey+":$text",i,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(t,e,i){if("$graveyard"==e.root.rootName)return;this.conversionApi.writer=i;const n="addMarker:"+t,o=new ka;if(o.add(e,n),this.conversionApi.consumable=o,this.fire(n,{markerName:t,markerRange:e},this.conversionApi),o.test(e,n)){this.conversionApi.consumable=this._createConsumableForRange(e,n);for(const i of e.getItems()){if(!this.conversionApi.consumable.test(i,n))continue;const o={item:i,range:wa._createOn(i),markerName:t,markerRange:e};this.fire(n,o,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(t,e,i){"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=i,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_mapReconversionTriggerEvent(t,e){this._reconversionEventsMapping.set(e,t)}_createInsertConsumable(t){const e=new ka;for(const i of t){const t=i.item;e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}return e}_createConsumableForRange(t,e){const i=new ka;for(const n of t.getItems())i.add(n,e);return i}_createSelectionConsumable(t,e){const i=new ka;i.add(t,"selection");for(const n of e)i.add(t,"addMarker:"+n.name);for(const e of t.getAttributeKeys())i.add(t,"attribute:"+e);return i}_testAndFire(t,e){this.conversionApi.consumable.test(e.item,t)&&this.fire(function(t,e){const i=e.item.name||"$text";return`${t}:${i}`}(t,e),e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}_convertInsertWithAttributes(t){this._testAndFire("insert",t);for(const e of t.item.getAttributeKeys())t.attributeKey=e,t.attributeOldValue=null,t.attributeNewValue=t.item.getAttribute(e),this._testAndFire("attribute:"+e,t)}_mapChangesWithAutomaticReconversion(t){const e=new Set,i=[];for(const n of t.getChanges()){const t=n.position||n.range.start,o=t.parent;if(ga(t,o)){i.push(n);continue}const r="attribute"===n.type?fa(t,o,null):o;if(r.is("$text")){i.push(n);continue}let s;if(s="attribute"===n.type?`attribute:${n.attributeKey}:${r.name}`:`${n.type}:${n.name}`,this._isReconvertTriggerEvent(s,r.name)){if(e.has(r))continue;e.add(r),i.push({type:"reconvert",element:r})}else i.push(n)}return i}_isReconvertTriggerEvent(t,e){return this._reconversionEventsMapping.get(t)===e}}function ya(t,e,i){const n=e.getRange(),o=Array.from(t.getAncestors());o.shift(),o.reverse();return!o.some(t=>{if(n.containsItem(t)){return!!i.toViewElement(t).getCustomProperty("addHighlight")}})}function xa(t){return{item:t.item,range:wa._createFromPositionAndShift(t.previousPosition,t.length)}}function Aa(t,e){if(t.is("textProxy")){const i=e.toViewPosition(ma._createBefore(t)).parent;return i.is("$text")?i:null}return e.toViewElement(t)}se(va,g);class Ca{constructor(t,e,i){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,i)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const n of t._ranges)if(e.isEqual(n)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new wa(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new wa(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new wa(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(t,e,i){if(null===t)this._setRanges([]);else if(t instanceof Ca)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof wa)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof ma)this._setRanges([new wa(t)]);else if(t instanceof sa){const n=!!i&&!!i.backward;let o;if("in"==e)o=wa._createIn(t);else if("on"==e)o=wa._createOn(t);else{if(void 0===e)throw new a("model-selection-setto-required-second-parameter",[this,t]);o=new wa(ma._createAt(t,e))}this._setRanges([o],n)}else{if(!mn(t))throw new a("model-selection-setto-not-selectable",[this,t]);this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const i=(t=Array.from(t)).some(e=>{if(!(e instanceof wa))throw new a("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every(t=>!t.isEqual(e))});if(t.length!==this._ranges.length||i){this._removeAllRanges();for(const e of t)this._pushRange(e);this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0})}}setFocus(t,e){if(null===this.anchor)throw new a("model-selection-setfocus-no-ranges",[this,t]);const i=ma._createAt(t,e);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(n)?(this._pushRange(new wa(i,n)),this._lastRangeBackward=!0):(this._pushRange(new wa(n,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(t){return"selection"===t||"model:selection"===t}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const i=Sa(e.start,t);i&&Pa(i,e)&&(yield i);for(const i of e.getWalker()){const n=i.item;"elementEnd"==i.type&&Ea(n,t,e)&&(yield n)}const n=Sa(e.end,t);n&&!e.end.isTouching(ma._createAt(n,0))&&Pa(n,e)&&(yield n)}}containsEntireContent(t=this.anchor.root){const e=ma._createAt(t,0),i=ma._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new wa(t.start,t.end))}_checkRange(t){for(let e=0;e<this._ranges.length;e++)if(t.isIntersecting(this._ranges[e]))throw new a("model-selection-range-intersects",[this,t],{addedRange:t,intersectingRange:this._ranges[e]})}_removeAllRanges(){for(;this._ranges.length>0;)this._popRange()}_popRange(){this._ranges.pop()}}function Ta(t,e){return!e.has(t)&&(e.add(t),t.root.document.model.schema.isBlock(t)&&t.parent)}function Ea(t,e,i){return Ta(t,e)&&Pa(t,i)}function Sa(t,e){const i=t.parent.root.document.model.schema,n=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let o=!1;const r=n.find(t=>!o&&(o=i.isLimit(t),!o&&Ta(t,e)));return n.forEach(t=>e.add(t)),r}function Pa(t,e){const i=function(t){const e=t.root.document.model.schema;let i=t.parent;for(;i;){if(e.isBlock(i))return i;i=i.parent}}(t);if(!i)return!0;return!e.containsRange(wa._createOn(i),!0)}se(Ca,g);class Ma extends wa{constructor(t,e){super(t,e),Ia.call(this)}detach(){this.stopListening()}is(t){return"liveRange"===t||"model:liveRange"===t||"range"==t||"model:range"===t}toRange(){return new wa(this.start,this.end)}static fromRange(t){return new Ma(t.start,t.end)}}function Ia(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&La.call(this,i)},{priority:"low"})}function La(t){const e=this.getTransformedByOperation(t),i=wa._createFromRanges(e),n=!i.isEqual(this),o=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let r=null;if(n){"$graveyard"==i.root.rootName&&(r="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",e,{deletionPosition:r})}else o&&this.fire("change:content",this.toRange(),{deletionPosition:r})}se(Ma,g);class Na{constructor(t){this._selection=new Ra(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(t){this._selection.observeMarkers(t)}is(t){return"selection"===t||"model:selection"==t||"documentSelection"==t||"model:documentSelection"==t}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return"selection:"+t}static _isStoreAttributeKey(t){return t.startsWith("selection:")}}se(Na,g);class Ra extends Ca{constructor(t){super(),this.markers=new gn({idProperty:"name"}),this._model=t.model,this._document=t,this._attributePriority=new Map,this._selectionRestorePosition=null,this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this._observedMarkers=new Set,this.listenTo(this._model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type&&(0==this._ranges.length&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new a("document-selection-wrong-position",this,{range:t})}),this.listenTo(this._model.markers,"update",(t,e,i,n)=>{this._updateMarker(e,n)}),this.listenTo(this._document,"change",(t,e)=>{!function(t,e){const i=t.document.differ;for(const n of i.getChanges()){if("insert"!=n.type)continue;const i=n.position.parent;n.length===i.maxOffset&&t.enqueueChange(e,t=>{const e=Array.from(i.getAttributeKeys()).filter(t=>t.startsWith("selection:"));for(const n of e)t.removeAttribute(n,i)})}}(this._model,e)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t<this._ranges.length;t++)this._ranges[t].detach();this.stopListening()}*getRanges(){this._ranges.length?yield*super.getRanges():yield this._document._getDefaultRange()}getFirstRange(){return super.getFirstRange()||this._document._getDefaultRange()}getLastRange(){return super.getLastRange()||this._document._getDefaultRange()}setTo(t,e,i){super.setTo(t,e,i),this._updateAttributes(!0),this._updateMarkers()}setFocus(t,e){super.setFocus(t,e),this._updateAttributes(!0),this._updateMarkers()}setAttribute(t,e){if(this._setAttribute(t,e)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}removeAttribute(t){if(this._removeAttribute(t)){const e=[t];this.fire("change:attribute",{attributeKeys:e,directChange:!0})}}overrideGravity(){const t=r();return this._overriddenGravityRegister.add(t),1===this._overriddenGravityRegister.size&&this._updateAttributes(!0),t}restoreGravity(t){if(!this._overriddenGravityRegister.has(t))throw new a("document-selection-gravity-wrong-restore",this,{uid:t});this._overriddenGravityRegister.delete(t),this.isGravityOverridden||this._updateAttributes(!0)}observeMarkers(t){this._observedMarkers.add(t),this._updateMarkers()}_popRange(){this._ranges.pop().detach()}_pushRange(t){const e=this._prepareRange(t);e&&this._ranges.push(e)}_prepareRange(t){if(this._checkRange(t),t.root==this._document.graveyard)return;const e=Ma.fromRange(t);return e.on("change:range",(t,i,n)=>{if(this._hasChangedRange=!0,e.root==this._document.graveyard){this._selectionRestorePosition=n.deletionPosition;const t=this._ranges.indexOf(e);this._ranges.splice(t,1),e.detach()}}),e}_updateMarkers(){if(!this._observedMarkers.size)return;const t=[];let e=!1;for(const e of this._model.markers){const i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))continue;const n=e.getRange();for(const i of this.getRanges())n.containsRange(i,!i.isCollapsed)&&t.push(e)}const i=Array.from(this.markers);for(const i of t)this.markers.has(i)||(this.markers.add(i),e=!0);for(const i of Array.from(this.markers))t.includes(i)||(this.markers.remove(i),e=!0);e&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(t,e){const i=t.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let n=!1;const o=Array.from(this.markers),r=this.markers.has(t);if(e){let i=!1;for(const t of this.getRanges())if(e.containsRange(t,!t.isCollapsed)){i=!0;break}i&&!r?(this.markers.add(t),n=!0):!i&&r&&(this.markers.remove(t),n=!0)}else r&&(this.markers.remove(t),n=!0);n&&this.fire("change:marker",{oldMarkers:o,directChange:!1})}_updateAttributes(t){const e=Sn(this._getSurroundingAttributes()),i=Sn(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[t,e]of this._attributePriority)"low"==e&&(this._attrs.delete(t),this._attributePriority.delete(t));this._setAttributesTo(e);const n=[];for(const[t,e]of this.getAttributes())i.has(t)&&i.get(t)===e||n.push(t);for(const[t]of i)this.hasAttribute(t)||n.push(t);n.length>0&&this.fire("change:attribute",{attributeKeys:n,directChange:!1})}_setAttribute(t,e,i=!0){const n=i?"normal":"low";if("low"==n&&"normal"==this._attributePriority.get(t))return!1;return super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,n),!0)}_removeAttribute(t,e=!0){const i=e?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,i),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[e,i]of this.getAttributes())t.get(e)!==i&&this._removeAttribute(e,!1);for(const[i,n]of t){this._setAttribute(i,n,!1)&&e.add(i)}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith("selection:")){const i=e.substr("selection:".length);yield[i,t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let i=null;if(this.isCollapsed){const n=t.textNode?t.textNode:t.nodeBefore,o=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(i=Oa(n)),i||(i=Oa(o)),!this.isGravityOverridden&&!i){let t=n;for(;t&&!e.isInline(t)&&!i;)t=t.previousSibling,i=Oa(t)}if(!i){let t=o;for(;t&&!e.isInline(t)&&!i;)t=t.nextSibling,i=Oa(t)}i||(i=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const n of t){if(n.item.is("element")&&e.isObject(n.item))break;if("text"==n.type){i=n.item.getAttributes();break}}}return i}_fixGraveyardSelection(t){const e=this._model.schema.getNearestSelectionRange(t);e&&this._pushRange(e)}}function Oa(t){return t instanceof la||t instanceof aa?t.getAttributes():null}class za{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}const Da=function(t){return an(t,5)};class Va extends za{elementToElement(t){return this.add(function(t){return(t=Da(t)).view=Fa(t.view,"container"),e=>{var i;if(e.on("insert:"+t.model,(i=t.view,(t,e,n)=>{const o=i(e.item,n);if(!o)return;if(!n.consumable.consume(e.item,"insert"))return;const r=n.mapper.toViewPosition(e.range.start);n.mapper.bindElements(e.item,o),n.writer.insert(r,o)}),{priority:t.converterPriority||"normal"}),t.triggerBy){if(t.triggerBy.attributes)for(const i of t.triggerBy.attributes)e._mapReconversionTriggerEvent(t.model,`attribute:${i}:${t.model}`);if(t.triggerBy.children)for(const i of t.triggerBy.children)e._mapReconversionTriggerEvent(t.model,"insert:"+i),e._mapReconversionTriggerEvent(t.model,"remove:"+i)}}}(t))}attributeToElement(t){return this.add(function(t){t=Da(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=Fa(t.view[e],"attribute");else t.view=Fa(t.view,"attribute");const i=Ha(t);return n=>{n.on(e,function(t){return(e,i,n)=>{const o=t(i.attributeOldValue,n),r=t(i.attributeNewValue,n);if(!o&&!r)return;if(!n.consumable.consume(i.item,e.name))return;const s=n.writer,a=s.document.selection;if(i.item instanceof Ca||i.item instanceof Na)s.wrap(a.getFirstRange(),r);else{let t=n.mapper.toViewRange(i.range);null!==i.attributeOldValue&&o&&(t=s.unwrap(t,o)),null!==i.attributeNewValue&&r&&s.wrap(t,r)}}}(i),{priority:t.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=Da(t);let e="attribute:"+(t.model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=Ua(t.view[e]);else t.view=Ua(t.view);const i=Ha(t);return n=>{var o;n.on(e,(o=i,(t,e,i)=>{const n=o(e.attributeOldValue,i),r=o(e.attributeNewValue,i);if(!n&&!r)return;if(!i.consumable.consume(e.item,t.name))return;const s=i.mapper.toViewElement(e.item),l=i.writer;if(!s)throw new a("conversion-attribute-to-attribute-on-text",[e,i]);if(null!==e.attributeOldValue&&n)if("class"==n.key){const t=pn(n.value);for(const e of t)l.removeClass(e,s)}else if("style"==n.key){const t=Object.keys(n.value);for(const e of t)l.removeStyle(e,s)}else l.removeAttribute(n.key,s);if(null!==e.attributeNewValue&&r)if("class"==r.key){const t=pn(r.value);for(const e of t)l.addClass(e,s)}else if("style"==r.key){const t=Object.keys(r.value);for(const e of t)l.setStyle(e,r.value[e],s)}else l.setAttribute(r.key,r.value,s)}),{priority:t.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(t){return(t=Da(t)).view=Fa(t.view,"ui"),e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,n)=>{e.isOpening=!0;const o=i(e,n);e.isOpening=!1;const r=i(e,n);if(!o||!r)return;const s=e.markerRange;if(s.isCollapsed&&!n.consumable.consume(s,t.name))return;for(const e of s)if(!n.consumable.consume(e.item,t.name))return;const a=n.mapper,l=n.writer;l.insert(a.toViewPosition(s.start),o),n.mapper.bindElementToMarker(o,e.markerName),s.isCollapsed||(l.insert(a.toViewPosition(s.end),r),n.mapper.bindElementToMarker(r,e.markerName)),t.stop()}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(t.view,(t,e,i)=>{const n=i.mapper.markerNameToElements(e.markerName);if(n){for(const t of n)i.mapper.unbindElementFromMarkerName(t,e.markerName),i.writer.clear(i.writer.createRangeOn(t),t);i.writer.clearClonedElementsGroup(e.markerName),t.stop()}}),{priority:t.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(t){return e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,n)=>{if(!e.item)return;if(!(e.item instanceof Ca||e.item instanceof Na||e.item.is("$textProxy")))return;const o=qa(i,e,n);if(!o)return;if(!n.consumable.consume(e.item,t.name))return;const r=n.writer,s=ja(r,o),a=r.document.selection;if(e.item instanceof Ca||e.item instanceof Na)r.wrap(a.getFirstRange(),s,a);else{const t=n.mapper.toViewRange(e.range),i=r.wrap(t,s);for(const t of i.getItems())if(t.is("attributeElement")&&t.isSimilar(s)){n.mapper.bindElementToMarker(t,e.markerName);break}}}),{priority:t.converterPriority||"normal"}),e.on("addMarker:"+t.model,function(t){return(e,i,n)=>{if(!i.item)return;if(!(i.item instanceof da))return;const o=qa(t,i,n);if(!o)return;if(!n.consumable.test(i.item,e.name))return;const r=n.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){n.consumable.consume(i.item,e.name);for(const t of wa._createIn(i.item))n.consumable.consume(t.item,e.name);r.getCustomProperty("addHighlight")(r,o,n.writer),n.mapper.bindElementToMarker(r,i.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,function(t){return(e,i,n)=>{if(i.markerRange.isCollapsed)return;const o=qa(t,i,n);if(!o)return;const r=ja(n.writer,o),s=n.mapper.markerNameToElements(i.markerName);if(s){for(const t of s)n.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("attributeElement")?n.writer.unwrap(n.writer.createRangeOn(t),r):t.getCustomProperty("removeHighlight")(t,o.id,n.writer);n.writer.clearClonedElementsGroup(i.markerName),e.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}markerToData(t){return this.add(function(t){const e=(t=Da(t)).model;t.view||(t.view=i=>({group:e,name:i.substr(t.model.length+1)}));return i=>{var n;i.on("addMarker:"+e,(n=t.view,(t,e,i)=>{const o=n(e.markerName,i);if(!o)return;const r=e.markerRange;i.consumable.consume(r,t.name)&&(Ba(r,!1,i,e,o),Ba(r,!0,i,e,o),t.stop())}),{priority:t.converterPriority||"normal"}),i.on("removeMarker:"+e,function(t){return(e,i,n)=>{const o=t(i.markerName,n);if(!o)return;const r=n.mapper.markerNameToElements(i.markerName);if(r){for(const t of r)n.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("containerElement")?(s(`data-${o.group}-start-before`,t),s(`data-${o.group}-start-after`,t),s(`data-${o.group}-end-before`,t),s(`data-${o.group}-end-after`,t)):n.writer.clear(n.writer.createRangeOn(t),t);n.writer.clearClonedElementsGroup(i.markerName),e.stop()}function s(t,e){if(e.hasAttribute(t)){const i=new Set(e.getAttribute(t).split(","));i.delete(o.name),0==i.size?n.writer.removeAttribute(t,e):n.writer.setAttribute(t,Array.from(i).join(","),e)}}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}}function ja(t,e){const i=t.createAttributeElement("span",e.attributes);return e.classes&&i._addClass(e.classes),"number"==typeof e.priority&&(i._priority=e.priority),i._id=e.id,i}function Ba(t,e,i,n,o){const r=e?t.start:t.end,s=r.nodeAfter&&r.nodeAfter.is("element")?r.nodeAfter:null,a=r.nodeBefore&&r.nodeBefore.is("element")?r.nodeBefore:null;if(s||a){let t,r;e&&s||!e&&!a?(t=s,r=!0):(t=a,r=!1);const l=i.mapper.toViewElement(t);if(l)return void function(t,e,i,n,o,r){const s=`data-${r.group}-${e?"start":"end"}-${i?"before":"after"}`,a=t.hasAttribute(s)?t.getAttribute(s).split(","):[];a.unshift(r.name),n.writer.setAttribute(s,a.join(","),t),n.mapper.bindElementToMarker(t,o.markerName)}(l,e,r,i,n,o)}!function(t,e,i,n,o){const r=`${o.group}-${e?"start":"end"}`,s=o.name?{name:o.name}:null,a=i.writer.createUIElement(r,s);i.writer.insert(t,a),i.mapper.bindElementToMarker(a,n.markerName)}(i.mapper.toViewPosition(r),e,i,n,o)}function Fa(t,e){return"function"==typeof t?t:(i,n)=>function(t,e,i){"string"==typeof t&&(t={name:t});let n;const o=e.writer,r=Object.assign({},t.attributes);if("container"==i)n=o.createContainerElement(t.name,r);else if("attribute"==i){const e={priority:t.priority||Do.DEFAULT_PRIORITY};n=o.createAttributeElement(t.name,r,e)}else n=o.createUIElement(t.name,r);if(t.styles){const e=Object.keys(t.styles);for(const i of e)o.setStyle(i,t.styles[i],n)}if(t.classes){const e=t.classes;if("string"==typeof e)o.addClass(e,n);else for(const t of e)o.addClass(t,n)}return n}(t,n,e)}function Ha(t){return t.model.values?(e,i)=>{const n=t.view[e];return n?n(e,i):null}:t.view}function Ua(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function qa(t,e,i){const n="function"==typeof t?t(e,i):t;return n?(n.priority||(n.priority=10),n.id||(n.id=e.markerName),n):null}function Wa(t){const{schema:e,document:i}=t.model;for(const n of i.getRootNames()){const o=i.getRoot(n);if(o.isEmpty&&!e.checkChild(o,"$text")&&e.checkChild(o,"paragraph"))return t.insertElement("paragraph",o),!0}return!1}function $a(t,e,i){const n=i.createContext(t);return!!i.checkChild(n,"paragraph")&&!!i.checkChild(n.push("paragraph"),e)}function Ga(t,e){const i=e.createElement("paragraph");return e.insert(i,t),e.createPositionAt(i,0)}class Ya extends za{elementToElement(t){return this.add(Ka(t))}elementToAttribute(t){return this.add(function(t){Za(t=Da(t));const e=Xa(t,!1),i=Qa(t.view),n=i?"element:"+i:"element";return i=>{i.on(n,e,{priority:t.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=Da(t);let e=null;("string"==typeof t.view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let i;if("class"==e||"style"==e){i={["class"==e?"classes":"styles"]:t.view.value}}else{const n=void 0===t.view.value?/[\s\S]*/:t.view.value;i={attributes:{[e]:n}}}t.view.name&&(i.name=t.view.name);return t.view=i,e}(t));Za(t,e);const i=Xa(t,!0);return e=>{e.on("element",i,{priority:t.converterPriority||"low"})}}(t))}elementToMarker(t){return l("upcast-helpers-element-to-marker-deprecated"),this.add(function(t){return function(t){const e=t.model;t.model=(t,i)=>{const n="string"==typeof e?e:e(t,i);return i.writer.createElement("$marker",{"data-name":n})}}(t=Da(t)),Ka(t)}(t))}dataToMarker(t){return this.add(function(t){(t=Da(t)).model||(t.model=e=>e?t.view+":"+e:t.view);const e=Ja(tl(t,"start")),i=Ja(tl(t,"end"));return n=>{n.on("element:"+t.view+"-start",e,{priority:t.converterPriority||"normal"}),n.on("element:"+t.view+"-end",i,{priority:t.converterPriority||"normal"});const o=s.get("low"),r=s.get("highest"),a=s.get(t.converterPriority)/r;n.on("element",function(t){return(e,i,n)=>{const o="data-"+t.view;function r(e,o){for(const r of o){const o=t.model(r,n),s=n.writer.createElement("$marker",{"data-name":o});n.writer.insert(s,e),i.modelCursor.isEqual(e)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(e,1),i.modelRange=i.modelRange._getTransformedByInsertion(e,1)[0]}}(n.consumable.test(i.viewItem,{attributes:o+"-end-after"})||n.consumable.test(i.viewItem,{attributes:o+"-start-after"})||n.consumable.test(i.viewItem,{attributes:o+"-end-before"})||n.consumable.test(i.viewItem,{attributes:o+"-start-before"}))&&(i.modelRange||Object.assign(i,n.convertChildren(i.viewItem,i.modelCursor)),n.consumable.consume(i.viewItem,{attributes:o+"-end-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(o+"-end-after").split(",")),n.consumable.consume(i.viewItem,{attributes:o+"-start-after"})&&r(i.modelRange.end,i.viewItem.getAttribute(o+"-start-after").split(",")),n.consumable.consume(i.viewItem,{attributes:o+"-end-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(o+"-end-before").split(",")),n.consumable.consume(i.viewItem,{attributes:o+"-start-before"})&&r(i.modelRange.start,i.viewItem.getAttribute(o+"-start-before").split(",")))}}(t),{priority:o+a})}}(t))}}function Ka(t){const e=Ja(t=Da(t)),i=Qa(t.view),n=i?"element:"+i:"element";return i=>{i.on(n,e,{priority:t.converterPriority||"normal"})}}function Qa(t){return"string"==typeof t?t:"object"==typeof t&&"string"==typeof t.name?t.name:null}function Ja(t){const e=new Pn(t.view);return(i,n,o)=>{const r=e.match(n.viewItem);if(!r)return;const s=r.match;if(s.name=!0,!o.consumable.test(n.viewItem,s))return;const a=function(t,e,i){return t instanceof Function?t(e,i):i.writer.createElement(t)}(t.model,n.viewItem,o);a&&o.safeInsert(a,n.modelCursor)&&(o.consumable.consume(n.viewItem,s),o.convertChildren(n.viewItem,a),o.updateConversionResult(a,n))}}function Za(t,e=null){const i=null===e||(t=>t.getAttribute(e)),n="object"!=typeof t.model?t.model:t.model.key,o="object"!=typeof t.model||void 0===t.model.value?i:t.model.value;t.model={key:n,value:o}}function Xa(t,e){const i=new Pn(t.view);return(n,o,r)=>{const s=i.match(o.viewItem);if(!s)return;if(!function(t,e){const i="function"==typeof t?t(e):t;if("object"==typeof i&&!Qa(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(t.view,o.viewItem)?delete s.match.name:s.match.name=!0,!r.consumable.test(o.viewItem,s.match))return;const a=t.model.key,l="function"==typeof t.model.value?t.model.value(o.viewItem,r):t.model.value;if(null===l)return;o.modelRange||Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor));(function(t,e,i,n){let o=!1;for(const r of Array.from(t.getItems({shallow:i})))n.schema.checkAttribute(r,e.key)&&(o=!0,r.hasAttribute(e.key)||n.writer.setAttribute(e.key,e.value,r));return o})(o.modelRange,{key:a,value:l},e,r)&&r.consumable.consume(o.viewItem,s.match)}}function tl(t,e){const i={};return i.view=t.view+"-"+e,i.model=(e,i)=>{const n=e.getAttribute("name"),o=t.model(n,i);return i.writer.createElement("$marker",{"data-name":o})},i}class el{constructor(t,e){this.model=t,this.view=new ra(e),this.mapper=new ba,this.downcastDispatcher=new va({mapper:this.mapper,schema:t.schema});const i=this.model.document,n=i.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(i,"change",()=>{this.view.change(t=>{this.downcastDispatcher.convertChanges(i.differ,o,t),this.downcastDispatcher.convertSelection(n,o,t)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(i,n)=>{const o=n.newSelection,r=[];for(const t of o.getRanges())r.push(e.toModelRange(t));const s=t.createSelection(r,{backward:o.isBackward});s.isEqual(t.document.selection)||t.change(t=>{t.setSelection(s)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const n=i.writer,o=i.mapper.toViewPosition(e.range.start),r=n.createText(e.item.data);n.insert(o,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(t,e,i)=>{const n=i.mapper.toViewPosition(e.position),o=e.position.getShiftedBy(e.length),r=i.mapper.toViewPosition(o,{isPhantom:!0}),s=i.writer.createRange(n,r),a=i.writer.remove(s.getTrimmed());for(const t of i.writer.createRangeIn(a).getItems())i.mapper.unbindViewElement(t)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const n=i.writer,o=n.document.selection;for(const t of o.getRanges())t.isCollapsed&&t.end.parent.isAttached()&&i.writer.mergeAttributes(t.start);n.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const n=e.selection;if(n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const o=[];for(const t of n.getRanges()){const e=i.mapper.toViewRange(t);o.push(e)}i.writer.setSelection(o,{backward:n.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const n=e.selection;if(!n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const o=i.writer,r=n.getFirstPosition(),s=i.mapper.toViewPosition(r),a=o.breakAttributes(s);o.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(t=>{if("$graveyard"==t.rootName)return null;const e=new vo(this.view.document,t.name);return e.rootName=t.rootName,this.mapper.bindElements(t,e),e})}destroy(){this.view.destroy(),this.stopListening()}}se(el,te);class il{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const i=this.get(t);if(!i)throw new a("commandcollection-command-not-found",this,{commandName:t});return i.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}}class nl{constructor(){this._consumables=new Map}add(t,e){let i;t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?i=this._consumables.get(t):(i=new ol(t),this._consumables.set(t,i)),i.add(e))}test(t,e){const i=this._consumables.get(t);return void 0===i?null:t.is("$text")||t.is("documentFragment")?i:i.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const i=this._consumables.get(t);void 0!==i&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):i.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},i=t.getAttributeKeys();for(const t of i)"style"!=t&&"class"!=t&&e.attributes.push(t);const n=t.getClassNames();for(const t of n)e.classes.push(t);const o=t.getStyleNames();for(const t of o)e.styles.push(t);return e}static createFrom(t,e){if(e||(e=new nl(t)),t.is("$text"))return e.add(t),e;t.is("element")&&e.add(t,nl.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const i of t.getChildren())e=nl.createFrom(i,e);return e}}class ol{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e in this._consumables)if(e in t){const i=this._test(e,t[e]);if(!0!==i)return i}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e in this._consumables)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._revert(e,t[e])}_add(t,e){const i=At(e)?e:[e],n=this._consumables[t];for(const e of i){if("attributes"===t&&("class"===e||"style"===e))throw new a("viewconsumable-invalid-attribute",this);if(n.set(e,!0),"styles"===t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))n.set(t,!0)}}_test(t,e){const i=At(e)?e:[e],n=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){const t=n.get(e);if(void 0===t)return null;if(!t)return!1}else{const t="class"==e?"classes":"styles",i=this._test(t,[...this._consumables[t].keys()]);if(!0!==i)return i}return!0}_consume(t,e){const i=At(e)?e:[e],n=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){if(n.set(e,!1),"styles"==t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))n.set(t,!1)}else{const t="class"==e?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const i=At(e)?e:[e],n=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){!1===n.get(e)&&n.set(e,!0)}else{const t="class"==e?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}}class rl{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new sl(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new sl(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new a("schema-cannot-register-item-twice",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new a("schema-cannot-extend-missing-item",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:t.is&&(t.is("$text")||t.is("$textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!!e&&!!(e.isObject||e.isLimit&&e.isSelectable&&e.isContent)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}isSelectable(t){const e=this.getDefinition(t);return!!e&&!(!e.isSelectable&&!e.isObject)}isContent(t){const e=this.getDefinition(t);return!!e&&!(!e.isContent&&!e.isObject)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const i=this.getDefinition(t.last);return!!i&&i.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof ma){const e=t.nodeBefore,i=t.nodeAfter;if(!(e instanceof da))throw new a("schema-check-merge-no-element-before",this);if(!(i instanceof da))throw new a("schema-check-merge-no-element-after",this);return this.checkMerge(e,i)}for(const i of e.getChildren())if(!this.checkChild(t,i))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[i,n])=>{if(!n)return;const o=t(i,n);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[i,n])=>{const o=t(i,n);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;if(t instanceof ma)e=t.parent;else{e=(t instanceof wa?[t]:Array.from(t.getRanges())).reduce((t,e)=>{const i=e.getCommonAncestor();return t?t.getCommonAncestor(i,{includeSelf:!0}):i},null)}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const i=[...t.getFirstPosition().getAncestors(),new aa("",t.getAttributes())];return this.checkAttribute(i,e)}{const i=t.getRanges();for(const t of i)for(const i of t)if(this.checkAttribute(i.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const i of t)yield*this._getValidRangesForRange(i,e)}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new wa(t);let i,n;const o=t.getAncestors().reverse().find(t=>this.isLimit(t))||t.root;"both"!=e&&"backward"!=e||(i=new ha({boundaries:wa._createIn(o),startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(n=new ha({boundaries:wa._createIn(o),startPosition:t}));for(const t of function*(t,e){let i=!1;for(;!i;){if(i=!0,t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}}}(i,n)){const e=t.walker==i?"elementEnd":"elementStart",n=t.value;if(n.type==e&&this.isObject(n.item))return wa._createOn(n.item);if(this.checkChild(n.nextPosition,"$text"))return new wa(n.nextPosition)}return null}findAllowedParent(t,e){let i=t.parent;for(;i;){if(this.checkChild(i,e))return i;if(this.isLimit(i))return null;i=i.parent}return null}removeDisallowedAttributes(t,e){for(const i of t)if(i.is("$text"))kl(this,i,e);else{const t=wa._createIn(i).getPositions();for(const i of t){kl(this,i.nodeBefore||i.parent,e)}}}createContext(t){return new sl(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,i=Object.keys(e);for(const n of i)t[n]=al(e[n],n);for(const e of i)ll(t,e);for(const e of i)cl(t,e);for(const e of i)dl(t,e);for(const e of i)hl(t,e),ul(t,e);for(const e of i)ml(t,e),gl(t,e),fl(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,i=e.length-1){const n=e.getItem(i);if(t.allowIn.includes(n.name)){if(0==i)return!0;{const t=this.getDefinition(n);return this._checkContextMatch(t,e,i-1)}}return!1}*_getValidRangesForRange(t,e){let i=t.start,n=t.start;for(const o of t.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(wa._createIn(o),e)),this.checkAttribute(o,e)||(i.isEqual(n)||(yield new wa(i,n)),i=ma._createAfter(o)),n=ma._createAfter(o);i.isEqual(n)||(yield new wa(i,n))}}se(rl,te);class sl{constructor(t){if(t instanceof sl)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),this._items=t.map(bl)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new sl([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function al(t,e){const i={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],allowChildren:[],inheritTypesFrom:[]};return function(t,e){for(const i of t){const t=Object.keys(i).filter(t=>t.startsWith("is"));for(const n of t)e[n]=i[n]}}(t,i),pl(t,i,"allowIn"),pl(t,i,"allowContentOf"),pl(t,i,"allowWhere"),pl(t,i,"allowAttributes"),pl(t,i,"allowAttributesOf"),pl(t,i,"allowChildren"),pl(t,i,"inheritTypesFrom"),function(t,e){for(const i of t){const t=i.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,i),i}function ll(t,e){const i=t[e];for(const n of i.allowChildren){const i=t[n];i&&i.allowIn.push(e)}i.allowChildren.length=0}function cl(t,e){for(const i of t[e].allowContentOf)if(t[i]){wl(t,i).forEach(t=>{t.allowIn.push(e)})}delete t[e].allowContentOf}function dl(t,e){for(const i of t[e].allowWhere){const n=t[i];if(n){const i=n.allowIn;t[e].allowIn.push(...i)}}delete t[e].allowWhere}function hl(t,e){for(const i of t[e].allowAttributesOf){const n=t[i];if(n){const i=n.allowAttributes;t[e].allowAttributes.push(...i)}}delete t[e].allowAttributesOf}function ul(t,e){const i=t[e];for(const e of i.inheritTypesFrom){const n=t[e];if(n){const t=Object.keys(n).filter(t=>t.startsWith("is"));for(const e of t)e in i||(i[e]=n[e])}}delete i.inheritTypesFrom}function ml(t,e){const i=t[e],n=i.allowIn.filter(e=>t[e]);i.allowIn=Array.from(new Set(n))}function gl(t,e){const i=t[e];for(const n of i.allowIn){t[n].allowChildren.push(e)}}function fl(t,e){const i=t[e];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function pl(t,e,i){for(const n of t)"string"==typeof n[i]?e[i].push(n[i]):Array.isArray(n[i])&&e[i].push(...n[i])}function wl(t,e){const i=t[e];return(n=t,Object.keys(n).map(t=>n[t])).filter(t=>t.allowIn.includes(i.name));var n}function bl(t){return"string"==typeof t||t.is("documentFragment")?{name:"string"==typeof t?t:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}function kl(t,e,i){for(const n of e.getAttributeKeys())t.checkAttribute(e,n)||i.removeAttribute(n,e)}class _l{constructor(t={}){this._splitParts=new Map,this._cursorParents=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.safeInsert=this._safeInsert.bind(this),this.conversionApi.updateConversionResult=this._updateConversionResult.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(t,e,i=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let i;for(const n of new sl(t)){const t={};for(const e of n.getAttributeKeys())t[e]=n.getAttribute(e);const o=e.createElement(n.name,t);i&&e.append(o,i),i=ma._createAt(o,0)}return i}(i,e),this.conversionApi.writer=e,this.conversionApi.consumable=nl.createFrom(t),this.conversionApi.store={};const{modelRange:n}=this._convertItem(t,this._modelCursor),o=e.createDocumentFragment();if(n){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,o);o.markers=function(t,e){const i=new Set,n=new Map,o=wa._createIn(t).getItems();for(const t of o)"$marker"==t.name&&i.add(t);for(const t of i){const i=t.getAttribute("data-name"),o=e.createPositionBefore(t);n.has(i)?n.get(i).end=o.clone():n.set(i,new wa(o.clone())),e.remove(t)}return n}(o,e)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(t,e){const i=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,i,this.conversionApi):t.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof wa))throw new a("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(t,e){let i=e.is("position")?e:ma._createAt(e,0);const n=new wa(i);for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,i);t.modelRange instanceof wa&&(n.end=t.modelRange.end,i=t.modelCursor)}return{modelRange:n,modelCursor:i}}_safeInsert(t,e){const i=this._splitToAllowedParent(t,e);return!!i&&(this.conversionApi.writer.insert(t,i.position),!0)}_updateConversionResult(t,e){const i=this._getSplitParts(t),n=this.conversionApi.writer;e.modelRange||(e.modelRange=n.createRange(n.createPositionBefore(t),n.createPositionAfter(i[i.length-1])));const o=this._cursorParents.get(t);e.modelCursor=o?n.createPositionAt(o,0):e.modelRange.end}_splitToAllowedParent(t,e){const{schema:i,writer:n}=this.conversionApi;let o=i.findAllowedParent(e,t);if(o){if(o===e.parent)return{position:e};this._modelCursor.parent.getAncestors().includes(o)&&(o=null)}if(!o)return $a(e,t,i)?{position:Ga(e,n)}:null;const r=this.conversionApi.writer.split(e,o),s=[];for(const t of r.range.getWalker())if("elementEnd"==t.type)s.push(t.item);else{const e=s.pop(),i=t.item;this._registerSplitPair(e,i)}const a=r.range.end.parent;return this._cursorParents.set(t,a),{position:r.position,cursorParent:a}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const i=this._splitParts.get(t);this._splitParts.set(e,i),i.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}se(_l,g);class vl{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}}class yl{constructor(t){this._domParser=new DOMParser,this._domConverter=new Fr(t,{blockFillerMode:"nbsp"}),this._htmlWriter=new vl}toData(t){const e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this._domConverter.domToView(e)}registerRawContentMatcher(t){this._domConverter.registerRawContentMatcher(t)}useFillerType(t){this._domConverter.blockFillerMode="marked"==t?"markedNbsp":"nbsp"}_toDom(t){const e=this._domParser.parseFromString(t,"text/html"),i=e.createDocumentFragment(),n=e.body.childNodes;for(;n.length>0;)i.appendChild(n[0]);return i}}class xl{constructor(t,e){this.model=t,this.mapper=new ba,this.downcastDispatcher=new va({mapper:this.mapper,schema:t.schema}),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const n=i.writer,o=i.mapper.toViewPosition(e.range.start),r=n.createText(e.item.data);n.insert(o,r)},{priority:"lowest"}),this.upcastDispatcher=new _l({schema:t.schema}),this.viewDocument=new zo(e),this.stylesProcessor=e,this.htmlProcessor=new yl(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new rr(this.viewDocument),this.upcastDispatcher.on("text",(t,e,{schema:i,consumable:n,writer:o})=>{let r=e.modelCursor;if(!n.test(e.viewItem))return;if(!i.checkChild(r,"$text")){if(!$a(r,"$text",i))return;r=Ga(r,o)}n.consume(e.viewItem);const s=o.createText(e.viewItem.data);o.insert(s,r),e.modelRange=o.createRange(r,r.getShiftedBy(s.offsetSize)),e.modelCursor=e.modelRange.end},{priority:"lowest"}),this.upcastDispatcher.on("element",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:n}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=n}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:n}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=n}},{priority:"lowest"}),this.decorate("init"),this.decorate("set"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange("transparent",Wa)},{priority:"lowest"})}get(t={}){const{rootName:e="main",trim:i="empty"}=t;if(!this._checkIfRootsExists([e]))throw new a("datacontroller-get-non-existent-root",this);const n=this.model.document.getRoot(e);return"empty"!==i||this.model.hasContent(n,{ignoreWhitespaces:!0})?this.stringify(n,t):""}stringify(t,e={}){const i=this.toView(t,e);return this.processor.toData(i)}toView(t,e={}){const i=this.viewDocument,n=this._viewWriter;this.mapper.clearBindings();const o=wa._createIn(t),r=new or(i);this.mapper.bindElements(t,r),this.downcastDispatcher.conversionApi.options=e,this.downcastDispatcher.convertInsert(o,n);const s=t.is("documentFragment")?Array.from(t.markers):function(t){const e=[],i=t.root.document;if(!i)return[];const n=wa._createIn(t);for(const t of i.model.markers){const i=n.getIntersection(t.getRange());i&&e.push([t.name,i])}return e}(t);for(const[t,e]of s)this.downcastDispatcher.convertMarkerAdd(t,e,n);return delete this.downcastDispatcher.conversionApi.options,r}init(t){if(this.model.document.version)throw new a("datacontroller-init-document-not-empty",this);let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new a("datacontroller-init-non-existent-root",this);return this.model.enqueueChange("transparent",t=>{for(const i of Object.keys(e)){const n=this.model.document.getRoot(i);t.insert(this.parse(e[i],n),n,0)}}),Promise.resolve()}set(t){let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new a("datacontroller-set-non-existent-root",this);this.model.enqueueChange("transparent",t=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const i of Object.keys(e)){const n=this.model.document.getRoot(i);t.remove(t.createRangeIn(n)),t.insert(this.parse(e[i],n),n,0)}})}parse(t,e="$root"){const i=this.processor.toView(t);return this.toModel(i,e)}toModel(t,e="$root"){return this.model.change(i=>this.upcastDispatcher.convert(t,i,e))}addStyleProcessorRules(t){t(this.stylesProcessor)}registerRawContentMatcher(t){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(t),this.htmlProcessor.registerRawContentMatcher(t)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRootNames().includes(e))return!1;return!0}}se(xl,te);class Al{constructor(t,e){this._helpers=new Map,this._downcast=pn(t),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=pn(e),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const i=this._downcast.includes(e);if(!this._upcast.includes(e)&&!i)throw new a("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:i})}for(t){if(!this._helpers.has(t))throw new a("conversion-for-unknown-group",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:i}of Cl(t))this.for("upcast").elementToElement({model:e,view:i,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:i}of Cl(t))this.for("upcast").elementToAttribute({view:i,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:i}of Cl(t))this.for("upcast").attributeToAttribute({view:i,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:i}){if(this._helpers.has(t))throw new a("conversion-group-exists",this);const n=i?new Va(e):new Ya(e);this._helpers.set(t,n)}}function*Cl(t){if(t.model.values)for(const e of t.model.values){const i={key:t.model.key,value:e},n=t.view[e],o=t.upcastAlso?t.upcastAlso[e]:void 0;yield*Tl(i,n,o)}else yield*Tl(t.model,t.view,t.upcastAlso)}function*Tl(t,e,i){if(yield{model:t,view:e},i)for(const e of pn(i))yield{model:t,view:e}}class El{constructor(t="default"){this.operations=[],this.type=t}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}}class Sl{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}}class Pl{constructor(t){this.markers=new Map,this._children=new ca,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"model:documentFragment"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const i of t)i.name?e.push(da.fromJSON(i)):e.push(aa.fromJSON(i));return new Pl(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new aa(t)];mn(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new aa(t):t instanceof la?new aa(t.data,t.getAttributes()):t)}(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}}function Ml(t,e){const i=(e=Nl(e)).reduce((t,e)=>t+e.offsetSize,0),n=t.parent;Ol(t);const o=t.index;return n._insertChild(o,e),Rl(n,o+e.length),Rl(n,o),new wa(t,t.getShiftedBy(i))}function Il(t){if(!t.isFlat)throw new a("operation-utils-remove-range-not-flat",this);const e=t.start.parent;Ol(t.start),Ol(t.end);const i=e._removeChildren(t.start.index,t.end.index-t.start.index);return Rl(e,t.start.index),i}function Ll(t,e){if(!t.isFlat)throw new a("operation-utils-move-range-not-flat",this);const i=Il(t);return Ml(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),i)}function Nl(t){const e=[];t instanceof Array||(t=[t]);for(let i=0;i<t.length;i++)if("string"==typeof t[i])e.push(new aa(t[i]));else if(t[i]instanceof la)e.push(new aa(t[i].data,t[i].getAttributes()));else if(t[i]instanceof Pl||t[i]instanceof ca)for(const n of t[i])e.push(n);else t[i]instanceof sa&&e.push(t[i]);for(let t=1;t<e.length;t++){const i=e[t],n=e[t-1];i instanceof aa&&n instanceof aa&&zl(i,n)&&(e.splice(t-1,2,new aa(n.data+i.data,n.getAttributes())),t--)}return e}function Rl(t,e){const i=t.getChild(e-1),n=t.getChild(e);if(i&&n&&i.is("$text")&&n.is("$text")&&zl(i,n)){const o=new aa(i.data+n.data,i.getAttributes());t._removeChildren(e-1,2),t._insertChild(e-1,o)}}function Ol(t){const e=t.textNode,i=t.parent;if(e){const n=t.offset-e.startOffset,o=e.index;i._removeChildren(o,1);const r=new aa(e.data.substr(0,n),e.getAttributes()),s=new aa(e.data.substr(n),e.getAttributes());i._insertChild(o,[r,s])}}function zl(t,e){const i=t.getAttributes(),n=e.getAttributes();for(const t of i){if(t[1]!==e.getAttribute(t[0]))return!1;n.next()}return n.next().done}const Dl=function(t,e){return us(t,e)};class Vl extends Sl{constructor(t,e,i,n,o){super(o),this.range=t.clone(),this.key=e,this.oldValue=void 0===i?null:i,this.newValue=void 0===n?null:n}get type(){return null===this.oldValue?"addAttribute":null===this.newValue?"removeAttribute":"changeAttribute"}clone(){return new Vl(this.range,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Vl(this.range,this.key,this.newValue,this.oldValue,this.baseVersion+1)}toJSON(){const t=super.toJSON();return t.range=this.range.toJSON(),t}_validate(){if(!this.range.isFlat)throw new a("attribute-operation-range-not-flat",this);for(const t of this.range.getItems({shallow:!0})){if(null!==this.oldValue&&!Dl(t.getAttribute(this.key),this.oldValue))throw new a("attribute-operation-wrong-old-value",this,{item:t,key:this.key,value:this.oldValue});if(null===this.oldValue&&null!==this.newValue&&t.hasAttribute(this.key))throw new a("attribute-operation-attribute-exists",this,{node:t,key:this.key})}}_execute(){Dl(this.oldValue,this.newValue)||function(t,e,i){Ol(t.start),Ol(t.end);for(const n of t.getItems({shallow:!0})){const t=n.is("$textProxy")?n.textNode:n;null!==i?t._setAttribute(e,i):t._removeAttribute(e),Rl(t.parent,t.index)}Rl(t.end.parent,t.end.index)}(this.range,this.key,this.newValue)}static get className(){return"AttributeOperation"}static fromJSON(t,e){return new Vl(wa.fromJSON(t.range,e),t.key,t.oldValue,t.newValue,t.baseVersion)}}class jl extends Sl{constructor(t,e){super(null),this.sourcePosition=t.clone(),this.howMany=e}get type(){return"detach"}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t}_validate(){if(this.sourcePosition.root.document)throw new a("detach-operation-on-document-node",this)}_execute(){Il(wa._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}}class Bl extends Sl{constructor(t,e,i,n){super(n),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toNext",this.howMany=e,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNone"}get type(){return"$graveyard"==this.targetPosition.root.rootName?"remove":"$graveyard"==this.sourcePosition.root.rootName?"reinsert":"move"}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.baseVersion)}getMovedRangeStart(){return this.targetPosition._getTransformedByDeletion(this.sourcePosition,this.howMany)}getReversed(){const t=this.sourcePosition._getTransformedByInsertion(this.targetPosition,this.howMany);return new this.constructor(this.getMovedRangeStart(),this.howMany,t,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent,i=this.sourcePosition.offset,n=this.targetPosition.offset;if(i+this.howMany>t.maxOffset)throw new a("move-operation-nodes-do-not-exist",this);if(t===e&&i<n&&n<i+this.howMany)throw new a("move-operation-range-into-itself",this);if(this.sourcePosition.root==this.targetPosition.root&&"prefix"==xn(this.sourcePosition.getParentPath(),this.targetPosition.getParentPath())){const t=this.sourcePosition.path.length-1;if(this.targetPosition.path[t]>=i&&this.targetPosition.path[t]<i+this.howMany)throw new a("move-operation-node-into-itself",this)}}_execute(){Ll(wa._createFromPositionAndShift(this.sourcePosition,this.howMany),this.targetPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=this.sourcePosition.toJSON(),t.targetPosition=this.targetPosition.toJSON(),t}static get className(){return"MoveOperation"}static fromJSON(t,e){const i=ma.fromJSON(t.sourcePosition,e),n=ma.fromJSON(t.targetPosition,e);return new this(i,t.howMany,n,t.baseVersion)}}class Fl extends Sl{constructor(t,e,i){super(i),this.position=t.clone(),this.position.stickiness="toNone",this.nodes=new ca(Nl(e)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}clone(){const t=new ca([...this.nodes].map(t=>t._clone(!0))),e=new Fl(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new ma(t,[0]);return new Bl(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffset<this.position.offset)throw new a("insert-operation-position-invalid",this)}_execute(){const t=this.nodes;this.nodes=new ca([...t].map(t=>t._clone(!0))),Ml(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const i=[];for(const e of t.nodes)e.name?i.push(da.fromJSON(e)):i.push(aa.fromJSON(e));const n=new Fl(ma.fromJSON(t.position,e),i,t.baseVersion);return n.shouldReceiveAttributes=t.shouldReceiveAttributes,n}}class Hl extends Sl{constructor(t,e,i,n,o,r){super(r),this.name=t,this.oldRange=e?e.clone():null,this.newRange=i?i.clone():null,this.affectsData=o,this._markers=n}get type(){return"marker"}clone(){return new Hl(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Hl(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const t=this.newRange?"_set":"_remove";this._markers[t](this.name,this.newRange,!0,this.affectsData)}toJSON(){const t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new Hl(t.name,t.oldRange?wa.fromJSON(t.oldRange,e):null,t.newRange?wa.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}}class Ul extends Sl{constructor(t,e,i,n){super(n),this.position=t,this.position.stickiness="toNext",this.oldName=e,this.newName=i}get type(){return"rename"}clone(){return new Ul(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Ul(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof da))throw new a("rename-operation-wrong-position",this);if(t.name!==this.oldName)throw new a("rename-operation-wrong-name",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new Ul(ma.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}}class ql extends Sl{constructor(t,e,i,n,o){super(o),this.root=t,this.key=e,this.oldValue=i,this.newValue=n}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new ql(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new ql(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new a("rootattribute-operation-not-a-root",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new a("rootattribute-operation-wrong-old-value",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new a("rootattribute-operation-attribute-exists",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new a("rootattribute-operation-fromjson-no-root",this,{rootName:t.root});return new ql(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}}class Wl extends Sl{constructor(t,e,i,n,o){super(o),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=e,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=n.clone()}get type(){return"merge"}get deletionPosition(){return new ma(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new wa(this.sourcePosition,t)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),i=new ma(this.sourcePosition.root,e)._getTransformedByMergeOperation(this);return new $l(t,this.howMany,i,this.graveyardPosition,this.baseVersion+1)}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!t.parent)throw new a("merge-operation-source-position-invalid",this);if(!e.parent)throw new a("merge-operation-target-position-invalid",this);if(this.howMany!=t.maxOffset)throw new a("merge-operation-how-many-invalid",this)}_execute(){const t=this.sourcePosition.parent;Ll(wa._createIn(t),this.targetPosition),Ll(wa._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const i=ma.fromJSON(t.sourcePosition,e),n=ma.fromJSON(t.targetPosition,e),o=ma.fromJSON(t.graveyardPosition,e);return new this(i,t.howMany,n,o,t.baseVersion)}}class $l extends Sl{constructor(t,e,i,n,o){super(o),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=i,this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new ma(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new wa(this.splitPosition,t)}clone(){return new this.constructor(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new ma(t,[0]);return new Wl(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset<e)throw new a("split-operation-position-invalid",this);if(!t.parent)throw new a("split-operation-split-in-root",this);if(this.howMany!=t.maxOffset-this.splitPosition.offset)throw new a("split-operation-how-many-invalid",this);if(this.graveyardPosition&&!this.graveyardPosition.nodeAfter)throw new a("split-operation-graveyard-position-invalid",this)}_execute(){const t=this.splitPosition.parent;if(this.graveyardPosition)Ll(wa._createFromPositionAndShift(this.graveyardPosition,1),this.insertionPosition);else{const e=t._clone();Ml(this.insertionPosition,e)}Ll(new wa(ma._createAt(t,this.splitPosition.offset),ma._createAt(t,t.maxOffset)),this.moveTargetPosition)}toJSON(){const t=super.toJSON();return t.splitPosition=this.splitPosition.toJSON(),t.insertionPosition=this.insertionPosition.toJSON(),this.graveyardPosition&&(t.graveyardPosition=this.graveyardPosition.toJSON()),t}static get className(){return"SplitOperation"}static getInsertionPosition(t){const e=t.path.slice(0,-1);return e[e.length-1]++,new ma(t.root,e,"toPrevious")}static fromJSON(t,e){const i=ma.fromJSON(t.splitPosition,e),n=ma.fromJSON(t.insertionPosition,e),o=t.graveyardPosition?ma.fromJSON(t.graveyardPosition,e):null;return new this(i,t.howMany,n,o,t.baseVersion)}}class Gl extends da{constructor(t,e,i="main"){super(e),this._document=t,this.rootName=i}get document(){return this._document}is(t,e){return e?e===this.name&&("rootElement"===t||"model:rootElement"===t||"element"===t||"model:element"===t):"rootElement"===t||"model:rootElement"===t||"element"===t||"model:element"===t||"node"===t||"model:node"===t}toJSON(){return this.rootName}}class Yl{constructor(t,e){this.model=t,this.batch=e}createText(t,e){return new aa(t,e)}createElement(t,e){return new da(t,e)}createDocumentFragment(){return new Pl}cloneElement(t,e=!0){return t._clone(e)}insert(t,e,i=0){if(this._assertWriterUsedCorrectly(),t instanceof aa&&""==t.data)return;const n=ma._createAt(e,i);if(t.parent){if(Xl(t.root,n.root))return void this.move(wa._createOn(t),n);if(t.root.document)throw new a("model-writer-insert-forbidden-move",this);this.remove(t)}const o=n.root.document?n.root.document.version:null,r=new Fl(n,t,o);if(t instanceof aa&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),t instanceof Pl)for(const[e,i]of t.markers){const t=ma._createAt(i.root,0),o={range:new wa(i.start._getCombined(t,n),i.end._getCombined(t,n)),usingOperation:!0,affectsData:!0};this.model.markers.has(e)?this.updateMarker(e,o):this.addMarker(e,o)}}insertText(t,e,i,n){e instanceof Pl||e instanceof da||e instanceof ma?this.insert(this.createText(t),e,i):this.insert(this.createText(t,e),i,n)}insertElement(t,e,i,n){e instanceof Pl||e instanceof da||e instanceof ma?this.insert(this.createElement(t),e,i):this.insert(this.createElement(t,e),i,n)}append(t,e){this.insert(t,e,"end")}appendText(t,e,i){e instanceof Pl||e instanceof da?this.insert(this.createText(t),e,"end"):this.insert(this.createText(t,e),i,"end")}appendElement(t,e,i){e instanceof Pl||e instanceof da?this.insert(this.createElement(t),e,"end"):this.insert(this.createElement(t,e),i,"end")}setAttribute(t,e,i){if(this._assertWriterUsedCorrectly(),i instanceof wa){const n=i.getMinimalFlatRanges();for(const i of n)Kl(this,t,e,i)}else Ql(this,t,e,i)}setAttributes(t,e){for(const[i,n]of Sn(t))this.setAttribute(i,n,e)}removeAttribute(t,e){if(this._assertWriterUsedCorrectly(),e instanceof wa){const i=e.getMinimalFlatRanges();for(const e of i)Kl(this,t,null,e)}else Ql(this,t,null,e)}clearAttributes(t){this._assertWriterUsedCorrectly();const e=t=>{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof wa)for(const i of t.getItems())e(i);else e(t)}move(t,e,i){if(this._assertWriterUsedCorrectly(),!(t instanceof wa))throw new a("writer-move-invalid-range",this);if(!t.isFlat)throw new a("writer-move-range-not-flat",this);const n=ma._createAt(e,i);if(n.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!Xl(t.root,n.root))throw new a("writer-move-different-document",this);const o=t.root.document?t.root.document.version:null,r=new Bl(t.start,t.end.offset-t.start.offset,n,o);this.batch.addOperation(r),this.model.applyOperation(r)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof wa?t:wa._createOn(t)).getMinimalFlatRanges().reverse();for(const t of e)this._addOperationForAffectedMarkers("move",t),Zl(t.start,t.end.offset-t.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,i=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof da))throw new a("writer-merge-no-element-before",this);if(!(i instanceof da))throw new a("writer-merge-no-element-after",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,i){return this.model.createPositionFromPath(t,e,i)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(t,e,i){return this.model.createSelection(t,e,i)}_mergeDetached(t){const e=t.nodeBefore,i=t.nodeAfter;this.move(wa._createIn(i),ma._createAt(e,"end")),this.remove(i)}_merge(t){const e=ma._createAt(t.nodeBefore,"end"),i=ma._createAt(t.nodeAfter,0),n=t.root.document.graveyard,o=new ma(n,[0]),r=t.root.document.version,s=new Wl(i,t.nodeAfter.maxOffset,e,o,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof da))throw new a("writer-rename-not-element-instance",this);const i=t.root.document?t.root.document.version:null,n=new Ul(ma._createBefore(t),t.name,e,i);this.batch.addOperation(n),this.model.applyOperation(n)}split(t,e){this._assertWriterUsedCorrectly();let i,n,o=t.parent;if(!o.parent)throw new a("writer-split-element-no-parent",this);if(e||(e=o.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new a("writer-split-invalid-limit-element",this);do{const e=o.root.document?o.root.document.version:null,r=o.maxOffset-t.offset,s=$l.getInsertionPosition(t),a=new $l(t,r,s,null,e);this.batch.addOperation(a),this.model.applyOperation(a),i||n||(i=o,n=t.parent.nextSibling),o=(t=this.createPositionAfter(t.parent)).parent}while(o!==e);return{position:t,range:new wa(ma._createAt(i,"end"),ma._createAt(n,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new a("writer-wrap-range-not-flat",this);const i=e instanceof da?e:new da(e);if(i.childCount>0)throw new a("writer-wrap-element-not-empty",this);if(null!==i.parent)throw new a("writer-wrap-element-attached",this);this.insert(i,t.start);const n=new wa(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(n,ma._createAt(i,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new a("writer-unwrap-element-no-parent",this);this.move(wa._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new a("writer-addmarker-no-usingoperation",this);const i=e.usingOperation,n=e.range,o=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new a("writer-addmarker-marker-exists",this);if(!n)throw new a("writer-addmarker-no-range",this);return i?(Jl(this,t,null,n,o),this.model.markers.get(t)):this.model.markers._set(t,n,i,o)}updateMarker(t,e){this._assertWriterUsedCorrectly();const i="string"==typeof t?t:t.name,n=this.model.markers.get(i);if(!n)throw new a("writer-updatemarker-marker-not-exists",this);if(!e)return void this.model.markers._refresh(n);const o="boolean"==typeof e.usingOperation,r="boolean"==typeof e.affectsData,s=r?e.affectsData:n.affectsData;if(!o&&!e.range&&!r)throw new a("writer-updatemarker-wrong-options",this);const l=n.getRange(),c=e.range?e.range:l;o&&e.usingOperation!==n.managedUsingOperations?e.usingOperation?Jl(this,i,null,c,s):(Jl(this,i,l,null,s),this.model.markers._set(i,c,void 0,s)):n.managedUsingOperations?Jl(this,i,l,c,s):this.model.markers._set(i,c,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new a("writer-removemarker-no-marker",this);const i=this.model.markers.get(e);if(!i.managedUsingOperations)return void this.model.markers._remove(e);Jl(this,e,i.getRange(),null,i.affectsData)}setSelection(t,e,i){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,i)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[e,i]of Sn(t))this._setSelectionAttribute(e,i)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const n=Na._getStoreAttributeKey(t);this.setAttribute(n,e,i.anchor.parent)}i._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const i=Na._getStoreAttributeKey(t);this.removeAttribute(i,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new a("writer-incorrect-use",this)}_addOperationForAffectedMarkers(t,e){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const n=i.getRange();let o=!1;if("move"===t)o=e.containsPosition(n.start)||e.start.isEqual(n.start)||e.containsPosition(n.end)||e.end.isEqual(n.end);else{const t=e.nodeBefore,i=e.nodeAfter,r=n.start.parent==t&&n.start.isAtEnd,s=n.end.parent==i&&0==n.end.offset,a=n.end.nodeAfter==i,l=n.start.nodeAfter==i;o=r||s||a||l}o&&this.updateMarker(i.name,{range:n})}}}function Kl(t,e,i,n){const o=t.model,r=o.document;let s,a,l,c=n.start;for(const t of n.getWalker({shallow:!0}))l=t.item.getAttribute(e),s&&a!=l&&(a!=i&&d(),c=s),s=t.nextPosition,a=l;function d(){const n=new wa(c,s),l=n.root.document?r.version:null,d=new Vl(n,e,a,i,l);t.batch.addOperation(d),o.applyOperation(d)}s instanceof ma&&s!=c&&a!=i&&d()}function Ql(t,e,i,n){const o=t.model,r=o.document,s=n.getAttribute(e);let a,l;if(s!=i){if(n.root===n){const t=n.document?r.version:null;l=new ql(n,e,s,i,t)}else{a=new wa(ma._createBefore(n),t.createPositionAfter(n));const o=a.root.document?r.version:null;l=new Vl(a,e,s,i,o)}t.batch.addOperation(l),o.applyOperation(l)}}function Jl(t,e,i,n,o){const r=t.model,s=r.document,a=new Hl(e,i,n,r.markers,o,s.version);t.batch.addOperation(a),r.applyOperation(a)}function Zl(t,e,i,n){let o;if(t.root.document){const i=n.document,r=new ma(i.graveyard,[0]);o=new Bl(t,e,r,i.version)}else o=new jl(t,e);i.addOperation(o),n.applyOperation(o)}function Xl(t,e){return t===e||t instanceof Gl&&e instanceof Gl}class tc{constructor(t){this._markerCollection=t,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize);const e=wa._createOn(t);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}this._cachedChanges=null}bufferOperation(t){switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=wa._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1);const n=t.targetPosition.parent;this._isInInsertedElement(n)||this._markInsert(n,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,i,n){const o=this._changedMarkers.get(t);o?(o.newRange=i,o.affectsData=n,null==o.oldRange&&null==o.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:i,affectsData:n})}getMarkersToRemove(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.oldRange&&t.push({name:e,range:i.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.newRange&&t.push({name:e,range:i.newRange});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(t=>({name:t[0],data:{oldRange:t[1].oldRange,newRange:t[1].newRange}}))}hasDataChanges(){for(const[,t]of this._changedMarkers)if(t.affectsData)return!0;return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:!1}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let e=[];for(const t of this._changesInElement.keys()){const i=this._changesInElement.get(t).sort((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offset<e.offset?-1:1),n=this._elementSnapshots.get(t),o=ec(t.getChildren()),r=ic(n.length,i);let s=0,a=0;for(const i of r)if("i"===i)e.push(this._getInsertDiff(t,s,o[s].name)),s++;else if("r"===i)e.push(this._getRemoveDiff(t,s,n[a].name)),a++;else if("a"===i){const i=o[s].attributes,r=n[a].attributes;let l;if("$text"==o[s].name)l=new wa(ma._createAt(t,s),ma._createAt(t,s+1));else{const e=t.offsetToIndex(s);l=new wa(ma._createAt(t,s),ma._createAt(t.getChild(e),0))}e.push(...this._getAttributesDiff(l,r,i)),s++,a++}else s++,a++}e.sort((t,e)=>t.position.root!=e.position.root?t.position.root.rootName<e.position.root.rootName?-1:1:t.position.isEqual(e.position)?t.changeCount-e.changeCount:t.position.isBefore(e.position)?-1:1);for(let t=1,i=0;t<e.length;t++){const n=e[i],o=e[t],r="remove"==n.type&&"remove"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.isEqual(o.position),s="insert"==n.type&&"insert"==o.type&&"$text"==n.name&&"$text"==o.name&&n.position.parent==o.position.parent&&n.position.offset+n.length==o.position.offset,a="attribute"==n.type&&"attribute"==o.type&&n.position.parent==o.position.parent&&n.range.isFlat&&o.range.isFlat&&n.position.offset+n.length==o.position.offset&&n.attributeKey==o.attributeKey&&n.attributeOldValue==o.attributeOldValue&&n.attributeNewValue==o.attributeNewValue;r||s||a?(n.length++,a&&(n.range.end=n.range.end.getShiftedBy(1)),e[t]=null):i=t}e=e.filter(t=>t);for(const t of e)delete t.changeCount,"attribute"==t.type&&(delete t.position,delete t.length);return this._changeCount=0,this._cachedChangesWithGraveyard=e.slice(),this._cachedChanges=e.filter(nc),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard:this._cachedChanges}reset(){this._changesInElement.clear(),this._elementSnapshots.clear(),this._changedMarkers.clear(),this._cachedChanges=null}_markInsert(t,e,i){const n={type:"insert",offset:e,howMany:i,count:this._changeCount++};this._markChange(t,n)}_markRemove(t,e,i){const n={type:"remove",offset:e,howMany:i,count:this._changeCount++};this._markChange(t,n),this._removeAllNestedChanges(t,e,i)}_markAttribute(t){const e={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,e)}_markChange(t,e){this._makeSnapshot(t);const i=this._getChangesForElement(t);this._handleChange(e,i),i.push(e);for(let t=0;t<i.length;t++)i[t].howMany<1&&(i.splice(t,1),t--)}_getChangesForElement(t){let e;return this._changesInElement.has(t)?e=this._changesInElement.get(t):(e=[],this._changesInElement.set(t,e)),e}_makeSnapshot(t){this._elementSnapshots.has(t)||this._elementSnapshots.set(t,ec(t.getChildren()))}_handleChange(t,e){t.nodesToHandle=t.howMany;for(const i of e){const n=t.offset+t.howMany,o=i.offset+i.howMany;if("insert"==t.type&&("insert"==i.type&&(t.offset<=i.offset?i.offset+=t.howMany:t.offset<o&&(i.howMany+=t.nodesToHandle,t.nodesToHandle=0)),"remove"==i.type&&t.offset<i.offset&&(i.offset+=t.howMany),"attribute"==i.type))if(t.offset<=i.offset)i.offset+=t.howMany;else if(t.offset<o){const o=i.howMany;i.howMany=t.offset-i.offset,e.unshift({type:"attribute",offset:n,howMany:o-i.howMany,count:this._changeCount++})}if("remove"==t.type){if("insert"==i.type)if(n<=i.offset)i.offset-=t.howMany;else if(n<=o)if(t.offset<i.offset){const e=n-i.offset;i.offset=t.offset,i.howMany-=e,t.nodesToHandle-=e}else i.howMany-=t.nodesToHandle,t.nodesToHandle=0;else if(t.offset<=i.offset)t.nodesToHandle-=i.howMany,i.howMany=0;else if(t.offset<o){const e=o-t.offset;i.howMany-=e,t.nodesToHandle-=e}if("remove"==i.type&&(n<=i.offset?i.offset-=t.howMany:t.offset<i.offset&&(t.nodesToHandle+=i.howMany,i.howMany=0)),"attribute"==i.type)if(n<=i.offset)i.offset-=t.howMany;else if(t.offset<i.offset){const e=n-i.offset;i.offset=t.offset,i.howMany-=e}else if(t.offset<o)if(n<=o){const n=i.howMany;i.howMany=t.offset-i.offset;const o=n-i.howMany-t.nodesToHandle;e.unshift({type:"attribute",offset:t.offset,howMany:o,count:this._changeCount++})}else i.howMany-=o-t.offset}if("attribute"==t.type){if("insert"==i.type)if(t.offset<i.offset&&n>i.offset){if(n>o){const t={type:"attribute",offset:o,howMany:n-o,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=i.offset&&t.offset<o&&(n>o?(t.nodesToHandle=n-o,t.offset=o):t.nodesToHandle=0);if("remove"==i.type&&t.offset<i.offset&&n>i.offset){const o={type:"attribute",offset:i.offset,howMany:n-i.offset,count:this._changeCount++};this._handleChange(o,e),e.push(o),t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}"attribute"==i.type&&(t.offset>=i.offset&&n<=o?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=i.offset&&n>=o&&(i.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,i){return{type:"insert",position:ma._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,i){return{type:"remove",position:ma._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,i){const n=[];i=new Map(i);for(const[o,r]of e){const e=i.has(o)?i.get(o):null;e!==r&&n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:e,changeCount:this._changeCount++}),i.delete(o)}for(const[e,o]of i)n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++});return n}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const i=this._changesInElement.get(e),n=t.startOffset;if(i)for(const t of i)if("insert"==t.type&&n>=t.offset&&n<t.offset+t.howMany)return!0;return this._isInInsertedElement(e)}_removeAllNestedChanges(t,e,i){const n=new wa(ma._createAt(t,e),ma._createAt(t,e+i));for(const t of n.getItems({shallow:!0}))t.is("element")&&(this._elementSnapshots.delete(t),this._changesInElement.delete(t),this._removeAllNestedChanges(t,0,t.maxOffset))}}function ec(t){const e=[];for(const i of t)if(i.is("$text"))for(let t=0;t<i.data.length;t++)e.push({name:"$text",attributes:new Map(i.getAttributes())});else e.push({name:i.name,attributes:new Map(i.getAttributes())});return e}function ic(t,e){const i=[];let n=0,o=0;for(const t of e){if(t.offset>n){for(let e=0;e<t.offset-n;e++)i.push("e");o+=t.offset-n}if("insert"==t.type){for(let e=0;e<t.howMany;e++)i.push("i");n=t.offset+t.howMany}else if("remove"==t.type){for(let e=0;e<t.howMany;e++)i.push("r");n=t.offset,o+=t.howMany}else i.push(..."a".repeat(t.howMany).split("")),n=t.offset+t.howMany,o+=t.howMany}if(o<t)for(let e=0;e<t-o-n;e++)i.push("e");return i}function nc(t){const e=t.position&&"$graveyard"==t.position.root.rootName,i=t.range&&"$graveyard"==t.range.root.rootName;return!e&&!i}class oc{constructor(){this._operations=[],this._undoPairs=new Map,this._undoneOperations=new Set}addOperation(t){this._operations.includes(t)||this._operations.push(t)}getOperations(t=Number.NEGATIVE_INFINITY,e=Number.POSITIVE_INFINITY){const i=[];for(const n of this._operations)n.baseVersion>=t&&n.baseVersion<e&&i.push(n);return i}getOperation(t){for(const e of this._operations)if(e.baseVersion==t)return e}setOperationAsUndone(t,e){this._undoPairs.set(e,t),this._undoneOperations.add(t)}isUndoingOperation(t){return this._undoPairs.has(t)}isUndoneOperation(t){return this._undoneOperations.has(t)}getUndoneOperation(t){return this._undoPairs.get(t)}}function rc(t,e){return!!(i=t.charAt(e-1))&&1==i.length&&/[\ud800-\udbff]/.test(i)&&function(t){return!!t&&1==t.length&&/[\udc00-\udfff]/.test(t)}(t.charAt(e));var i}function sc(t,e){return!!(i=t.charAt(e))&&1==i.length&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(i);var i}class ac{constructor(t){this.model=t,this.version=0,this.history=new oc(this),this.selection=new Na(this),this.roots=new gn({idProperty:"rootName"}),this.differ=new tc(t.markers),this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root","$graveyard"),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];if(i.isDocumentOperation&&i.baseVersion!==this.version)throw new a("model-document-applyoperation-wrong-version",this,{operation:i})},{priority:"highest"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&(this.version++,this.history.addOperation(i))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(t.markers,"update",(t,e,i,n)=>{this.differ.bufferMarkerChange(e.name,i,n,e.affectsData),null===i&&e.on("change",(t,i)=>{this.differ.bufferMarkerChange(e.name,i,e.getRange(),e.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new a("model-document-createroot-name-exists",this,{name:e});const i=new Gl(this,t,e);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,t=>t.rootName).filter(t=>"$graveyard"!=t)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=An(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,i=e.schema,n=e.createPositionFromPath(t,[0]);return i.getNearestSelectionRange(n)||e.createRange(n)}_validateSelectionRange(t){return lc(t.start)&&lc(t.end)}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),e=i(t),e)break}while(e)}}function lc(t){const e=t.textNode;if(e){const i=e.data,n=t.offset-e.startOffset;return!rc(i,n)&&!sc(i,n)}return!0}se(ac,g);class cc{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){return this._markers.has(t)}get(t){return this._markers.get(t)||null}_set(t,e,i=!1,n=!1){const o=t instanceof dc?t.name:t;if(o.includes(","))throw new a("markercollection-incorrect-marker-name",this);const r=this._markers.get(o);if(r){const t=r.getRange();let s=!1;return t.isEqual(e)||(r._attachLiveRange(Ma.fromRange(e)),s=!0),i!=r.managedUsingOperations&&(r._managedUsingOperations=i,s=!0),"boolean"==typeof n&&n!=r.affectsData&&(r._affectsData=n,s=!0),s&&this.fire("update:"+o,r,t,e),r}const s=Ma.fromRange(e),l=new dc(o,s,i,n);return this._markers.set(o,l),this.fire("update:"+o,l,null,e),l}_remove(t){const e=t instanceof dc?t.name:t,i=this._markers.get(e);return!!i&&(this._markers.delete(e),this.fire("update:"+e,i,i.getRange(),null),this._destroyMarker(i),!0)}_refresh(t){const e=t instanceof dc?t.name:t,i=this._markers.get(e);if(!i)throw new a("markercollection-refresh-marker-not-exists",this);const n=i.getRange();this.fire("update:"+e,i,n,n,i.managedUsingOperations,i.affectsData)}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}se(cc,g);class dc{constructor(t,e,i,n){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=i,this._affectsData=n}get managedUsingOperations(){if(!this._liveRange)throw new a("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new a("marker-destroyed",this);return this._affectsData}getStart(){if(!this._liveRange)throw new a("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new a("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new a("marker-destroyed",this);return this._liveRange.toRange()}is(t){return"marker"===t||"model:marker"===t}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}se(dc,g);class hc extends Sl{get type(){return"noop"}clone(){return new hc(this.baseVersion)}getReversed(){return new hc(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}}const uc={};uc[Vl.className]=Vl,uc[Fl.className]=Fl,uc[Hl.className]=Hl,uc[Bl.className]=Bl,uc[hc.className]=hc,uc[Sl.className]=Sl,uc[Ul.className]=Ul,uc[ql.className]=ql,uc[$l.className]=$l,uc[Wl.className]=Wl;class mc extends ma{constructor(t,e,i="toNone"){if(super(t,e,i),!this.root.is("rootElement"))throw new a("model-liveposition-root-not-rootelement",t);gc.call(this)}detach(){this.stopListening()}is(t){return"livePosition"===t||"model:livePosition"===t||"position"==t||"model:position"===t}toPosition(){return new ma(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}function gc(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&fc.call(this,i)},{priority:"low"})}function fc(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}se(mc,g);class pc{constructor(t,e,i){this.model=t,this.writer=e,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._documentFragment=e.createDocumentFragment(),this._documentFragmentPosition=e.createPositionAt(this._documentFragment,0),this._firstNode=null,this._lastNode=null,this._lastAutoParagraph=null,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(t){for(const e of Array.from(t))this._handleNode(e);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesOf,this.writer),this._filterAttributesOf=[]}_updateLastNodeFromAutoParagraph(t){const e=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(t);if(i.isAfter(e)){if(this._lastNode=t,this.position.parent!=t||!this.position.isAtEnd)throw new a("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this.nodeToSelect?wa._createOn(this.nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new wa(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(t){if(this.schema.isObject(t))return void this._handleObject(t);let e=this._checkAndAutoParagraphToAllowedPosition(t);e||(e=this._checkAndSplitToAllowedPosition(t),e)?(this._appendToFragment(t),this._firstNode||(this._firstNode=t),this._lastNode=t):this._handleDisallowedNode(t)}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;const t=mc.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=t.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=t.toPosition(),t.detach()}_handleObject(t){this._checkAndSplitToAllowedPosition(t)?this._appendToFragment(t):this._tryAutoparagraphing(t)}_handleDisallowedNode(t){t.is("element")?this.handleNodes(t.getChildren()):this._tryAutoparagraphing(t)}_appendToFragment(t){if(!this.schema.checkChild(this.position,t))throw new a("insertcontent-wrong-position",this,{node:t,position:this.position});this.writer.insert(t,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(t.offsetSize),this.schema.isObject(t)&&!this.schema.checkChild(this.position,"$text")?this.nodeToSelect=t:this.nodeToSelect=null,this._filterAttributesOf.push(t)}_setAffectedBoundaries(t){this._affectedStart||(this._affectedStart=mc.fromPosition(t,"toPrevious")),this._affectedEnd&&!this._affectedEnd.isBefore(t)||(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=mc.fromPosition(t,"toNext"))}_mergeOnLeft(){const t=this._firstNode;if(!(t instanceof da))return;if(!this._canMergeLeft(t))return;const e=mc._createBefore(t);e.stickiness="toNext";const i=mc.fromPosition(this.position,"toNext");this._affectedStart.isEqual(e)&&(this._affectedStart.detach(),this._affectedStart=mc._createAt(e.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=mc._createAt(e.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_mergeOnRight(){const t=this._lastNode;if(!(t instanceof da))return;if(!this._canMergeRight(t))return;const e=mc._createAfter(t);if(e.stickiness="toNext",!this.position.isEqual(e))throw new a("insertcontent-invalid-insertion-position",this);this.position=ma._createAt(e.nodeBefore,"end");const i=mc.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(e)&&(this._affectedEnd.detach(),this._affectedEnd=mc._createAt(e.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=e.nodeBefore,this._lastNode=e.nodeBefore),this.writer.merge(e),e.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=mc._createAt(e.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesOf.push(this.position.parent),e.detach()}_canMergeLeft(t){const e=t.previousSibling;return e instanceof da&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(e,t)}_canMergeRight(t){const e=t.nextSibling;return e instanceof da&&this.canMergeWith.has(e)&&this.model.schema.checkMerge(t,e)}_tryAutoparagraphing(t){const e=this.writer.createElement("paragraph");this._getAllowedIn(e,this.position.parent)&&this.schema.checkChild(e,t)&&(e._appendChild(t),this._handleNode(e))}_checkAndAutoParagraphToAllowedPosition(t){if(this.schema.checkChild(this.position.parent,t))return!0;if(!this.schema.checkChild(this.position.parent,"paragraph")||!this.schema.checkChild("paragraph",t))return!1;this._insertPartialFragment();const e=this.writer.createElement("paragraph");return this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0),!0}_checkAndSplitToAllowedPosition(t){const e=this._getAllowedIn(t,this.position.parent);if(!e)return!1;for(e!=this.position.parent&&this._insertPartialFragment();e!=this.position.parent;){if(this.schema.isLimit(this.position.parent))return!1;if(this.position.isAtStart){const t=this.position.parent;this.position=this.writer.createPositionBefore(t),t.isEmpty&&t.parent===e&&this.writer.remove(t)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{const t=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=t,this.canMergeWith.add(this.position.nodeAfter)}}return!0}_getAllowedIn(t,e){return this.schema.checkChild(e,t)?e:e.parent?this._getAllowedIn(t,e.parent):null}}function wc(t,e,i={}){if(e.isCollapsed)return;const n=e.getFirstRange();if("$graveyard"==n.root.rootName)return;const o=t.schema;t.change(t=>{if(!i.doNotResetEntireContent&&function(t,e){const i=t.getLimitElement(e);if(!e.containsEntireContent(i))return!1;const n=e.getFirstRange();if(n.start.parent==n.end.parent)return!1;return t.checkChild(i,"paragraph")}(o,e))return void function(t,e){const i=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(i)),kc(t,t.createPositionAt(i,0),e)}(t,e);const[r,s]=function(t){const e=t.root.document.model,i=t.start;let n=t.end;if(e.hasContent(t,{ignoreMarkers:!0})){const i=function(t){const e=t.parent,i=e.root.document.model.schema,n=e.getAncestors({parentFirst:!0,includeSelf:!0});for(const t of n){if(i.isLimit(t))return null;if(i.isBlock(t))return t}}(n);if(i&&n.isTouching(e.createPositionAt(i,0))){const i=e.createSelection(t);e.modifySelection(i,{direction:"backward"});const o=i.getLastPosition(),r=e.createRange(o,n);e.hasContent(r,{ignoreMarkers:!0})||(n=o)}}return[mc.fromPosition(i,"toPrevious"),mc.fromPosition(n,"toNext")]}(n);r.isTouching(s)||t.remove(t.createRange(r,s)),i.leaveUnmerged||(!function(t,e,i){const n=t.model;if(!bc(t.model.schema,e,i))return;const[o,r]=function(t,e){const i=t.getAncestors(),n=e.getAncestors();let o=0;for(;i[o]&&i[o]==n[o];)o++;return[i[o],n[o]]}(e,i);if(!o||!r)return;!n.hasContent(o,{ignoreMarkers:!0})&&n.hasContent(r,{ignoreMarkers:!0})?function t(e,i,n,o){const r=i.parent,s=n.parent;if(r==o||s==o)return;i=e.createPositionAfter(r),(n=e.createPositionBefore(s)).isEqual(i)||e.insert(r,n);for(;i.parent.isEmpty;){const t=i.parent;i=e.createPositionBefore(t),e.remove(t)}if(n=e.createPositionBefore(s),function(t,e){const i=e.nodeBefore,n=e.nodeAfter;i.name!=n.name&&t.rename(i,n.name);t.clearAttributes(i),t.setAttributes(Object.fromEntries(n.getAttributes()),i),t.merge(e)}(e,n),!bc(e.model.schema,i,n))return;t(e,i,n,o)}(t,e,i,o.parent):function t(e,i,n,o){const r=i.parent,s=n.parent;if(r==o||s==o)return;i=e.createPositionAfter(r),(n=e.createPositionBefore(s)).isEqual(i)||e.insert(s,i);e.merge(i);for(;n.parent.isEmpty;){const t=n.parent;n=e.createPositionBefore(t),e.remove(t)}if(!bc(e.model.schema,i,n))return;t(e,i,n,o)}(t,e,i,o.parent)}(t,r,s),o.removeDisallowedAttributes(r.parent.getChildren(),t)),_c(t,e,r),!i.doNotAutoparagraph&&function(t,e){const i=t.checkChild(e,"$text"),n=t.checkChild(e,"paragraph");return!i&&n}(o,r)&&kc(t,r,e),r.detach(),s.detach()})}function bc(t,e,i){const n=e.parent,o=i.parent;return n!=o&&(!t.isLimit(n)&&!t.isLimit(o)&&function(t,e,i){const n=new wa(t,e);for(const t of n.getWalker())if(i.isLimit(t.item))return!1;return!0}(e,i,t))}function kc(t,e,i){const n=t.createElement("paragraph");t.insert(n,e),_c(t,i,t.createPositionAt(n,0))}function _c(t,e,i){e instanceof Na?t.setSelection(i):e.setTo(i)}function vc(t,e){const{isForward:i,walker:n,unit:o,schema:r}=t,{type:s,item:a,nextPosition:l}=e;if("text"==s)return"word"===t.unit?function(t,e){let i=t.position.textNode;if(i){let n=t.position.offset-i.startOffset;for(;!xc(i.data,n,e)&&!Ac(i,n,e);){t.next();const o=e?t.position.nodeAfter:t.position.nodeBefore;if(o&&o.is("$text")){const n=o.data.charAt(e?0:o.data.length-1);' ,.?!:;"-()'.includes(n)||(t.next(),i=t.position.textNode)}n=t.position.offset-i.startOffset}}return t.position}(n,i):function(t,e){const i=t.position.textNode;if(i){const n=i.data;let o=t.position.offset-i.startOffset;for(;rc(n,o)||"character"==e&&sc(n,o);)t.next(),o=t.position.offset-i.startOffset}return t.position}(n,o);if(s==(i?"elementStart":"elementEnd")){if(r.isSelectable(a))return ma._createAt(a,i?"after":"before");if(r.checkChild(l,"$text"))return l}else{if(r.isLimit(a))return void n.skip(()=>!0);if(r.checkChild(l,"$text"))return l}}function yc(t,e){const i=t.root,n=ma._createAt(i,e?"end":0);return e?new wa(t,n):new wa(n,t)}function xc(t,e,i){const n=e+(i?0:-1);return' ,.?!:;"-()'.includes(t.charAt(n))}function Ac(t,e,i){return e===(i?t.endOffset:0)}function Cc(t,e){const i=[];Array.from(t.getItems({direction:"backward"})).map(t=>e.createRangeOn(t)).filter(e=>(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))).forEach(t=>{i.push(t.start.parent),e.remove(t)}),i.forEach(t=>{let i=t;for(;i.parent&&i.isEmpty;){const t=e.createRangeOn(i);i=i.parent,e.remove(t)}})}function Tc(t){t.document.registerPostFixer(e=>function(t,e){const i=e.document.selection,n=e.schema,o=[];let r=!1;for(const t of i.getRanges()){const e=Ec(t,n);e&&!e.isEqual(t)?(o.push(e),r=!0):o.push(t)}r&&t.setSelection(function(t){const e=[];e.push(t.shift());for(const i of t){const t=e.pop();if(i.isEqual(t))e.push(t);else if(i.isIntersecting(t)){const n=t.start.isAfter(i.start)?i.start:t.start,o=t.end.isAfter(i.end)?t.end:i.end,r=new wa(n,o);e.push(r)}else e.push(t),e.push(i)}return e}(o),{backward:i.isBackward})}(e,t))}function Ec(t,e){return t.isCollapsed?function(t,e){const i=t.start,n=e.getNearestSelectionRange(i);if(!n)return null;if(!n.isCollapsed)return n;const o=n.start;if(i.isEqual(o))return null;return new wa(o)}(t,e):function(t,e){const{start:i,end:n}=t,o=e.checkChild(i,"$text"),r=e.checkChild(n,"$text"),s=e.getLimitElement(i),a=e.getLimitElement(n);if(s===a){if(o&&r)return null;if(function(t,e,i){const n=t.nodeAfter&&!i.isLimit(t.nodeAfter)||i.checkChild(t,"$text"),o=e.nodeBefore&&!i.isLimit(e.nodeBefore)||i.checkChild(e,"$text");return n||o}(i,n,e)){const t=i.nodeAfter&&e.isSelectable(i.nodeAfter)?null:e.getNearestSelectionRange(i,"forward"),o=n.nodeBefore&&e.isSelectable(n.nodeBefore)?null:e.getNearestSelectionRange(n,"backward"),r=t?t.start:i,s=o?o.end:n;return new wa(r,s)}}const l=s&&!s.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){const t=i.nodeAfter&&n.nodeBefore&&i.nodeAfter.parent===n.nodeBefore.parent,o=l&&(!t||!Pc(i.nodeAfter,e)),r=c&&(!t||!Pc(n.nodeBefore,e));let d=i,h=n;return o&&(d=ma._createBefore(Sc(s,e))),r&&(h=ma._createAfter(Sc(a,e))),new wa(d,h)}return null}(t,e)}function Sc(t,e){let i=t,n=i;for(;e.isLimit(n)&&n.parent;)i=n,n=n.parent;return i}function Pc(t,e){return t&&e.isSelectable(t)}class Mc{constructor(){this.markers=new cc,this.document=new ac(this),this.schema=new rl,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:"$root",allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck((t,e)=>{if("$marker"===e.name)return!0}),Tc(this),this.document.registerPostFixer(Wa)}change(t){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new El,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(t){a.rethrowUnexpectedError(t,this)}}enqueueChange(t,e){try{"string"==typeof t?t=new El(t):"function"==typeof t&&(e=t,t=new El),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(t){a.rethrowUnexpectedError(t,this)}}applyOperation(t){t._execute()}insertContent(t,e,i){return function(t,e,i,n){return t.change(o=>{let r;r=i?i instanceof Ca||i instanceof Na?i:o.createSelection(i,n):t.document.selection,r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0});const s=new pc(t,o,r.anchor);let a;a=e.is("documentFragment")?e.getChildren():[e],s.handleNodes(a);const l=s.getSelectionRange();l&&(r instanceof Na?o.setSelection(l):r.setTo(l));const c=s.getAffectedRange()||t.createRange(r.anchor);return s.destroy(),c})}(this,t,e,i)}deleteContent(t,e){wc(this,t,e)}modifySelection(t,e){!function(t,e,i={}){const n=t.schema,o="backward"!=i.direction,r=i.unit?i.unit:"character",s=e.focus,a=new ha({boundaries:yc(s,o),singleCharacters:!0,direction:o?"forward":"backward"}),l={walker:a,schema:n,isForward:o,unit:r};let c;for(;c=a.next();){if(c.done)return;const i=vc(l,c.value);if(i)return void(e instanceof Na?t.change(t=>{t.setSelectionFocus(i)}):e.setFocus(i))}}(this,t,e)}getSelectedContent(t){return function(t,e){return t.change(t=>{const i=t.createDocumentFragment(),n=e.getFirstRange();if(!n||n.isCollapsed)return i;const o=n.start.root,r=n.start.getCommonPath(n.end),s=o.getNodeByPath(r);let a;a=n.start.parent==n.end.parent?n:t.createRange(t.createPositionAt(s,n.start.path[r.length]),t.createPositionAt(s,n.end.path[r.length]+1));const l=a.end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("$textProxy")?t.appendText(e.data,e.getAttributes(),i):t.append(t.cloneElement(e,!0),i);if(a!=n){const e=n._getTransformedByMove(a.start,t.createPositionAt(i,0),l)[0],o=t.createRange(t.createPositionAt(i,0),e.start);Cc(t.createRange(e.end,t.createPositionAt(i,"end")),t),Cc(o,t)}return i})}(this,t)}hasContent(t,e={}){const i=t instanceof da?wa._createIn(t):t;if(i.isCollapsed)return!1;const{ignoreWhitespaces:n=!1,ignoreMarkers:o=!1}=e;if(!o)for(const t of this.markers.getMarkersIntersectingRange(i))if(t.affectsData)return!0;for(const t of i.getItems())if(this.schema.isContent(t)){if(!t.is("$textProxy"))return!0;if(!n)return!0;if(-1!==t.data.search(/\S/))return!0}return!1}createPositionFromPath(t,e,i){return new ma(t,e,i)}createPositionAt(t,e){return ma._createAt(t,e)}createPositionAfter(t){return ma._createAfter(t)}createPositionBefore(t){return ma._createBefore(t)}createRange(t,e){return new wa(t,e)}createRangeIn(t){return wa._createIn(t)}createRangeOn(t){return wa._createOn(t)}createSelection(t,e,i){return new Ca(t,e,i)}createBatch(t){return new El(t)}createOperationFromJSON(t){return class{static fromJSON(t,e){return uc[t.__className].fromJSON(t,e)}}.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new Yl(this,e);const i=this._pendingChanges[0].callback(this._currentWriter);t.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),t}}se(Mc,te);class Ic extends Gs{constructor(t){super(),this.editor=t}set(t,e,i={}){if("string"==typeof e){const t=e;e=(e,i)=>{this.editor.execute(t),i()}}super.set(t,e,i)}}class Lc{constructor(t={}){this._context=t.context||new vn({language:t.language}),this._context._addEditor(this,!t.context);const e=Array.from(this.constructor.builtinPlugins||[]);this.config=new dn(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.config.define(this._context._getEditorConfig()),this.plugins=new fn(this,e,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new il,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new Mc;const i=new uo;this.data=new xl(this.model,i),this.editing=new el(this.model,i),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new Al([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Ic(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this.config,e=t.get("plugins"),i=t.get("removePlugins")||[],n=t.get("extraPlugins")||[],o=t.get("substitutePlugins")||[];return this.plugins.init(e.concat(n),i,o)}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise(t=>this.once("ready",t))),t.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...t){try{return this.commands.execute(...t)}catch(t){a.rethrowUnexpectedError(t,this)}}focus(){this.editing.view.focus()}}se(Lc,te);class Nc{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){this._components.set(Rc(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new a("componentfactory-item-missing",this,{name:t});return this._components.get(Rc(t)).callback(this.editor.locale)}has(t){return this._components.has(Rc(t))}}function Rc(t){return String(t).toLowerCase()}class Oc{constructor(t){this.editor=t,this.componentFactory=new Nc(t),this.focusTracker=new $s,this._editableElementsMap=new Map,this.listenTo(t.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}se(Oc,g);const zc={setData(t){this.data.set(t)},getData(t){return this.data.get(t)}};const Dc={updateSourceElement(){if(!this.sourceElement)throw new a("editor-missing-sourceelement",this);var t,e;t=this.sourceElement,e=this.data.get(),t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}};class Vc extends yn{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new gn({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new a("pendingactions-add-invalid-message",this);const e=Object.create(te);return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}}const jc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z"/></svg>',Bc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z"/></svg>',Fc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z"/><path d="M4 18h5.523v-1H4zm-2 0h1v-1H2z"/></svg>',Hc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.085 6.22 2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z"/></svg>',Uc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z"/></svg>',qc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',Wc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z"/></svg>',$c='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z"/></svg>',Gc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z"/></svg>',Yc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M18 4.5V3H2v1.5h16zm0 3V6h-5.674v1.5H18zm0 3V9h-5.674v1.5H18zm0 3V12h-5.674v1.5H18zm-8.5-6V12h-6V7.5h6zm.818-1.5H2.682C2.305 6 2 6.407 2 6.91v5.68c0 .503.305.91.682.91h7.636c.377 0 .682-.407.682-.91V6.91c0-.503-.305-.91-.682-.91zM18 16.5V15H2v1.5h16z"/></svg>',Kc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm4.5 3V12h7V7.5h-7zM5.758 6h8.484c.419 0 .758.407.758.91v5.681c0 .502-.34.909-.758.909H5.758c-.419 0-.758-.407-.758-.91V6.91c0-.503.34-.91.758-.91zM2 16.5V15h16v1.5z"/></svg>',Qc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm0 3V6h5.674v1.5zm0 3V9h5.674v1.5zm0 3V12h5.674v1.5zm8.5-6V12h6V7.5h-6zM9.682 6h7.636c.377 0 .682.407.682.91v5.68c0 .503-.305.91-.682.91H9.682c-.377 0-.682-.407-.682-.91V6.91c0-.503.305-.91.682-.91zM2 16.5V15h16v1.5z"/></svg>',Jc='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5V3h16v1.5zm2.5 3V12h11V7.5h-11zM4.061 6H15.94c.586 0 1.061.407 1.061.91v5.68c0 .503-.475.91-1.061.91H4.06c-.585 0-1.06-.407-1.06-.91V6.91C3 6.406 3.475 6 4.061 6zM2 16.5V15h16v1.5z"/></svg>',Zc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z"/></svg>',Xc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M13 6H2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v8a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5h11z"/></svg>',td='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z"/></svg>',ed='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z"/><path d="M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z"/></svg>',id='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z"/></svg>',nd='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z"/></svg>',od='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="9.5" cy="4.5" r="1.5"/><circle cx="9.5" cy="10.5" r="1.5"/><circle cx="9.5" cy="16.5" r="1.5"/></svg>';function rd({emitter:t,activator:e,callback:i,contextElements:n}){t.listenTo(document,"mousedown",(t,o)=>{if(!e())return;const r="function"==typeof o.composedPath?o.composedPath():[];for(const t of n)if(t.contains(o.target)||r.includes(t))return;i()})}function sd(t){t.set("_isCssTransitionsDisabled",!1),t.disableCssTransitions=()=>{t._isCssTransitionsDisabled=!0},t.enableCssTransitions=()=>{t._isCssTransitionsDisabled=!1},t.extendTemplate({attributes:{class:[t.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}function ad({view:t}){t.listenTo(t.element,"submit",(e,i)=>{i.preventDefault(),t.fire("submit")},{useCapture:!0})}class ld extends gn{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",(t,e,i)=>{this._renderViewIntoCollectionParent(e,i)}),this.on("remove",(t,e)=>{e.element&&this._parentElement&&e.element.remove()}),this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...t){if(!t.length||!t.every(t=>"string"==typeof t))throw new a("ui-viewcollection-delegate-wrong-events",this);return{to:e=>{for(const i of this)for(const n of t)i.delegate(n).to(e);this.on("add",(i,n)=>{for(const i of t)n.delegate(i).to(e)}),this.on("remove",(i,n)=>{for(const i of t)n.stopDelegating(i,e)})}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}}i(7770);class cd{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new gn,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,i)=>{i.locale=t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=dd.bind(this,this)}createCollection(t){const e=new ld(t);return this._viewCollections.add(e),e}registerChild(t){mn(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){mn(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new dd(t)}extendTemplate(t){dd.extend(this.template,t)}render(){if(this.isRendered)throw new a("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(t=>t.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}se(cd,$r),se(cd,te);class dd{constructor(t){Object.assign(this,_d(kd(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new a("ui-template-revert-not-applied",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const i of e.children)Cd(i)?yield i:Td(i)&&(yield*t(i))}(this)}static bind(t,e){return{to:(i,n)=>new ud({eventNameOrFunction:i,attribute:i,observable:t,emitter:e,callback:n}),if:(i,n,o)=>new md({observable:t,emitter:e,attribute:i,valueIfTrue:n,callback:o})}}static extend(t,e){if(t._isRendered)throw new a("template-extend-render",[this,t]);!function t(e,i){i.attributes&&(e.attributes||(e.attributes={}),xd(e.attributes,i.attributes));i.eventListeners&&(e.eventListeners||(e.eventListeners={}),xd(e.eventListeners,i.eventListeners));i.text&&e.text.push(...i.text);if(i.children&&i.children.length){if(e.children.length!=i.children.length)throw new a("ui-template-extend-children-mismatch",e);let n=0;for(const o of i.children)t(e.children[n++],o)}}(t,_d(kd(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new a("ui-template-wrong-syntax",this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),gd(this.text)?this._bindToObservable({schema:this.text,updater:pd(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,i,n,o;if(!this.attributes)return;const r=t.node,s=t.revertData;for(e in this.attributes)if(n=r.getAttribute(e),i=this.attributes[e],s&&(s.attributes[e]=n),o=v(i[0])&&i[0].ns?i[0].ns:null,gd(i)){const a=o?i[0].value:i;s&&Sd(e)&&a.unshift(n),this._bindToObservable({schema:a,updater:wd(r,e,o),data:t})}else"style"==e&&"string"!=typeof i[0]?this._renderStyleAttribute(i[0],t):(s&&n&&Sd(e)&&i.unshift(n),i=i.map(t=>t&&t.value||t).reduce((t,e)=>t.concat(e),[]).reduce(yd,""),Ad(i)||r.setAttributeNS(o,e,i))}_renderStyleAttribute(t,e){const i=e.node;for(const n in t){const o=t[n];gd(o)?this._bindToObservable({schema:[o],updater:bd(i,n),data:e}):i.style[n]=o}}_renderElementChildren(t){const e=t.node,i=t.intoFragment?document.createDocumentFragment():e,n=t.isApplying;let o=0;for(const r of this.children)if(Ed(r)){if(!n){r.setParent(e);for(const t of r)i.appendChild(t.element)}}else if(Cd(r))n||(r.isRendered||r.render(),i.appendChild(r.element));else if(Mr(r))i.appendChild(r);else if(n){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),r._renderNode({node:i.childNodes[o++],isApplying:!0,revertData:e})}else i.appendChild(r.render());t.intoFragment&&e.appendChild(i)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const i=this.eventListeners[e].map(i=>{const[n,o]=e.split("@");return i.activateDomEventListener(n,o,t)});t.revertData&&t.revertData.bindings.push(i)}}_bindToObservable({schema:t,updater:e,data:i}){const n=i.revertData;fd(t,e,i);const o=t.filter(t=>!Ad(t)).filter(t=>t.observable).map(n=>n.activateAttributeListener(t,e,i));n&&n.bindings.push(o)}_revertTemplateFromNode(t,e){for(const t of e.bindings)for(const e of t)e();if(e.text)t.textContent=e.text;else{for(const i in e.attributes){const n=e.attributes[i];null===n?t.removeAttribute(i):t.setAttribute(i,n)}for(let i=0;i<e.children.length;++i)this._revertTemplateFromNode(t.childNodes[i],e.children[i])}}}se(dd,g);class hd{constructor(t){Object.assign(this,t)}getValue(t){const e=this.observable[this.attribute];return this.callback?this.callback(e,t):e}activateAttributeListener(t,e,i){const n=()=>fd(t,e,i);return this.emitter.listenTo(this.observable,"change:"+this.attribute,n),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,n)}}}class ud extends hd{activateDomEventListener(t,e,i){const n=(t,i)=>{e&&!i.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,t,n),()=>{this.emitter.stopListening(i.node,t,n)}}}class md extends hd{getValue(t){return!Ad(super.getValue(t))&&(this.valueIfTrue||!0)}}function gd(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(gd):t instanceof hd)}function fd(t,e,{node:i}){let n=function(t,e){return t.map(t=>t instanceof hd?t.getValue(e):t)}(t,i);n=1==t.length&&t[0]instanceof md?n[0]:n.reduce(yd,""),Ad(n)?e.remove():e.set(n)}function pd(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function wd(t,e,i){return{set(n){t.setAttributeNS(i,e,n)},remove(){t.removeAttributeNS(i,e)}}}function bd(t,e){return{set(i){t.style[e]=i},remove(){t.style[e]=null}}}function kd(t){return ln(t,t=>{if(t&&(t instanceof hd||Td(t)||Cd(t)||Ed(t)))return t})}function _d(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){t.text=pn(t.text)}(t),t.on&&(t.eventListeners=function(t){for(const e in t)vd(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=pn(t[e].value)),vd(t,e)}(t.attributes);const e=[];if(t.children)if(Ed(t.children))e.push(t.children);else for(const i of t.children)Td(i)||Cd(i)||Mr(i)?e.push(i):e.push(new dd(i));t.children=e}return t}function vd(t,e){t[e]=pn(t[e])}function yd(t,e){return Ad(e)?t:Ad(t)?e:`${t} ${e}`}function xd(t,e){for(const i in e)t[i]?t[i].push(...e[i]):t[i]=e[i]}function Ad(t){return!t&&0!==t}function Cd(t){return t instanceof cd}function Td(t){return t instanceof dd}function Ed(t){return t instanceof ld}function Sd(t){return"class"==t||"style"==t}const Pd=function(t){return"string"==typeof t||!At(t)&&bt(t)&&"[object String]"==R(t)};class Md extends ld{constructor(t,e=[]){super(e),this.locale=t}attachToDom(){this._bodyCollectionContainer=new dd({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let t=document.querySelector(".ck-body-wrapper");t||(t=function(t,e,i={},n=[]){const o=i&&i.xmlns,r=o?t.createElementNS(o,e):t.createElement(e);for(const t in i)r.setAttribute(t,i[t]);!Pd(n)&&mn(n)||(n=[n]);for(let e of n)Pd(e)&&(e=t.createTextNode(e)),r.appendChild(e);return r}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&0==t.childElementCount&&t.remove()}}i(7835);class Id extends cd{constructor(){super();const t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:t.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}}i(9314);class Ld extends cd{constructor(t){super(t),this.set("text",""),this.set("position","s");const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",e.to("position",t=>"ck-tooltip_"+t),e.if("text","ck-hidden",t=>!t.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:e.to("text")}]}]})}}i(9852);class Nd extends cd{constructor(t){super(t);const e=this.bindTemplate,i=r();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(i),this.iconView=new Id,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",e.to("class"),e.if("isEnabled","ck-disabled",t=>!t),e.if("isVisible","ck-hidden",t=>!t),e.to("isOn",t=>t?"ck-on":"ck-off"),e.if("withText","ck-button_with-text"),e.if("withKeystroke","ck-button_with-keystroke")],type:e.to("type",t=>t||"button"),tabindex:e.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+i,"aria-disabled":e.if("isEnabled",!0,t=>!t),"aria-pressed":e.to("isOn",t=>!!this.isToggleable&&String(t))},children:this.children,on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(t=>{this.isEnabled?this.fire("execute"):t.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const t=new Ld;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new cd,i=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:"ck-editor__aria-label_"+t},children:[{text:this.bindTemplate.to("label")}]}),e}_createKeystrokeView(){const t=new cd;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Qo(t))}]}),t}_getTooltipString(t,e,i){return t?"string"==typeof t?t:(i&&(i=Qo(i)),t instanceof Function?t(e,i):`${e}${i?` (${i})`:""}`):""}}i(285);class Rd extends Nd{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new cd;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}}function Od(t){return"string"==typeof t?{model:t,label:t,hasBorder:!1,view:{name:"span",styles:{color:t}}}:{model:t.color,label:t.label||t.color,hasBorder:void 0!==t.hasBorder&&t.hasBorder,view:{name:"span",styles:{color:""+t.color}}}}class zd extends Nd{constructor(t){super(t);const e=this.bindTemplate;this.set("color"),this.set("hasBorder"),this.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path class="ck-icon__fill" d="M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z"/><path d="M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z"/></svg>',this.extendTemplate({attributes:{style:{backgroundColor:e.to("color")},class:["ck","ck-color-grid__tile",e.if("hasBorder","ck-color-table__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}}class Dd{constructor(t){if(Object.assign(this,t),t.actions&&t.keystrokeHandler)for(const e in t.actions){let i=t.actions[e];"string"==typeof i&&(i=[i]);for(const n of i)t.keystrokeHandler.set(n,(t,i)=>{this[e](),i()})}}get first(){return this.focusables.find(Vd)||null}get last(){return this.focusables.filter(Vd).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,i)=>{const n=e.element===this.focusTracker.focusedElement;return n&&(t=i),n}),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,i=this.focusables.length;if(!i)return null;if(null===e)return this[1===t?"first":"last"];let n=(e+i+t)%i;do{const e=this.focusables.get(n);if(Vd(e))return e;n=(n+i+t)%i}while(n!==e);return null}}function Vd(t){return!(!t.focus||"none"==Or.window.getComputedStyle(t.element).display)}i(218);class jd extends cd{constructor(t,e){super(t);const i=e&&e.colorDefinitions||[],n={};e&&e.columns&&(n.gridTemplateColumns=`repeat( ${e.columns}, 1fr)`),this.set("selectedColor"),this.items=this.createCollection(),this.focusTracker=new $s,this.keystrokes=new Gs,this._focusCycler=new Dd({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowleft",focusNext:"arrowright"}}),this.items.on("add",(t,e)=>{e.isOn=e.color===this.selectedColor}),i.forEach(t=>{const e=new zd;e.set({color:t.color,label:t.label,tooltip:!0,hasBorder:t.options.hasBorder}),e.on("execute",()=>{this.fire("execute",{value:t.color,hasBorder:t.options.hasBorder,label:t.label})}),this.items.add(e)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:n}}),this.on("change:selectedColor",(t,e,i)=>{for(const t of this.items)t.isOn=t.color===i})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}}const Bd='<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z"/></svg>';class Fd extends Nd{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new Id;return t.content=Bd,t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}i(8295);class Hd extends cd{constructor(t){super(t);const e=this.bindTemplate;this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(),this.arrowView=this._createArrowView(),this.keystrokes=new Gs,this.focusTracker=new $s,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",e.if("isVisible","ck-hidden",t=>!t),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",(t,e)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),e())}),this.keystrokes.set("arrowleft",(t,e)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),e())})}focus(){this.actionView.focus()}_createActionView(){const t=new Nd;return 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 t=new Nd,e=t.bindTemplate;return t.icon=Bd,t.extendTemplate({attributes:{class:"ck-splitbutton__arrow","aria-haspopup":!0,"aria-expanded":e.to("isOn",t=>String(t))}}),t.bind("isEnabled").to(this),t.delegate("execute").to(this,"open"),t}}class Ud extends cd{constructor(t){super(t);const e=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",e.to("position",t=>"ck-dropdown__panel_"+t),e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to(t=>t.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}i(6775);function qd({element:t,target:e,positions:i,limiter:n,fitInViewport:o}){O(e)&&(e=e()),O(n)&&(n=n());const r=function(t){return t&&t.parentNode?t.offsetParent===Or.document.body?null:t.offsetParent:null}(t),s=new Bs(t),a=new Bs(e);let l,c;if(n||o){const t=function(t,e){const{elementRect:i,viewportRect:n}=e,o=i.getArea(),r=function(t,{targetRect:e,elementRect:i,limiterRect:n,viewportRect:o}){const r=[],s=i.getArea();for(const a of t){const t=Wd(a,e,i);if(!t)continue;const[l,c]=t;let d=0,h=0;if(n)if(o){const t=n.getIntersection(o);t&&(d=t.getIntersectionArea(c))}else d=n.getIntersectionArea(c);o&&(h=o.getIntersectionArea(c));const u={positionName:l,positionRect:c,limiterIntersectArea:d,viewportIntersectArea:h};if(d===s)return[u];r.push(u)}return r}(t,e);if(n){const t=$d(r.filter(({viewportIntersectArea:t})=>t===o),o);if(t)return t}return $d(r,o)}(i,{targetRect:a,elementRect:s,limiterRect:n&&new Bs(n).getVisible(),viewportRect:o&&new Bs(Or.window)});[c,l]=t||Wd(i[0],a,s)}else[c,l]=Wd(i[0],a,s);let d=Gd(l);return r&&(d=function({left:t,top:e},i){const n=Gd(new Bs(i)),o=Vs(i);return t-=n.left,e-=n.top,t+=i.scrollLeft,e+=i.scrollTop,t-=o.left,e-=o.top,{left:t,top:e}}(d,r)),{left:d.left,top:d.top,name:c}}function Wd(t,e,i){const n=t(e,i);if(!n)return null;const{left:o,top:r,name:s}=n;return[s,i.clone().moveTo(o,r)]}function $d(t,e){let i,n,o=0;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:l}of t){if(a===e)return[r,s];const t=l**2+a**2;t>o&&(o=t,i=s,n=r)}return i?[n,i]:null}function Gd({left:t,top:e}){const{scrollX:i,scrollY:n}=Or.window;return{left:t+i,top:e+n}}class Yd extends cd{constructor(t,e,i){super(t);const n=this.bindTemplate;this.buttonView=e,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new Gs,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",t=>!t)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[e,i]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=Yd._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const t=(t,e)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){const{south:t,north:e,southEast:i,southWest:n,northEast:o,northWest:r,southMiddleEast:s,southMiddleWest:a,northMiddleEast:l,northMiddleWest:c}=Yd.defaultPanelPositions;return"rtl"!==this.locale.uiLanguageDirection?[i,n,s,a,t,o,r,l,c,e]:[n,i,a,s,t,r,o,c,l,e]}}Yd.defaultPanelPositions={south:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/2,name:"s"}),southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),southMiddleEast:(t,e)=>({top:t.bottom,left:t.left-(e.width-t.width)/4,name:"sme"}),southMiddleWest:(t,e)=>({top:t.bottom,left:t.left-3*(e.width-t.width)/4,name:"smw"}),north:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/2,name:"n"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.top-e.height,left:t.left-e.width+t.width,name:"nw"}),northMiddleEast:(t,e)=>({top:t.top-e.height,left:t.left-(e.width-t.width)/4,name:"nme"}),northMiddleWest:(t,e)=>({top:t.top-e.height,left:t.left-3*(e.width-t.width)/4,name:"nmw"})},Yd._getOptimalPosition=qd;class Kd extends cd{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}}class Qd extends cd{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}}function Jd(t){return Array.isArray(t)?{items:t,removeItems:[]}:t?Object.assign({items:[],removeItems:[]},t):{items:[],removeItems:[]}}i(3171);class Zd extends cd{constructor(t,e){super(t);const i=this.bindTemplate,n=this.t;this.options=e||{},this.set("ariaLabel",n("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new $s,this.keystrokes=new Gs,this.set("class"),this.set("isCompact",!1),this.itemsView=new Xd(t),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();const o="rtl"===t.uiLanguageDirection;this._focusCycler=new Dd({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[o?"arrowright":"arrowleft","arrowup"],focusNext:[o?"arrowleft":"arrowright","arrowdown"]}});const r=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")];var s;this.options.shouldGroupWhenFull&&this.options.isFloating&&r.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:r,role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")}},children:this.children,on:{mousedown:(s=this,s.bindTemplate.to(t=>{t.target===s.element&&t.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new eh(this):new th(this)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){const i=Jd(t),n=i.items.filter((t,n,o)=>"|"===t||-1===i.removeItems.indexOf(t)&&("-"===t?!this.options.shouldGroupWhenFull||(l("toolbarview-line-break-ignored-when-grouping-items",o),!1):!!e.has(t)||(l("toolbarview-item-unavailable",{name:t}),!1))),o=this._cleanSeparators(n).map(t=>"|"===t?new Kd:"-"===t?new Qd:e.create(t));this.items.addMany(o)}_cleanSeparators(t){const e=t=>"-"!==t&&"|"!==t,i=t.length,n=t.findIndex(e),o=i-t.slice().reverse().findIndex(e);return t.slice(n,o).filter((t,i,n)=>{if(e(t))return!0;return!(i>0&&n[i-1]===t)})}}class Xd extends cd{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class th{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using(t=>t),t.focusables.bindTo(t.items).using(t=>t),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class eh{constructor(t){this.view=t,this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,t.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),t.children.on("add",this._updateFocusCycleableItems.bind(this)),t.children.on("remove",this._updateFocusCycleableItems.bind(this)),t.items.on("change",(t,e)=>{const i=e.index;for(const t of e.removed)i>=this.ungroupedItems.length?this.groupedItems.remove(t):this.ungroupedItems.remove(t);for(let t=i;t<i+e.added.length;t++){const n=e.added[t-i];t>this.ungroupedItems.length?this.groupedItems.add(n,t-this.ungroupedItems.length):this.ungroupedItems.add(n,t)}this._updateGrouping()}),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);const t=this.groupedItems.length;let e;for(;this._areItemsOverflowing;)this._groupLastItem(),e=!0;if(!e&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}this.groupedItems.length!==t&&this.view.fire("groupedItemsUpdate")}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,i=new Bs(t.lastChild),n=new Bs(t);if(!this.cachedPadding){const i=Or.window.getComputedStyle(t),n="ltr"===e?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[n])}return"ltr"===e?i.right>n.right-this.cachedPadding:i.left<n.left+this.cachedPadding}_enableGroupingOnResize(){let t;this.resizeObserver=new Us(this.viewElement,e=>{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new Kd),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 t=this.viewLocale,e=t.t,i=rh(t);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===t.uiLanguageDirection?"sw":"se",sh(i,[]),i.buttonView.set({label:e("Show more items"),tooltip:!0,tooltipPosition:"rtl"===t.uiLanguageDirection?"se":"sw",icon:od}),i.toolbarView.items.bindTo(this.groupedItems).using(t=>t),i}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(t=>{this.viewFocusables.add(t)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}i(2547);class ih extends cd{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new $s,this.keystrokes=new Gs,this._focusCycler=new Dd({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}}class nh extends cd{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}}class oh extends cd{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}i(6390),i(9607);function rh(t,e=Fd){const i=new e(t),n=new Ud(t),o=new Yd(t,i,n);return i.bind("isEnabled").to(o),i instanceof Fd?i.bind("isOn").to(o,"isOpen"):i.arrowView.bind("isOn").to(o,"isOpen"),function(t){(function(t){t.on("render",()=>{rd({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})})})(t),function(t){t.on("execute",e=>{e.source instanceof Rd||(t.isOpen=!1)})}(t),function(t){t.keystrokes.set("arrowdown",(e,i)=>{t.isOpen&&(t.panelView.focus(),i())}),t.keystrokes.set("arrowup",(e,i)=>{t.isOpen&&(t.panelView.focusLast(),i())})}(t)}(o),o}function sh(t,e){const i=t.locale,n=i.t,o=t.toolbarView=new Zd(i);o.set("ariaLabel",n("Dropdown toolbar")),t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(t=>o.items.add(t)),t.panelView.children.add(o),o.items.delegate("execute").to(t)}function ah(t,e){const i=t.locale,n=t.listView=new ih(i);n.items.bindTo(e).using(({type:t,model:e})=>{if("separator"===t)return new oh(i);if("button"===t||"switchbutton"===t){const n=new nh(i);let o;return o="button"===t?new Nd(i):new Rd(i),o.bind(...Object.keys(e)).to(e),o.delegate("execute").to(n),n.children.add(o),n}}),t.panelView.children.add(n),n.items.delegate("execute").to(t)}i(996);class lh extends cd{constructor(t){super(t),this.body=new Md(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}i(480);class ch extends cd{constructor(t){super(t),this.set("text"),this.set("for"),this.id="ck-editor__label_"+r();const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}}class dh extends lh{constructor(t){super(t),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:t.uiLanguageDirection,lang:t.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 t=this.t,e=new ch;return e.text=t("Rich Text Editor"),e.extendTemplate({attributes:{class:"ck-voice-label"}}),e}}class hh extends cd{constructor(t,e,i){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=e}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()}_updateIsFocusedClasses(){const t=this._editingView;function e(e){t.change(i=>{const n=t.document.getRoot(e.name);i.addClass(e.isFocused?"ck-focused":"ck-blurred",n),i.removeClass(e.isFocused?"ck-blurred":"ck-focused",n)})}t.isRenderingInProgress?function i(n){t.once("change:isRenderingInProgress",(t,o,r)=>{r?i(n):e(n)})}(this):e(this)}}class uh extends hh{constructor(t,e,i){super(t,e,i),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const t=this._editingView,e=this.t;t.change(i=>{const n=t.document.getRoot(this.name);i.setAttribute("aria-label",e("Rich Text Editor, %0",this.name),n)})}}i(9350);class mh extends cd{constructor(t,e={}){super(t);const i=this.bindTemplate;this.set("label",e.label||""),this.set("class",e.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children});const n=new cd(t);n.setTemplate({tag:"span",attributes:{class:["ck","ck-form__header__label"]},children:[{text:i.to("label")}]}),this.children.add(n)}}i(5728);class gh extends cd{constructor(t){super(t),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById"),this.focusTracker=new $s,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",e.if("isFocused","ck-input_focused"),e.if("isEmpty","ck-input-text_empty"),e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to("input"),change:e.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(t,e,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}select(){this.element.select()}focus(){this.element.focus()}_updateIsEmpty(){this.isEmpty=!this.element.value}_setDomElementValue(t){this.element.value=t||0===t?t:""}}i(5872);class fh extends cd{constructor(t,e){super(t);const i="ck-labeled-field-view-"+r(),n="ck-labeled-field-view-status-"+r();this.fieldView=e(this,i,n),this.set("label"),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.set("placeholder"),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(n),this.bind("_statusText").to(this,"errorText",this,"infoText",(t,e)=>t||e);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",t=>!t),o.if("isEmpty","ck-labeled-field-view_empty"),o.if("isFocused","ck-labeled-field-view_focused"),o.if("placeholder","ck-labeled-field-view_placeholder"),o.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:[this.fieldView,this.labelView]},this.statusView]})}_createLabelView(t){const e=new ch(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createStatusView(t){const e=new cd(this.locale),i=this.bindTemplate;return e.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",t=>!t)],id:t,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),e}focus(){this.fieldView.focus()}}function ph(t,e,i){const n=new gh(t.locale);return n.set({id:e,ariaDescribedById:i}),n.bind("isReadOnly").to(t,"isEnabled",t=>!t),n.bind("hasError").to(t,"errorText",t=>!!t),n.on("input",()=>{t.errorText=null}),t.bind("isEmpty","isFocused","placeholder").to(n),n}class wh extends yn{static get pluginName(){return"Notification"}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e="show:"+t.type+(t.namespace?":"+t.namespace:"");this.fire(e,{message:t.message,type:t.type,title:t.title||""})}}class bh{constructor(t,e){e&&Gt(this,e),t&&this.set(t)}}function kh(t){return e=>e+t}se(bh,te);i(2653);const _h=kh("px"),vh=Or.document.body;class yh extends cd{constructor(t){super(t);const e=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"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>"ck-balloon-panel_"+t),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",_h),left:e.to("left",_h)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=yh.defaultPositions,i=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast],limiter:vh,fitInViewport:!0},t),n=yh._getOptimalPosition(i),o=parseInt(n.left),r=parseInt(n.top),s=n.name;Object.assign(this,{top:r,left:o,position:s})}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(t):this._stopPinning()},this._startPinning(t),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(t){this.attachTo(t);const e=xh(t.target),i=t.limiter?xh(t.limiter):vh;this.listenTo(Or.document,"scroll",(n,o)=>{const r=o.target,s=e&&r.contains(e),a=i&&r.contains(i);!s&&!a&&e&&i||this.attachTo(t)},{useCapture:!0}),this.listenTo(Or.window,"resize",()=>{this.attachTo(t)})}_stopPinning(){this.stopListening(Or.document,"scroll"),this.stopListening(Or.window,"resize")}}function xh(t){return cn(t)?t:Ds(t)?t.commonAncestorContainer:"function"==typeof t?xh(t()):null}function Ah(t,e){return t.top-e.height-yh.arrowVerticalOffset}function Ch(t){return t.bottom+yh.arrowVerticalOffset}yh.arrowHorizontalOffset=25,yh.arrowVerticalOffset=10,yh._getOptimalPosition=qd,yh.defaultPositions={northWestArrowSouthWest:(t,e)=>({top:Ah(t,e),left:t.left-yh.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(t,e)=>({top:Ah(t,e),left:t.left-.25*e.width-yh.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(t,e)=>({top:Ah(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(t,e)=>({top:Ah(t,e),left:t.left-.75*e.width+yh.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(t,e)=>({top:Ah(t,e),left:t.left-e.width+yh.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:Ah(t,e),left:t.left+t.width/2-yh.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(t,e)=>({top:Ah(t,e),left:t.left+t.width/2-.25*e.width-yh.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(t,e)=>({top:Ah(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(t,e)=>({top:Ah(t,e),left:t.left+t.width/2-.75*e.width+yh.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(t,e)=>({top:Ah(t,e),left:t.left+t.width/2-e.width+yh.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:Ah(t,e),left:t.right-yh.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(t,e)=>({top:Ah(t,e),left:t.right-.25*e.width-yh.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(t,e)=>({top:Ah(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(t,e)=>({top:Ah(t,e),left:t.right-.75*e.width+yh.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(t,e)=>({top:Ah(t,e),left:t.right-e.width+yh.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(t,e)=>({top:Ch(t),left:t.left-yh.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(t,e)=>({top:Ch(t),left:t.left-.25*e.width-yh.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(t,e)=>({top:Ch(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(t,e)=>({top:Ch(t),left:t.left-.75*e.width+yh.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(t,e)=>({top:Ch(t),left:t.left-e.width+yh.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:Ch(t),left:t.left+t.width/2-yh.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(t,e)=>({top:Ch(t),left:t.left+t.width/2-.25*e.width-yh.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(t,e)=>({top:Ch(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(t,e)=>({top:Ch(t),left:t.left+t.width/2-.75*e.width+yh.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(t,e)=>({top:Ch(t),left:t.left+t.width/2-e.width+yh.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:Ch(t),left:t.right-yh.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(t,e)=>({top:Ch(t),left:t.right-.25*e.width-yh.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(t,e)=>({top:Ch(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(t,e)=>({top:Ch(t),left:t.right-.75*e.width+yh.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(t,e)=>({top:Ch(t),left:t.right-e.width+yh.arrowHorizontalOffset,name:"arrow_ne"})};i(5165),i(3423);const Th=kh("px");class Eh extends ae{static get pluginName(){return"ContextualBalloon"}constructor(t){super(t),this.positionLimiter=()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},this.set("visibleView",null),this.view=new yh(t.locale),t.ui.view.body.add(this.view),t.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this.hasView(t.view))throw new a("contextualballoon-add-view-exist",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const i=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),i.set(t.view,t),this._viewToStack.set(t.view,i),i===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new a("contextualballoon-remove-view-not-exist",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(1===e.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),1===e.size?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new a("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find(e=>e[1]===t)[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new Sh(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>1),t.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(t,i)=>{if(i<2)return"";const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[n,i])}),t.buttonNextView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),t.buttonPrevView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),t}_createFakePanelsView(){const t=new Ph(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>=2?Math.min(t-1,2):0),t.listenTo(this.view,"change:top",()=>t.updatePosition()),t.listenTo(this.view,"change:left",()=>t.updatePosition()),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:i=!0,singleViewMode:n=!1}){this.view.class=e,this.view.withArrow=i,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),n&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&!t.limiter&&(t=Object.assign({},t,{limiter:this.positionLimiter})),t}}class Sh extends cd{constructor(t){super(t);const e=t.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new $s,this.buttonPrevView=this._createButtonView(e("Previous"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z"/></svg>'),this.buttonNextView=this._createButtonView(e("Next"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z"/></svg>'),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",t=>t?"":"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)}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const i=new Nd(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i}}class Ph extends cd{constructor(t,e){super(t);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=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",t=>t?"":"ck-hidden")],style:{top:i.to("top",Th),left:i.to("left",Th),width:i.to("width",Th),height:i.to("height",Th)}},children:this.content}),this.on("change:numberOfPanels",(t,e,i,n)=>{i>n?this._addPanels(i-n):this._removePanels(n-i),this.updatePosition()})}_addPanels(t){for(;t--;){const t=new cd;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(t){for(;t--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:i,height:n}=new Bs(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:i,height:n})}}}i(7372);const Mh=kh("px");class Ih extends cd{constructor(t){super(t);const e=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("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new dd({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",t=>t?"block":"none"),height:e.to("isSticky",t=>t?Mh(this._panelRect.height):null)}}}).render(),this._contentPanel=new dd({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",e.if("isSticky","ck-sticky-panel__content_sticky"),e.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:e.to("isSticky",t=>t?Mh(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:e.to("_hasViewportTopOffset",t=>t?Mh(this.viewportTopOffset):null),bottom:e.to("_isStickyToTheLimiter",t=>t?Mh(this.limiterBottomOffset):null),marginLeft:e.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(Or.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const t=this._panelRect=this._contentPanel.getBoundingClientRect();let e;this.limiterElement?(e=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&e.top<this.viewportTopOffset&&this._panelRect.height+this.limiterBottomOffset<e.height):this.isSticky=!1,this.isSticky?(this._isStickyToTheLimiter=e.bottom<t.height+this.limiterBottomOffset+this.viewportTopOffset,this._hasViewportTopOffset=!this._isStickyToTheLimiter&&!!this.viewportTopOffset,this._marginLeft=this._isStickyToTheLimiter?null:Mh(-Or.window.scrollX)):(this._isStickyToTheLimiter=!1,this._hasViewportTopOffset=!1,this._marginLeft=null)}}kh("px");i(7964);kh("px");kh("px");i(3047);const Lh=new WeakMap;function Nh(t){const{view:e,element:i,text:n,isDirectHost:o=!0,keepOnFocus:r=!1}=t,s=e.document;Lh.has(s)||(Lh.set(s,new Map),s.registerPostFixer(t=>Oh(s,t))),Lh.get(s).set(i,{text:n,isDirectHost:o,keepOnFocus:r,hostElement:o?i:null}),e.change(t=>Oh(s,t))}function Rh(t,e){return!!e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),!0)}function Oh(t,e){const i=Lh.get(t),n=[];let o=!1;for(const[t,r]of i)r.isDirectHost&&(n.push(t),zh(e,t,r)&&(o=!0));for(const[t,r]of i){if(r.isDirectHost)continue;const i=Dh(t);i&&(n.includes(i)||(r.hostElement=i,zh(e,t,r)&&(o=!0)))}return o}function zh(t,e,i){const{text:n,isDirectHost:o,hostElement:r}=i;let s=!1;r.getAttribute("data-placeholder")!==n&&(t.setAttribute("data-placeholder",n,r),s=!0);return(o||1==e.childCount)&&function(t,e){if(!t.isAttached())return!1;if(Array.from(t.getChildren()).some(t=>!t.is("uiElement")))return!1;if(e)return!0;const i=t.document;if(!i.isFocused)return!0;const n=i.selection.anchor;return n&&n.parent!==t}(r,i.keepOnFocus)?function(t,e){return!e.hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",e),!0)}(t,r)&&(s=!0):Rh(t,r)&&(s=!0),s}function Dh(t){if(t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null}const Vh=new Map;function jh(t,e,i){let n=Vh.get(t);n||(n=new Map,Vh.set(t,n)),n.set(e,i)}function Bh(t){return[t]}function Fh(t,e,i={}){const n=function(t,e){const i=Vh.get(t);return i&&i.has(e)?i.get(e):Bh}(t.constructor,e.constructor);try{return n(t=t.clone(),e,i)}catch(t){throw t}}function Hh(t,e,i){t=t.slice(),e=e.slice();const n=new Uh(i.document,i.useRelations,i.forceWeakRemove);n.setOriginalOperations(t),n.setOriginalOperations(e);const o=n.originalOperations;if(0==t.length||0==e.length)return{operationsA:t,operationsB:e,originalOperations:o};const r=new WeakMap;for(const e of t)r.set(e,0);const s={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length};let a=0;for(;a<t.length;){const i=t[a],o=r.get(i);if(o==e.length){a++;continue}const s=e[o],l=Fh(i,s,n.getContext(i,s,!0)),c=Fh(s,i,n.getContext(s,i,!1));n.updateRelation(i,s),n.setOriginalOperations(l,i),n.setOriginalOperations(c,s);for(const t of l)r.set(t,o+c.length);t.splice(a,1,...l),e.splice(o,1,...c)}if(i.padWithNoOps){const i=t.length-s.originalOperationsACount,n=e.length-s.originalOperationsBCount;Wh(t,n-i),Wh(e,i-n)}return qh(t,s.nextBaseVersionB),qh(e,s.nextBaseVersionA),{operationsA:t,operationsB:e,originalOperations:o}}class Uh{constructor(t,e,i=!1){this.originalOperations=new Map,this._history=t.history,this._useRelations=e,this._forceWeakRemove=!!i,this._relations=new Map}setOriginalOperations(t,e=null){const i=e?this.originalOperations.get(e):null;for(const e of t)this.originalOperations.set(e,i||e)}updateRelation(t,e){switch(t.constructor){case Bl:switch(e.constructor){case Wl:t.targetPosition.isEqual(e.sourcePosition)||e.movedRange.containsPosition(t.targetPosition)?this._setRelation(t,e,"insertAtSource"):t.targetPosition.isEqual(e.deletionPosition)?this._setRelation(t,e,"insertBetween"):t.targetPosition.isAfter(e.sourcePosition)&&this._setRelation(t,e,"moveTargetAfter");break;case Bl:t.targetPosition.isEqual(e.sourcePosition)||t.targetPosition.isBefore(e.sourcePosition)?this._setRelation(t,e,"insertBefore"):this._setRelation(t,e,"insertAfter")}break;case $l:switch(e.constructor){case Wl:t.splitPosition.isBefore(e.sourcePosition)&&this._setRelation(t,e,"splitBefore");break;case Bl:if(t.splitPosition.isEqual(e.sourcePosition)||t.splitPosition.isBefore(e.sourcePosition))this._setRelation(t,e,"splitBefore");else{const i=wa._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&i.containsPosition(t.splitPosition)){const n=i.end.offset-t.splitPosition.offset,o=t.splitPosition.offset-i.start.offset;this._setRelation(t,e,{howMany:n,offset:o})}}}break;case Wl:switch(e.constructor){case Wl:t.targetPosition.isEqual(e.sourcePosition)||this._setRelation(t,e,"mergeTargetNotMoved"),t.sourcePosition.isEqual(e.targetPosition)&&this._setRelation(t,e,"mergeSourceNotMoved"),t.sourcePosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,"mergeSameElement");break;case $l:t.sourcePosition.isEqual(e.splitPosition)&&this._setRelation(t,e,"splitAtSource")}break;case Hl:{const i=t.newRange;if(!i)return;switch(e.constructor){case Bl:{const n=wa._createFromPositionAndShift(e.sourcePosition,e.howMany),o=n.containsPosition(i.start)||n.start.isEqual(i.start),r=n.containsPosition(i.end)||n.end.isEqual(i.end);!o&&!r||n.containsRange(i)||this._setRelation(t,e,{side:o?"left":"right",path:o?i.start.path.slice():i.end.path.slice()});break}case Wl:{const n=i.start.isEqual(e.targetPosition),o=i.start.isEqual(e.deletionPosition),r=i.end.isEqual(e.deletionPosition),s=i.end.isEqual(e.sourcePosition);(n||o||r||s)&&this._setRelation(t,e,{wasInLeftElement:n,wasStartBeforeMergedElement:o,wasEndBeforeMergedElement:r,wasInRightElement:s});break}}break}}}getContext(t,e,i){return{aIsStrong:i,aWasUndone:this._wasUndone(t),bWasUndone:this._wasUndone(e),abRelation:this._useRelations?this._getRelation(t,e):null,baRelation:this._useRelations?this._getRelation(e,t):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(t){const e=this.originalOperations.get(t);return e.wasUndone||this._history.isUndoneOperation(e)}_getRelation(t,e){const i=this.originalOperations.get(e),n=this._history.getUndoneOperation(i);if(!n)return null;const o=this.originalOperations.get(t),r=this._relations.get(o);return r&&r.get(n)||null}_setRelation(t,e,i){const n=this.originalOperations.get(t),o=this.originalOperations.get(e);let r=this._relations.get(n);r||(r=new Map,this._relations.set(n,r)),r.set(o,i)}}function qh(t,e){for(const i of t)i.baseVersion=e++}function Wh(t,e){for(let i=0;i<e;i++)t.push(new hc(0))}function $h(t,e,i){const n=t.nodes.getNode(0).getAttribute(e);if(n==i)return null;const o=new wa(t.position,t.position.getShiftedBy(t.howMany));return new Vl(o,e,n,i,0)}function Gh(t,e){return null===t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany)}function Yh(t,e){const i=[];for(let n=0;n<t.length;n++){const o=t[n],r=new Bl(o.start,o.end.offset-o.start.offset,e,0);i.push(r);for(let e=n+1;e<t.length;e++)t[e]=t[e]._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)[0];e=e._getTransformedByMove(r.sourcePosition,r.targetPosition,r.howMany)}return i}jh(Vl,Vl,(t,e,i)=>{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const n=t.range.getDifference(e.range).map(e=>new Vl(e,t.key,t.oldValue,t.newValue,0)),o=t.range.getIntersection(e.range);return o&&i.aIsStrong&&n.push(new Vl(o,e.key,e.newValue,t.newValue,0)),0==n.length?[new hc(0)]:n}return[t]}),jh(Vl,Fl,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const i=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(e=>new Vl(e,t.key,t.oldValue,t.newValue,t.baseVersion));if(e.shouldReceiveAttributes){const n=$h(e,t.key,t.oldValue);n&&i.unshift(n)}return i}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]}),jh(Vl,Wl,(t,e)=>{const i=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&i.push(wa._createFromPositionAndShift(e.graveyardPosition,1));const n=t.range._getTransformedByMergeOperation(e);return n.isCollapsed||i.push(n),i.map(e=>new Vl(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),jh(Vl,Bl,(t,e)=>function(t,e){const i=wa._createFromPositionAndShift(e.sourcePosition,e.howMany);let n=null,o=[];i.containsRange(t,!0)?n=t:t.start.hasSameParentAs(i.start)?(o=t.getDifference(i),n=t.getIntersection(i)):o=[t];const r=[];for(let t of o){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const i=e.getMovedRangeStart(),n=t.start.hasSameParentAs(i);t=t._getTransformedByInsertion(i,e.howMany,n),r.push(...t)}n&&r.push(n._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]);return r}(t.range,e).map(e=>new Vl(e,t.key,t.oldValue,t.newValue,t.baseVersion))),jh(Vl,$l,(t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const i=t.clone();return i.range=new wa(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,i]}return t.range=t.range._getTransformedBySplitOperation(e),[t]}),jh(Fl,Vl,(t,e)=>{const i=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const n=$h(t,e.key,e.newValue);n&&i.push(n)}return i}),jh(Fl,Fl,(t,e,i)=>(t.position.isEqual(e.position)&&i.aIsStrong||(t.position=t.position._getTransformedByInsertOperation(e)),[t])),jh(Fl,Bl,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),jh(Fl,$l,(t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t])),jh(Fl,Wl,(t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t])),jh(Hl,Fl,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t])),jh(Hl,Hl,(t,e,i)=>{if(t.name==e.name){if(!i.aIsStrong)return[new hc(0)];t.oldRange=e.newRange?e.newRange.clone():null}return[t]}),jh(Hl,Wl,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t])),jh(Hl,Bl,(t,e,i)=>{if(t.oldRange&&(t.oldRange=wa._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){if(i.abRelation){const n=wa._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if("left"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.start))return t.newRange.start.path=i.abRelation.path,t.newRange.end=n.end,[t];if("right"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.end))return t.newRange.start=n.start,t.newRange.end.path=i.abRelation.path,[t]}t.newRange=wa._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]}),jh(Hl,$l,(t,e,i)=>{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(i.abRelation){const n=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?t.newRange.start=ma._createAt(e.insertionPosition):t.newRange.start.isEqual(e.splitPosition)&&!i.abRelation.wasInLeftElement&&(t.newRange.start=ma._createAt(e.moveTargetPosition)),t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasInRightElement?t.newRange.end=ma._createAt(e.moveTargetPosition):t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?t.newRange.end=ma._createAt(e.insertionPosition):t.newRange.end=n.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]}),jh(Wl,Fl,(t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t])),jh(Wl,Wl,(t,e,i)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(i.bWasUndone){const i=e.graveyardPosition.path.slice();return i.push(0),t.sourcePosition=new ma(e.graveyardPosition.root,i),t.howMany=0,[t]}return[new hc(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const n="$graveyard"==t.targetPosition.root.rootName,o="$graveyard"==e.targetPosition.root.rootName,r=n&&!o;if(o&&!n||!r&&i.aIsStrong){const i=e.targetPosition._getTransformedByMergeOperation(e),n=t.targetPosition._getTransformedByMergeOperation(e);return[new Bl(i,t.howMany,n,0)]}return[new hc(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&i.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),jh(Wl,Bl,(t,e,i)=>{const n=wa._createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!i.bWasUndone&&!i.forceWeakRemove&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.sourcePosition)?[new hc(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])}),jh(Wl,$l,(t,e,i)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const n=0!=e.howMany,o=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(n||o||"mergeTargetNotMoved"==i.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}if(t.sourcePosition.isEqual(e.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if("mergeSameElement"==i.abRelation||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}),jh(Bl,Fl,(t,e)=>{const i=wa._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=i.start,t.howMany=i.end.offset-i.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]}),jh(Bl,Bl,(t,e,i)=>{const n=wa._createFromPositionAndShift(t.sourcePosition,t.howMany),o=wa._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,s=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),r=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Gh(t,e)&&Gh(e,t))return[e.getReversed()];if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Yh([n],r);if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return n.start=n.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),n.end=n.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Yh([n],r);const l=xn(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==l||"extension"==l)return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Yh([n],r);"remove"!=t.type||"remove"==e.type||i.aWasUndone||i.forceWeakRemove?"remove"==t.type||"remove"!=e.type||i.bWasUndone||i.forceWeakRemove||(s=!1):s=!0;const c=[],d=n.getDifference(o);for(const t of d){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const i="same"==xn(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),n=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,i);c.push(...n)}const h=n.getIntersection(o);return null!==h&&s&&(h.start=h.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),h.end=h.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===c.length?c.push(h):1==c.length?o.start.isBefore(n.start)||o.start.isEqual(n.start)?c.unshift(h):c.push(h):c.splice(1,0,h)),0===c.length?[new hc(t.baseVersion)]:Yh(c,r)}),jh(Bl,$l,(t,e,i)=>{let n=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(n=t.targetPosition._getTransformedBySplitOperation(e));const o=wa._createFromPositionAndShift(t.sourcePosition,t.howMany);if(o.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=n,[t];if(o.start.hasSameParentAs(e.splitPosition)&&o.containsPosition(e.splitPosition)){let t=new wa(e.splitPosition,o.end);t=t._getTransformedBySplitOperation(e);return Yh([new wa(o.start,e.splitPosition),t],n)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==i.abRelation&&(n=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==i.abRelation&&(n=t.targetPosition);const r=[o._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const n=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);t.howMany>1&&n&&!i.aWasUndone&&r.push(wa._createFromPositionAndShift(e.insertionPosition,1))}return Yh(r,n)}),jh(Bl,Wl,(t,e,i)=>{const n=wa._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.sourcePosition))if("remove"!=t.type||i.forceWeakRemove){if(1==t.howMany)return i.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new hc(0)]}else if(!i.aWasUndone){const i=[];let n=e.graveyardPosition.clone(),o=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(i.push(new Bl(t.sourcePosition,t.howMany-1,t.targetPosition,0)),n=n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),o=o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));const r=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition),s=new Bl(n,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const l=new ma(s.targetPosition.root,a);o=o._getTransformedByMove(n,r,1);const c=new Bl(o,e.howMany,l,0);return i.push(s),i.push(c),i}const o=wa._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=o.start,t.howMany=o.end.offset-o.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]}),jh(Ul,Fl,(t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t])),jh(Ul,Wl,(t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t])),jh(Ul,Bl,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),jh(Ul,Ul,(t,e,i)=>{if(t.position.isEqual(e.position)){if(!i.aIsStrong)return[new hc(0)];t.oldName=e.newName}return[t]}),jh(Ul,$l,(t,e)=>{if("same"==xn(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){const e=new Ul(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,e]}return t.position=t.position._getTransformedBySplitOperation(e),[t]}),jh(ql,ql,(t,e,i)=>{if(t.root===e.root&&t.key===e.key){if(!i.aIsStrong||t.newValue===e.newValue)return[new hc(0)];t.oldValue=e.newValue}return[t]}),jh($l,Fl,(t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset<e.position.offset&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByInsertOperation(e),t.insertionPosition=t.insertionPosition._getTransformedByInsertOperation(e),[t])),jh($l,Wl,(t,e,i)=>{if(!t.graveyardPosition&&!i.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const i=e.graveyardPosition.path.slice();i.push(0);const n=new ma(e.graveyardPosition.root,i),o=$l.getInsertionPosition(new ma(e.graveyardPosition.root,i)),r=new $l(n,0,o,null,0);return t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=$l.getInsertionPosition(t.splitPosition),t.graveyardPosition=r.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[r,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=$l.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),jh($l,Bl,(t,e,i)=>{const n=wa._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const o=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition);if(!i.bWasUndone&&o){const i=t.splitPosition._getTransformedByMoveOperation(e),n=t.graveyardPosition._getTransformedByMoveOperation(e),o=n.path.slice();o.push(0);const r=new ma(n.root,o);return[new Bl(i,t.howMany,r,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}const o=t.splitPosition.isEqual(e.targetPosition);if(o&&("insertAtSource"==i.baRelation||"splitBefore"==i.abRelation))return t.howMany+=e.howMany,t.splitPosition=t.splitPosition._getTransformedByDeletion(e.sourcePosition,e.howMany),t.insertionPosition=$l.getInsertionPosition(t.splitPosition),[t];if(o&&i.abRelation&&i.abRelation.howMany){const{howMany:e,offset:n}=i.abRelation;return t.howMany+=e,t.splitPosition=t.splitPosition.getShiftedBy(n),[t]}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.splitPosition)){const i=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=i,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany),t.splitPosition=e.sourcePosition.clone(),t.insertionPosition=$l.getInsertionPosition(t.splitPosition),[t]}return e.sourcePosition.isEqual(e.targetPosition)||(t.splitPosition.hasSameParentAs(e.sourcePosition)&&t.splitPosition.offset<=e.sourcePosition.offset&&(t.howMany-=e.howMany),t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset<e.targetPosition.offset&&(t.howMany+=e.howMany)),t.splitPosition.stickiness="toNone",t.splitPosition=t.splitPosition._getTransformedByMoveOperation(e),t.splitPosition.stickiness="toNext",t.graveyardPosition?t.insertionPosition=t.insertionPosition._getTransformedByMoveOperation(e):t.insertionPosition=$l.getInsertionPosition(t.splitPosition),[t]}),jh($l,$l,(t,e,i)=>{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new hc(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new hc(0)];if("splitBefore"==i.abRelation)return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const n="$graveyard"==t.splitPosition.root.rootName,o="$graveyard"==e.splitPosition.root.rootName,r=n&&!o;if(o&&!n||!r&&i.aIsStrong){const i=[];return e.howMany&&i.push(new Bl(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&i.push(new Bl(t.splitPosition,t.howMany,t.moveTargetPosition,0)),i}return[new hc(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.baRelation){const i=e.insertionPosition.path.slice();i.push(0);const n=new ma(e.insertionPosition.root,i);return[t,new Bl(t.insertionPosition,1,n,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offset<e.splitPosition.offset&&(t.howMany-=e.howMany),t.splitPosition=t.splitPosition._getTransformedBySplitOperation(e),t.insertionPosition=$l.getInsertionPosition(t.splitPosition),[t]});class Kh extends ps{constructor(t){super(t),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}class Qh extends ps{constructor(t){super(t),this.domEventType=["mousedown","mouseup","mouseover","mouseout"]}onDomEvent(t){this.fire(t.type,t)}}class Jh{constructor(t){this.document=t}createDocumentFragment(t){return new or(this.document,t)}createElement(t,e,i){return new fo(this.document,t,e,i)}createText(t){return new Tn(this.document,t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,i){return i._insertChild(t,e)}removeChildren(t,e,i){return i._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const i=t.parent;if(i){const n=i.getChildIndex(t);return this.removeChildren(n,1,i),this.insertChild(n,e,i),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const i=e.getChildIndex(t);this.remove(t),this.insertChild(i,t.getChildren(),e)}}rename(t,e){const i=new fo(this.document,t,e.getAttributes(),e.getChildren());return this.replace(e,i)?i:null}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){ke(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return xo._createAt(t,e)}createPositionAfter(t){return xo._createAfter(t)}createPositionBefore(t){return xo._createBefore(t)}createRange(t,e){return new Ao(t,e)}createRangeOn(t){return Ao._createOn(t)}createRangeIn(t){return Ao._createIn(t)}createSelection(t,e,i){return new Eo(t,e,i)}}const Zh=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,Xh=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,tu=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,eu=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,iu=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,nu=new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","rebeccapurple","currentcolor","transparent"]);function ou(t){return t.startsWith("#")?Zh.test(t):t.startsWith("rgb")?Xh.test(t)||tu.test(t):t.startsWith("hsl")?eu.test(t)||iu.test(t):nu.has(t.toLowerCase())}const ru=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;const su=/^[+-]?[0-9]*([.][0-9]+)?%$/;const au=["repeat-x","repeat-y","repeat","space","round","no-repeat"];const lu=["center","top","bottom","left","right"];function cu(t){return lu.includes(t)}const du=["fixed","scroll","local"];function hu(t){return du.includes(t)}const uu=/^url\(/;function mu(t){return uu.test(t)}function gu(t){return t.replace(/, /g,",").split(" ").map(t=>t.replace(/,/g,", "))}function fu(t){t.setNormalizer("background",pu),t.setNormalizer("background-color",t=>({path:"background.color",value:t})),t.setReducer("background",t=>{const e=[];return e.push(["background-color",t.color]),e})}function pu(t){const e={},i=gu(t);for(const t of i)n=t,au.includes(n)?(e.repeat=e.repeat||[],e.repeat.push(t)):cu(t)?(e.position=e.position||[],e.position.push(t)):hu(t)?e.attachment=t:ou(t)?e.color=t:mu(t)&&(e.image=t);var n;return{path:"background",value:e}}class wu extends Oc{constructor(t,e){super(t),this.view=e,this._toolbarConfig=Jd(t.config.get("toolbar")),this._elementReplacer=new zs}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,n=e.editing.view,o=i.editable,r=n.document.getRoot();o.name=r.rootName,i.render();const s=o.element;this.setEditableElement(o.name,s),this.focusTracker.add(s),i.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(s),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,i=t.editing.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,this._toolbarConfig.viewportTopOffset&&(e.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),function({origin:t,originKeystrokeHandler:e,originFocusTracker:i,toolbar:n,beforeFocus:o,afterBlur:r}){i.add(n.element),e.set("Alt+F10",(t,e)=>{i.isFocused&&!n.focusTracker.isFocused&&(o&&o(),n.focus(),e())}),n.keystrokes.set("Esc",(e,i)=>{n.focusTracker.isFocused&&(t.focus(),r&&r(),i())})}({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e.toolbar})}_initPlaceholder(){const t=this.editor,e=t.editing.view,i=e.document.getRoot(),n=t.sourceElement,o=t.config.get("placeholder")||n&&"textarea"===n.tagName.toLowerCase()&&n.getAttribute("placeholder");o&&Nh({view:e,element:i,text:o,isDirectHost:!1,keepOnFocus:!0})}}i(6045);class bu extends dh{constructor(t,e,i={}){super(t),this.stickyPanel=new Ih(t),this.toolbar=new Zd(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new uh(t,e)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}class ku extends Lc{constructor(t,e){super(e),cn(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new bu(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new wu(this,n),function(t){if(!O(t.updateSourceElement))throw new a("attachtoform-missing-elementapi-interface",t);const e=t.sourceElement;if(e&&"textarea"===e.tagName.toLowerCase()&&e.form){let i;const n=e.form,o=()=>t.updateSourceElement();O(n.submit)&&(i=n.submit,n.submit=()=>{o(),i.apply(n)}),n.addEventListener("submit",o),t.on("destroy",()=>{n.removeEventListener("submit",o),i&&(n.submit=i)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise(i=>{const n=new this(t,e);i(n.initPlugins().then(()=>n.ui.init(cn(t)?t:null)).then(()=>{if(!cn(t)&&e.initialData)throw new a("editor-create-initial-data",null);const i=void 0!==e.initialData?e.initialData:function(t){return cn(t)?(e=t,e instanceof HTMLTextAreaElement?e.value:e.innerHTML):t;var e}(t);return n.data.init(i)}).then(()=>n.fire("ready")).then(()=>n))})}}se(ku,zc),se(ku,Dc);class _u{constructor(t){this.files=function(t){const e=t.files?Array.from(t.files):[],i=t.items?Array.from(t.items):[];if(e.length)return e;return i.filter(t=>"file"===t.kind).map(t=>t.getAsFile())}(t),this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}set effectAllowed(t){this._native.effectAllowed=t}get effectAllowed(){return this._native.effectAllowed}set dropEffect(t){this._native.dropEffect=t}get dropEffect(){return this._native.dropEffect}get isCanceled(){return"none"==this._native.dropEffect||!!this._native.mozUserCancelled}}class vu extends ps{constructor(t){super(t);const i=this.document;function n(t){return(n,o)=>{o.preventDefault();const r=o.dropRange?[o.dropRange]:null,s=new e(i,t);i.fire(s,{dataTransfer:o.dataTransfer,method:n.name,targetRanges:r,target:o.target}),s.stop.called&&o.stopPropagation()}}this.domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"],this.listenTo(i,"paste",n("clipboardInput"),{priority:"low"}),this.listenTo(i,"drop",n("clipboardInput"),{priority:"low"}),this.listenTo(i,"dragover",n("dragging"),{priority:"low"})}onDomEvent(t){const e={dataTransfer:new _u(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"!=t.type&&"dragover"!=t.type||(e.dropRange=function(t,e){const i=e.target.ownerDocument,n=e.clientX,o=e.clientY;let r;i.caretRangeFromPoint&&i.caretRangeFromPoint(n,o)?r=i.caretRangeFromPoint(n,o):e.rangeParent&&(r=i.createRange(),r.setStart(e.rangeParent,e.rangeOffset),r.collapse(!0));if(r)return t.domConverter.domRangeToView(r);return null}(this.view,t)),this.fire(t.type,t,e)}}const yu=["figcaption","li"];class xu extends ae{static get pluginName(){return"ClipboardPipeline"}init(){this.editor.editing.view.addObserver(vu),this._setupPasteDrop(),this._setupCopyCut()}_setupPasteDrop(){const t=this.editor,i=t.model,n=t.editing.view,o=n.document;this.listenTo(o,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(t,i)=>{const o=i.dataTransfer;let r=i.content||"";var s;r||(o.getData("text/html")?r=function(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(t,e)=>1==e.length?" ":e)}(o.getData("text/html")):o.getData("text/plain")&&(((s=(s=o.getData("text/plain")).replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br>").replace(/^\s/,"&nbsp;").replace(/\s$/,"&nbsp;").replace(/\s\s/g," &nbsp;")).includes("</p><p>")||s.includes("<br>"))&&(s=`<p>${s}</p>`),r=s),r=this.editor.data.htmlProcessor.toView(r));const a=new e(this,"inputTransformation");this.fire(a,{content:r,dataTransfer:o,targetRanges:i.targetRanges,method:i.method}),a.stop.called&&t.stop(),n.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,e)=>{if(e.content.isEmpty)return;const n=this.editor.data.toModel(e.content,"$clipboardHolder");0!=n.childCount&&(t.stop(),i.change(()=>{this.fire("contentInsertion",{content:n,method:e.method,dataTransfer:e.dataTransfer,targetRanges:e.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(t,e)=>{e.resultRange=i.insertContent(e.content)},{priority:"low"})}_setupCopyCut(){const t=this.editor,e=t.model.document,i=t.editing.view.document;function n(n,o){const r=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));i.fire("clipboardOutput",{dataTransfer:r,content:s,method:n.name})}this.listenTo(i,"copy",n,{priority:"low"}),this.listenTo(i,"cut",(e,i)=>{t.isReadOnly?i.preventDefault():n(e,i)},{priority:"low"}),this.listenTo(i,"clipboardOutput",(i,n)=>{n.content.isEmpty||(n.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(n.content)),n.dataTransfer.setData("text/plain",function t(e){let i="";if(e.is("$text")||e.is("$textProxy"))i=e.data;else if(e.is("element","img")&&e.hasAttribute("alt"))i=e.getAttribute("alt");else if(e.is("element","br"))i="\n";else{let n=null;for(const o of e.getChildren()){const e=t(o);n&&(n.is("containerElement")||o.is("containerElement"))&&(yu.includes(n.name)||yu.includes(o.name)?i+="\n":i+="\n\n"),i+=e,n=o}}return i}(n.content))),"cut"==n.method&&t.model.deleteContent(e.selection)},{priority:"low"})}}function*Au(t,e){for(const i of e)i&&t.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}class Cu extends ce{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i,n){const o=i.isCollapsed,r=i.getFirstRange(),s=r.start.parent,a=r.end.parent;if(n.isLimit(s)||n.isLimit(a))return void(o||s!=a||t.deleteContent(i));if(o){const t=Au(e.model.schema,i.getAttributes());Tu(e,r.start),e.setSelectionAttribute(t)}else{const n=!(r.start.isAtStart&&r.end.isAtEnd),o=s==a;t.deleteContent(i,{leaveUnmerged:n}),n&&(o?Tu(e,i.focus):e.setSelection(a,0))}}(this.editor.model,i,e.selection,t.schema),this.fire("afterExecute",{writer:i})})}}function Tu(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)}class Eu extends Kr{constructor(t){super(t);const e=this.document;e.on("keydown",(t,i)=>{if(this.isEnabled&&i.keyCode==$o.enter){const n=new Po(e,"enter",e.selection.getFirstRange());e.fire(n,new fs(e,i.domEvent,{isSoft:i.shiftKey})),n.stop.called&&t.stop()}})}observe(){}}class Su extends ae{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,i=e.document;e.addObserver(Eu),t.commands.add("enter",new Cu(t)),this.listenTo(i,"enter",(i,n)=>{n.preventDefault(),n.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}}class Pu{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=(t,e)=>{"transparent"!=e.type&&e!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(t){this.size+=t,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t){this.isLocked&&!t||(this._batch=null,this.size=0)}}class Mu extends ce{constructor(t,e){super(t),this.direction=e,this._buffer=new Pu(t.model,t.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,i=e.document;e.enqueueChange(this._buffer.batch,n=>{this._buffer.lock();const o=n.createSelection(t.selection||i.selection),r=t.sequence||1,s=o.isCollapsed;if(o.isCollapsed&&e.modifySelection(o,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(r))return void this._replaceEntireContentWithParagraph(n);if(this._shouldReplaceFirstBlockWithParagraph(o,r))return void this.editor.execute("paragraph",{selection:o});if(o.isCollapsed)return;let a=0;o.getFirstRange().getMinimalFlatRanges().forEach(t=>{a+=To(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(o,{doNotResetEntireContent:s,direction:this.direction}),this._buffer.input(a),n.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,i=e.document.selection,n=e.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(n)))return!1;if(!e.schema.checkChild(n,"paragraph"))return!1;const o=n.getChild(0);return!o||"paragraph"!==o.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,i=e.document.selection,n=e.schema.getLimitElement(i),o=t.createElement("paragraph");t.remove(t.createRangeIn(n)),t.insert(o,n),t.setSelection(o,0)}_shouldReplaceFirstBlockWithParagraph(t,e){const i=this.editor.model;if(e>1||"backward"!=this.direction)return!1;if(!t.isCollapsed)return!1;const n=t.getFirstPosition(),o=i.schema.getLimitElement(n),r=o.getChild(0);return n.parent==r&&(!!t.containsEntireContent(r)&&(!!i.schema.checkChild(o,"paragraph")&&"paragraph"!=r.name))}}class Iu extends Kr{constructor(t){super(t);const e=t.document;let i=0;function n(t,i,n){const o=new Po(e,"delete",e.selection.getFirstRange());e.fire(o,new fs(e,i,n)),o.stop.called&&t.stop()}e.on("keyup",(t,e)=>{e.keyCode!=$o.delete&&e.keyCode!=$o.backspace||(i=0)}),e.on("keydown",(t,e)=>{const o={};if(e.keyCode==$o.delete)o.direction="forward",o.unit="character";else{if(e.keyCode!=$o.backspace)return;o.direction="backward",o.unit="codePoint"}const r=Uo.isMac?e.altKey:e.ctrlKey;o.unit=r?"word":o.unit,o.sequence=++i,n(t,e.domEvent,o)}),Uo.isAndroid&&e.on("beforeinput",(e,i)=>{if("deleteContentBackward"!=i.domEvent.inputType)return;const o={unit:"codepoint",direction:"backward",sequence:1},r=i.domTarget.ownerDocument.defaultView.getSelection();r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset&&(o.selectionToRemove=t.domConverter.domSelectionToView(r)),n(e,i.domEvent,o)})}observe(){}}class Lu extends ae{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,i=e.document;e.addObserver(Iu);const n=new Mu(t,"forward");if(t.commands.add("deleteForward",n),t.commands.add("forwardDelete",n),t.commands.add("delete",new Mu(t,"backward")),this.listenTo(i,"delete",(i,n)=>{const o={unit:n.unit,sequence:n.sequence};if(n.selectionToRemove){const e=t.model.createSelection(),i=[];for(const e of n.selectionToRemove.getRanges())i.push(t.editing.mapper.toModelRange(e));e.setTo(i),o.selection=e}t.execute("forward"==n.direction?"deleteForward":"delete",o),n.preventDefault(),e.scrollToTheSelection()},{priority:"low"}),Uo.isAndroid){let t=null;this.listenTo(i,"delete",(e,i)=>{const n=i.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}},{priority:"lowest"}),this.listenTo(i,"keyup",(e,i)=>{if(t){const e=i.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset),e.extend(t.focusNode,t.focusOffset),t=null}})}}}class Nu{constructor(){this._stack=[]}add(t,e){const i=this._stack,n=i[0];this._insertDescriptor(t);const o=i[0];n===o||Ru(n,o)||this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:e})}remove(t,e){const i=this._stack,n=i[0];this._removeDescriptor(t);const o=i[0];n===o||Ru(n,o)||this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:e})}_insertDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t.id);if(Ru(t,e[i]))return;i>-1&&e.splice(i,1);let n=0;for(;e[n]&&Ou(e[n],t);)n++;e.splice(n,0,t)}_removeDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t);i>-1&&e.splice(i,1)}}function Ru(t,e){return t&&e&&t.priority==e.priority&&zu(t.classes)==zu(e.classes)}function Ou(t,e){return t.priority>e.priority||!(t.priority<e.priority)&&zu(t.classes)>zu(e.classes)}function zu(t){return Array.isArray(t)?t.sort().join(","):t}se(Nu,g);function Du(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function Vu(t,e,i={}){if(!t.is("containerElement"))throw new a("widget-to-widget-wrong-element-type",null,{element:t});return e.setAttribute("contenteditable","false",t),e.addClass("ck-widget",t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=Gu,i.label&&function(t,e,i){i.setCustomProperty("widgetLabel",e,t)}(t,i.label,e),i.hasSelectionHandle&&function(t,e){const i=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t),i=new Id;return i.set("content",'<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z"/><path fill-opacity=".256" d="M1 1h14v14H1z"/><g class="ck-icon__selected-indicator"><path d="M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z"/><path fill-opacity=".254" d="M1 1h14v14H1z"/></g></svg>'),i.render(),e.appendChild(i.element),e}));e.insert(e.createPositionAt(t,0),i),e.addClass(["ck-widget_with-selection-handle"],t)}(t,e),Fu(t,e,ju,Bu),t}function ju(t,e,i){if(e.classes&&i.addClass(pn(e.classes),t),e.attributes)for(const n in e.attributes)i.setAttribute(n,e.attributes[n],t)}function Bu(t,e,i){if(e.classes&&i.removeClass(pn(e.classes),t),e.attributes)for(const n in e.attributes)i.removeAttribute(n,t)}function Fu(t,e,i,n){const o=new Nu;o.on("change:top",(e,o)=>{o.oldDescriptor&&n(t,o.oldDescriptor,o.writer),o.newDescriptor&&i(t,o.newDescriptor,o.writer)}),e.setCustomProperty("addHighlight",(t,e,i)=>o.add(e,i),t),e.setCustomProperty("removeHighlight",(t,e,i)=>o.remove(e,i),t)}function Hu(t){const e=t.getCustomProperty("widgetLabel");return e?"function"==typeof e?e():e:""}function Uu(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(i,n,o)=>{e.setAttribute("contenteditable",o?"false":"true",t)}),t.on("change:isFocused",(i,n,o)=>{o?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),t}function qu(t,e){const i=t.getSelectedElement();if(i){const n=Ku(t);if(n)return e.createPositionAt(i,n);if(e.schema.isBlock(i))return e.createPositionAfter(i)}const n=t.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return e.createPositionAt(n,0);const i=e.createPositionAfter(n);return t.focus.isTouching(i)?i:e.createPositionBefore(n)}return t.focus}function Wu(t,e){const i=t.getSelectedElement();return!!i&&e.isObject(i)}function $u(t,e){const i=new Bs(Or.window),n=i.getIntersection(t),o=e.height+yh.arrowVerticalOffset;if(t.top-o>i.top||t.bottom+o<i.bottom)return null;const r=n||t,s=r.left+r.width/2-e.width/2;return{top:Math.max(t.top,0)+yh.arrowVerticalOffset,left:s,name:"arrow_n"}}function Gu(){return null}function Yu(t,e,i){return t&&Du(t)&&!i.isInline(e)}function Ku(t){return t.getAttribute("widget-type-around")}const Qu=[Yo("arrowUp"),Yo("arrowRight"),Yo("arrowDown"),Yo("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let t=112;t<=135;t++)Qu.push(t);function Ju(t){return!(!t.ctrlKey&&!t.metaKey)||Qu.includes(t.keyCode)}i(2928);const Zu=["before","after"],Xu=(new DOMParser).parseFromString('<svg viewBox="0 0 10 8" xmlns="http://www.w3.org/2000/svg"><path d="M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038"/></svg>',"image/svg+xml").firstChild;class tm extends ae{static get pluginName(){return"WidgetTypeAround"}static get requires(){return[Su,Lu]}constructor(t){super(t),this._currentFakeCaretModelElement=null}init(){const t=this.editor,e=t.editing.view;this.on("change:isEnabled",(i,n,o)=>{e.change(t=>{for(const i of e.document.roots)o?t.removeClass("ck-widget__type-around_disabled",i):t.addClass("ck-widget__type-around_disabled",i)}),o||t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableDeleteContentIntegration()}destroy(){this._currentFakeCaretModelElement=null}_insertParagraph(t,e){const i=this.editor,n=i.editing.view;i.execute("insertParagraph",{position:i.model.createPositionAt(t,e)}),n.focus(),n.scrollToTheSelection()}_listenToIfEnabled(t,e,i,n){this.listenTo(t,e,(...t)=>{this.isEnabled&&i(...t)},n)}_insertParagraphAccordingToFakeCaretPosition(){const t=this.editor.model.document.selection,e=Ku(t);if(!e)return!1;const i=t.getSelectedElement();return this._insertParagraph(i,e),!0}_enableTypeAroundUIInjection(){const t=this.editor,e=t.model.schema,i=t.locale.t,n={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};t.editing.downcastDispatcher.on("insert",(t,i,o)=>{const r=o.mapper.toViewElement(i.item);Yu(r,i.item,e)&&function(t,e,i){const n=t.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},(function(t){const i=this.toDomElement(t);return function(t,e){for(const i of Zu){const n=new dd({tag:"div",attributes:{class:["ck","ck-widget__type-around__button","ck-widget__type-around__button_"+i],title:e[i]},children:[t.ownerDocument.importNode(Xu,!0)]});t.appendChild(n.render())}}(i,e),function(t){const e=new dd({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});t.appendChild(e.render())}(i),i}));t.insert(t.createPositionAt(i,"end"),n)}(o.writer,n,r)},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){const t=this.editor,e=t.model,i=e.document.selection,n=e.schema,o=t.editing.view;function r(t){return"ck-widget_type-around_show-fake-caret_"+t}this._listenToIfEnabled(o.document,"arrowKey",(t,e)=>{this._handleArrowKeyPress(t,e)},{context:[Du,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",(e,i)=>{i.directChange&&t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(e.document,"change:data",()=>{const e=i.getSelectedElement();if(e){if(Yu(t.editing.mapper.toViewElement(e),e,n))return}t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})}),this._listenToIfEnabled(t.editing.downcastDispatcher,"selection",(t,e,i)=>{const o=i.writer;if(this._currentFakeCaretModelElement){const t=i.mapper.toViewElement(this._currentFakeCaretModelElement);t&&(o.removeClass(Zu.map(r),t),this._currentFakeCaretModelElement=null)}const s=e.selection.getSelectedElement();if(!s)return;const a=i.mapper.toViewElement(s);if(!Yu(a,s,n))return;const l=Ku(e.selection);l&&(o.addClass(r(l),a),this._currentFakeCaretModelElement=s)}),this._listenToIfEnabled(t.ui.focusTracker,"change:isFocused",(e,i,n)=>{n||t.model.change(t=>{t.removeSelectionAttribute("widget-type-around")})})}_handleArrowKeyPress(t,e){const i=this.editor,n=i.model,o=n.document.selection,r=n.schema,s=i.editing.view,a=Zo(e.keyCode,i.locale.contentLanguageDirection),l=s.document.selection.getSelectedElement();let c;Yu(l,i.editing.mapper.toModelElement(l),r)?c=this._handleArrowKeyPressOnSelectedWidget(a):o.isCollapsed&&(c=this._handleArrowKeyPressWhenSelectionNextToAWidget(a)),c&&(e.preventDefault(),t.stop())}_handleArrowKeyPressOnSelectedWidget(t){const e=this.editor.model,i=Ku(e.document.selection);return e.change(e=>{if(!i)return e.setSelectionAttribute("widget-type-around",t?"after":"before"),!0;if(!(i===(t?"after":"before")))return e.removeSelectionAttribute("widget-type-around"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(t){const e=this.editor,i=e.model,n=i.schema,o=e.plugins.get("Widget"),r=o._getObjectElementNextToSelection(t);return!!Yu(e.editing.mapper.toViewElement(r),r,n)&&(i.change(e=>{o._setSelectionOverElement(r),e.setSelectionAttribute("widget-type-around",t?"before":"after")}),!0)}_enableInsertingParagraphsOnButtonClick(){const t=this.editor,e=t.editing.view;this._listenToIfEnabled(e.document,"mousedown",(i,n)=>{const o=n.domTarget.closest(".ck-widget__type-around__button");if(!o)return;const r=function(t){return t.classList.contains("ck-widget__type-around__button_before")?"before":"after"}(o),s=function(t,e){const i=t.closest(".ck-widget");return e.mapDomToView(i)}(o,e.domConverter),a=t.editing.mapper.toModelElement(s);this._insertParagraph(a,r),n.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){const t=this.editor,e=t.model.document.selection,i=t.editing.view;this._listenToIfEnabled(i.document,"enter",(i,n)=>{if("atTarget"!=i.eventPhase)return;const o=e.getSelectedElement(),r=t.editing.mapper.toViewElement(o),s=t.model.schema;let a;this._insertParagraphAccordingToFakeCaretPosition()?a=!0:Yu(r,o,s)&&(this._insertParagraph(o,n.isSoft?"before":"after"),a=!0),a&&(n.preventDefault(),i.stop())},{context:Du})}_enableInsertingParagraphsOnTypingKeystroke(){const t=this.editor.editing.view,e=[$o.enter,$o.delete,$o.backspace];this._listenToIfEnabled(t.document,"keydown",(t,i)=>{e.includes(i.keyCode)||Ju(i)||this._insertParagraphAccordingToFakeCaretPosition()},{priority:"high"})}_enableDeleteIntegration(){const t=this.editor,e=t.editing.view,i=t.model,n=i.schema;this._listenToIfEnabled(e.document,"delete",(e,o)=>{if("atTarget"!=e.eventPhase)return;const r=Ku(i.document.selection);if(!r)return;const s=o.direction,a=i.document.selection.getSelectedElement(),l="forward"==s;if("before"===r===l)t.execute("delete",{selection:i.createSelection(a,"on")});else{const e=n.getNearestSelectionRange(i.createPositionAt(a,r),s);if(e)if(e.isCollapsed){const o=i.createSelection(e.start);if(i.modifySelection(o,{direction:s}),o.focus.isEqual(e.start)){const t=function(t,e){let i=e;for(const n of e.getAncestors({parentFirst:!0})){if(n.childCount>1||t.isLimit(n))break;i=n}return i}(n,e.start.parent);i.deleteContent(i.createSelection(t,"on"),{doNotAutoparagraph:!0})}else i.change(i=>{i.setSelection(e),t.execute(l?"deleteForward":"delete")})}else i.change(i=>{i.setSelection(e),t.execute(l?"deleteForward":"delete")})}o.preventDefault(),e.stop()},{context:Du})}_enableInsertContentIntegration(){const t=this.editor,e=this.editor.model,i=e.document.selection;this._listenToIfEnabled(t.model,"insertContent",(t,[n,o])=>{if(o&&!o.is("documentSelection"))return;const r=Ku(i);return r?(t.stop(),e.change(t=>{const o=i.getSelectedElement(),s=e.createPositionAt(o,r),a=t.createSelection(s),l=e.insertContent(n,a);return t.setSelection(a),l})):void 0},{priority:"high"})}_enableDeleteContentIntegration(){const t=this.editor,e=this.editor.model.document.selection;this._listenToIfEnabled(t.model,"deleteContent",(t,[i])=>{if(i&&!i.is("documentSelection"))return;Ku(e)&&t.stop()},{priority:"high"})}}i(4936);function em(t){const e=t.model;return(i,n)=>{const o=n.keyCode==$o.arrowup,r=n.keyCode==$o.arrowdown,s=n.shiftKey,a=e.document.selection;if(!o&&!r)return;const l=r;if(s&&function(t,e){return!t.isCollapsed&&t.isBackward==e}(a,l))return;const c=function(t,e,i){const n=t.model;if(i){const t=e.isCollapsed?e.focus:e.getLastPosition(),i=im(n,t,"forward");if(!i)return null;const o=n.createRange(t,i),r=nm(n.schema,o,"backward");return r&&t.isBefore(r)?n.createRange(t,r):null}{const t=e.isCollapsed?e.focus:e.getFirstPosition(),i=im(n,t,"backward");if(!i)return null;const o=n.createRange(i,t),r=nm(n.schema,o,"forward");return r&&t.isAfter(r)?n.createRange(r,t):null}}(t,a,l);c&&!c.isCollapsed&&function(t,e,i){const n=t.model,o=t.view.domConverter;if(i){const t=n.createSelection(e.start);n.modifySelection(t),t.focus.isAtEnd||e.start.isEqual(t.focus)||(e=n.createRange(t.focus,e.end))}const r=t.mapper.toViewRange(e),s=o.viewRangeToDom(r),a=Bs.getDomRangeRects(s);let l;for(const t of a)if(void 0!==l){if(Math.round(t.top)>=l)return!1;l=Math.max(l,Math.round(t.bottom))}else l=Math.round(t.bottom);return!0}(t,c,l)&&(e.change(t=>{const i=l?c.end:c.start;if(s){const n=e.createSelection(a.anchor);n.setFocus(i),t.setSelection(n)}else t.setSelection(i)}),i.stop(),n.preventDefault(),n.stopPropagation())}}function im(t,e,i){const n=t.schema,o=t.createRangeIn(e.root),r="forward"==i?"elementStart":"elementEnd";for(const{previousPosition:t,item:s,type:a}of o.getWalker({startPosition:e,direction:i})){if(n.isLimit(s)&&!n.isInline(s))return t;if(a==r&&n.isBlock(s))return null}return null}function nm(t,e,i){const n="backward"==i?e.end:e.start;if(t.checkChild(n,"$text"))return n;for(const{nextPosition:n}of e.getWalker({direction:i}))if(t.checkChild(n,"$text"))return n}class om extends ae{static get pluginName(){return"Widget"}static get requires(){return[tm,Lu]}init(){const t=this.editor.editing.view,e=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,e,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const n=i.writer,o=n.document.selection,r=o.getSelectedElement();let s=null;for(const t of o.getRanges())for(const e of t){const t=e.item;Du(t)&&!rm(t,s)&&(n.addClass("ck-widget_selected",t),this._previouslySelected.add(t),s=t,t==r&&n.setSelection(o.getRanges(),{fake:!0,label:Hu(r)}))}},{priority:"low"}),t.addObserver(Qh),this.listenTo(e,"mousedown",(...t)=>this._onMousedown(...t)),this.listenTo(e,"arrowKey",(...t)=>{this._handleSelectionChangeOnArrowKeyPress(...t)},{context:[Du,"$text"]}),this.listenTo(e,"arrowKey",(...t)=>{this._preventDefaultOnArrowKeyPress(...t)},{context:"$root"}),this.listenTo(e,"arrowKey",em(this.editor.editing),{context:"$text"}),this.listenTo(e,"delete",(t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())},{context:"$root"})}_onMousedown(t,e){const i=this.editor,n=i.editing.view,o=n.document;let r=e.target;if(function(t){for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(Du(t))return!1;t=t.parent}return!1}(r)){if((Uo.isSafari||Uo.isGecko)&&e.domEvent.detail>=3){const t=i.editing.mapper,n=r.is("attributeElement")?r.findAncestor(t=>!t.is("attributeElement")):r,o=t.toModelElement(n);e.preventDefault(),this.editor.model.change(t=>{t.setSelection(o,"in")})}return}if(!Du(r)&&(r=r.findAncestor(Du),!r))return;Uo.isAndroid&&e.preventDefault(),o.isFocused||n.focus();const s=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_handleSelectionChangeOnArrowKeyPress(t,e){const i=e.keyCode,n=this.editor.model,o=n.schema,r=n.document.selection,s=r.getSelectedElement(),a=Zo(i,this.editor.locale.contentLanguageDirection);if(s&&o.isObject(s)){const i=a?r.getLastPosition():r.getFirstPosition(),s=o.getNearestSelectionRange(i,a?"forward":"backward");return void(s&&(n.change(t=>{t.setSelection(s)}),e.preventDefault(),t.stop()))}if(!r.isCollapsed)return;const l=this._getObjectElementNextToSelection(a);l&&o.isObject(l)&&(this._setSelectionOverElement(l),e.preventDefault(),t.stop())}_preventDefaultOnArrowKeyPress(t,e){const i=this.editor.model,n=i.schema,o=i.document.selection.getSelectedElement();o&&n.isObject(o)&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const i=this._getObjectElementNextToSelection(t);return i?(this.editor.model.change(t=>{let n=e.anchor.parent;for(;n.isEmpty;){const e=n;n=e.parent,t.remove(e)}this._setSelectionOverElement(i)}),!0):void 0}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,i=e.schema,n=e.document.selection,o=e.createSelection(n);e.modifySelection(o,{direction:t?"forward":"backward"});const r=t?o.focus.nodeBefore:o.focus.nodeAfter;return r&&i.isObject(r)?r:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass("ck-widget_selected",e);this._previouslySelected.clear()}}function rm(t,e){return!!e&&Array.from(t.getAncestors()).includes(e)}const sm=function(t,e,i){var n=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return v(i)&&(n="leading"in i?!!i.leading:n,o="trailing"in i?!!i.trailing:o),Ms(t,e,{leading:n,maxWait:e,trailing:o})};i(901);class am extends ae{static get pluginName(){return"DragDrop"}static get requires(){return[xu,om]}init(){const t=this.editor,e=t.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,this._updateDropMarkerThrottled=sm(t=>this._updateDropMarker(t),40),this._removeDropMarkerDelayed=dm(()=>this._removeDropMarker(),40),this._clearDraggableAttributesDelayed=dm(()=>this._clearDraggableAttributes(),40),e.addObserver(vu),e.addObserver(Qh),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDropMarker(),this._setupDraggableAttributeHandling(),this.listenTo(t,"change:isReadOnly",(t,e,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(t,e,i)=>{i||this._finalizeDragging(!1)}),Uo.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._updateDropMarkerThrottled.cancel(),this._removeDropMarkerDelayed.cancel(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){const t=this.editor,e=t.model,i=e.document,n=t.editing.view,o=n.document;this.listenTo(o,"dragstart",(n,s)=>{const a=i.selection;if(s.target&&s.target.is("editableElement"))return void s.preventDefault();const l=s.target?hm(s.target):null;if(l){const i=t.editing.mapper.toModelElement(l);this._draggedRange=Ma.fromRange(e.createRangeOn(i))}else if(!o.selection.isCollapsed){const t=o.selection.getSelectedElement();t&&Du(t)||(this._draggedRange=Ma.fromRange(a.getFirstRange()))}if(!this._draggedRange)return void s.preventDefault();this._draggingUid=r(),s.dataTransfer.effectAllowed=this.isEnabled?"copyMove":"copy",s.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);const c=e.createSelection(this._draggedRange.toRange()),d=t.data.toView(e.getSelectedContent(c));o.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:d,method:n.name}),this.isEnabled||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(o,"dragend",(t,e)=>{this._finalizeDragging(!e.dataTransfer.isCanceled&&"move"==e.dataTransfer.dropEffect)},{priority:"low"}),this.listenTo(o,"dragenter",()=>{this.isEnabled&&n.focus()}),this.listenTo(o,"dragleave",()=>{this._removeDropMarkerDelayed()}),this.listenTo(o,"dragging",(e,i)=>{if(!this.isEnabled)return void(i.dataTransfer.dropEffect="none");this._removeDropMarkerDelayed.cancel();const n=lm(t,i.targetRanges,i.target);this._draggedRange||(i.dataTransfer.dropEffect="copy"),Uo.isGecko||("copy"==i.dataTransfer.effectAllowed?i.dataTransfer.dropEffect="copy":["all","copyMove"].includes(i.dataTransfer.effectAllowed)&&(i.dataTransfer.dropEffect="move")),n&&this._updateDropMarkerThrottled(n)},{priority:"low"})}_setupClipboardInputIntegration(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"clipboardInput",(e,i)=>{if("drop"!=i.method)return;const n=lm(t,i.targetRanges,i.target);if(this._removeDropMarker(),!n)return this._finalizeDragging(!1),void e.stop();this._draggedRange&&this._draggingUid!=i.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="");if("move"==cm(i.dataTransfer)&&this._draggedRange&&this._draggedRange.containsRange(n,!0))return this._finalizeDragging(!1),void e.stop();i.targetRanges=[t.editing.mapper.toViewRange(n)]},{priority:"high"})}_setupContentInsertionIntegration(){const t=this.editor.plugins.get(xu);t.on("contentInsertion",(t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const i=e.targetRanges.map(t=>this.editor.editing.mapper.toModelRange(t));this.editor.model.change(t=>t.setSelection(i))},{priority:"high"}),t.on("contentInsertion",(t,e)=>{if(!this.isEnabled||"drop"!==e.method)return;const i="move"==cm(e.dataTransfer),n=!e.resultRange||!e.resultRange.isCollapsed;this._finalizeDragging(n&&i)},{priority:"lowest"})}_setupDraggableAttributeHandling(){const t=this.editor,e=t.editing.view,i=e.document;this.listenTo(i,"mousedown",(n,o)=>{if(Uo.isAndroid||!o)return;this._clearDraggableAttributesDelayed.cancel();let r=hm(o.target);if(Uo.isBlink&&!t.isReadOnly&&!r&&!i.selection.isCollapsed){const t=i.selection.getSelectedElement();t&&Du(t)||(r=i.selection.editableElement)}r&&(e.change(t=>{t.setAttribute("draggable","true",r)}),this._draggableElement=t.editing.mapper.toModelElement(r))}),this.listenTo(i,"mouseup",()=>{Uo.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){const t=this.editor.editing;t.view.change(e=>{this._draggableElement&&"$graveyard"!=this._draggableElement.root.rootName&&e.removeAttribute("draggable",t.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_setupDropMarker(){const t=this.editor;t.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),t.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(e,{writer:i})=>{if(t.model.schema.checkChild(e.markerRange.start,"$text"))return i.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},(function(t){const e=this.toDomElement(t);return e.innerHTML="&NoBreak;<span></span>&NoBreak;",e}))}})}_updateDropMarker(t){const e=this.editor,i=e.model.markers;e.model.change(e=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(t)||e.updateMarker("drop-target",{range:t}):e.addMarker("drop-target",{range:t,usingOperation:!1,affectsData:!1})})}_removeDropMarker(){const t=this.editor.model;this._removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),t.markers.has("drop-target")&&t.change(t=>{t.removeMarker("drop-target")})}_finalizeDragging(t){const e=this.editor.model;this._removeDropMarker(),this._clearDraggableAttributes(),this._draggingUid="",this._draggedRange&&(t&&this.isEnabled&&e.deleteContent(e.createSelection(this._draggedRange),{doNotAutoparagraph:!0}),this._draggedRange.detach(),this._draggedRange=null)}}function lm(t,e,i){const n=t.model,o=t.editing.mapper;let r=null;const s=e?e[0].start:null;if(i.is("uiElement")&&(i=i.parent),r=function(t,e){const i=t.model,n=t.editing.mapper;if(Du(e))return i.createRangeOn(n.toModelElement(e));if(!e.is("editableElement")){const t=e.findAncestor(t=>Du(t)||t.is("editableElement"));if(Du(t))return i.createRangeOn(n.toModelElement(t))}return null}(t,i),r)return r;const a=function(t,e){const i=t.editing.mapper,n=t.editing.view,o=i.toModelElement(e);if(o)return o;const r=n.createPositionBefore(e),s=i.findMappedViewAncestor(r);return i.toModelElement(s)}(t,i),l=s?o.toModelPosition(s):null;return l?(r=function(t,e,i){const n=t.model;if(!n.schema.checkChild(i,"$block"))return null;const o=n.createPositionAt(i,0),r=e.path.slice(0,o.path.length),s=n.createPositionFromPath(e.root,r).nodeAfter;if(s&&n.schema.isObject(s))return n.createRangeOn(s);return null}(t,l,a),r||(r=n.schema.getNearestSelectionRange(l,Uo.isGecko?"forward":"backward"),r||function(t,e){const i=t.model;for(;e;){if(i.schema.isObject(e))return i.createRangeOn(e);e=e.parent}}(t,l.parent))):function(t,e){const i=t.model,n=i.schema,o=i.createPositionAt(e,0);return n.getNearestSelectionRange(o,"forward")}(t,a)}function cm(t){return Uo.isGecko?t.dropEffect:["all","copyMove"].includes(t.effectAllowed)?"move":"copy"}function dm(t,e){let i;function n(...o){n.cancel(),i=setTimeout(()=>t(...o),e)}return n.cancel=()=>{clearTimeout(i)},n}function hm(t){if(t.is("editableElement"))return null;if(t.hasClass("ck-widget__selection-handle"))return t.findAncestor(Du);if(Du(t))return t;const e=t.findAncestor(t=>Du(t)||t.is("editableElement"));return Du(e)?e:null}class um extends ae{static get pluginName(){return"PastePlainText"}static get requires(){return[xu]}init(){const t=this.editor,e=t.model,i=t.editing.view,n=i.document,o=e.document.selection;let r=!1;i.addObserver(vu),this.listenTo(n,"keydown",(t,e)=>{r=e.shiftKey}),t.plugins.get(xu).on("contentInsertion",(t,i)=>{(r||function(t,e){if(t.childCount>1)return!1;const i=t.getChild(0);if(e.isObject(i))return!1;return 0==[...i.getAttributeKeys()].length}(i.content,e.schema))&&e.change(t=>{const n=Array.from(o.getAttributes()).filter(([t])=>e.schema.getAttributeProperties(t).isFormatting);o.isCollapsed||e.deleteContent(o,{doNotAutoparagraph:!0}),n.push(...o.getAttributes());const r=t.createRangeIn(i.content);for(const e of r.getItems())e.is("$textProxy")&&t.setAttributes(n,e)})})}}class mm extends ae{static get pluginName(){return"Clipboard"}static get requires(){return[xu,am,um]}}class gm extends ce{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i){const n=i.isCollapsed,o=i.getFirstRange(),r=o.start.parent,s=o.end.parent,a=r==s;if(n){const n=Au(t.schema,i.getAttributes());fm(t,e,o.end),e.removeSelectionAttribute(i.getAttributeKeys()),e.setSelectionAttribute(n)}else{const n=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(i,{leaveUnmerged:n}),a?fm(t,e,i.focus):n&&e.setSelection(s,0)}}(t,i,e.selection),this.fire("afterExecute",{writer:i})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const i=e.anchor;if(!i||!t.checkChild(i,"softBreak"))return!1;const n=e.getFirstRange(),o=n.start.parent,r=n.end.parent;if((pm(o,t)||pm(r,t))&&o!==r)return!1;return!0}(t.schema,e.selection)}}function fm(t,e,i){const n=e.createElement("softBreak");t.insertContent(n,i),e.setSelection(n,"after")}function pm(t,e){return!t.is("rootElement")&&(e.isLimit(t)||pm(t.parent,e))}class wm extends ae{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,i=t.conversion,n=t.editing.view,o=n.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(t,{writer:e})=>e.createEmptyElement("br")}),n.addObserver(Eu),t.commands.add("shiftEnter",new gm(t)),this.listenTo(o,"enter",(e,i)=>{i.preventDefault(),i.isSoft&&(t.execute("shiftEnter"),n.scrollToTheSelection())},{priority:"low"})}}class bm extends ce{execute(){const t=this.editor.model,e=t.document.selection;let i=t.schema.getLimitElement(e);if(e.containsEntireContent(i)||!km(t.schema,i))do{if(i=i.parent,!i)return}while(!km(t.schema,i));t.change(t=>{t.setSelection(i,"in")})}}function km(t,e){return t.isLimit(e)&&(t.checkChild(e,"$text")||t.checkChild(e,"paragraph"))}const _m=Ko("Ctrl+A");class vm extends ae{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new bm(t)),this.listenTo(e,"keydown",(e,i)=>{Yo(i)===_m&&(t.execute("selectAll"),i.preventDefault())})}}class ym extends ae{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const i=t.commands.get("selectAll"),n=new Nd(e),o=e.t;return n.set({label:o("Select all"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2v-1.1c0-.11.09-.2.2-.2h1.6zm.45-5.5a.75.75 0 1 1 0 1.5h-8.5a.75.75 0 1 1 0-1.5h8.5zM1.3 11c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2v-1.6c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM1.3 7c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm18.5 0c.11 0 .2.09.2.2v1.6a.2.2 0 0 1-.2.2h-1.1a.2.2 0 0 1-.2-.2V7.2c0-.11.09-.2.2-.2h1.1zm-4.55-2a.75.75 0 1 1 0 1.5h-2.5a.75.75 0 1 1 0-1.5h2.5zm-5 0a.75.75 0 1 1 0 1.5h-5.5a.75.75 0 0 1 0-1.5h5.5zm-6.5-5a.75.75 0 0 1 0 1.5H2a.5.5 0 0 0-.492.41L1.5 2v1.75a.75.75 0 0 1-1.5 0V1.5l.007-.144A1.5 1.5 0 0 1 1.356.006L1.5 0h2.25zM18.5 0l.144.007a1.5 1.5 0 0 1 1.35 1.349L20 1.5v2.25a.75.75 0 1 1-1.5 0V2l-.008-.09A.5.5 0 0 0 18 1.5h-1.75a.75.75 0 1 1 0-1.5h2.25zM8.8 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6zm4 0c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2h-1.6a.2.2 0 0 1-.2-.2V.2c0-.11.09-.2.2-.2h1.6z"/></svg>',keystroke:"Ctrl+A",tooltip:!0}),n.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),n})}}class xm extends ae{static get requires(){return[vm,ym]}static get pluginName(){return"SelectAll"}}class Am extends ce{constructor(t,e){super(t),this._buffer=new Pu(t.model,e),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,i=e.document,n=t.text||"",o=n.length,r=t.range?e.createSelection(t.range):i.selection,s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{this._buffer.lock(),this._batches.add(this._buffer.batch),e.deleteContent(r),n&&e.insertContent(t.createText(n,i.selection.getAttributes()),r),s?t.setSelection(s):r.is("documentSelection")||t.setSelection(r),this._buffer.unlock(),this._buffer.input(o)})}}function Cm(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const i=[];let n,o=0;return t.forEach(t=>{"equal"==t?(r(),o++):"insert"==t?(s("insert")?n.values.push(e[o]):(r(),n={type:"insert",index:o,values:[e[o]]}),o++):s("delete")?n.howMany++:(r(),n={type:"delete",index:o,howMany:1})}),r(),i;function r(){n&&(i.push(n),n=null)}function s(t){return n&&n.type==t}}(Er(t.oldChildren,t.newChildren,Tm),t.newChildren);if(e.length>1)return;const i=e[0];return i.values[0]&&i.values[0].is("$text")?i:void 0}function Tm(t,e){return t&&t.is("$text")&&e&&e.is("$text")?t.data===e.data:t===e}class Em{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(function(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!Cm(e))return!0;return!1}(t))this._handleContainerChildrenMutations(t,e);else for(const i of t)this._handleTextMutation(i,e),this._handleTextNodeInsertion(i)}_handleContainerChildrenMutations(t,e){const i=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(!e)return;return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!i)return;const n=this.editor.editing.view.domConverter.mapViewToDom(i),o=new Fr(this.editor.editing.view.document),r=this.editor.data.toModel(o.domToView(n)).getChild(0),s=this.editor.editing.mapper.toModelElement(i);if(!s)return;const a=Array.from(r.getChildren()),l=Array.from(s.getChildren()),c=a[a.length-1],d=l[l.length-1],h=c&&c.is("element","softBreak"),u=d&&!d.is("element","softBreak");h&&u&&a.pop();const m=this.editor.model.schema;if(!Sm(a,m)||!Sm(l,m))return;const g=a.map(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," "),f=l.map(t=>t.is("$text")?t.data:"@").join("").replace(/\u00A0/g," ");if(f===g)return;const p=Er(f,g),{firstChangeAt:w,insertions:b,deletions:k}=Pm(p);let _=null;e&&(_=this.editing.mapper.toModelRange(e.getFirstRange()));const v=g.substr(w,b),y=this.editor.model.createRange(this.editor.model.createPositionAt(s,w),this.editor.model.createPositionAt(s,w+k));this.editor.execute("input",{text:v,range:y,resultRange:_})}_handleTextMutation(t,e){if("text"!=t.type)return;const i=t.newText.replace(/\u00A0/g," "),n=t.oldText.replace(/\u00A0/g," ");if(n===i)return;const o=Er(n,i),{firstChangeAt:r,insertions:s,deletions:a}=Pm(o);let l=null;e&&(l=this.editing.mapper.toModelRange(e.getFirstRange()));const c=this.editing.view.createPositionAt(t.node,r),d=this.editing.mapper.toModelPosition(c),h=this.editor.model.createRange(d,d.getShiftedBy(a)),u=i.substr(r,s);this.editor.execute("input",{text:u,range:h,resultRange:l})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=Cm(t),i=this.editing.view.createPositionAt(t.node,e.index),n=this.editing.mapper.toModelPosition(i),o=e.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(n)})}}function Sm(t,e){return t.every(t=>e.isInline(t))}function Pm(t){let e=null,i=null;for(let n=0;n<t.length;n++){"equal"!=t[n]&&(e=null===e?n:e,i=n)}let n=0,o=0;for(let r=e;r<=i;r++)"insert"!=t[r]&&n++,"delete"!=t[r]&&o++;return{insertions:o,deletions:n,firstChangeAt:e}}class Mm extends ae{static get pluginName(){return"Input"}init(){const t=this.editor,e=new Am(t,t.config.get("typing.undoStep")||20);t.commands.add("input",e),function(t){let e=null;const i=t.model,n=t.editing.view,o=t.commands.get("input");function r(t){const r=i.document,a=n.document.isComposing,l=e&&e.isEqual(r.selection);e=null,o.isEnabled&&(Ju(t)||r.selection.isCollapsed||a&&229===t.keyCode||!a&&229===t.keyCode&&l||s())}function s(){const t=o.buffer;t.lock();const e=t.batch;o._batches.add(e),i.enqueueChange(e,()=>{i.deleteContent(i.document.selection)}),t.unlock()}Uo.isAndroid?n.document.on("beforeinput",(t,e)=>r(e),{priority:"lowest"}):n.document.on("keydown",(t,e)=>r(e),{priority:"lowest"}),n.document.on("compositionstart",(function(){const t=i.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;if(t.selection.isCollapsed||e)return;s()}),{priority:"lowest"}),n.document.on("compositionend",()=>{e=i.createSelection(i.document.selection)},{priority:"lowest"})}(t),function(t){t.editing.view.document.on("mutations",(e,i,n)=>{new Em(t).handle(i,n)})}(t)}isInput(t){return this.editor.commands.get("input")._batches.has(t)}}class Im extends ae{static get requires(){return[Mm,Lu]}static get pluginName(){return"Typing"}}function Lm(t,e){let i=t.start;return{text:Array.from(t.getItems()).reduce((t,n)=>n.is("$text")||n.is("$textProxy")?t+n.data:(i=e.createPositionAfter(n),""),""),range:e.createRange(i,t.end)}}class Nm{constructor(t,e){this.model=t,this.testCallback=e,this.hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(t.document.selection),this.stopListening(t.document))}),this._startListening()}_startListening(){const t=this.model.document;this.listenTo(t.selection,"change:range",(e,{directChange:i})=>{i&&(t.selection.isCollapsed?this._evaluateTextBeforeSelection("selection"):this.hasMatch&&(this.fire("unmatched"),this.hasMatch=!1))}),this.listenTo(t,"change:data",(t,e)=>{"transparent"!=e.type&&this._evaluateTextBeforeSelection("data",{batch:e})})}_evaluateTextBeforeSelection(t,e={}){const i=this.model,n=i.document.selection,o=i.createRange(i.createPositionAt(n.focus.parent,0),n.focus),{text:r,range:s}=Lm(o,i),a=this.testCallback(r);if(!a&&this.hasMatch&&this.fire("unmatched"),this.hasMatch=!!a,a){const i=Object.assign(e,{text:r,range:s});"object"==typeof a&&Object.assign(i,a),this.fire("matched:"+t,i)}}}se(Nm,te);class Rm extends ae{static get pluginName(){return"TwoStepCaretMovement"}constructor(t){super(t),this.attributes=new Set,this._overrideUid=null}init(){const t=this.editor,e=t.model,i=t.editing.view,n=t.locale,o=e.document.selection;this.listenTo(i.document,"arrowKey",(t,e)=>{if(!o.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const i=e.keyCode==$o.arrowright,r=e.keyCode==$o.arrowleft;if(!i&&!r)return;const s=n.contentLanguageDirection;let a=!1;a="ltr"===s&&i||"rtl"===s&&r?this._handleForwardMovement(e):this._handleBackwardMovement(e),!0===a&&t.stop()},{context:"$text",priority:"highest"}),this._isNextGravityRestorationSkipped=!1,this.listenTo(o,"change:range",(t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&Vm(o.getFirstPosition(),this.attributes)||this._restoreGravity())})}registerAttribute(t){this.attributes.add(t)}_handleForwardMovement(t){const e=this.attributes,i=this.editor.model.document.selection,n=i.getFirstPosition();return!this._isGravityOverridden&&((!n.isAtStart||!Om(i,e))&&(Vm(n,e)?(Dm(t),this._overrideGravity(),!0):void 0))}_handleBackwardMovement(t){const e=this.attributes,i=this.editor.model,n=i.document.selection,o=n.getFirstPosition();return this._isGravityOverridden?(Dm(t),this._restoreGravity(),zm(i,e,o),!0):o.isAtStart?!!Om(n,e)&&(Dm(t),zm(i,e,o),!0):function(t,e){return Vm(t.getShiftedBy(-1),e)}(o,e)?o.isAtEnd&&!Om(n,e)&&Vm(o,e)?(Dm(t),zm(i,e,o),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):void 0}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}}function Om(t,e){for(const i of e)if(t.hasAttribute(i))return!0;return!1}function zm(t,e,i){const n=i.nodeBefore;t.change(t=>{n?t.setSelectionAttribute(n.getAttributes()):t.removeSelectionAttribute(e)})}function Dm(t){t.preventDefault()}function Vm(t,e){const{nodeBefore:i,nodeAfter:n}=t;for(const t of e){const e=i?i.getAttribute(t):void 0;if((n?n.getAttribute(t):void 0)!==e)return!0}return!1}var jm=/[\\^$.*+?()[\]{}|]/g,Bm=RegExp(jm.source);const Fm=function(t){return(t=qn(t))&&Bm.test(t)?t.replace(jm,"\\$&"):t},Hm={copyright:{from:"(c)",to:"©"},registeredTrademark:{from:"(r)",to:"®"},trademark:{from:"(tm)",to:"™"},oneHalf:{from:"1/2",to:"½"},oneThird:{from:"1/3",to:"⅓"},twoThirds:{from:"2/3",to:"⅔"},oneForth:{from:"1/4",to:"¼"},threeQuarters:{from:"3/4",to:"¾"},lessThanOrEqual:{from:"<=",to:"≤"},greaterThanOrEqual:{from:">=",to:"≥"},notEqual:{from:"!=",to:"≠"},arrowLeft:{from:"<-",to:"←"},arrowRight:{from:"->",to:"→"},horizontalEllipsis:{from:"...",to:"…"},enDash:{from:/(^| )(--)( )$/,to:[null,"–",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"—",null]},quotesPrimary:{from:Ym('"'),to:[null,"“",null,"”"]},quotesSecondary:{from:Ym("'"),to:[null,"‘",null,"’"]},quotesPrimaryEnGb:{from:Ym("'"),to:[null,"‘",null,"’"]},quotesSecondaryEnGb:{from:Ym('"'),to:[null,"“",null,"”"]},quotesPrimaryPl:{from:Ym('"'),to:[null,"„",null,"”"]},quotesSecondaryPl:{from:Ym("'"),to:[null,"‚",null,"’"]}},Um={symbols:["copyright","registeredTrademark","trademark"],mathematical:["oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight"],typography:["horizontalEllipsis","enDash","emDash"],quotes:["quotesPrimary","quotesSecondary"]},qm=["symbols","mathematical","typography","quotes"];function Wm(t){return"string"==typeof t?new RegExp(`(${Fm(t)})$`):t}function $m(t){return"string"==typeof t?()=>[t]:t instanceof Array?()=>t:t}function Gm(t){return(t.textNode?t.textNode:t.nodeAfter).getAttributes()}function Ym(t){return new RegExp(`(^|\\s)(${t})([^${t}]*)(${t})$`)}function Km(t,e,i,n){return n.createRange(Qm(t,e,i,!0,n),Qm(t,e,i,!1,n))}function Qm(t,e,i,n,o){let r=t.textNode||(n?t.nodeBefore:t.nodeAfter),s=null;for(;r&&r.getAttribute(e)==i;)s=r,r=n?r.previousSibling:r.nextSibling;return s?o.createPositionAt(s,n?"before":"after"):t}function Jm(t,e,i,n){const o=t.editing.view,r=new Set;o.document.registerPostFixer(o=>{const s=t.model.document.selection;let a=!1;if(s.hasAttribute(e)){const l=Km(s.getFirstPosition(),e,s.getAttribute(e),t.model),c=t.editing.mapper.toViewRange(l);for(const t of c.getItems())t.is("element",i)&&!t.hasClass(n)&&(o.addClass(n,t),r.add(t),a=!0)}return a}),t.conversion.for("editingDowncast").add(t=>{function e(){o.change(t=>{for(const e of r.values())t.removeClass(n,e),r.delete(e)})}t.on("insert",e,{priority:"highest"}),t.on("remove",e,{priority:"highest"}),t.on("attribute",e,{priority:"highest"}),t.on("selection",e,{priority:"highest"})})}class Zm extends ce{constructor(t){super(t),this._stack=[],this._createdBatches=new WeakSet,this.refresh(),this.listenTo(t.data,"set",()=>this.clearStack())}refresh(){this.isEnabled=this._stack.length>0}addBatch(t){const e=this.editor.model.document.selection,i={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,i){const n=this.editor.model,o=n.document,r=[],s=t.map(t=>t.getTransformedByOperations(i)),a=s.flat();for(const t of s){const e=t.filter(t=>t.root!=o.graveyard).filter(t=>!tg(t,a));e.length&&(Xm(e),r.push(e[0]))}r.length&&n.change(t=>{t.setSelection(r,{backward:e})})}_undo(t,e){const i=this.editor.model,n=i.document;this._createdBatches.add(e);const o=t.operations.slice().filter(t=>t.isDocumentOperation);o.reverse();for(const t of o){const o=t.baseVersion+1,r=Array.from(n.history.getOperations(o)),s=Hh([t.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const o of s)e.addOperation(o),i.applyOperation(o),n.history.setOperationAsUndone(t,o)}}}function Xm(t){t.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let e=1;e<t.length;e++){const i=t[e-1].getJoined(t[e],!0);i&&(e--,t.splice(e,2,i))}}function tg(t,e){return e.some(e=>e!==t&&e.containsRange(t,!0))}class eg extends Zm{execute(t=null){const e=t?this._stack.findIndex(e=>e.batch==t):this._stack.length-1,i=this._stack.splice(e,1)[0],n=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(n,()=>{this._undo(i.batch,n);const t=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,t),this.fire("revert",i.batch,n)}),this.refresh()}}class ig extends Zm{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(e,()=>{const i=t.batch.operations[t.batch.operations.length-1].baseVersion+1,n=this.editor.model.document.history.getOperations(i);this._restoreSelection(t.selection.ranges,t.selection.isBackward,n),this._undo(t.batch,e)}),this.refresh()}}class ng extends ae{static get pluginName(){return"UndoEditing"}constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new eg(t),this._redoCommand=new ig(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(t,e)=>{const i=e[0];if(!i.isDocumentOperation)return;const n=i.batch,o=this._redoCommand._createdBatches.has(n),r=this._undoCommand._createdBatches.has(n);this._batchRegistry.has(n)||"transparent"==n.type&&!o&&!r||(o?this._undoCommand.addBatch(n):r||(this._undoCommand.addBatch(n),this._redoCommand.clearStack()),this._batchRegistry.add(n))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,e,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}const og='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z"/></svg>',rg='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z"/></svg>';class sg extends ae{static get pluginName(){return"UndoUI"}init(){const t=this.editor,e=t.locale,i=t.t,n="ltr"==e.uiLanguageDirection?og:rg,o="ltr"==e.uiLanguageDirection?rg:og;this._addButton("undo",i("Undo"),"CTRL+Z",n),this._addButton("redo",i("Redo"),"CTRL+Y",o)}_addButton(t,e,i,n){const o=this.editor;o.ui.componentFactory.add(t,r=>{const s=o.commands.get(t),a=new Nd(r);return a.set({label:e,icon:n,keystroke:i,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{o.execute(t),o.editing.view.focus()}),a})}}class ag extends ae{static get requires(){return[ng,sg]}static get pluginName(){return"Undo"}}class lg{constructor(){const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((i,n)=>{e.onload=()=>{const t=e.result;this._data=t,i(t)},e.onerror=()=>{n("error")},e.onabort=()=>{n("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}se(lg,te);class cg extends ae{static get pluginName(){return"FileRepository"}static get requires(){return[Vc]}init(){this.loaders=new gn,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return l("filerepository-no-upload-adapter"),null;const e=new dg(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(t=>{this._loadersMap.set(t,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let t=0;for(const e of this.loaders)t+=e.uploaded;this.uploaded=t}),e.on("change:uploadTotal",()=>{let t=0;for(const e of this.loaders)e.uploadTotal&&(t+=e.uploadTotal);this.uploadTotal=t}),e}destroyLoader(t){const e=t instanceof dg?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((t,i)=>{t===e&&this._loadersMap.delete(i)})}_updatePendingAction(){const t=this.editor.plugins.get(Vc);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,i=t=>`${e("Upload in progress")} ${parseInt(t)}%.`;this._pendingAction=t.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else t.remove(this._pendingAction),this._pendingAction=null}}se(cg,te);class dg{constructor(t,e){this.id=r(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new lg,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new a("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if("reading"!==this.status)throw this.status;return this.status="idle",t}).catch(t=>{if("aborted"===t)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:t})}upload(){if("idle"!=this.status)throw new a("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{if("aborted"===this.status)throw"aborted";throw this.status="error",t})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==t?this._reader.abort():"uploading"==t&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(t){const e={};return e.promise=new Promise((i,n)=>{e.rejecter=n,e.isFulfilled=!1,t.then(t=>{e.isFulfilled=!0,i(t)}).catch(t=>{e.isFulfilled=!0,n(t)})}),e}}se(dg,te);class hg extends cd{constructor(t){super(t),this.buttonView=new Nd(t),this._fileInputView=new ug(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class ug extends cd{constructor(t){super(t),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}}function mg(){let t=function(t){t=t.toLowerCase();const e=document.cookie.split(";");for(const i of e){const e=i.split("=");if(decodeURIComponent(e[0].trim().toLowerCase())===t)return decodeURIComponent(e[1])}return null}("ckCsrfToken");var e,i;return t&&40==t.length||(t=function(t){let e="";const i=new Uint8Array(t);window.crypto.getRandomValues(i);for(let t=0;t<i.length;t++){const n="abcdefghijklmnopqrstuvwxyz0123456789".charAt(i[t]%"abcdefghijklmnopqrstuvwxyz0123456789".length);e+=Math.random()>.5?n.toUpperCase():n}return e}(40),e="ckCsrfToken",i=t,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(i)+";path=/"),t}class gg{constructor(t,e,i){this.loader=t,this.url=e,this.t=i}upload(){return this.loader.file.then(t=>new Promise((e,i)=>{this._initRequest(),this._initListeners(e,i,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e,i){const n=this.xhr,o=this.loader,r=(0,this.t)("Cannot upload file:")+` ${i.name}.`;n.addEventListener("error",()=>e(r)),n.addEventListener("abort",()=>e()),n.addEventListener("load",()=>{const i=n.response;if(!i||!i.uploaded)return e(i&&i.error&&i.error.message?i.error.message:r);t({default:i.url})}),n.upload&&n.upload.addEventListener("progress",t=>{t.lengthComputable&&(o.uploadTotal=t.total,o.uploaded=t.loaded)})}_sendRequest(t){const e=new FormData;e.append("upload",t),e.append("ckCsrfToken",mg()),this.xhr.send(e)}}function fg(t,e,i,n){let o,r=null;"function"==typeof n?o=n:(r=t.commands.get(n),o=()=>{t.execute(n)}),t.model.document.on("change:data",(s,a)=>{if(r&&!r.isEnabled||!e.isEnabled)return;const l=Ws(t.model.document.selection.getRanges());if(!l.isCollapsed)return;if("transparent"==a.type)return;const c=Array.from(t.model.document.differ.getChanges()),d=c[0];if(1!=c.length||"insert"!==d.type||"$text"!=d.name||1!=d.length)return;const h=d.position.parent;if(h.is("element","codeBlock"))return;if(h.is("element","listItem")&&"function"!=typeof n&&!["numberedList","bulletedList","todoList"].includes(n))return;if(r&&!0===r.value)return;const u=h.getChild(0),m=t.model.createRangeOn(u);if(!m.containsRange(l)&&!l.end.isEqual(m.end))return;const g=i.exec(u.data.substr(0,l.end.offset));g&&t.model.enqueueChange(e=>{const i=e.createPositionAt(h,0),n=e.createPositionAt(h,g[0].length),r=new Ma(i,n);if(!1!==o({match:g})){e.remove(r);const i=t.model.document.selection.getFirstRange(),n=e.createRangeIn(h);!h.isEmpty||n.isEqual(i)||n.containsRange(i,!0)||e.remove(h)}r.detach()})})}function pg(t,e,i,n){let o,r;i instanceof RegExp?o=i:r=i,r=r||(t=>{let e;const i=[],n=[];for(;null!==(e=o.exec(t))&&!(e&&e.length<4);){let{index:t,1:o,2:r,3:s}=e;const a=o+r+s;t+=e[0].length-a.length;const l=[t,t+o.length],c=[t+o.length+r.length,t+o.length+r.length+s.length];i.push(l),i.push(c),n.push([t+o.length,t+o.length+r.length])}return{remove:i,format:n}}),t.model.document.on("change:data",(i,o)=>{if("transparent"==o.type||!e.isEnabled)return;const s=t.model,a=s.document.selection;if(!a.isCollapsed)return;const l=Array.from(s.document.differ.getChanges()),c=l[0];if(1!=l.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const d=a.focus,h=d.parent,{text:u,range:m}=function(t,e){let i=t.start;return{text:Array.from(t.getItems()).reduce((t,n)=>!n.is("$text")&&!n.is("$textProxy")||n.getAttribute("code")?(i=e.createPositionAfter(n),""):t+n.data,""),range:e.createRange(i,t.end)}}(s.createRange(s.createPositionAt(h,0),d),s),g=r(u),f=wg(m.start,g.format,s),p=wg(m.start,g.remove,s);f.length&&p.length&&s.enqueueChange(t=>{if(!1!==n(t,f))for(const e of p.reverse())t.remove(e)})})}function wg(t,e,i){return e.filter(t=>void 0!==t[0]&&void 0!==t[1]).map(e=>i.createRange(t.getShiftedBy(e[0]),t.getShiftedBy(e[1])))}function bg(t,e){return(i,n)=>{if(!t.commands.get(e).isEnabled)return!1;const o=t.model.schema.getValidRanges(n,e);for(const t of o)i.setAttribute(e,!0,t);i.removeSelectionAttribute(e)}}class kg extends ce{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(i.isCollapsed)n?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of o)n?t.setAttribute(this.attributeKey,n,e):t.removeAttribute(this.attributeKey,e)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const t of i.getRanges())for(const i of t.getItems())if(e.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}}class _g extends ae{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"bold"}),t.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e?"bold"==e||Number(e)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),t.commands.add("bold",new kg(t,"bold")),t.keystrokes.set("CTRL+B","bold")}}class vg extends ae{static get pluginName(){return"BoldUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("bold",i=>{const n=t.commands.get("bold"),o=new Nd(i);return o.set({label:e("Bold"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z"/></svg>',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("bold"),t.editing.view.focus()}),o})}}class yg extends ae{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"italic"}),t.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add("italic",new kg(t,"italic")),t.keystrokes.set("CTRL+I","italic")}}class xg extends ae{static get pluginName(){return"ItalicUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("italic",i=>{const n=t.commands.get("italic"),o=new Nd(i);return o.set({label:e("Italic"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z"/></svg>',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("italic"),t.editing.view.focus()}),o})}}class Ag extends ce{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.schema,n=e.document.selection,o=Array.from(n.getSelectedBlocks()),r=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(r){const e=o.filter(t=>Cg(t)||Eg(i,t));this._applyQuote(t,e)}else this._removeQuote(t,o.filter(Cg))})}_getValue(){const t=Ws(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!Cg(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=Ws(t.getSelectedBlocks());return!!i&&Eg(e,i)}_removeQuote(t,e){Tg(t,e).reverse().forEach(e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const i=t.createPositionBefore(e.start.parent);return void t.move(e,i)}e.end.isAtEnd||t.split(e.end);const i=t.createPositionAfter(e.end.parent);t.move(e,i)})}_applyQuote(t,e){const i=[];Tg(t,e).reverse().forEach(e=>{let n=Cg(e.start);n||(n=t.createElement("blockQuote"),t.wrap(e,n)),i.push(n)}),i.reverse().reduce((e,i)=>e.nextSibling==i?(t.merge(t.createPositionAfter(e)),e):i)}}function Cg(t){return"blockQuote"==t.parent.name?t.parent:null}function Tg(t,e){let i,n=0;const o=[];for(;n<e.length;){const r=e[n],s=e[n+1];i||(i=t.createPositionBefore(r)),s&&r.nextSibling==s||(o.push(t.createRange(i,t.createPositionAfter(r))),i=null),n++}return o}function Eg(t,e){const i=t.checkChild(e.parent,"blockQuote"),n=t.checkChild(["$root","blockQuote"],e);return i&&n}class Sg extends ae{static get pluginName(){return"BlockQuoteEditing"}static get requires(){return[Su,Lu]}init(){const t=this.editor,e=t.model.schema;t.commands.add("blockQuote",new Ag(t)),e.register("blockQuote",{allowWhere:"$block",allowContentOf:"$root"}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer(i=>{const n=t.model.document.differ.getChanges();for(const t of n)if("insert"==t.type){const n=t.position.nodeAfter;if(!n)continue;if(n.is("element","blockQuote")&&n.isEmpty)return i.remove(n),!0;if(n.is("element","blockQuote")&&!e.checkChild(t.position,n))return i.unwrap(n),!0;if(n.is("element")){const t=i.createRangeIn(n);for(const n of t.getItems())if(n.is("element","blockQuote")&&!e.checkChild(i.createPositionBefore(n),n))return i.unwrap(n),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("element","blockQuote")&&e.isEmpty)return i.remove(e),!0}return!1});const i=this.editor.editing.view.document,n=t.model.document.selection,o=t.commands.get("blockQuote");this.listenTo(i,"enter",(e,i)=>{if(!n.isCollapsed||!o.value)return;n.getLastPosition().parent.isEmpty&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),i.preventDefault(),e.stop())},{context:"blockquote"}),this.listenTo(i,"delete",(e,i)=>{if("backward"!=i.direction||!n.isCollapsed||!o.value)return;const r=n.getLastPosition().parent;r.isEmpty&&!r.previousSibling&&(t.execute("blockQuote"),t.editing.view.scrollToTheSelection(),i.preventDefault(),e.stop())},{context:"blockquote"})}}i(321);class Pg extends ae{static get pluginName(){return"BlockQuoteUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",i=>{const n=t.commands.get("blockQuote"),o=new Nd(i);return o.set({label:e("Block quote"),icon:nd,tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),o})}}class Mg extends ae{static get pluginName(){return"CKFinderUI"}init(){const t=this.editor,e=t.ui.componentFactory,i=t.t;e.add("ckfinder",e=>{const n=t.commands.get("ckfinder"),o=new Nd(e);return o.set({label:i("Insert image or file"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.627 16.5zm5.873-.196zm0-7.001V8h-13v8.5h4.341c.191.54.457 1.044.785 1.5H2a1.5 1.5 0 0 1-1.5-1.5v-13A1.5 1.5 0 0 1 2 2h4.5a1.5 1.5 0 0 1 1.06.44L9.122 4H16a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 19 8v2.531a6.027 6.027 0 0 0-1.5-1.228zM16 6.5v-1H8.5l-2-2H2v13h1V8a1.5 1.5 0 0 1 1.5-1.5H16z"/><path d="M14.5 19.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zM15 14v-2h-1v2h-2v1h2v2h1v-2h2v-1h-2z"/></svg>',tooltip:!0}),o.bind("isEnabled").to(n),o.on("execute",()=>{t.execute("ckfinder"),t.editing.view.focus()}),o})}}class Ig extends ce{constructor(t){super(t),this.stopListening(this.editor.model.document,"change"),this.listenTo(this.editor.model.document,"change",()=>this.refresh(),{priority:"low"})}refresh(){const t=this.editor.commands.get("insertImage"),e=this.editor.commands.get("link");this.isEnabled=t.isEnabled||e.isEnabled}execute(){const t=this.editor,e=this.editor.config.get("ckfinder.openerMethod")||"modal";if("popup"!=e&&"modal"!=e)throw new a("ckfinder-unknown-openermethod",t);const i=this.editor.config.get("ckfinder.options")||{};i.chooseFiles=!0;const n=i.onInit;i.language||(i.language=t.locale.uiLanguage),i.onInit=e=>{n&&n(e),e.on("files:choose",i=>{const n=i.data.files.toArray(),o=n.filter(t=>!t.isImage()),r=n.filter(t=>t.isImage());for(const e of o)t.execute("link",e.getUrl());const s=[];for(const t of r){const i=t.getUrl();s.push(i||e.request("file:getProxyUrl",{file:t}))}s.length&&Lg(t,s)}),e.on("file:choose:resizedImage",e=>{const i=e.data.resizedUrl;if(i)Lg(t,[i]);else{const e=t.plugins.get("Notification"),i=t.locale.t;e.showWarning(i("Could not obtain resized image URL."),{title:i("Selecting resized image failed"),namespace:"ckfinder"})}})},window.CKFinder[e](i)}}function Lg(t,e){if(t.commands.get("insertImage").isEnabled)t.execute("insertImage",{source:e});else{const e=t.plugins.get("Notification"),i=t.locale.t;e.showWarning(i("Could not insert image at the current position."),{title:i("Inserting image failed"),namespace:"ckfinder"})}}class Ng extends ae{static get pluginName(){return"CKFinderEditing"}static get requires(){return[wh,"ImageEditing","LinkEditing"]}init(){const t=this.editor;t.commands.add("ckfinder",new Ig(t))}}class Rg extends ae{static get pluginName(){return"CloudServicesUploadAdapter"}static get requires(){return["CloudServices",cg]}init(){const t=this.editor,e=t.plugins.get("CloudServices"),i=e.token,n=e.uploadUrl;i&&(this._uploadGateway=t.plugins.get("CloudServicesCore").createUploadGateway(i,n),t.plugins.get(cg).createUploadAdapter=t=>new Og(this._uploadGateway,t))}}class Og{constructor(t,e){this.uploadGateway=t,this.loader=e}upload(){return this.loader.file.then(t=>(this.fileUploader=this.uploadGateway.upload(t),this.fileUploader.on("progress",(t,e)=>{this.loader.uploadTotal=e.total,this.loader.uploaded=e.uploaded}),this.fileUploader.send()))}abort(){this.fileUploader.abort()}}class zg extends ce{refresh(){const t=this.editor.model,e=Ws(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("element","paragraph"),this.isEnabled=!!e&&Dg(e,t.schema)}execute(t={}){const e=this.editor.model,i=e.document;e.change(n=>{const o=(t.selection||i.selection).getSelectedBlocks();for(const t of o)!t.is("element","paragraph")&&Dg(t,e.schema)&&n.rename(t,"paragraph")})}}function Dg(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)}class Vg extends ce{execute(t){const e=this.editor.model;let i=t.position;e.change(t=>{const n=t.createElement("paragraph");if(!e.schema.checkChild(i.parent,n)){const o=e.schema.findAllowedParent(i,n);if(!o)return;i=t.split(i,o).position}e.insertContent(n,i),t.setSelection(n,"in")})}}class jg extends ae{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model;t.commands.add("paragraph",new zg(t)),t.commands.add("insertParagraph",new Vg(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(t,{writer:e})=>jg.paragraphLikeElements.has(t.name)?t.isEmpty?null:e.createElement("paragraph"):null,view:/.+/,converterPriority:"low"})}}jg.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"]);class Bg extends ce{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=Ws(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>Fg(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,i=e.document,n=t.value;e.change(t=>{const o=Array.from(i.selection.getSelectedBlocks()).filter(t=>Fg(t,n,e.schema));for(const e of o)e.is("element",n)||t.rename(e,n)})}}function Fg(t,e,i){return i.checkChild(t.parent,e)&&!i.isObject(t)}class Hg extends ae{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[jg]}init(){const t=this.editor,e=t.config.get("heading.options"),i=[];for(const n of e)"paragraph"!==n.model&&(t.model.schema.register(n.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(n),i.push(n.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new Bg(t,i))}afterInit(){const t=this.editor,e=t.commands.get("enter"),i=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(e,n)=>{const o=t.model.document.selection.getFirstPosition().parent;i.some(t=>o.is("element",t.model))&&!o.is("element","paragraph")&&0===o.childCount&&n.writer.rename(o,"paragraph")})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:s.get("low")+1})}}i(6846);class Ug extends ae{static get pluginName(){return"HeadingUI"}init(){const t=this.editor,e=t.t,i=function(t){const e=t.t,i={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map(t=>{const e=i[t.title];return e&&e!=t.title&&(t.title=e),t})}(t),n=e("Choose heading"),o=e("Heading");t.ui.componentFactory.add("heading",e=>{const r={},s=new gn,a=t.commands.get("heading"),l=t.commands.get("paragraph"),c=[a];for(const t of i){const e={type:"button",model:new bh({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(l,"value"),e.model.set("commandName","paragraph"),c.push(l)):(e.model.bind("isOn").to(a,"value",e=>e===t.model),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),r[t.model]=t.title}const d=rh(e);return ah(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:o}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(c,"isEnabled",(...t)=>t.some(t=>t)),d.buttonView.bind("label").to(a,"value",l,"value",(t,e)=>{const i=t||e&&"paragraph";return r[i]?r[i]:n}),this.listenTo(d,"execute",e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()}),d})}}class qg extends ae{static get requires(){return[Eh]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",e=>{(function(t){const e=t.getSelectedElement();return!(!e||!Du(e))})(t.editing.view.document.selection)&&e.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:i,getRelatedElement:n,balloonClassName:o="ck-toolbar-container"}){if(!i.length)return void l("widget-toolbar-no-items",{toolbarId:t});const r=this.editor,s=r.t,c=new Zd(r.locale);if(c.ariaLabel=e||s("Widget toolbar"),this._toolbarDefinitions.has(t))throw new a("widget-toolbar-duplicated",this,{toolbarId:t});c.fillFromConfig(i,r.ui.componentFactory),this._toolbarDefinitions.set(t,{view:c,getRelatedElement:n,balloonClassName:o})}_updateToolbarsVisibility(){let t=0,e=null,i=null;for(const n of this._toolbarDefinitions.values()){const o=n.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&o)if(this.editor.ui.focusTracker.isFocused){const r=o.getAncestors().length;r>t&&(t=r,e=o,i=n)}else this._isToolbarVisible(n)&&this._hideToolbar(n);else this._isToolbarInBalloon(n)&&this._hideToolbar(n)}i&&this._showToolbar(i,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?Wg(this.editor,e):this._isToolbarInBalloon(t)||(this._balloon.add({view:t.view,position:$g(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);Wg(this.editor,e)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function Wg(t,e){const i=t.plugins.get("ContextualBalloon"),n=$g(t,e);i.updatePosition(n)}function $g(t,e){const i=t.editing.view,n=yh.defaultPositions;return{target:i.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,$u]}}class Gg{constructor(t){this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=t,this._referenceCoordinates=null}begin(t,e,i){const n=new Bs(e);this.activeHandlePosition=function(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const i of e)if(t.classList.contains("ck-widget__resizer__handle-"+i))return i}(t),this._referenceCoordinates=function(t,e){const i=new Bs(t),n=e.split("-"),o={x:"right"==n[1]?i.right:i.left,y:"bottom"==n[0]?i.bottom:i.top};return o.x+=t.ownerDocument.defaultView.scrollX,o.y+=t.ownerDocument.defaultView.scrollY,o}(e,function(t){const e=t.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[e[0]]}-${i[e[1]]}`}(this.activeHandlePosition)),this.originalWidth=n.width,this.originalHeight=n.height,this.aspectRatio=n.width/n.height;const o=i.style.width;o&&o.match(/^\d+(\.\d*)?%$/)?this.originalWidthPercents=parseFloat(o):this.originalWidthPercents=function(t,e){const i=t.parentElement,n=parseFloat(i.ownerDocument.defaultView.getComputedStyle(i).width);return e.width/n*100}(i,n)}update(t){this.proposedWidth=t.width,this.proposedHeight=t.height,this.proposedWidthPercents=t.widthPercents,this.proposedHandleHostWidth=t.handleHostWidth,this.proposedHandleHostHeight=t.handleHostHeight}}se(Gg,te);class Yg{constructor(t){this._options=t,this._domResizerWrapper=null,this._viewResizerWrapper=null,this.set("isEnabled",!0),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{this.state.proposedWidth||this.state.proposedWidthPercents||(this._cleanup(),t.stop())},{priority:"high"}),this.on("change:isEnabled",()=>{this.isEnabled&&this.redraw()})}attach(){const t=this,e=this._options.viewElement;this._options.editor.editing.view.change(i=>{const n=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},(function(e){const i=this.toDomElement(e);return t._appendHandles(i),t._appendSizeUI(i),t._domResizerWrapper=i,t.on("change:isEnabled",(t,e,n)=>{i.style.display=n?"":"none"}),i.style.display=t.isEnabled?"":"none",i}));i.insert(i.createPositionAt(e,"end"),n),i.addClass("ck-widget_with-resizer",e),this._viewResizerWrapper=n})}begin(t){this.state=new Gg(this._options),this._sizeUI.bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(t,this._getHandleHost(),this._getResizeHost())}updateSize(t){const e=this._proposeNewSize(t);this._options.editor.editing.view.change(t=>{const i=this._options.unit||"%",n=("%"===i?e.widthPercents:e.width)+i;t.setStyle("width",n,this._options.viewElement)});const i=this._getHandleHost(),n=new Bs(i);e.handleHostWidth=Math.round(n.width),e.handleHostHeight=Math.round(n.height);const o=new Bs(i);e.width=Math.round(o.width),e.height=Math.round(o.height),this.redraw(n),this.state.update(e)}commit(){const t=this._options.unit||"%",e=("%"===t?this.state.proposedWidthPercents:this.state.proposedWidth)+t;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(e)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(t){const e=this._domResizerWrapper;if(!((i=e)&&i.ownerDocument&&i.ownerDocument.contains(i)))return;var i;const n=e.parentElement,o=this._getHandleHost(),r=this._viewResizerWrapper,s=[r.getStyle("width"),r.getStyle("height"),r.getStyle("left"),r.getStyle("top")];let a;if(n.isSameNode(o)){const e=t||new Bs(o);a=[e.width+"px",e.height+"px",void 0,void 0]}else a=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];"same"!==xn(s,a)&&this._options.editor.editing.view.change(t=>{t.setStyle({width:a[0],height:a[1],left:a[2],top:a[3]},r)})}containsHandle(t){return this._domResizerWrapper.contains(t)}static isResizeHandle(t){return t.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeUI.dismiss(),this._sizeUI.isVisible=!1;this._options.editor.editing.view.change(t=>{t.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(t){const e=this.state,i={x:(n=t).pageX,y:n.pageY};var n;const o=!this._options.isCentered||this._options.isCentered(this),r={x:e._referenceCoordinates.x-(i.x+e.originalWidth),y:i.y-e.originalHeight-e._referenceCoordinates.y};o&&e.activeHandlePosition.endsWith("-right")&&(r.x=i.x-(e._referenceCoordinates.x+e.originalWidth)),o&&(r.x*=2);const s={width:Math.abs(e.originalWidth+r.x),height:Math.abs(e.originalHeight+r.y)};s.dominant=s.width/e.aspectRatio>s.height?"width":"height",s.max=s[s.dominant];const a={width:s.width,height:s.height};return"width"==s.dominant?a.height=a.width/e.aspectRatio:a.width=a.height*e.aspectRatio,{width:Math.round(a.width),height:Math.round(a.height),widthPercents:Math.min(Math.round(e.originalWidthPercents/e.originalWidth*a.width*100)/100,100)}}_getResizeHost(){const t=this._domResizerWrapper.parentElement;return this._options.getResizeHost(t)}_getHandleHost(){const t=this._domResizerWrapper.parentElement;return this._options.getHandleHost(t)}_appendHandles(t){const e=["top-left","top-right","bottom-right","bottom-left"];for(const n of e)t.appendChild(new dd({tag:"div",attributes:{class:"ck-widget__resizer__handle "+(i=n,"ck-widget__resizer__handle-"+i)}}).render());var i}_appendSizeUI(t){const e=new Kg;e.render(),this._sizeUI=e,t.appendChild(e.element)}}se(Yg,te);class Kg extends cd{constructor(){super();const t=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",t.to("activeHandlePosition",t=>t?"ck-orientation-"+t:"")],style:{display:t.if("isVisible","none",t=>!t)}},children:[{text:t.to("label")}]})}bindToState(t,e){this.bind("isVisible").to(e,"proposedWidth",e,"proposedHeight",(t,e)=>null!==t&&null!==e),this.bind("label").to(e,"proposedHandleHostWidth",e,"proposedHandleHostHeight",e,"proposedWidthPercents",(e,i,n)=>"px"===t.unit?`${e}×${i}`:n+"%"),this.bind("activeHandlePosition").to(e)}dismiss(){this.unbind(),this.isVisible=!1}}i(353);class Qg extends ae{static get pluginName(){return"WidgetResize"}init(){this.set("visibleResizer",null),this.set("_activeResizer",null),this._resizers=new Map;const t=Or.window.document;this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0}),this.editor.editing.view.addObserver(Qh),this._observer=Object.create($r),this.listenTo(this.editor.editing.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this));const e=()=>{this.visibleResizer&&this.visibleResizer.redraw()};this._redrawFocusedResizerThrottled=sm(e,200),this.on("change:visibleResizer",e),this.editor.ui.on("update",this._redrawFocusedResizerThrottled),this._observer.listenTo(Or.window,"resize",this._redrawFocusedResizerThrottled);const i=this.editor.editing.view.document.selection;i.on("change",()=>{const t=i.getSelectedElement();this.visibleResizer=this.getResizerByViewElement(t)||null})}destroy(){this._observer.stopListening();for(const t of this._resizers.values())t.destroy();this._redrawFocusedResizerThrottled.cancel()}attachTo(t){const e=new Yg(t),i=this.editor.plugins;if(e.attach(),i.has("WidgetToolbarRepository")){const t=i.get("WidgetToolbarRepository");e.on("begin",()=>{t.forceDisabled("resize")},{priority:"lowest"}),e.on("cancel",()=>{t.clearForceDisabled("resize")},{priority:"highest"}),e.on("commit",()=>{t.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(t.viewElement,e);const n=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(n)==e&&(this.visibleResizer=e),e}getResizerByViewElement(t){return this._resizers.get(t)}_getResizerByHandle(t){for(const e of this._resizers.values())if(e.containsHandle(t))return e}_mouseDownListener(t,e){const i=e.domTarget;Yg.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i),this._activeResizer&&(this._activeResizer.begin(i),t.stop(),e.preventDefault()))}_mouseMoveListener(t,e){this._activeResizer&&this._activeResizer.updateSize(e)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}}se(Qg,te);class Jg extends Kr{observe(t){this.listenTo(t,"load",(t,e)=>{const i=e.target;this.checkShouldIgnoreEventFromTarget(i)||"IMG"==i.tagName&&this._fireEvents(e)},{useCapture:!0})}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}}function Zg(t){return!!t.getCustomProperty("image")&&Du(t)}function Xg(t){const e=t.getSelectedElement();return e&&Zg(e)?e:null}function tf(t){return!!t&&t.is("element","image")}function ef(t,e={},i=null){t.change(n=>{const o=n.createElement("image",e),r=i||qu(t.document.selection,t);t.insertContent(o,r),o.parent&&n.setSelection(o,"on")})}function nf(t){const e=t.schema,i=t.document.selection;return function(t,e,i){const n=function(t,e){const i=qu(t,e).parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(t,i);return e.checkChild(n,"image")}(i,e,t)&&!Wu(i,e)&&function(t){return[...t.focus.getAncestors()].every(t=>!t.is("element","image"))}(i)}function of(t){const e=[];for(const i of t.getChildren())e.push(i),i.is("element")&&e.push(...i.getChildren());return e.find(t=>t.is("element","img"))}function rf(t){return i=>{i.on(`attribute:${t}:image`,e)};function e(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const n=i.writer,o=of(i.mapper.toViewElement(e.item));n.setAttribute(e.attributeKey,e.attributeNewValue||"",o)}}class sf extends ce{refresh(){this.isEnabled=nf(this.editor.model)}execute(t){const e=this.editor.model;for(const i of pn(t.source))ef(e,{src:i})}}class af extends ae{static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.model.schema,i=t.t,n=t.conversion;t.editing.view.addObserver(Jg),e.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset","data-asset-variable"]}),n.for("dataDowncast").elementToElement({model:"image",view:(t,{writer:e})=>lf(e)}),n.for("editingDowncast").elementToElement({model:"image",view:(t,{writer:e})=>function(t,e,i){return e.setCustomProperty("image",!0,t),Vu(t,e,{label:function(){const e=of(t).getAttribute("alt");return e?`${e} ${i}`:i}})}(lf(e),e,i("image widget"))}),n.for("downcast").add(rf("src")).add(rf("alt")).add(rf("data-asset-variable")).add(function(){return e=>{e.on("attribute:srcset:image",t)};function t(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const n=i.writer,o=of(i.mapper.toViewElement(e.item));if(null===e.attributeNewValue){const t=e.attributeOldValue;t.data&&(n.removeAttribute("srcset",o),n.removeAttribute("sizes",o),t.width&&n.removeAttribute("width",o))}else{const t=e.attributeNewValue;t.data&&(n.setAttribute("srcset",t.data,o),n.setAttribute("sizes","100vw",o),t.width&&n.setAttribute("width",t.width,o))}}}()),n.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(t,{writer:e})=>e.createElement("image",{src:t.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"data-asset-variable"},model:"data-asset-variable"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}}).add(function(){return e=>{e.on("element:figure",t)};function t(t,e,i){if(!i.consumable.test(e.viewItem,{name:!0,classes:"image"}))return;const n=of(e.viewItem);if(!n||!n.hasAttribute("src")||!i.consumable.test(n,{name:!0}))return;const o=Ws(i.convertItem(n,e.modelCursor).modelRange.getItems());o&&(i.convertChildren(e.viewItem,o),i.updateConversionResult(o,e))}}());const o=new sf(t);t.commands.add("insertImage",o),t.commands.add("imageInsert",o)}}function lf(t){const e=t.createEmptyElement("img"),i=t.createContainerElement("figure",{class:"image"});return t.insert(t.createPositionAt(i,0),e),i}class cf extends ce{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=tf(t),tf(t)&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor.model,i=e.document.selection.getSelectedElement();e.change(e=>{e.setAttribute("alt",t.newValue,i)})}}class df extends ae{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new cf(this.editor))}}i(3456),i(49);class hf extends cd{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new $s,this.keystrokes=new Gs,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),Bc,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),jc,"ck-button-cancel","cancel"),this._focusables=new ld,this._focusCycler=new Dd({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]}),sd(this)}render(){super.render(),this.keystrokes.listenTo(this.element),ad({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}_createButton(t,e,i,n){const o=new Nd(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createLabeledInputView(){const t=this.locale.t,e=new fh(this.locale,ph);return e.label=t("Text alternative"),e}}function uf(t){const e=t.editing.view,i=yh.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}class mf extends ae{static get requires(){return[Eh]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",i=>{const n=t.commands.get("imageTextAlternative"),o=new Nd(i);return o.set({label:e("Change image text alternative"),icon:Hc,tooltip:!0}),o.bind("isEnabled").to(n,"isEnabled"),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const t=this.editor,e=t.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new hf(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(t,e)=>{this._hideForm(!0),e()}),this.listenTo(t.ui,"update",()=>{Xg(e.selection)?this._isVisible&&function(t){const e=t.plugins.get("ContextualBalloon");if(Xg(t.editing.view.document.selection)){const i=uf(t);e.updatePosition(i)}}(t):this._hideForm(!0)}),rd({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:uf(t)}),i.fieldView.value=i.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(t){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}}class gf extends ae{static get requires(){return[df,mf]}static get pluginName(){return"ImageTextAlternative"}}i(8593);function ff(t){const e=t.getSelectedElement();return e&&function(t){return!!t.getCustomProperty("image")&&Du(t)}(e)?e:null}function pf(t){return!!t&&t.is("element","image")}function wf(t){const e=t.schema,i=t.document.selection;return function(t,e,i){const n=function(t,e){const i=qu(t,e).parent;if(i.isEmpty&&!i.is("element","$root"))return i.parent;return i}(t,i);return e.checkChild(n,"image")}(i,e,t)&&!Wu(i,e)&&function(t){return[...t.focus.getAncestors()].every(t=>!t.is("element","image"))}(i)}function bf(t){const e=[];for(const i of t.getChildren())e.push(i),i.is("element")&&e.push(...i.getChildren());return e.find(t=>t.is("element","img"))}function kf(t){for(const e of t.getChildren())if(e&&e.is("element","caption"))return e;return null}function _f(t){const e=t.parent;return"figcaption"==t.name&&e&&"figure"==e.name&&e.hasClass("image")?{name:!0}:null}class vf extends ae{static get pluginName(){return"ImageCaptionEditing"}init(){const t=this.editor,e=t.editing.view,i=t.model.schema,n=t.data,o=t.editing,r=t.t;i.isRegistered("caption")?i.extend("caption",{allowIn:"image"}):i.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),t.model.document.registerPostFixer(t=>this._insertMissingModelCaptionElement(t)),t.conversion.for("upcast").elementToElement({view:_f,model:"caption"});n.downcastDispatcher.on("insert:caption",yf(t=>t.createContainerElement("figcaption"),!1));const s=function(t,e){return i=>{const n=i.createEditableElement("figcaption");return i.setCustomProperty("imageCaption",!0,n),Nh({view:t,element:n,text:e}),Uu(n,i)}}(e,r("Enter image caption"));o.downcastDispatcher.on("insert:caption",yf(s)),o.downcastDispatcher.on("insert",this._fixCaptionVisibility(t=>t.item),{priority:"high"}),o.downcastDispatcher.on("remove",this._fixCaptionVisibility(t=>t.position.parent),{priority:"high"}),e.document.registerPostFixer(t=>this._updateCaptionVisibility(t))}_updateCaptionVisibility(t){const e=this.editor.editing.mapper,i=this._lastSelectedCaption;let n;const o=this.editor.model.document.selection,r=o.getSelectedElement();if(r&&r.is("element","image")){const t=kf(r);n=e.toViewElement(t)}const s=xf(o.getFirstPosition().parent);if(s&&(n=e.toViewElement(s)),n&&!this.editor.isReadOnly)return i?(i===n||(Af(i,t),this._lastSelectedCaption=n),Cf(n,t)):(this._lastSelectedCaption=n,Cf(n,t));if(i){const e=Af(i,t);return this._lastSelectedCaption=null,e}return!1}_fixCaptionVisibility(t){return(e,i,n)=>{const o=xf(t(i)),r=this.editor.editing.mapper,s=n.writer;if(o){const t=r.toViewElement(o);t&&(o.childCount?s.removeClass("ck-hidden",t):s.addClass("ck-hidden",t))}}}_insertMissingModelCaptionElement(t){const e=this.editor.model,i=e.document.differ.getChanges(),n=[];for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter;if(i.is("element","image")&&!kf(i)&&n.push(i),!i.is("element","image")&&i.childCount)for(const t of e.createRangeIn(i).getItems())t.is("element","image")&&!kf(t)&&n.push(t)}for(const e of n)t.appendElement("caption",e);return!!n.length}}function yf(t,e=!0){return(i,n,o)=>{const r=n.item;if((r.childCount||e)&&pf(r.parent)){if(!o.consumable.consume(n.item,"insert"))return;const e=o.mapper.toViewElement(n.range.start.parent),i=t(o.writer),s=o.writer;r.childCount||s.addClass("ck-hidden",i),function(t,e,i,n){const o=n.writer.createPositionAt(i,"end");n.writer.insert(o,t),n.mapper.bindElements(e,t)}(i,n.item,e,o)}}}function xf(t){const e=t.getAncestors({includeSelf:!0}).find(t=>"caption"==t.name);return e&&e.parent&&"image"==e.parent.name?e:null}function Af(t,e){return!t.childCount&&!t.hasClass("ck-hidden")&&(e.addClass("ck-hidden",t),!0)}function Cf(t,e){return!!t.hasClass("ck-hidden")&&(e.removeClass("ck-hidden",t),!0)}i(1213);class Tf extends ae{static get requires(){return[vf]}static get pluginName(){return"ImageCaption"}}class Ef extends ce{constructor(t,e){super(t),this.defaultStyle=!1,this.styles=e.reduce((t,e)=>(t[e.name]=e,e.isDefault&&(this.defaultStyle=e.name),t),{})}refresh(){const t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=pf(t),t)if(t.hasAttribute("imageStyle")){const e=t.getAttribute("imageStyle");this.value=!!this.styles[e]&&e}else this.value=this.defaultStyle;else this.value=!1}execute(t){const e=t.value,i=this.editor.model,n=i.document.selection.getSelectedElement();i.change(t=>{this.styles[e].isDefault?t.removeAttribute("imageStyle",n):t.setAttribute("imageStyle",e,n)})}}function Sf(t,e){for(const i of e)if(i.name===t)return i}const Pf={full:{name:"full",title:"Full size image",icon:Jc,isDefault:!0},side:{name:"side",title:"Side image",icon:Qc,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:Yc,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:Kc,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:Qc,className:"image-style-align-right"}},Mf={full:Jc,left:Yc,right:Qc,center:Kc};function If(t=[]){return t.map(Lf)}function Lf(t){if("string"==typeof t){const e=t;Pf[e]?t=Object.assign({},Pf[e]):(l("image-style-not-found",{name:e}),t={name:e})}else if(Pf[t.name]){const e=Pf[t.name],i=Object.assign({},t);for(const n in e)Object.prototype.hasOwnProperty.call(t,n)||(i[n]=e[n]);t=i}return"string"==typeof t.icon&&Mf[t.icon]&&(t.icon=Mf[t.icon]),t}class Nf extends ae{static get pluginName(){return"ImageStyleEditing"}init(){const t=this.editor,e=t.model.schema,i=t.data,n=t.editing;t.config.define("image.styles",["full","side"]);const o=If(t.config.get("image.styles"));e.extend("image",{allowAttributes:"imageStyle"});const r=function(t){return(e,i,n)=>{if(!n.consumable.consume(i.item,e.name))return;const o=Sf(i.attributeNewValue,t),r=Sf(i.attributeOldValue,t),s=n.mapper.toViewElement(i.item),a=n.writer;r&&a.removeClass(r.className,s),o&&a.addClass(o.className,s)}}(o);n.downcastDispatcher.on("attribute:imageStyle:image",r),i.downcastDispatcher.on("attribute:imageStyle:image",r),i.upcastDispatcher.on("element:figure",function(t){const e=t.filter(t=>!t.isDefault);return(t,i,n)=>{if(!i.modelRange)return;const o=i.viewItem,r=Ws(i.modelRange.getItems());if(!r||n.schema.checkAttribute(r,"imageStyle"))for(const t of e)n.consumable.consume(o,{classes:t.className})&&n.writer.setAttribute("imageStyle",t.name,r)}}(o),{priority:"low"}),t.commands.add("imageStyle",new Ef(t,o))}}i(8454);class Rf extends ae{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=function(t,e){for(const i of t)e[i.title]&&(i.title=e[i.title]);return t}(If(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const e of t)this._createButton(e)}_createButton(t){const e=this.editor,i="imageStyle:"+t.name;e.ui.componentFactory.add(i,i=>{const n=e.commands.get("imageStyle"),o=new Nd(i);return o.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(n,"isEnabled"),o.bind("isOn").to(n,"value",e=>e===t.name),this.listenTo(o,"execute",()=>{e.execute("imageStyle",{value:t.name}),e.editing.view.focus()}),o})}}function Of(t){const e=t.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)}function zf(t){return new Promise((e,i)=>{const n=t.getAttribute("src");fetch(n).then(t=>t.blob()).then(t=>{const i=Df(t,n),o=i.replace("image/",""),r=new File([t],"image."+o,{type:i});e(r)}).catch(t=>t&&"TypeError"===t.name?function(t){return function(t){return new Promise((e,i)=>{const n=Or.document.createElement("img");n.addEventListener("load",()=>{const t=Or.document.createElement("canvas");t.width=n.width,t.height=n.height;t.getContext("2d").drawImage(n,0,0),t.toBlob(t=>t?e(t):i())}),n.addEventListener("error",()=>i()),n.src=t})}(t).then(e=>{const i=Df(e,t),n=i.replace("image/","");return new File([e],"image."+n,{type:i})})}(n).then(e).catch(i):i(t))})}function Df(t,e){return t.type?t.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}class Vf extends ae{static get pluginName(){return"ImageUploadUI"}init(){const t=this.editor,e=t.t,i=i=>{const n=new hg(i),o=t.commands.get("uploadImage"),r=t.config.get("image.upload.types"),s=Of(r);return n.set({acceptedType:r.map(t=>"image/"+t).join(","),allowMultipleFiles:!0}),n.buttonView.set({label:e("Insert image"),icon:Uc,tooltip:!0}),n.buttonView.bind("isEnabled").to(o),n.on("done",(e,i)=>{const n=Array.from(i).filter(t=>s.test(t.type));n.length&&t.execute("uploadImage",{file:n})}),n};t.ui.componentFactory.add("uploadImage",i),t.ui.componentFactory.add("imageUpload",i)}}i(7800),i(4919),i(8753);class jf extends ae{static get pluginName(){return"ImageUploadProgress"}constructor(t){super(t),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 700 250"><rect rx="4"/></svg>')}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(t,e,i){const n=this.editor,o=e.item,r=o.getAttribute("uploadId");if(!i.consumable.consume(e.item,t.name))return;const s=n.plugins.get(cg),a=r?e.attributeNewValue:null,l=this.placeholder,c=n.editing.mapper.toViewElement(o),d=i.writer;if("reading"==a)return Bf(c,d),void Ff(l,c,d);if("uploading"==a){const t=s.loaders.get(r);return Bf(c,d),void(t?(Hf(c,d),function(t,e,i,n){const o=function(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty("progressBar",!0,e),e}(e);e.insert(e.createPositionAt(t,"end"),o),i.on("change:uploadedPercent",(t,e,i)=>{n.change(t=>{t.setStyle("width",i+"%",o)})})}(c,d,t,n.editing.view),function(t,e,i){if(i.data){const n=bf(t);e.setAttribute("src",i.data,n)}}(c,d,t)):Ff(l,c,d))}"complete"==a&&s.loaders.get(r)&&function(t,e,i){const n=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),n),setTimeout(()=>{i.change(t=>t.remove(t.createRangeOn(n)))},3e3)}(c,d,n.editing.view),function(t,e){qf(t,e,"progressBar")}(c,d),Hf(c,d),function(t,e){e.removeClass("ck-appear",t)}(c,d)}}function Bf(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function Ff(t,e,i){e.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",e);const n=bf(e);n.getAttribute("src")!==t&&i.setAttribute("src",t,n),Uf(e,"placeholder")||i.insert(i.createPositionAfter(n),function(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty("placeholder",!0,e),e}(i))}function Hf(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),qf(t,e,"placeholder")}function Uf(t,e){for(const i of t.getChildren())if(i.getCustomProperty(e))return i}function qf(t,e,i){const n=Uf(t,i);n&&e.remove(e.createRangeOn(n))}class Wf extends ce{refresh(){const t=this.editor.model.document.selection.getSelectedElement(),e=t&&"image"===t.name||!1;this.isEnabled=wf(this.editor.model)||e}execute(t){const e=this.editor,i=e.model,n=e.plugins.get(cg);for(const e of pn(t.file))$f(i,n,e)}}function $f(t,e,i){const n=e.createLoader(i);n&&function(t,e={},i=null){t.change(n=>{const o=n.createElement("image",e),r=i||qu(t.document.selection,t);t.insertContent(o,r),o.parent&&n.setSelection(o,"on")})}(t,{uploadId:n.id})}class Gf extends ae{static get requires(){return[cg,wh,xu]}static get pluginName(){return"ImageUploadEditing"}constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}})}init(){const t=this.editor,e=t.model.document,i=t.model.schema,n=t.conversion,o=t.plugins.get(cg),r=Of(t.config.get("image.upload.types"));i.extend("image",{allowAttributes:["uploadId","uploadStatus"]});const s=new Wf(t);t.commands.add("uploadImage",s),t.commands.add("imageUpload",s),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(e,i)=>{if(n=i.dataTransfer,Array.from(n.types).includes("text/html")&&""!==n.getData("text/html"))return;var n;const o=Array.from(i.dataTransfer.files).filter(t=>!!t&&r.test(t.type));o.length&&(e.stop(),t.model.change(e=>{i.targetRanges&&e.setSelection(i.targetRanges.map(e=>t.editing.mapper.toModelRange(e))),t.model.enqueueChange("default",()=>{t.execute("uploadImage",{file:o})})}))}),this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",(e,i)=>{const n=Array.from(t.editing.view.createRangeIn(i.content)).filter(t=>{return!(!(e=t.item).is("element","img")||!e.getAttribute("src"))&&(e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g))&&!t.item.getAttribute("uploadProcessed");var e}).map(t=>({promise:zf(t.item),imageElement:t.item}));if(!n.length)return;const r=new Jh(t.editing.view.document);for(const t of n){r.setAttribute("uploadProcessed",!0,t.imageElement);const e=o.createLoader(t.promise);e&&(r.setAttribute("src","",t.imageElement),r.setAttribute("uploadId",e.id,t.imageElement))}}),t.editing.view.document.on("dragover",(t,e)=>{e.preventDefault()}),e.on("change",()=>{const i=e.differ.getChanges({includeChangesInGraveyard:!0});for(const e of i)if("insert"==e.type&&"$text"!=e.name){const i=e.position.nodeAfter,n="$graveyard"==e.position.root.rootName;for(const e of Yf(t,i)){const t=e.getAttribute("uploadId");if(!t)continue;const i=o.loaders.get(t);i&&(n?i.abort():"idle"==i.status&&this._readAndUpload(i,e))}}}),this.on("uploadComplete",(t,{imageElement:e,data:i})=>{const n=i.urls?i.urls:i;this.editor.model.change(t=>{t.setAttribute("src",n.default,e),this._parseAndSetSrcsetAttributeOnImage(n,e,t)})},{priority:"low"})}_readAndUpload(t,e){const i=this.editor,n=i.model,o=i.locale.t,r=i.plugins.get(cg),s=i.plugins.get(wh);return n.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","reading",e)}),t.read().then(()=>{const o=t.upload();if(Uo.isSafari){const t=bf(i.editing.mapper.toViewElement(e));i.editing.view.once("render",()=>{if(!t.parent)return;const e=i.editing.view.domConverter.mapViewToDom(t.parent);if(!e)return;const n=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=n})}return n.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","uploading",e)}),o}).then(t=>{n.enqueueChange("transparent",i=>{i.setAttribute("uploadStatus","complete",e),this.fire("uploadComplete",{data:t,imageElement:e})}),a()}).catch(i=>{if("error"!==t.status&&"aborted"!==t.status)throw i;"error"==t.status&&i&&s.showWarning(i,{title:o("Upload failed"),namespace:"upload"}),a(),n.enqueueChange("transparent",t=>{t.remove(e)})});function a(){n.enqueueChange("transparent",t=>{t.removeAttribute("uploadId",e),t.removeAttribute("uploadStatus",e)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,i){let n=0;const o=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e))return n=Math.max(n,e),!0}).map(e=>`${t[e]} ${e}w`).join(", ");""!=o&&i.setAttribute("srcset",{data:o,width:n},e)}}function Yf(t,e){return Array.from(t.model.createRangeOn(e)).filter(t=>t.item.is("element","image")).map(t=>t.item)}const Kf=["resizeImage:25","resizeImage:50","resizeImage:75","resizeImage:100","resizeImage:original"];function Qf(t){return Kf.includes(t)}class Jf extends ce{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=tf(t),t&&t.hasAttribute("width")?this.value={width:t.getAttribute("width"),height:null}:this.value=null}execute(t){const e=this.editor.model,i=e.document.selection.getSelectedElement(),n=this.editor.config.get("image.resizeOptions").filter(t=>Qf(t.name)).some(t=>!!t.className);this.value={width:t.width,height:null},i&&e.change(e=>{n?e.setAttribute("resizeImage",t.value,i):e.setAttribute("width",t.width,i)})}}class Zf extends ae{static get pluginName(){return"ImageResizeEditing"}constructor(t){super(t),t.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"},{name:"resizeImage:100",value:"100",icon:"full"}]})}init(){const t=this.editor,e=new Jf(t);this.editor.config.get("image.resizeOptions").filter(t=>Qf(t.name)).some(t=>!!t.className)?(this._registerClassSchema(),this._registerClassConverters()):(this._registerInlineSchema(),this._registerConverters()),t.commands.add("resizeImage",e),t.commands.add("imageResize",e)}_registerInlineSchema(){this.editor.model.schema.extend("image",{allowAttributes:"width"}),this.editor.model.schema.setAttributeProperties("width",{isFormatting:!0})}_registerClassSchema(){this.editor.model.schema.extend("image",{allowAttributes:"resizeImage"}),this.editor.model.schema.setAttributeProperties("resizeImage",{isFormatting:!0})}_registerClassConverters(){this.editor.conversion.attributeToAttribute(function(t){const e={model:{key:"resizeImage",values:t.resizeOptions.map(t=>t.name)},view:{}};for(const i of t.resizeOptions)e.view[i.name]={key:"class",value:i.className};return e}(this.editor.config.get("image")))}_registerConverters(){const t=this.editor;t.conversion.for("downcast").add(t=>t.on("attribute:width:image",(t,e,i)=>{if(!i.consumable.consume(e.item,t.name))return;const n=i.writer,o=i.mapper.toViewElement(e.item);null!==e.attributeNewValue?(n.setStyle("width",e.attributeNewValue,o),n.addClass("image_resized",o)):(n.removeStyle("width",o),n.removeClass("image_resized",o))})),t.conversion.for("upcast").attributeToAttribute({view:{name:"figure",styles:{width:/.+/}},model:{key:"width",value:t=>t.getStyle("width")}})}}const Xf={small:td,medium:ed,large:Xc,full:Jc,original:Zc};function tp(t){return e=>null===t&&e===t||e&&e.width===t}class ep extends ae{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new he(t)),t.commands.add("outdent",new he(t))}}const ip='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z"/></svg>',np='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z"/></svg>';class op extends ae{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,i=t.t,n="ltr"==e.uiLanguageDirection?ip:np,o="ltr"==e.uiLanguageDirection?np:ip;this._defineButton("indent",i("Increase indent"),n),this._defineButton("outdent",i("Decrease indent"),o)}_defineButton(t,e,i){const n=this.editor;n.ui.componentFactory.add(t,o=>{const r=n.commands.get(t),s=new Nd(o);return s.set({label:e,icon:i,tooltip:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(s,"execute",()=>{n.execute(t),n.editing.view.focus()}),s})}}class rp{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(t=>this._definitions.add(t)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(t,e,i)=>{if(!i.consumable.test(e.item,"attribute:linkHref"))return;const n=i.writer,o=n.document.selection;for(const t of this._definitions){const r=n.createAttributeElement("a",t.attributes,{priority:5});n.setCustomProperty("link",!0,r),t.callback(e.attributeNewValue)?e.item.is("selection")?n.wrap(o.getFirstRange(),r):n.wrap(i.mapper.toViewRange(e.range),r):n.unwrap(i.mapper.toViewRange(e.range),r)}},{priority:"high"})}}getDispatcherForLinkedImage(){return t=>{t.on("attribute:linkHref:image",(t,e,i)=>{const n=i.mapper.toViewElement(e.item),o=Array.from(n.getChildren()).find(t=>"a"===t.name);for(const t of this._definitions){const n=Sn(t.attributes);if(t.callback(e.attributeNewValue))for(const[t,e]of n)"class"===t?i.writer.addClass(e,o):i.writer.setAttribute(t,e,o);else for(const[t,e]of n)"class"===t?i.writer.removeClass(e,o):i.writer.removeAttribute(t,o)}})}}}const sp=function(t,e,i){var n=t.length;return i=void 0===i?n:i,!e&&i>=n?t:Kn(t,e,i)};var ap=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");const lp=function(t){return ap.test(t)};const cp=function(t){return t.split("")};var dp="[\\ud800-\\udfff]",hp="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",up="\\ud83c[\\udffb-\\udfff]",mp="[^\\ud800-\\udfff]",gp="(?:\\ud83c[\\udde6-\\uddff]){2}",fp="[\\ud800-\\udbff][\\udc00-\\udfff]",pp="(?:"+hp+"|"+up+")"+"?",wp="[\\ufe0e\\ufe0f]?"+pp+("(?:\\u200d(?:"+[mp,gp,fp].join("|")+")[\\ufe0e\\ufe0f]?"+pp+")*"),bp="(?:"+[mp+hp+"?",hp,gp,fp,dp].join("|")+")",kp=RegExp(up+"(?="+up+")|"+bp+wp,"g");const _p=function(t){return t.match(kp)||[]};const vp=function(t){return lp(t)?_p(t):cp(t)};const yp=function(t){return function(e){e=qn(e);var i=lp(e)?vp(e):void 0,n=i?i[0]:e.charAt(0),o=i?sp(i,1).join(""):e.slice(1);return n[t]()+o}}("toUpperCase"),xp=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Ap=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i,Cp=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,Tp=/^((\w+:(\/{2,})?)|(\W))/i;function Ep(t,{writer:e}){const i=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,i),i}function Sp(t){return function(t){return t.replace(xp,"").match(Ap)}(t=String(t))?t:"#"}function Pp(t,e){return!!t&&(t.is("element","image")&&e.checkAttribute("image","linkHref"))}function Mp(t,e){const i=(n=t,Cp.test(n)?"mailto:":e);var n;const o=!!i&&!Tp.test(t);return t&&o?i+t:t}class Ip extends ce{constructor(t){super(t),this.manualDecorators=new gn,this.automaticDecorators=new rp}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document,i=Ws(e.selection.getSelectedBlocks());Pp(i,t.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttribute(i,"linkHref")):(this.value=e.selection.getAttribute("linkHref"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref"));for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}execute(t,e={}){const i=this.editor.model,n=i.document.selection,o=[],r=[];for(const t in e)e[t]?o.push(t):r.push(t);i.change(e=>{if(n.isCollapsed){const s=n.getFirstPosition();if(n.hasAttribute("linkHref")){const a=Km(s,"linkHref",n.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,a),o.forEach(t=>{e.setAttribute(t,!0,a)}),r.forEach(t=>{e.removeAttribute(t,a)}),e.setSelection(e.createPositionAfter(a.end.nodeBefore))}else if(""!==t){const r=Sn(n.getAttributes());r.set("linkHref",t),o.forEach(t=>{r.set(t,!0)});const{end:a}=i.insertContent(e.createText(t,r),s);e.setSelection(a)}["linkHref",...o,...r].forEach(t=>{e.removeSelectionAttribute(t)})}else{const s=i.schema.getValidRanges(n.getRanges(),"linkHref"),a=[];for(const t of n.getSelectedBlocks())i.schema.checkAttribute(t,"linkHref")&&a.push(e.createRangeOn(t));const l=a.slice();for(const t of s)this._isRangeToUpdate(t,a)&&l.push(t);for(const i of l)e.setAttribute("linkHref",t,i),o.forEach(t=>{e.setAttribute(t,!0,i)}),r.forEach(t=>{e.removeAttribute(t,i)})}})}_getDecoratorStateFromModel(t){const e=this.editor.model,i=e.document,n=Ws(i.selection.getSelectedBlocks());return Pp(n,e.schema)?n.getAttribute(t):i.selection.getAttribute(t)}_isRangeToUpdate(t,e){for(const i of e)if(i.containsRange(t))return!1;return!0}}class Lp extends ce{refresh(){const t=this.editor.model,e=t.document,i=Ws(e.selection.getSelectedBlocks());Pp(i,t.schema)?this.isEnabled=t.schema.checkAttribute(i,"linkHref"):this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref")}execute(){const t=this.editor,e=this.editor.model,i=e.document.selection,n=t.commands.get("link");e.change(t=>{const o=i.isCollapsed?[Km(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),e)]:e.schema.getValidRanges(i.getRanges(),"linkHref");for(const e of o)if(t.removeAttribute("linkHref",e),n)for(const i of n.manualDecorators)t.removeAttribute(i.id,e)})}}class Np{constructor({id:t,label:e,attributes:i,defaultValue:n}){this.id=t,this.set("value"),this.defaultValue=n,this.label=e,this.attributes=i}}se(Np,te);i(1306);const Rp=/^(https?:)?\/\//;class Op extends ae{static get pluginName(){return"LinkEditing"}static get requires(){return[Rm,Mm,xu]}constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Ep}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>Ep(Sp(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new Ip(t)),t.commands.add("unlink",new Lp(t));const e=function(t,e){const i={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach(t=>(t.label&&i[t.label]&&(t.label=i[t.label]),t)),e}(t.t,function(t){const e=[];if(t)for(const[i,n]of Object.entries(t)){const t=Object.assign({},n,{id:"link"+yp(i)});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(e.filter(t=>"automatic"===t.mode)),this._enableManualDecorators(e.filter(t=>"manual"===t.mode));t.plugins.get(Rm).registerAttribute("linkHref"),Jm(t,"linkHref","a","ck-link_selected"),this._enableInsertContentSelectionAttributesFixer(),this._enableClickingAfterLink(),this._enableTypingOverLink(),this._handleDeleteContentAfterLink()}_enableAutomaticDecorators(t){const e=this.editor,i=e.commands.get("link").automaticDecorators;e.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:"automatic",callback:t=>Rp.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(t),i.length&&e.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,i=e.commands.get("link").manualDecorators;t.forEach(t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),i.add(new Np(t)),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,{writer:n})=>{if(e){const e=i.get(t.id).attributes,o=n.createAttributeElement("a",e,{priority:5});return n.setCustomProperty("link",!0,o),o}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:i.get(t.id).attributes},model:{key:t.id}})})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;this.listenTo(t,"insertContent",()=>{const i=e.anchor.nodeBefore,n=e.anchor.nodeAfter;e.hasAttribute("linkHref")&&i&&i.hasAttribute("linkHref")&&(n&&n.hasAttribute("linkHref")||t.change(e=>{zp(e,Vp(t.schema))}))},{priority:"low"})}_enableClickingAfterLink(){const t=this.editor,e=t.model;t.editing.view.addObserver(Qh);let i=!1;this.listenTo(t.editing.view.document,"mousedown",()=>{i=!0}),this.listenTo(t.editing.view.document,"selectionChange",()=>{if(!i)return;i=!1;const t=e.document.selection;if(!t.isCollapsed)return;if(!t.hasAttribute("linkHref"))return;const n=t.getFirstPosition(),o=Km(n,"linkHref",t.getAttribute("linkHref"),e);(n.isTouching(o.start)||n.isTouching(o.end))&&e.change(t=>{zp(t,Vp(e.schema))})})}_enableTypingOverLink(){const t=this.editor,e=t.editing.view;let i,n;this.listenTo(e.document,"delete",()=>{n=!0},{priority:"high"}),this.listenTo(t.model,"deleteContent",()=>{const e=t.model.document.selection;e.isCollapsed||(n?n=!1:Dp(t)&&function(t){const e=t.document.selection,i=e.getFirstPosition(),n=e.getLastPosition(),o=i.nodeAfter;if(!o)return!1;if(!o.is("$text"))return!1;if(!o.hasAttribute("linkHref"))return!1;const r=n.textNode||n.nodeBefore;if(o===r)return!0;return Km(i,"linkHref",o.getAttribute("linkHref"),t).containsRange(t.createRange(i,n),!0)}(t.model)&&(i=e.getAttributes()))},{priority:"high"}),this.listenTo(t.model,"insertContent",(e,[o])=>{n=!1,Dp(t)&&i&&(t.model.change(t=>{for(const[e,n]of i)t.setAttribute(e,n,o)}),i=null)},{priority:"high"})}_handleDeleteContentAfterLink(){const t=this.editor,e=t.model,i=e.document.selection,n=t.editing.view;let o=!1,r=!1;this.listenTo(n.document,"delete",(t,e)=>{r=e.domEvent.keyCode===$o.backspace},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{o=!1;const t=i.getFirstPosition(),n=i.getAttribute("linkHref");if(!n)return;const r=Km(t,"linkHref",n,e);o=r.containsPosition(t)||r.end.isEqual(t)},{priority:"high"}),this.listenTo(e,"deleteContent",()=>{r&&(r=!1,o||t.model.enqueueChange(t=>{zp(t,Vp(e.schema))}))},{priority:"low"})}}function zp(t,e){t.removeSelectionAttribute("linkHref");for(const i of e)t.removeSelectionAttribute(i)}function Dp(t){return t.plugins.get("Input").isInput(t.model.change(t=>t.batch))}function Vp(t){return t.getDefinition("$text").allowAttributes.filter(t=>t.startsWith("link"))}i(7512);class jp extends cd{constructor(t,e){super(t);const i=t.t;this.focusTracker=new $s,this.keystrokes=new Gs,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Bc,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),jc,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusables=new ld,this._focusCycler=new Dd({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const n=["ck","ck-link-form","ck-responsive-form"];e.manualDecorators.length&&n.push("ck-link-form_layout-vertical","ck-vertical-form"),this.setTemplate({tag:"form",attributes:{class:n,tabindex:"-1"},children:this.children}),sd(this)}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),ad({view:this});[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new fh(this.locale,ph);return e.label=t("Link URL"),e}_createButton(t,e,i,n){const o=new Nd(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const i of t.manualDecorators){const n=new Rd(this.locale);n.set({name:i.id,label:i.label,withText:!0}),n.bind("isOn").toMany([i,t],"value",(t,e)=>void 0===e&&void 0===t?i.defaultValue:t),n.on("execute",()=>{i.set("value",!n.isOn)}),e.add(n)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const t=new cd;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(t)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}i(554);class Bp extends cd{constructor(t){super(t);const e=t.t;this.focusTracker=new $s,this.keystrokes=new Gs,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z"/></svg>',"unlink"),this.editButtonView=this._createButton(e("Edit link"),id,"edit"),this.set("href"),this._focusables=new ld,this._focusCycler=new Dd({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions","ck-responsive-form"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render();[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,i){const n=new Nd(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.delegate("execute").to(this,i),n}_createPreviewButton(){const t=new Nd(this.locale),e=this.bindTemplate,i=this.t;return t.set({withText:!0,tooltip:i("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",t=>t&&Sp(t)),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",t=>t||i("This link has no URL")),t.bind("isEnabled").to(this,"href",t=>!!t),t.template.tag="a",t.template.eventListeners={},t}}class Fp extends ae{static get requires(){return[Eh]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(Kh),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(Eh),this._createToolbarLinkButton(),this._enableUserBalloonInteractions(),t.conversion.for("editingDowncast").markerToHighlight({model:"link-ui",view:{classes:["ck-fake-link-selection"]}}),t.conversion.for("editingDowncast").markerToElement({model:"link-ui",view:{name:"span",classes:["ck-fake-link-selection","ck-fake-link-selection_collapsed"]}})}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const t=this.editor,e=new Bp(t.locale),i=t.commands.get("link"),n=t.commands.get("unlink");return e.bind("href").to(i,"value"),e.editButtonView.bind("isEnabled").to(i),e.unlinkButtonView.bind("isEnabled").to(n),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(t,e)=>{this._hideUI(),e()}),e.keystrokes.set("Ctrl+K",(t,e)=>{this._addFormView(),e()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),i=t.config.get("link.defaultProtocol"),n=new jp(t.locale,e);return n.urlInputView.fieldView.bind("value").to(e,"value"),n.urlInputView.bind("isReadOnly").to(e,"isEnabled",t=>!t),n.saveButtonView.bind("isEnabled").to(e),this.listenTo(n,"submit",()=>{const{value:e}=n.urlInputView.fieldView.element,o=Mp(e,i);t.execute("link",o,n.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(n,"cancel",()=>{this._closeFormView()}),n.keystrokes.set("Esc",(t,e)=>{this._closeFormView(),e()}),n}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),i=t.t;t.keystrokes.set("Ctrl+K",(t,i)=>{i(),e.isEnabled&&this._showUI(!0)}),t.ui.componentFactory.add("link",t=>{const n=new Nd(t);return n.isEnabled=!0,n.label=i("Link"),n.icon='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z"/></svg>',n.keystroke="Ctrl+K",n.tooltip=!0,n.isToggleable=!0,n.bind("isEnabled").to(e,"isEnabled"),n.bind("isOn").to(e,"value",t=>!!t),this.listenTo(n,"execute",()=>this._showUI(!0)),n})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),rd({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const t=this.editor.commands.get("link");this.formView.disableCssTransitions(),this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions(),this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),void 0!==t.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus(),this._hideFakeVisualSelection())}_showUI(t=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView),this._hideFakeVisualSelection()}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let i=this._getSelectedLinkElement(),n=r();const o=()=>{const t=this._getSelectedLinkElement(),e=r();i&&!t||!i&&e!==n?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=t,n=e};function r(){return e.selection.focus.getAncestors().reverse().find(t=>t.is("element"))}this.listenTo(t.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=this.editor.model,i=t.document;let n=null;if(e.markers.has("link-ui")){const e=Array.from(this.editor.editing.mapper.markerNameToElements("link-ui")),i=t.createRange(t.createPositionBefore(e[0]),t.createPositionAfter(e[e.length-1]));n=t.domConverter.viewRangeToDom(i)}else{const e=this._getSelectedLinkElement(),o=i.selection.getFirstRange();n=e?t.domConverter.mapViewToDom(e):t.domConverter.viewRangeToDom(o)}return{target:n}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection;if(e.isCollapsed)return Hp(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),n=Hp(i.start),o=Hp(i.end);return n&&n==o&&t.createRangeIn(n).getTrimmed().isEqual(i)?n:null}}_showFakeVisualSelection(){const t=this.editor.model;t.change(e=>{const i=t.document.selection.getFirstRange();if(t.markers.has("link-ui"))e.updateMarker("link-ui",{range:i});else if(i.start.isAtEnd){const n=i.start.getLastMatchingPosition(({item:e})=>!t.schema.isContent(e),{boundaries:i});e.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:e.createRange(n,i.end)})}else e.addMarker("link-ui",{usingOperation:!1,affectsData:!1,range:i})})}_hideFakeVisualSelection(){const t=this.editor.model;t.markers.has("link-ui")&&t.change(t=>{t.removeMarker("link-ui")})}}function Hp(t){return t.getAncestors().find(t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e})}const Up=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63})))(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i");class qp extends ae{static get pluginName(){return"AutoLink"}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling()}_enableTypingHandling(){const t=this.editor,e=new Nm(t.model,t=>{if(!function(t){return t.length>4&&" "===t[t.length-1]&&" "!==t[t.length-2]}(t))return;const e=Wp(t.substr(0,t.length-1));return e?{url:e}:void 0}),i=t.plugins.get("Input");e.on("matched:data",(e,n)=>{const{batch:o,range:r,url:s}=n;if(!i.isInput(o))return;const a=r.end.getShiftedBy(-1),l=a.getShiftedBy(-s.length),c=t.model.createRange(l,a);this._applyAutoLink(s,c)}),e.bind("isEnabled").to(this)}_enableEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("enter");i&&i.on("execute",()=>{const t=e.document.selection.getFirstPosition();if(!t.parent.previousSibling)return;const i=e.createRangeIn(t.parent.previousSibling);this._checkAndApplyAutoLinkOnRange(i)})}_enableShiftEnterHandling(){const t=this.editor,e=t.model,i=t.commands.get("shiftEnter");i&&i.on("execute",()=>{const t=e.document.selection.getFirstPosition(),i=e.createRange(e.createPositionAt(t.parent,0),t.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(i)})}_checkAndApplyAutoLinkOnRange(t){const e=this.editor.model,{text:i,range:n}=Lm(t,e),o=Wp(i);if(o){const t=e.createRange(n.end.getShiftedBy(-o.length),n.end);this._applyAutoLink(o,t)}}_applyAutoLink(t,e){const i=this.editor.model;this.isEnabled&&function(t,e){return e.schema.checkAttributeInSelection(e.createSelection(t),"linkHref")}(e,i)&&i.enqueueChange(i=>{const n=this.editor.config.get("link.defaultProtocol"),o=Mp(t,n);i.setAttribute("linkHref",o,e)})}}function Wp(t){const e=Up.exec(t);return e?e[2]:null}class $p extends ce{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.document,n=Array.from(i.selection.getSelectedBlocks()).filter(t=>Yp(t,e.schema)),o=void 0!==t.forceValue?!t.forceValue:this.value;e.change(t=>{if(o){let e=n[n.length-1].nextSibling,i=Number.POSITIVE_INFINITY,o=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t<i&&(i=t);const n=t-i;o.push({element:e,listIndent:n}),e=e.nextSibling}o=o.reverse();for(const e of o)t.setAttribute("listIndent",e.listIndent,e.element)}if(!o){let t=Number.POSITIVE_INFINITY;for(const e of n)e.is("element","listItem")&&e.getAttribute("listIndent")<t&&(t=e.getAttribute("listIndent"));t=0===t?1:t,Gp(n,!0,t),Gp(n,!1,t)}for(const e of n.reverse())o&&"listItem"==e.name?t.rename(e,"paragraph"):o||"listItem"==e.name?o||"listItem"!=e.name||e.getAttribute("listType")==this.type||t.setAttribute("listType",this.type,e):(t.setAttributes({listType:this.type,listIndent:0},e),t.rename(e,"listItem"));this.fire("_executeCleanup",n)})}_getValue(){const t=Ws(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is("element","listItem")&&t.getAttribute("listType")==this.type}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=Ws(t.getSelectedBlocks());return!!i&&Yp(i,e)}}function Gp(t,e,i){const n=e?t[0]:t[t.length-1];if(n.is("element","listItem")){let o=n[e?"previousSibling":"nextSibling"],r=n.getAttribute("listIndent");for(;o&&o.is("element","listItem")&&o.getAttribute("listIndent")>=i;)r>o.getAttribute("listIndent")&&(r=o.getAttribute("listIndent")),o.getAttribute("listIndent")==r&&t[e?"unshift":"push"](o),o=o[e?"previousSibling":"nextSibling"]}}function Yp(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)}class Kp extends ce{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=i[i.length-1];let n=e.nextSibling;for(;n&&"listItem"==n.name&&n.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(n),n=n.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}this.fire("_executeCleanup",i)})}_checkEnabled(){const t=Ws(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("element","listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let n=t.previousSibling;for(;n&&n.is("element","listItem")&&n.getAttribute("listIndent")>=e;){if(n.getAttribute("listIndent")==e)return n.getAttribute("listType")==i;n=n.previousSibling}return!1}return!0}}function Qp(t,e){const i=e.mapper,n=e.writer,o="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=iw,e}(n),s=n.createContainerElement(o,null);return n.insert(n.createPositionAt(s,0),r),i.bindElements(t,r),r}function Jp(t,e,i,n){const o=e.parent,r=i.mapper,s=i.writer;let a=r.toViewPosition(n.createPositionBefore(t));const l=tw(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),c=t.previousSibling;if(l&&l.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(l);a=s.breakContainer(s.createPositionAfter(t))}else if(c&&"listItem"==c.name){a=r.toViewPosition(n.createPositionAt(c,"end"));const t=r.findMappedViewAncestor(a),e=function(t){for(const e of t.getChildren())if("ul"==e.name||"ol"==e.name)return e;return null}(t);a=e?s.createPositionBefore(e):s.createPositionAt(t,"end")}else a=r.toViewPosition(n.createPositionBefore(t));if(a=Xp(a),s.insert(a,o),c&&"listItem"==c.name){const t=r.toViewElement(c),i=s.createRange(s.createPositionAt(t,0),a).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("element","li")){const n=s.breakContainer(s.createPositionBefore(t.item)),o=t.item.parent,r=s.createPositionAt(e,"end");Zp(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(o),r),i.position=n}}else{const i=o.nextSibling;if(i&&(i.is("element","ul")||i.is("element","ol"))){let n=null;for(const e of i.getChildren()){const i=r.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;n=e}n&&(s.breakContainer(s.createPositionAfter(n)),s.move(s.createRangeOn(n.parent),s.createPositionAt(e,"end")))}}Zp(s,o,o.nextSibling),Zp(s,o.previousSibling,o)}function Zp(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function Xp(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}function tw(t,e){const i=!!e.sameIndent,n=!!e.smallerIndent,o=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(i&&o==t||n&&o>t)return r;r="forward"===e.direction?r.nextSibling:r.previousSibling}return null}function ew(t,e,i,n){t.ui.componentFactory.add(e,o=>{const r=t.commands.get(e),s=new Nd(o);return s.set({label:i,icon:n,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{t.execute(e),t.editing.view.focus()}),s})}function iw(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:bo.call(this)}function nw(t){return(e,i,n)=>{const o=n.consumable;if(!o.test(i.item,"insert")||!o.test(i.item,"attribute:listType")||!o.test(i.item,"attribute:listIndent"))return;o.consume(i.item,"insert"),o.consume(i.item,"attribute:listType"),o.consume(i.item,"attribute:listIndent");const r=i.item;Jp(r,Qp(r,n),n,t)}}function ow(t,e,i){if(!i.consumable.consume(e.item,"attribute:listType"))return;const n=i.mapper.toViewElement(e.item),o=i.writer;o.breakContainer(o.createPositionBefore(n)),o.breakContainer(o.createPositionAfter(n));const r=n.parent,s="numbered"==e.attributeNewValue?"ol":"ul";o.rename(s,r)}function rw(t,e,i){const n=i.mapper.toViewElement(e.item).parent,o=i.writer;Zp(o,n,n.nextSibling),Zp(o,n.previousSibling,n);for(const t of e.item.getChildren())i.consumable.consume(t,"insert")}function sw(t,e,i){if("listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const n=i.writer,o=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=n.breakContainer(t),"li"==t.parent.name);){const e=t,i=n.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=n.remove(n.createRange(e,i));o.push(t)}t=n.createPositionAfter(t.parent)}if(o.length>0){for(let e=0;e<o.length;e++){const i=t.nodeBefore;if(t=n.insert(t,o[e]).end,e>0){const e=Zp(n,i,i.nextSibling);e&&e.parent==i&&t.offset--}}Zp(n,t.nodeBefore,t.nodeAfter)}}}function aw(t,e,i){const n=i.mapper.toViewPosition(e.position),o=n.nodeBefore,r=n.nodeAfter;Zp(i.writer,o,r)}function lw(t,e,i){if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,n=t.createElement("listItem"),o=function(t){let e=0,i=t.parent;for(;i;){if(i.is("element","li"))e++;else{const t=i.previousSibling;t&&t.is("element","li")&&e++}i=i.parent}return e}(e.viewItem);t.setAttribute("listIndent",o,n);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";if(t.setAttribute("listType",r,n),!i.safeInsert(n,e.modelCursor))return;const s=function(t,e,i){const{writer:n,schema:o}=i;let r=n.createPositionAfter(t);for(const s of e)if("ul"==s.name||"ol"==s.name)r=i.convertItem(s,r).modelCursor;else{const e=i.convertItem(s,n.createPositionAt(t,"end")),a=e.modelRange.start.nodeAfter;a&&a.is("element")&&!o.checkChild(t,a.name)&&(t=e.modelCursor.parent.is("element","listItem")?e.modelCursor.parent:mw(e.modelCursor),r=n.createPositionAfter(t))}return r}(n,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,s),i.updateConversionResult(n,e)}}function cw(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("element","li")||fw(e))&&e._remove()}}}function dw(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1,n=!0;for(const e of t)i&&!fw(e)&&e._remove(),e.is("$text")?(n&&(e._data=e.data.trimStart()),e.nextSibling&&!fw(e.nextSibling)||(e._data=e.data.trimEnd())):fw(e)&&(i=!0),n=!1}}function hw(t){return(e,i)=>{if(i.isPhantom)return;const n=i.modelPosition.nodeBefore;if(n&&n.is("element","listItem")){const e=i.mapper.toViewElement(n),o=e.getAncestors().find(fw),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("element","li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==o){i.viewPosition=t.nextPosition;break}}}}}function uw(t,[e,i]){let n,o=e.is("documentFragment")?e.getChild(0):e;if(n=i?this.createSelection(i):this.document.selection,o&&o.is("element","listItem")){const t=n.getFirstPosition();let e=null;if(t.parent.is("element","listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("element","listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;o&&o.is("element","listItem");)o._setAttribute("listIndent",o.getAttribute("listIndent")+t),o=o.nextSibling}}}function mw(t){const e=new ha({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("element","listItem"));return i.value.item}function gw(t,e,i,n,o,r){const s=tw(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:"b"}),a=o.mapper,l=o.writer,c=s?s.getAttribute("listIndent"):null;let d;if(s)if(c==t){const t=a.toViewElement(s).parent;d=l.createPositionAfter(t)}else{const t=r.createPositionAt(s,"end");d=a.toViewPosition(t)}else d=i;d=Xp(d);for(const t of[...n.getChildren()])fw(t)&&(d=l.move(l.createRangeOn(t),d).end,Zp(l,t,t.nextSibling),Zp(l,t.previousSibling,t))}function fw(t){return t.is("element","ol")||t.is("element","ul")}class pw extends ae{static get pluginName(){return"ListEditing"}static get requires(){return[Su,Lu]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var n;t.model.document.registerPostFixer(e=>function(t,e){const i=t.document.differ.getChanges(),n=new Map;let o=!1;for(const n of i)if("insert"==n.type&&"listItem"==n.name)r(n.position);else if("insert"==n.type&&"listItem"!=n.name){if("$text"!=n.name){const i=n.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),o=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),o=!0),i.hasAttribute("listStyle")&&(e.removeAttribute("listStyle",i),o=!0);for(const e of Array.from(t.createRangeIn(i)).filter(t=>t.item.is("element","listItem")))r(e.previousPosition)}r(n.position.getShiftedBy(n.length))}else"remove"==n.type&&"listItem"==n.name?r(n.position):("attribute"==n.type&&"listIndent"==n.attributeKey||"attribute"==n.type&&"listType"==n.attributeKey)&&r(n.range.start);for(const t of n.values())s(t),a(t);return o;function r(t){const e=t.nodeBefore;if(e&&e.is("element","listItem")){let t=e;if(n.has(t))return;for(let e=t.previousSibling;e&&e.is("element","listItem");e=t.previousSibling)if(t=e,n.has(t))return;n.set(e,t)}else{const e=t.nodeAfter;e&&e.is("element","listItem")&&n.set(e,e)}}function s(t){let i=0,n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(r>i){let s;null===n?(n=r-i,s=i):(n>r&&(n=r),s=r-n),e.setAttribute("listIndent",s,t),o=!0}else n=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let i=[],n=null;for(;t&&t.is("element","listItem");){const r=t.getAttribute("listIndent");if(n&&n.getAttribute("listIndent")>r&&(i=i.slice(0,r+1)),0!=r)if(i[r]){const n=i[r];t.getAttribute("listType")!=n&&(e.setAttribute("listType",n,t),o=!0)}else i[r]=t.getAttribute("listType");n=t,t=t.nextSibling}}}(t.model,e)),i.mapper.registerViewToModelLength("li",ww),e.mapper.registerViewToModelLength("li",ww),i.mapper.on("modelToViewPosition",hw(i.view)),i.mapper.on("viewToModelPosition",(n=t.model,(t,e)=>{const i=e.viewPosition,o=i.parent,r=e.mapper;if("ul"==o.name||"ol"==o.name){if(i.isAtEnd){const t=r.toModelElement(i.nodeBefore),o=r.getModelLength(i.nodeBefore);e.modelPosition=n.createPositionBefore(t).getShiftedBy(o)}else{const t=r.toModelElement(i.nodeAfter);e.modelPosition=n.createPositionBefore(t)}t.stop()}else if("li"==o.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const s=r.toModelElement(o);let a=1,l=i.nodeBefore;for(;l&&fw(l);)a+=r.getModelLength(l),l=l.previousSibling;e.modelPosition=n.createPositionBefore(s).getShiftedBy(a),t.stop()}})),e.mapper.on("modelToViewPosition",hw(i.view)),t.conversion.for("editingDowncast").add(e=>{e.on("insert",sw,{priority:"high"}),e.on("insert:listItem",nw(t.model)),e.on("attribute:listType:listItem",ow,{priority:"high"}),e.on("attribute:listType:listItem",rw,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,n)=>{if(!n.consumable.consume(i.item,"attribute:listIndent"))return;const o=n.mapper.toViewElement(i.item),r=n.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,l=r.createRangeOn(s);r.remove(l),a&&a.nextSibling&&Zp(r,a,a.nextSibling),gw(i.attributeOldValue+1,i.range.start,l.start,o,n,t),Jp(i.item,o,n,t);for(const t of i.item.getChildren())n.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,n)=>{const o=n.mapper.toViewPosition(i.position).getLastMatchingPosition(t=>!t.item.is("element","li")).nodeAfter,r=n.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,l=r.createRangeOn(s),c=r.remove(l);a&&a.nextSibling&&Zp(r,a,a.nextSibling);gw(n.mapper.toModelElement(o).getAttribute("listIndent")+1,i.position,l.start,o,n,t);for(const t of r.createRangeIn(c).getItems())n.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",aw,{priority:"low"})}),t.conversion.for("dataDowncast").add(e=>{e.on("insert",sw,{priority:"high"}),e.on("insert:listItem",nw(t.model))}),t.conversion.for("upcast").add(t=>{t.on("element:ul",cw,{priority:"high"}),t.on("element:ol",cw,{priority:"high"}),t.on("element:li",dw,{priority:"high"}),t.on("element:li",lw)}),t.model.on("insertContent",uw,{priority:"high"}),t.commands.add("numberedList",new $p(t,"numbered")),t.commands.add("bulletedList",new $p(t,"bulleted")),t.commands.add("indentList",new Kp(t,"forward")),t.commands.add("outdentList",new Kp(t,"backward"));const o=i.view.document;this.listenTo(o,"enter",(t,e)=>{const i=this.editor.model.document,n=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==n.name&&n.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{context:"li"}),this.listenTo(o,"delete",(t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const n=i.getFirstPosition();if(!n.isAtStart)return;const o=n.parent;if("listItem"!==o.name)return;o.previousSibling&&"listItem"===o.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop())},{context:"li"});const r=t=>(e,i)=>{this.editor.commands.get(t).isEnabled&&(this.editor.execute(t),i())};t.keystrokes.set("Tab",r("indentList")),t.keystrokes.set("Shift+Tab",r("outdentList"))}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function ww(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=ww(t);return e}class bw extends ae{static get pluginName(){return"ListUI"}init(){const t=this.editor.t;ew(this.editor,"numberedList",t("Numbered List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z"/></svg>'),ew(this.editor,"bulletedList",t("Bulleted List"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z"/></svg>')}}function kw(t,e){return t=>{t.on("attribute:url:media",i)};function i(i,n,o){if(!o.consumable.consume(n.item,i.name))return;const r=n.attributeNewValue,s=o.writer,a=o.mapper.toViewElement(n.item),l=[...a.getChildren()].find(t=>t.getCustomProperty("media-content"));s.remove(l);const c=t.getMediaViewElement(s,r,e);s.insert(s.createPositionAt(a,0),c)}}function _w(t,e,i,n){const o=t.createContainerElement("figure",{class:"media"});return t.insert(t.createPositionAt(o,0),e.getMediaViewElement(t,i,n)),o}function vw(t){const e=t.getSelectedElement();return e&&e.is("element","media")?e:null}function yw(t,e,i){t.change(n=>{const o=n.createElement("media",{url:e});t.insertContent(o,i),n.setSelection(o,"on")})}class xw extends ce{refresh(){const t=this.editor.model,e=t.document.selection,i=t.schema,n=vw(e);this.value=n?n.getAttribute("url"):null,this.isEnabled=function(t){const e=t.getSelectedElement();return!!e&&"media"===e.name}(e)||function(t,e){let i=qu(t,e).parent;i.isEmpty&&!e.schema.isLimit(i)&&(i=i.parent);return e.schema.checkChild(i,"media")}(e,t)&&!Wu(e,i)}execute(t){const e=this.editor.model,i=e.document.selection,n=vw(i);if(n)e.change(e=>{e.setAttribute("url",t,n)});else{const n=qu(i,e);yw(e,t,n)}}}class Aw{constructor(t,e){const i=e.providers,n=e.extraProviders||[],o=new Set(e.removeProviders),r=i.concat(n).filter(t=>{const e=t.name;return e?!o.has(e):(l("media-embed-no-provider-name",{provider:t}),!1)});this.locale=t,this.providerDefinitions=r}hasMedia(t){return!!this._getMedia(t)}getMediaViewElement(t,e,i){return this._getMedia(e).getViewElement(t,i)}_getMedia(t){if(!t)return new Cw(this.locale);t=t.trim();for(const e of this.providerDefinitions){const i=e.html,n=pn(e.url);for(const e of n){const n=this._getUrlMatches(t,e);if(n)return new Cw(this.locale,t,n,i)}}return null}_getUrlMatches(t,e){let i=t.match(e);if(i)return i;let n=t.replace(/^https?:\/\//,"");return i=n.match(e),i||(n=n.replace(/^www\./,""),i=n.match(e),i||null)}}class Cw{constructor(t,e,i,n){this.url=this._getValidUrl(e),this._t=t.t,this._match=i,this._previewRenderer=n}getViewElement(t,e){const i={};let n;if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(i["data-oembed-url"]=this.url),e.renderForEditingView&&(i.class="ck-media__wrapper");const o=this._getPreviewHtml(e);n=t.createRawElement("div",i,(function(t){t.innerHTML=o}))}else this.url&&(i.url=this.url),n=t.createEmptyElement(e.elementName,i);return t.setCustomProperty("media-content",!0,n),n}_getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():""}_getPlaceholderHtml(){const t=new Ld,e=new Id;t.text=this._t("Open media in new tab"),e.content='<svg viewBox="0 0 64 42" xmlns="http://www.w3.org/2000/svg"><path d="M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098-2.506.668-4.538-.083-4.538-1.678 0-1.594 2.032-3.43 4.538-4.098.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556A1.014 1.014 0 0 0 49 17h-1.574zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.994 1.994 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805V17zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17zm29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155h18.692zM20.6 21.375v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616V37.53H20.6zm24.233-16.155v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615V37.53h-1.615zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35v-9.956z"/></svg>',e.viewBox="0 0 64 42";return new dd({tag:"div",attributes:{class:"ck ck-reset_all ck-media__placeholder"},children:[{tag:"div",attributes:{class:"ck-media__placeholder__icon"},children:[e]},{tag:"a",attributes:{class:"ck-media__placeholder__url",target:"_blank",rel:"noopener noreferrer",href:this.url},children:[{tag:"span",attributes:{class:"ck-media__placeholder__url__text"},children:[this.url]},t]}]}).render().outerHTML}_getValidUrl(t){return t?t.match(/^https?/)?t:"https://"+t:null}}i(3841);class Tw extends ae{static get pluginName(){return"MediaEmbedEditing"}constructor(t){super(t),t.config.define("mediaEmbed",{elementName:"oembed",providers:[{name:"dailymotion",url:/^dailymotion\.com\/video\/(\w+)/,html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; "><iframe src="https://www.dailymotion.com/embed/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" width="480" height="270" allowfullscreen allow="autoplay"></iframe></div>`},{name:"spotify",url:[/^open\.spotify\.com\/(artist\/\w+)/,/^open\.spotify\.com\/(album\/\w+)/,/^open\.spotify\.com\/(track\/\w+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;"><iframe src="https://open.spotify.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe></div>`},{name:"youtube",url:[/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,/^youtube\.com\/embed\/([\w-]+)/,/^youtu\.be\/([\w-]+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://www.youtube.com/embed/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`},{name:"vimeo",url:[/^vimeo\.com\/(\d+)/,/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,/^vimeo\.com\/channels\/[^/]+\/(\d+)/,/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,/^player\.vimeo\.com\/video\/(\d+)/],html:t=>`<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;"><iframe src="https://player.vimeo.com/video/${t[1]}" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>`},{name:"instagram",url:/^instagram\.com\/p\/(\w+)/},{name:"twitter",url:/^twitter\.com/},{name:"googleMaps",url:[/^google\.com\/maps/,/^goo\.gl\/maps/,/^maps\.google\.com/,/^maps\.app\.goo\.gl/]},{name:"flickr",url:/^flickr\.com/},{name:"facebook",url:/^facebook\.com/}]}),this.registry=new Aw(t.locale,t.config.get("mediaEmbed"))}init(){const t=this.editor,e=t.model.schema,i=t.t,n=t.conversion,o=t.config.get("mediaEmbed.previewsInData"),r=t.config.get("mediaEmbed.elementName"),s=this.registry;t.commands.add("mediaEmbed",new xw(t)),e.register("media",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["url"]}),n.for("dataDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const i=t.getAttribute("url");return _w(e,s,i,{elementName:r,renderMediaPreview:i&&o})}}),n.for("dataDowncast").add(kw(s,{elementName:r,renderMediaPreview:o})),n.for("editingDowncast").elementToElement({model:"media",view:(t,{writer:e})=>{const n=t.getAttribute("url");return function(t,e,i){return e.setCustomProperty("media",!0,t),Vu(t,e,{label:i})}(_w(e,s,n,{elementName:r,renderForEditingView:!0}),e,i("media widget"))}}),n.for("editingDowncast").add(kw(s,{elementName:r,renderForEditingView:!0})),n.for("upcast").elementToElement({view:t=>["oembed",r].includes(t.name)&&t.getAttribute("url")?{name:!0}:null,model:(t,{writer:e})=>{const i=t.getAttribute("url");if(s.hasMedia(i))return e.createElement("media",{url:i})}}).elementToElement({view:{name:"div",attributes:{"data-oembed-url":!0}},model:(t,{writer:e})=>{const i=t.getAttribute("data-oembed-url");if(s.hasMedia(i))return e.createElement("media",{url:i})}})}}const Ew=/^(?:http(s)?:\/\/)?[\w-]+\.[\w-.~:/?#[\]@!$&'()*+,;=%]+$/;class Sw extends ae{static get requires(){return[mm,ag]}static get pluginName(){return"AutoMediaEmbed"}constructor(t){super(t),this._timeoutId=null,this._positionToInsert=null}init(){const t=this.editor,e=t.model.document;this.listenTo(t.plugins.get("ClipboardPipeline"),"inputTransformation",()=>{const t=e.selection.getFirstRange(),i=mc.fromPosition(t.start);i.stickiness="toPrevious";const n=mc.fromPosition(t.end);n.stickiness="toNext",e.once("change:data",()=>{this._embedMediaBetweenPositions(i,n),i.detach(),n.detach()},{priority:"high"})}),t.commands.get("undo").on("execute",()=>{this._timeoutId&&(Or.window.clearTimeout(this._timeoutId),this._positionToInsert.detach(),this._timeoutId=null,this._positionToInsert=null)},{priority:"high"})}_embedMediaBetweenPositions(t,e){const i=this.editor,n=i.plugins.get(Tw).registry,o=new Ma(t,e),r=o.getWalker({ignoreElementEnd:!0});let s="";for(const t of r)t.item.is("$textProxy")&&(s+=t.item.data);if(s=s.trim(),!s.match(Ew))return void o.detach();if(!n.hasMedia(s))return void o.detach();i.commands.get("mediaEmbed").isEnabled?(this._positionToInsert=mc.fromPosition(t),this._timeoutId=Or.window.setTimeout(()=>{i.model.change(t=>{let e;this._timeoutId=null,t.remove(o),o.detach(),"$graveyard"!==this._positionToInsert.root.rootName&&(e=this._positionToInsert),yw(i.model,s,e),this._positionToInsert.detach(),this._positionToInsert=null})},100)):o.detach()}}i(1531);class Pw extends cd{constructor(t,e){super(e);const i=e.t;this.focusTracker=new $s,this.keystrokes=new Gs,this.set("mediaURLInputValue",""),this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Bc,"ck-button-save"),this.saveButtonView.type="submit",this.saveButtonView.bind("isEnabled").to(this,"mediaURLInputValue",t=>!!t),this.cancelButtonView=this._createButton(i("Cancel"),jc,"ck-button-cancel","cancel"),this._focusables=new ld,this._focusCycler=new Dd({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this._validators=t,this.setTemplate({tag:"form",attributes:{class:["ck","ck-media-form","ck-responsive-form"],tabindex:"-1"},children:[this.urlInputView,this.saveButtonView,this.cancelButtonView]}),sd(this)}render(){super.render(),ad({view:this});[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element);const t=t=>t.stopPropagation();this.keystrokes.set("arrowright",t),this.keystrokes.set("arrowleft",t),this.keystrokes.set("arrowup",t),this.keystrokes.set("arrowdown",t),this.listenTo(this.urlInputView.element,"selectstart",(t,e)=>{e.stopPropagation()},{priority:"high"})}focus(){this._focusCycler.focusFirst()}get url(){return this.urlInputView.fieldView.element.value.trim()}set url(t){this.urlInputView.fieldView.element.value=t.trim()}isValid(){this.resetFormStatus();for(const t of this._validators){const e=t(this);if(e)return this.urlInputView.errorText=e,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault}_createUrlInput(){const t=this.locale.t,e=new fh(this.locale,ph),i=e.fieldView;return this._urlInputViewInfoDefault=t("Paste the media URL in the input."),this._urlInputViewInfoTip=t("Tip: Paste the URL into the content to embed faster."),e.label=t("Media URL"),e.infoText=this._urlInputViewInfoDefault,i.on("input",()=>{e.infoText=i.element.value?this._urlInputViewInfoTip:this._urlInputViewInfoDefault,this.mediaURLInputValue=i.element.value.trim()}),e}_createButton(t,e,i,n){const o=new Nd(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}}class Mw extends ae{static get requires(){return[Tw]}static get pluginName(){return"MediaEmbedUI"}init(){const t=this.editor,e=t.commands.get("mediaEmbed"),i=t.plugins.get(Tw).registry;t.ui.componentFactory.add("mediaEmbed",n=>{const o=rh(n),r=new Pw(function(t,e){return[e=>{if(!e.url.length)return t("The URL must not be empty.")},i=>{if(!e.hasMedia(i.url))return t("This media URL is not supported.")}]}(t.t,i),t.locale);return this._setUpDropdown(o,r,e,t),this._setUpForm(o,r,e),o})}_setUpDropdown(t,e,i){const n=this.editor,o=n.t,r=t.buttonView;function s(){n.editing.view.focus(),t.isOpen=!1}t.bind("isEnabled").to(i),t.panelView.children.add(e),r.set({label:o("Insert media"),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M18.68 3.03c.6 0 .59-.03.59.55v12.84c0 .59.01.56-.59.56H1.29c-.6 0-.59.03-.59-.56V3.58c0-.58-.01-.55.6-.55h17.38zM15.77 15V5H4.2v10h11.57zM2 4v1h1V4H2zm0 2v1h1V6H2zm0 2v1h1V8H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zM17 4v1h1V4h-1zm0 2v1h1V6h-1zm0 2v1h1V8h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zM7.5 7.177a.4.4 0 0 1 .593-.351l5.133 2.824a.4.4 0 0 1 0 .7l-5.133 2.824a.4.4 0 0 1-.593-.35V7.176v.001z"/></svg>',tooltip:!0}),r.on("open",()=>{e.disableCssTransitions(),e.url=i.value||"",e.urlInputView.fieldView.select(),e.focus(),e.enableCssTransitions()},{priority:"low"}),t.on("submit",()=>{e.isValid()&&(n.execute("mediaEmbed",e.url),s())}),t.on("change:isOpen",()=>e.resetFormStatus()),t.on("cancel",()=>s())}_setUpForm(t,e,i){e.delegate("submit","cancel").to(t),e.urlInputView.bind("value").to(i,"value"),e.urlInputView.bind("isReadOnly").to(i,"isEnabled",t=>!t)}}i(1593);function Iw(t,e){if(!t.childCount)return;const i=new Jh(t.document),n=function(t,e){const i=e.createRangeIn(t),n=new Pn({name:/^p|h\d+$/,styles:{"mso-list":/.*/}}),o=[];for(const t of i)if("elementStart"===t.type&&n.match(t.item)){const e=Rw(t.item);o.push({element:t.item,id:e.id,order:e.order,indent:e.indent})}return o}(t,i);if(!n.length)return;let o=null,r=1;n.forEach((t,s)=>{const a=function(t,e){if(!t)return!0;if(t.id!==e.id)return e.indent-t.indent!=1;const i=e.element.previousSibling;if(!i)return!0;return n=i,!(n.is("element","ol")||n.is("element","ul"));var n}(n[s-1],t),l=a?null:n[s-1],c=(h=t,(d=l)?h.indent-d.indent:h.indent-1);var d,h;if(a&&(o=null,r=1),!o||0!==c){const n=function(t,e){const i=new RegExp(`@list l${t.id}:level${t.indent}\\s*({[^}]*)`,"gi"),n=/mso-level-number-format:([^;]{0,100});/gi,o=i.exec(e);let r="decimal",s="ol";if(o&&o[1]){const e=n.exec(o[1]);if(e&&e[1]&&(r=e[1].trim(),s="bullet"!==r&&"image"!==r?"ol":"ul"),"bullet"===r){const e=function(t){const e=function(t){if(t.getChild(0).is("$text"))return null;const e=t.getChild(0).getChild(0);if(e.is("$text"))return e;return e.getChild(0)}(t);if(!e)return null;const i=e._data;if("o"===i)return"circle";if("·"===i)return"disc";if("§"===i)return"square";return null}(t.element);e&&(r=e)}}return{type:s,style:Lw(r)}}(t,e);if(o){if(t.indent>r){const t=o.getChild(o.childCount-1),e=t.getChild(t.childCount-1);o=Nw(n,e,i),r+=1}else if(t.indent<r){const e=r-t.indent;o=function(t,e){const i=t.getAncestors({parentFirst:!0});let n=null,o=0;for(const t of i)if("ul"!==t.name&&"ol"!==t.name||o++,o===e){n=t;break}return n}(o,e),r=parseInt(t.indent)}}else o=Nw(n,t.element,i);t.indent<=r&&(o.is("element",n.type)||(o=i.rename(n.type,o)))}const u=function(t,e){return function(t,e){const i=new Pn({name:"span",styles:{"mso-list":"Ignore"}}),n=e.createRangeIn(t);for(const t of n)"elementStart"===t.type&&i.match(t.item)&&e.remove(t.item)}(t,e),e.rename("li",t)}(t.element,i);i.appendChild(u,o)})}function Lw(t){switch(t){case"arabic-leading-zero":return"decimal-leading-zero";case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return t;default:return null}}function Nw(t,e,i){const n=e.parent,o=i.createElement(t.type),r=n.getChildIndex(e)+1;return i.insertChild(r,o,n),t.style&&i.setStyle("list-style-type",t.style,o),o}function Rw(t){const e={},i=t.getStyle("mso-list");if(i){const t=i.match(/(^|\s{1,100})l(\d+)/i),n=i.match(/\s{0,100}lfo(\d+)/i),o=i.match(/\s{0,100}level(\d+)/i);t&&n&&o&&(e.id=t[2],e.order=n[1],e.indent=o[1])}return e}const Ow=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i;class zw{constructor(t){this.document=t}isActive(t){return Ow.test(t)}execute(t){const e=new Jh(this.document);!function(t,e){for(const i of t.getChildren())if(i.is("element","b")&&"normal"===i.getStyle("font-weight")){const n=t.getChildIndex(i);e.remove(i),e.insertChild(n,i.getChildren(),t)}}(t.content,e),function(t,e){for(const i of e.createRangeIn(t)){const t=i.item;if(t.is("element","li")){const i=t.getChild(0);i&&i.is("element","p")&&e.unwrapElement(i)}}}(t.content,e)}}function Dw(t){return t.replace(/<span(?: class="Apple-converted-space"|)>(\s+)<\/span>/g,(t,e)=>1===e.length?" ":Array(e.length+1).join("  ").substr(0,e.length))}function Vw(t,e){const i=new DOMParser,n=function(t){return Dw(Dw(t)).replace(/(<span\s+style=['"]mso-spacerun:yes['"]>[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<span\s+style=['"]mso-spacerun:yes['"]><\/span>/g,"").replace(/ <\//g," </").replace(/ <o:p><\/o:p>/g," <o:p></o:p>").replace(/<o:p>(&nbsp;|\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)</g,"><")}(function(t){const e=t.indexOf("</body>");if(e<0)return t;const i=t.indexOf("</html>",e+"</body>".length);return t.substring(0,e+"</body>".length)+(i>=0?t.substring(i):"")}(t=t.replace(/<!--\[if gte vml 1]>/g,""))),o=i.parseFromString(n,"text/html");!function(t){t.querySelectorAll("span[style*=spacerun]").forEach(t=>{const e=t.innerText.length||0;t.innerHTML=Array(e+1).join("  ").substr(0,e)})}(o);const r=o.body.innerHTML,s=function(t,e){const i=new zo(e),n=new Fr(i,{blockFillerMode:"nbsp"}),o=t.createDocumentFragment(),r=t.body.childNodes;for(;r.length>0;)o.appendChild(r[0]);return n.domToView(o)}(o,e),a=function(t){const e=[],i=[],n=Array.from(t.getElementsByTagName("style"));for(const t of n)t.sheet&&t.sheet.cssRules&&t.sheet.cssRules.length&&(e.push(t.sheet),i.push(t.innerHTML));return{styles:e,stylesString:i.join(" ")}}(o);return{body:s,bodyString:r,styles:a.styles,stylesString:a.stylesString}}function jw(t,e){if(!t.childCount)return;const i=new Jh;!function(t,e,i){const n=i.createRangeIn(e),o=new Pn({name:"img"}),r=[];for(const e of n)if(o.match(e.item)){const i=e.item,n=i.getAttribute("v:shapes")?i.getAttribute("v:shapes").split(" "):[];n.length&&n.every(e=>t.indexOf(e)>-1)?r.push(i):i.getAttribute("src")||r.push(i)}for(const t of r)i.remove(t)}(function(t,e){const i=e.createRangeIn(t),n=new Pn({name:/v:(.+)/}),o=[];for(const t of i){const e=t.item,i=e.previousSibling&&e.previousSibling.name||null;n.match(e)&&e.getAttribute("o:gfxdata")&&"v:shapetype"!==i&&o.push(t.item.getAttribute("id"))}return o}(t,i),t,i),function(t,e){const i=e.createRangeIn(t),n=new Pn({name:/v:(.+)/}),o=[];for(const t of i)n.match(t.item)&&o.push(t.item);for(const t of o)e.remove(t)}(t,i);const n=function(t,e){const i=e.createRangeIn(t),n=new Pn({name:"img"}),o=[];for(const t of i)n.match(t.item)&&t.item.getAttribute("src").startsWith("file://")&&o.push(t.item);return o}(t,i);n.length&&function(t,e,i){if(t.length===e.length)for(let o=0;o<t.length;o++){const r=`data:${e[o].type};base64,${n=e[o].hex,btoa(n.match(/\w{2}/g).map(t=>String.fromCharCode(parseInt(t,16))).join(""))}`;i.setAttribute("src",r,t[o])}var n}(n,function(t){if(!t)return[];const e=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp("(?:("+e.source+"))([\\da-fA-F\\s]+)\\}","g"),n=t.match(i),o=[];if(n)for(const t of n){let i=!1;t.includes("\\pngblip")?i="image/png":t.includes("\\jpegblip")&&(i="image/jpeg"),i&&o.push({hex:t.replace(e,"").replace(/[^\da-fA-F]/g,""),type:i})}return o}(e),i)}const Bw=/<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i,Fw=/xmlns:o="urn:schemas-microsoft-com/i;class Hw{constructor(t){this.document=t}isActive(t){return Bw.test(t)||Fw.test(t)}execute(t){const{body:e,stylesString:i}=Vw(t.dataTransfer.getData("text/html"),this.document.stylesProcessor);Iw(e,i),jw(e,t.dataTransfer.getData("text/rtf")),t.content=e}}function Uw(t,e,i,n,o=1){e>o?n.setAttribute(t,e,i):n.removeAttribute(t,i)}function qw(t,e,i={}){const n=t.createElement("tableCell",i);return t.insertElement("paragraph",n),t.insert(n,e),n}function Ww(t,e){const i=e.parent.parent,n=parseInt(i.getAttribute("headingColumns")||0),{column:o}=t.getCellLocation(e);return!!n&&o<n}function $w(){return t=>{t.on("element:table",(t,e,i)=>{const n=e.viewItem;if(!i.consumable.test(n,{name:!0}))return;const{rows:o,headingRows:r,headingColumns:s}=function(t){const e={headingRows:0,headingColumns:0},i=[],n=[];let o;for(const r of Array.from(t.getChildren()))if("tbody"===r.name||"thead"===r.name||"tfoot"===r.name){"thead"!==r.name||o||(o=r);const t=Array.from(r.getChildren()).filter(t=>t.is("element","tr"));for(const r of t)if("thead"===r.parent.name&&r.parent===o)e.headingRows++,i.push(r);else{n.push(r);const t=Yw(r);t>e.headingColumns&&(e.headingColumns=t)}}return e.rows=[...i,...n],e}(n),a={};s&&(a.headingColumns=s),r&&(a.headingRows=r);const l=i.writer.createElement("table",a);if(i.safeInsert(l,e.modelCursor)){if(i.consumable.consume(n,{name:!0}),o.forEach(t=>i.convertItem(t,i.writer.createPositionAt(l,"end"))),i.convertChildren(n,i.writer.createPositionAt(l,"end")),l.isEmpty){const t=i.writer.createElement("tableRow");i.writer.insert(t,i.writer.createPositionAt(l,"end")),qw(i.writer,i.writer.createPositionAt(t,"end"))}i.updateConversionResult(l,e)}})}}function Gw(t){return e=>{e.on("element:"+t,(t,e,i)=>{if(e.modelRange&&e.viewItem.isEmpty){const t=e.modelRange.start.nodeAfter,n=i.writer.createPositionAt(t,0);i.writer.insertElement("paragraph",n)}},{priority:"low"})}}function Yw(t){let e=0,i=0;const n=Array.from(t.getChildren()).filter(t=>"th"===t.name||"td"===t.name);for(;i<n.length&&"th"===n[i].name;){const t=n[i];e+=parseInt(t.getAttribute("colspan")||1),i++}return e}class Kw{constructor(t,e={}){this._table=t,this._startRow=void 0!==e.row?e.row:e.startRow||0,this._endRow=void 0!==e.row?e.row:e.endRow,this._startColumn=void 0!==e.column?e.column:e.startColumn||0,this._endColumn=void 0!==e.column?e.column:e.endColumn,this._includeAllSlots=!!e.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){const t=this._table.getChild(this._rowIndex);if(!t||this._isOverEndRow())return{done:!0};if(!t.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let e=null;const i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(e=this._formatOutValue(i.cell,i.row,i.column));else{const i=t.getChild(this._cellIndex);if(!i)return this._advanceToNextRow();const n=parseInt(i.getAttribute("colspan")||1),o=parseInt(i.getAttribute("rowspan")||1);(n>1||o>1)&&this._recordSpans(i,o,n),this._shouldSkipSlot()||(e=this._formatOutValue(i)),this._nextCellAtColumn=this._column+n}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,e||this.next()}skipRow(t){this._skipRows.add(t)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return void 0!==this._endRow&&this._row>this._endRow}_isOverEndColumn(){return void 0!==this._endColumn&&this._column>this._endColumn}_formatOutValue(t,e=this._row,i=this._column){return{done:!1,value:new Qw(this,t,e,i)}}_shouldSkipSlot(){const t=this._skipRows.has(this._row),e=this._row<this._startRow,i=this._column<this._startColumn,n=void 0!==this._endColumn&&this._column>this._endColumn;return t||e||i||n}_getSpanned(){const t=this._spannedCells.get(this._row);return t&&t.get(this._column)||null}_recordSpans(t,e,i){const n={cell:t,row:this._row,column:this._column};for(let t=this._row;t<this._row+e;t++)for(let e=this._column;e<this._column+i;e++)t==this._row&&e==this._column||this._markSpannedCell(t,e,n)}_markSpannedCell(t,e,i){this._spannedCells.has(t)||this._spannedCells.set(t,new Map);this._spannedCells.get(t).set(e,i)}}class Qw{constructor(t,e,i,n){this.cell=e,this.row=t._row,this.column=t._column,this.cellAnchorRow=i,this.cellAnchorColumn=n,this._cellIndex=t._cellIndex,this._rowIndex=t._rowIndex,this._table=t._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||1)}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||1)}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}}function Jw(t={}){return e=>e.on("insert:table",(e,i,n)=>{const o=i.item;if(!n.consumable.consume(o,"insert"))return;n.consumable.consume(o,"attribute:headingRows:table"),n.consumable.consume(o,"attribute:headingColumns:table");const r=t&&t.asWidget,s=n.writer.createContainerElement("figure",{class:"table"}),a=n.writer.createContainerElement("table");let l;var c,d;n.writer.insert(n.writer.createPositionAt(s,0),a),r&&(c=s,(d=n.writer).setCustomProperty("table",!0,c),l=Vu(c,d,{hasSelectionHandle:!0}));const h=new Kw(o),u={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},m=new Map;for(const e of h){const{row:i,cell:r}=e,s=o.getChild(i),l=m.get(i)||ib(a,s,i,u,n);m.set(i,l),n.consumable.consume(r,"insert");eb(e,u,n.writer.createPositionAt(l,"end"),n,t)}for(const t of o.getChildren()){const e=t.index;t.is("element","tableRow")&&!m.has(e)&&m.set(e,ib(a,t,e,u,n))}const g=n.mapper.toViewPosition(i.range.start);n.mapper.bindElements(o,r?l:s),n.writer.insert(g,r?l:s)})}function Zw(t,e){const{writer:i}=e;if(t.parent.is("element","tableCell"))return Xw(t)?i.createContainerElement("span",{style:"display:inline-block"}):i.createContainerElement("p")}function Xw(t){return 1===t.parent.childCount&&!sb(t)}function tb(t,e,i){const{cell:n}=t,o=nb(t,e),r=i.mapper.toViewElement(n);r&&r.name!==o&&function(t,e,i){const n=i.writer,o=i.mapper.toViewElement(t),r=Uu(n.createEditableElement(e,o.getAttributes()),n);Fu(r,n,(t,e,i)=>i.addClass(pn(e.classes),t),(t,e,i)=>i.removeClass(pn(e.classes),t)),n.insert(n.createPositionAfter(o),r),n.move(n.createRangeIn(o),n.createPositionAt(r,0)),n.remove(n.createRangeOn(o)),i.mapper.unbindViewElement(o),i.mapper.bindElements(t,r)}(n,o,i)}function eb(t,e,i,n,o){const r=o&&o.asWidget,s=nb(t,e),a=r?Uu(n.writer.createEditableElement(s),n.writer):n.writer.createContainerElement(s);r&&Fu(a,n.writer,(t,e,i)=>i.addClass(pn(e.classes),t),(t,e,i)=>i.removeClass(pn(e.classes),t));const l=t.cell,c=l.getChild(0),d=1===l.childCount&&"paragraph"===c.name;if(n.writer.insert(i,a),n.mapper.bindElements(l,a),!r&&d&&!sb(c)){const t=l.getChild(0);n.consumable.consume(t,"insert"),n.mapper.bindElements(t,a)}}function ib(t,e,i,n,o){o.consumable.consume(e,"insert");const r=e.isEmpty?o.writer.createEmptyElement("tr"):o.writer.createContainerElement("tr");o.mapper.bindElements(e,r);const s=n.headingRows,a=function(t,e,i){const n=ob(t,e);return n||function(t,e,i){const n=i.writer.createContainerElement(t),o=i.writer.createPositionAt(e,"tbody"==t?"end":0);return i.writer.insert(o,n),n}(t,e,i)}(function(t,e){return t<e.headingRows?"thead":"tbody"}(i,n),t,o),l=s>0&&i>=s?i-s:i,c=o.writer.createPositionAt(a,l);return o.writer.insert(c,r),r}function nb(t,e){const{row:i,column:n}=t,{headingColumns:o,headingRows:r}=e;if(r&&r>i)return"th";return o&&o>n?"th":"td"}function ob(t,e){for(const i of e.getChildren())if(i.name==t)return i}function rb(t,e,i){const n=ob(t,e);n&&0===n.childCount&&i.writer.remove(i.writer.createRangeOn(n))}function sb(t){return!![...t.getAttributeKeys()].length}class ab extends ce{refresh(){const t=this.editor.model,e=t.document.selection,i=t.schema;this.isEnabled=function(t,e){const i=t.getFirstPosition().parent,n=i===i.root?i:i.parent;return e.checkChild(n,"table")}(e,i)&&!Wu(e,i)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=this.editor.plugins.get("TableUtils"),o=qu(i,e);e.change(i=>{const r=n.createTable(i,t);e.insertContent(r,o),i.setSelection(i.createPositionAt(r.getNodeByPath([0,0,0]),0))})}}function lb(t){const e=[];for(const i of gb(t.getRanges())){const t=i.getContainedElement();t&&t.is("element","tableCell")&&e.push(t)}return e}function cb(t){const e=[];for(const i of t.getRanges()){const t=i.start.findAncestor("tableCell");t&&e.push(t)}return e}function db(t){const e=lb(t);return e.length?e:cb(t)}function hb(t){return fb(t.map(t=>t.parent.index))}function ub(t){const e=t[0].findAncestor("table");return fb([...new Kw(e)].filter(e=>t.includes(e.cell)).map(t=>t.column))}function mb(t,e){if(t.length<2||!function(t){const e=t[0].findAncestor("table"),i=hb(t),n=parseInt(e.getAttribute("headingRows")||0);if(!wb(i,n))return!1;const o=parseInt(e.getAttribute("headingColumns")||0);return wb(ub(t),o)}(t))return!1;const i=new Set,n=new Set;let o=0;for(const r of t){const{row:t,column:s}=e.getCellLocation(r),a=parseInt(r.getAttribute("rowspan")||1),l=parseInt(r.getAttribute("colspan")||1);i.add(t),n.add(s),a>1&&i.add(t+a-1),l>1&&n.add(s+l-1),o+=a*l}return function(t,e){const i=Array.from(t.values()),n=Array.from(e.values()),o=Math.max(...i),r=Math.min(...i),s=Math.max(...n),a=Math.min(...n);return(o-r+1)*(s-a+1)}(i,n)==o}function gb(t){return Array.from(t).sort(pb)}function fb(t){const e=t.sort((t,e)=>t-e);return{first:e[0],last:e[e.length-1]}}function pb(t,e){const i=t.start,n=e.start;return i.isBefore(n)?-1:1}function wb({first:t,last:e},i){return t<i===e<i}class bb extends ce{constructor(t,e={}){super(t),this.order=e.order||"below"}refresh(){const t=!!db(this.editor.model.document.selection).length;this.isEnabled=t}execute(){const t=this.editor,e=t.model.document.selection,i=t.plugins.get("TableUtils"),n="above"===this.order,o=db(e),r=hb(o),s=n?r.first:r.last,a=o[0].findAncestor("table");i.insertRows(a,{at:n?s:s+1,copyStructureFromAbove:!n})}}class kb extends ce{constructor(t,e={}){super(t),this.order=e.order||"right"}refresh(){const t=!!db(this.editor.model.document.selection).length;this.isEnabled=t}execute(){const t=this.editor,e=t.model.document.selection,i=t.plugins.get("TableUtils"),n="left"===this.order,o=db(e),r=ub(o),s=n?r.first:r.last,a=o[0].findAncestor("table");i.insertColumns(a,{columns:1,at:n?s:s+1})}}class _b extends ce{constructor(t,e={}){super(t),this.direction=e.direction||"horizontally"}refresh(){const t=db(this.editor.model.document.selection);this.isEnabled=1===t.length}execute(){const t=db(this.editor.model.document.selection)[0],e="horizontally"===this.direction,i=this.editor.plugins.get("TableUtils");e?i.splitCellHorizontally(t,2):i.splitCellVertically(t,2)}}function vb(t,e,i){const{startRow:n,startColumn:o,endRow:r,endColumn:s}=e,a=i.createElement("table"),l=r-n+1;for(let t=0;t<l;t++)i.insertElement("tableRow",a,"end");const c=[...new Kw(t,{startRow:n,endRow:r,startColumn:o,endColumn:s,includeAllSlots:!0})];for(const{row:t,column:e,cell:l,isAnchor:d,cellAnchorRow:h,cellAnchorColumn:u}of c){const c=t-n,m=a.getChild(c);if(d){const n=i.cloneElement(l);i.append(n,m),Tb(n,t,e,r,s,i)}else(h<n||u<o)&&qw(i,i.createPositionAt(m,"end"))}return function(t,e,i,n,o){const r=parseInt(e.getAttribute("headingRows")||0);if(r>0){Uw("headingRows",r-i,t,o,0)}const s=parseInt(e.getAttribute("headingColumns")||0);if(s>0){Uw("headingColumns",s-n,t,o,0)}}(a,t,n,o,i),a}function yb(t,e,i=0){const n=[],o=new Kw(t,{startRow:i,endRow:e-1});for(const t of o){const{row:i,cellHeight:o}=t,r=i+o-1;i<e&&e<=r&&n.push(t)}return n}function xb(t,e,i){const n=t.parent,o=n.parent,r=n.index,s=e-r,a={},l=parseInt(t.getAttribute("rowspan"))-s;l>1&&(a.rowspan=l);const c=parseInt(t.getAttribute("colspan")||1);c>1&&(a.colspan=c);const d=r+s,h=[...new Kw(o,{startRow:r,endRow:d,includeAllSlots:!0})];let u,m=null;for(const e of h){const{row:n,column:o,cell:r}=e;r===t&&void 0===u&&(u=o),void 0!==u&&u===o&&n===d&&(m=qw(i,e.getPositionBefore(),a))}return Uw("rowspan",s,t,i),m}function Ab(t,e){const i=[],n=new Kw(t);for(const t of n){const{column:n,cellWidth:o}=t,r=n+o-1;n<e&&e<=r&&i.push(t)}return i}function Cb(t,e,i,n){const o=i-e,r={},s=parseInt(t.getAttribute("colspan"))-o;s>1&&(r.colspan=s);const a=parseInt(t.getAttribute("rowspan")||1);a>1&&(r.rowspan=a);const l=qw(n,n.createPositionAfter(t),r);return Uw("colspan",o,t,n),l}function Tb(t,e,i,n,o,r){const s=parseInt(t.getAttribute("colspan")||1),a=parseInt(t.getAttribute("rowspan")||1);if(i+s-1>o){Uw("colspan",o-i+1,t,r,1)}if(e+a-1>n){Uw("rowspan",n-e+1,t,r,1)}}function Eb(t,e){const i=e.getColumns(t),n=new Array(i).fill(0);for(const{column:e}of new Kw(t))n[e]++;const o=n.reduce((t,e,i)=>e?t:[...t,i],[]);if(o.length>0){const i=o[o.length-1];return e.removeColumns(t,{at:i}),!0}return!1}function Sb(t,e){const i=[],n=e.getRows(t);for(let e=0;e<n;e++){t.getChild(e).isEmpty&&i.push(e)}if(i.length>0){const n=i[i.length-1];return e.removeRows(t,{at:n}),!0}return!1}function Pb(t,e){Eb(t,e)||Sb(t,e)}function Mb(t,e){const i=Array.from(new Kw(t,{startColumn:e.firstColumn,endColumn:e.lastColumn,row:e.lastRow}));if(i.every(({cellHeight:t})=>1===t))return e.lastRow;const n=i[0].cellHeight-1;return e.lastRow+n}function Ib(t,e){const i=Array.from(new Kw(t,{startRow:e.firstRow,endRow:e.lastRow,column:e.lastColumn}));if(i.every(({cellWidth:t})=>1===t))return e.lastColumn;const n=i[0].cellWidth-1;return e.lastColumn+n}class Lb extends ce{constructor(t,e){super(t),this.direction=e.direction,this.isHorizontal="right"==this.direction||"left"==this.direction}refresh(){const t=this._getMergeableCell();this.value=t,this.isEnabled=!!t}execute(){const t=this.editor.model,e=cb(t.document.selection)[0],i=this.value,n=this.direction;t.change(t=>{const o="right"==n||"down"==n,r=o?e:i,s=o?i:e,a=s.parent;!function(t,e,i){Nb(t)||(Nb(e)&&i.remove(i.createRangeIn(e)),i.move(i.createRangeIn(t),i.createPositionAt(e,"end")));i.remove(t)}(s,r,t);const l=this.isHorizontal?"colspan":"rowspan",c=parseInt(e.getAttribute(l)||1),d=parseInt(i.getAttribute(l)||1);t.setAttribute(l,c+d,r),t.setSelection(t.createRangeIn(r));const h=this.editor.plugins.get("TableUtils");Pb(a.findAncestor("table"),h)})}_getMergeableCell(){const t=cb(this.editor.model.document.selection)[0];if(!t)return;const e=this.editor.plugins.get("TableUtils"),i=this.isHorizontal?function(t,e,i){const n=t.parent.parent,o="right"==e?t.nextSibling:t.previousSibling,r=(n.getAttribute("headingColumns")||0)>0;if(!o)return;const s="right"==e?t:o,a="right"==e?o:t,{column:l}=i.getCellLocation(s),{column:c}=i.getCellLocation(a),d=parseInt(s.getAttribute("colspan")||1),h=Ww(i,s),u=Ww(i,a);if(r&&h!=u)return;return l+d===c?o:void 0}(t,this.direction,e):function(t,e,i){const n=t.parent,o=n.parent,r=o.getChildIndex(n);if("down"==e&&r===i.getRows(o)-1||"up"==e&&0===r)return;const s=parseInt(t.getAttribute("rowspan")||1),a=o.getAttribute("headingRows")||0,l="down"==e&&r+s===a,c="up"==e&&r===a;if(a&&(l||c))return;const d=parseInt(t.getAttribute("rowspan")||1),h="down"==e?r+d:r,u=[...new Kw(o,{endRow:h})],m=u.find(e=>e.cell===t).column,g=u.find(({row:t,cellHeight:i,column:n})=>n===m&&("down"==e?t===h:h===t+i));return g&&g.cell}(t,this.direction,e);if(!i)return;const n=this.isHorizontal?"rowspan":"colspan",o=parseInt(t.getAttribute(n)||1);return parseInt(i.getAttribute(n)||1)===o?i:void 0}}function Nb(t){return 1==t.childCount&&t.getChild(0).is("element","paragraph")&&t.getChild(0).isEmpty}class Rb extends ce{refresh(){const t=db(this.editor.model.document.selection),e=t[0];if(e){const i=e.findAncestor("table"),n=this.editor.plugins.get("TableUtils").getRows(i)-1,o=hb(t),r=0===o.first&&o.last===n;this.isEnabled=!r}else this.isEnabled=!1}execute(){const t=this.editor.model,e=this.editor.plugins.get("TableUtils"),i=db(t.document.selection),n=hb(i),o=i[0],r=o.findAncestor("table"),s=e.getCellLocation(o).column;t.change(t=>{const i=n.last-n.first+1;e.removeRows(r,{at:n.first,rows:i});const o=function(t,e,i,n){const o=t.getChild(Math.min(e,n-1));let r=o.getChild(0),s=0;for(const t of o.getChildren()){if(s>i)return r;r=t,s+=parseInt(t.getAttribute("colspan")||1)}return r}(r,n.first,s,e.getRows(r));t.setSelection(t.createPositionAt(o,0))})}}class Ob extends ce{refresh(){const t=db(this.editor.model.document.selection),e=t[0];if(e){const i=e.findAncestor("table"),n=this.editor.plugins.get("TableUtils").getColumns(i),{first:o,last:r}=ub(t);this.isEnabled=r-o<n-1}else this.isEnabled=!1}execute(){const[t,e]=function(t){const e=db(t),i=e[0],n=e.pop(),o=[i,n];return i.isBefore(n)?o:o.reverse()}(this.editor.model.document.selection),i=t.parent.parent,n=[...new Kw(i)],o={first:n.find(e=>e.cell===t).column,last:n.find(t=>t.cell===e).column},r=function(t,e,i,n){return parseInt(i.getAttribute("colspan")||1)>1?i:e.previousSibling||i.nextSibling?i.nextSibling||e.previousSibling:n.first?t.reverse().find(({column:t})=>t<n.first).cell:t.reverse().find(({column:t})=>t>n.last).cell}(n,t,e,o);this.editor.model.change(t=>{const e=o.last-o.first+1;this.editor.plugins.get("TableUtils").removeColumns(i,{at:o.first,columns:e}),t.setSelection(t.createPositionAt(r,0))})}}class zb extends ce{refresh(){const t=db(this.editor.model.document.selection),e=t.length>0;this.isEnabled=e,this.value=e&&t.every(t=>this._isInHeading(t,t.parent.parent))}execute(t={}){if(t.forceValue===this.value)return;const e=this.editor.model,i=db(e.document.selection),n=i[0].findAncestor("table"),{first:o,last:r}=hb(i),s=this.value?o:r+1,a=n.getAttribute("headingRows")||0;e.change(t=>{if(s){const e=yb(n,s,s>a?a:0);for(const{cell:i}of e)xb(i,s,t)}Uw("headingRows",s,n,t,0)})}_isInHeading(t,e){const i=parseInt(e.getAttribute("headingRows")||0);return!!i&&t.parent.index<i}}class Db extends ce{refresh(){const t=db(this.editor.model.document.selection),e=this.editor.plugins.get("TableUtils"),i=t.length>0;this.isEnabled=i,this.value=i&&t.every(t=>Ww(e,t))}execute(t={}){if(t.forceValue===this.value)return;const e=this.editor.model,i=db(e.document.selection),n=i[0].findAncestor("table"),{first:o,last:r}=ub(i),s=this.value?o:r+1;e.change(t=>{if(s){const e=Ab(n,s);for(const{cell:i,column:n}of e)Cb(i,n,s,t)}Uw("headingColumns",s,n,t,0)})}}class Vb extends ae{static get pluginName(){return"TableUtils"}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(t){const e=t.parent,i=e.parent,n=i.getChildIndex(e),o=new Kw(i,{row:n});for(const{cell:e,row:i,column:n}of o)if(e===t)return{row:i,column:n}}createTable(t,e){const i=t.createElement("table");return jb(t,i,0,parseInt(e.rows)||2,parseInt(e.columns)||2),e.headingRows&&Uw("headingRows",e.headingRows,i,t,0),e.headingColumns&&Uw("headingColumns",e.headingColumns,i,t,0),i}insertRows(t,e={}){const i=this.editor.model,n=e.at||0,o=e.rows||1,r=void 0!==e.copyStructureFromAbove,s=e.copyStructureFromAbove?n-1:n,l=this.getRows(t),c=this.getColumns(t);if(n>l)throw new a("tableutils-insertrows-insert-out-of-range",this,{options:e});i.change(e=>{const i=t.getAttribute("headingRows")||0;if(i>n&&Uw("headingRows",i+o,t,e,0),!r&&(0===n||n===l))return void jb(e,t,n,o,c);const a=r?Math.max(n,s):n,d=new Kw(t,{endRow:a}),h=new Array(c).fill(1);for(const{row:t,column:i,cellHeight:a,cellWidth:l,cell:c}of d){const d=t+a-1,u=t<=s&&s<=d;t<n&&n<=d?(e.setAttribute("rowspan",a+o,c),h[i]=-l):r&&u&&(h[i]=l)}for(let i=0;i<o;i++){const i=e.createElement("tableRow");e.insert(i,t,n);for(let t=0;t<h.length;t++){const n=h[t],o=e.createPositionAt(i,"end");n>0&&qw(e,o,n>1?{colspan:n}:null),t+=Math.abs(n)-1}}})}insertColumns(t,e={}){const i=this.editor.model,n=e.at||0,o=e.columns||1;i.change(e=>{const i=t.getAttribute("headingColumns");n<i&&e.setAttribute("headingColumns",i+o,t);const r=this.getColumns(t);if(0===n||r===n){for(const i of t.getChildren())i.is("element","tableRow")&&Bb(o,e,e.createPositionAt(i,n?"end":0));return}const s=new Kw(t,{column:n,includeAllSlots:!0});for(const t of s){const{row:i,cell:r,cellAnchorColumn:a,cellAnchorRow:l,cellWidth:c,cellHeight:d}=t;if(a<n){e.setAttribute("colspan",c+o,r);const t=l+d-1;for(let e=i;e<=t;e++)s.skipRow(e)}else Bb(o,e,t.getPositionBefore())}})}removeRows(t,e){const i=this.editor.model,n=e.rows||1,o=this.getRows(t),r=e.at,s=r+n-1;if(s>o-1)throw new a("tableutils-removerows-row-index-out-of-range",this,{table:t,options:e});i.change(e=>{const{cellsToMove:i,cellsToTrim:n}=function(t,e,i){const n=new Map,o=[];for(const{row:r,column:s,cellHeight:a,cell:l}of new Kw(t,{endRow:i})){const t=r+a-1;if(r>=e&&r<=i&&t>i){const t=a-(i-r+1);n.set(s,{cell:l,rowspan:t})}if(r<e&&t>=e){let n;n=t>=i?i-e+1:t-e+1,o.push({cell:l,rowspan:a-n})}}return{cellsToMove:n,cellsToTrim:o}}(t,r,s);if(i.size){!function(t,e,i,n){const o=[...new Kw(t,{includeAllSlots:!0,row:e})],r=t.getChild(e);let s;for(const{column:t,cell:e,isAnchor:a}of o)if(i.has(t)){const{cell:e,rowspan:o}=i.get(t),a=s?n.createPositionAfter(s):n.createPositionAt(r,0);n.move(n.createRangeOn(e),a),Uw("rowspan",o,e,n),s=e}else a&&(s=e)}(t,s+1,i,e)}for(let i=s;i>=r;i--)e.remove(t.getChild(i));for(const{rowspan:t,cell:i}of n)Uw("rowspan",t,i,e);!function(t,e,i,n){const o=t.getAttribute("headingRows")||0;if(e<o){Uw("headingRows",i<o?o-(i-e+1):e,t,n,0)}}(t,r,s,e),Eb(t,this)||Sb(t,this)})}removeColumns(t,e){const i=this.editor.model,n=e.at,o=e.columns||1,r=e.at+o-1;i.change(e=>{!function(t,e,i){const n=t.getAttribute("headingColumns")||0;if(n&&e.first<n){const o=Math.min(n-1,e.last)-e.first+1;i.setAttribute("headingColumns",n-o,t)}}(t,{first:n,last:r},e);for(let i=r;i>=n;i--)for(const{cell:n,column:o,cellWidth:r}of[...new Kw(t)])o<=i&&r>1&&o+r>i?Uw("colspan",r-1,n,e):o===i&&e.remove(n);Sb(t,this)||Eb(t,this)})}splitCellVertically(t,e=2){const i=this.editor.model,n=t.parent.parent,o=parseInt(t.getAttribute("rowspan")||1),r=parseInt(t.getAttribute("colspan")||1);i.change(i=>{if(r>1){const{newCellsSpan:n,updatedSpan:s}=Fb(r,e);Uw("colspan",s,t,i);const a={};n>1&&(a.colspan=n),o>1&&(a.rowspan=o);Bb(r>e?e-1:r-1,i,i.createPositionAfter(t),a)}if(r<e){const s=e-r,a=[...new Kw(n)],{column:l}=a.find(({cell:e})=>e===t),c=a.filter(({cell:e,cellWidth:i,column:n})=>e!==t&&n===l||n<l&&n+i>l);for(const{cell:t,cellWidth:e}of c)i.setAttribute("colspan",e+s,t);const d={};o>1&&(d.rowspan=o),Bb(s,i,i.createPositionAfter(t),d);const h=n.getAttribute("headingColumns")||0;h>l&&Uw("headingColumns",h+s,n,i)}})}splitCellHorizontally(t,e=2){const i=this.editor.model,n=t.parent,o=n.parent,r=o.getChildIndex(n),s=parseInt(t.getAttribute("rowspan")||1),a=parseInt(t.getAttribute("colspan")||1);i.change(i=>{if(s>1){const n=[...new Kw(o,{startRow:r,endRow:r+s-1,includeAllSlots:!0})],{newCellsSpan:l,updatedSpan:c}=Fb(s,e);Uw("rowspan",c,t,i);const{column:d}=n.find(({cell:e})=>e===t),h={};l>1&&(h.rowspan=l),a>1&&(h.colspan=a);for(const t of n){const{column:e,row:n}=t,o=e===d,s=(n+r+c)%l==0;n>=r+c&&o&&s&&Bb(1,i,t.getPositionBefore(),h)}}if(s<e){const n=e-s,l=[...new Kw(o,{startRow:0,endRow:r})];for(const{cell:e,cellHeight:o,row:s}of l)if(e!==t&&s+o>r){const t=o+n;i.setAttribute("rowspan",t,e)}const c={};a>1&&(c.colspan=a),jb(i,o,r+1,n,1,c);const d=o.getAttribute("headingRows")||0;d>r&&Uw("headingRows",d+n,o,i)}})}getColumns(t){return[...t.getChild(0).getChildren()].reduce((t,e)=>t+parseInt(e.getAttribute("colspan")||1),0)}getRows(t){return Array.from(t.getChildren()).reduce((t,e)=>e.is("element","tableRow")?t+1:t,0)}}function jb(t,e,i,n,o,r={}){for(let s=0;s<n;s++){const n=t.createElement("tableRow");t.insert(n,e,i),Bb(o,t,t.createPositionAt(n,"end"),r)}}function Bb(t,e,i,n={}){for(let o=0;o<t;o++)qw(e,i,n)}function Fb(t,e){if(t<e)return{newCellsSpan:1,updatedSpan:1};const i=Math.floor(t/e);return{newCellsSpan:i,updatedSpan:t-i*e+i}}class Hb extends ce{refresh(){const t=lb(this.editor.model.document.selection);this.isEnabled=mb(t,this.editor.plugins.get(Vb))}execute(){const t=this.editor.model,e=this.editor.plugins.get(Vb);t.change(i=>{const n=lb(t.document.selection),o=n.shift(),{mergeWidth:r,mergeHeight:s}=function(t,e,i){let n=0,o=0;for(const t of e){const{row:e,column:r}=i.getCellLocation(t);n=Wb(t,r,n,"colspan"),o=Wb(t,e,o,"rowspan")}const{row:r,column:s}=i.getCellLocation(t);return{mergeWidth:n-s,mergeHeight:o-r}}(o,n,e);Uw("colspan",r,o,i),Uw("rowspan",s,o,i);for(const t of n)Ub(t,o,i);Pb(o.findAncestor("table"),e),i.setSelection(o,"in")})}}function Ub(t,e,i){qb(t)||(qb(e)&&i.remove(i.createRangeIn(e)),i.move(i.createRangeIn(t),i.createPositionAt(e,"end"))),i.remove(t)}function qb(t){return 1==t.childCount&&t.getChild(0).is("element","paragraph")&&t.getChild(0).isEmpty}function Wb(t,e,i,n){const o=parseInt(t.getAttribute(n)||1);return Math.max(i,e+o)}class $b extends ce{refresh(){const t=db(this.editor.model.document.selection);this.isEnabled=t.length>0}execute(){const t=this.editor.model,e=db(t.document.selection),i=hb(e),n=e[0].findAncestor("table"),o=[];for(let e=i.first;e<=i.last;e++)for(const i of n.getChild(e).getChildren())o.push(t.createRangeOn(i));t.change(t=>{t.setSelection(o)})}}class Gb extends ce{refresh(){const t=db(this.editor.model.document.selection);this.isEnabled=t.length>0}execute(){const t=this.editor.model,e=db(t.document.selection),i=e[0],n=e.pop(),o=i.findAncestor("table"),r=this.editor.plugins.get("TableUtils"),s=r.getCellLocation(i),a=r.getCellLocation(n),l=Math.min(s.column,a.column),c=Math.max(s.column,a.column),d=[];for(const e of new Kw(o,{startColumn:l,endColumn:c}))d.push(t.createRangeOn(e.cell));t.change(t=>{t.setSelection(d)})}}function Yb(t){t.document.registerPostFixer(e=>function(t,e){const i=e.document.differ.getChanges();let n=!1;const o=new Set;for(const e of i){let i;"table"==e.name&&"insert"==e.type&&(i=e.position.nodeAfter),"tableRow"!=e.name&&"tableCell"!=e.name||(i=e.position.findAncestor("table")),Jb(e)&&(i=e.range.start.findAncestor("table")),i&&!o.has(i)&&(n=Kb(i,t)||n,n=Qb(i,t)||n,o.add(i))}return n}(e,t))}function Kb(t,e){let i=!1;const n=function(t){const e=parseInt(t.getAttribute("headingRows")||0),i=Array.from(t.getChildren()).reduce((t,e)=>e.is("element","tableRow")?t+1:t,0),n=[];for(const{row:o,cell:r,cellHeight:s}of new Kw(t)){if(s<2)continue;const t=o<e?e:i;if(o+s>t){const e=t-o;n.push({cell:r,rowspan:e})}}return n}(t);if(n.length){i=!0;for(const t of n)Uw("rowspan",t.rowspan,t.cell,e,1)}return i}function Qb(t,e){let i=!1;const n=function(t){const e=new Array(t.childCount).fill(0);for(const{rowIndex:i}of new Kw(t,{includeAllSlots:!0}))e[i]++;return e}(t),o=[];for(const[e,i]of n.entries())!i&&t.getChild(e).is("element","tableRow")&&o.push(e);if(o.length){i=!0;for(const i of o.reverse())e.remove(t.getChild(i)),n.splice(i,1)}const r=n.filter((e,i)=>t.getChild(i).is("element","tableRow")),s=r[0];if(!r.every(t=>t===s)){const n=r.reduce((t,e)=>e>t?e:t,0);for(const[o,s]of r.entries()){const r=n-s;if(r){for(let i=0;i<r;i++)qw(e,e.createPositionAt(t.getChild(o),"end"));i=!0}}}return i}function Jb(t){const e="attribute"===t.type,i=t.attributeKey;return e&&("headingRows"===i||"colspan"===i||"rowspan"===i)}function Zb(t){t.document.registerPostFixer(e=>function(t,e){const i=e.document.differ.getChanges();let n=!1;for(const e of i)"insert"==e.type&&"table"==e.name&&(n=Xb(e.position.nodeAfter,t)||n),"insert"==e.type&&"tableRow"==e.name&&(n=tk(e.position.nodeAfter,t)||n),"insert"==e.type&&"tableCell"==e.name&&(n=ek(e.position.nodeAfter,t)||n),ik(e)&&(n=ek(e.position.parent,t)||n);return n}(e,t))}function Xb(t,e){let i=!1;for(const n of t.getChildren())n.is("element","tableRow")&&(i=tk(n,e)||i);return i}function tk(t,e){let i=!1;for(const n of t.getChildren())i=ek(n,e)||i;return i}function ek(t,e){if(0==t.childCount)return e.insertElement("paragraph",t),!0;const i=Array.from(t.getChildren()).filter(t=>t.is("$text"));for(const t of i)e.wrap(e.createRangeOn(t),"paragraph");return!!i.length}function ik(t){return!(!t.position||!t.position.parent.is("element","tableCell"))&&("insert"==t.type&&"$text"==t.name||"remove"==t.type)}function nk(t,e){t.document.registerPostFixer(()=>function(t,e){const i=new Set;for(const e of t.getChanges()){const t="attribute"==e.type?e.range.start.parent:e.position.parent;t.is("element","tableCell")&&i.add(t)}for(const n of i.values())for(const i of[...n.getChildren()].filter(t=>ok(t,e)))t.refreshItem(i);return!1}(t.document.differ,e))}function ok(t,e){if(!t.is("element","paragraph"))return!1;const i=e.toViewElement(t);return!!i&&Xw(t)!==i.is("element","span")}function rk(t){t.document.registerPostFixer(()=>function(t){const e=t.document.differ,i=new Set;for(const t of e.getChanges()){if("attribute"!=t.type)continue;const e=t.range.start.nodeAfter;e&&e.is("element","table")&&"headingRows"==t.attributeKey&&i.add(e)}if(i.size){for(const t of i.values())e.refreshItem(t);return!0}return!1}(t))}i(3275);class sk extends ae{static get pluginName(){return"TableEditing"}init(){const t=this.editor,e=t.model,i=e.schema,n=t.conversion;i.register("table",{allowWhere:"$block",allowAttributes:["headingRows","headingColumns"],isObject:!0,isBlock:!0}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowIn:"tableRow",allowChildren:"$block",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),n.for("upcast").add(t=>{t.on("element:figure",(t,e,i)=>{if(!i.consumable.test(e.viewItem,{name:!0,classes:"table"}))return;const n=function(t){for(const e of t.getChildren())if(e.is("element","table"))return e}(e.viewItem);if(!n||!i.consumable.test(n,{name:!0}))return;const o=Ws(i.convertItem(n,e.modelCursor).modelRange.getItems());o&&(i.convertChildren(e.viewItem,i.writer.createPositionAt(o,"end")),i.updateConversionResult(o,e))})}),n.for("upcast").add($w()),n.for("editingDowncast").add(Jw({asWidget:!0})),n.for("dataDowncast").add(Jw()),n.for("upcast").elementToElement({model:"tableRow",view:"tr"}),n.for("upcast").add(t=>{t.on("element:tr",(t,e)=>{e.viewItem.isEmpty&&0==e.modelCursor.index&&t.stop()},{priority:"high"})}),n.for("editingDowncast").add(t=>t.on("insert:tableRow",(t,e,i)=>{const n=e.item;if(!i.consumable.consume(n,"insert"))return;const o=n.parent,r=function(t){for(const e of t.getChildren())if("table"===e.name)return e}(i.mapper.toViewElement(o)),s=o.getChildIndex(n),a=new Kw(o,{row:s}),l={headingRows:o.getAttribute("headingRows")||0,headingColumns:o.getAttribute("headingColumns")||0},c=new Map;for(const t of a){const e=c.get(s)||ib(r,n,s,l,i);c.set(s,e),i.consumable.consume(t.cell,"insert"),eb(t,l,i.writer.createPositionAt(e,"end"),i,{asWidget:!0})}})),n.for("editingDowncast").add(t=>t.on("remove:tableRow",(t,e,i)=>{t.stop();const n=i.writer,o=i.mapper,r=o.toViewPosition(e.position).getLastMatchingPosition(t=>!t.item.is("element","tr")).nodeAfter,s=r.parent.parent,a=n.createRangeOn(r),l=n.remove(a);for(const t of n.createRangeIn(l).getItems())o.unbindViewElement(t);rb("thead",s,i),rb("tbody",s,i)},{priority:"higher"})),n.for("upcast").elementToElement({model:"tableCell",view:"td"}),n.for("upcast").elementToElement({model:"tableCell",view:"th"}),n.for("upcast").add(Gw("td")),n.for("upcast").add(Gw("th")),n.for("editingDowncast").add(t=>t.on("insert:tableCell",(t,e,i)=>{const n=e.item;if(!i.consumable.consume(n,"insert"))return;const o=n.parent,r=o.parent,s=r.getChildIndex(o),a=new Kw(r,{row:s}),l={headingRows:r.getAttribute("headingRows")||0,headingColumns:r.getAttribute("headingColumns")||0};for(const t of a)if(t.cell===n){const e=i.mapper.toViewElement(o);return void eb(t,l,i.writer.createPositionAt(e,o.getChildIndex(n)),i,{asWidget:!0})}})),n.for("editingDowncast").elementToElement({model:"paragraph",view:Zw,converterPriority:"high"}),n.attributeToAttribute({model:"colspan",view:"colspan"}),n.attributeToAttribute({model:"rowspan",view:"rowspan"}),n.for("editingDowncast").add(t=>t.on("attribute:headingColumns:table",(t,e,i)=>{const n=e.item;if(!i.consumable.consume(e.item,t.name))return;const o={headingRows:n.getAttribute("headingRows")||0,headingColumns:n.getAttribute("headingColumns")||0},r=e.attributeOldValue,s=e.attributeNewValue,a=(r>s?r:s)-1;for(const t of new Kw(n,{endColumn:a}))tb(t,o,i)})),t.commands.add("insertTable",new ab(t)),t.commands.add("insertTableRowAbove",new bb(t,{order:"above"})),t.commands.add("insertTableRowBelow",new bb(t,{order:"below"})),t.commands.add("insertTableColumnLeft",new kb(t,{order:"left"})),t.commands.add("insertTableColumnRight",new kb(t,{order:"right"})),t.commands.add("removeTableRow",new Rb(t)),t.commands.add("removeTableColumn",new Ob(t)),t.commands.add("splitTableCellVertically",new _b(t,{direction:"vertically"})),t.commands.add("splitTableCellHorizontally",new _b(t,{direction:"horizontally"})),t.commands.add("mergeTableCells",new Hb(t)),t.commands.add("mergeTableCellRight",new Lb(t,{direction:"right"})),t.commands.add("mergeTableCellLeft",new Lb(t,{direction:"left"})),t.commands.add("mergeTableCellDown",new Lb(t,{direction:"down"})),t.commands.add("mergeTableCellUp",new Lb(t,{direction:"up"})),t.commands.add("setTableColumnHeader",new Db(t)),t.commands.add("setTableRowHeader",new zb(t)),t.commands.add("selectTableRow",new $b(t)),t.commands.add("selectTableColumn",new Gb(t)),rk(e),Yb(e),nk(e,t.editing.mapper),Zb(e)}static get requires(){return[Vb]}}i(28);class ak extends cd{constructor(t){super(t);const e=this.bindTemplate;this.items=this._createGridCollection(),this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(t,e)=>`${e} × ${t}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":e.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck-insert-table-dropdown__label"]},children:[{text:e.to("label")}]}],on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(()=>{this.fire("execute")})}}),this.on("boxover",(t,e)=>{const{row:i,column:n}=e.target.dataset;this.set({rows:parseInt(i),columns:parseInt(n)})}),this.on("change:columns",()=>{this._highlightGridBoxes()}),this.on("change:rows",()=>{this._highlightGridBoxes()})}focus(){}focusLast(){}_highlightGridBoxes(){const t=this.rows,e=this.columns;this.items.map((i,n)=>{const o=Math.floor(n/10)<t&&n%10<e;i.set("isOn",o)})}_createGridCollection(){const t=[];for(let e=0;e<100;e++){const i=Math.floor(e/10),n=e%10;t.push(new lk(this.locale,i+1,n+1))}return this.createCollection(t)}}class lk extends cd{constructor(t,e,i){super(t);const n=this.bindTemplate;this.set("isOn",!1),this.setTemplate({tag:"div",attributes:{class:["ck-insert-table-dropdown-grid-box",n.if("isOn","ck-on")],"data-row":e,"data-column":i}})}}class ck extends ae{static get pluginName(){return"TableUI"}init(){const t=this.editor,e=this.editor.t,i="ltr"===t.locale.contentLanguageDirection;t.ui.componentFactory.add("insertTable",i=>{const n=t.commands.get("insertTable"),o=rh(i);let r;return o.bind("isEnabled").to(n),o.buttonView.set({icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z"/></svg>',label:e("Insert table"),tooltip:!0}),o.on("change:isOpen",()=>{r||(r=new ak(i),o.panelView.children.add(r),r.delegate("execute").to(o),o.buttonView.on("open",()=>{r.rows=0,r.columns=0}),o.on("execute",()=>{t.execute("insertTable",{rows:r.rows,columns:r.columns}),t.editing.view.focus()}))}),o}),t.ui.componentFactory.add("tableColumn",t=>{const n=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:e("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:e("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:e("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:e("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:e("Select column")}}];return this._prepareDropdown(e("Column"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>',n,t)}),t.ui.componentFactory.add("tableRow",t=>{const i=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:e("Header row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:e("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:e("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:e("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:e("Select row")}}];return this._prepareDropdown(e("Row"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>',i,t)}),t.ui.componentFactory.add("mergeTableCells",t=>{const n=[{type:"button",model:{commandName:"mergeTableCellUp",label:e("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:e("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:e("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:e("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:e("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:e("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(e("Merge cells"),'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>',n,t)})}_prepareDropdown(t,e,i,n){const o=this.editor,r=rh(n),s=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:t,icon:e,tooltip:!0}),r.bind("isEnabled").toMany(s,"isEnabled",(...t)=>t.some(t=>t)),this.listenTo(r,"execute",t=>{o.execute(t.source.commandName),o.editing.view.focus()}),r}_prepareMergeSplitButtonDropdown(t,e,i,n){const o=this.editor,r=rh(n,Hd),s=o.commands.get("mergeTableCells"),a=this._fillDropdownWithListOptions(r,i);return r.buttonView.set({label:t,icon:e,tooltip:!0,isEnabled:!0}),r.bind("isEnabled").toMany([s,...a],"isEnabled",(...t)=>t.some(t=>t)),this.listenTo(r.buttonView,"execute",()=>{o.execute("mergeTableCells"),o.editing.view.focus()}),this.listenTo(r,"execute",t=>{o.execute(t.source.commandName),o.editing.view.focus()}),r}_fillDropdownWithListOptions(t,e){const i=this.editor,n=[],o=new gn;for(const t of e)dk(t,i,n,o);return ah(t,o,i.ui.componentFactory),n}}function dk(t,e,i,n){const o=t.model=new bh(t.model),{commandName:r,bindIsOn:s}=t.model;if("button"===t.type||"switchbutton"===t.type){const t=e.commands.get(r);i.push(t),o.set({commandName:r}),o.bind("isEnabled").to(t),s&&o.bind("isOn").to(t,"value")}o.set({withText:!0}),n.add(t)}i(5873);class hk extends ae{static get pluginName(){return"TableSelection"}static get requires(){return[Vb]}init(){const t=this.editor.model;this.listenTo(t,"deleteContent",(t,e)=>this._handleDeleteContent(t,e),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){const t=lb(this.editor.model.document.selection);return 0==t.length?null:t}getSelectionAsFragment(){const t=this.getSelectedTableCells();return t?this.editor.model.change(e=>{const i=e.createDocumentFragment(),n=this.editor.plugins.get("TableUtils"),{first:o,last:r}=ub(t),{first:s,last:a}=hb(t),l=t[0].findAncestor("table");let c=a,d=r;if(mb(t,n)){const t={firstColumn:o,lastColumn:r,firstRow:s,lastRow:a};c=Mb(l,t),d=Ib(l,t)}const h=vb(l,{startRow:s,startColumn:o,endRow:c,endColumn:d},e);return e.insert(h,i,0),i}):null}setCellSelection(t,e){const i=this._getCellsToSelect(t,e);this.editor.model.change(t=>{t.setSelection(i.cells.map(e=>t.createRangeOn(e)),{backward:i.backward})})}getFocusCell(){const t=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return t&&t.is("element","tableCell")?t:null}getAnchorCell(){const t=Ws(this.editor.model.document.selection.getRanges()).getContainedElement();return t&&t.is("element","tableCell")?t:null}_defineSelectionConverter(){const t=this.editor,e=new Set;t.conversion.for("editingDowncast").add(t=>t.on("selection",(t,i,n)=>{const o=n.writer;!function(t){for(const i of e)t.removeClass("ck-editor__editable_selected",i);e.clear()}(o);const r=this.getSelectedTableCells();if(!r)return;for(const t of r){const i=n.mapper.toViewElement(t);o.addClass("ck-editor__editable_selected",i),e.add(i)}const s=n.mapper.toViewElement(r[r.length-1]);o.setSelection(s,0)},{priority:"lowest"}))}_enablePluginDisabling(){const t=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){const e=this.getSelectedTableCells();if(!e)return;t.model.change(i=>{const n=i.createPositionAt(e[0],0),o=t.model.schema.getNearestSelectionRange(n);i.setSelection(o)})}})}_handleDeleteContent(t,e){const[i,n]=e,o=this.editor.model,r=!n||"backward"==n.direction,s=lb(i);s.length&&(t.stop(),o.change(t=>{const e=s[r?s.length-1:0];o.change(t=>{for(const e of s)o.deleteContent(t.createSelection(e,"in"))});const n=o.schema.getNearestSelectionRange(t.createPositionAt(e,0));i.is("documentSelection")?t.setSelection(n):i.setTo(n)}))}_getCellsToSelect(t,e){const i=this.editor.plugins.get("TableUtils"),n=i.getCellLocation(t),o=i.getCellLocation(e),r=Math.min(n.row,o.row),s=Math.max(n.row,o.row),a=Math.min(n.column,o.column),l=Math.max(n.column,o.column),c=new Array(s-r+1).fill(null).map(()=>[]),d={startRow:r,endRow:s,startColumn:a,endColumn:l};for(const{row:e,cell:i}of new Kw(t.findAncestor("table"),d))c[e-r].push(i);const h=o.row<n.row,u=o.column<n.column;return h&&c.reverse(),u&&c.forEach(t=>t.reverse()),{cells:c.flat(),backward:h||u}}}class uk extends ae{static get pluginName(){return"TableClipboard"}static get requires(){return[hk,Vb]}init(){const t=this.editor,e=t.editing.view.document;this.listenTo(e,"copy",(t,e)=>this._onCopyCut(t,e)),this.listenTo(e,"cut",(t,e)=>this._onCopyCut(t,e)),this.listenTo(t.model,"insertContent",(t,e)=>this._onInsertContent(t,...e),{priority:"high"}),this.decorate("_replaceTableSlotCell")}_onCopyCut(t,e){const i=this.editor.plugins.get(hk);if(!i.getSelectedTableCells())return;if("cut"==t.name&&this.editor.isReadOnly)return;e.preventDefault(),t.stop();const n=this.editor.data,o=this.editor.editing.view.document,r=n.toView(i.getSelectionAsFragment());o.fire("clipboardOutput",{dataTransfer:e.dataTransfer,content:r,method:t.name})}_onInsertContent(t,e,i){if(i&&!i.is("documentSelection"))return;const n=this.editor.model,o=this.editor.plugins.get(Vb);let r=function(t,e){if(!t.is("documentFragment")&&!t.is("element"))return null;if(t.is("element","table"))return t;if(1==t.childCount&&t.getChild(0).is("element","table"))return t.getChild(0);const i=e.createRangeIn(t);for(const t of i.getItems())if(t.is("element","table")){const n=e.createRange(i.start,e.createPositionBefore(t));if(e.hasContent(n,{ignoreWhitespaces:!0}))return null;const o=e.createRange(e.createPositionAfter(t),i.end);return e.hasContent(o,{ignoreWhitespaces:!0})?null:t}return null}(e,n);if(!r)return;const s=db(n.document.selection);s.length?(t.stop(),n.change(t=>{const e={width:o.getColumns(r),height:o.getRows(r)},i=function(t,e,i,n){const o=t[0].findAncestor("table"),r=ub(t),s=hb(t),a={firstColumn:r.first,lastColumn:r.last,firstRow:s.first,lastRow:s.last},l=1===t.length;l&&(a.lastRow+=e.height-1,a.lastColumn+=e.width-1,function(t,e,i,n){const o=n.getColumns(t),r=n.getRows(t);i>o&&n.insertColumns(t,{at:o,columns:i-o});e>r&&n.insertRows(t,{at:r,rows:e-r})}(o,a.lastRow+1,a.lastColumn+1,n));l||!mb(t,n)?function(t,e,i){const{firstRow:n,lastRow:o,firstColumn:r,lastColumn:s}=e,a={first:n,last:o},l={first:r,last:s};gk(t,r,a,i),gk(t,s+1,a,i),mk(t,n,l,i),mk(t,o+1,l,i,n)}(o,a,i):(a.lastRow=Mb(o,a),a.lastColumn=Ib(o,a));return a}(s,e,t,o),n=i.lastRow-i.firstRow+1,a=i.lastColumn-i.firstColumn+1,l={startRow:0,startColumn:0,endRow:Math.min(n,e.height)-1,endColumn:Math.min(a,e.width)-1};r=vb(r,l,t);const c=s[0].findAncestor("table"),d=this._replaceSelectedCellsWithPasted(r,e,c,i,t);if(this.editor.plugins.get("TableSelection").isEnabled){const e=gb(d.map(e=>t.createRangeOn(e)));t.setSelection(e)}else t.setSelection(d[0],0)})):Pb(r,o)}_replaceSelectedCellsWithPasted(t,e,i,n,o){const{width:r,height:s}=e,a=function(t,e,i){const n=new Array(i).fill(null).map(()=>new Array(e).fill(null));for(const{column:e,row:i,cell:o}of new Kw(t))n[i][e]=o;return n}(t,r,s),l=[...new Kw(i,{startRow:n.firstRow,endRow:n.lastRow,startColumn:n.firstColumn,endColumn:n.lastColumn,includeAllSlots:!0})],c=[];let d;for(const t of l){const{row:e,column:i}=t;i===n.firstColumn&&(d=t.getPositionBefore());const l=e-n.firstRow,h=i-n.firstColumn,u=a[l%s][h%r],m=u?o.cloneElement(u):null,g=this._replaceTableSlotCell(t,m,d,o);g&&(Tb(g,e,i,n.lastRow,n.lastColumn,o),c.push(g),d=o.createPositionAfter(g))}const h=parseInt(i.getAttribute("headingRows")||0),u=parseInt(i.getAttribute("headingColumns")||0),m=n.firstRow<h&&h<=n.lastRow,g=n.firstColumn<u&&u<=n.lastColumn;if(m){const t=mk(i,h,{first:n.firstColumn,last:n.lastColumn},o,n.firstRow);c.push(...t)}if(g){const t=gk(i,u,{first:n.firstRow,last:n.lastRow},o);c.push(...t)}return c}_replaceTableSlotCell(t,e,i,n){const{cell:o,isAnchor:r}=t;return r&&n.remove(o),e?(n.insert(e,i),e):null}}function mk(t,e,i,n,o=0){if(e<1)return;return yb(t,e,o).filter(({column:t,cellWidth:e})=>fk(t,e,i)).map(({cell:t})=>xb(t,e,n))}function gk(t,e,i,n){if(e<1)return;return Ab(t,e).filter(({row:t,cellHeight:e})=>fk(t,e,i)).map(({cell:t,column:i})=>Cb(t,i,e,n))}function fk(t,e,i){const n=t+e-1,{first:o,last:r}=i;return t>=o&&t<=r||t<o&&n>=o}class pk extends ae{static get pluginName(){return"TableKeyboard"}static get requires(){return[hk]}init(){const t=this.editor.editing.view.document;this.editor.keystrokes.set("Tab",(...t)=>this._handleTabOnSelectedTable(...t),{priority:"low"}),this.editor.keystrokes.set("Tab",this._getTabHandler(!0),{priority:"low"}),this.editor.keystrokes.set("Shift+Tab",this._getTabHandler(!1),{priority:"low"}),this.listenTo(t,"arrowKey",(...t)=>this._onArrowKey(...t),{context:"table"})}_handleTabOnSelectedTable(t,e){const i=this.editor,n=i.model.document.selection.getSelectedElement();n&&n.is("element","table")&&(e(),i.model.change(t=>{t.setSelection(t.createRangeIn(n.getChild(0).getChild(0)))}))}_getTabHandler(t){const e=this.editor;return(i,n)=>{let o=cb(e.model.document.selection)[0];if(o||(o=this.editor.plugins.get("TableSelection").getFocusCell()),!o)return;n();const r=o.parent,s=r.parent,a=s.getChildIndex(r),l=r.getChildIndex(o),c=0===l;if(!t&&c&&0===a)return void e.model.change(t=>{t.setSelection(t.createRangeOn(s))});const d=this.editor.plugins.get("TableUtils"),h=l===r.childCount-1,u=a===d.getRows(s)-1;if(t&&u&&h&&(e.execute("insertTableRowBelow"),a===d.getRows(s)-1))return void e.model.change(t=>{t.setSelection(t.createRangeOn(s))});let m;if(t&&h){const t=s.getChild(a+1);m=t.getChild(0)}else if(!t&&c){const t=s.getChild(a-1);m=t.getChild(t.childCount-1)}else m=r.getChild(l+(t?1:-1));e.model.change(t=>{t.setSelection(t.createRangeIn(m))})}}_onArrowKey(t,e){const i=this.editor,n=Jo(e.keyCode,i.locale.contentLanguageDirection);this._handleArrowKeys(n,e.shiftKey)&&(e.preventDefault(),e.stopPropagation(),t.stop())}_handleArrowKeys(t,e){const i=this.editor.model.document.selection,n=["right","down"].includes(t),o=lb(i);if(o.length){let i;return i=e?this.editor.plugins.get("TableSelection").getFocusCell():n?o[o.length-1]:o[0],this._navigateFromCellInDirection(i,t,e),!0}const r=i.focus.findAncestor("tableCell");return!!r&&(!(e&&!i.isCollapsed&&i.isBackward==n)&&(!!this._isSelectionAtCellEdge(i,r,n)&&(this._navigateFromCellInDirection(r,t,e),!0)))}_isSelectionAtCellEdge(t,e,i){const n=this.editor.model,o=this.editor.model.schema,r=i?t.getLastPosition():t.getFirstPosition();if(!o.getLimitElement(r).is("element","tableCell")){return n.createPositionAt(e,i?"end":0).isTouching(r)}const s=n.createSelection(r);return n.modifySelection(s,{direction:i?"forward":"backward"}),r.isEqual(s.focus)}_navigateFromCellInDirection(t,e,i=!1){const n=this.editor.model,o=t.findAncestor("table"),r=[...new Kw(o,{includeAllSlots:!0})],{row:s,column:a}=r[r.length-1],l=r.find(({cell:e})=>e==t);let{row:c,column:d}=l;switch(e){case"left":d--;break;case"up":c--;break;case"right":d+=l.cellWidth;break;case"down":c+=l.cellHeight}if(c<0||c>s||d<0&&c<=0||d>a&&c>=s)return void n.change(t=>{t.setSelection(t.createRangeOn(o))});d<0?(d=i?0:a,c--):d>a&&(d=i?a:0,c++);const h=r.find(t=>t.row==c&&t.column==d).cell,u=["right","down"].includes(e),m=this.editor.plugins.get("TableSelection");if(i&&m.isEnabled){const e=m.getAnchorCell()||t;m.setCellSelection(e,h)}else{const t=n.createPositionAt(h,u?0:"end");n.change(e=>{e.setSelection(t)})}}}class wk extends ps{constructor(t){super(t),this.domEventType=["mousemove","mouseleave"]}onDomEvent(t){this.fire(t.type,t)}}class bk extends ae{static get pluginName(){return"TableMouse"}static get requires(){return[hk]}init(){this.editor.editing.view.addObserver(wk),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){const t=this.editor;let e=!1;const i=t.plugins.get(hk);this.listenTo(t.editing.view.document,"mousedown",(n,o)=>{if(!this.isEnabled||!i.isEnabled)return;if(!o.domEvent.shiftKey)return;const r=i.getAnchorCell()||cb(t.model.document.selection)[0];if(!r)return;const s=this._getModelTableCellFromDomEvent(o);s&&kk(r,s)&&(e=!0,i.setCellSelection(r,s),o.preventDefault())}),this.listenTo(t.editing.view.document,"mouseup",()=>{e=!1}),this.listenTo(t.editing.view.document,"selectionChange",t=>{e&&t.stop()},{priority:"highest"})}_enableMouseDragSelection(){const t=this.editor;let e,i,n=!1,o=!1;const r=t.plugins.get(hk);this.listenTo(t.editing.view.document,"mousedown",(t,i)=>{this.isEnabled&&r.isEnabled&&(i.domEvent.shiftKey||i.domEvent.ctrlKey||i.domEvent.altKey||(e=this._getModelTableCellFromDomEvent(i)))}),this.listenTo(t.editing.view.document,"mousemove",(t,s)=>{if(!s.domEvent.buttons)return;if(!e)return;const a=this._getModelTableCellFromDomEvent(s);a&&kk(e,a)&&(i=a,n||i==e||(n=!0)),n&&(o=!0,r.setCellSelection(e,i),s.preventDefault())}),this.listenTo(t.editing.view.document,"mouseup",()=>{n=!1,o=!1,e=null,i=null}),this.listenTo(t.editing.view.document,"selectionChange",t=>{o&&t.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(t){const e=t.target,i=this.editor.editing.view.createPositionAt(e,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}}function kk(t,e){return t.parent.parent==e.parent.parent}i(4567);function _k(t){const e=t.getSelectedElement();return e&&yk(e)?e:null}function vk(t){let e=t.getFirstPosition().parent;for(;e;){if(e.is("element")&&yk(e))return e;e=e.parent}return null}function yk(t){return!!t.getCustomProperty("table")&&Du(t)}const xk={autoRefresh:!0};class Ak{constructor(t,e=xk){if(!t)throw new a("token-missing-token-url",this);e.initValue&&this._validateTokenValue(e.initValue),this.set("value",e.initValue),this._refresh="function"==typeof t?t:()=>{return e=t,new Promise((t,i)=>{const n=new XMLHttpRequest;n.open("GET",e),n.addEventListener("load",()=>{const e=n.status,o=n.response;return e<200||e>299?i(new a("token-cannot-download-new-token",null)):t(o)}),n.addEventListener("error",()=>i(new Error("Network Error"))),n.addEventListener("abort",()=>i(new Error("Abort"))),n.send()});var e},this._options=Object.assign({},xk,e)}init(){return new Promise((t,e)=>{this.value?(this._options.autoRefresh&&this._registerRefreshTokenTimeout(),t(this)):this.refreshToken().then(t).catch(e)})}refreshToken(){return this._refresh().then(t=>{this._validateTokenValue(t),this.set("value",t),this._options.autoRefresh&&this._registerRefreshTokenTimeout()}).then(()=>this)}destroy(){clearTimeout(this._tokenRefreshTimeout)}_validateTokenValue(t){const e="string"==typeof t,i=!/^".*"$/.test(t),n=e&&3===t.split(".").length;if(!i||!n)throw new a("token-not-in-jwt-format",this)}_registerRefreshTokenTimeout(){const t=this._getTokenRefreshTimeoutTime();clearTimeout(this._tokenRefreshTimeout),this._tokenRefreshTimeout=setTimeout(()=>{this.refreshToken()},t)}_getTokenRefreshTimeoutTime(){try{const[,t]=this.value.split("."),{exp:e}=JSON.parse(atob(t));if(!e)return 36e5;return Math.floor((1e3*e-Date.now())/2)}catch(t){return 36e5}}static create(t,e=xk){return new Ak(t,e).init()}}se(Ak,te);const Ck=Ak,Tk=/^data:(\S*?);base64,/;class Ek{constructor(t,e,i){if(!t)throw new a("fileuploader-missing-file",null);if(!e)throw new a("fileuploader-missing-token",null);if(!i)throw new a("fileuploader-missing-api-address",null);this.file=function(t){if("string"!=typeof t)return!1;const e=t.match(Tk);return!(!e||!e.length)}(t)?function(t,e=512){try{const i=t.match(Tk)[1],n=atob(t.replace(Tk,"")),o=[];for(let t=0;t<n.length;t+=e){const i=n.slice(t,t+e),r=new Array(i.length);for(let t=0;t<i.length;t++)r[t]=i.charCodeAt(t);o.push(new Uint8Array(r))}return new Blob(o,{type:i})}catch(t){throw new a("fileuploader-decoding-image-data-error",null)}}(t):t,this._token=e,this._apiAddress=i}onProgress(t){return this.on("progress",(e,i)=>t(i)),this}onError(t){return this.once("error",(e,i)=>t(i)),this}abort(){this.xhr.abort()}send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest()}_prepareRequest(){const t=new XMLHttpRequest;t.open("POST",this._apiAddress),t.setRequestHeader("Authorization",this._token.value),t.responseType="json",this.xhr=t}_attachXHRListeners(){const t=this,e=this.xhr;function i(e){return()=>t.fire("error",e)}e.addEventListener("error",i("Network Error")),e.addEventListener("abort",i("Abort")),e.upload&&e.upload.addEventListener("progress",t=>{t.lengthComputable&&this.fire("progress",{total:t.total,uploaded:t.loaded})}),e.addEventListener("load",()=>{const t=e.status,i=e.response;if(t<200||t>299)return this.fire("error",i.message||i.error)})}_sendRequest(){const t=new FormData,e=this.xhr;return t.append("file",this.file),new Promise((i,n)=>{e.addEventListener("load",()=>{const t=e.status,o=e.response;return t<200||t>299?o.message?n(new a("fileuploader-uploading-data-failed",this,{message:o.message})):n(o.error):i(o)}),e.addEventListener("error",()=>n(new Error("Network Error"))),e.addEventListener("abort",()=>n(new Error("Abort"))),e.send(t)})}}se(Ek,g);class Sk{constructor(t,e){if(!t)throw new a("uploadgateway-missing-token",null);if(!e)throw new a("uploadgateway-missing-api-address",null);this._token=t,this._apiAddress=e}upload(t){return new Ek(t,this._token,this._apiAddress)}}class Pk extends yn{static get pluginName(){return"CloudServicesCore"}createToken(t,e){return new Ck(t,e)}createUploadGateway(t,e){return new Sk(t,e)}}function Mk(t){return i=>{i.on(`attribute:${t}:image`,e)};function e(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const n=i.writer,o=bf(i.mapper.toViewElement(e.item));n.setAttribute(e.attributeKey,e.attributeNewValue||"",o)}}class Ik extends ps{constructor(t){super(t),this.domEventType="dblclick"}onDomEvent(t){this.fire(t.type,t)}}let Lk;class Nk extends mh{constructor(t,e){super(t);const i=t.t;this.set("class","ck-special-characters-navigation"),this.groupDropdownView=this._createGroupDropdown(e),this.groupDropdownView.panelPosition="rtl"===t.uiLanguageDirection?"se":"sw",this.label=i("Special characters"),this.children.add(this.groupDropdownView)}get currentGroupName(){return this.groupDropdownView.value}_createGroupDropdown(t){const e=this.locale,i=e.t,n=rh(e),o=this._getCharacterGroupListItemDefinitions(n,t);return n.set("value",o.first.model.label),n.buttonView.bind("label").to(n,"value"),n.buttonView.set({isOn:!1,withText:!0,tooltip:i("Character categories"),class:["ck-dropdown__button_label-width_auto"]}),n.on("execute",t=>{n.value=t.source.label}),n.delegate("execute").to(this),ah(n,o),n}_getCharacterGroupListItemDefinitions(t,e){const i=new gn;for(const n of e){const e={type:"button",model:new bh({label:n,withText:!0})};e.model.bind("isOn").to(t,"value",t=>t===e.model.label),i.add(e)}return i}}i(1626);class Rk extends cd{constructor(t){super(t),this.tiles=this.createCollection(),this.setTemplate({tag:"div",children:[{tag:"div",attributes:{class:["ck","ck-character-grid__tiles"]},children:this.tiles}],attributes:{class:["ck","ck-character-grid"]}})}createTile(t,e){const i=new Nd(this.locale);return i.set({label:t,withText:!0,class:"ck-character-grid__tile"}),i.extendTemplate({attributes:{title:e},on:{mouseover:i.bindTemplate.to("mouseover")}}),i.on("mouseover",()=>{this.fire("tileHover",{name:e,character:t})}),i.on("execute",()=>{this.fire("execute",{name:e,character:t})}),i}}i(191);class Ok extends cd{constructor(t){super(t);const e=this.bindTemplate;this.set("character",null),this.set("name",null),this.bind("code").to(this,"character",zk),this.setTemplate({tag:"div",children:[{tag:"span",attributes:{class:["ck-character-info__name"]},children:[{text:e.to("name",t=>t||"​")}]},{tag:"span",attributes:{class:["ck-character-info__code"]},children:[{text:e.to("code")}]}],attributes:{class:["ck","ck-character-info"]}})}}function zk(t){if(null===t)return"";return"U+"+("0000"+t.codePointAt(0).toString(16)).slice(-4)}i(6434);class Dk extends ae{static get pluginName(){return"SpecialCharactersCurrency"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Currency",[{character:"$",title:e("Dollar sign")},{character:"€",title:e("Euro sign")},{character:"¥",title:e("Yen sign")},{character:"£",title:e("Pound sign")},{character:"¢",title:e("Cent sign")},{character:"₠",title:e("Euro-currency sign")},{character:"₡",title:e("Colon sign")},{character:"₢",title:e("Cruzeiro sign")},{character:"₣",title:e("French franc sign")},{character:"₤",title:e("Lira sign")},{character:"¤",title:e("Currency sign")},{character:"₿",title:e("Bitcoin sign")},{character:"₥",title:e("Mill sign")},{character:"₦",title:e("Naira sign")},{character:"₧",title:e("Peseta sign")},{character:"₨",title:e("Rupee sign")},{character:"₩",title:e("Won sign")},{character:"₪",title:e("New sheqel sign")},{character:"₫",title:e("Dong sign")},{character:"₭",title:e("Kip sign")},{character:"₮",title:e("Tugrik sign")},{character:"₯",title:e("Drachma sign")},{character:"₰",title:e("German penny sign")},{character:"₱",title:e("Peso sign")},{character:"₲",title:e("Guarani sign")},{character:"₳",title:e("Austral sign")},{character:"₴",title:e("Hryvnia sign")},{character:"₵",title:e("Cedi sign")},{character:"₶",title:e("Livre tournois sign")},{character:"₷",title:e("Spesmilo sign")},{character:"₸",title:e("Tenge sign")},{character:"₹",title:e("Indian rupee sign")},{character:"₺",title:e("Turkish lira sign")},{character:"₻",title:e("Nordic mark sign")},{character:"₼",title:e("Manat sign")},{character:"₽",title:e("Ruble sign")}])}}class Vk extends ae{static get pluginName(){return"SpecialCharactersMathematical"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Mathematical",[{character:"<",title:e("Less-than sign")},{character:">",title:e("Greater-than sign")},{character:"≤",title:e("Less-than or equal to")},{character:"≥",title:e("Greater-than or equal to")},{character:"–",title:e("En dash")},{character:"—",title:e("Em dash")},{character:"¯",title:e("Macron")},{character:"‾",title:e("Overline")},{character:"°",title:e("Degree sign")},{character:"−",title:e("Minus sign")},{character:"±",title:e("Plus-minus sign")},{character:"÷",title:e("Division sign")},{character:"⁄",title:e("Fraction slash")},{character:"×",title:e("Multiplication sign")},{character:"ƒ",title:e("Latin small letter f with hook")},{character:"∫",title:e("Integral")},{character:"∑",title:e("N-ary summation")},{character:"∞",title:e("Infinity")},{character:"√",title:e("Square root")},{character:"∼",title:e("Tilde operator")},{character:"≅",title:e("Approximately equal to")},{character:"≈",title:e("Almost equal to")},{character:"≠",title:e("Not equal to")},{character:"≡",title:e("Identical to")},{character:"∈",title:e("Element of")},{character:"∉",title:e("Not an element of")},{character:"∋",title:e("Contains as member")},{character:"∏",title:e("N-ary product")},{character:"∧",title:e("Logical and")},{character:"∨",title:e("Logical or")},{character:"¬",title:e("Not sign")},{character:"∩",title:e("Intersection")},{character:"∪",title:e("Union")},{character:"∂",title:e("Partial differential")},{character:"∀",title:e("For all")},{character:"∃",title:e("There exists")},{character:"∅",title:e("Empty set")},{character:"∇",title:e("Nabla")},{character:"∗",title:e("Asterisk operator")},{character:"∝",title:e("Proportional to")},{character:"∠",title:e("Angle")},{character:"¼",title:e("Vulgar fraction one quarter")},{character:"½",title:e("Vulgar fraction one half")},{character:"¾",title:e("Vulgar fraction three quarters")}])}}class jk extends ae{static get pluginName(){return"SpecialCharactersArrows"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Arrows",[{title:e("leftwards double arrow"),character:"⇐"},{title:e("rightwards double arrow"),character:"⇒"},{title:e("upwards double arrow"),character:"⇑"},{title:e("downwards double arrow"),character:"⇓"},{title:e("leftwards dashed arrow"),character:"⇠"},{title:e("rightwards dashed arrow"),character:"⇢"},{title:e("upwards dashed arrow"),character:"⇡"},{title:e("downwards dashed arrow"),character:"⇣"},{title:e("leftwards arrow to bar"),character:"⇤"},{title:e("rightwards arrow to bar"),character:"⇥"},{title:e("upwards arrow to bar"),character:"⤒"},{title:e("downwards arrow to bar"),character:"⤓"},{title:e("up down arrow with base"),character:"↨"},{title:e("back with leftwards arrow above"),character:"🔙"},{title:e("end with leftwards arrow above"),character:"🔚"},{title:e("on with exclamation mark with left right arrow above"),character:"🔛"},{title:e("soon with rightwards arrow above"),character:"🔜"},{title:e("top with upwards arrow above"),character:"🔝"}])}}class Bk extends ae{static get pluginName(){return"SpecialCharactersLatin"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Latin",[{character:"Ā",title:e("Latin capital letter a with macron")},{character:"ā",title:e("Latin small letter a with macron")},{character:"Ă",title:e("Latin capital letter a with breve")},{character:"ă",title:e("Latin small letter a with breve")},{character:"Ą",title:e("Latin capital letter a with ogonek")},{character:"ą",title:e("Latin small letter a with ogonek")},{character:"Ć",title:e("Latin capital letter c with acute")},{character:"ć",title:e("Latin small letter c with acute")},{character:"Ĉ",title:e("Latin capital letter c with circumflex")},{character:"ĉ",title:e("Latin small letter c with circumflex")},{character:"Ċ",title:e("Latin capital letter c with dot above")},{character:"ċ",title:e("Latin small letter c with dot above")},{character:"Č",title:e("Latin capital letter c with caron")},{character:"č",title:e("Latin small letter c with caron")},{character:"Ď",title:e("Latin capital letter d with caron")},{character:"ď",title:e("Latin small letter d with caron")},{character:"Đ",title:e("Latin capital letter d with stroke")},{character:"đ",title:e("Latin small letter d with stroke")},{character:"Ē",title:e("Latin capital letter e with macron")},{character:"ē",title:e("Latin small letter e with macron")},{character:"Ĕ",title:e("Latin capital letter e with breve")},{character:"ĕ",title:e("Latin small letter e with breve")},{character:"Ė",title:e("Latin capital letter e with dot above")},{character:"ė",title:e("Latin small letter e with dot above")},{character:"Ę",title:e("Latin capital letter e with ogonek")},{character:"ę",title:e("Latin small letter e with ogonek")},{character:"Ě",title:e("Latin capital letter e with caron")},{character:"ě",title:e("Latin small letter e with caron")},{character:"Ĝ",title:e("Latin capital letter g with circumflex")},{character:"ĝ",title:e("Latin small letter g with circumflex")},{character:"Ğ",title:e("Latin capital letter g with breve")},{character:"ğ",title:e("Latin small letter g with breve")},{character:"Ġ",title:e("Latin capital letter g with dot above")},{character:"ġ",title:e("Latin small letter g with dot above")},{character:"Ģ",title:e("Latin capital letter g with cedilla")},{character:"ģ",title:e("Latin small letter g with cedilla")},{character:"Ĥ",title:e("Latin capital letter h with circumflex")},{character:"ĥ",title:e("Latin small letter h with circumflex")},{character:"Ħ",title:e("Latin capital letter h with stroke")},{character:"ħ",title:e("Latin small letter h with stroke")},{character:"Ĩ",title:e("Latin capital letter i with tilde")},{character:"ĩ",title:e("Latin small letter i with tilde")},{character:"Ī",title:e("Latin capital letter i with macron")},{character:"ī",title:e("Latin small letter i with macron")},{character:"Ĭ",title:e("Latin capital letter i with breve")},{character:"ĭ",title:e("Latin small letter i with breve")},{character:"Į",title:e("Latin capital letter i with ogonek")},{character:"į",title:e("Latin small letter i with ogonek")},{character:"İ",title:e("Latin capital letter i with dot above")},{character:"ı",title:e("Latin small letter dotless i")},{character:"IJ",title:e("Latin capital ligature ij")},{character:"ij",title:e("Latin small ligature ij")},{character:"Ĵ",title:e("Latin capital letter j with circumflex")},{character:"ĵ",title:e("Latin small letter j with circumflex")},{character:"Ķ",title:e("Latin capital letter k with cedilla")},{character:"ķ",title:e("Latin small letter k with cedilla")},{character:"ĸ",title:e("Latin small letter kra")},{character:"Ĺ",title:e("Latin capital letter l with acute")},{character:"ĺ",title:e("Latin small letter l with acute")},{character:"Ļ",title:e("Latin capital letter l with cedilla")},{character:"ļ",title:e("Latin small letter l with cedilla")},{character:"Ľ",title:e("Latin capital letter l with caron")},{character:"ľ",title:e("Latin small letter l with caron")},{character:"Ŀ",title:e("Latin capital letter l with middle dot")},{character:"ŀ",title:e("Latin small letter l with middle dot")},{character:"Ł",title:e("Latin capital letter l with stroke")},{character:"ł",title:e("Latin small letter l with stroke")},{character:"Ń",title:e("Latin capital letter n with acute")},{character:"ń",title:e("Latin small letter n with acute")},{character:"Ņ",title:e("Latin capital letter n with cedilla")},{character:"ņ",title:e("Latin small letter n with cedilla")},{character:"Ň",title:e("Latin capital letter n with caron")},{character:"ň",title:e("Latin small letter n with caron")},{character:"ʼn",title:e("Latin small letter n preceded by apostrophe")},{character:"Ŋ",title:e("Latin capital letter eng")},{character:"ŋ",title:e("Latin small letter eng")},{character:"Ō",title:e("Latin capital letter o with macron")},{character:"ō",title:e("Latin small letter o with macron")},{character:"Ŏ",title:e("Latin capital letter o with breve")},{character:"ŏ",title:e("Latin small letter o with breve")},{character:"Ő",title:e("Latin capital letter o with double acute")},{character:"ő",title:e("Latin small letter o with double acute")},{character:"Œ",title:e("Latin capital ligature oe")},{character:"œ",title:e("Latin small ligature oe")},{character:"Ŕ",title:e("Latin capital letter r with acute")},{character:"ŕ",title:e("Latin small letter r with acute")},{character:"Ŗ",title:e("Latin capital letter r with cedilla")},{character:"ŗ",title:e("Latin small letter r with cedilla")},{character:"Ř",title:e("Latin capital letter r with caron")},{character:"ř",title:e("Latin small letter r with caron")},{character:"Ś",title:e("Latin capital letter s with acute")},{character:"ś",title:e("Latin small letter s with acute")},{character:"Ŝ",title:e("Latin capital letter s with circumflex")},{character:"ŝ",title:e("Latin small letter s with circumflex")},{character:"Ş",title:e("Latin capital letter s with cedilla")},{character:"ş",title:e("Latin small letter s with cedilla")},{character:"Š",title:e("Latin capital letter s with caron")},{character:"š",title:e("Latin small letter s with caron")},{character:"Ţ",title:e("Latin capital letter t with cedilla")},{character:"ţ",title:e("Latin small letter t with cedilla")},{character:"Ť",title:e("Latin capital letter t with caron")},{character:"ť",title:e("Latin small letter t with caron")},{character:"Ŧ",title:e("Latin capital letter t with stroke")},{character:"ŧ",title:e("Latin small letter t with stroke")},{character:"Ũ",title:e("Latin capital letter u with tilde")},{character:"ũ",title:e("Latin small letter u with tilde")},{character:"Ū",title:e("Latin capital letter u with macron")},{character:"ū",title:e("Latin small letter u with macron")},{character:"Ŭ",title:e("Latin capital letter u with breve")},{character:"ŭ",title:e("Latin small letter u with breve")},{character:"Ů",title:e("Latin capital letter u with ring above")},{character:"ů",title:e("Latin small letter u with ring above")},{character:"Ű",title:e("Latin capital letter u with double acute")},{character:"ű",title:e("Latin small letter u with double acute")},{character:"Ų",title:e("Latin capital letter u with ogonek")},{character:"ų",title:e("Latin small letter u with ogonek")},{character:"Ŵ",title:e("Latin capital letter w with circumflex")},{character:"ŵ",title:e("Latin small letter w with circumflex")},{character:"Ŷ",title:e("Latin capital letter y with circumflex")},{character:"ŷ",title:e("Latin small letter y with circumflex")},{character:"Ÿ",title:e("Latin capital letter y with diaeresis")},{character:"Ź",title:e("Latin capital letter z with acute")},{character:"ź",title:e("Latin small letter z with acute")},{character:"Ż",title:e("Latin capital letter z with dot above")},{character:"ż",title:e("Latin small letter z with dot above")},{character:"Ž",title:e("Latin capital letter z with caron")},{character:"ž",title:e("Latin small letter z with caron")},{character:"ſ",title:e("Latin small letter long s")}])}}class Fk extends ae{static get pluginName(){return"SpecialCharactersText"}init(){const t=this.editor,e=t.t;t.plugins.get("SpecialCharacters").addItems("Text",[{character:"‹",title:e("Single left-pointing angle quotation mark")},{character:"›",title:e("Single right-pointing angle quotation mark")},{character:"«",title:e("Left-pointing double angle quotation mark")},{character:"»",title:e("Right-pointing double angle quotation mark")},{character:"‘",title:e("Left single quotation mark")},{character:"’",title:e("Right single quotation mark")},{character:"“",title:e("Left double quotation mark")},{character:"”",title:e("Right double quotation mark")},{character:"‚",title:e("Single low-9 quotation mark")},{character:"„",title:e("Double low-9 quotation mark")},{character:"¡",title:e("Inverted exclamation mark")},{character:"¿",title:e("Inverted question mark")},{character:"‥",title:e("Two dot leader")},{character:"…",title:e("Horizontal ellipsis")},{character:"‡",title:e("Double dagger")},{character:"‰",title:e("Per mille sign")},{character:"‱",title:e("Per ten thousand sign")},{character:"‼",title:e("Double exclamation mark")},{character:"⁈",title:e("Question exclamation mark")},{character:"⁉",title:e("Exclamation question mark")},{character:"⁇",title:e("Double question mark")},{character:"©",title:e("Copyright sign")},{character:"®",title:e("Registered sign")},{character:"™",title:e("Trade mark sign")},{character:"§",title:e("Section sign")},{character:"¶",title:e("Paragraph sign")},{character:"⁋",title:e("Reversed paragraph sign")}])}}class Hk extends ce{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute(this.attributeKey),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=t.value;e.change(t=>{if(i.isCollapsed)n?t.setSelectionAttribute(this.attributeKey,n):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of o)n?t.setAttribute(this.attributeKey,n,e):t.removeAttribute(this.attributeKey,e)}})}}class Uk extends gn{constructor(t){super(t),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",0===this.length)})}add(t,e){this.find(e=>e.color===t.color)||super.add(t,e)}hasColor(t){return!!this.find(e=>e.color===t)}}se(Uk,te);i(2199);class qk extends cd{constructor(t,{colors:e,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r}){super(t),this.items=this.createCollection(),this.colorDefinitions=e,this.focusTracker=new $s,this.keystrokes=new Gs,this.set("selectedColor"),this.removeButtonLabel=n,this.columns=i,this.documentColors=new Uk,this.documentColorsCount=r,this._focusCycler=new Dd({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this._documentColorsLabel=o,this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-table"]},children:this.items}),this.items.add(this._removeColorButton())}updateDocumentColors(t,e){const i=t.document,n=this.documentColorsCount;this.documentColors.clear();for(const o of i.getRootNames()){const r=i.getRoot(o),s=t.createRangeIn(r);for(const t of s.getItems())if(t.is("$textProxy")&&t.hasAttribute(e)&&(this._addColorToDocumentColors(t.getAttribute(e)),this.documentColors.length>=n))return}}updateSelectedColors(){const t=this.documentColorsGrid,e=this.staticColorsGrid,i=this.selectedColor;e.selectedColor=i,t&&(t.selectedColor=i)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element)}appendGrids(){if(!this.staticColorsGrid&&(this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount)){const t=dd.bind(this.documentColors,this.documentColors),e=new ch(this.locale);e.text=this._documentColorsLabel,e.extendTemplate({attributes:{class:["ck","ck-color-grid__label",t.if("isEmpty","ck-hidden")]}}),this.items.add(e),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_removeColorButton(){const t=new Nd;return t.set({withText:!0,icon:Fc,tooltip:!0,label:this.removeButtonLabel}),t.class="ck-color-table__remove-color",t.on("execute",()=>{this.fire("execute",{value:null})}),t}_createStaticColorsGrid(){const t=new jd(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return t.delegate("execute").to(this),t}_createDocumentColorsGrid(){const t=dd.bind(this.documentColors,this.documentColors),e=new jd(this.locale,{columns:this.columns});return e.delegate("execute").to(this),e.extendTemplate({attributes:{class:t.if("isEmpty","ck-hidden")}}),e.items.bindTo(this.documentColors).using(t=>{const e=new zd;return e.set({color:t.color,hasBorder:t.options&&t.options.hasBorder}),t.label&&e.set({label:t.label,tooltip:!0}),e.on("execute",()=>{this.fire("execute",{value:t.color})}),e}),this.documentColors.on("change:isEmpty",(t,i,n)=>{n&&(e.selectedColor=null)}),e}_addColorToDocumentColors(t){const e=this.colorDefinitions.find(e=>e.color===t);e?this.documentColors.add(Object.assign({},e)):this.documentColors.add({color:t,label:t,options:{hasBorder:!1}})}}function Wk(t,e){const i={model:{key:t,values:[]},view:{},upcastAlso:{}};for(const t of e)i.model.values.push(t.model),i.view[t.model]=t.view,t.upcastAlso&&(i.upcastAlso[t.model]=t.upcastAlso);return i}function $k(t){return e=>e.getStyle(t).replace(/\s/g,"")}function Gk(t){return(e,{writer:i})=>i.createAttributeElement("span",{style:`${t}:${e}`},{priority:7})}class Yk extends Hk{constructor(t){super(t,"fontFamily")}}function Kk(t){return t.map(Qk).filter(t=>!!t)}function Qk(t){return"object"==typeof t?t:"default"===t?{title:"Default",model:void 0}:"string"==typeof t?function(t){const e=t.replace(/"|'/g,"").split(","),i=e[0],n=e.map(Jk).join(", ");return{title:i,model:n,view:{name:"span",styles:{"font-family":n},priority:7}}}(t):void 0}function Jk(t){return(t=t.trim()).indexOf(" ")>0&&(t=`'${t}'`),t}class Zk extends ae{static get pluginName(){return"FontFamilyEditing"}constructor(t){super(t),t.config.define("fontFamily",{options:["default","Arial, Helvetica, sans-serif","Courier New, Courier, monospace","Georgia, serif","Lucida Sans Unicode, Lucida Grande, sans-serif","Tahoma, Geneva, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Helvetica, sans-serif","Verdana, Geneva, sans-serif"],supportAllValues:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"fontFamily"}),t.model.schema.setAttributeProperties("fontFamily",{isFormatting:!0,copyOnEnter:!0});const e=Wk("fontFamily",Kk(t.config.get("fontFamily.options")).filter(t=>t.model));t.config.get("fontFamily.supportAllValues")?(this._prepareAnyValueConverters(),this._prepareCompatibilityConverter()):t.conversion.attributeToElement(e),t.commands.add("fontFamily",new Yk(t))}_prepareAnyValueConverters(){const t=this.editor;t.conversion.for("downcast").attributeToElement({model:"fontFamily",view:(t,{writer:e})=>e.createAttributeElement("span",{style:"font-family:"+t},{priority:7})}),t.conversion.for("upcast").elementToAttribute({model:{key:"fontFamily",value:t=>t.getStyle("font-family")},view:{name:"span",styles:{"font-family":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{face:/.*/}},model:{key:"fontFamily",value:t=>t.getAttribute("face")}})}}class Xk extends ae{static get pluginName(){return"FontFamilyUI"}init(){const t=this.editor,e=t.t,i=this._getLocalizedOptions(),n=t.commands.get("fontFamily");t.ui.componentFactory.add("fontFamily",o=>{const r=rh(o);return ah(r,function(t,e){const i=new gn;for(const n of t){const t={type:"button",model:new bh({commandName:"fontFamily",commandParam:n.model,label:n.title,withText:!0})};t.model.bind("isOn").to(e,"value",t=>t===n.model||!(!t||!n.model)&&t.split(",")[0].replace(/'/g,"").toLowerCase()===n.model.toLowerCase()),n.view&&n.view.styles&&t.model.set("labelStyle","font-family: "+n.view.styles["font-family"]),i.add(t)}return i}(i,n)),r.buttonView.set({label:e("Font Family"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.03 3h6.149a.75.75 0 1 1 0 1.5h-5.514L11.03 3zm1.27 3h4.879a.75.75 0 1 1 0 1.5h-4.244L12.3 6zm1.27 3h3.609a.75.75 0 1 1 0 1.5h-2.973L13.57 9zm-2.754 2.5L8.038 4.785 5.261 11.5h5.555zm.62 1.5H4.641l-1.666 4.028H1.312l5.789-14h1.875l5.789 14h-1.663L11.436 13z"/></svg>',tooltip:!0}),r.extendTemplate({attributes:{class:"ck-font-family-dropdown"}}),r.bind("isEnabled").to(n),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()}),r})}_getLocalizedOptions(){const t=this.editor,e=t.t;return Kk(t.config.get("fontFamily").options).map(t=>("Default"===t.title&&(t.title=e("Default")),t))}}class t_ extends ae{static get requires(){return[Zk,Xk]}static get pluginName(){return"FontFamily"}}class e_ extends Hk{constructor(t){super(t,"fontSize")}}function i_(t){return t.map(t=>function(t){if(e=t,"object"==typeof e&&e.title&&e.model&&e.view)return o_(t);var e;const i=function(t){return n_[t]||n_[t.model]}(t);if(i)return o_(i);if("default"===t)return{model:void 0,title:"Default"};if(function(t){let e;if("object"==typeof t){if(!t.model)throw new a("font-size-invalid-definition",null,t);e=parseFloat(t.model)}else e=parseFloat(t);return isNaN(e)}(t))return;return function(t){"number"!=typeof t&&"string"!=typeof t||(t={title:String(t),model:parseFloat(t)+"px"});return t.view={name:"span",styles:{"font-size":t.model}},o_(t)}(t)}(t)).filter(t=>!!t)}const n_={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"fs-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"fs-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"fs-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"fs-huge",priority:7}}},get one(){return{title:"1",model:"one",view:{name:"span",classes:"fs-1",priority:7}}},get two(){return{title:"2",model:"two",view:{name:"span",classes:"fs-2",priority:7}}},get three(){return{title:"3",model:"three",view:{name:"span",classes:"fs-3",priority:7}}},get four(){return{title:"4",model:"four",view:{name:"span",classes:"fs-4",priority:7}}},get five(){return{title:"5",model:"five",view:{name:"span",classes:"fs-5",priority:7}}},get six(){return{title:"6",model:"six",view:{name:"span",classes:"fs-6",priority:7}}},get seven(){return{title:"7",model:"seven",view:{name:"span",classes:"fs-7",priority:7}}},get eight(){return{title:"8",model:"eight",view:{name:"span",classes:"fs-8",priority:7}}},get nine(){return{title:"9",model:"nine",view:{name:"span",classes:"fs-9",priority:7}}},get ten(){return{title:"10",model:"ten",view:{name:"span",classes:"fs-10",priority:7}}},get eleven(){return{title:"11",model:"eleven",view:{name:"span",classes:"fs-11",priority:7}}},get twelve(){return{title:"12",model:"twelve",view:{name:"span",classes:"fs-12",priority:7}}},get thirteen(){return{title:"13",model:"thirteen",view:{name:"span",classes:"fs-13",priority:7}}},get fourteen(){return{title:"14",model:"fourteen",view:{name:"span",classes:"fs-14",priority:7}}},get fifteen(){return{title:"15",model:"fifteen",view:{name:"span",classes:"fs-15",priority:7}}},get sixteen(){return{title:"16",model:"sixteen",view:{name:"span",classes:"fs-16",priority:7}}},get seventeen(){return{title:"17",model:"seventeen",view:{name:"span",classes:"fs-17",priority:7}}},get eighteen(){return{title:"18",model:"eighteen",view:{name:"span",classes:"fs-18",priority:7}}},get nineteen(){return{title:"19",model:"nineteen",view:{name:"span",classes:"fs-19",priority:7}}},get twenty(){return{title:"20",model:"twenty",view:{name:"span",classes:"fs-20",priority:7}}},get twentyone(){return{title:"21",model:"twentyone",view:{name:"span",classes:"fs-21",priority:7}}},get twentytwo(){return{title:"22",model:"twentytwo",view:{name:"span",classes:"fs-22",priority:7}}},get twentythree(){return{title:"23",model:"twentythree",view:{name:"span",classes:"fs-23",priority:7}}},get twentyfour(){return{title:"24",model:"twentyfour",view:{name:"span",classes:"fs-24",priority:7}}},get twentyfive(){return{title:"25",model:"twentyfive",view:{name:"span",classes:"fs-25",priority:7}}},get twentysix(){return{title:"26",model:"twentysix",view:{name:"span",classes:"fs-26",priority:7}}},get twentyseven(){return{title:"27",model:"twentyseven",view:{name:"span",classes:"fs-27",priority:7}}},get twentyeight(){return{title:"28",model:"twentyeight",view:{name:"span",classes:"fs-28",priority:7}}},get twentynine(){return{title:"29",model:"twentynine",view:{name:"span",classes:"fs-29",priority:7}}},get thirty(){return{title:"30",model:"thirty",view:{name:"span",classes:"fs-30",priority:7}}},get thirtysix(){return{title:"36",model:"thirtysix",view:{name:"span",classes:"fs-36",priority:7}}}};function o_(t){return t.view.priority||(t.view.priority=7),t}const r_=["x-small","x-small","small","medium","large","x-large","xx-large","xxx-large"];class s_ extends ae{static get pluginName(){return"FontSizeEditing"}constructor(t){super(t),t.config.define("fontSize",{options:["tiny","small","big","huge","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty","twentyone","twentytwo","twentythree","twentyfour","twentyfive","twentysix","twentyseven","twentyeight","twentynine","thirty","thirtysix"],supportAllValues:!1})}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"fontSize"}),t.model.schema.setAttributeProperties("fontSize",{isFormatting:!0,copyOnEnter:!0});const e=t.config.get("fontSize.supportAllValues"),i=Wk("fontSize",i_(this.editor.config.get("fontSize.options")).filter(t=>t.model));e?(this._prepareAnyValueConverters(i),this._prepareCompatibilityConverter()):t.conversion.attributeToElement(i),t.commands.add("fontSize",new e_(t))}_prepareAnyValueConverters(t){const e=this.editor,i=t.model.values.filter(t=>{return!(e=String(t),ru.test(e)||function(t){return su.test(t)}(String(t)));var e});if(i.length)throw new a("font-size-invalid-use-of-named-presets",null,{presets:i});e.conversion.for("downcast").attributeToElement({model:"fontSize",view:(t,{writer:e})=>{if(t)return e.createAttributeElement("span",{style:"font-size:"+t},{priority:7})}}),e.conversion.for("upcast").elementToAttribute({model:{key:"fontSize",value:t=>t.getStyle("font-size")},view:{name:"span",styles:{"font-size":/.*/}}})}_prepareCompatibilityConverter(){this.editor.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{size:/^[+-]?\d{1,3}$/}},model:{key:"fontSize",value:t=>{const e=t.getAttribute("size"),i="-"===e[0]||"+"===e[0];let n=parseInt(e,10);i&&(n=3+n);const o=r_.length-1,r=Math.min(Math.max(n,0),o);return r_[r]}}})}}i(8520);class a_ extends ae{static get pluginName(){return"FontSizeUI"}init(){const t=this.editor,e=t.t,i=this._getLocalizedOptions(),n=t.commands.get("fontSize");t.ui.componentFactory.add("fontSize",o=>{const r=rh(o);return ah(r,function(t,e){const i=new gn;for(const n of t){const t={type:"button",model:new bh({commandName:"fontSize",commandParam:n.model,label:n.title,class:"ck-fontsize-option",withText:!0})};n.view&&n.view.styles&&t.model.set("labelStyle","font-size:"+n.view.styles["font-size"]),n.view&&n.view.classes&&t.model.set("class",`${t.model.class} ${n.view.classes}`),t.model.bind("isOn").to(e,"value",t=>t===n.model),i.add(t)}return i}(i,n)),r.buttonView.set({label:e("Font Size"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.816 11.5 7.038 4.785 4.261 11.5h5.555zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13zm7.55 2.279.779-.779.707.707-2.265 2.265-2.193-2.265.707-.707.765.765V4.825c0-.042 0-.083.002-.123l-.77.77-.707-.707L17.207 2.5l2.265 2.265-.707.707-.782-.782c.002.043.003.089.003.135v10.454z"/></svg>',tooltip:!0}),r.extendTemplate({attributes:{class:["ck-font-size-dropdown"]}}),r.bind("isEnabled").to(n),this.listenTo(r,"execute",e=>{t.execute(e.source.commandName,{value:e.source.commandParam}),t.editing.view.focus()}),r})}_getLocalizedOptions(){const t=this.editor,e=t.t,i={Default:e("Default"),Tiny:e("Tiny"),Small:e("Small"),Big:e("Big"),Huge:e("Huge"),XLarge:e("XLarge"),1:e("1"),2:e("2"),3:e("3"),4:e("4"),5:e("5"),6:e("6"),7:e("7"),8:e("8"),9:e("9"),10:e("10"),11:e("11"),12:e("12"),13:e("13"),14:e("14"),15:e("15"),16:e("16"),17:e("17"),18:e("18"),19:e("19"),20:e("20"),21:e("21"),22:e("22"),23:e("23"),24:e("24"),25:e("25"),26:e("26"),27:e("27"),28:e("28"),29:e("29"),30:e("30"),36:e("36")};return i_(t.config.get("fontSize").options).map(t=>{const e=i[t.title];return e&&e!=t.title&&(t=Object.assign({},t,{title:e})),t})}}class l_ extends ae{static get requires(){return[s_,a_]}static get pluginName(){return"FontSize"}}class c_ extends Hk{constructor(t){super(t,"fontColor")}}class d_ extends ae{static get pluginName(){return"FontColorEditing"}constructor(t){super(t),t.config.define("fontColor",{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{color:/[\s\S]+/}},model:{key:"fontColor",value:$k("color")}}),t.conversion.for("upcast").elementToAttribute({view:{name:"font",attributes:{color:/^#?\w+$/}},model:{key:"fontColor",value:t=>t.getAttribute("color")}}),t.conversion.for("downcast").attributeToElement({model:"fontColor",view:Gk("color")}),t.commands.add("fontColor",new c_(t)),t.model.schema.extend("$text",{allowAttributes:"fontColor"}),t.model.schema.setAttributeProperties("fontColor",{isFormatting:!0,copyOnEnter:!0})}}class h_ extends ae{constructor(t,{commandName:e,icon:i,componentName:n,dropdownLabel:o}){super(t),this.commandName=e,this.componentName=n,this.icon=i,this.dropdownLabel=o,this.columns=t.config.get(this.componentName+".columns"),this.colorTableView=void 0}init(){const t=this.editor,e=t.locale,i=e.t,n=t.commands.get(this.commandName);const o=function(t,e){const i=t.t,n={Black:i("Black"),"Dim grey":i("Dim grey"),Grey:i("Grey"),"Light grey":i("Light grey"),White:i("White"),Red:i("Red"),Orange:i("Orange"),Yellow:i("Yellow"),"Light green":i("Light green"),Green:i("Green"),Aquamarine:i("Aquamarine"),Turquoise:i("Turquoise"),"Light blue":i("Light blue"),Blue:i("Blue"),Purple:i("Purple")};return e.map(t=>{const e=n[t.label];return e&&e!=t.label&&(t.label=e),t})}(e,t.config.get(this.componentName).colors.map(Od).filter(t=>!!t)),r=t.config.get(this.componentName+".documentColors");t.ui.componentFactory.add(this.componentName,e=>{const s=rh(e);return this.colorTableView=function({dropdownView:t,colors:e,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r}){const s=t.locale,a=new qk(s,{colors:e,columns:i,removeButtonLabel:n,documentColorsLabel:o,documentColorsCount:r});return t.colorTableView=a,t.panelView.children.add(a),a.delegate("execute").to(t,"execute"),a}({dropdownView:s,colors:o.map(t=>({label:t.label,color:t.model,options:{hasBorder:t.hasBorder}})),columns:this.columns,removeButtonLabel:i("Remove color"),documentColorsLabel:0!==r?i("Document colors"):void 0,documentColorsCount:void 0===r?this.columns:r}),this.colorTableView.bind("selectedColor").to(n,"value"),s.buttonView.set({label:this.dropdownLabel,icon:this.icon,tooltip:!0}),s.extendTemplate({attributes:{class:"ck-color-ui-dropdown"}}),s.bind("isEnabled").to(n),s.on("execute",(e,i)=>{t.execute(this.commandName,i),t.editing.view.focus()}),s.on("change:isOpen",(e,i,n)=>{s.colorTableView.appendGrids(),n&&(0!==r&&this.colorTableView.updateDocumentColors(t.model,this.componentName),this.colorTableView.updateSelectedColors())}),s})}}class u_ extends h_{constructor(t){super(t,{commandName:"fontColor",componentName:"fontColor",icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z"/></svg>',dropdownLabel:(0,t.locale.t)("Font Color")})}static get pluginName(){return"FontColorUI"}}class m_ extends ae{static get requires(){return[d_,u_]}static get pluginName(){return"FontColor"}}class g_ extends Hk{constructor(t){super(t,"fontBackgroundColor")}}class f_ extends ae{static get pluginName(){return"FontBackgroundColorEditing"}constructor(t){super(t),t.config.define("fontBackgroundColor",{colors:[{color:"hsl(0, 0%, 0%)",label:"Black"},{color:"hsl(0, 0%, 30%)",label:"Dim grey"},{color:"hsl(0, 0%, 60%)",label:"Grey"},{color:"hsl(0, 0%, 90%)",label:"Light grey"},{color:"hsl(0, 0%, 100%)",label:"White",hasBorder:!0},{color:"hsl(0, 75%, 60%)",label:"Red"},{color:"hsl(30, 75%, 60%)",label:"Orange"},{color:"hsl(60, 75%, 60%)",label:"Yellow"},{color:"hsl(90, 75%, 60%)",label:"Light green"},{color:"hsl(120, 75%, 60%)",label:"Green"},{color:"hsl(150, 75%, 60%)",label:"Aquamarine"},{color:"hsl(180, 75%, 60%)",label:"Turquoise"},{color:"hsl(210, 75%, 60%)",label:"Light blue"},{color:"hsl(240, 75%, 60%)",label:"Blue"},{color:"hsl(270, 75%, 60%)",label:"Purple"}],columns:5}),t.data.addStyleProcessorRules(fu),t.conversion.for("upcast").elementToAttribute({view:{name:"span",styles:{"background-color":/[\s\S]+/}},model:{key:"fontBackgroundColor",value:$k("background-color")}}),t.conversion.for("downcast").attributeToElement({model:"fontBackgroundColor",view:Gk("background-color")}),t.commands.add("fontBackgroundColor",new g_(t)),t.model.schema.extend("$text",{allowAttributes:"fontBackgroundColor"}),t.model.schema.setAttributeProperties("fontBackgroundColor",{isFormatting:!0,copyOnEnter:!0})}}class p_ extends h_{constructor(t){super(t,{commandName:"fontBackgroundColor",componentName:"fontBackgroundColor",icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z"/></svg>',dropdownLabel:(0,t.locale.t)("Font Background Color")})}static get pluginName(){return"FontBackgroundColorUI"}}class w_ extends ae{static get requires(){return[f_,p_]}static get pluginName(){return"FontBackgroundColor"}}class b_ extends ae{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"underline"}),t.model.schema.setAttributeProperties("underline",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"underline",view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add("underline",new kg(t,"underline")),t.keystrokes.set("CTRL+U","underline")}}class k_ extends ae{static get pluginName(){return"UnderlineUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("underline",i=>{const n=t.commands.get("underline"),o=new Nd(i);return o.set({label:e("Underline"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z"/></svg>',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("underline"),t.editing.view.focus()}),o})}}class __ extends ae{static get pluginName(){return"StrikethroughEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"strikethrough"}),t.model.schema.setAttributeProperties("strikethrough",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"strikethrough",view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add("strikethrough",new kg(t,"strikethrough")),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}class v_ extends ae{static get pluginName(){return"StrikethroughUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("strikethrough",i=>{const n=t.commands.get("strikethrough"),o=new Nd(i);return o.set({label:e("Strikethrough"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z"/><path d="M3 10.5V9h14v1.5z"/></svg>',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("strikethrough"),t.editing.view.focus()}),o})}}const y_="code";class x_ extends ae{static get pluginName(){return"CodeEditing"}static get requires(){return[Rm]}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:y_}),t.model.schema.setAttributeProperties(y_,{isFormatting:!0,copyOnEnter:!1}),t.conversion.attributeToElement({model:y_,view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),t.commands.add(y_,new kg(t,y_)),t.plugins.get(Rm).registerAttribute(y_),Jm(t,y_,"code","ck-code_selected")}}i(8857);class A_ extends ae{static get pluginName(){return"CodeUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("code",i=>{const n=t.commands.get("code"),o=new Nd(i);return o.set({label:e("Code"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m12.5 5.7 5.2 3.9v1.3l-5.6 4c-.1.2-.3.2-.5.2-.3-.1-.6-.7-.6-1l.3-.4 4.7-3.5L11.5 7l-.2-.2c-.1-.3-.1-.6 0-.8.2-.2.5-.4.8-.4a.8.8 0 0 1 .4.1zm-5.2 0L2 9.6v1.3l5.6 4c.1.2.3.2.5.2.3-.1.7-.7.6-1 0-.1 0-.3-.2-.4l-5-3.5L8.2 7l.2-.2c.1-.3.1-.6 0-.8-.2-.2-.5-.4-.8-.4a.8.8 0 0 0-.3.1z"/></svg>',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("code"),t.editing.view.focus()}),o})}}class C_ extends ae{static get pluginName(){return"SubscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"subscript"}),t.model.schema.setAttributeProperties("subscript",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"subscript",view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),t.commands.add("subscript",new kg(t,"subscript"))}}class T_ extends ae{static get pluginName(){return"SubscriptUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("subscript",i=>{const n=t.commands.get("subscript"),o=new Nd(i);return o.set({label:e("Subscript"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m7.03 10.349 3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82zm8.147 7.829h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309z"/></svg>',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("subscript"),t.editing.view.focus()}),o})}}class E_ extends ae{static get pluginName(){return"SuperscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"superscript"}),t.model.schema.setAttributeProperties("superscript",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"superscript",view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),t.commands.add("superscript",new kg(t,"superscript"))}}class S_ extends ae{static get pluginName(){return"SuperscriptUI"}init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("superscript",i=>{const n=t.commands.get("superscript"),o=new Nd(i);return o.set({label:e("Superscript"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.677 8.678h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309zM7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82z"/></svg>',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("superscript"),t.editing.view.focus()}),o})}}function P_(t){if(t.is("$text")||t.is("$textProxy"))return t.data;let e="",i=null;for(const n of t.getChildren()){const t=P_(n);i&&i.is("element")&&(e+="\n"),e+=t,i=n}return e}const M_=["left","right","center","justify"];function I_(t){return M_.includes(t)}function L_(t,e){return"rtl"==e.contentLanguageDirection?"right"===t:"left"===t}function N_(t){const e=t.map(t=>{let e;return e="string"==typeof t?{name:t}:t,e}).filter(t=>{const e=!!M_.includes(t.name);return e||l("alignment-config-name-not-recognized",{option:t}),e}),i=e.filter(t=>!!t.className).length;if(i&&i<e.length)throw new a("alignment-config-classnames-are-missing",{configuredOptions:t});return e.forEach((e,i,n)=>{const o=n.slice(i+1);if(o.some(t=>t.name==e.name))throw new a("alignment-config-name-already-defined",{option:e,configuredOptions:t});if(e.className){if(o.some(t=>t.className==e.className))throw new a("alignment-config-classname-already-defined",{option:e,configuredOptions:t})}}),e}class R_ extends ce{refresh(){const t=this.editor.locale,e=Ws(this.editor.model.document.selection.getSelectedBlocks());this.isEnabled=!!e&&this._canBeAligned(e),this.isEnabled&&e.hasAttribute("alignment")?this.value=e.getAttribute("alignment"):this.value="rtl"===t.contentLanguageDirection?"right":"left"}execute(t={}){const e=this.editor,i=e.locale,n=e.model,o=n.document,r=t.value;n.change(t=>{const e=Array.from(o.selection.getSelectedBlocks()).filter(t=>this._canBeAligned(t)),n=e[0].getAttribute("alignment");L_(r,i)||n===r||!r?function(t,e){for(const i of t)e.removeAttribute("alignment",i)}(e,t):function(t,e,i){for(const n of t)e.setAttribute("alignment",i,n)}(e,t,r)})}_canBeAligned(t){return this.editor.model.schema.checkAttribute(t,"alignment")}}class O_ extends ae{static get pluginName(){return"AlignmentEditing"}constructor(t){super(t),t.config.define("alignment",{options:[...M_.map(t=>({name:t}))]})}init(){const t=this.editor,e=t.locale,i=t.model.schema,n=N_(t.config.get("alignment.options")).filter(t=>I_(t.name)&&!L_(t.name,e)),o=n.some(t=>!!t.className);i.extend("$block",{allowAttributes:"alignment"}),t.model.schema.setAttributeProperties("alignment",{isFormatting:!0}),o?t.conversion.attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map(t=>t.name)},view:{}};for(const i of t)e.view[i.name]={key:"class",value:i.className};return e}(n)):t.conversion.for("downcast").attributeToAttribute(function(t){const e={model:{key:"alignment",values:t.map(t=>t.name)},view:{}};for(const{name:i}of t)e.view[i]={key:"style",value:{"text-align":i}};return e}(n));const r=function(t){const e=[];for(const{name:i}of t)e.push({view:{key:"style",value:{"text-align":i}},model:{key:"alignment",value:i}});return e}(n);for(const e of r)t.conversion.for("upcast").attributeToAttribute(e);const s=function(t){const e=[];for(const{name:i}of t)e.push({view:{key:"align",value:i},model:{key:"alignment",value:i}});return e}(n);for(const e of s)t.conversion.for("upcast").attributeToAttribute(e);t.commands.add("alignment",new R_(t))}}const z_=new Map([["left",qc],["right",$c],["center",Wc],["justify",Gc]]);class D_ extends ae{get localizedOptionTitles(){const t=this.editor.t;return{left:t("Align left"),right:t("Align right"),center:t("Align center"),justify:t("Justify")}}static get pluginName(){return"AlignmentUI"}init(){const t=this.editor,e=t.ui.componentFactory,i=t.t,n=N_(t.config.get("alignment.options"));n.map(t=>t.name).filter(I_).forEach(t=>this._addButton(t)),e.add("alignment",t=>{const o=rh(t),r=n.map(t=>e.create("alignment:"+t.name));sh(o,r),o.buttonView.set({label:i("Text alignment"),tooltip:!0}),o.toolbarView.isVertical=!0,o.toolbarView.ariaLabel=i("Text alignment toolbar"),o.extendTemplate({attributes:{class:"ck-alignment-dropdown"}});const s="rtl"===t.contentLanguageDirection?z_.get("right"):z_.get("left");return o.buttonView.bind("icon").toMany(r,"isOn",(...t)=>{const e=t.findIndex(t=>t);return e<0?s:r[e].icon}),o.bind("isEnabled").toMany(r,"isEnabled",(...t)=>t.some(t=>t)),o})}_addButton(t){const e=this.editor;e.ui.componentFactory.add("alignment:"+t,i=>{const n=e.commands.get("alignment"),o=new Nd(i);return o.set({label:this.localizedOptionTitles[t],icon:z_.get(t),tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(n),o.bind("isOn").to(n,"value",e=>e===t),this.listenTo(o,"execute",()=>{e.execute("alignment",{value:t}),e.editing.view.focus()}),o})}}class V_ extends ku{}V_.builtinPlugins=[class extends ae{static get requires(){return[mm,Su,xm,wm,Im,ag]}static get pluginName(){return"Essentials"}},class extends ae{static get requires(){return[cg]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const t=this.editor.config.get("ckfinder.uploadUrl");t&&(this.editor.plugins.get(cg).createUploadAdapter=e=>new gg(e,t,this.editor.t))}},class extends ae{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats()}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&fg(this.editor,this,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&fg(this.editor,this,/^1[.|)]\s$/,"numberedList"),t.get("todoList")&&fg(this.editor,this,/^\[\s?\]\s$/,"todoList"),t.get("checkTodoList")&&fg(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){const t=this.editor.commands;if(t.get("bold")){const t=bg(this.editor,"bold");pg(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,t),pg(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,t)}if(t.get("italic")){const t=bg(this.editor,"italic");pg(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,t),pg(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,t)}if(t.get("code")){const t=bg(this.editor,"code");pg(this.editor,this,/(`)([^`]+)(`)$/g,t)}if(t.get("strikethrough")){const t=bg(this.editor,"strikethrough");pg(this.editor,this,/(~~)([^~]+)(~~)$/g,t)}}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter(t=>t.match(/^heading[1-6]$/)).forEach(e=>{const i=e[7],n=new RegExp(`^(#{${i}})\\s$`);fg(this.editor,this,n,()=>{if(!t.isEnabled||t.value===e)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&fg(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){this.editor.commands.get("codeBlock")&&fg(this.editor,this,/^```$/,"codeBlock")}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&fg(this.editor,this,/^---$/,"horizontalLine")}},class extends ae{static get requires(){return[_g,vg]}static get pluginName(){return"Bold"}},class extends ae{static get requires(){return[b_,k_]}static get pluginName(){return"Underline"}},class extends ae{static get requires(){return[__,v_]}static get pluginName(){return"Strikethrough"}},class extends ae{static get requires(){return[C_,T_]}static get pluginName(){return"Subscript"}},class extends ae{static get requires(){return[E_,S_]}static get pluginName(){return"Superscript"}},class extends ae{static get requires(){return[x_,A_]}static get pluginName(){return"Code"}},class extends ae{static get requires(){return[yg,xg]}static get pluginName(){return"Italic"}},class extends ae{static get requires(){return[Sg,Pg]}static get pluginName(){return"BlockQuote"}},class extends ae{static get pluginName(){return"CKFinder"}static get requires(){return["Image","Link","CKFinderUploadAdapter",Ng,Mg]}},class extends yn{static get pluginName(){return"CloudServices"}static get requires(){return[Pk]}init(){const t=this.context.config.get("cloudServices")||{};for(const e in t)this[e]=t[e];if(this._tokens=new Map,this.tokenUrl)return this.token=this.context.plugins.get("CloudServicesCore").createToken(this.tokenUrl),this._tokens.set(this.tokenUrl,this.token),this.token.init();this.token=null}registerTokenUrl(t){if(this._tokens.has(t))return Promise.resolve(this.getTokenFor(t));const e=this.context.plugins.get("CloudServicesCore").createToken(t);return this._tokens.set(t,e),e.init()}getTokenFor(t){const e=this._tokens.get(t);if(!e)throw new a("cloudservices-token-not-registered",this);return e}destroy(){super.destroy();for(const t of this._tokens.values())t.destroy()}},class extends ae{static get requires(){return[Rg,"Image","ImageUpload"]}static get pluginName(){return"EasyImage"}},class extends ae{static get requires(){return[Hg,Ug]}static get pluginName(){return"Heading"}},class extends ae{static get requires(){return[af,om,gf]}static get pluginName(){return"Image"}isImageWidget(t){return Zg(t)}},Tf,class extends ae{static get requires(){return[Nf,Rf]}static get pluginName(){return"ImageStyle"}},class extends ae{static get requires(){return[qg]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor,e=t.t;t.plugins.get(qg).register("image",{ariaLabel:e("Image toolbar"),items:t.config.get("image.toolbar")||[],getRelatedElement:ff})}},class extends ae{static get pluginName(){return"ImageUpload"}static get requires(){return[Gf,Vf,jf]}},Zf,class extends ae{static get requires(){return[Zf]}static get pluginName(){return"ImageResizeButtons"}constructor(t){super(t),this._resizeUnit=t.config.get("image.resizeUnit")}init(){const t=this.editor,e=t.config.get("image.resizeOptions"),i=t.commands.get("resizeImage"),n=e.filter(t=>Qf(t.name)).some(t=>!!t.className);this.bind("isEnabled").to(i);for(const t of e)this._registerImageResizeButton(t,n);this._registerImageResizeDropdown(e,n)}_registerImageResizeButton(t,e){const i=this.editor,{name:n,value:o,icon:r,className:s}=t;let l;l=e?n||null:o?o+this._resizeUnit:null,i.ui.componentFactory.add(n,n=>{const o=new Nd(n),s=i.commands.get("resizeImage"),c=this._getOptionLabelValue(t,!0);if(!Xf[r])throw new a("imageresizebuttons-missing-icon",i,t);return o.set({label:c,icon:Xf[r],tooltip:c,isToggleable:!0}),o.bind("isEnabled").to(this),o.bind("isOn").to(s,"value",tp(l)),this.listenTo(o,"execute",()=>{e?i.execute("resizeImage",{value:l}):i.execute("resizeImage",{width:l})}),o})}_registerImageResizeDropdown(t,e){const i=this.editor,n=i.t,o=t.find(t=>!t.value),r=e=>{const r=i.commands.get("resizeImage"),s=rh(e,Fd),a=s.buttonView;return a.set({tooltip:n("Resize image"),commandValue:o.value,icon:Xf.medium,isToggleable:!0,label:this._getOptionLabelValue(o),withText:!0,class:"ck-resize-image-button"}),a.bind("label").to(r,"value",t=>t&&t.width?t.width:this._getOptionLabelValue(o)),s.bind("isOn").to(r),s.bind("isEnabled").to(this),ah(s,this._getResizeDropdownListItemDefinitions(t,r)),s.listView.ariaLabel=n("Image resize list"),this.listenTo(s,"execute",t=>{i.execute(t.source.commandName,{width:t.source.commandValue}),i.editing.view.focus()}),s};i.ui.componentFactory.add("resizeImage",r),i.ui.componentFactory.add("imageResize",r)}_getOptionLabelValue(t,e){const i=this.editor.t;return t.label?t.label:e?t.value?i("Resize image to %0",t.value+this._resizeUnit):i("Resize image to the original size"):t.value?t.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(t,e){const i=new gn;return t.map(t=>{const n=t.value?t.value+this._resizeUnit:null,o={type:"button",model:new bh({commandName:"resizeImage",commandValue:n,label:this._getOptionLabelValue(t),withText:!0,icon:null})};o.model.bind("isOn").to(e,"value",tp(n)),i.add(o)}),i}},class extends ae{static get requires(){return[Qg]}static get pluginName(){return"ImageResizeHandles"}init(){const t=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(t),this._setupResizerCreator()}_setupResizerCreator(){const t=this.editor,e=t.editing.view;e.addObserver(Jg),this.listenTo(e.document,"imageLoaded",(i,n)=>{if(!n.target.matches("figure.image.ck-widget > img, figure.image.ck-widget > a > img"))return;const o=t.editing.view.domConverter.domToView(n.target).findAncestor("figure");let r=this.editor.plugins.get(Qg).getResizerByViewElement(o);if(r)return void r.redraw();const s=t.editing.mapper.toModelElement(o);r=t.plugins.get(Qg).attachTo({unit:t.config.get("image.resizeUnit"),modelElement:s,viewElement:o,editor:t,getHandleHost:t=>t.querySelector("img"),getResizeHost:t=>t,isCentered(){const t=s.getAttribute("imageStyle");return!t||"full"==t||"alignCenter"==t},onCommit(e){t.execute("resizeImage",{width:e})}}),r.on("updateSize",()=>{o.hasClass("image_resized")||e.change(t=>{t.addClass("image_resized",o)})}),r.bind("isEnabled").to(this)})}},class extends ae{static get pluginName(){return"Indent"}static get requires(){return[ep,op]}},class extends ae{static get requires(){return[Op,Fp,qp]}static get pluginName(){return"Link"}},class extends ae{static get requires(){return[t_,l_,m_,w_]}static get pluginName(){return"Font"}},class extends ae{static get requires(){return[pw,bw]}static get pluginName(){return"List"}},class extends ae{static get requires(){return[Tw,Mw,Sw,om]}static get pluginName(){return"MediaEmbed"}},jg,class extends ae{static get pluginName(){return"PasteFromOffice"}static get requires(){return[xu]}init(){const t=this.editor,e=t.editing.view.document,i=[];i.push(new Hw(e)),i.push(new zw(e)),t.plugins.get("ClipboardPipeline").on("inputTransformation",(t,e)=>{if(e.isTransformedWithPasteFromOffice)return;const n=e.dataTransfer.getData("text/html"),o=i.find(t=>t.isActive(n));o&&(o.execute(e),e.isTransformedWithPasteFromOffice=!0)},{priority:"high"})}},class extends ae{static get requires(){return[sk,ck,hk,bk,pk,uk,om]}static get pluginName(){return"Table"}},class extends ae{static get requires(){return[qg]}static get pluginName(){return"TableToolbar"}afterInit(){const t=this.editor,e=t.t,i=t.plugins.get(qg),n=t.config.get("table.contentToolbar"),o=t.config.get("table.tableToolbar");n&&i.register("tableContent",{ariaLabel:e("Table toolbar"),items:n,getRelatedElement:vk}),o&&i.register("table",{ariaLabel:e("Table toolbar"),items:o,getRelatedElement:_k})}},class extends ae{static get pluginName(){return"TextTransformation"}constructor(t){super(t),t.config.define("typing",{transformations:{include:qm}})}init(){const t=this.editor.model.document.selection;t.on("change:range",()=>{this.isEnabled=!t.anchor.parent.is("element","codeBlock")}),this._enableTransformationWatchers()}_enableTransformationWatchers(){const t=this.editor,e=t.model,i=t.plugins.get("Input"),n=function(t){const e=t.extra||[],i=t.remove||[],n=t=>!i.includes(t);return function(t){const e=new Set;for(const i of t)if(Um[i])for(const t of Um[i])e.add(t);else e.add(i);return Array.from(e)}(t.include.concat(e).filter(n)).filter(n).map(t=>Hm[t]||t).map(t=>({from:Wm(t.from),to:$m(t.to)}))}(t.config.get("typing.transformations")),o=new Nm(t.model,t=>{for(const e of n){if(e.from.test(t))return{normalizedTransformation:e}}});o.on("matched:data",(t,n)=>{if(!i.isInput(n.batch))return;const{from:o,to:r}=n.normalizedTransformation,s=o.exec(n.text),a=r(s.slice(1)),l=n.range;let c=s.index;e.enqueueChange(t=>{for(let i=1;i<s.length;i++){const n=s[i],o=a[i-1];if(null==o){c+=n.length;continue}const r=l.start.getShiftedBy(c),d=e.createRange(r,r.getShiftedBy(n.length)),h=Gm(r);e.insertContent(t.createText(o,h),d),c+=o.length}})}),o.bind("isEnabled").to(this)}},class extends ae{init(){const t=this.editor,e=t.editing.view,i=t.ui.componentFactory;this._defineSchema(),this._defineConverters(),e.addObserver(Kh),e.addObserver(Ik),i.add("MathText",t=>{const e=new Nd(t);return e.set({label:"Add Equations",icon:'<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 190 190" style="enable-background:new 0 0 190 190;" xml:space="preserve"> <path d="M3.53,0h182.94v44.78h-32.439V32.439H73.017L125.42,95l-52.403,62.561h81.015V145.22h32.439V190H3.53l79.574-95L3.53,0z"/> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> <g> </g> </svg>',withText:!1,tooltip:!0}),this.listenTo(e,"execute",()=>{this._loadIframeModal("btnClick")}),e}),this.listenTo(t.editing.view.document,"dblclick",(t,e)=>{const i=document.getElementById("mathModalIframe");"img"==e.domTarget.nodeName.toLowerCase()&&e.domTarget.hasAttribute("data-mathtext")&&!i&&this._loadIframeModal("dbClick",e),t.stop()},{priority:"highest"})}_loadIframeModal(t,e=""){const i=this,n=document.createElement("iframe");n.id="mathModalIframe",n.style="border: none;z-index:1001;border: 1px solid #ccc;\n --width: 500px;\n --height: 480px;\n position: fixed;\n width: var(--width);\n height: var(--height);\n left: calc( ( 100% - var(--width) ) / 2 );\n right: calc( ( 100% - var(--width) ) / 2 );\n top: calc( ( 100% - var(--height) ) / 2 );\n bottom: calc( ( 100% - var(--height) ) / 2 );\n border-radius: 5px;\n box-shadow: 3px 5px 4px #00000030;",n.src="assets/libs/mathEquation/plugin/mathModal/index.html",document.body.appendChild(n);const o=document.createElement("div");o.id="iframeBackdrop",o.style="background-color: #00000040;width: 100%;height: 100%;position: fixed;top: 0;left: 0;z-index: 1000;",o.onclick=function(){i._removeIframeModal()},document.body.appendChild(o),n.onload=function(){Lk=this,"btnClick"===t?i._defineEquationWriter():"dbClick"===t&&i._editorToPopupdoubleClickHandler(e.domTarget,e.domEvent)}}_removeIframeModal(){Lk.nextSibling.remove(),Lk.remove()}_defineSchema(){this.editor.model.schema.extend("image",{allowAttributes:["data-mathtext","advanced"]})}_defineConverters(){const t=this.editor.conversion;t.for("downcast").add(Mk("data-mathtext")),t.for("upcast").attributeToAttribute({view:{name:"img",key:"data-mathtext"},model:"data-mathtext"}),t.for("downcast").add(Mk("advanced")),t.for("upcast").attributeToAttribute({view:{name:"img",key:"advanced"},model:"advanced"})}_defineEquationWriter(t=""){const e=this.editor.model,i=e.document.selection,n={};n.detail=t;const o=n.onInit;n.onInit=t=>{o&&o(t),e.change(n=>{const o=n.createElement("image",{src:t.imgURL,"data-mathtext":encodeURIComponent(t.latexFrmla),advanced:t.advanced});this._removeIframeModal(),e.insertContent(o,i)})},Lk.contentWindow.mathModal.ckeditor.mathtext.modal(n)}_editorToPopupdoubleClickHandler(t,e){const i=decodeURIComponent(t.getAttribute("data-mathtext")),n=t.getAttribute("advanced");void 0!==e.stopPropagation?e.stopPropagation():e.returnValue=!1,this._defineEquationWriter({latex:i,advanced:n})}},class extends ae{static get requires(){return[Im]}static get pluginName(){return"SpecialCharacters"}constructor(t){super(t),this._characters=new Map,this._groups=new Map}init(){const t=this.editor,e=t.t,i=t.commands.get("input");t.ui.componentFactory.add("specialCharacters",n=>{const o=rh(n);let r;return o.buttonView.set({label:e("Special characters"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10 2.5a7.47 7.47 0 0 1 4.231 1.31 7.268 7.268 0 0 1 2.703 3.454 7.128 7.128 0 0 1 .199 4.353c-.39 1.436-1.475 2.72-2.633 3.677h2.013c0-.226.092-.443.254-.603a.876.876 0 0 1 1.229 0c.163.16.254.377.254.603v.853c0 .209-.078.41-.22.567a.873.873 0 0 1-.547.28l-.101.006h-4.695a.517.517 0 0 1-.516-.518v-1.265c0-.21.128-.398.317-.489a5.601 5.601 0 0 0 2.492-2.371 5.459 5.459 0 0 0 .552-3.693 5.53 5.53 0 0 0-1.955-3.2A5.71 5.71 0 0 0 10 4.206 5.708 5.708 0 0 0 6.419 5.46 5.527 5.527 0 0 0 4.46 8.663a5.457 5.457 0 0 0 .554 3.695 5.6 5.6 0 0 0 2.497 2.37.55.55 0 0 1 .317.49v1.264c0 .286-.23.518-.516.518H2.618a.877.877 0 0 1-.614-.25.845.845 0 0 1-.254-.603v-.853c0-.226.091-.443.254-.603a.876.876 0 0 1 1.228 0c.163.16.255.377.255.603h1.925c-1.158-.958-2.155-2.241-2.545-3.678a7.128 7.128 0 0 1 .199-4.352 7.268 7.268 0 0 1 2.703-3.455A7.475 7.475 0 0 1 10 2.5z"/></svg>',tooltip:!0}),o.bind("isEnabled").to(i),o.on("execute",(e,i)=>{t.execute("input",{text:i.character}),t.editing.view.focus()}),o.on("change:isOpen",()=>{r||(r=this._createDropdownPanelContent(n,o),o.panelView.children.add(r.navigationView),o.panelView.children.add(r.gridView),o.panelView.children.add(r.infoView)),r.infoView.set({character:null,name:null})}),o})}addItems(t,e){if("All"===t)throw new a('special-character-invalid-group-name: The name "All" is reserved and cannot be used.');const i=this._getGroup(t);for(const t of e)i.add(t.title),this._characters.set(t.title,t.character)}getGroups(){return this._groups.keys()}getCharactersForGroup(t){return"All"===t?new Set(this._characters.keys()):this._groups.get(t)}getCharacter(t){return this._characters.get(t)}_getGroup(t){return this._groups.has(t)||this._groups.set(t,new Set),this._groups.get(t)}_updateGrid(t,e){e.tiles.clear();const i=this.getCharactersForGroup(t);for(const t of i){const i=this.getCharacter(t);e.tiles.add(e.createTile(i,t))}}_createDropdownPanelContent(t,e){const i=[...this.getGroups()];i.unshift("All");const n=new Nk(t,i),o=new Rk(t),r=new Ok(t);return o.delegate("execute").to(e),o.on("tileHover",(t,e)=>{r.set(e)}),n.on("execute",()=>{this._updateGrid(n.currentGroupName,o)}),this._updateGrid(n.currentGroupName,o),{navigationView:n,gridView:o,infoView:r}}},class extends ae{static get requires(){return[Dk,Fk,Vk,jk,Bk]}},class extends ae{constructor(t){super(t),this.set("characters",0),this.set("words",0),Object.defineProperties(this,{characters:{get(){return this.characters=this._getCharacters()}},words:{get(){return this.words=this._getWords()}}}),this.set("_wordsLabel"),this.set("_charactersLabel"),this._config=t.config.get("wordCount")||{},this._outputView=void 0,this._wordsMatchRegExp=Uo.features.isRegExpUnicodePropertySupported?new RegExp("([\\p{L}\\p{N}]+\\S?)+","gu"):/([a-zA-Z0-9À-ž]+\S?)+/gu}static get pluginName(){return"WordCount"}init(){this.editor.model.document.on("change:data",sm(this._refreshStats.bind(this),250)),"function"==typeof this._config.onUpdate&&this.on("update",(t,e)=>{this._config.onUpdate(e)}),cn(this._config.container)&&this._config.container.appendChild(this.wordCountContainer)}destroy(){this._outputView&&(this._outputView.element.remove(),this._outputView.destroy()),super.destroy()}get wordCountContainer(){const t=this.editor,e=t.t,i=t.config.get("wordCount.displayWords"),n=t.config.get("wordCount.displayCharacters"),o=dd.bind(this,this),r=[];return this._outputView||(this._outputView=new cd,(i||void 0===i)&&(this.bind("_wordsLabel").to(this,"words",t=>e("Words: %0",t)),r.push({tag:"div",children:[{text:[o.to("_wordsLabel")]}],attributes:{class:"ck-word-count__words"}})),(n||void 0===n)&&(this.bind("_charactersLabel").to(this,"characters",t=>e("Characters: %0",t)),r.push({tag:"div",children:[{text:[o.to("_charactersLabel")]}],attributes:{class:"ck-word-count__characters"}})),this._outputView.setTemplate({tag:"div",attributes:{class:["ck","ck-word-count"]},children:r}),this._outputView.render()),this._outputView.element}_getCharacters(){return P_(this.editor.model.document.getRoot()).replace(/\n/g,"").length}_getWords(){return(P_(this.editor.model.document.getRoot()).match(this._wordsMatchRegExp)||[]).length}_refreshStats(){const t=this.words=this._getWords(),e=this.characters=this._getCharacters();this.fire("update",{words:t,characters:e})}},class extends ae{static get requires(){return[O_,D_]}static get pluginName(){return"Alignment"}}],V_.defaultConfig={toolbar:{items:["heading","|","bold","italic","alignment","underline","strikethrough","code","subscript","superscript","link","bulletedList","numberedList","|","outdent","indent","|","uploadImage","blockQuote","insertTable","mediaEmbed","undo","redo","MathText","specialCharacters"]},image:{resizeUnit:"%",resizeOptions:[{name:"resizeImage:25",value:"25",icon:"small",className:"resize-25"},{name:"resizeImage:50",value:"50",icon:"medium",className:"resize-50"},{name:"resizeImage:75",value:"75",icon:"large",className:"resize-75"},{name:"resizeImage:100",value:"100",icon:"full",className:"resize-100"},{name:"resizeImage:original",value:null,icon:"original",className:"resize-original"}],toolbar:["imageStyle:alignLeft","imageStyle:full","imageStyle:alignRight","|","resizeImage:25","resizeImage:50","resizeImage:75","resizeImage:100","resizeImage:original"],styles:["full","alignLeft","alignRight","alignCenter"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells"]},removePlugins:[Tf],language:"en"}})(),n=n.default})()}));
6
+ //# sourceMappingURL=ckeditor.js.map