commspliant-html-editor 0.0.1

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 (323) hide show
  1. package/README.md +315 -0
  2. package/dist/commspliant-html-editor.css +1 -0
  3. package/dist/components/Editor.d.ts +3 -0
  4. package/dist/components/Editor.d.ts.map +1 -0
  5. package/dist/components/HtmlSurface.d.ts +9 -0
  6. package/dist/components/HtmlSurface.d.ts.map +1 -0
  7. package/dist/components/VisualSurface.d.ts +13 -0
  8. package/dist/components/VisualSurface.d.ts.map +1 -0
  9. package/dist/core/blockFormat.d.ts +10 -0
  10. package/dist/core/blockFormat.d.ts.map +1 -0
  11. package/dist/core/blocks.d.ts +19 -0
  12. package/dist/core/blocks.d.ts.map +1 -0
  13. package/dist/core/bookmark.d.ts +10 -0
  14. package/dist/core/bookmark.d.ts.map +1 -0
  15. package/dist/core/cellProperties.d.ts +18 -0
  16. package/dist/core/cellProperties.d.ts.map +1 -0
  17. package/dist/core/clearFormatting.d.ts +2 -0
  18. package/dist/core/clearFormatting.d.ts.map +1 -0
  19. package/dist/core/clipboard.d.ts +9 -0
  20. package/dist/core/clipboard.d.ts.map +1 -0
  21. package/dist/core/commandTypes.d.ts +229 -0
  22. package/dist/core/commandTypes.d.ts.map +1 -0
  23. package/dist/core/commands.d.ts +5 -0
  24. package/dist/core/commands.d.ts.map +1 -0
  25. package/dist/core/cssLength.d.ts +13 -0
  26. package/dist/core/cssLength.d.ts.map +1 -0
  27. package/dist/core/customActions.d.ts +12 -0
  28. package/dist/core/customActions.d.ts.map +1 -0
  29. package/dist/core/fontFamily.d.ts +40 -0
  30. package/dist/core/fontFamily.d.ts.map +1 -0
  31. package/dist/core/fontSize.d.ts +25 -0
  32. package/dist/core/fontSize.d.ts.map +1 -0
  33. package/dist/core/fontSizeUnits.d.ts +29 -0
  34. package/dist/core/fontSizeUnits.d.ts.map +1 -0
  35. package/dist/core/image.d.ts +19 -0
  36. package/dist/core/image.d.ts.map +1 -0
  37. package/dist/core/imageProperties.d.ts +35 -0
  38. package/dist/core/imageProperties.d.ts.map +1 -0
  39. package/dist/core/imageResize.d.ts +18 -0
  40. package/dist/core/imageResize.d.ts.map +1 -0
  41. package/dist/core/imageSize.d.ts +23 -0
  42. package/dist/core/imageSize.d.ts.map +1 -0
  43. package/dist/core/indent.d.ts +7 -0
  44. package/dist/core/indent.d.ts.map +1 -0
  45. package/dist/core/inlineColor.d.ts +23 -0
  46. package/dist/core/inlineColor.d.ts.map +1 -0
  47. package/dist/core/inlineRange.d.ts +10 -0
  48. package/dist/core/inlineRange.d.ts.map +1 -0
  49. package/dist/core/link.d.ts +18 -0
  50. package/dist/core/link.d.ts.map +1 -0
  51. package/dist/core/lists.d.ts +12 -0
  52. package/dist/core/lists.d.ts.map +1 -0
  53. package/dist/core/marks.d.ts +18 -0
  54. package/dist/core/marks.d.ts.map +1 -0
  55. package/dist/core/page.d.ts +8 -0
  56. package/dist/core/page.d.ts.map +1 -0
  57. package/dist/core/pageProperties.d.ts +7 -0
  58. package/dist/core/pageProperties.d.ts.map +1 -0
  59. package/dist/core/paragraphBox.d.ts +82 -0
  60. package/dist/core/paragraphBox.d.ts.map +1 -0
  61. package/dist/core/paragraphProperties.d.ts +17 -0
  62. package/dist/core/paragraphProperties.d.ts.map +1 -0
  63. package/dist/core/rowProperties.d.ts +17 -0
  64. package/dist/core/rowProperties.d.ts.map +1 -0
  65. package/dist/core/selection.d.ts +22 -0
  66. package/dist/core/selection.d.ts.map +1 -0
  67. package/dist/core/table.d.ts +28 -0
  68. package/dist/core/table.d.ts.map +1 -0
  69. package/dist/core/tableProperties.d.ts +18 -0
  70. package/dist/core/tableProperties.d.ts.map +1 -0
  71. package/dist/core/textAlign.d.ts +9 -0
  72. package/dist/core/textAlign.d.ts.map +1 -0
  73. package/dist/hooks/useControllableState.d.ts +8 -0
  74. package/dist/hooks/useControllableState.d.ts.map +1 -0
  75. package/dist/i18n/LocaleProvider.d.ts +11 -0
  76. package/dist/i18n/LocaleProvider.d.ts.map +1 -0
  77. package/dist/i18n/en.d.ts +3 -0
  78. package/dist/i18n/en.d.ts.map +1 -0
  79. package/dist/i18n/es.d.ts +3 -0
  80. package/dist/i18n/es.d.ts.map +1 -0
  81. package/dist/i18n/types.d.ts +333 -0
  82. package/dist/i18n/types.d.ts.map +1 -0
  83. package/dist/icons/AlignCenterIcon.d.ts +3 -0
  84. package/dist/icons/AlignCenterIcon.d.ts.map +1 -0
  85. package/dist/icons/AlignJustifyIcon.d.ts +3 -0
  86. package/dist/icons/AlignJustifyIcon.d.ts.map +1 -0
  87. package/dist/icons/AlignLeftIcon.d.ts +3 -0
  88. package/dist/icons/AlignLeftIcon.d.ts.map +1 -0
  89. package/dist/icons/AlignRightIcon.d.ts +3 -0
  90. package/dist/icons/AlignRightIcon.d.ts.map +1 -0
  91. package/dist/icons/BoldIcon.d.ts +3 -0
  92. package/dist/icons/BoldIcon.d.ts.map +1 -0
  93. package/dist/icons/BookmarkIcon.d.ts +3 -0
  94. package/dist/icons/BookmarkIcon.d.ts.map +1 -0
  95. package/dist/icons/BulletListIcon.d.ts +3 -0
  96. package/dist/icons/BulletListIcon.d.ts.map +1 -0
  97. package/dist/icons/CellPropertiesIcon.d.ts +3 -0
  98. package/dist/icons/CellPropertiesIcon.d.ts.map +1 -0
  99. package/dist/icons/ClearFormattingIcon.d.ts +3 -0
  100. package/dist/icons/ClearFormattingIcon.d.ts.map +1 -0
  101. package/dist/icons/CloseIcon.d.ts +3 -0
  102. package/dist/icons/CloseIcon.d.ts.map +1 -0
  103. package/dist/icons/CommspliantShieldIcon.d.ts +3 -0
  104. package/dist/icons/CommspliantShieldIcon.d.ts.map +1 -0
  105. package/dist/icons/CustomActionIcon.d.ts +3 -0
  106. package/dist/icons/CustomActionIcon.d.ts.map +1 -0
  107. package/dist/icons/FontColorIcon.d.ts +3 -0
  108. package/dist/icons/FontColorIcon.d.ts.map +1 -0
  109. package/dist/icons/FontPropertiesIcon.d.ts +3 -0
  110. package/dist/icons/FontPropertiesIcon.d.ts.map +1 -0
  111. package/dist/icons/FullscreenIcon.d.ts +3 -0
  112. package/dist/icons/FullscreenIcon.d.ts.map +1 -0
  113. package/dist/icons/HighlightColorIcon.d.ts +3 -0
  114. package/dist/icons/HighlightColorIcon.d.ts.map +1 -0
  115. package/dist/icons/HtmlIcon.d.ts +3 -0
  116. package/dist/icons/HtmlIcon.d.ts.map +1 -0
  117. package/dist/icons/ImageIcon.d.ts +3 -0
  118. package/dist/icons/ImageIcon.d.ts.map +1 -0
  119. package/dist/icons/IndentIcon.d.ts +3 -0
  120. package/dist/icons/IndentIcon.d.ts.map +1 -0
  121. package/dist/icons/ItalicIcon.d.ts +3 -0
  122. package/dist/icons/ItalicIcon.d.ts.map +1 -0
  123. package/dist/icons/LinkIcon.d.ts +3 -0
  124. package/dist/icons/LinkIcon.d.ts.map +1 -0
  125. package/dist/icons/MenuIcon.d.ts +3 -0
  126. package/dist/icons/MenuIcon.d.ts.map +1 -0
  127. package/dist/icons/NumberedListIcon.d.ts +3 -0
  128. package/dist/icons/NumberedListIcon.d.ts.map +1 -0
  129. package/dist/icons/OpenIcon.d.ts +3 -0
  130. package/dist/icons/OpenIcon.d.ts.map +1 -0
  131. package/dist/icons/OutdentIcon.d.ts +3 -0
  132. package/dist/icons/OutdentIcon.d.ts.map +1 -0
  133. package/dist/icons/PagePropertiesIcon.d.ts +3 -0
  134. package/dist/icons/PagePropertiesIcon.d.ts.map +1 -0
  135. package/dist/icons/ParagraphPropertiesIcon.d.ts +3 -0
  136. package/dist/icons/ParagraphPropertiesIcon.d.ts.map +1 -0
  137. package/dist/icons/PlusIcon.d.ts +3 -0
  138. package/dist/icons/PlusIcon.d.ts.map +1 -0
  139. package/dist/icons/PrintIcon.d.ts +3 -0
  140. package/dist/icons/PrintIcon.d.ts.map +1 -0
  141. package/dist/icons/RedoIcon.d.ts +3 -0
  142. package/dist/icons/RedoIcon.d.ts.map +1 -0
  143. package/dist/icons/RowPropertiesIcon.d.ts +3 -0
  144. package/dist/icons/RowPropertiesIcon.d.ts.map +1 -0
  145. package/dist/icons/SaveIcon.d.ts +3 -0
  146. package/dist/icons/SaveIcon.d.ts.map +1 -0
  147. package/dist/icons/StrikethroughIcon.d.ts +3 -0
  148. package/dist/icons/StrikethroughIcon.d.ts.map +1 -0
  149. package/dist/icons/TableColumnIcon.d.ts +3 -0
  150. package/dist/icons/TableColumnIcon.d.ts.map +1 -0
  151. package/dist/icons/TableIcon.d.ts +3 -0
  152. package/dist/icons/TableIcon.d.ts.map +1 -0
  153. package/dist/icons/TableRowIcon.d.ts +3 -0
  154. package/dist/icons/TableRowIcon.d.ts.map +1 -0
  155. package/dist/icons/UnderlineIcon.d.ts +3 -0
  156. package/dist/icons/UnderlineIcon.d.ts.map +1 -0
  157. package/dist/icons/UndoIcon.d.ts +3 -0
  158. package/dist/icons/UndoIcon.d.ts.map +1 -0
  159. package/dist/icons/VisualIcon.d.ts +3 -0
  160. package/dist/icons/VisualIcon.d.ts.map +1 -0
  161. package/dist/icons/index.d.ts +41 -0
  162. package/dist/icons/index.d.ts.map +1 -0
  163. package/dist/icons/types.d.ts +4 -0
  164. package/dist/icons/types.d.ts.map +1 -0
  165. package/dist/index.cjs +92 -0
  166. package/dist/index.d.ts +3 -0
  167. package/dist/index.d.ts.map +1 -0
  168. package/dist/index.js +13150 -0
  169. package/dist/modules/contextMenu/ContextMenu.d.ts +13 -0
  170. package/dist/modules/contextMenu/ContextMenu.d.ts.map +1 -0
  171. package/dist/modules/contextMenu/commands.d.ts +3 -0
  172. package/dist/modules/contextMenu/commands.d.ts.map +1 -0
  173. package/dist/modules/contextMenu/index.d.ts +4 -0
  174. package/dist/modules/contextMenu/index.d.ts.map +1 -0
  175. package/dist/modules/file/catalog.d.ts +3 -0
  176. package/dist/modules/file/catalog.d.ts.map +1 -0
  177. package/dist/modules/file/commands.d.ts +3 -0
  178. package/dist/modules/file/commands.d.ts.map +1 -0
  179. package/dist/modules/file/fileDialogs.d.ts +3 -0
  180. package/dist/modules/file/fileDialogs.d.ts.map +1 -0
  181. package/dist/modules/file/index.d.ts +4 -0
  182. package/dist/modules/file/index.d.ts.map +1 -0
  183. package/dist/modules/file/printHtml.d.ts +2 -0
  184. package/dist/modules/file/printHtml.d.ts.map +1 -0
  185. package/dist/modules/format/ColorField.d.ts +11 -0
  186. package/dist/modules/format/ColorField.d.ts.map +1 -0
  187. package/dist/modules/format/ColorPicker.d.ts +13 -0
  188. package/dist/modules/format/ColorPicker.d.ts.map +1 -0
  189. package/dist/modules/format/ColorSelect.d.ts +16 -0
  190. package/dist/modules/format/ColorSelect.d.ts.map +1 -0
  191. package/dist/modules/format/CustomParagraphStyleDialog.d.ts +21 -0
  192. package/dist/modules/format/CustomParagraphStyleDialog.d.ts.map +1 -0
  193. package/dist/modules/format/FontColorSelect.d.ts +3 -0
  194. package/dist/modules/format/FontColorSelect.d.ts.map +1 -0
  195. package/dist/modules/format/FontFamilyList.d.ts +16 -0
  196. package/dist/modules/format/FontFamilyList.d.ts.map +1 -0
  197. package/dist/modules/format/FontFamilySelect.d.ts +15 -0
  198. package/dist/modules/format/FontFamilySelect.d.ts.map +1 -0
  199. package/dist/modules/format/FontPropertiesDialog.d.ts +24 -0
  200. package/dist/modules/format/FontPropertiesDialog.d.ts.map +1 -0
  201. package/dist/modules/format/FontPropertiesFields.d.ts +12 -0
  202. package/dist/modules/format/FontPropertiesFields.d.ts.map +1 -0
  203. package/dist/modules/format/FontSizeCombobox.d.ts +13 -0
  204. package/dist/modules/format/FontSizeCombobox.d.ts.map +1 -0
  205. package/dist/modules/format/FontSizeSelect.d.ts +3 -0
  206. package/dist/modules/format/FontSizeSelect.d.ts.map +1 -0
  207. package/dist/modules/format/HighlightColorSelect.d.ts +4 -0
  208. package/dist/modules/format/HighlightColorSelect.d.ts.map +1 -0
  209. package/dist/modules/format/LengthField.d.ts +12 -0
  210. package/dist/modules/format/LengthField.d.ts.map +1 -0
  211. package/dist/modules/format/PagePropertiesDialog.d.ts +14 -0
  212. package/dist/modules/format/PagePropertiesDialog.d.ts.map +1 -0
  213. package/dist/modules/format/ParagraphPropertiesDialog.d.ts +12 -0
  214. package/dist/modules/format/ParagraphPropertiesDialog.d.ts.map +1 -0
  215. package/dist/modules/format/ParagraphPropertiesFields.d.ts +13 -0
  216. package/dist/modules/format/ParagraphPropertiesFields.d.ts.map +1 -0
  217. package/dist/modules/format/ParagraphStyleList.d.ts +22 -0
  218. package/dist/modules/format/ParagraphStyleList.d.ts.map +1 -0
  219. package/dist/modules/format/ParagraphStyleSelect.d.ts +4 -0
  220. package/dist/modules/format/ParagraphStyleSelect.d.ts.map +1 -0
  221. package/dist/modules/format/ShadowFields.d.ts +8 -0
  222. package/dist/modules/format/ShadowFields.d.ts.map +1 -0
  223. package/dist/modules/format/catalog.d.ts +3 -0
  224. package/dist/modules/format/catalog.d.ts.map +1 -0
  225. package/dist/modules/format/colorModel.d.ts +22 -0
  226. package/dist/modules/format/colorModel.d.ts.map +1 -0
  227. package/dist/modules/format/colorPalette.d.ts +3 -0
  228. package/dist/modules/format/colorPalette.d.ts.map +1 -0
  229. package/dist/modules/format/commands.d.ts +4 -0
  230. package/dist/modules/format/commands.d.ts.map +1 -0
  231. package/dist/modules/format/fontDialog.d.ts +9 -0
  232. package/dist/modules/format/fontDialog.d.ts.map +1 -0
  233. package/dist/modules/format/fontSize.d.ts +2 -0
  234. package/dist/modules/format/fontSize.d.ts.map +1 -0
  235. package/dist/modules/format/index.d.ts +3 -0
  236. package/dist/modules/format/index.d.ts.map +1 -0
  237. package/dist/modules/format/pageDialog.d.ts +9 -0
  238. package/dist/modules/format/pageDialog.d.ts.map +1 -0
  239. package/dist/modules/format/paragraphDialog.d.ts +9 -0
  240. package/dist/modules/format/paragraphDialog.d.ts.map +1 -0
  241. package/dist/modules/history/catalog.d.ts +3 -0
  242. package/dist/modules/history/catalog.d.ts.map +1 -0
  243. package/dist/modules/history/commands.d.ts +4 -0
  244. package/dist/modules/history/commands.d.ts.map +1 -0
  245. package/dist/modules/history/history.d.ts +15 -0
  246. package/dist/modules/history/history.d.ts.map +1 -0
  247. package/dist/modules/history/index.d.ts +5 -0
  248. package/dist/modules/history/index.d.ts.map +1 -0
  249. package/dist/modules/insert/BookmarkDialog.d.ts +9 -0
  250. package/dist/modules/insert/BookmarkDialog.d.ts.map +1 -0
  251. package/dist/modules/insert/ImageDialog.d.ts +12 -0
  252. package/dist/modules/insert/ImageDialog.d.ts.map +1 -0
  253. package/dist/modules/insert/ImagePropertiesDialog.d.ts +13 -0
  254. package/dist/modules/insert/ImagePropertiesDialog.d.ts.map +1 -0
  255. package/dist/modules/insert/ImagePropertiesFields.d.ts +11 -0
  256. package/dist/modules/insert/ImagePropertiesFields.d.ts.map +1 -0
  257. package/dist/modules/insert/ImageResizeOverlay.d.ts +7 -0
  258. package/dist/modules/insert/ImageResizeOverlay.d.ts.map +1 -0
  259. package/dist/modules/insert/ImageSizeField.d.ts +10 -0
  260. package/dist/modules/insert/ImageSizeField.d.ts.map +1 -0
  261. package/dist/modules/insert/LinkDialog.d.ts +22 -0
  262. package/dist/modules/insert/LinkDialog.d.ts.map +1 -0
  263. package/dist/modules/insert/catalog.d.ts +3 -0
  264. package/dist/modules/insert/catalog.d.ts.map +1 -0
  265. package/dist/modules/insert/commands.d.ts +4 -0
  266. package/dist/modules/insert/commands.d.ts.map +1 -0
  267. package/dist/modules/insert/imagePropertiesDialog.d.ts +9 -0
  268. package/dist/modules/insert/imagePropertiesDialog.d.ts.map +1 -0
  269. package/dist/modules/insert/index.d.ts +3 -0
  270. package/dist/modules/insert/index.d.ts.map +1 -0
  271. package/dist/modules/table/CellPropertiesDialog.d.ts +10 -0
  272. package/dist/modules/table/CellPropertiesDialog.d.ts.map +1 -0
  273. package/dist/modules/table/CellPropertiesFields.d.ts +8 -0
  274. package/dist/modules/table/CellPropertiesFields.d.ts.map +1 -0
  275. package/dist/modules/table/RowPropertiesDialog.d.ts +10 -0
  276. package/dist/modules/table/RowPropertiesDialog.d.ts.map +1 -0
  277. package/dist/modules/table/RowPropertiesFields.d.ts +8 -0
  278. package/dist/modules/table/RowPropertiesFields.d.ts.map +1 -0
  279. package/dist/modules/table/TableDialog.d.ts +9 -0
  280. package/dist/modules/table/TableDialog.d.ts.map +1 -0
  281. package/dist/modules/table/TablePropertiesDialog.d.ts +10 -0
  282. package/dist/modules/table/TablePropertiesDialog.d.ts.map +1 -0
  283. package/dist/modules/table/TablePropertiesFields.d.ts +8 -0
  284. package/dist/modules/table/TablePropertiesFields.d.ts.map +1 -0
  285. package/dist/modules/table/catalog.d.ts +3 -0
  286. package/dist/modules/table/catalog.d.ts.map +1 -0
  287. package/dist/modules/table/commands.d.ts +4 -0
  288. package/dist/modules/table/commands.d.ts.map +1 -0
  289. package/dist/modules/table/index.d.ts +3 -0
  290. package/dist/modules/table/index.d.ts.map +1 -0
  291. package/dist/modules/view/catalog.d.ts +3 -0
  292. package/dist/modules/view/catalog.d.ts.map +1 -0
  293. package/dist/modules/view/commands.d.ts +4 -0
  294. package/dist/modules/view/commands.d.ts.map +1 -0
  295. package/dist/modules/view/index.d.ts +3 -0
  296. package/dist/modules/view/index.d.ts.map +1 -0
  297. package/dist/toolbar/EditorToolbar.d.ts +14 -0
  298. package/dist/toolbar/EditorToolbar.d.ts.map +1 -0
  299. package/dist/toolbar/IconNav.d.ts +12 -0
  300. package/dist/toolbar/IconNav.d.ts.map +1 -0
  301. package/dist/toolbar/MenuBar.d.ts +18 -0
  302. package/dist/toolbar/MenuBar.d.ts.map +1 -0
  303. package/dist/toolbar/ScrollChevronIcons.d.ts +4 -0
  304. package/dist/toolbar/ScrollChevronIcons.d.ts.map +1 -0
  305. package/dist/toolbar/Tooltip.d.ts +11 -0
  306. package/dist/toolbar/Tooltip.d.ts.map +1 -0
  307. package/dist/toolbar/defaultCatalog.d.ts +4 -0
  308. package/dist/toolbar/defaultCatalog.d.ts.map +1 -0
  309. package/dist/toolbar/defaultLayout.d.ts +3 -0
  310. package/dist/toolbar/defaultLayout.d.ts.map +1 -0
  311. package/dist/toolbar/index.d.ts +7 -0
  312. package/dist/toolbar/index.d.ts.map +1 -0
  313. package/dist/toolbar/overflow.d.ts +7 -0
  314. package/dist/toolbar/overflow.d.ts.map +1 -0
  315. package/dist/toolbar/resolveChrome.d.ts +12 -0
  316. package/dist/toolbar/resolveChrome.d.ts.map +1 -0
  317. package/dist/toolbar/types.d.ts +65 -0
  318. package/dist/toolbar/types.d.ts.map +1 -0
  319. package/dist/toolbar/useIconNavOverflow.d.ts +9 -0
  320. package/dist/toolbar/useIconNavOverflow.d.ts.map +1 -0
  321. package/dist/types.d.ts +186 -0
  322. package/dist/types.d.ts.map +1 -0
  323. package/package.json +53 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,92 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),s=require("react"),le=require("react-dom");function jo({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"align-center",children:[o.jsx("path",{d:"M4 6h16"}),o.jsx("path",{d:"M7 12h10"}),o.jsx("path",{d:"M4 18h16"})]})}function Ta({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"align-justify",children:[o.jsx("path",{d:"M4 6h16"}),o.jsx("path",{d:"M4 12h16"}),o.jsx("path",{d:"M4 18h16"})]})}function No({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"align-left",children:[o.jsx("path",{d:"M4 6h16"}),o.jsx("path",{d:"M4 12h10"}),o.jsx("path",{d:"M4 18h16"})]})}function Lo({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"align-right",children:[o.jsx("path",{d:"M4 6h16"}),o.jsx("path",{d:"M10 12h10"}),o.jsx("path",{d:"M4 18h16"})]})}function Ts({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"bold",children:[o.jsx("path",{d:"M7 5h6.5a3.5 3.5 0 0 1 0 7H7z"}),o.jsx("path",{d:"M7 12h7.5a3.5 3.5 0 0 1 0 7H7z"}),o.jsx("path",{d:"M7 5v14"})]})}function Ms({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"bookmark",children:o.jsx("path",{d:"M6 4h12a1 1 0 0 1 1 1v16l-7-4-7 4V5a1 1 0 0 1 1-1z"})})}function Ma({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"bullet-list",children:[o.jsx("path",{d:"M9 6h12"}),o.jsx("path",{d:"M9 12h12"}),o.jsx("path",{d:"M9 18h12"}),o.jsx("circle",{cx:"4.5",cy:"6",r:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"4.5",cy:"12",r:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"4.5",cy:"18",r:"1.2",fill:"currentColor",stroke:"none"})]})}function Rs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"cell-properties",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),o.jsx("path",{d:"M3 12h18"}),o.jsx("path",{d:"M12 4v16"}),o.jsx("rect",{x:"12.5",y:"4.5",width:"8",height:"7",fill:"currentColor",stroke:"none",opacity:"0.25"})]})}function _s({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"clear-formatting",children:[o.jsx("path",{d:"M4 5h12"}),o.jsx("path",{d:"M10 5v8"}),o.jsx("path",{d:"m14 15 6 6"}),o.jsx("path",{d:"m20 15-6 6"})]})}function He({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"close",children:[o.jsx("path",{d:"M18 6L6 18"}),o.jsx("path",{d:"M6 6l12 12"})]})}function Fs({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 616.23 542.09",width:"45",height:"40","aria-hidden":"true","data-icon":"commspliant-shield",children:o.jsxs("g",{transform:"translate(129.79555,688.75474)",children:[o.jsx("path",{fill:"#334E68",d:"m 92.41768,-326.31771 a 0.3,0.3 0 0 1 0.48,0.05 q 5.04,8.55 15.34,22.7 5.5,7.55 11.93,14.77 11.84,13.3 12.69,14.16 11.29,11.41 26.17,23.51 c 4.66,3.79 9.84,8.83 15.07,12.39 18.71,12.72 34.7,23.08 52.84,31.97 q 15.29,7.5 16.67,8.12 5.77,2.59 8.73,3.54 c 1.66,0.54 2.74,-0.25 4.17,-0.93 q 27.98,-13.14 49.38,-25.74 21.15,-12.47 41.94,-29.56 1.28,-1.05 12.72,-11.11 c 11.11,-9.78 22.59,-22.12 30.48,-31.94 q 10.87,-13.52 16.67,-23.55 c 3.7,-6.41 7.66,-12.73 10.29,-18.63 q 9.41,-21.06 13.67,-35.18 8.51,-28.19 9.46,-61.31 0.96,-33.72 0.31,-64.55 -0.09,-4.4 2.81,-7.26 5.42,-5.33 7.5,-7.38 c 6.37,-6.25 11.24,-13.29 18.07,-19.23 q 7.84,-6.84 14.74,-16.11 0.14,-0.19 0.39,-0.15 0.61,0.1 0.52,0.7 -0.37,2.69 -0.35,4.95 c 0.37,45.85 0.81,76.35 -0.95,110.71 q -0.66,12.89 -2.71,28.52 -2.84,21.57 -7.17,36.03 -2.02,6.75 -5.4,17.5 c -5.64,17.94 -13.55,35.09 -23.13,50.9 q -1.72,2.86 -12.91,19.22 c -10.81,15.81 -22.83,29.61 -35.06,41.83 q -4.06,4.07 -17.47,16.38 -9.77,8.98 -18.52,15.14 -19.27,13.56 -32.8,21.84 c -8.27,5.05 -17.73,9.75 -26.22,14.7 q -3.66,2.13 -10.7,5.47 -27.19,12.89 -34.36,16.16 -3.92,1.79 -7.2,0.44 -3.47,-1.43 -11.46,-4.85 c -9.07,-3.89 -16.98,-8.27 -24.9,-11.89 -8.4,-3.84 -18.78,-9.89 -28.06,-15.14 q -43.25,-24.5 -76.54,-56.22 -11.98,-11.41 -24.94,-26.56 -12.76,-14.92 -26.13,-34.48 a 0.43,0.44 56.8 0 1 0.13,-0.61 c 12.12,-7.82 23.12,-17.82 33.81,-29.32 z"}),o.jsx("path",{fill:"#334E68",d:"m -128.82232,-375.77771 a 0.96,0.96 0 0 1 -0.8,-1.51 l 28.86,-41.82 a 3.24,3.2 6.2 0 1 1.45,-1.15 q 0.69,-0.27 3.64,-0.32 15.37,-0.27 46.58,-0.45 12.44,-0.07 19.69,-1.84 c 26.32,-6.42 44.55,-29.39 47.76,-55.67 q 1.05,-8.54 0.87,-20.92 c -0.55,-39.95 0.23,-77.15 -0.1,-117.57 a 0.94,0.95 85.4 0 1 0.81,-0.94 c 35.7,-5.08 70.26,-12.78 104.11,-23.86 q 9.4,-3.07 22.28,-7.05 8.6,-2.65 22.1,-7.58 18.33,-6.69 43.02,-16.74 23.04,-9.38 35.12,-15.34 1.17,-0.58 3.29,0.39 c 14.96,6.81 34.27,13.39 42.79,16.68 q 14.24,5.5 27.59,10.33 23.24,8.41 27.7,10.07 2.01,0.75 9.42,3.41 5.07,1.82 9.47,3.13 40.54,12.1 57.07,16.58 2.54,0.68 4.26,0.82 a 0.48,0.48 0 0 1 0.32,0.79 l -33.68,37.82 a 0.58,0.58 0 0 1 -0.68,0.13 q -3.43,-1.67 -5.84,-2.43 -8.74,-2.79 -47.37,-15.63 -8.92,-2.96 -17.51,-6.16 c -17.92,-6.67 -32.21,-11.74 -65.83,-24.24 -2.89,-1.08 -8.28,-3.56 -11.57,-2.33 -11.44,4.27 -27.67,11.24 -40.6,15.93 q -8.12,2.94 -26.33,9.89 c -21.86,8.35 -43.57,14.34 -67.25,21.47 q -20.07,6.03 -48.78,11.52 a 0.71,0.7 84.6 0 0 -0.57,0.7 q 0.1,95.52 0.1,95.57 c -0.53,30.1 -14.63,58.57 -36,79.25 -10.83,10.49 -23.5,17.98 -37.57,23.68 -10.14,4.1 -18.76,4.57 -31.18,4.79 q -3.1,0.05 -86.64,0.6 z"}),o.jsx("path",{fill:"#C9A227",d:"m 169.86768,-422.45771 q 0.04,-0.4 0.24,-0.59 c 3.41,-3.3 5.96,-6.99 9.56,-10.8 q 10.13,-10.72 15.25,-16.65 2.05,-2.38 5.38,-4.3 a 0.68,0.69 53.4 0 1 0.84,0.12 l 49.51,50.92 a 1.06,1.06 0 0 0 1.52,0 q 17.38,-17.8 26.4,-27.94 c 6.36,-7.14 15.04,-14.76 20.1,-20.56 q 10.29,-11.81 17.14,-18.67 7.41,-7.41 17.44,-18.41 13.85,-15.18 23.56,-24.67 c 3.68,-3.59 5.5,-6.17 8.54,-10.08 2.38,-3.06 4.42,-4.87 8.16,-8.31 6.16,-5.66 10.48,-11.49 16.47,-17.22 6.29,-6.03 12.87,-14.23 18.87,-20.24 q 5.56,-5.56 13.49,-14.45 c 6.79,-7.6 12.13,-13.02 18.46,-19.66 4.83,-5.06 9.88,-11.22 15.21,-16.21 a 1.91,1.91 0 0 1 1.3,-0.51 h 28.15 a 0.83,0.83 0 0 1 0.83,0.82 q 0.28,14.3 0.03,31.53 c -0.07,4.93 -1.9,6.19 -5.19,9.51 -5.86,5.92 -12.79,12.1 -18.21,18.16 q -6.63,7.4 -16.64,16.86 c -2.68,2.53 -6.31,6.91 -8.5,9.17 -8.76,9.01 -14.72,16.05 -22.55,23.36 q -1.37,1.28 -9.09,9.75 -4.93,5.41 -24.32,25.01 c -9.96,10.07 -19.18,20.45 -27.83,28.95 q -11.52,11.33 -20.29,20.96 c -19.16,21.01 -41.14,42.93 -58.64,61.61 q -10.7,11.42 -22.21,22 a 1.97,1.94 24 0 1 -1.38,0.52 q -1.9,-0.06 -3.83,-2.08 c -19.01,-19.93 -45.74,-44.39 -67.08,-67.5 q -5.05,-5.47 -10.42,-9.75 -0.31,-0.24 -0.27,-0.65 z"}),o.jsx("path",{fill:"#5B7B9C",d:"m 351.58768,-544.71771 a 0.41,0.41 0 0 1 0.17,0.69 q -15.9,15.29 -29.64,31.76 a 1.16,1.19 33.7 0 1 -1.44,0.3 c -5.87,-3 -10.72,-6.65 -16.97,-10.42 -17.2,-10.37 -38.83,-14.16 -59.18,-13.16 -12.15,0.6 -23.67,3.62 -34.54,8.11 -5.15,2.13 -9.08,4.66 -14.86,8.63 q -14.63,10.05 -22.02,17.75 -6.98,7.27 -17.47,22.45 c -5.11,7.4 -9.03,15.18 -13.55,23.27 q -5.09,9.08 -10.38,20.93 c -4.39,9.81 -8.53,17.45 -13.72,27.5 q -6,11.58 -11.58,19.91 c -6.74,10.09 -11.32,17.91 -17.68,26.12 -4.94,6.38 -10.92,12.4 -15.22,17.55 q -3.48,4.18 -9.33,9.51 c -20.66,18.83 -45.19,33.15 -72.9,38.24 q -15.17,2.79 -26.21,3.08 -22.84,0.6 -52.01,0.23 a 0.29,0.29 0 0 1 -0.24,-0.43 c 6.02,-10.58 11.85,-19.61 23.29,-37.61 q 2.27,-3.58 5.02,-6.38 a 3.39,3.4 24.3 0 1 2.63,-1 q 16.4,1.07 32.77,-1.23 c 15.39,-2.16 29.33,-7.66 42.1,-15.59 q 4.42,-2.75 14.17,-10.6 3.58,-2.89 14.27,-14.03 6.08,-6.33 9.69,-12.1 c 3.25,-5.19 7.59,-10.59 11.55,-17.24 q 16.77,-28.19 29.52,-56.84 c 4.49,-10.08 8.7,-16.87 15.5,-28.37 q 5.49,-9.29 14.18,-21.09 5.94,-8.07 12.61,-14.76 12.65,-12.7 13.8,-13.72 5.51,-4.84 19.01,-13.66 49.89,-32.59 109.07,-20.31 7.95,1.65 15.41,4.34 14.58,5.25 20.68,8.05 c 10.41,4.78 21.11,12.36 31.15,19.28 a 2.65,2.62 70.1 0 0 0.78,0.37 z"}),o.jsx("path",{fill:"#5B7B9C",d:"m 143.16768,-394.65771 q 0.46,0.11 0.45,0.6 -0.03,2.2 0.62,4.89 2.72,11.27 9.81,22.88 7.25,11.89 15.4,22.7 c 4.71,6.26 10.61,13.06 17.11,18.9 9.38,8.42 15.79,14.58 25.02,21.29 q 13.29,9.65 15.1,10.72 10.62,6.29 20.67,12.58 1.94,1.22 4,1.86 a 2.56,2.59 42.2 0 0 1.81,-0.1 c 7.1,-3.08 12.92,-6.7 21.76,-11.78 q 6.63,-3.81 11.42,-7.45 c 4.56,-3.47 9.98,-6.63 14.83,-10.52 q 18.45,-14.82 32.58,-32 6.8,-8.28 11.17,-16.16 c 7.76,-14.01 13.11,-25.52 16.26,-40.82 1.49,-7.23 1.56,-11.99 2.41,-21.26 a 3.66,3.67 70 0 1 1.06,-2.26 q 9.34,-9.27 20.72,-20.12 c 6.47,-6.15 12.23,-13.51 18.33,-19.07 a 0.67,0.67 0 0 1 1.11,0.43 q 1.92,19.96 1.77,37.52 -0.18,19.95 -4.43,40.76 -3.4,16.65 -11.34,32.24 -0.55,1.09 -4.75,9.06 -3,5.69 -5.08,8.85 c -9.56,14.55 -19.75,27.73 -31.99,39.39 q -7.6,7.24 -9.98,9.35 -10.58,9.37 -24.17,18.04 c -4.91,3.14 -9.19,7.11 -13.77,9.89 q -24.03,14.58 -42.68,23.19 -3.32,1.53 -8.02,-0.31 -1.97,-0.78 -11.41,-5.19 c -8.92,-4.17 -16.04,-8.65 -24.58,-13.03 q -6.75,-3.47 -13.06,-7.8 -18.87,-12.96 -21.03,-14.68 -15.47,-12.4 -29.21,-26.05 -5.39,-5.35 -13.86,-16.13 -6.45,-8.2 -14.56,-19.38 c -3.42,-4.72 -6.19,-10.2 -9.49,-14.45 a 1.33,1.32 44.2 0 1 -0.03,-1.59 c 5.8,-7.95 10.64,-13.7 15.23,-21.14 q 8.66,-14.03 14.39,-23.68 a 0.38,0.39 23.4 0 1 0.41,-0.17 z"})]})})}function Is({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"custom-action",children:[o.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"}),o.jsx("path",{d:"M9 8.5c0-1 .7-1.5 1.5-1.5S12 7.5 12 8.5c0 1.2-3 1.2-3 3.2"}),o.jsx("path",{d:"M10.5 14v.5"}),o.jsx("path",{d:"M15 10v4"}),o.jsx("path",{d:"M13 12h4"})]})}function Bs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"font-color",children:[o.jsx("path",{d:"M6 18L12 4l6 14"}),o.jsx("path",{d:"M8.5 13h7"})]})}function Hs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"font-properties",children:[o.jsx("path",{d:"M4 20h4"}),o.jsx("path",{d:"M6 20V6"}),o.jsx("path",{d:"M4 6h4"}),o.jsx("path",{d:"M12 20V9"}),o.jsx("path",{d:"M12 9h8"}),o.jsx("path",{d:"M16 9v11"})]})}function Os({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"fullscreen",children:[o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}),o.jsx("path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}),o.jsx("path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}),o.jsx("path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"})]})}function zs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"highlight-color",children:[o.jsx("path",{d:"M15.5 4.5l4 4-9 9H6.5v-4.5z"}),o.jsx("path",{d:"M13.5 6.5l4 4"}),o.jsx("path",{d:"M4 20h8"})]})}function Ks({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"html",children:[o.jsx("path",{d:"M8 8l-4 4 4 4"}),o.jsx("path",{d:"M16 8l4 4-4 4"})]})}function Ra({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"image",children:[o.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),o.jsx("circle",{cx:"8.5",cy:"10",r:"1.5"}),o.jsx("path",{d:"m21 15-4.5-4.5L7 20"})]})}function $s({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"indent",children:[o.jsx("path",{d:"M4 6h16"}),o.jsx("path",{d:"M12 12h8"}),o.jsx("path",{d:"M4 18h16"}),o.jsx("path",{d:"M4 9l4 3-4 3"})]})}function Us({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"italic",children:[o.jsx("path",{d:"M10 4h9"}),o.jsx("path",{d:"M5 20h9"}),o.jsx("path",{d:"M14 4L8 20"})]})}function Ws({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"link",children:[o.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),o.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})}function qs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"menu",children:[o.jsx("path",{d:"M4 6h16"}),o.jsx("path",{d:"M4 12h16"}),o.jsx("path",{d:"M4 18h16"})]})}function _a({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"numbered-list",children:[o.jsx("path",{d:"M10 6h11"}),o.jsx("path",{d:"M10 12h11"}),o.jsx("path",{d:"M10 18h11"}),o.jsx("path",{d:"M4 5v3h2"}),o.jsx("path",{d:"M4 11h2l-2 2h2"}),o.jsx("path",{d:"M4 19h2"}),o.jsx("path",{d:"M4 17h2v2"})]})}function Gs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"open",children:[o.jsx("path",{d:"M3 7h6l2 2h10v3"}),o.jsx("path",{d:"M3 10l2.2 9h13.6L21 10H3z"})]})}function Vs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"outdent",children:[o.jsx("path",{d:"M4 6h16"}),o.jsx("path",{d:"M12 12h8"}),o.jsx("path",{d:"M4 18h16"}),o.jsx("path",{d:"M8 9l-4 3 4 3"})]})}function Xs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"page-properties",children:[o.jsx("path",{d:"M6 3h8l6 6v12H6z"}),o.jsx("path",{d:"M14 3v6h6"})]})}function Ys({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"paragraph-properties",children:[o.jsx("path",{d:"M13 4H9a4 4 0 0 0 0 8h2"}),o.jsx("path",{d:"M15 4v16"}),o.jsx("path",{d:"M11 4v16"})]})}function Js({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"plus",children:[o.jsx("path",{d:"M12 5v14"}),o.jsx("path",{d:"M5 12h14"})]})}function Zs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"print",children:[o.jsx("path",{d:"M6 9V3h12v6"}),o.jsx("path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"}),o.jsx("path",{d:"M6 14h12v8H6z"})]})}function Qs({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"redo",children:[o.jsx("path",{d:"M21 10H10a5 5 0 0 0 0 10h1"}),o.jsx("path",{d:"M17 6l4 4-4 4"})]})}function ec({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"row-properties",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),o.jsx("path",{d:"M3 10h18"}),o.jsx("path",{d:"M3 16h18"}),o.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"5",fill:"currentColor",stroke:"none",opacity:"0.25"})]})}function tc({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"save",children:[o.jsx("path",{d:"M5 3h11l5 5v13H5V3z"}),o.jsx("path",{d:"M15 3v6H9V3"}),o.jsx("path",{d:"M8 21v-7h8v7"})]})}function Vr({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"table-column",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),o.jsx("path",{d:"M3 10h18"}),o.jsx("path",{d:"M3 16h18"}),o.jsx("path",{d:"M9 4v16"}),o.jsx("path",{d:"M15 4v16"}),o.jsx("rect",{x:"9.5",y:"5",width:"5",height:"14",fill:"currentColor",stroke:"none",opacity:"0.25"})]})}function Bi({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"table",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),o.jsx("path",{d:"M3 10h18"}),o.jsx("path",{d:"M3 16h18"}),o.jsx("path",{d:"M9 4v16"}),o.jsx("path",{d:"M15 4v16"})]})}function Xr({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"table-row",children:[o.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"1"}),o.jsx("path",{d:"M3 10h18"}),o.jsx("path",{d:"M3 16h18"}),o.jsx("rect",{x:"4",y:"10.5",width:"16",height:"5",fill:"currentColor",stroke:"none",opacity:"0.25"})]})}function nc({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"strikethrough",children:[o.jsx("path",{d:"M6 7.5C6 5.5 8 4 12 4s6 1.5 6 3.5-1.8 2.8-6 3.5"}),o.jsx("path",{d:"M6 16.5C6 18.5 8 20 12 20s6-1.5 6-3.5c0-1-.5-1.8-1.8-2.5"}),o.jsx("path",{d:"M4 12h16"})]})}function rc({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"underline",children:[o.jsx("path",{d:"M7 4v8a5 5 0 0 0 10 0V4"}),o.jsx("path",{d:"M5 20h14"})]})}function oc({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"undo",children:[o.jsx("path",{d:"M3 10h11a5 5 0 0 1 0 10h-1"}),o.jsx("path",{d:"M7 6L3 10l4 4"})]})}function ic({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"visual",children:[o.jsx("path",{d:"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z"}),o.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}const be="---";function Qe(e){return e===be}function an(e){return typeof e=="object"&&e!==null&&"submenu"in e}const To=new Set(["save","open","print","undo","redo","link","bookmark","visual","html","fullscreen","bold","italic","underline","strikethrough","clearFormatting","fontSize","fontFamily","paragraphStyle","fontProperties","paragraphProperties","pageProperties","imageProperties","fontColor","highlightColor","alignLeft","alignCenter","alignRight","alignJustify","indent","outdent","bulletList","numberedList"]),ac=new Set(["file","edit","insert","view","format"]),Fa="custom",Ia="custom";function Ba(e){return`custom:${e}`}function lc(e){return e==="menu"||e==="both"}function sc(e){return e==="toolbar"||e==="both"}function Ha(e){return e.map(t=>an(t)?{submenu:t.submenu,items:Ha(t.items)}:t)}function cc(e){return{menus:e.menus.map(t=>({id:t.id,items:Ha(t.items)})),iconGroups:e.iconGroups.map(t=>({id:t.id,items:[...t.items]}))}}function Oa(e){return Qe(e)?!0:an(e)?e.items.every(Oa):To.has(e)}function za(e,t){for(const n of e)if(n===t||an(n)&&za(n.items,t))return!0;return!1}function uc(e){const t=e.tooltip??e.label;return{id:e.id,command:Ba(e.id),icon:e.icon??Is,label:e.label,ariaLabel:e.label,tooltip:t}}function dc(e,t,n,r){if(e.menus[n])r&&!e.menus[n].label&&!ac.has(n)&&(e.menus[n]={...e.menus[n],label:r,ariaLabel:r});else if(n===Fa&&!r)e.menus[n]={id:n,labelKey:"menuCustom",ariaKey:"menuCustomAria"};else{const i=r??n;e.menus[n]={id:n,label:i,ariaLabel:i}}t.menus.some(i=>i.id===n)||t.menus.push({id:n,items:[]})}function mc(e,t,n){e.groups[n]||(n===Ia?e.groups[n]={id:n,labelKey:"toolbarGroupCustom"}:e.groups[n]={id:n,label:n}),t.iconGroups.some(r=>r.id===n)||t.iconGroups.push({id:n,items:[]})}function fc(e,t,n){var a,l;const r={menus:{...t.menus},submenus:{...t.submenus},groups:{...t.groups},items:{...t.items}},i=cc(n);for(const c of e??[])if(!(To.has(c.id)||Qe(c.id))){if(r.items[c.id]=uc(c),lc(c.showIn)){const m=((a=c.menu)==null?void 0:a.id)??Fa;dc(r,i,m,(l=c.menu)==null?void 0:l.label);const p=i.menus.find(b=>b.id===m);if(p&&!za(p.items,c.id)){const b=p.items[p.items.length-1];b!==void 0&&!Qe(b)&&p.items.every(Oa)&&p.items.push(be),p.items.push(c.id)}}if(sc(c.showIn)){const m=c.toolbarGroup??Ia;mc(r,i,m);const p=i.iconGroups.find(b=>b.id===m);p&&!p.items.includes(c.id)&&p.items.push(c.id)}}return{catalog:r,layout:i}}function pc(e,t){const n={};for(const r of e??[])To.has(r.id)||Qe(r.id)||(n[Ba(r.id)]=()=>r.onAction(t()));return n}function hc(e){return{cut:async()=>{await e.cut()},copy:async()=>{await e.copy()},deleteSelection:()=>{e.deleteSelection()}}}function Mo(e,t){const n=e[t];n==null||n()}const Ro={modeVisual:"Visual",modeHtml:"HTML",modeVisualAria:"Switch to visual mode",modeHtmlAria:"Switch to HTML mode",modeFullscreen:"Full screen",modeFullscreenAria:"Toggle full screen",exitFullscreenAria:"Exit full screen",visualEditorAria:"Visual editor",htmlEditorAria:"HTML editor",menuFile:"File",menuFileAria:"File menu",menuEdit:"Edit",menuEditAria:"Edit menu",menuInsert:"Insert",menuInsertAria:"Insert menu",menuView:"View",menuViewAria:"View menu",menuFormat:"Format",menuFormatAria:"Format menu",menuFont:"Fonts",menuFontAria:"Fonts submenu",menuParagraph:"Paragraph",menuParagraphAria:"Paragraph submenu",menuParagraphStyles:"Paragraph styles",menuParagraphStylesAria:"Paragraph styles submenu",menuPage:"Page",menuPageAria:"Page submenu",menuImage:"Image",menuImageAria:"Image properties",menuInsertRow:"Row",menuInsertRowAria:"Insert or delete row",menuInsertColumn:"Column",menuInsertColumnAria:"Insert or delete column",menuTable:"Table",menuTableAria:"Table properties",menuCustom:"Custom",menuCustomAria:"Custom menu",menuHamburgerAria:"Open menu",menuCloseAria:"Close menu",menuOverlayAria:"Editor menu",brandMarkAria:"CommsPliant HTML editor",commandSave:"Save",commandSaveAria:"Save as HTML file",commandOpen:"Open",commandOpenAria:"Open HTML file",commandPrint:"Print",commandPrintAria:"Print document",commandUndo:"Undo",commandUndoAria:"Undo",commandRedo:"Redo",commandRedoAria:"Redo",commandCut:"Cut",commandCutAria:"Cut",commandCopy:"Copy",commandCopyAria:"Copy",commandDelete:"Delete",commandDeleteAria:"Delete",commandLink:"Link",commandLinkAria:"Link",commandBookmark:"Bookmark",commandBookmarkAria:"Bookmark",commandImage:"Image",commandImageAria:"Insert image",commandImageProperties:"Image properties…",commandImagePropertiesAria:"Image properties",commandTable:"Table",commandTableAria:"Insert table",commandTableProperties:"Table properties…",commandTablePropertiesAria:"Table properties",commandCellProperties:"Cell properties…",commandCellPropertiesAria:"Cell properties",commandRowProperties:"Row properties…",commandRowPropertiesAria:"Row properties",commandInsertRowBelow:"Add below",commandInsertRowBelowAria:"Add row below",commandInsertRowBefore:"Add before",commandInsertRowBeforeAria:"Add row before",commandDeleteRow:"Delete",commandDeleteRowAria:"Delete row",commandInsertColumnAfter:"Add after",commandInsertColumnAfterAria:"Add column after",commandInsertColumnBefore:"Add before",commandInsertColumnBeforeAria:"Add column before",commandDeleteColumn:"Delete",commandDeleteColumnAria:"Delete column",contextMenuAria:"Editor context menu",commandBold:"Bold",commandBoldAria:"Bold",commandItalic:"Italic",commandItalicAria:"Italic",commandUnderline:"Underline",commandUnderlineAria:"Underline",commandStrikethrough:"Strikethrough",commandStrikethroughAria:"Strikethrough",commandClearFormatting:"Reset formatting",commandClearFormattingAria:"Reset formatting",commandFontSize:"Font size",commandFontSizeAria:"Font size",commandFontSizeUnitAria:"Font size unit",commandFontFamily:"Font",commandFontFamilyAria:"Font family",commandFontProperties:"Font properties…",commandFontPropertiesAria:"Font properties",commandParagraphProperties:"Paragraph properties…",commandParagraphPropertiesAria:"Paragraph properties",commandPageProperties:"Page properties…",commandPagePropertiesAria:"Page properties",commandFontColor:"Font color",commandFontColorAria:"Font color",commandHighlightColor:"Highlight color",commandHighlightColorAria:"Highlight color",commandParagraphStyle:"Styles",commandParagraphStyleAria:"Paragraph styles",commandAlignLeft:"Align left",commandAlignLeftAria:"Align left",commandAlignCenter:"Align center",commandAlignCenterAria:"Align center",commandAlignRight:"Align right",commandAlignRightAria:"Align right",commandAlignJustify:"Justify",commandAlignJustifyAria:"Justify",commandIndent:"Increase indent",commandIndentAria:"Increase indent",commandOutdent:"Decrease indent",commandOutdentAria:"Decrease indent",commandBulletList:"Bullet list",commandBulletListAria:"Bullet list",commandNumberedList:"Numbered list",commandNumberedListAria:"Numbered list",styleParagraph:"Paragraph",styleHeading1:"Heading 1",styleHeading2:"Heading 2",styleHeading3:"Heading 3",styleHeading4:"Heading 4",styleHeading5:"Heading 5",styleHeading6:"Heading 6",styleAddNew:"Add new",styleAddNewAria:"Add new paragraph style",customStyleDialogAddTitle:"Add paragraph style",customStyleDialogEditTitle:"Edit paragraph style",customStyleDialogTabFont:"Font",customStyleDialogTabParagraph:"Paragraph",customStyleDialogName:"Name",customStyleDialogDelete:"Delete",customStyleDialogDeleteConfirm:"Delete this paragraph style?",customStyleDialogCloseAria:"Close",customStyleLoading:"Loading paragraph styles",colorAutomatic:"Automatic",colorNone:"No color",colorCustom:"Custom color",colorHex:"Hex",colorRgbR:"R",colorRgbG:"G",colorRgbB:"B",colorPickFromScreen:"Pick from screen",colorRecent:"Recent colors",fontDialogTitle:"Font properties",fontDialogTabGeneral:"General",fontDialogFamily:"Font",fontFamilyDefault:"Default",fontDialogSize:"Size",fontDialogUnit:"Unit",fontDialogStyle:"Style",fontDialogOk:"OK",fontDialogCancel:"Cancel",linkDialogTitle:"Insert link",linkDialogTabLink:"Link",linkDialogTabBookmark:"Bookmark",linkDialogHref:"URL",linkDialogHoverTitle:"Title",linkDialogTargetBlank:"Open in a new tab",linkDialogTextDecorationNone:"No underline",linkDialogHover:"On hover",linkDialogHoverColor:"Color",linkDialogHoverColorField:"Hover color",linkDialogHoverHtml:"HTML",linkDialogHoverHtmlAria:"Custom hover HTML",linkDialogBookmark:"Bookmark",linkDialogBookmarkEmpty:"No bookmarks in this document.",linkDialogSelect:"Select",bookmarkDialogTitle:"Insert bookmark",bookmarkDialogName:"Bookmark name",bookmarkDialogHelp:"Start with a letter. Use only letters, numbers, hyphens, and underscores. Must be unique in the document.",bookmarkDialogHelpAria:"Bookmark name format",bookmarkDialogCloseAria:"Close",bookmarkDialogErrorEmpty:"Enter a bookmark name.",bookmarkDialogErrorInvalid:"Start with a letter. Use only letters, numbers, hyphens, and underscores.",bookmarkDialogErrorDuplicate:"A bookmark with this name already exists.",imageDialogTitle:"Insert image",imageDialogSource:"Source",imageDialogFile:"File",imageDialogChooseFile:"Choose file",imageDialogUrl:"Image URL",imageDialogAlt:"Alt text",imageDialogTitleField:"Title",imageDialogCloseAria:"Close",imageDialogErrorEmpty:"Choose a file or enter an image URL.",imageDialogErrorInvalid:"Enter a valid image URL.",imageDialogErrorType:"Use a JPEG, PNG, GIF, WebP, BMP, or AVIF image.",imageDialogErrorTooLarge:"Choose an image smaller than 2 MB.",imagePropertiesDialogTitle:"Image properties",imagePropertiesDialogCloseAria:"Close",imagePropertiesTabAlignment:"Alignment",imagePropertiesTabBorder:"Border & margin",imagePropertiesTabAdvanced:"Advanced",imagePropertiesTabHover:"Hover",imagePropertiesSize:"Size",imagePropertiesSizeMode:"Size mode",imagePropertiesSizeWidth:"Width only",imagePropertiesSizeHeight:"Height only",imagePropertiesSizeLock:"Lock together",imagePropertiesWidth:"Width",imagePropertiesHeight:"Height",imagePropertiesWidthAria:"Image width",imagePropertiesHeightAria:"Image height",imagePropertiesSizeUnitAria:"Image size unit",imagePropertiesFit:"Fit",imagePropertiesFitDefault:"Default",imagePropertiesFitFill:"Fill",imagePropertiesFitContain:"Contain",imagePropertiesFitCover:"Cover",imagePropertiesFitNoneValue:"None",imagePropertiesFitScaleDown:"Scale down",imagePropertiesPosition:"Position",imagePropertiesPositionDefault:"Default",imagePropertiesPositionCenter:"Center",imagePropertiesPositionTop:"Top",imagePropertiesPositionBottom:"Bottom",imagePropertiesPositionLeft:"Left",imagePropertiesPositionRight:"Right",imagePropertiesPositionTopLeft:"Top left",imagePropertiesPositionTopRight:"Top right",imagePropertiesPositionBottomLeft:"Bottom left",imagePropertiesPositionBottomRight:"Bottom right",imagePropertiesRotation:"Rotation",imagePropertiesRotationUnit:"deg",imagePropertiesHoverCss:"Hover CSS",imagePropertiesHoverCssAria:"Custom hover CSS",imagePropertiesHoverHelp:"CSS applied when the pointer is over the image.",imageResizeHandleEastAria:"Resize image width, keep aspect ratio",imageResizeHandleSouthAria:"Resize image height, keep aspect ratio",imageResizeHandleSouthEastAria:"Resize image freely",tableDialogTitle:"Insert table",tableDialogCloseAria:"Close",tableDialogRows:"Rows",tableDialogColumns:"Columns",tableDialogSize:"Size",tableDialogGridAria:"Table size grid",tableDialogInsert:"Insert",tablePropertiesDialogTitle:"Table properties",tablePropertiesDialogCloseAria:"Close",tablePropertiesCollapse:"Border collapse",tablePropertiesCollapseCollapse:"Collapse",tablePropertiesCollapseSeparate:"Separate",tablePropertiesSpacing:"Border spacing",tablePropertiesWidth:"Width",cellPropertiesDialogTitle:"Cell properties",cellPropertiesDialogCloseAria:"Close",cellPropertiesColor:"Text color",cellPropertiesVerticalAlign:"Vertical align",cellPropertiesVerticalAlignDefault:"Default",cellPropertiesVerticalAlignTop:"Top",cellPropertiesVerticalAlignMiddle:"Middle",cellPropertiesVerticalAlignBottom:"Bottom",cellPropertiesVerticalAlignBaseline:"Baseline",cellPropertiesWidth:"Width",rowPropertiesDialogTitle:"Row properties",rowPropertiesDialogCloseAria:"Close",rowPropertiesHeight:"Height",paragraphDialogTitle:"Paragraph properties",pageDialogTitle:"Page properties",paragraphDialogTabBorder:"Border",paragraphDialogTabBackground:"Background",paragraphDialogAlignment:"Alignment",paragraphDialogLists:"Lists",paragraphDialogSpacing:"Spacing",paragraphDialogMargin:"Margin",paragraphDialogPadding:"Padding",paragraphDialogLineHeight:"Line height",paragraphDialogLineHeightNormal:"Normal",paragraphDialogLineHeightUnitless:"×",paragraphDialogLinkSides:"Same on all sides",paragraphDialogSideTop:"Top",paragraphDialogSideRight:"Right",paragraphDialogSideBottom:"Bottom",paragraphDialogSideLeft:"Left",paragraphDialogBorder:"Border",paragraphDialogBorderStyle:"Style",paragraphDialogBorderWidth:"Width",paragraphDialogBorderColor:"Color",paragraphDialogBorderRadius:"Corner radius",paragraphDialogBoxShadow:"Box shadow",paragraphDialogShadowOffsetX:"Offset X",paragraphDialogShadowOffsetY:"Offset Y",paragraphDialogShadowBlur:"Blur",paragraphDialogShadowSpread:"Spread",paragraphDialogShadowColor:"Color",paragraphDialogShadowInset:"Inset",paragraphDialogLengthUnitAria:"Unit",paragraphDialogBorderStyleNone:"None",paragraphDialogBorderStyleSolid:"Solid",paragraphDialogBorderStyleDotted:"Dotted",paragraphDialogBorderStyleDashed:"Dashed",paragraphDialogBorderStyleDouble:"Double",paragraphDialogBorderStyleGroove:"Groove",paragraphDialogBorderStyleRidge:"Ridge",paragraphDialogBorderStyleInset:"Inset",paragraphDialogBorderStyleOutset:"Outset",paragraphDialogBackgroundColor:"Background color",paragraphDialogOpacity:"Opacity",fontSizeUnitPt:"pt",fontSizeUnitPx:"px",fontSizeUnitEm:"em",fontSizeUnitRem:"rem",fontSizeUnitPercent:"%",fontSizeUnitPc:"pc",toolbarAria:"Formatting toolbar",toolbarGroupFile:"File",toolbarGroupPrint:"Print",toolbarGroupEdit:"Edit",toolbarGroupInsert:"Insert",toolbarGroupFont:"Fonts",toolbarGroupAlign:"Align",toolbarGroupParagraph:"Paragraph",toolbarGroupView:"View",toolbarGroupCustom:"Custom",toolbarScrollLeftAria:"Scroll toolbar left",toolbarScrollRightAria:"Scroll toolbar right"},gc={modeVisual:"Visual",modeHtml:"HTML",modeVisualAria:"Cambiar al modo visual",modeHtmlAria:"Cambiar al modo HTML",modeFullscreen:"Pantalla completa",modeFullscreenAria:"Activar o desactivar pantalla completa",exitFullscreenAria:"Salir de pantalla completa",visualEditorAria:"Editor visual",htmlEditorAria:"Editor HTML",menuFile:"Archivo",menuFileAria:"Menú Archivo",menuEdit:"Editar",menuEditAria:"Menú Editar",menuInsert:"Insertar",menuInsertAria:"Menú Insertar",menuView:"Vista",menuViewAria:"Menú Vista",menuFormat:"Formato",menuFormatAria:"Menú Formato",menuFont:"Fuentes",menuFontAria:"Submenú Fuentes",menuParagraph:"Párrafo",menuParagraphAria:"Submenú Párrafo",menuParagraphStyles:"Estilos de párrafo",menuParagraphStylesAria:"Submenú Estilos de párrafo",menuPage:"Página",menuPageAria:"Submenú Página",menuImage:"Imagen",menuImageAria:"Propiedades de imagen",menuInsertRow:"Fila",menuInsertRowAria:"Insertar o eliminar fila",menuInsertColumn:"Columna",menuInsertColumnAria:"Insertar o eliminar columna",menuTable:"Tabla",menuTableAria:"Propiedades de tabla",menuCustom:"Personalizado",menuCustomAria:"Menú personalizado",menuHamburgerAria:"Abrir menú",menuCloseAria:"Cerrar menú",menuOverlayAria:"Menú del editor",brandMarkAria:"Editor HTML de CommsPliant",commandSave:"Guardar",commandSaveAria:"Guardar como archivo HTML",commandOpen:"Abrir",commandOpenAria:"Abrir archivo HTML",commandPrint:"Imprimir",commandPrintAria:"Imprimir documento",commandUndo:"Deshacer",commandUndoAria:"Deshacer",commandRedo:"Rehacer",commandRedoAria:"Rehacer",commandCut:"Cortar",commandCutAria:"Cortar",commandCopy:"Copiar",commandCopyAria:"Copiar",commandDelete:"Eliminar",commandDeleteAria:"Eliminar",commandLink:"Enlace",commandLinkAria:"Enlace",commandBookmark:"Marcador",commandBookmarkAria:"Marcador",commandImage:"Imagen",commandImageAria:"Insertar imagen",commandImageProperties:"Propiedades de imagen…",commandImagePropertiesAria:"Propiedades de imagen",commandTable:"Tabla",commandTableAria:"Insertar tabla",commandTableProperties:"Propiedades de tabla…",commandTablePropertiesAria:"Propiedades de tabla",commandCellProperties:"Propiedades de celda…",commandCellPropertiesAria:"Propiedades de celda",commandRowProperties:"Propiedades de fila…",commandRowPropertiesAria:"Propiedades de fila",commandInsertRowBelow:"Añadir debajo",commandInsertRowBelowAria:"Añadir fila debajo",commandInsertRowBefore:"Añadir antes",commandInsertRowBeforeAria:"Añadir fila antes",commandDeleteRow:"Eliminar",commandDeleteRowAria:"Eliminar fila",commandInsertColumnAfter:"Añadir después",commandInsertColumnAfterAria:"Añadir columna después",commandInsertColumnBefore:"Añadir antes",commandInsertColumnBeforeAria:"Añadir columna antes",commandDeleteColumn:"Eliminar",commandDeleteColumnAria:"Eliminar columna",contextMenuAria:"Menú contextual del editor",commandBold:"Negrita",commandBoldAria:"Negrita",commandItalic:"Cursiva",commandItalicAria:"Cursiva",commandUnderline:"Subrayado",commandUnderlineAria:"Subrayado",commandStrikethrough:"Tachado",commandStrikethroughAria:"Tachado",commandClearFormatting:"Restablecer formato",commandClearFormattingAria:"Restablecer formato",commandFontSize:"Tamaño de fuente",commandFontSizeAria:"Tamaño de fuente",commandFontSizeUnitAria:"Unidad de tamaño de fuente",commandFontFamily:"Fuente",commandFontFamilyAria:"Familia tipográfica",commandFontProperties:"Propiedades de fuente…",commandFontPropertiesAria:"Propiedades de fuente",commandParagraphProperties:"Propiedades de párrafo…",commandParagraphPropertiesAria:"Propiedades de párrafo",commandPageProperties:"Propiedades de página…",commandPagePropertiesAria:"Propiedades de página",commandFontColor:"Color de fuente",commandFontColorAria:"Color de fuente",commandHighlightColor:"Color de resaltado",commandHighlightColorAria:"Color de resaltado",commandParagraphStyle:"Estilos",commandParagraphStyleAria:"Estilos de párrafo",commandAlignLeft:"Alinear a la izquierda",commandAlignLeftAria:"Alinear a la izquierda",commandAlignCenter:"Alinear al centro",commandAlignCenterAria:"Alinear al centro",commandAlignRight:"Alinear a la derecha",commandAlignRightAria:"Alinear a la derecha",commandAlignJustify:"Justificar",commandAlignJustifyAria:"Justificar",commandIndent:"Aumentar sangría",commandIndentAria:"Aumentar sangría",commandOutdent:"Disminuir sangría",commandOutdentAria:"Disminuir sangría",commandBulletList:"Lista con viñetas",commandBulletListAria:"Lista con viñetas",commandNumberedList:"Lista numerada",commandNumberedListAria:"Lista numerada",styleParagraph:"Párrafo",styleHeading1:"Encabezado 1",styleHeading2:"Encabezado 2",styleHeading3:"Encabezado 3",styleHeading4:"Encabezado 4",styleHeading5:"Encabezado 5",styleHeading6:"Encabezado 6",styleAddNew:"Añadir nuevo",styleAddNewAria:"Añadir un estilo de párrafo",customStyleDialogAddTitle:"Añadir estilo de párrafo",customStyleDialogEditTitle:"Editar estilo de párrafo",customStyleDialogTabFont:"Fuente",customStyleDialogTabParagraph:"Párrafo",customStyleDialogName:"Nombre",customStyleDialogDelete:"Eliminar",customStyleDialogDeleteConfirm:"¿Eliminar este estilo de párrafo?",customStyleDialogCloseAria:"Cerrar",customStyleLoading:"Cargando estilos de párrafo",colorAutomatic:"Automático",colorNone:"Sin color",colorCustom:"Color personalizado",colorHex:"Hex",colorRgbR:"R",colorRgbG:"G",colorRgbB:"B",colorPickFromScreen:"Seleccionar de la pantalla",colorRecent:"Colores recientes",fontDialogTitle:"Propiedades de fuente",fontDialogTabGeneral:"General",fontDialogFamily:"Fuente",fontFamilyDefault:"Predeterminada",fontDialogSize:"Tamaño",fontDialogUnit:"Unidad",fontDialogStyle:"Estilo",fontDialogOk:"Aceptar",fontDialogCancel:"Cancelar",linkDialogTitle:"Insertar enlace",linkDialogTabLink:"Enlace",linkDialogTabBookmark:"Marcador",linkDialogHref:"URL",linkDialogHoverTitle:"Título",linkDialogTargetBlank:"Abrir en una pestaña nueva",linkDialogTextDecorationNone:"Sin subrayado",linkDialogHover:"Al pasar el cursor",linkDialogHoverColor:"Color",linkDialogHoverColorField:"Color al pasar el cursor",linkDialogHoverHtml:"HTML",linkDialogHoverHtmlAria:"HTML personalizado al pasar el cursor",linkDialogBookmark:"Marcador",linkDialogBookmarkEmpty:"No hay marcadores en este documento.",linkDialogSelect:"Seleccionar",bookmarkDialogTitle:"Insertar marcador",bookmarkDialogName:"Nombre del marcador",bookmarkDialogHelp:"Empieza por una letra. Usa solo letras, números, guiones y guiones bajos. Debe ser único en el documento.",bookmarkDialogHelpAria:"Formato del nombre del marcador",bookmarkDialogCloseAria:"Cerrar",bookmarkDialogErrorEmpty:"Introduce un nombre de marcador.",bookmarkDialogErrorInvalid:"Empieza por una letra. Usa solo letras, números, guiones y guiones bajos.",bookmarkDialogErrorDuplicate:"Ya existe un marcador con este nombre.",imageDialogTitle:"Insertar imagen",imageDialogSource:"Origen",imageDialogFile:"Archivo",imageDialogChooseFile:"Elegir archivo",imageDialogUrl:"URL de la imagen",imageDialogAlt:"Texto alternativo",imageDialogTitleField:"Título",imageDialogCloseAria:"Cerrar",imageDialogErrorEmpty:"Elige un archivo o introduce una URL de imagen.",imageDialogErrorInvalid:"Introduce una URL de imagen válida.",imageDialogErrorType:"Usa una imagen JPEG, PNG, GIF, WebP, BMP o AVIF.",imageDialogErrorTooLarge:"Elige una imagen de menos de 2 MB.",imagePropertiesDialogTitle:"Propiedades de imagen",imagePropertiesDialogCloseAria:"Cerrar",imagePropertiesTabAlignment:"Alineación",imagePropertiesTabBorder:"Borde y margen",imagePropertiesTabAdvanced:"Avanzado",imagePropertiesTabHover:"Al pasar el puntero",imagePropertiesSize:"Tamaño",imagePropertiesSizeMode:"Modo de tamaño",imagePropertiesSizeWidth:"Solo ancho",imagePropertiesSizeHeight:"Solo alto",imagePropertiesSizeLock:"Bloquear juntos",imagePropertiesWidth:"Ancho",imagePropertiesHeight:"Alto",imagePropertiesWidthAria:"Ancho de la imagen",imagePropertiesHeightAria:"Alto de la imagen",imagePropertiesSizeUnitAria:"Unidad de tamaño de imagen",imagePropertiesFit:"Ajuste",imagePropertiesFitDefault:"Predeterminado",imagePropertiesFitFill:"Rellenar",imagePropertiesFitContain:"Contener",imagePropertiesFitCover:"Cubrir",imagePropertiesFitNoneValue:"Ninguno",imagePropertiesFitScaleDown:"Reducir",imagePropertiesPosition:"Posición",imagePropertiesPositionDefault:"Predeterminada",imagePropertiesPositionCenter:"Centro",imagePropertiesPositionTop:"Arriba",imagePropertiesPositionBottom:"Abajo",imagePropertiesPositionLeft:"Izquierda",imagePropertiesPositionRight:"Derecha",imagePropertiesPositionTopLeft:"Arriba izquierda",imagePropertiesPositionTopRight:"Arriba derecha",imagePropertiesPositionBottomLeft:"Abajo izquierda",imagePropertiesPositionBottomRight:"Abajo derecha",imagePropertiesRotation:"Rotación",imagePropertiesRotationUnit:"deg",imagePropertiesHoverCss:"CSS al pasar el puntero",imagePropertiesHoverCssAria:"CSS personalizado al pasar el puntero",imagePropertiesHoverHelp:"CSS que se aplica cuando el puntero está sobre la imagen.",imageResizeHandleEastAria:"Redimensionar el ancho de la imagen, mantener la proporción",imageResizeHandleSouthAria:"Redimensionar el alto de la imagen, mantener la proporción",imageResizeHandleSouthEastAria:"Redimensionar la imagen sin mantener la proporción",tableDialogTitle:"Insertar tabla",tableDialogCloseAria:"Cerrar",tableDialogRows:"Filas",tableDialogColumns:"Columnas",tableDialogSize:"Tamaño",tableDialogGridAria:"Cuadrícula de tamaño de tabla",tableDialogInsert:"Insertar",tablePropertiesDialogTitle:"Propiedades de tabla",tablePropertiesDialogCloseAria:"Cerrar",tablePropertiesCollapse:"Contracción de bordes",tablePropertiesCollapseCollapse:"Contraídos",tablePropertiesCollapseSeparate:"Separados",tablePropertiesSpacing:"Espaciado de bordes",tablePropertiesWidth:"Ancho",cellPropertiesDialogTitle:"Propiedades de celda",cellPropertiesDialogCloseAria:"Cerrar",cellPropertiesColor:"Color de texto",cellPropertiesVerticalAlign:"Alineación vertical",cellPropertiesVerticalAlignDefault:"Predeterminada",cellPropertiesVerticalAlignTop:"Arriba",cellPropertiesVerticalAlignMiddle:"Centro",cellPropertiesVerticalAlignBottom:"Abajo",cellPropertiesVerticalAlignBaseline:"Línea base",cellPropertiesWidth:"Ancho",rowPropertiesDialogTitle:"Propiedades de fila",rowPropertiesDialogCloseAria:"Cerrar",rowPropertiesHeight:"Alto",paragraphDialogTitle:"Propiedades de párrafo",pageDialogTitle:"Propiedades de página",paragraphDialogTabBorder:"Borde",paragraphDialogTabBackground:"Fondo",paragraphDialogAlignment:"Alineación",paragraphDialogLists:"Listas",paragraphDialogSpacing:"Espaciado",paragraphDialogMargin:"Margen",paragraphDialogPadding:"Relleno",paragraphDialogLineHeight:"Interlineado",paragraphDialogLineHeightNormal:"Normal",paragraphDialogLineHeightUnitless:"×",paragraphDialogLinkSides:"Igual en todos los lados",paragraphDialogSideTop:"Superior",paragraphDialogSideRight:"Derecho",paragraphDialogSideBottom:"Inferior",paragraphDialogSideLeft:"Izquierdo",paragraphDialogBorder:"Borde",paragraphDialogBorderStyle:"Estilo",paragraphDialogBorderWidth:"Grosor",paragraphDialogBorderColor:"Color",paragraphDialogBorderRadius:"Radio de esquina",paragraphDialogBoxShadow:"Sombra",paragraphDialogShadowOffsetX:"Desplazamiento X",paragraphDialogShadowOffsetY:"Desplazamiento Y",paragraphDialogShadowBlur:"Desenfoque",paragraphDialogShadowSpread:"Extensión",paragraphDialogShadowColor:"Color",paragraphDialogShadowInset:"Interior",paragraphDialogLengthUnitAria:"Unidad",paragraphDialogBorderStyleNone:"Ninguno",paragraphDialogBorderStyleSolid:"Sólido",paragraphDialogBorderStyleDotted:"Punteado",paragraphDialogBorderStyleDashed:"Discontinuo",paragraphDialogBorderStyleDouble:"Doble",paragraphDialogBorderStyleGroove:"Surco",paragraphDialogBorderStyleRidge:"Relieve",paragraphDialogBorderStyleInset:"Hundido",paragraphDialogBorderStyleOutset:"Saliente",paragraphDialogBackgroundColor:"Color de fondo",paragraphDialogOpacity:"Opacidad",fontSizeUnitPt:"pt",fontSizeUnitPx:"px",fontSizeUnitEm:"em",fontSizeUnitRem:"rem",fontSizeUnitPercent:"%",fontSizeUnitPc:"pc",toolbarAria:"Barra de herramientas",toolbarGroupFile:"Archivo",toolbarGroupPrint:"Imprimir",toolbarGroupEdit:"Editar",toolbarGroupInsert:"Insertar",toolbarGroupFont:"Fuentes",toolbarGroupAlign:"Alinear",toolbarGroupParagraph:"Párrafo",toolbarGroupView:"Vista",toolbarGroupCustom:"Personalizado",toolbarScrollLeftAria:"Desplazar la barra a la izquierda",toolbarScrollRightAria:"Desplazar la barra a la derecha"},bc={en:Ro,es:gc},Ka=s.createContext(e=>Ro[e]);function yc({locale:e="en",children:t}){const n=s.useMemo(()=>{const r=bc[e]??Ro;return i=>r[i]},[e]);return o.jsx(Ka.Provider,{value:n,children:t})}function V(){return s.useContext(Ka)}const xc="_menu_uy4s1_1",wc="_item_uy4s1_17",Sc="_separator_uy4s1_57",Yr={menu:xc,item:wc,separator:Sc},Nn=8,kc=[{type:"item",command:"deleteSelection",labelKey:"commandDelete",ariaKey:"commandDeleteAria",enabled:e=>e==="text"||e==="image"},{type:"item",command:"cut",labelKey:"commandCut",ariaKey:"commandCutAria",enabled:e=>e==="text"||e==="image"},{type:"item",command:"copy",labelKey:"commandCopy",ariaKey:"commandCopyAria",enabled:e=>e==="text"||e==="image"},{type:"separator"},{type:"item",command:"openLinkDialog",labelKey:"commandLink",ariaKey:"commandLinkAria",enabled:e=>e!=="image"},{type:"separator"},{type:"item",command:"openFontProperties",labelKey:"commandFontProperties",ariaKey:"commandFontPropertiesAria",enabled:e=>e!=="image"},{type:"item",command:"openParagraphProperties",labelKey:"commandParagraphProperties",ariaKey:"commandParagraphPropertiesAria",enabled:e=>e!=="image"},{type:"item",command:"openImageProperties",labelKey:"commandImageProperties",ariaKey:"commandImagePropertiesAria",enabled:e=>e==="image"},{type:"item",command:"openTableProperties",labelKey:"commandTableProperties",ariaKey:"commandTablePropertiesAria",enabled:(e,t)=>t},{type:"item",command:"openCellProperties",labelKey:"commandCellProperties",ariaKey:"commandCellPropertiesAria",enabled:(e,t)=>t},{type:"item",command:"openRowProperties",labelKey:"commandRowProperties",ariaKey:"commandRowPropertiesAria",enabled:(e,t)=>t}];function Hi(){return'[role="menuitem"]:not(:disabled)'}function Cc({open:e,x:t,y:n,kind:r,inTable:i=!1,commands:a,onClose:l}){const c=V(),m=s.useId(),p=s.useRef(null);if(s.useLayoutEffect(()=>{var y;if(!e)return;const h=p.current;if(!h)return;const w=h.getBoundingClientRect(),x=Math.max(Nn,Math.min(t,window.innerWidth-w.width-Nn)),S=Math.max(Nn,Math.min(n,window.innerHeight-w.height-Nn));h.style.left=`${x}px`,h.style.top=`${S}px`,(y=h.querySelector(Hi()))==null||y.focus()},[e,t,n,r]),s.useEffect(()=>{if(!e)return;const h=y=>{var C;(C=p.current)!=null&&C.contains(y.target)||l()},w=y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),l())},x=()=>{l()},S=y=>{var C;if((C=p.current)!=null&&C.contains(y.target)){y.preventDefault();return}y.defaultPrevented||l()};return document.addEventListener("pointerdown",h),document.addEventListener("keydown",w,!0),window.addEventListener("scroll",x,!0),document.addEventListener("contextmenu",S),()=>{document.removeEventListener("pointerdown",h),document.removeEventListener("keydown",w,!0),window.removeEventListener("scroll",x,!0),document.removeEventListener("contextmenu",S)}},[e,l]),!e)return null;const b=h=>{var C;if(h.key!=="ArrowDown"&&h.key!=="ArrowUp")return;const w=[...((C=p.current)==null?void 0:C.querySelectorAll(Hi()))??[]];if(w.length===0)return;const x=w.indexOf(document.activeElement),S=h.key==="ArrowDown"?1:-1,y=w[(x+S+w.length)%w.length];h.preventDefault(),y==null||y.focus()};return le.createPortal(o.jsxs("div",{ref:p,className:Yr.menu,role:"menu","aria-labelledby":m,style:{left:t,top:n},onMouseDown:h=>h.preventDefault(),onKeyDown:b,children:[o.jsx("span",{id:m,hidden:!0,children:c("contextMenuAria")}),kc.map((h,w)=>{if(h.type==="separator")return o.jsx("div",{role:"separator",className:Yr.separator},`separator-${w}`);const x=h.enabled(r,i);return o.jsx("button",{type:"button",role:"menuitem",className:Yr.item,"aria-label":c(h.ariaKey),disabled:!x,onClick:()=>{x&&(l(),Mo(a,h.command))},children:c(h.labelKey)},h.command)})]}),document.body)}const $a={description:"HTML",accept:{"text/html":[".html",".htm"]}},vc="document.html";function Ua(){return window}function Wa(e){return e instanceof DOMException&&e.name==="AbortError"}function qa(e){return typeof e.text=="function"?e.text():new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(String(r.result??"")),r.onerror=()=>n(r.error??new Error("Failed to read file")),r.readAsText(e)})}function Dc(e,t){const n=new Blob([e],{type:"text/html;charset=utf-8"}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=t,i.rel="noopener",document.body.append(i),i.click(),i.remove(),URL.revokeObjectURL(r)}function Ac(){return new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept=".html,.htm,text/html",t.hidden=!0;const n=r=>{t.remove(),e(r)};t.addEventListener("change",()=>{var i;const r=(i=t.files)==null?void 0:i[0];if(!r){n(null);return}qa(r).then(a=>n(a),()=>n(null))}),t.addEventListener("cancel",()=>n(null)),document.body.append(t),t.click()})}async function Pc(e,t=vc){const n=Ua().showSaveFilePicker;if(typeof n=="function"){try{const i=await(await n({suggestedName:t,types:[$a]})).createWritable();await i.write(e),await i.close()}catch(r){if(Wa(r))return;throw r}return}Dc(e,t)}async function Ec(){const e=Ua().showOpenFilePicker;if(typeof e=="function")try{const[t]=await e({multiple:!1,types:[$a]}),n=await t.getFile();return await qa(n)}catch(t){if(Wa(t))return null;throw t}return Ac()}const jc=new Set(["span","strong","b","em","i","u","s","strike","del"]);function ae(e,t){return t?e===t||e.contains(t):!1}function Ve(e){return jc.has(e.tagName.toLowerCase())}function Nc(e,t){const n=document.createRange();return n.selectNodeContents(t),e.compareBoundaryPoints(Range.END_TO_START,n)<0&&e.compareBoundaryPoints(Range.START_TO_END,n)>0}function Ne(e){const t=e.commonAncestorContainer;if(t.nodeType===Node.TEXT_NODE)return t.nodeValue?[t]:[];const n=[],r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);let i;for(;i=r.nextNode();)i.nodeValue&&Nc(e,i)&&n.push(i);return n}function et(e){const t=e.startContainer,n=e.startOffset;if(t.nodeType===Node.TEXT_NODE){const a=t;if(n>0&&n<a.length){const l=a.splitText(n);e.setStart(l,0),e.endContainer===a&&e.setEnd(l,e.endOffset-n)}}const r=e.endContainer,i=e.endOffset;if(r.nodeType===Node.TEXT_NODE){const a=r;i>0&&i<a.length&&(a.splitText(i),e.setEnd(a,a.length))}}function mt(e){return e.tagName.toLowerCase()!=="span"||e.style.cssText.trim()?!1:(e.removeAttribute("style"),e.attributes.length===0)}function Re(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function ft(e,t){const n=[...e.childNodes],r=n.indexOf(t);if(r<=-1||n.length===1)return;const i=e.parentNode;if(!i)return;const a=n.slice(0,r),l=n.slice(r+1);if(a.length>0){const c=e.cloneNode(!1);for(const m of a)c.appendChild(m);i.insertBefore(c,e)}if(l.length>0){const c=e.cloneNode(!1);for(const m of l)c.appendChild(m);i.insertBefore(c,e.nextSibling)}}function Nt(e){if(e.length===0)return;const t=e[0],n=e[e.length-1],r=document.createRange();r.setStart(t,0),r.setEnd(n,n.data.length);const i=window.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(r)}function Qn(e,t){const n=e.parentElement;if(n&&n.tagName.toLowerCase()==="span"&&n.childNodes.length===1)return t(n),n;const r=document.createElement("span");return t(r),n==null||n.insertBefore(r,e),r.appendChild(e),r}const er="data-wysiwyg-font",Lc=[{name:"Arial",family:"Arial, Helvetica, sans-serif"},{name:"Arial Black",family:"'Arial Black', Gadget, sans-serif"},{name:"Comic Sans MS",family:"'Comic Sans MS', Textile, cursive"},{name:"Courier New",family:"'Courier New', Courier, monospace"},{name:"Georgia",family:"Georgia, serif"},{name:"Helvetica",family:"Helvetica, Arial, sans-serif"},{name:"Impact",family:"Impact, Charcoal, sans-serif"},{name:"Lucida Console",family:"'Lucida Console', Monaco, monospace"},{name:"Lucida Sans Unicode",family:"'Lucida Sans Unicode', 'Lucida Grande', sans-serif"},{name:"Palatino Linotype",family:"'Palatino Linotype', Palatino, serif"},{name:"Tahoma",family:"Tahoma, Geneva, sans-serif"},{name:"Times New Roman",family:"'Times New Roman', Times, serif"},{name:"Trebuchet MS",family:"'Trebuchet MS', Helvetica, sans-serif"},{name:"Verdana",family:"Verdana, Geneva, sans-serif"}];function nn(e){return e.split(",").map(t=>t.trim().replace(/^["']|["']$/g,"").toLowerCase()).filter(Boolean).join(",")}function ln(e,t){return e===t?!0:!e||!t?!1:nn(e)===nn(t)}function Ga(e=[]){var r;const t=[],n=new Set;for(const i of[...Lc,...e]){const a=i.family.trim();if(!a)continue;const l=nn(a);if(n.has(l))continue;n.add(l);const c=(r=i.css)==null?void 0:r.trim();t.push({name:i.name.trim()||a,family:a,...c?{css:c}:{}})}return t}function Tc(e,t){return e?t.find(n=>ln(n.family,e))??null:null}function Mc(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function Rc(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function tr(e){const t=new Set,n=[];for(const r of e){const i=r.trim();!i||!Mc(i)||t.has(i)||(t.add(i),n.push(i))}return n}function _c(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&amp;/g,"&")}const Fc=new RegExp(`<link\\b[^>]*\\b${er}\\b[^>]*>`,"gi");function rn(e){if(!e.includes(er))return{hrefs:[],body:e};const t=[],n=e.replace(Fc,r=>{var a,l;const i=((a=r.match(/\bhref\s*=\s*"([^"]*)"/i))==null?void 0:a[1])??((l=r.match(/\bhref\s*=\s*'([^']*)'/i))==null?void 0:l[1]);return i&&t.push(_c(i)),""});return{hrefs:tr(t),body:n}}function Jr(e,t){const n=tr(t);return n.length===0?e:`${n.map(i=>`<link rel="stylesheet" href="${Rc(i)}" ${er}="">`).join("")}${e}`}function Ic(e,t){const n=nn(t);if(!n)return!1;const r=new DOMParser().parseFromString(e,"text/html"),i=r.createTreeWalker(r.body,NodeFilter.SHOW_ELEMENT);let a=i.currentNode;for(;a;){if(a instanceof HTMLElement){const l=a.style.fontFamily;if(l&&nn(l)===n)return!0}a=i.nextNode()}return!1}function Zr(e,t,n=[]){const r=rn(t).hrefs,i=n.filter(a=>a.css&&Ic(e,a.family)).map(a=>a.css??"");return tr([...r,...i])}function Bc(e,t=[]){const n=rn(e).hrefs,r=t.map(i=>i.css??"");return tr([...n,...r])}function Hc(e){return e.nodeType===Node.TEXT_NODE?e.parentElement:e instanceof Element?e:e.parentElement}function Va(e){return e.style.fontFamily.trim()||null}function _o(e,t){let n=Hc(t);for(;n&&n!==e&&n instanceof HTMLElement;){const r=Va(n);if(r)return r;n=n.parentElement}return null}function po(e){return e instanceof HTMLElement&&Va(e)!==null}function Fo(e){e.style.fontFamily="",e.style.removeProperty("font-family")}function Oc(e,t){let n=t;for(;n.parentElement&&n.parentElement!==e;){const r=n.parentElement;if(!Ve(r)||!po(r)){n=r;continue}if(ft(r,n),po(r)&&(Fo(r),mt(r))){Re(r);continue}n=r}}function Xa(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return ae(e,n.commonAncestorContainer)?n:null}function zc(e){const t=Xa(e);if(!t)return{value:null,mixed:!1};const n=t.collapsed?[]:Ne(t).filter(c=>c.data.length>0),i=(n.length>0?n:[t.startContainer]).map(c=>_o(e,c)),a=i[0]??null;return i.every(c=>ln(c,a))?{value:a,mixed:!1}:{value:null,mixed:!0}}function Oi(e,t){const n=Xa(e);if(!n||n.collapsed)return!1;const r=t!=null&&t.trim()?t.trim():null;et(n);const i=Ne(n).filter(a=>a.data.length>0);for(const a of i){const l=_o(e,a);if(r===null){if(l===null)continue;Oc(e,a);continue}ln(l,r)||Qn(a,c=>{c.style.fontFamily=r})}return Nt(i),!0}function Kc(e,t){if(t){if(t.value===null){Fo(e);return}e.style.fontFamily=t.value}}function $c(e){return e!=null}function Uc(e){const t=e.startContainer,n=e.startOffset;if(t.nodeType!==Node.TEXT_NODE)return;const r=t;if(n<=0||n>=r.length)return;const i=r.splitText(n);e.setStart(i,0),e.collapse(!0)}function Wc(e){var r,i,a;let t=e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset===0?e.startContainer:e.startContainer.childNodes[e.startOffset]??e.startContainer.lastChild??e.startContainer;if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset>0){const l=document.createTextNode("");return(r=e.startContainer.parentNode)==null||r.insertBefore(l,e.startContainer.nextSibling),l}if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset===0){const l=document.createTextNode("");return(i=e.startContainer.parentNode)==null||i.insertBefore(l,e.startContainer),l}const n=document.createTextNode("");return t&&t!==e.startContainer?(a=t.parentNode)==null||a.insertBefore(n,t):e.startContainer.appendChild(n),n}function ho(e,t){let n=t;for(;n.parentElement&&n.parentElement!==e;){const r=n.parentElement;if(!Ve(r)||!po(r)){n=r;continue}if(ft(r,n),Fo(r),mt(r)){Re(r);continue}n=r.isConnected?r:t}return t}function qc(e,t){Uc(t);const n=Wc(t);return ho(e,n)}function Gc(e,t,n){return!!(n&&n.value===null&&_o(e,t))}const Vc=`
2
+ @page {
3
+ margin: 0;
4
+ }
5
+ body {
6
+ margin: 0;
7
+ padding: 1.5cm;
8
+ color: #111;
9
+ background: #fff;
10
+ font-family: system-ui, sans-serif;
11
+ font-size: 1rem;
12
+ font-weight: 400;
13
+ line-height: 1.5;
14
+ }
15
+ p {
16
+ margin: 0 0 0.75em;
17
+ }
18
+ p:last-child {
19
+ margin-bottom: 0;
20
+ }
21
+ h1, h2, h3, h4, h5, h6 {
22
+ margin: 1em 0 0.5em;
23
+ font-weight: 600;
24
+ line-height: 1.25;
25
+ color: inherit;
26
+ }
27
+ h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {
28
+ margin-top: 0;
29
+ }
30
+ h1 { font-size: 1.75rem; }
31
+ h2 { font-size: 1.5rem; }
32
+ h3 { font-size: 1.25rem; }
33
+ h4 { font-size: 1.125rem; }
34
+ h5 { font-size: 1rem; }
35
+ h6 { font-size: 0.875rem; }
36
+ ul, ol {
37
+ margin: 0 0 0.75em;
38
+ padding-left: 1.5em;
39
+ }
40
+ li {
41
+ margin: 0.25em 0;
42
+ }
43
+ a {
44
+ color: #06c;
45
+ text-decoration: underline;
46
+ }
47
+ strong, b { font-weight: 700; }
48
+ em, i { font-style: italic; }
49
+ u { text-decoration: underline; }
50
+ s { text-decoration: line-through; }
51
+ blockquote {
52
+ margin: 0 0 0.75em;
53
+ padding: 0 0 0 0.75em;
54
+ border: 0;
55
+ border-left: 3px solid #d0d0d0;
56
+ color: #444;
57
+ }
58
+ code {
59
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
60
+ font-size: 0.875em;
61
+ background: #f4f4f4;
62
+ padding: 0.1em 0.3em;
63
+ border-radius: 3px;
64
+ }
65
+ pre {
66
+ margin: 0 0 0.75em;
67
+ padding: 0.75em;
68
+ overflow: auto;
69
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
70
+ font-size: 0.875rem;
71
+ line-height: 1.5;
72
+ background: #f4f4f4;
73
+ border-radius: 4px;
74
+ }
75
+ pre code {
76
+ background: transparent;
77
+ padding: 0;
78
+ font-size: inherit;
79
+ }
80
+ hr {
81
+ margin: 1em 0;
82
+ border: 0;
83
+ border-top: 1px solid #d0d0d0;
84
+ }
85
+ img {
86
+ max-width: 100%;
87
+ height: auto;
88
+ vertical-align: middle;
89
+ }
90
+ `.trim(),Xc=1e3;function Yc(e){const t=document.createElement("iframe");t.setAttribute("aria-hidden","true"),t.setAttribute("data-wysiwyg-print",""),t.style.position="fixed",t.style.right="0",t.style.bottom="0",t.style.width="0",t.style.height="0",t.style.border="0",document.body.append(t);const n=t.contentDocument,r=t.contentWindow;if(!n||!r){t.remove();return}const{hrefs:i,body:a}=rn(e),l=n.createElement("meta");l.setAttribute("charset","utf-8");const c=n.createElement("title");c.textContent="​";const m=n.createElement("style");m.textContent=Vc;const p=i.map(w=>{const x=n.createElement("link");return x.rel="stylesheet",x.href=w,x});n.head.replaceChildren(l,c,m,...p),n.title="​",n.body.innerHTML=a;let b=!1;const h=()=>{b||(b=!0,t.remove())};r.addEventListener("afterprint",h),r.focus(),r.print(),window.setTimeout(h,Xc)}function Jc(e){return{save:async()=>{await Pc(e.getHtml())},open:async()=>{const t=await Ec();t!==null&&e.setHtml(t)},print:()=>{Yc(e.getHtml())}}}function Zc(e){return{toggleBold:()=>{e.toggleFontMark("bold")},toggleItalic:()=>{e.toggleFontMark("italic")},toggleUnderline:()=>{e.toggleFontMark("underline")},toggleStrikethrough:()=>{e.toggleFontMark("strikethrough")},clearFormatting:()=>{e.clearFormatting()},setFontSize:(t,n)=>{e.setFontSize(t,n)},setFontSizeUnit:t=>{e.setFontSizeUnit(t)},setFontFamily:t=>{e.setFontFamily(t)},setFontColor:t=>{e.setFontColor(t)},setHighlightColor:t=>{e.setHighlightColor(t)},setParagraphStyle:t=>{e.setParagraphStyle(t)},alignLeft:()=>{e.setTextAlign("left")},alignCenter:()=>{e.setTextAlign("center")},alignRight:()=>{e.setTextAlign("right")},alignJustify:()=>{e.setTextAlign("justify")},indent:()=>{e.indent()},outdent:()=>{e.outdent()},toggleBulletList:()=>{e.toggleList("ul")},toggleNumberedList:()=>{e.toggleList("ol")},openFontProperties:t=>{e.openFontProperties(t??"general")},applyFontProperties:t=>{e.applyFontProperties(t)},openParagraphProperties:t=>{e.openParagraphProperties(t??"general")},applyParagraphProperties:t=>{e.applyParagraphProperties(t)},openPageProperties:t=>{e.openPageProperties(t??"font")},applyPageProperties:t=>{e.applyPageProperties(t)},openCustomParagraphStyleDialog:t=>{e.openCustomParagraphStyleDialog(t)},applyCustomParagraphStyle:t=>{e.applyCustomParagraphStyle(t)}}}function Qc(e){return{isBold:()=>e.isFontMarkActive("bold"),isItalic:()=>e.isFontMarkActive("italic"),isUnderline:()=>e.isFontMarkActive("underline"),isStrikethrough:()=>e.isFontMarkActive("strikethrough"),getFontSize:()=>e.getFontSize(),getFontSizeUnit:()=>e.getFontSizeUnit(),isFontSizeMixed:()=>e.isFontSizeMixed(),getFontFamily:()=>e.getFontFamily(),isFontFamilyMixed:()=>e.isFontFamilyMixed(),getFontFaces:()=>e.getFontFaces(),getFontColor:()=>e.getFontColor(),isFontColorMixed:()=>e.isFontColorMixed(),getHighlightColor:()=>e.getHighlightColor(),isHighlightColorMixed:()=>e.isHighlightColorMixed(),getParagraphStyle:()=>e.getParagraphStyle(),isParagraphStyleMixed:()=>e.isParagraphStyleMixed(),isAlignLeft:()=>e.getTextAlign()==="left"&&!e.isTextAlignMixed(),isAlignCenter:()=>e.getTextAlign()==="center"&&!e.isTextAlignMixed(),isAlignRight:()=>e.getTextAlign()==="right"&&!e.isTextAlignMixed(),isAlignJustify:()=>e.getTextAlign()==="justify"&&!e.isTextAlignMixed(),canOutdent:()=>e.canOutdent(),isBulletList:()=>e.isBulletList(),isNumberedList:()=>e.isNumberedList(),hasTextSelection:()=>e.hasTextSelection(),customParagraphStylesEnabled:()=>e.customParagraphStylesEnabled(),getCustomParagraphStyles:()=>e.getCustomParagraphStyles(),isCustomParagraphStylesLoading:()=>e.isCustomParagraphStylesLoading()}}function eu(e){return{undo:()=>{e.undo()},redo:()=>{e.redo()}}}function tu(e){return{canUndo:()=>e.canUndo(),canRedo:()=>e.canRedo()}}function nu(e){return{openLinkDialog:t=>{e.openLinkDialog(t)},applyLink:t=>{e.applyLink(t)},openBookmarkDialog:()=>{e.openBookmarkDialog()},applyBookmark:t=>{e.applyBookmark(t)},openImageDialog:()=>{e.openImageDialog()},applyImage:t=>{e.applyImage(t)},openImageProperties:t=>{e.openImageProperties(t)},applyImageProperties:t=>{e.applyImageProperties(t)}}}function ru(e){return{isLink:()=>e.isLink(),isImageSelected:()=>e.isImageSelected()}}function ou(e){return{openTableDialog:()=>{e.openTableDialog()},applyTable:t=>{e.applyTable(t)},openTableProperties:()=>{e.openTableProperties()},applyTableProperties:t=>{e.applyTableProperties(t)},openCellProperties:()=>{e.openCellProperties()},applyCellProperties:t=>{e.applyCellProperties(t)},openRowProperties:()=>{e.openRowProperties()},applyRowProperties:t=>{e.applyRowProperties(t)},insertRowBelow:()=>{e.insertRowBelow()},insertRowBefore:()=>{e.insertRowBefore()},deleteRow:()=>{e.deleteRow()},insertColumnAfter:()=>{e.insertColumnAfter()},insertColumnBefore:()=>{e.insertColumnBefore()},deleteColumn:()=>{e.deleteColumn()}}}function iu(e){return{isInTable:()=>e.isInTable()}}function au(e){return{setVisualMode:()=>{e.setMode("visual")},setHtmlMode:()=>{e.setMode("html")},toggleFullscreen:()=>{e.setFullscreen(!e.getFullscreen())}}}function lu(e){return{isVisualMode:()=>e.getMode()==="visual",isHtmlMode:()=>e.getMode()==="html",isFullscreen:()=>e.getFullscreen()}}function su(e){return{...Jc(e),...eu(e),...hc(e),...nu(e),...ou(e),...au(e),...Zc(e)}}function cu(e){return{...lu(e),...tu(e),...ru(e),...iu(e),...Qc(e)}}const Io=["pt","px","em","rem","%"],ut="pt",uu={pt:[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72],px:[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72],em:[.5,.75,1,1.25,1.5,2,2.5,3],rem:[.5,.75,1,1.25,1.5,2,2.5,3],"%":[50,75,100,125,150,200,250,300]},du={pt:{min:1,max:400},px:{min:1,max:400},em:{min:.1,max:20},rem:{min:.1,max:20},"%":{min:1,max:1e3}},mu=new Set(Io),fu=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(pt|px|em|rem|%|pc|cm|mm|in|ex|ch|q|vw|vh|vmin|vmax)$/i;function nr(e){return mu.has(e)}function xe(e){return Math.round(e*100)/100}function Y(e){const t=xe(e);return Number.isInteger(t),String(t)}function Bo(e,t){return`${Y(e)}${t}`}function Ho(e){const t=e.trim();if(!t)return null;const n=t.match(fu);if(!n)return null;const r=Number(n[1]);if(!Number.isFinite(r))return null;const i=n[2]==="%"?"%":n[2].toLowerCase();return{value:r,unit:i}}function pu(e,t){const n=e.trim();if(!n)return null;const r=Ho(n);if(r)return nr(r.unit)?dt(r.value,r.unit):null;const i=Number(n.replace(",","."));return Number.isFinite(i)?dt(i,t):null}function dt(e,t){if(!Number.isFinite(e)||e<=0)return null;const{min:n,max:r}=du[t];return{value:xe(Math.min(r,Math.max(n,e))),unit:t}}function Ya(e,t,n,r){const i=n>0?n:16,a=r>0?r:16;switch(t){case"px":return xe(e);case"pt":return xe(e*.75);case"em":return xe(e/i);case"rem":return xe(e/a);case"%":return xe(e/i*100)}}function hu(e,t,n,r){const i=n>0?n:16,a=r>0?r:16;switch(t){case"px":return e;case"pt":return e*(4/3);case"em":return e*i;case"rem":return e*a;case"%":return e/100*i}}function Ja(e,t,n,r,i){if(t===n)return xe(e);const a=hu(e,t,r,i);return Ya(a,n,r,i)}function Kn(e){return e.nodeType===Node.TEXT_NODE?e.parentElement:e instanceof Element?e:e.parentElement}function gu(e){const t=e.style.fontSize;if(!t)return null;const n=Ho(t);return!n||!nr(n.unit)?null:{value:n.value,unit:n.unit}}function Za(e,t){let n=Kn(t);for(;n&&n!==e&&n instanceof HTMLElement;){const r=gu(n);if(r)return r;n=n.parentElement}return null}function bu(e,t){const n=Kn(e)??t,r=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(r)&&r>0?r:16}function Qa(e,t){var a;let n=Kn(t);for(;n&&n!==e;){if(n.style.fontSize){const c=n.parentElement??e,m=parseFloat(getComputedStyle(c).fontSize);return Number.isFinite(m)&&m>0?m:16}n=n.parentElement}const r=((a=Kn(t))==null?void 0:a.parentElement)??e,i=parseFloat(getComputedStyle(r).fontSize);return Number.isFinite(i)&&i>0?i:16}function el(e){const t=parseFloat(getComputedStyle(e).fontSize);return Number.isFinite(t)&&t>0?t:16}function yu(e,t){return e===t?!0:!e||!t?!1:e.value===t.value&&e.unit===t.unit}function zi(e=ut){return{value:null,unit:e,mixed:!1}}function xu(e,t=ut){const n=window.getSelection();if(!n||n.rangeCount===0)return zi(t);const r=n.getRangeAt(0);if(!ae(e,r.commonAncestorContainer))return zi(t);const i=r.collapsed?[]:Ne(r).filter(p=>p.data.length>0),a=i.length>0?i:[r.startContainer],l=a.map(p=>Za(e,p)),c=l[0];if(l.every(p=>yu(p,c))&&c)return{value:c.value,unit:c.unit,mixed:!1};if(l.every(p=>p===null)){const p=a.map(h=>bu(h,e)),b=p[0];if(p.every(h=>Math.abs(h-b)<.05)){const h=Qa(e,a[0]),w=el(e);return{value:Ya(b,t,h,w),unit:t,mixed:!1}}return{value:null,unit:t,mixed:!0}}return{value:null,unit:t,mixed:!0}}function wu(e,t){return{parentPx:Qa(e,t),rootPx:el(e)}}function Su(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return ae(e,n.commonAncestorContainer)?n:null}function Ki(e,t,n){const r=dt(t,n);if(!r)return!1;const i=Su(e);if(!i||i.collapsed)return!1;const a=Bo(r.value,r.unit);et(i);const l=Ne(i).filter(c=>c.data.length>0);for(const c of l){const m=Za(e,c);m&&m.value===r.value&&m.unit===r.unit||Qn(c,p=>{p.style.fontSize=a})}return Nt(l),!0}function ku(e,t){e.style.fontSize=Bo(t.value,t.unit)}function Cu(e){return e.nodeType===Node.TEXT_NODE?e.parentElement:e instanceof Element?e:e.parentElement}function Qr(e){const t=e.trim().match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d*\.?\d+))?\s*\)$/i);if(!t)return null;const n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=t[4]===void 0?1:Number(t[4]);return[n,r,i,a].every(l=>Number.isFinite(l))?{r:n,g:r,b:i,a}:null}function eo(e,t,n){const r=i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function to(e){const t=e.trim().toLowerCase();return/^#[0-9a-f]{6}$/.test(t)?t:/^#[0-9a-f]{3}$/.test(t)?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:null}const vu={black:"#000000",silver:"#c0c0c0",gray:"#808080",grey:"#808080",white:"#ffffff",maroon:"#800000",red:"#ff0000",purple:"#800080",fuchsia:"#ff00ff",magenta:"#ff00ff",green:"#008000",lime:"#00ff00",olive:"#808000",yellow:"#ffff00",navy:"#000080",blue:"#0000ff",teal:"#008080",aqua:"#00ffff",cyan:"#00ffff",orange:"#ffa500"};function Du(e){const t=e.trim().toLowerCase();return t===""||t==="transparent"||t==="inherit"||t==="initial"||t==="unset"||t==="currentcolor"||t==="currentColor"}function se(e){const t=e.trim();if(!t||Du(t))return null;const n=to(t);if(n)return n;const r=Qr(t);if(r)return r.a===0?null:eo(r.r,r.g,r.b);const i=vu[t.toLowerCase()];if(i)return i;const a=document.createElement("canvas").getContext("2d");if(!a)return null;a.fillStyle="#010203";try{a.fillStyle=t}catch{return null}const l=String(a.fillStyle);if(l==="#010203"){const m=to(t);if(m==="#010203")return m;const p=Qr(t);return p&&eo(p.r,p.g,p.b)==="#010203"?"#010203":t.trim().toLowerCase()==="black"?"#000000":null}if(l.startsWith("#"))return to(l);const c=Qr(l);return!c||c.a===0?null:eo(c.r,c.g,c.b)}function tl(e,t){const n=t==="color"?e.style.color:e.style.backgroundColor;return n?se(n):null}function $n(e,t,n){let r=Cu(t);for(;r&&r!==e&&r instanceof HTMLElement;){const i=tl(r,n);if(i)return i;r=r.parentElement}return null}function Un(e,t){return e instanceof HTMLElement?tl(e,t)!==null:!1}function Oo(e,t){if(t==="color"){e.style.color="",e.style.removeProperty("color");return}e.style.backgroundColor="",e.style.removeProperty("background-color")}function nl(e,t,n){if(t==="color"){e.style.color=n;return}e.style.backgroundColor=n}function Au(e,t,n){let r=t;for(;r.parentElement&&r.parentElement!==e;){const i=r.parentElement;if(!Ve(i)||!Un(i,n)){r=i;continue}if(ft(i,r),Un(i,n)&&(Oo(i,n),mt(i))){Re(i);continue}r=i}}function rl(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return ae(e,n.commonAncestorContainer)?n:null}function $i(e,t){const n=rl(e);if(!n)return{value:null,mixed:!1};const r=n.collapsed?[]:Ne(n).filter(m=>m.data.length>0),a=(r.length>0?r:[n.startContainer]).map(m=>$n(e,m,t)),l=a[0]??null;return a.every(m=>m===l)?{value:l,mixed:!1}:{value:null,mixed:!0}}function no(e,t,n){const r=rl(e);if(!r||r.collapsed)return!1;const i=n===null?null:se(n);if(n!==null&&i===null)return!1;et(r);const a=Ne(r).filter(l=>l.data.length>0);for(const l of a){const c=$n(e,l,t);if(i===null){if(c===null)continue;Au(e,l,t);continue}c!==i&&Qn(l,m=>{nl(m,t,i)})}return Nt(a),!0}function Ui(e,t,n){if(n.value===null){Oo(e,t);return}const r=se(n.value);r&&nl(e,t,r)}function Pu(e){return!!(e!=null&&e.color||e!=null&&e.backgroundColor)}function Eu(e){const t=e.startContainer,n=e.startOffset;if(t.nodeType!==Node.TEXT_NODE)return;const r=t;if(n<=0||n>=r.length)return;const i=r.splitText(n);e.setStart(i,0),e.collapse(!0)}function ju(e){var r,i,a;let t=e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset===0?e.startContainer:e.startContainer.childNodes[e.startOffset]??e.startContainer.lastChild??e.startContainer;if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset>0){const l=document.createTextNode("");return(r=e.startContainer.parentNode)==null||r.insertBefore(l,e.startContainer.nextSibling),l}if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startOffset===0){const l=document.createTextNode("");return(i=e.startContainer.parentNode)==null||i.insertBefore(l,e.startContainer),l}const n=document.createTextNode("");return t&&t!==e.startContainer?(a=t.parentNode)==null||a.insertBefore(n,t):e.startContainer.appendChild(n),n}function ol(e,t,n){let r=t;for(;r.parentElement&&r.parentElement!==e;){const i=r.parentElement;if(!Ve(i)||!n.some(a=>Un(i,a))){r=i;continue}ft(i,r);for(const a of n)Un(i,a)&&Oo(i,a);if(mt(i)){Re(i);continue}r=i.isConnected?i:t}return t}function Nu(e,t,n){Eu(t);const r=ju(t);return ol(e,r,n)}function Lu(e,t,n){const r=[];return n!=null&&n.color&&n.color.value===null&&$n(e,t,"color")&&r.push("color"),n!=null&&n.backgroundColor&&n.backgroundColor.value===null&&$n(e,t,"backgroundColor")&&r.push("backgroundColor"),r}const _e=["bold","italic","underline","strikethrough"],yt={bold:new Set(["strong","b"]),italic:new Set(["em","i"]),underline:new Set(["u"]),strikethrough:new Set(["s","strike","del"])},Tu=new Set(["underline","line-through","overline"]);function $e(){return{bold:!1,italic:!1,underline:!1,strikethrough:!1}}function Mu(e,t){return _e.every(n=>e[n]===t[n])}function Ru(e){return _e.some(t=>e[t]!==void 0)}function il(e,t){const n={...e};if(!t)return n;for(const r of _e){const i=t[r];i!==void 0&&(n[r]=i)}return n}function _u(e,t,n){const r=e[n]??t[n],i={...e,[n]:!r};return i[n]===t[n]&&delete i[n],i}function tt(e){return(e.style.textDecorationLine||e.style.textDecoration).split(/\s+/).filter(n=>Tu.has(n))}function kt(e,t){if(t.length===0){e.style.textDecorationLine="",e.style.removeProperty("text-decoration-line"),e.style.textDecoration&&(e.style.textDecoration="",e.style.removeProperty("text-decoration"));return}e.style.textDecorationLine=t.join(" ")}function al(e,t){const n=e,r=e.tagName.toLowerCase();if(t==="bold"){if(yt.bold.has(r))return!0;const l=n.style.fontWeight;if(!l)return null;if(l==="bold"||l==="bolder")return!0;const c=Number(l);return Number.isNaN(c)?l==="normal"||l==="lighter"?!1:null:c>=700}if(t==="italic"){if(yt.italic.has(r))return!0;const l=n.style.fontStyle;return l?l==="italic"||l==="oblique"?!0:l==="normal"?!1:null:null}if(t==="underline"){if(yt.underline.has(r))return!0;const l=n.style.textDecorationLine||n.style.textDecoration;if(!l)return null;if(l==="none")return!1;const c=tt(n);return c.includes("underline")?!0:c.length>0?!1:null}if(yt.strikethrough.has(r))return!0;const i=n.style.textDecorationLine||n.style.textDecoration;if(!i)return null;if(i==="none")return!1;const a=tt(n);return a.includes("line-through")?!0:a.length>0?!1:null}function Wn(e,t){return al(e,t)===!0}function Ct(e,t,n){let r=t.nodeType===Node.TEXT_NODE?t.parentElement:t;for(;r&&r!==e&&r instanceof Element;){const i=al(r,n);if(i!==null)return i;r=r.parentElement}return!1}function ll(e,t){if(t==="bold"){e.style.fontWeight="700";return}if(t==="italic"){e.style.fontStyle="italic";return}if(t==="underline"){const r=tt(e);r.includes("underline")||r.push("underline"),kt(e,r);return}const n=tt(e);n.includes("line-through")||n.push("line-through"),kt(e,n)}function sl(e,t){if(t==="bold"){e.style.fontWeight="",e.style.removeProperty("font-weight");return}if(t==="italic"){e.style.fontStyle="",e.style.removeProperty("font-style");return}if(t==="underline"){kt(e,tt(e).filter(n=>n!=="underline"));return}kt(e,tt(e).filter(n=>n!=="line-through"))}function Fu(e,t){if(t==="bold"){e.style.fontWeight="400";return}if(t==="italic"){e.style.fontStyle="normal";return}if(t==="underline"){const r=tt(e).filter(i=>i!=="underline");if(r.length===0){e.style.textDecorationLine="none";return}kt(e,r);return}const n=tt(e).filter(r=>r!=="line-through");if(n.length===0){e.style.textDecorationLine="none";return}kt(e,n)}function Iu(e,t){Qn(e,n=>ll(n,t))}function Bu(e,t,n){let r=t;for(;r.parentElement&&r.parentElement!==e;){const i=r.parentElement;if(!Ve(i)||!Wn(i,n)){r=i;continue}if(ft(i,r),Wn(i,n)){if(yt[n].has(i.tagName.toLowerCase())){Re(i);continue}if(sl(i,n),mt(i)){Re(i);continue}}r=i}}function Hu(e,t,n){const r=Ne(t).filter(i=>i.data.length>0);return r.length===0?Ct(e,t.startContainer,n):r.every(i=>Ct(e,i,n))}function Ou(e,t,n,r){et(t);const i=Ne(t).filter(a=>a.data.length>0);for(const a of i)r?Ct(e,a,n)||Iu(a,n):Bu(e,a,n);Nt(i)}function Ln(e){const t=window.getSelection();if(!t||t.rangeCount===0)return $e();const n=t.getRangeAt(0);if(!ae(e,n.commonAncestorContainer))return $e();if(n.collapsed)return go(e,n);const r=Ne(n).filter(a=>a.data.length>0);if(r.length===0)return go(e,n);const i=$e();for(const a of _e)i[a]=Ct(e,r[0],a);for(let a=1;a<r.length;a+=1)for(const l of _e)i[l]=i[l]&&Ct(e,r[a],l);return i}function go(e,t){const n=$e();for(const r of _e)n[r]=Ct(e,t.startContainer,r);return n}function Wi(e,t){const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0);if(!ae(e,r.commonAncestorContainer)||r.collapsed)return!1;const i=Hu(e,r,t);return Ou(e,r,t,!i),!0}function zu(e){const t=e.startContainer,n=e.startOffset;if(t.nodeType!==Node.TEXT_NODE)return;const r=t;if(n<=0||n>=r.length)return;const i=r.splitText(n);e.setStart(i,0),e.collapse(!0)}function Ku(e,t,n){var a,l,c;zu(t);let r=t.startContainer.nodeType===Node.TEXT_NODE&&t.startOffset===0?t.startContainer:t.startContainer.childNodes[t.startOffset]??t.startContainer.lastChild??t.startContainer;if(t.startContainer.nodeType===Node.TEXT_NODE&&t.startOffset>0){const m=document.createTextNode("");(a=t.startContainer.parentNode)==null||a.insertBefore(m,t.startContainer.nextSibling),r=m}else if(t.startContainer.nodeType===Node.TEXT_NODE&&t.startOffset===0){const m=document.createTextNode("");(l=t.startContainer.parentNode)==null||l.insertBefore(m,t.startContainer),r=m}else{const m=document.createTextNode("");r&&r!==t.startContainer?(c=r.parentNode)==null||c.insertBefore(m,r):t.startContainer.appendChild(m),r=m}let i=r;for(;i.parentElement&&i.parentElement!==e;){const m=i.parentElement;if(!Ve(m)){i=m;continue}if(!n.some(b=>Wn(m,b))){i=m;continue}ft(m,i);for(const b of n)if(Wn(m,b)){if(yt[b].has(m.tagName.toLowerCase())){Re(m);break}if(sl(m,b),mt(m)){Re(m);break}}i=m.isConnected?m:r}return r}function $u(e,t,n){for(const r of _e)n[r]!==t[r]&&(n[r]?ll(e,r):Fu(e,r))}function Uu(e,t,n,r,i,a){var g,k;const l=window.getSelection();if(!l||l.rangeCount===0)return;const c=l.getRangeAt(0);if(!ae(e,c.commonAncestorContainer))return;const m=go(e,c),p=il(m,n),b=_e.filter(P=>m[P]&&!p[P]),h=Lu(e,c.startContainer,i),w=Gc(e,c.startContainer,a);let x=null;b.length>0?(x=Ku(e,c,b),h.length>0&&ol(e,x,h),w&&ho(e,x)):h.length>0?(x=Nu(e,c,h),w&&ho(e,x)):w?x=qc(e,c):c.deleteContents();const S=document.createElement("span");$u(S,m,p),r&&ku(S,r),i!=null&&i.color&&Ui(S,"color",i.color),i!=null&&i.backgroundColor&&Ui(S,"backgroundColor",i.backgroundColor),a&&Kc(S,a),S.textContent=t;const y=S.style.cssText.trim()?S:document.createTextNode(t);x?((g=x.parentNode)==null||g.insertBefore(y,x),x.nodeType===Node.TEXT_NODE&&!x.data&&((k=x.parentNode)==null||k.removeChild(x))):c.insertNode(y);const C=document.createRange();C.setStartAfter(y),C.collapse(!0),l.removeAllRanges(),l.addRange(C)}const qn="data-page";function cl(e,t){return e instanceof HTMLElement&&e!==t&&e.parentElement===t&&e.hasAttribute(qn)}function ul(e){return[...e.children].filter(t=>t instanceof HTMLElement)}function Wu(e){return[...e.childNodes].some(t=>t.nodeType===Node.TEXT_NODE&&(t.textContent??"").trim()!=="")}function sn(e){return ul(e).find(n=>n.hasAttribute(qn))??null}function qu(e){if(Wu(e))return null;const t=ul(e);if(t.length!==1)return null;const n=t[0];return n.tagName.toLowerCase()!=="div"?null:n}function Gu(e){const t=sn(e);if(t)return t;const n=qu(e);if(n)return n.setAttribute(qn,""),n;const r=document.createElement("div");for(r.setAttribute(qn,"");e.firstChild;)r.appendChild(e.firstChild);return e.appendChild(r),r}function zo(e){return sn(e)??e}function dl(e){const t=sn(e),n=(t==null?void 0:t.style.backgroundColor.trim())??"";n?e.style.backgroundColor=n:e.style.removeProperty("background-color")}function qi(e){return{text:e.text,collapsed:e.collapsed,start:e.start,end:e.end}}function Vu(e,t){return t?e===t||e.contains(t):!1}function Gi(e,t){var a;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r=0,i;for(;i=n.nextNode();){if(i===t||t.contains(i)||t.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING)return r;r+=((a=i.textContent)==null?void 0:a.length)??0}return r}function Vi(e,t,n){var a;if(t.nodeType===Node.TEXT_NODE)return Gi(e,t)+n;let r=0;const i=t.childNodes;for(let l=0;l<n&&l<i.length;l+=1)r+=((a=i[l].textContent)==null?void 0:a.length)??0;return Gi(e,t)+r}function Xi(e,t){var l,c;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r=Math.max(0,t),i,a=null;for(;i=n.nextNode();){a=i;const m=((l=i.textContent)==null?void 0:l.length)??0;if(r<=m)return{node:i,offset:r};r-=m}return a?{node:a,offset:((c=a.textContent)==null?void 0:c.length)??0}:{node:e,offset:e.childNodes.length}}function ml(e,t,n){const r=document.createRange(),i=Xi(e,t),a=Xi(e,n);return r.setStart(i.node,i.offset),r.setEnd(a.node,a.offset),r}function Xu(e,t){try{const n=e.commonAncestorContainer;return t===n||t.contains(n)}catch{return!1}}function Je(e){var n;if(e.mode==="html"&&e.htmlEl){const r=e.htmlEl.selectionStart,i=e.htmlEl.selectionEnd;return{mode:"html",text:e.htmlEl.value.slice(r,i),collapsed:r===i,start:r,end:i,visualRange:null}}const t=e.visualEl;if(e.mode==="visual"&&t){const r=window.getSelection();if(r&&r.rangeCount>0){const a=r.getRangeAt(0);if(Vu(t,a.commonAncestorContainer)){const l=Vi(t,a.startContainer,a.startOffset),c=Vi(t,a.endContainer,a.endOffset);return{mode:"visual",text:a.toString(),collapsed:a.collapsed,start:Math.min(l,c),end:Math.max(l,c),visualRange:a.cloneRange()}}}const i=((n=t.textContent)==null?void 0:n.length)??0;return{mode:"visual",text:"",collapsed:!0,start:i,end:i,visualRange:null}}return{mode:e.mode,text:"",collapsed:!0,start:0,end:0,visualRange:null}}function Yi(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Yu(e){if(e.snapshot.mode==="html"){const a=e.getHtml(),l=e.snapshot.start,c=e.snapshot.end,m=e.asHtml?e.content:Yi(e.content);e.setHtml(a.slice(0,l)+m+a.slice(c));const p=e.htmlEl;if(p){const b=l+m.length;p.focus(),p.setSelectionRange(b,b)}return}const t=e.visualEl;if(!t){const a=e.asHtml?e.content:Yi(e.content);e.setHtml(e.getHtml()+a);return}const r=(e.snapshot.visualRange&&Xu(e.snapshot.visualRange,t)?e.snapshot.visualRange:null)??ml(t,e.snapshot.start,e.snapshot.end);if(r.deleteContents(),e.content)if(e.asHtml){const a=r.createContextualFragment(e.content),l=a.lastChild;r.insertNode(a),l&&(r.setStartAfter(l),r.collapse(!0))}else{const a=document.createTextNode(e.content);r.insertNode(a),r.setStartAfter(a),r.collapse(!0)}const i=window.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(r),e.setHtml(t.innerHTML)}const Ko=new Set(["p","h1","h2","h3","h4","h5","h6","div","li","blockquote"]),fl=new Set(["table","thead","tbody","tr","td","th"]),$o=new Set([...fl,"ul","ol","li","pre"]);function ie(e){return e.tagName.toLowerCase()}function rr(e){return e.nodeType===Node.TEXT_NODE?e.parentElement:e instanceof Element?e:e.parentElement}function Uo(e){return e instanceof HTMLElement&&(ie(e)==="ul"||ie(e)==="ol")}function Ee(e){return e instanceof HTMLElement&&ie(e)==="li"}function nt(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return ae(e,n.commonAncestorContainer)?n:null}function Wo(e){const t=e.collapsed?[]:Ne(e).filter(n=>n.data.length>0);return t.length>0?t:[e.startContainer]}function vt(e,t,n){var m,p,b;if(t.nodeType===Node.TEXT_NODE){const h=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let w=0,x;for(;x=h.nextNode();){if(x===t)return w+n;w+=((m=x.textContent)==null?void 0:m.length)??0}return w}let r=0;const i=t.childNodes;for(let h=0;h<n&&h<i.length;h+=1)r+=((p=i[h].textContent)==null?void 0:p.length)??0;const a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let l=0,c;for(;c=a.nextNode();){if(t.contains(c)||t.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_FOLLOWING)return l+r;l+=((b=c.textContent)==null?void 0:b.length)??0}return l+r}function qo(e,t,n){const r=ml(e,t,n),i=window.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(r)}function Lt(e,t){const n=nt(e);if(!n)return!1;const r=vt(e,n.startContainer,n.startOffset),i=vt(e,n.endContainer,n.endOffset),a=Math.min(r,i),l=Math.max(r,i),c=t();return qo(e,a,l),c}function Go(e,t){if(ie(e)===t)return e;const n=document.createElement(t);for(const r of[...e.attributes])n.setAttribute(r.name,r.value);for(;e.firstChild;)n.appendChild(e.firstChild);return e.replaceWith(n),n}function rt(e){var t;(t=e.getAttribute("style"))!=null&&t.trim()||e.removeAttribute("style")}function Ju(e,t){let n=rr(t);for(;n&&n!==e;){if(cl(n,e)){n=n.parentElement;continue}const r=ie(n);if(Ko.has(r)&&n instanceof HTMLElement)return n;if(fl.has(r)||r==="pre")return null;n=n.parentElement}return null}function Tt(e){const t=nt(e);if(!t)return[];const n=new Set,r=[];for(const i of Wo(t)){const a=Ju(e,i);a&&!n.has(a)&&(n.add(a),r.push(a))}return r}function bo(e){if(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.COMMENT_NODE||!(e instanceof Element))return!0;const t=ie(e);return Ko.has(t)||$o.has(t)?!1:Ve(e)||t==="br"||t==="a"||t==="img"||t==="span"}function Zu(e,t){let n=rr(t);for(;n&&n!==e;){if($o.has(ie(n)))return!0;n=n.parentElement}return!1}function Qu(e,t){let n=t;for(;n&&n.parentNode!==e;)n=n.parentNode;return n&&n.parentNode===e?n:null}function ed(e,t){const n=[...e.childNodes],r=n.indexOf(t);if(r<0)return[t];let i=r,a=r;for(;i>0&&bo(n[i-1]);)i-=1;for(;a<n.length-1&&bo(n[a+1]);)a+=1;return n.slice(i,a+1)}function td(e,t,n){return n.startContainer===e?e.childNodes[Math.min(n.startOffset,Math.max(0,e.childNodes.length-1))]??e.firstChild:n.startContainer===t&&e!==t?e.firstChild:Qu(e,n.startContainer)}function nd(e,t){const n=zo(e);if(Zu(e,t.startContainer))return null;if(!n.firstChild){const l=document.createElement("p");return l.appendChild(document.createElement("br")),n.appendChild(l),l}const r=td(n,e,t);if(!r||r instanceof Element&&$o.has(ie(r))||r instanceof HTMLElement&&Ko.has(ie(r))||!bo(r))return null;const i=ed(n,r),a=document.createElement("p");n.insertBefore(a,i[0]);for(const l of i)a.appendChild(l);return a}function cn(e){const t=Tt(e);if(t.length>0)return t;const n=nt(e);if(!n)return[];const r=nd(e,n);return r?[r]:[]}function Dt(e){const t=e.parentElement;return t&&Uo(t)?t:null}function pl(e){if(e.length===0)return[];const t=[[e[0]]];for(let n=1;n<e.length;n+=1){const r=e[n-1],i=e[n];r.parentNode===i.parentNode&&rd(r,i)?t[t.length-1].push(i):t.push([i])}return t}function rd(e,t){var r;let n=e.nextSibling;for(;n;){if(n===t)return!0;if(n.nodeType===Node.TEXT_NODE&&!((r=n.textContent)!=null&&r.trim())){n=n.nextSibling;continue}return!1}return!1}const Gn=["p","h1","h2","h3","h4","h5","h6"],od=new Set(Gn),hl=new Set([...Gn,"div"]),or=new Set(["li","ul","ol","td","th","tr","thead","tbody","table","blockquote","pre"]),id=()=>({tag:null,mixed:!1});function gl(e){return od.has(e)}function ad(e){return gl(e)?e:e==="div"?"p":null}function ld(e){return e instanceof Element&&or.has(ie(e))}function bl(e){return e instanceof HTMLElement&&hl.has(ie(e))}function yo(e){if(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.COMMENT_NODE||!(e instanceof Element))return!0;const t=ie(e);return hl.has(t)||or.has(t)?!1:Ve(e)||t==="br"||t==="a"||t==="img"||t==="span"}function sd(e,t){let n=rr(t);for(;n&&n!==e;){if(or.has(ie(n)))return!0;n=n.parentElement}return!1}function yl(e,t){let n=rr(t);for(;n&&n!==e;){if(cl(n,e)){n=n.parentElement;continue}if(bl(n))return n;if(or.has(ie(n)))return null;n=n.parentElement}return null}function cd(e,t){const n=new Set,r=[];for(const i of Wo(t)){const a=yl(e,i);a&&!n.has(a)&&(n.add(a),r.push(a))}return r}function ud(e,t){let n=t;for(;n&&n.parentNode!==e;)n=n.parentNode;return n&&n.parentNode===e?n:null}function dd(e,t){const n=[...e.childNodes],r=n.indexOf(t);if(r<0)return[t];let i=r,a=r;for(;i>0&&yo(n[i-1]);)i-=1;for(;a<n.length-1&&yo(n[a+1]);)a+=1;return n.slice(i,a+1)}function md(e,t,n){return n.startContainer===e?e.childNodes[Math.min(n.startOffset,Math.max(0,e.childNodes.length-1))]??e.firstChild:n.startContainer===t&&e!==t?e.firstChild:ud(e,n.startContainer)}function fd(e,t,n){const r=zo(e);if(sd(e,t.startContainer))return!1;if(!r.firstChild){const c=document.createElement(n);return c.appendChild(document.createElement("br")),r.appendChild(c),!0}const i=md(r,e,t);if(!i||ld(i)||bl(i)||!yo(i))return!1;const a=dd(r,i),l=document.createElement(n);r.insertBefore(l,a[0]);for(const c of a)l.appendChild(c);return!0}function pd(e){const t=nt(e);if(!t)return id();const n=Wo(t).map(i=>{const a=yl(e,i);return a?ad(ie(a)):null}),r=n[0];return n.every(i=>i===r)?{tag:r??null,mixed:!1}:{tag:null,mixed:!0}}function hd(e,t){if(!gl(t))return!1;const n=nt(e);if(!n)return!1;const r=vt(e,n.startContainer,n.startOffset),i=vt(e,n.endContainer,n.endOffset),a=Math.min(r,i),l=Math.max(r,i),c=cd(e,n);let m=!1;if(c.length===0)m=fd(e,n,t);else for(const p of c)ie(p)!==t&&(Go(p,t),m=!0);return qo(e,a,l),m}function Vo(e){if(!Ee(e))return null;const t=Dt(e);if(!t)return null;const n=ie(t);return n==="ul"||n==="ol"?n:null}function xl(e){const t=Tt(e);if(t.length===0)return{type:null,mixed:!1};const n=t.map(Vo),r=n[0];return n.every(i=>i===r)?{type:r,mixed:!1}:{type:null,mixed:!0}}function gd(e,t,n){const r=[...e.children].filter(i=>Uo(i));for(const i of r)t.insertBefore(i,n)}function wl(e){const t=Dt(e),n=document.createElement("p");for(const p of[...e.attributes])n.setAttribute(p.name,p.value);for(n.style.marginLeft="",rt(n);e.firstChild&&!Uo(e.firstChild);)n.appendChild(e.firstChild);const r=[];let i=e.nextElementSibling;for(;i;)r.push(i),i=i.nextElementSibling;const a=(t==null?void 0:t.parentNode)??e.parentNode;if(!t||!a)return e.replaceWith(n),n;const l=Ee(a)?a.parentNode??a:a,c=Ee(a)?a.nextSibling:t.nextSibling;e.remove();let m=null;if(r.length>0){m=document.createElement(t.tagName);for(const p of r)m.appendChild(p)}return l.insertBefore(n,c),m&&l.insertBefore(m,n.nextSibling),gd(e,l,n.nextSibling),t.childElementCount===0&&t.remove(),n}function bd(e){if(Ee(e))return e;const t=Go(e,"li");return t.style.marginLeft="",rt(t),t}function Sl(e,t){if(e.length===0)return!1;if(e.every(Ee)){const a=Dt(e[0]);if(a&&e.every(l=>l.parentElement===a)&&[...a.children].every(c=>c instanceof HTMLElement&&e.includes(c)))return ie(a)===t?!1:(Go(a,t),!0)}const n=e[0],r=n.parentNode;if(!r)return!1;const i=document.createElement(t);r.insertBefore(i,n);for(const a of e){const l=Ee(a)?Dt(a):null;i.appendChild(bd(a)),l&&l!==i&&l.childElementCount===0&&l.remove()}return!0}function kl(e){let t=!1;for(const n of[...e].reverse())Ee(n)&&(wl(n),t=!0);return t}function yd(e,t){return Lt(e,()=>{const n=cn(e);if(n.length===0)return!1;if(n.every(a=>Vo(a)===t))return kl(n);let i=!1;for(const a of pl(n))Sl(a,t)&&(i=!0);return i})}function xd(e,t){return Lt(e,()=>{const n=cn(e);if(n.length===0)return!1;if(t===null)return kl(n);if(n.every(a=>Vo(a)===t))return!1;let i=!1;for(const a of pl(n))Sl(a,t)&&(i=!0);return i})}const Cl=40;function Xo(e){const t=e.style.marginLeft;if(!t)return 0;const n=Number.parseFloat(t);return Number.isFinite(n)?n:0}function vl(e,t){if(t<=0){e.style.marginLeft="",rt(e);return}e.style.marginLeft=`${t}px`}function wd(e){let t=e.previousElementSibling;for(;t;){if(Ee(t))return t;t=t.previousElementSibling}return null}function Sd(e){for(let t=e.children.length-1;t>=0;t-=1){const n=e.children[t];if(n instanceof HTMLElement&&(ie(n)==="ul"||ie(n)==="ol"))return n}return null}function kd(e){const t=wd(e);if(!t)return!1;const n=Dt(e);if(!n)return!1;const r=ie(n)==="ol"?"ol":"ul";let i=Sd(t);return(!i||ie(i)!==r)&&(i=document.createElement(r),t.appendChild(i)),i.appendChild(e),!0}function Cd(e){const t=Dt(e);if(!t)return!1;const n=t.parentElement;if(n&&Ee(n)){const r=n.parentElement;return r?(r.insertBefore(e,n.nextSibling),t.childElementCount===0&&t.remove(),!0):!1}return wl(e),!0}function vd(e){return Tt(e).some(n=>Ee(n)||Xo(n)>0)}function Dd(e){return Lt(e,()=>{const t=cn(e);if(t.length===0)return!1;let n=!1;for(const r of t){if(Ee(r)){kd(r)&&(n=!0);continue}vl(r,Xo(r)+Cl),n=!0}return n})}function Ad(e){return Lt(e,()=>{const t=Tt(e);if(t.length===0)return!1;let n=!1;for(const r of[...t].reverse()){if(Ee(r)){Cd(r)&&(n=!0);continue}const i=Xo(r);i<=0||(vl(r,Math.max(0,i-Cl)),n=!0)}return n})}const Dl="pt",Pd=/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(pt|px|em|rem|%)$/i,Ed=/^[+-]?0(?:\.0+)?$/;function Ae(e){return`${Y(e.value)}${e.unit}`}function Le(e){const t=e.trim();if(!t)return null;if(Ed.test(t))return{value:0,unit:"px"};const n=t.match(Pd);if(!n)return null;const r=Number(n[1]);if(!Number.isFinite(r))return null;const i=n[2]==="%"?"%":n[2].toLowerCase();return nr(i)?{value:xe(r),unit:i}:null}function Vn(e,t,n){const r=e.trim();if(!r)return null;const i=Le(r);if(i)return!n&&i.value<0?{...i,value:0}:i;const a=Number(r.replace(",","."));return Number.isFinite(a)?!n&&a<0?{value:0,unit:t}:{value:xe(a),unit:t}:null}function ot(e){return e.value>=0?e:{value:0,unit:e.unit}}function Pe(e,t){return e===t?!0:!e||!t?!1:e.value===t.value&&e.unit===t.unit}const Oe=["top","right","bottom","left"],ir=["none","solid","dotted","dashed","double","groove","ridge","inset","outset"],We={top:null,right:null,bottom:null,left:null},Yo={style:"none",width:null,color:null},jd=new Set(ir),Ji={value:0,unit:"px"};function Nd(){return{margin:{...We},padding:{...We},lineHeight:null,border:{...Yo},borderRadius:null,boxShadow:null,backgroundColor:null,opacity:null}}function Jo(){const e=Nd();return{margin:e.margin,marginMixed:!1,padding:e.padding,paddingMixed:!1,lineHeight:e.lineHeight,lineHeightMixed:!1,border:e.border,borderMixed:!1,borderRadius:e.borderRadius,radiusMixed:!1,boxShadow:e.boxShadow,shadowMixed:!1,backgroundColor:e.backgroundColor,backgroundMixed:!1,opacity:e.opacity,opacityMixed:!1}}function qe(e,t){return Oe.every(n=>Pe(e[n],t[n]))}function Al(e,t){return e===t?!0:!e||!t||e.kind!==t.kind?!1:e.kind==="normal"||t.kind==="normal"?!0:e.kind==="number"&&t.kind==="number"?e.value===t.value:e.kind==="length"&&t.kind==="length"&&e.value===t.value&&e.unit===t.unit}function Pl(e,t){return e.style===t.style&&Pe(e.width,t.width)&&e.color===t.color}function El(e,t){return e===t?!0:!e||!t?!1:Pe(e.offsetX,t.offsetX)&&Pe(e.offsetY,t.offsetY)&&Pe(e.blur,t.blur)&&Pe(e.spread,t.spread)&&e.color===t.color&&e.inset===t.inset}function Ld(e){return e.kind==="normal"?"normal":e.kind==="number"?Y(e.value):Ae({value:e.value,unit:e.unit})}function Td(e){const t=e.trim();if(!t)return null;if(t.endsWith("%")){const r=Number(t.slice(0,-1).trim().replace(",","."));return Number.isFinite(r)?At(r/100):null}const n=Number(t.replace(",","."));return Number.isFinite(n)?At(n):null}function At(e){return xe(Math.min(1,Math.max(0,e)))}function Xn(e){return xe(At(e)*100)}function jl(e){return At(e/100)}function Md(e){return Y(At(e))}function Rd(e){const t=e.trim();if(!t)return null;if(t.toLowerCase()==="normal")return{kind:"normal"};if(/^[+]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(t)){const r=Number(t);return!Number.isFinite(r)||r<0?null:{kind:"number",value:xe(r)}}const n=Le(t);return!n||n.value<0?null:{kind:"length",value:n.value,unit:n.unit}}function _d(e,t){const n=[];let r="",i=0;for(const a of e){if(a==="("){i+=1,r+=a;continue}if(a===")"){i=Math.max(0,i-1),r+=a;continue}if(a===t&&i===0){r.trim()&&n.push(r.trim()),r="";continue}r+=a}return r.trim()&&n.push(r.trim()),n}function Fd(e){const t=[];let n="",r=0;for(const i of e){if(i==="("){r+=1,n+=i;continue}if(i===")"){r=Math.max(0,r-1),n+=i;continue}if(/\s/.test(i)&&r===0){n&&t.push(n),n="";continue}n+=i}return n&&t.push(n),t}function Id(e){const t=[Ae(e.offsetX),Ae(e.offsetY),Ae(e.blur),Ae(e.spread)];e.color&&t.push(e.color);const n=t.join(" ");return e.inset?`inset ${n}`:n}function Bd(e){const t=e.trim();if(!t||t.toLowerCase()==="none")return null;const n=_d(t,",")[0];if(!n)return null;const r=Fd(n);let i=!1,a=null;const l=[];for(const c of r){if(c.toLowerCase()==="inset"){i=!0;continue}const m=Le(c);if(m){l.push(m);continue}const p=se(c);if(p){a=p;continue}return null}return l.length<2||l.length>4?null:{offsetX:l[0],offsetY:l[1],blur:l[2]??Ji,spread:l[3]??Ji,color:a,inset:i}}function xt(e,t){return Le(e.style.getPropertyValue(t))}function Hd(e,t,n,r){const i=n&&r?ot(n):n,a=i?Ae(i):"";return e.style.getPropertyValue(t)===a?!1:(a?e.style.setProperty(t,a):e.style.removeProperty(t),!0)}function Zi(e,t){return{top:xt(e,`${t}-top`),right:xt(e,`${t}-right`),bottom:xt(e,`${t}-bottom`),left:xt(e,`${t}-left`)}}function Qi(e,t,n,r){let i=!1;for(const a of Oe)Hd(e,`${t}-${a}`,n[a],r)&&(i=!0);return i}function Od(e){const t=e.trim().toLowerCase();return jd.has(t)?t:"none"}function Nl(e){const t=Od(e.style.borderStyle||e.style.borderTopStyle),n=xt(e,"border-width")??xt(e,"border-top-width"),r=e.style.borderColor||e.style.borderTopColor,i=r?se(r):null;return{style:t,width:n,color:i}}function zd(e,t){const n=Nl(e),r=t.style==="none"?{style:"none",width:null,color:null}:{style:t.style,width:t.width?ot(t.width):null,color:t.color};return Pl(n,r)?!1:r.style==="none"?(e.style.removeProperty("border"),e.style.removeProperty("border-style"),e.style.removeProperty("border-width"),e.style.removeProperty("border-color"),!0):(e.style.borderStyle=r.style,r.width?e.style.borderWidth=Ae(r.width):e.style.removeProperty("border-width"),r.color?e.style.borderColor=r.color:e.style.removeProperty("border-color"),!0)}function Ll(e){const t=e.style.borderRadius.trim();if(!t)return null;const n=t.split(/\s+/)[0];return Le(n)}function Kd(e,t){const n=t?ot(t):null,r=Ll(e);return Pe(r,n)?!1:(n?e.style.borderRadius=Ae(n):e.style.removeProperty("border-radius"),!0)}function Tl(e){return Bd(e.style.boxShadow)}function $d(e,t){const n=Tl(e),r=t?{...t,blur:ot(t.blur)}:null;return El(n,r)?!1:(r?e.style.boxShadow=Id(r):e.style.removeProperty("box-shadow"),!0)}function Ml(e){return Rd(e.style.lineHeight)}function Ud(e,t){const n=Ml(e);return Al(n,t)?!1:(t?e.style.lineHeight=Ld(t):e.style.removeProperty("line-height"),!0)}function Rl(e){const t=e.style.backgroundColor;return t?se(t):null}function Wd(e,t){const n=t?se(t):null;return Rl(e)===n?!1:(n?e.style.backgroundColor=n:e.style.removeProperty("background-color"),!0)}function _l(e){return Td(e.style.opacity)}function qd(e,t){const n=_l(e),r=t===null?null:At(t);return n===r?!1:(r===null?e.style.removeProperty("opacity"):e.style.opacity=Md(r),!0)}function Mt(e){return{margin:Zi(e,"margin"),padding:Zi(e,"padding"),lineHeight:Ml(e),border:Nl(e),borderRadius:Ll(e),boxShadow:Tl(e),backgroundColor:Rl(e),opacity:_l(e)}}function Rt(e,t){let n=!1;return!t.marginMixed&&Qi(e,"margin",t.margin,!1)&&(n=!0),!t.paddingMixed&&Qi(e,"padding",t.padding,!0)&&(n=!0),!t.lineHeightMixed&&Ud(e,t.lineHeight)&&(n=!0),!t.borderMixed&&zd(e,t.border)&&(n=!0),!t.radiusMixed&&Kd(e,t.borderRadius)&&(n=!0),!t.shadowMixed&&$d(e,t.boxShadow)&&(n=!0),!t.backgroundMixed&&Wd(e,t.backgroundColor)&&(n=!0),!t.opacityMixed&&qd(e,t.opacity)&&(n=!0),n&&rt(e),n}function Gd(e){const t=Jo(),n=Tt(e);if(n.length===0)return t;const r=n.map(Mt),i=r[0];return{margin:i.margin,marginMixed:r.some(a=>!qe(a.margin,i.margin)),padding:i.padding,paddingMixed:r.some(a=>!qe(a.padding,i.padding)),lineHeight:i.lineHeight,lineHeightMixed:r.some(a=>!Al(a.lineHeight,i.lineHeight)),border:i.border,borderMixed:r.some(a=>!Pl(a.border,i.border)),borderRadius:i.borderRadius,radiusMixed:r.some(a=>!Pe(a.borderRadius,i.borderRadius)),boxShadow:i.boxShadow,shadowMixed:r.some(a=>!El(a.boxShadow,i.boxShadow)),backgroundColor:i.backgroundColor,backgroundMixed:r.some(a=>a.backgroundColor!==i.backgroundColor),opacity:i.opacity,opacityMixed:r.some(a=>a.opacity!==i.opacity)}}function Vd(e,t){return Lt(e,()=>{const n=cn(e);if(n.length===0)return!1;let r=!1;for(const i of n)Rt(i,t)&&(r=!0);return r})}const Fl=["left","center","right","justify"];function Xd(e){const t=e.trim().toLowerCase();return t==="center"?"center":t==="right"||t==="end"?"right":t==="justify"?"justify":"left"}function Yd(e){return Xd(e.style.textAlign)}function Il(e){const t=Tt(e);if(t.length===0)return nt(e)?{align:"left",mixed:!1}:{align:null,mixed:!1};const n=t.map(Yd),r=n[0];return n.every(i=>i===r)?{align:r,mixed:!1}:{align:null,mixed:!0}}function Bl(e,t){return Fl.includes(t)?Lt(e,()=>{const n=cn(e);if(n.length===0)return!1;let r=!1;for(const i of n)i.style.textAlign!==t&&(i.style.textAlign=t,r=!0);return r}):!1}function Jt(){return{...Jo(),align:"left",alignMixed:!1,list:null,listMixed:!1}}function ea(e){const t=Gd(e),n=Il(e),r=xl(e);return{...t,align:n.align,alignMixed:n.mixed,list:r.type,listMixed:r.mixed}}function Hl(e,t){let n=!1;return!t.alignMixed&&t.align&&Bl(e,t.align)&&(n=!0),t.listMixed||xd(e,t.list)&&(n=!0),Vd(e,t)&&(n=!0),n}function Jd(e,t){return Hl(e,xo(t))}function Ol(e){return{align:e.alignMixed?void 0:e.align??"left",list:e.listMixed?void 0:e.list,margin:e.marginMixed?void 0:e.margin,padding:e.paddingMixed?void 0:e.padding,lineHeight:e.lineHeightMixed?void 0:e.lineHeight,border:e.borderMixed?void 0:e.border,borderRadius:e.radiusMixed?void 0:e.borderRadius,boxShadow:e.shadowMixed?void 0:e.boxShadow,backgroundColor:e.backgroundMixed?void 0:e.backgroundColor,opacity:e.opacityMixed?void 0:e.opacity}}function xo(e){const t=Jt();return e?{align:e.align??t.align,alignMixed:e.align===void 0,list:e.list===void 0?t.list:e.list,listMixed:e.list===void 0,margin:e.margin??t.margin,marginMixed:e.margin===void 0,padding:e.padding??t.padding,paddingMixed:e.padding===void 0,lineHeight:e.lineHeight===void 0?t.lineHeight:e.lineHeight,lineHeightMixed:e.lineHeight===void 0,border:e.border??t.border,borderMixed:e.border===void 0,borderRadius:e.borderRadius===void 0?t.borderRadius:e.borderRadius,radiusMixed:e.borderRadius===void 0,boxShadow:e.boxShadow===void 0?t.boxShadow:e.boxShadow,shadowMixed:e.boxShadow===void 0,backgroundColor:e.backgroundColor===void 0?t.backgroundColor:e.backgroundColor,backgroundMixed:e.backgroundColor===void 0,opacity:e.opacity===void 0?t.opacity:e.opacity,opacityMixed:e.opacity===void 0}:{...t,alignMixed:!0,listMixed:!0,marginMixed:!0,paddingMixed:!0,lineHeightMixed:!0,borderMixed:!0,radiusMixed:!0,shadowMixed:!0,backgroundMixed:!0,opacityMixed:!0}}function Zd(){return{size:null,unit:ut,marks:$e(),fontFamily:null,fontFamilyMixed:!1,fontColor:null,highlightColor:null,fontColorMixed:!1,highlightColorMixed:!1}}function wo(){return{font:Zd(),box:Jo()}}function Qd(e){const t=e.style.fontSize,n=t?Ho(t):null,r=n&&nr(n.unit)?{value:n.value,unit:n.unit}:null,i=`${e.style.textDecorationLine} ${e.style.textDecoration}`.toLowerCase(),a=e.style.fontWeight.trim().toLowerCase(),l={bold:a==="bold"||Number(a)>=700,italic:e.style.fontStyle.trim().toLowerCase()==="italic",underline:/\bunderline\b/.test(i),strikethrough:/\bline-through\b/.test(i)},c=e.style.color,m=e.style.fontFamily.trim();return{size:(r==null?void 0:r.value)??null,unit:(r==null?void 0:r.unit)??ut,marks:l,fontFamily:m||null,fontFamilyMixed:!1,fontColor:c?se(c):null,highlightColor:null,fontColorMixed:!1,highlightColorMixed:!1}}function em(e,t){const n=e.style.fontSize,r=t.size===null?null:dt(t.size,t.unit);if(!r)return n?(e.style.removeProperty("font-size"),!0):!1;const i=Bo(r.value,r.unit);return n===i?!1:(e.style.fontSize=i,!0)}function tm(e,t){var i;if(t.fontFamilyMixed)return!1;const n=(i=t.fontFamily)!=null&&i.trim()?t.fontFamily.trim():null,r=e.style.fontFamily.trim()||null;return ln(r,n)?!1:(n?e.style.fontFamily=n:e.style.removeProperty("font-family"),!0)}function nm(e,t){if(t.fontColorMixed)return!1;const n=t.fontColor?se(t.fontColor):null;return(e.style.color?se(e.style.color):null)===n?!1:(n?e.style.color=n:e.style.removeProperty("color"),!0)}function rm(e,t){let n=!1;const r=t.bold?"bold":"";e.style.fontWeight!==r&&(r?e.style.fontWeight=r:e.style.removeProperty("font-weight"),n=!0);const i=t.italic?"italic":"";e.style.fontStyle!==i&&(i?e.style.fontStyle=i:e.style.removeProperty("font-style"),n=!0);const a=[];t.underline&&a.push("underline"),t.strikethrough&&a.push("line-through");const l=a.join(" ");return(e.style.textDecorationLine||e.style.textDecoration).trim()!==l&&(l?e.style.textDecoration=l:(e.style.removeProperty("text-decoration"),e.style.removeProperty("text-decoration-line")),n=!0),n}function om(e,t){let n=!1;return em(e,t)&&(n=!0),tm(e,t)&&(n=!0),nm(e,t)&&(n=!0),rm(e,t.marks)&&(n=!0),n&&rt(e),n}function im(e){const t=e.box;return t.backgroundMixed||t.backgroundColor?t:!e.font.highlightColorMixed&&e.font.highlightColor?{...t,backgroundColor:e.font.highlightColor}:t}function am(e){const t=sn(e);if(!t)return wo();const n=Mt(t);return{font:Qd(t),box:{margin:n.margin,marginMixed:!1,padding:n.padding,paddingMixed:!1,lineHeight:n.lineHeight,lineHeightMixed:!1,border:n.border,borderMixed:!1,borderRadius:n.borderRadius,radiusMixed:!1,boxShadow:n.boxShadow,shadowMixed:!1,backgroundColor:n.backgroundColor,backgroundMixed:!1,opacity:n.opacity,opacityMixed:!1}}}function lm(e,t){const n=nt(e),r=n?vt(e,n.startContainer,n.startOffset):null,i=n?vt(e,n.endContainer,n.endOffset):null,a=sn(e),l=Gu(e),c=om(l,t.font),m=Rt(l,im(t));return dl(e),r!==null&&i!==null&&qo(e,Math.min(r,i),Math.max(r,i)),!a||c||m}const Zo="data-hover-html",sm="noopener noreferrer",cm="var n=this._hoverBox;if(!n){n=document.createElement('div');n.style.cssText='position:absolute;z-index:2147483646;background:#fff;border:1px solid #c8c8c8;border-radius:4px;padding:0.35rem 0.5rem;color:#222;max-width:18rem';this._hoverBox=n}n.innerHTML=this.getAttribute('data-hover-html')||'';var r=this.getBoundingClientRect();n.style.left=r.left+window.scrollX+'px';n.style.top=r.bottom+4+window.scrollY+'px';document.body.appendChild(n)",um="this._hoverBox&&this._hoverBox.remove()",dm=/^(#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\(\s*\d+\s*,\s*\d+\s*,\s*\d+(?:\s*,\s*(?:0|0?\.\d+|1))?\s*\))$/;function ar(e={}){return{href:"",title:"",targetBlank:!1,textDecorationNone:!1,hoverMode:"color",hoverColor:null,hoverHtml:"",...e}}function mm(e){return e.tagName.toLowerCase()==="a"&&e.hasAttribute("href")}function on(e,t){let n=t;for(;n&&n!==e;){if(n instanceof Element&&mm(n))return n;n=n.parentNode}return null}function zl(e){return dm.test(e)}function fm(e){var i;const t=e.getAttribute("onmouseover")??"",n=/this\.style\.color\s*=\s*'([^']+)'/.exec(t),r=((i=n==null?void 0:n[1])==null?void 0:i.trim())??"";return r&&zl(r)?r:null}function Kl(e){const t=`${e.style.textDecoration} ${e.style.textDecorationLine}`.toLowerCase();return/\bnone\b/.test(t)}function pm(e){const t=e.getAttribute(Zo)??"",n=fm(e);return{href:e.getAttribute("href")??"",title:e.getAttribute("title")??"",targetBlank:e.getAttribute("target")==="_blank",textDecorationNone:Kl(e),hoverMode:t.trim()?"html":"color",hoverColor:n,hoverHtml:t}}function $l(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);if(!ae(e,n.commonAncestorContainer))return null;const r=on(e,n.commonAncestorContainer);return r?pm(r):null}function hm(e){return $l(e)!==null}function gm(e){e.removeAttribute("onmouseover"),e.removeAttribute("onmouseout"),e.removeAttribute(Zo)}function bm(e,t){var r;if(gm(e),t.hoverMode==="html"){const i=t.hoverHtml.trim();if(!i)return;e.setAttribute(Zo,i),e.setAttribute("onmouseover",cm),e.setAttribute("onmouseout",um);return}const n=((r=t.hoverColor)==null?void 0:r.trim())??"";!n||!zl(n)||(e.setAttribute("onmouseover",`this.style.color='${n}'`),e.setAttribute("onmouseout","this.style.color=''"))}function Qo(e,t){const n=ar(t);e.setAttribute("href",n.href);const r=n.title.trim();r?e.setAttribute("title",r):e.removeAttribute("title"),n.targetBlank?(e.setAttribute("target","_blank"),e.setAttribute("rel",sm)):(e.removeAttribute("target"),e.removeAttribute("rel")),n.textDecorationNone?e.style.textDecoration="none":Kl(e)&&(e.style.removeProperty("text-decoration"),e.style.removeProperty("text-decoration-line")),bm(e,n)}function ym(e,t){const n=new Set;for(const r of t){const i=on(e,r);i&&!n.has(i)&&n.add(i)}for(const r of n)Re(r)}function xm(e,t,n){et(t);const r=Ne(t).filter(c=>c.data.length>0);ym(e,r),r.length>0&&Nt(r);const i=window.getSelection();if(!i||i.rangeCount===0)return!1;const a=i.getRangeAt(0);et(a);const l=document.createElement("a");Qo(l,n);try{return a.surroundContents(l),!0}catch{const c=a.extractContents();return c.hasChildNodes()?(l.appendChild(c),a.insertNode(l),!0):!1}}function wm(e,t){const n=document.createElement("a");Qo(n,t),n.textContent=t.href,e.insertNode(n),e.setStartAfter(n),e.collapse(!0);const r=window.getSelection();return r==null||r.removeAllRanges(),r==null||r.addRange(e),!0}function Sm(e,t){const n=t.href.trim();if(!n)return!1;const r=ar({...t,href:n}),i=window.getSelection();if(!i||i.rangeCount===0)return!1;const a=i.getRangeAt(0);if(!ae(e,a.commonAncestorContainer))return!1;const l=on(e,a.startContainer),c=on(e,a.endContainer);return l&&l===c?(Qo(l,r),!0):a.collapsed?wm(a,r):xm(e,a,r)}const km=/^[A-Za-z][A-Za-z0-9_-]*$/,Ul="​";function So(e){var r;const t=zo(e),n=new Set;for(const i of t.querySelectorAll("[id]")){if(i===t)continue;const a=i.id.trim();a&&n.add(a)}for(const i of t.querySelectorAll("a[name]")){const a=(r=i.getAttribute("name"))==null?void 0:r.trim();a&&n.add(a)}return[...n].sort((i,a)=>i.localeCompare(a)).map(i=>({id:i}))}function Cm(e){return new Set(So(e).map(t=>t.id))}function Wl(e,t){const n=e.trim();return n?km.test(n)?t.has(n)?"duplicate":null:"invalid":"empty"}function ta(e,t){const n=document.createElement("a");n.id=t,n.appendChild(document.createTextNode(Ul)),e.insertNode(n),e.setStartAfter(n),e.collapse(!0);const r=window.getSelection();r==null||r.removeAllRanges(),r==null||r.addRange(e)}function vm(e,t){var r;const n=document.createElement("a");n.id=t,n.appendChild(document.createTextNode(Ul)),(r=e.parentNode)==null||r.insertBefore(n,e)}function Dm(e,t){const n=t.trim();if(Wl(n,Cm(e)))return!1;const r=window.getSelection();if(!r||r.rangeCount===0)return!1;const i=r.getRangeAt(0);if(!ae(e,i.commonAncestorContainer))return!1;const a=on(e,i.startContainer);if(a)return vm(a,n),!0;if(i.collapsed)return ta(i,n),!0;et(i);const l=document.createElement("span");l.id=n;try{return i.surroundContents(l),!0}catch{return ta(i,n),!0}}function ql(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return ae(e,n.commonAncestorContainer)?n:null}function Am(e){const t=ql(e);if(!t||t.collapsed)return null;const n=document.createElement("div");n.appendChild(t.cloneContents());const r=n.innerHTML;if(!r)return null;let i=t.toString();if(!i){const a=n.querySelector("img");i=(a==null?void 0:a.getAttribute("alt"))??(a==null?void 0:a.getAttribute("src"))??""}return{html:r,text:i}}function Gl(e){const t=ql(e);if(!t||t.collapsed)return!1;t.deleteContents();const n=window.getSelection();return n==null||n.removeAllRanges(),n==null||n.addRange(t),!0}async function Pm(e){const t=navigator.clipboard;if(!t)return!1;try{if(typeof ClipboardItem=="function"&&typeof t.write=="function"){const n=new ClipboardItem({"text/plain":new Blob([e.text],{type:"text/plain"}),"text/html":new Blob([e.html],{type:"text/html"})});return await t.write([n]),!0}if(typeof t.writeText=="function")return await t.writeText(e.text),!0}catch{if(typeof t.writeText=="function")try{return await t.writeText(e.text),!0}catch{return!1}return!1}return!1}async function Vl(e){const t=Am(e);return t?Pm(t):!1}async function Em(e){return await Vl(e)?Gl(e):!1}const jm=new Set(["strong","b","em","i","u","s","strike","del"]),Nm=["font","font-weight","font-style","font-family","font-size","color","background","background-color","text-decoration","text-decoration-line","text-decoration-color","text-decoration-style","text-decoration-thickness"];function Lm(e){for(const t of Nm)e.style.removeProperty(t)}function Tm(e,t){let n=t;for(;n.parentElement&&n.parentElement!==e;){const r=n.parentElement;if(!Ve(r)){n=r;continue}if(ft(r,n),jm.has(r.tagName.toLowerCase())){Re(r);continue}if(Lm(r),mt(r)){Re(r);continue}n=r.isConnected?r:t}}function Mm(e){const t=nt(e);if(!t||t.collapsed)return!1;const n=e.innerHTML;et(t);const r=Ne(t).filter(i=>i.data.length>0);if(r.length===0)return!1;for(const i of r)Tm(e,i);return Nt(r),e.innerHTML!==n}const Rm=2*1024*1024,_m="image/jpeg,image/png,image/gif,image/webp,image/bmp,image/avif,.jpg,.jpeg,.png,.gif,.webp,.bmp,.avif",Fm=new Set(["image/jpeg","image/jpg","image/png","image/gif","image/webp","image/bmp","image/x-ms-bmp","image/avif"]),Im=new Set(["jpg","jpeg","png","gif","webp","bmp","avif"]),Bm=/^data:image\/(?:jpeg|jpg|png|gif|webp|bmp|avif)(?:;charset=[^;,]+)?;base64,/i,Hm=/^(javascript|vbscript|file|blob):/i;function Om(e={}){return{src:"",alt:"",title:"",...e}}function ei(e){const t=e.trim();if(!t)return"empty";if(Hm.test(t))return"invalid";if(t.toLowerCase().startsWith("data:"))return Bm.test(t)?null:"invalid";if(/^[a-z][a-z0-9+.-]*:/i.test(t)){const n=t.slice(0,t.indexOf(":")).toLowerCase();return n==="http"||n==="https"?null:"invalid"}return null}function zm(e){return e.size>Rm?"tooLarge":qm(e)?null:"type"}function Km(e){const t=zm(e);return t?Promise.reject(new Error(t)):new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{const a=String(i.result??"");if(ei(a)){r(new Error("invalid"));return}n(a)},i.onerror=()=>r(i.error??new Error("Failed to read file")),i.readAsDataURL(e)})}function $m(e,t){e.setAttribute("src",t.src.trim());const n=t.alt.trim(),r=t.title.trim();n?e.setAttribute("alt",n):e.removeAttribute("alt"),r?e.setAttribute("title",r):e.removeAttribute("title"),e.style.maxWidth="100%",e.style.height="auto",Um(e,t.css)}function Um(e,t){if(t)for(const n of t.split(";")){const r=n.trim();if(!r)continue;const i=r.indexOf(":");if(i<=0)continue;const a=r.slice(0,i).trim(),l=r.slice(i+1).trim();a&&l&&e.style.setProperty(a,l)}}function Wm(e,t){const n=Om(t);if(ei(n.src))return!1;const r=window.getSelection();if(!r||r.rangeCount===0)return!1;const i=r.getRangeAt(0);if(!ae(e,i.commonAncestorContainer))return!1;i.collapsed||i.deleteContents();const a=document.createElement("img");return $m(a,n),i.insertNode(a),i.setStartAfter(a),i.collapse(!0),r.removeAllRanges(),r.addRange(i),!0}function ko(e,t){let n=t;for(;n&&n!==e;){if(n instanceof HTMLImageElement)return n;n=n.parentNode}return null}function ro(e,t){if(!ae(e,t)||t===e)return!1;const n=document.createRange();n.selectNode(t);const r=window.getSelection();return r?(r.removeAllRanges(),r.addRange(n),!0):!1}function qm(e){const t=e.type.trim().toLowerCase();if(t&&Fm.has(t))return!0;const n=Gm(e.name);return!!(!t&&n&&Im.has(n))}function Gm(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"":e.slice(t+1).toLowerCase()}const Xl=["%","px","pt","pc","em","rem"],Vm="%",Xm={"%":[25,50,75,100,125,150,200],px:[50,100,150,200,300,400,600,800],pt:[36,48,72,96,144,192,288],pc:[3,4,6,8,12,16,24],em:[2,4,6,8,12,16,24],rem:[2,4,6,8,12,16,24]},Pt={"%":{min:1,max:1e3},px:{min:1,max:4e3},pt:{min:1,max:3e3},pc:{min:.1,max:250},em:{min:.1,max:200},rem:{min:.1,max:200}},Ym=new Set(Xl),Jm=/^([+]?(?:\d+(?:\.\d+)?|\.\d+))\s*(pt|px|em|rem|%|pc)$/i;function Zm(e){return Ym.has(e)}function na(e){return`${Y(e.value)}${e.unit}`}function Co(e){const t=e.trim();if(!t||t.toLowerCase()==="auto")return null;const n=t.match(Jm);if(!n)return null;const r=Number(n[1]);if(!Number.isFinite(r)||r<=0)return null;const i=n[2]==="%"?"%":n[2].toLowerCase();return Zm(i)?Et(r,i):null}function ra(e,t){const n=e.trim();if(!n)return null;const r=Co(n);if(r)return r;const i=Number(n.replace(",","."));return Number.isFinite(i)?Et(i,t):null}function Et(e,t){if(!Number.isFinite(e)||e<=0)return null;const{min:n,max:r}=Pt[t];return{value:xe(Math.min(r,Math.max(n,e))),unit:t}}function Zt(e,t,n){const r=n>0?n:1;if(e==="width"){const a=Et(t.value/r,t.unit)??t;return{width:t,height:a}}return{width:Et(t.value*r,t.unit)??t,height:t}}const zn="data-hover-css",Yl=["fill","contain","cover","none","scale-down"],Jl=["center","top","bottom","left","right","top left","top right","bottom left","bottom right"],Qm=new Set(Yl),ef=new Set(Jl),oa="if(this._hp==null)this._hp=this.getAttribute('style')||'';this.setAttribute('style',(this._hp?this._hp+';':'')+(this.getAttribute('data-hover-css')||''))",tf="if(this._hp!=null){this.setAttribute('style',this._hp);this._hp=null}",nf=/^-?[a-z][a-z0-9-]*$/i,rf=/expression\s*\(|javascript:|vbscript:|-moz-binding|\bbehavior\b/i,vo=/rotate\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*deg\s*\)/i;function Zl(e={}){return{sizeMode:"width",width:null,height:null,align:null,margin:{...We},border:{...Yo},borderRadius:null,boxShadow:null,opacity:null,objectFit:null,objectPosition:null,rotateDeg:null,hoverCss:"",...e}}function of(e){const t=e.naturalWidth,n=e.naturalHeight;return t>0&&n>0?t/n:1}function af(e,t){const n=e.objectFit;if(n!=="cover"&&n!=="contain"&&n!=="fill"||e.width&&e.height||!e.width&&!e.height)return e;if(e.width){const r=Zt("width",e.width,t);return{...e,sizeMode:"lock",width:r.width,height:r.height}}if(e.height){const r=Zt("height",e.height,t);return{...e,sizeMode:"lock",width:r.width,height:r.height}}return e}function lf(e){const t=[];for(const n of e.split(";")){const r=n.trim();if(!r)continue;const i=r.indexOf(":");if(i<=0)continue;const a=r.slice(0,i).trim().toLowerCase(),l=r.slice(i+1).trim();!a||!l||nf.test(a)&&(a==="behavior"||a.endsWith("binding")||rf.test(l)||t.push(`${a}: ${l}`))}return t.join("; ")}function Qt(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);if(!ae(e,n.commonAncestorContainer))return null;if(n.startContainer instanceof HTMLImageElement)return n.startContainer;if(n.startContainer.nodeType===Node.ELEMENT_NODE){const r=n.startContainer.childNodes[n.startOffset];if(r instanceof HTMLImageElement&&ae(e,r))return r}return ko(e,n.commonAncestorContainer)}function sf(e){const t=Qt(e);return t?Ql(t):null}function Ql(e){const t=Mt(e),n=ff(e),r=n==="center"?{...t.margin,left:null,right:null}:t.margin,i=uf(e);return Zl({sizeMode:i.sizeMode,width:i.width,height:i.height,align:n,margin:r,border:t.border,borderRadius:t.borderRadius,boxShadow:t.boxShadow,opacity:t.opacity,objectFit:ts(e),objectPosition:bf(e),rotateDeg:ns(e),hoverCss:e.getAttribute(zn)??""})}function es(e,t){let n=!1;return df(e,t)&&(n=!0),Rt(e,{margin:t.align==="center"?{...t.margin,left:null,right:null}:t.margin,marginMixed:!1,padding:We,paddingMixed:!0,lineHeight:null,lineHeightMixed:!0,border:t.border,borderMixed:!1,borderRadius:t.borderRadius,radiusMixed:!1,boxShadow:t.boxShadow,shadowMixed:!1,backgroundColor:null,backgroundMixed:!0,opacity:t.opacity,opacityMixed:!1})&&(n=!0),pf(e,t.align)&&(n=!0),hf(e,t.objectFit)&&(n=!0),gf(e,t.objectPosition)&&(n=!0),xf(e,t.rotateDeg)&&(n=!0),wf(e,t.hoverCss)&&(n=!0),n}function cf(e,t){const n=Qt(e);return n?es(n,t):!1}function uf(e){const t=Co(e.style.width),n=Co(e.style.height);return t&&n?{sizeMode:"lock",width:t,height:n}:n&&!t?{sizeMode:"height",width:null,height:n}:{sizeMode:"width",width:t,height:null}}function df(e,t){const n={width:e.style.width,height:e.style.height,maxWidth:e.style.maxWidth},r=mf(t);return r.width?e.style.width=na(r.width):e.style.removeProperty("width"),r.height?e.style.height=na(r.height):e.style.height="auto",r.width||r.height?e.style.removeProperty("max-width"):e.style.maxWidth="100%",n.width!==e.style.width||n.height!==e.style.height||n.maxWidth!==e.style.maxWidth}function mf(e){return e.sizeMode==="width"?{sizeMode:"width",width:e.width,height:null}:e.sizeMode==="height"?{sizeMode:"height",width:null,height:e.height}:{sizeMode:"lock",width:e.width,height:e.height}}function ff(e){const t=e.style.float.trim().toLowerCase();if(t==="left")return"left";if(t==="right")return"right";const n=e.style.display.trim().toLowerCase(),r=e.style.marginLeft.trim().toLowerCase(),i=e.style.marginRight.trim().toLowerCase();return n==="block"&&r==="auto"&&i==="auto"?"center":null}function pf(e,t){const n={float:e.style.float,display:e.style.display,marginLeft:e.style.marginLeft,marginRight:e.style.marginRight};return t==="left"?(e.style.float="left",e.style.removeProperty("display"),e.style.marginLeft.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-left"),e.style.marginRight.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-right")):t==="right"?(e.style.float="right",e.style.removeProperty("display"),e.style.marginLeft.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-left"),e.style.marginRight.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-right")):t==="center"?(e.style.removeProperty("float"),e.style.display="block",e.style.marginLeft="auto",e.style.marginRight="auto"):(e.style.removeProperty("float"),e.style.display.trim().toLowerCase()==="block"&&e.style.removeProperty("display"),e.style.marginLeft.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-left"),e.style.marginRight.trim().toLowerCase()==="auto"&&e.style.removeProperty("margin-right")),n.float!==e.style.float||n.display!==e.style.display||n.marginLeft!==e.style.marginLeft||n.marginRight!==e.style.marginRight}function ts(e){const t=e.style.objectFit.trim().toLowerCase();return Qm.has(t)?t:null}function hf(e,t){return ts(e)===t?!1:(t?e.style.objectFit=t:e.style.removeProperty("object-fit"),!0)}function gf(e,t){const n=(t==null?void 0:t.trim().toLowerCase().replace(/\s+/g," "))||"";return e.style.objectPosition.trim().toLowerCase().replace(/\s+/g," ")===n?!1:(n?e.style.objectPosition=n:e.style.removeProperty("object-position"),!0)}function bf(e){const t=e.style.objectPosition.trim().toLowerCase().replace(/\s+/g," ");return t?(ef.has(t),t):null}function ns(e){const t=vo.exec(e.style.transform);if(!t)return null;const n=Number(t[1]);return Number.isFinite(n)?xe(n):null}function yf(e){const t=e.trim();return t?vo.test(t)&&t.replace(vo,"").trim()==="":!0}function xf(e,t){const n=ns(e),r=t===null||t===0?null:xe(t);return n===r?!1:r===null?yf(e.style.transform)?(e.style.removeProperty("transform"),!0):!1:(e.style.transform=`rotate(${Y(r)}deg)`,!0)}function wf(e,t){const n=lf(t),r=e.getAttribute(zn)??"",i=e.getAttribute("onmouseover")??"";return r===n&&(n&&i===oa||!n&&!i)?!1:n?(e.setAttribute(zn,n),e.setAttribute("onmouseover",oa),e.setAttribute("onmouseout",tf),!0):(e.removeAttribute(zn),e.removeAttribute("onmouseover"),e.removeAttribute("onmouseout"),!0)}const Ge=16;function ia(e){return Math.min(Pt.px.max,Math.max(Ge,e))}function Sf(e){return e.width>0&&e.height>0?e.width/e.height:1}function kf(e,t){const n=Math.max(Ge,Ge*t),r=Math.min(Pt.px.max,Pt.px.max*t),i=Math.min(r,Math.max(n,e));return{width:i,height:i/t}}function Cf(e,t){const n=Math.max(Ge,Ge/t),r=Math.min(Pt.px.max,Pt.px.max/t),i=Math.min(r,Math.max(n,e));return{width:i*t,height:i}}function vf(e,t,n){const r=Sf(t);return e==="e"?kf(t.width+n.x,r):e==="s"?Cf(t.height+n.y,r):{width:ia(t.width+n.x),height:ia(t.height+n.y)}}function Df(e){const t=e.getBoundingClientRect(),n=e.offsetWidth||t.width,r=e.offsetHeight||t.height;return{width:n>0?n:Ge,height:r>0?r:Ge}}function Af(e,t,n){const r=Et(Math.max(Ge,t),"px"),i=Et(Math.max(Ge,n),"px");return!r||!i?!1:es(e,{...Ql(e),sizeMode:"lock",width:r,height:i})}const aa=10,wt=1,St=50,Pf="1px solid #000",Ef="0.25em",jf=new Set(["td","th"]);function rs(e,t){return Number.isInteger(e)&&Number.isInteger(t)&&e>=wt&&t>=wt&&e<=St&&t<=St}function Be(e,t){return ti(e,t,n=>n instanceof HTMLTableElement)}function Yn(e,t){return ti(e,t,n=>Bf(n))}function Nf(e,t){return ti(e,t,n=>n instanceof HTMLTableRowElement)}function en(e){return Be(e,ni(e))}function _t(e){return Yn(e,ni(e))}function os(e){return Nf(e,ni(e))}function Lf(e){const t=[];for(const n of Array.from(e.rows))t.push(...Array.from(n.cells));return t}function Tf(e){const t=window.getSelection();if(!t||t.rangeCount===0)return[];const n=t.getRangeAt(0);if(!ae(e,n.commonAncestorContainer))return[];const r=Yn(e,n.startContainer),i=Yn(e,n.endContainer);if(!r)return[];if(!i||r===i)return[r];const a=Be(e,r);if(!a||Be(e,i)!==a)return[r];const l=sa(r),c=sa(i);if(!l||!c)return[r];const m=Math.min(l.row,c.row),p=Math.max(l.row,c.row),b=Math.min(l.col,c.col),h=Math.max(l.col,c.col),w=[];for(const x of Array.from(a.rows))if(!(x.rowIndex<m||x.rowIndex>p))for(const S of Array.from(x.cells))S.cellIndex>=b&&S.cellIndex<=h&&w.push(S);return w.length>0?w:[r]}function Mf(e,t){if(!rs(t.rows,t.cols))return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0);if(!ae(e,r.commonAncestorContainer))return!1;const i=document.createElement("table");i.style.borderCollapse="collapse",i.style.width="100%";const a=document.createElement("tbody");for(let c=0;c<t.rows;c+=1){const m=document.createElement("tr");for(let p=0;p<t.cols;p+=1)m.appendChild(ri("td"));a.appendChild(m)}i.appendChild(a),r.collapsed||r.deleteContents(),r.insertNode(i),Of(e,i);const l=i.querySelector("td, th");return l instanceof HTMLTableCellElement&&Ue(l),!0}function Do(e,t){var m;const n=_t(e);if(!n)return!1;const r=n.parentElement;if(!(r instanceof HTMLTableRowElement)||!Be(e,n))return!1;const a=document.createElement("tr"),l=Math.max(1,r.cells.length);for(let p=0;p<l;p+=1){const b=r.cells[p];a.appendChild(ri((b==null?void 0:b.tagName)==="TH"?"th":"td"))}t==="before"?(m=r.parentNode)==null||m.insertBefore(a,r):r.insertAdjacentElement("afterend",a);const c=a.cells[Math.min(n.cellIndex,a.cells.length-1)];return c&&Ue(c),!0}function la(e,t){const n=_t(e);if(!n)return!1;const r=Be(e,n);if(!r)return!1;const i=n.cellIndex,a=t==="before"?i:i+1;let l=null;for(const c of Array.from(r.rows)){const m=c.cells[Math.min(i,c.cells.length-1)]??null,p=ri((m==null?void 0:m.tagName)==="TH"?"th":"td");Hf(c,a,p),c===n.parentElement&&(l=p)}return l&&Ue(l),!0}function Rf(e){const t=_t(e);if(!t)return!1;const n=t.parentElement;if(!(n instanceof HTMLTableRowElement))return!1;const r=Be(e,t);if(!r)return!1;const i=t.cellIndex,a=n.rowIndex;if(r.rows.length<=1)return is(e,r);const l=n.parentNode;n.remove();const c=r.rows[Math.min(a,r.rows.length-1)],m=c==null?void 0:c.cells[Math.min(i,c.cells.length-1)];return m?Ue(m):l&&Kf(r),!0}function _f(e){const t=_t(e);if(!t)return!1;const n=Be(e,t);if(!n)return!1;const r=t.cellIndex,i=t.parentElement;if(Math.max(0,...Array.from(n.rows,p=>p.cells.length))<=1)return is(e,n);const l=i instanceof HTMLTableRowElement?i.rowIndex:0;for(const p of Array.from(n.rows)){const b=p.cells[r];b&&b.remove()}const c=n.rows[Math.min(l,n.rows.length-1)],m=c==null?void 0:c.cells[Math.min(r,c.cells.length-1)];return m&&Ue(m),!0}function Ff(e,t){const n=_t(e);if(!n)return!1;const r=Be(e,n);if(!r)return!1;const i=Lf(r),a=i.indexOf(n);if(a<0)return!1;if(t)return a===0?!1:(Ue(i[a-1]),{changed:!1});if(a<i.length-1)return Ue(i[a+1]),{changed:!1};const l=n.parentElement;if(!Do(e,"below"))return!1;const c=l instanceof HTMLTableRowElement?l.nextElementSibling:null;return c instanceof HTMLTableRowElement&&c.cells[0]&&Ue(c.cells[0]),{changed:!0}}function If(e,t){return!ae(e,t)||t===e?!1:(Ue(t),!0)}function ti(e,t,n){let r=t;for(;r&&r!==e;){if(r instanceof HTMLElement&&n(r))return r;r=r.parentNode}return null}function Bf(e){return jf.has(e.tagName.toLowerCase())}function ni(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const n=t.getRangeAt(0);return ae(e,n.commonAncestorContainer)?n.startContainer:null}function sa(e){const t=e.parentElement;return t instanceof HTMLTableRowElement?{row:t.rowIndex,col:e.cellIndex}:null}function ri(e){const t=document.createElement(e);return t.style.border=Pf,t.style.padding=Ef,t.appendChild(document.createElement("br")),t}function Hf(e,t,n){t>=e.cells.length?e.appendChild(n):e.insertBefore(n,e.cells[t])}function Of(e,t){var i;const n=t.parentElement;if(!n||n===e)return;const r=n.tagName.toLowerCase();r==="td"||r==="th"||(r==="p"||/^h[1-6]$/.test(r))&&((i=n.parentNode)==null||i.insertBefore(t,n.nextSibling),zf(n)&&n.remove())}function zf(e){var t;return e.childNodes.length===0||e.childNodes.length===1&&((t=e.firstChild)==null?void 0:t.nodeName)==="BR"?!0:(e.textContent??"").trim().length===0&&e.querySelector("img, table, ul, ol")===null}function is(e,t){if(!t.parentNode||!ae(e,t))return!1;const r=document.createRange();r.setStartBefore(t),r.collapse(!0),t.remove();const i=window.getSelection();return i&&(i.removeAllRanges(),i.addRange(r)),!0}function Ue(e){const t=document.createRange();t.selectNodeContents(e),t.collapse(!0);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(t))}function Kf(e){const t=document.createRange();t.setStartAfter(e),t.collapse(!0);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(t))}function $f(e={}){return{border:{...Yo},borderCollapse:"collapse",borderSpacing:null,borderRadius:null,boxShadow:null,width:{value:100,unit:"%"},...e}}function Uf(e){const t=Mt(e);return{border:t.border,borderCollapse:Vf(e),borderSpacing:as(e),borderRadius:t.borderRadius,boxShadow:t.boxShadow,width:Le(e.style.width)}}function Wf(e,t){let n=Rt(e,{margin:{top:null,right:null,bottom:null,left:null},marginMixed:!0,padding:{top:null,right:null,bottom:null,left:null},paddingMixed:!0,lineHeight:null,lineHeightMixed:!0,border:t.border,borderMixed:!1,borderRadius:t.borderRadius,radiusMixed:!1,boxShadow:t.boxShadow,shadowMixed:!1,backgroundColor:null,backgroundMixed:!0,opacity:null,opacityMixed:!0});return Xf(e,t.borderCollapse)&&(n=!0),Yf(e,t.borderCollapse,t.borderSpacing)&&(n=!0),Jf(e,t.width)&&(n=!0),n&&rt(e),n}function qf(e){const t=en(e);return t?Uf(t):null}function Gf(e,t){const n=en(e);return n?Wf(n,t):!1}function Vf(e){return e.style.borderCollapse.trim().toLowerCase()==="separate"?"separate":"collapse"}function Xf(e,t){return e.style.borderCollapse.trim().toLowerCase()===t?!1:(e.style.borderCollapse=t,!0)}function as(e){const t=e.style.borderSpacing.trim();return t?Le(t.split(/\s+/)[0]??""):null}function Yf(e,t,n){if(t!=="separate")return e.style.borderSpacing?(e.style.removeProperty("border-spacing"),!0):!1;const r=n?ot(n):null,i=as(e);return Pe(i,r)?!1:(r?e.style.borderSpacing=Ae(r):e.style.removeProperty("border-spacing"),!0)}function Jf(e,t){const n=t?ot(t):null,r=Le(e.style.width);return Pe(r,n)?!1:(n?e.style.width=Ae(n):e.style.removeProperty("width"),!0)}const lr=["top","middle","bottom","baseline"],Zf=new Set(lr);function Qf(e={}){return{backgroundColor:null,color:null,padding:{...We},verticalAlign:null,width:null,...e}}function ep(e){const t=Mt(e);return{backgroundColor:t.backgroundColor,color:ls(e),padding:t.padding,verticalAlign:ss(e),width:Le(e.style.width)}}function tp(e,t){let n=Rt(e,{margin:{...We},marginMixed:!0,padding:t.padding,paddingMixed:!1,lineHeight:null,lineHeightMixed:!0,border:{style:"none",width:null,color:null},borderMixed:!0,borderRadius:null,radiusMixed:!0,boxShadow:null,shadowMixed:!0,backgroundColor:t.backgroundColor,backgroundMixed:!1,opacity:null,opacityMixed:!0});return op(e,t.color)&&(n=!0),ip(e,t.verticalAlign)&&(n=!0),ap(e,t.width)&&(n=!0),n&&rt(e),n}function np(e){const t=_t(e);return t?ep(t):null}function rp(e,t){const n=Tf(e);if(n.length===0)return!1;let r=!1;for(const i of n)tp(i,t)&&(r=!0);return r}function ls(e){const t=e.style.color;return t?se(t):null}function op(e,t){const n=t?se(t):null;return ls(e)===n?!1:(n?e.style.color=n:e.style.removeProperty("color"),!0)}function ss(e){const t=e.style.verticalAlign.trim().toLowerCase();return Zf.has(t)?t:null}function ip(e,t){return ss(e)===t?!1:(t?e.style.verticalAlign=t:e.style.removeProperty("vertical-align"),!0)}function ap(e,t){const n=t?ot(t):null,r=Le(e.style.width);return Pe(r,n)?!1:(n?e.style.width=Ae(n):e.style.removeProperty("width"),!0)}const lp=new Set(lr);function sp(e={}){return{backgroundColor:null,color:null,padding:{...We},height:null,verticalAlign:null,...e}}function cp(e){const t=e.cells[0],n=t?Mt(t).padding:{...We};return{backgroundColor:cs(e),color:us(e),padding:n,height:Le(e.style.height),verticalAlign:ds(e)}}function up(e,t){let n=!1;fp(e,t.backgroundColor)&&(n=!0),pp(e,t.color)&&(n=!0),gp(e,t.height)&&(n=!0),hp(e,t.verticalAlign)&&(n=!0);for(const r of Array.from(e.cells))Rt(r,{margin:{...We},marginMixed:!0,padding:t.padding,paddingMixed:!1,lineHeight:null,lineHeightMixed:!0,border:{style:"none",width:null,color:null},borderMixed:!0,borderRadius:null,radiusMixed:!0,boxShadow:null,shadowMixed:!0,backgroundColor:null,backgroundMixed:!0,opacity:null,opacityMixed:!0})&&(n=!0);return n&&rt(e),n}function dp(e){const t=os(e);return t?cp(t):null}function mp(e,t){const n=os(e);return n?up(n,t):!1}function cs(e){const t=e.style.backgroundColor;return t?se(t):null}function fp(e,t){const n=t?se(t):null;return cs(e)===n?!1:(n?e.style.backgroundColor=n:e.style.removeProperty("background-color"),!0)}function us(e){const t=e.style.color;return t?se(t):null}function pp(e,t){const n=t?se(t):null;return us(e)===n?!1:(n?e.style.color=n:e.style.removeProperty("color"),!0)}function ds(e){const t=e.style.verticalAlign.trim().toLowerCase();return lp.has(t)?t:null}function hp(e,t){return ds(e)===t?!1:(t?e.style.verticalAlign=t:e.style.removeProperty("vertical-align"),!0)}function gp(e,t){const n=t?ot(t):null,r=Le(e.style.height);return Pe(r,n)?!1:(n?e.style.height=Ae(n):e.style.removeProperty("height"),!0)}function oo({value:e,defaultValue:t,onChange:n}){const[r,i]=s.useState(t),a=e!==void 0,l=a?e:r,c=s.useCallback(m=>{a||i(m),n==null||n(m)},[a,n]);return[l,c]}const ca=8,ua=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#9900ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#d9d2e9","#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#8e7cc3","#660000","#990000","#b45f06","#bf9000","#38761d","#134f5c","#1155cc","#351c75"],bp=8;let Ao=[];const Po=new Set;function da(){return Ao}function yp(e){const t=se(e);t&&(Ao=[t,...Ao.filter(n=>n!==t)].slice(0,bp),Po.forEach(n=>n()))}function xp(e){return Po.add(e),()=>{Po.delete(e)}}function Tn(e){const t=se(e);return t?{r:Number.parseInt(t.slice(1,3),16),g:Number.parseInt(t.slice(3,5),16),b:Number.parseInt(t.slice(5,7),16)}:null}function st(e,t,n){const r=i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function io({r:e,g:t,b:n}){const r=e/255,i=t/255,a=n/255,l=Math.max(r,i,a),c=Math.min(r,i,a),m=l-c;let p=0;return m!==0&&(l===r?p=(i-a)/m%6:l===i?p=(a-r)/m+2:p=(r-i)/m+4,p*=60,p<0&&(p+=360)),{h:p,s:l===0?0:m/l,v:l}}function ao({h:e,s:t,v:n}){const r=(e%360+360)%360,i=n*t,a=i*(1-Math.abs(r/60%2-1)),l=n-i;let c=0,m=0,p=0;return r<60?(c=i,m=a):r<120?(c=a,m=i):r<180?(m=i,p=a):r<240?(m=a,p=i):r<300?(c=a,p=i):(c=i,p=a),{r:Math.round((c+l)*255),g:Math.round((m+l)*255),b:Math.round((p+l)*255)}}function ms(){return typeof window<"u"&&"EyeDropper"in window}async function wp(){if(!ms())return null;const e=window.EyeDropper;try{const t=await new e().open();return se(t.sRGBHex)}catch{return null}}const Sp="_picker_vmqkv_1",kp="_none_vmqkv_12",Cp="_customToggle_vmqkv_13",vp="_eyedrop_vmqkv_14",Dp="_swatch_vmqkv_48",Ap="_field_vmqkv_49",Pp="_grid_vmqkv_54",Ep="_recents_vmqkv_55",jp="_sectionLabel_vmqkv_84",Np="_custom_vmqkv_13",Lp="_sv_vmqkv_95",Tp="_svThumb_vmqkv_105",Mp="_hue_vmqkv_116",Rp="_rgbRow_vmqkv_155",_p="_hexRow_vmqkv_156",ge={picker:Sp,none:kp,customToggle:Cp,eyedrop:vp,swatch:Dp,field:Ap,grid:Pp,recents:Ep,sectionLabel:jp,custom:Np,sv:Lp,svThumb:Tp,hue:Mp,rgbRow:Rp,hexRow:_p};function Fp(e){if(!/^\d+$/.test(e.trim()))return null;const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(255,t)):null}function oi({value:e,mixed:t=!1,noneLabel:n,ariaLabel:r,disabled:i,menu:a=!1,fallbackCustom:l="#000000",onChange:c,onCommit:m}){const p=V(),b=s.useId(),h=a?"menuitemradio":"option",w=t?null:e,x=Tn(w??l)??{r:0,g:0,b:0},[S,y]=s.useState(!1),[C,g]=s.useState(()=>io(x)),[k,P]=s.useState(()=>({r:String(x.r),g:String(x.g),b:String(x.b)})),[L,N]=s.useState(()=>st(x.r,x.g,x.b)),[M,T]=s.useState(()=>[...da()]),F=s.useRef(null),D=s.useRef(st(x.r,x.g,x.b));s.useEffect(()=>xp(()=>T([...da()])),[]),s.useEffect(()=>{const A=Tn(w??l);if(!A)return;const K=io(A);g(K),P({r:String(A.r),g:String(A.g),b:String(A.b)}),N(st(A.r,A.g,A.b))},[w,l]);const E=(A,K,j)=>{A&&(D.current=A),j&&A&&yp(A),c(A),K&&(m==null||m(A))},_=(A,K,j)=>{const O=st(A.r,A.g,A.b);g(io(A)),P({r:String(A.r),g:String(A.g),b:String(A.b)}),N(O),E(O,K,j)},z=(A,K,j)=>{const O=ao(A),ee=st(O.r,O.g,O.b);g(A),P({r:String(O.r),g:String(O.g),b:String(O.b)}),N(ee),E(ee,K,j)},W=A=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(A.key))return;const j=[...A.currentTarget.querySelectorAll("button")],O=j.findIndex(re=>re===document.activeElement);if(O<0)return;A.preventDefault();const ee=A.key==="ArrowLeft"?-1:A.key==="ArrowRight"?1:A.key==="ArrowUp"?-ca:ca,ye=j[Math.max(0,Math.min(j.length-1,O+ee))];ye==null||ye.focus()},X=(A,K)=>{const j=F.current;if(!j||i)return;const O=j.getBoundingClientRect(),ee=Math.max(0,Math.min(1,(A.clientX-O.left)/O.width)),ye=Math.max(0,Math.min(1,1-(A.clientY-O.top)/O.height));z({h:C.h,s:ee,v:ye},K,K)},J=A=>{i||(A.currentTarget.setPointerCapture(A.pointerId),X(A,!1))},fe=ao({h:C.h,s:1,v:1}),ce=st(fe.r,fe.g,fe.b),te=ao(C),R=st(te.r,te.g,te.b),Z=new Set(ua),Q=M.filter(A=>!Z.has(A));return o.jsxs("div",{className:ge.picker,role:a?void 0:"listbox","aria-label":r,"data-color-picker":"",children:[o.jsx("button",{type:"button",className:ge.none,role:h,"aria-checked":a?w===null&&!t:void 0,"aria-selected":a?void 0:w===null&&!t,disabled:i,onClick:()=>E(null,!0,!1),children:n}),o.jsx("div",{className:ge.grid,role:a?"group":"none",onKeyDown:W,children:ua.map(A=>{const K=w===A;return o.jsx("button",{type:"button",className:ge.swatch,role:h,"aria-label":A,"aria-checked":a?K:void 0,"aria-selected":a?void 0:K,disabled:i,style:{backgroundColor:A},onMouseDown:j=>j.preventDefault(),onClick:()=>E(A,!0,!1)},A)})}),Q.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:ge.sectionLabel,children:p("colorRecent")}),o.jsx("div",{className:ge.recents,role:a?"group":"none","aria-label":p("colorRecent"),children:Q.map(A=>o.jsx("button",{type:"button",className:ge.swatch,role:h,"aria-label":A,"aria-checked":a?w===A:void 0,"aria-selected":a?void 0:w===A,disabled:i,style:{backgroundColor:A},onMouseDown:K=>K.preventDefault(),onClick:()=>E(A,!0,!1)},A))})]}):null,o.jsx("button",{type:"button",className:ge.customToggle,disabled:i,"aria-expanded":S,onClick:()=>y(A=>!A),children:p("colorCustom")}),S?o.jsxs("div",{className:ge.custom,children:[o.jsx("div",{ref:F,className:ge.sv,style:{background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${ce})`},onPointerDown:J,onPointerMove:A=>{A.currentTarget.hasPointerCapture(A.pointerId)&&X(A,!1)},onPointerUp:A=>{X(A,!0)},children:o.jsx("span",{className:ge.svThumb,style:{left:`${C.s*100}%`,top:`${(1-C.v)*100}%`}})}),o.jsx("input",{className:ge.hue,type:"range",min:0,max:360,value:Math.round(C.h),disabled:i,"aria-label":p("colorCustom"),onChange:A=>z({...C,h:Number(A.target.value)},!1,!1),onPointerUp:()=>E(D.current,!0,!0)}),o.jsx("div",{className:ge.rgbRow,children:["r","g","b"].map(A=>o.jsxs("div",{className:ge.field,children:[o.jsx("label",{htmlFor:`${b}-${A}`,children:p(A==="r"?"colorRgbR":A==="g"?"colorRgbG":"colorRgbB")}),o.jsx("input",{id:`${b}-${A}`,inputMode:"numeric",value:k[A],disabled:i,onChange:K=>{P(j=>({...j,[A]:K.target.value}))},onBlur:()=>{const K=Fp(k[A]);if(K===null){P({r:String(te.r),g:String(te.g),b:String(te.b)});return}_({...te,[A]:K},!0,!0)},onKeyDown:K=>{K.key==="Enter"&&K.currentTarget.blur()}})]},A))}),o.jsx("div",{className:ge.hexRow,children:o.jsxs("div",{className:ge.field,children:[o.jsx("label",{htmlFor:`${b}-hex`,children:p("colorHex")}),o.jsx("input",{id:`${b}-hex`,value:L,disabled:i,onChange:A=>N(A.target.value),onBlur:()=>{const A=se(L);if(!A){N(R);return}const K=Tn(A);K&&_(K,!0,!0)},onKeyDown:A=>{A.key==="Enter"&&A.currentTarget.blur()}})]})}),ms()?o.jsx("button",{type:"button",className:ge.eyedrop,disabled:i,onClick:()=>{wp().then(A=>{if(!A)return;const K=Tn(A);K&&_(K,!0,!0)})},children:p("colorPickFromScreen")}):null]}):null]})}const Ip="_wrap_mid65_1",Bp="_button_mid65_8",Hp="_icon_mid65_18",Op="_bar_mid65_24",zp="_barEmpty_mid65_33",Kp="_popover_mid65_43",ct={wrap:Ip,button:Bp,icon:Hp,bar:Op,barEmpty:zp,popover:Kp},$p="_field_pl3rn_1",Up="_label_pl3rn_8",Wp="_button_pl3rn_12",qp="_swatch_pl3rn_37",Gp="_swatchEmpty_pl3rn_44",Vt={field:$p,label:Up,button:Wp,swatch:qp,swatchEmpty:Gp},Mn=4;function je({label:e,noneLabel:t,value:n,mixed:r=!1,disabled:i,fallbackCustom:a,onChange:l}){const c=s.useId(),m=s.useRef(null),p=s.useRef(null),b=s.useRef(null),[h,w]=s.useState(!1),[x,S]=s.useState({top:0,left:0}),y=s.useCallback(()=>{const k=p.current,P=b.current;if(!k)return;const L=k.getBoundingClientRect(),N=(P==null?void 0:P.offsetHeight)??0,M=(P==null?void 0:P.offsetWidth)??240;let T=L.bottom;T+N>window.innerHeight-Mn&&(T=Math.max(Mn,L.top-N));const F=Math.min(Math.max(L.left,Mn),window.innerWidth-M-Mn);S({top:T,left:F})},[]);s.useLayoutEffect(()=>{if(!h)return;y();const k=()=>y();return window.addEventListener("scroll",k,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",k,!0),window.removeEventListener("resize",k)}},[h,y]),s.useEffect(()=>{if(!h)return;const k=L=>{var M,T;const N=L.target;(M=m.current)!=null&&M.contains(N)||(T=b.current)!=null&&T.contains(N)||w(!1)},P=L=>{var N;L.key==="Escape"&&(L.preventDefault(),L.stopPropagation(),w(!1),(N=p.current)==null||N.focus())};return document.addEventListener("pointerdown",k),document.addEventListener("keydown",P,!0),()=>{document.removeEventListener("pointerdown",k),document.removeEventListener("keydown",P,!0)}},[h]);const C=`${Vt.swatch}${!n||r?` ${Vt.swatchEmpty}`:""}`,g=n&&!r?{backgroundColor:n}:void 0;return o.jsxs("div",{className:Vt.field,ref:m,children:[o.jsx("span",{className:Vt.label,children:e}),o.jsx("button",{ref:p,type:"button",className:Vt.button,"aria-label":e,"aria-haspopup":"listbox","aria-expanded":h,"aria-controls":h?c:void 0,disabled:i,onClick:()=>w(k=>!k),children:o.jsx("span",{className:C,style:g})}),h?le.createPortal(o.jsx("div",{ref:b,id:c,className:ct.popover,style:{top:x.top,left:x.left,zIndex:1400},children:o.jsx(oi,{value:n,mixed:r,noneLabel:t,ariaLabel:e,disabled:i,fallbackCustom:a,onChange:l,onCommit:()=>w(!1)})}),document.body):null]})}const lo=[{id:"general",labelKey:"fontDialogTabGeneral",implemented:!0}],Vp="_toolbar_xlok8_1",Xp="_menuBar_xlok8_14",Yp="_menuBarDesktop_xlok8_22",Jp="_brandMark_xlok8_28",Zp="_brandMarkIcon_xlok8_35",Qp="_menuBarCompact_xlok8_47",eh="_menuWrap_xlok8_70",th="_menuButton_xlok8_76",nh="_iconButton_xlok8_77",rh="_menuItem_xlok8_78",oh="_hamburgerButton_xlok8_121",ih="_iconNav_xlok8_128",ah="_iconTrack_xlok8_137",lh="_iconTrackInner_xlok8_152",sh="_iconGroup_xlok8_158",ch="_tooltipTrigger_xlok8_180",uh="_scrollButton_xlok8_186",dh="_scrollButtonLeft_xlok8_203",mh="_scrollButtonRight_xlok8_208",fh="_menu_xlok8_14",ph="_submenuWrap_xlok8_235",hh="_submenu_xlok8_235",gh="_submenuTrigger_xlok8_245",bh="_menuOverlay_xlok8_260",yh="_menuOverlayHeader_xlok8_272",xh="_menuOverlayTitle_xlok8_282",wh="_menuOverlayBody_xlok8_288",Sh="_menuSeparator_xlok8_339",kh="_icon_xlok8_77",Ch="_tooltip_xlok8_180",vh="_tooltipElevated_xlok8_424",U={toolbar:Vp,menuBar:Xp,menuBarDesktop:Yp,brandMark:Jp,brandMarkIcon:Zp,menuBarCompact:Qp,menuWrap:eh,menuButton:th,iconButton:nh,menuItem:rh,hamburgerButton:oh,iconNav:ih,iconTrack:ah,iconTrackInner:lh,iconGroup:sh,tooltipTrigger:ch,scrollButton:uh,scrollButtonLeft:dh,scrollButtonRight:mh,menu:fh,submenuWrap:ph,submenu:hh,submenuTrigger:gh,menuOverlay:bh,menuOverlayHeader:yh,menuOverlayTitle:xh,menuOverlayBody:wh,menuSeparator:Sh,icon:kh,tooltip:Ch,tooltipElevated:vh},Dh=400,ma=6,so=4;function Ie({label:e,children:t,className:n,elevated:r}){const i=s.useRef(null),a=s.useRef(null),l=s.useRef(null),c=s.useRef(!1),m=s.useRef(!1),[p,b]=s.useState(!1),[h,w]=s.useState({top:0,left:0}),x=s.useCallback(()=>{l.current!==null&&(clearTimeout(l.current),l.current=null)},[]),S=s.useCallback(g=>{if(!(c.current||m.current)){x(),b(!1);return}if(g||m.current){x(),b(!0);return}x(),l.current=setTimeout(()=>{l.current=null,b(!0)},Dh)},[x]),y=s.useCallback(()=>{const g=i.current,k=a.current;if(!g||!k)return;const P=g.getBoundingClientRect(),L=k.offsetWidth,N=k.offsetHeight;let M=P.bottom+ma;M+N>window.innerHeight-so&&(M=P.top-ma-N);let T=P.left+P.width/2-L/2;T=Math.min(Math.max(T,so),window.innerWidth-L-so),w({top:M,left:T})},[]);s.useEffect(()=>()=>x(),[x]),s.useEffect(()=>{const g=i.current;if(!g)return;const k=()=>{m.current=!0,S(!0)},P=()=>{m.current=!1,S(!1)};return g.addEventListener("focusin",k),g.addEventListener("focusout",P),()=>{g.removeEventListener("focusin",k),g.removeEventListener("focusout",P)}},[S]),s.useLayoutEffect(()=>{if(!p)return;y();const g=()=>y();return window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),()=>{window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}},[p,e,y]);const C=n?`${U.tooltipTrigger} ${n}`:U.tooltipTrigger;return o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:i,className:C,"data-tooltip-trigger":"",onMouseEnter:()=>{c.current=!0,S(!1)},onMouseLeave:()=>{c.current=!1,S(!1)},children:t}),p?le.createPortal(o.jsx("span",{ref:a,className:r?`${U.tooltip} ${U.tooltipElevated}`:U.tooltip,"data-toolbar-tooltip":"",style:{top:h.top,left:h.left},"aria-hidden":"true",children:e}),document.body):null]})}const Ah="_wrap_o2uzw_1",Ph="_wrapToolbar_o2uzw_7",Eh="_field_o2uzw_12",jh="_trigger_o2uzw_20",Nh="_chevron_o2uzw_50",Lh="_list_o2uzw_73",Th="_listInline_o2uzw_88",Mh="_option_o2uzw_96",Rh="_separator_o2uzw_125",Me={wrap:Ah,wrapToolbar:Ph,field:Eh,trigger:jh,chevron:Nh,list:Lh,listInline:Th,option:Mh,separator:Rh};function _h({value:e,mixed:t=!1,fonts:n,disabled:r,listId:i,listRef:a,inline:l,style:c,onSelect:m}){const p=V(),b=!t&&e===null;return o.jsxs("ul",{ref:a,id:i,className:l?`${Me.list} ${Me.listInline}`:Me.list,role:"listbox","aria-label":p("commandFontFamilyAria"),style:c,children:[o.jsx("li",{role:"presentation",children:o.jsx("button",{type:"button",className:Me.option,role:"option","aria-checked":b,disabled:r,onMouseDown:h=>h.preventDefault(),onClick:()=>m(null),children:p("fontFamilyDefault")})}),o.jsx("li",{className:Me.separator,role:"separator"}),n.map(h=>{const w=!t&&ln(e,h.family);return o.jsx("li",{role:"presentation",children:o.jsx("button",{type:"button",className:Me.option,role:"option","aria-checked":w,disabled:r,style:{fontFamily:h.family},onMouseDown:x=>x.preventDefault(),onClick:()=>m(h.family),children:h.name})},h.family)})]})}function Fh(e,t,n,r){var i;return t?"":e===null?r:((i=Tc(e,n))==null?void 0:i.name)??e}const Rn=4;function fs({family:e,mixed:t=!1,fonts:n,disabled:r,tooltip:i,toolbar:a=!1,triggerId:l,onChange:c}){const m=V(),p=s.useId(),b=s.useRef(null),h=s.useRef(null),w=s.useRef(null),[x,S]=s.useState(!1),[y,C]=s.useState({top:0,left:0,width:0}),g=Fh(e,t,n,m("fontFamilyDefault")),k=s.useCallback(()=>{const L=h.current,N=w.current;if(!L)return;const M=L.getBoundingClientRect(),T=(N==null?void 0:N.offsetHeight)??0,F=Math.max(M.width,(N==null?void 0:N.offsetWidth)??0);let D=M.bottom;D+T>window.innerHeight-Rn&&(D=Math.max(Rn,M.top-T));const E=Math.min(Math.max(M.left,Rn),window.innerWidth-F-Rn);C({top:D,left:E,width:F})},[]);s.useLayoutEffect(()=>{if(!x)return;k();const L=()=>k();return window.addEventListener("scroll",L,!0),window.addEventListener("resize",L),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L)}},[x,k,n.length]),s.useEffect(()=>{if(!x)return;const L=M=>{var F,D;const T=M.target;(F=b.current)!=null&&F.contains(T)||(D=w.current)!=null&&D.contains(T)||S(!1)},N=M=>{M.key==="Escape"&&(M.preventDefault(),M.stopPropagation(),S(!1))};return document.addEventListener("pointerdown",L),document.addEventListener("keydown",N,!0),()=>{document.removeEventListener("pointerdown",L),document.removeEventListener("keydown",N,!0)}},[x]);const P=o.jsxs("div",{className:`${Me.wrap}${a?` ${Me.wrapToolbar}`:""}`,ref:b,children:[o.jsxs("div",{className:Me.field,ref:h,children:[o.jsx("button",{type:"button",id:l,className:Me.trigger,disabled:r,"aria-label":a?m("commandFontFamilyAria"):void 0,"aria-haspopup":"listbox","aria-expanded":x,"aria-controls":x?p:void 0,style:e&&!t?{fontFamily:e}:void 0,onMouseDown:L=>L.preventDefault(),onClick:()=>S(L=>!L),children:g}),o.jsx("span",{className:Me.chevron,"aria-hidden":"true"})]}),x?le.createPortal(o.jsx(_h,{listRef:w,listId:p,value:t?null:e,mixed:t,fonts:n,disabled:r,style:{top:y.top,left:y.left,minWidth:y.width},onSelect:L=>{c(L),S(!1)}}),document.body):null]});return i?o.jsx(Ie,{label:i,children:P}):P}function Ih({commands:e,queries:t,disabled:n}){const r=V(),i=!!(n||!t.isVisualMode());return o.jsx(fs,{family:t.isFontFamilyMixed()?null:t.getFontFamily(),mixed:t.isFontFamilyMixed(),fonts:t.getFontFaces(),disabled:i,tooltip:r("commandFontFamily"),toolbar:!0,onChange:a=>{e.setFontFamily(a)}})}const Bh="_wrap_1qhfu_1",Hh="_wrapToolbar_1qhfu_9",Oh="_field_1qhfu_14",zh="_input_1qhfu_22",Kh="_toggle_1qhfu_41",$h="_chevron_1qhfu_42",Uh="_unit_1qhfu_80",Wh="_list_1qhfu_110",qh="_option_1qhfu_125",ue={wrap:Bh,wrapToolbar:Hh,field:Oh,input:zh,toggle:Kh,chevron:$h,unit:Uh,list:Wh,option:qh},_n=4,Gh={pt:"fontSizeUnitPt",px:"fontSizeUnitPx",em:"fontSizeUnitEm",rem:"fontSizeUnitRem","%":"fontSizeUnitPercent"};function ps({size:e,unit:t,onSizeChange:n,onUnitChange:r,disabled:i,tooltip:a,sizeInputId:l,toolbar:c=!1}){const m=V(),p=s.useId(),b=s.useRef(null),h=s.useRef(null),w=s.useRef(null),[x,S]=s.useState(()=>e===null?"":Y(e)),[y,C]=s.useState(!1),[g,k]=s.useState(!1),[P,L]=s.useState({top:0,left:0,width:0});s.useEffect(()=>{y||S(e===null?"":Y(e))},[e,y]);const N=s.useCallback(()=>{const E=h.current,_=w.current;if(!E)return;const z=E.getBoundingClientRect(),W=(_==null?void 0:_.offsetHeight)??0;let X=z.bottom;X+W>window.innerHeight-_n&&(X=Math.max(_n,z.top-W));const J=Math.min(Math.max(z.left,_n),window.innerWidth-Math.max(z.width,72)-_n);L({top:X,left:J,width:z.width})},[]);s.useLayoutEffect(()=>{if(!g)return;N();const E=()=>N();return window.addEventListener("scroll",E,!0),window.addEventListener("resize",E),()=>{window.removeEventListener("scroll",E,!0),window.removeEventListener("resize",E)}},[g,N]),s.useEffect(()=>{if(!g)return;const E=z=>{var X,J;const W=z.target;(X=b.current)!=null&&X.contains(W)||(J=w.current)!=null&&J.contains(W)||k(!1)},_=z=>{z.key==="Escape"&&(z.preventDefault(),z.stopPropagation(),k(!1))};return document.addEventListener("pointerdown",E),document.addEventListener("keydown",_,!0),()=>{document.removeEventListener("pointerdown",E),document.removeEventListener("keydown",_,!0)}},[g]);const M=E=>{const _=pu(E,t);if(!_){S(e===null?"":Y(e));return}n(_.value,_.unit),S(Y(_.value))},T=uu[t],F=g?le.createPortal(o.jsx("ul",{ref:w,className:ue.list,role:"listbox",id:p,style:{top:P.top,left:P.left,minWidth:P.width},children:T.map(E=>o.jsx("li",{role:"presentation",children:o.jsx("button",{type:"button",className:ue.option,role:"option","aria-selected":e===E,onMouseDown:_=>_.preventDefault(),onClick:()=>{n(E,t),S(Y(E)),k(!1)},children:Y(E)})},E))}),document.body):null,D=o.jsxs("div",{className:`${ue.wrap}${c?` ${ue.wrapToolbar}`:""}`,ref:b,children:[o.jsxs("div",{className:ue.field,ref:h,children:[o.jsx("input",{id:l,className:ue.input,value:x,disabled:i,"aria-label":m("commandFontSizeAria"),"aria-autocomplete":"list","aria-expanded":g,"aria-controls":p,role:"combobox",inputMode:"decimal",onFocus:()=>C(!0),onBlur:()=>{C(!1),M(x)},onChange:E=>S(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),M(x),k(!1),E.currentTarget.blur()),E.key==="ArrowDown"&&(E.preventDefault(),k(!0))}}),o.jsx("button",{type:"button",className:ue.toggle,tabIndex:-1,disabled:i,"aria-label":m("commandFontSizeAria"),"aria-expanded":g,"aria-controls":p,onMouseDown:E=>E.preventDefault(),onClick:()=>k(E=>!E)})]}),o.jsxs("div",{className:ue.field,children:[o.jsx("select",{className:ue.unit,value:t,disabled:i,"aria-label":m("commandFontSizeUnitAria"),onChange:E=>{r(E.target.value)},children:Io.map(E=>o.jsx("option",{value:E,children:m(Gh[E])},E))}),o.jsx("span",{className:ue.chevron,"aria-hidden":"true"})]}),F]});return a?o.jsx(Ie,{label:a,children:D}):D}const Vh="_backdrop_po4dq_1",Xh="_dialog_po4dq_12",Yh="_dialogWide_po4dq_28",Jh="_header_po4dq_32",Zh="_tabs_po4dq_39",Qh="_tab_po4dq_39",eg="_body_po4dq_71",tg="_field_po4dq_79",ng="_label_po4dq_85",rg="_sizeRow_po4dq_89",og="_fileRow_po4dq_95",ig="_fileName_po4dq_101",ag="_marks_po4dq_108",lg="_mark_po4dq_108",sg="_actions_po4dq_123",cg="_actionsSpread_po4dq_130",ug="_actionsEnd_po4dq_134",dg="_headerRow_po4dq_139",mg="_close_po4dq_151",fg="_nameSection_po4dq_168",pg="_nameInput_po4dq_172",hg="_labelRow_po4dq_189",gg="_help_po4dq_195",bg="_textInput_po4dq_213",yg="_fullSelect_po4dq_225",xg="_error_po4dq_229",wg="_emptyHint_po4dq_234",Sg="_action_po4dq_123",kg="_textarea_po4dq_245",Cg="_actionDanger_po4dq_259",vg="_confirmBody_po4dq_265",Dg="_nestedPanel_po4dq_273",Ag="_spinnerWrap_po4dq_284",Pg="_spinner_po4dq_284",Eg="_actionPrimary_po4dq_319",jg="_iconButton_po4dq_333",Ng="_select_po4dq_334",Lg="_lengthInput_po4dq_335",Tg="_lengthUnit_po4dq_336",Mg="_group_po4dq_344",Rg="_nestedGroup_po4dq_354",_g="_subLabel_po4dq_364",Fg="_iconRow_po4dq_368",Ig="_lengthField_po4dq_400",Bg="_sideLabel_po4dq_406",Hg="_lengthRow_po4dq_410",Og="_sideGrid_po4dq_438",zg="_shadowGrid_po4dq_439",d={backdrop:Vh,dialog:Xh,dialogWide:Yh,header:Jh,tabs:Zh,tab:Qh,body:eg,field:tg,label:ng,sizeRow:rg,fileRow:og,fileName:ig,marks:ag,mark:lg,actions:sg,actionsSpread:cg,actionsEnd:ug,headerRow:dg,close:mg,nameSection:fg,nameInput:pg,labelRow:hg,help:gg,textInput:bg,fullSelect:yg,error:xg,emptyHint:wg,action:Sg,textarea:kg,actionDanger:Cg,confirmBody:vg,nestedPanel:Dg,spinnerWrap:Ag,spinner:Pg,actionPrimary:Eg,iconButton:jg,select:Ng,lengthInput:Lg,lengthUnit:Tg,group:Mg,nestedGroup:Rg,subLabel:_g,iconRow:Fg,lengthField:Ig,sideLabel:Bg,lengthRow:Hg,sideGrid:Og,shadowGrid:zg},Kg={bold:{label:"commandBold"},italic:{label:"commandItalic"},underline:{label:"commandUnderline"},strikethrough:{label:"commandStrikethrough"}};function ii({tab:e,value:t,fonts:n,disabled:r,onTabChange:i,onChange:a}){const l=V(),c=s.useId(),m=s.useId(),p=n??Ga(),b=lo.find(h=>h.id===e)??lo[0];return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:d.tabs,role:"tablist","aria-label":l("fontDialogTitle"),children:lo.map(h=>o.jsx("button",{type:"button",className:d.tab,role:"tab","aria-selected":h.id===e,disabled:!h.implemented,onClick:()=>i(h.id),children:l(h.labelKey)},h.id))}),o.jsx("div",{className:d.body,role:"tabpanel",children:b.implemented?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:m,children:l("fontDialogFamily")}),o.jsx(fs,{family:t.fontFamilyMixed?null:t.fontFamily,mixed:t.fontFamilyMixed,fonts:p,disabled:r,triggerId:m,onChange:h=>{a({...t,fontFamily:h,fontFamilyMixed:!1})}})]}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:c,children:l("fontDialogSize")}),o.jsx("div",{className:d.sizeRow,children:o.jsx(ps,{size:t.size,unit:t.unit,sizeInputId:c,disabled:r,onSizeChange:(h,w)=>{a({...t,size:h,unit:w})},onUnitChange:h=>{const w=t.size!==null?Ja(t.size,t.unit,h,16,16):t.size;a({...t,size:w,unit:h})}})})]}),o.jsx("div",{className:d.field,children:o.jsx(je,{label:l("commandFontColor"),noneLabel:l("colorAutomatic"),value:t.fontColor,mixed:t.fontColorMixed,disabled:r,onChange:h=>{a({...t,fontColor:h,fontColorMixed:!1})}})}),o.jsx("div",{className:d.field,children:o.jsx(je,{label:l("commandHighlightColor"),noneLabel:l("colorNone"),value:t.highlightColor,mixed:t.highlightColorMixed,disabled:r,fallbackCustom:"#ffff00",onChange:h=>{a({...t,highlightColor:h,highlightColorMixed:!1})}})}),o.jsxs("fieldset",{className:d.marks,children:[o.jsx("legend",{className:d.label,children:l("fontDialogStyle")}),_e.map(h=>o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:t.marks[h],disabled:r,onChange:()=>{a({...t,marks:{...t.marks,[h]:!t.marks[h]}})}}),l(Kg[h].label)]},h))]})]}):null})]})}const fa='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])';function $g({open:e,tab:t,size:n,unit:r,marks:i,fontFamily:a=null,fontFamilyMixed:l=!1,fontColor:c,fontColorMixed:m=!1,highlightColor:p,highlightColorMixed:b=!1,fonts:h,disabled:w,onTabChange:x,onApply:S,onClose:y}){const C=V(),g=s.useId(),k=s.useRef(null),[P,L]=s.useState({size:n,unit:r,marks:i,fontFamily:a,fontFamilyMixed:l,fontColor:c,highlightColor:p,fontColorMixed:m,highlightColorMixed:b});return s.useEffect(()=>{e&&L({size:n,unit:r,marks:i,fontFamily:a,fontFamilyMixed:l,fontColor:c,highlightColor:p,fontColorMixed:m,highlightColorMixed:b})},[e,n,r,i,a,l,c,m,p,b]),s.useEffect(()=>{if(!e)return;const N=k.current,M=N==null?void 0:N.querySelector(fa);M==null||M.focus();const T=F=>{if(F.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;F.preventDefault(),F.stopPropagation(),y();return}if(F.key!=="Tab"||!N)return;const D=[...N.querySelectorAll(fa)];if(D.length===0)return;const E=D[0],_=D[D.length-1];F.shiftKey&&document.activeElement===E?(F.preventDefault(),_.focus()):!F.shiftKey&&document.activeElement===_&&(F.preventDefault(),E.focus())};return document.addEventListener("keydown",T,!0),()=>document.removeEventListener("keydown",T,!0)},[e,y]),e?le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:y,children:o.jsxs("div",{ref:k,className:d.dialog,role:"dialog","aria-modal":"true","aria-labelledby":g,onMouseDown:N=>N.stopPropagation(),children:[o.jsx("h2",{className:d.header,id:g,children:C("fontDialogTitle")}),o.jsx(ii,{tab:t,value:P,fonts:h,disabled:w,onTabChange:x,onChange:L}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:y,children:C("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:w,onClick:()=>S(P),children:C("fontDialogOk")})]})]})}),document.body):null}const Ug={pt:"fontSizeUnitPt",px:"fontSizeUnitPx",em:"fontSizeUnitEm",rem:"fontSizeUnitRem","%":"fontSizeUnitPercent"};function me({label:e,value:t,disabled:n,allowNegative:r=!1,unitAria:i,inputId:a,onChange:l}){const c=V(),m=s.useId(),p=a??m,b=(t==null?void 0:t.unit)??Dl,[h,w]=s.useState(()=>t?Y(t.value):""),[x,S]=s.useState(!1);s.useEffect(()=>{x||w(t?Y(t.value):"")},[t,x]);const y=C=>{const g=C.trim();if(!g){l(null),w("");return}const k=Vn(g,b,r);if(!k){w(t?Y(t.value):"");return}l(k),w(Y(k.value))};return o.jsxs("div",{className:d.lengthField,children:[o.jsx("label",{className:d.sideLabel,htmlFor:p,children:e}),o.jsxs("div",{className:d.lengthRow,children:[o.jsx("input",{id:p,className:d.lengthInput,value:h,disabled:n,inputMode:"decimal",onFocus:()=>S(!0),onBlur:()=>{S(!1),y(h)},onChange:C=>w(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),y(h),C.currentTarget.blur())}}),o.jsx("select",{className:d.lengthUnit,value:b,disabled:n,"aria-label":i??c("paragraphDialogLengthUnitAria"),onChange:C=>{const g=C.target.value;if(t){l({value:t.value,unit:g});return}if(h.trim()){const k=Vn(h,g,r);l(k)}},children:Io.map(C=>o.jsx("option",{value:C,children:c(Ug[C])},C))})]})]})}function ai({shadow:e,disabled:t,onChange:n}){const r=V();return o.jsxs("div",{className:d.shadowGrid,children:[o.jsx(me,{label:r("paragraphDialogShadowOffsetX"),value:e.offsetX,disabled:t,allowNegative:!0,onChange:i=>{n({...e,offsetX:i??{value:0,unit:"px"}})}}),o.jsx(me,{label:r("paragraphDialogShadowOffsetY"),value:e.offsetY,disabled:t,allowNegative:!0,onChange:i=>{n({...e,offsetY:i??{value:0,unit:"px"}})}}),o.jsx(me,{label:r("paragraphDialogShadowBlur"),value:e.blur,disabled:t,onChange:i=>{n({...e,blur:i??{value:0,unit:"px"}})}}),o.jsx(me,{label:r("paragraphDialogShadowSpread"),value:e.spread,disabled:t,allowNegative:!0,onChange:i=>{n({...e,spread:i??{value:0,unit:"px"}})}}),o.jsx(je,{label:r("paragraphDialogShadowColor"),noneLabel:r("colorNone"),value:e.color,disabled:t,onChange:i=>{n({...e,color:i})}}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:e.inset,disabled:t,onChange:()=>{n({...e,inset:!e.inset})}}),r("paragraphDialogShadowInset")]})]})}const pa=[{id:"general",labelKey:"fontDialogTabGeneral",implemented:!0},{id:"spacing",labelKey:"paragraphDialogSpacing",implemented:!0},{id:"border",labelKey:"paragraphDialogTabBorder",implemented:!0},{id:"background",labelKey:"paragraphDialogTabBackground",implemented:!0}],Wg={left:No,center:jo,right:Lo,justify:Ta},qg={left:{aria:"commandAlignLeftAria"},center:{aria:"commandAlignCenterAria"},right:{aria:"commandAlignRightAria"},justify:{aria:"commandAlignJustifyAria"}},Gg={top:"paragraphDialogSideTop",right:"paragraphDialogSideRight",bottom:"paragraphDialogSideBottom",left:"paragraphDialogSideLeft"},Vg={none:"paragraphDialogBorderStyleNone",solid:"paragraphDialogBorderStyleSolid",dotted:"paragraphDialogBorderStyleDotted",dashed:"paragraphDialogBorderStyleDashed",double:"paragraphDialogBorderStyleDouble",groove:"paragraphDialogBorderStyleGroove",ridge:"paragraphDialogBorderStyleRidge",inset:"paragraphDialogBorderStyleInset",outset:"paragraphDialogBorderStyleOutset"},Xg={pt:"fontSizeUnitPt",px:"fontSizeUnitPx",em:"fontSizeUnitEm",rem:"fontSizeUnitRem","%":"fontSizeUnitPercent"},Yg={value:1,unit:"pt"},Jg={offsetX:{value:0,unit:"px"},offsetY:{value:4,unit:"px"},blur:{value:8,unit:"px"},spread:{value:0,unit:"px"},color:"#000000",inset:!1};function Xt(e){return{top:e,right:e,bottom:e,left:e}}function ha(e){for(const t of Oe)if(e[t])return e[t];return null}function li({tab:e,value:t,disabled:n,tabs:r,tablistLabelKey:i="paragraphDialogTitle",onTabChange:a,onChange:l}){const c=V(),m=r?pa.filter(y=>r.includes(y.id)):pa,p=s.useId(),[b,h]=s.useState(()=>qe(t.margin,Xt(t.margin.top))),[w,x]=s.useState(()=>qe(t.padding,Xt(t.padding.top))),S=(y,C,g,k)=>{const P=t[y],L=C?Xt(k):{...P,[g]:k};l({...t,[y]:L,[`${y}Mixed`]:!1})};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:d.tabs,role:"tablist","aria-label":c(i),children:m.map(y=>o.jsx("button",{type:"button",className:d.tab,role:"tab","aria-selected":y.id===e,disabled:!y.implemented,onClick:()=>a(y.id),children:c(y.labelKey)},y.id))}),o.jsxs("div",{className:d.body,role:"tabpanel",children:[e==="general"?o.jsxs(o.Fragment,{children:[o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:c("paragraphDialogAlignment")}),o.jsx("div",{className:d.iconRow,role:"radiogroup","aria-label":c("paragraphDialogAlignment"),children:Fl.map(y=>{const C=Wg[y],g=!t.alignMixed&&t.align===y;return o.jsx("button",{type:"button",className:d.iconButton,role:"radio","aria-checked":g,"aria-label":c(qg[y].aria),disabled:n,onClick:()=>{l({...t,align:y,alignMixed:!1})},children:o.jsx(C,{})},y)})})]}),o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:c("paragraphDialogLists")}),o.jsxs("div",{className:d.iconRow,children:[o.jsx("button",{type:"button",className:d.iconButton,"aria-pressed":!t.listMixed&&t.list==="ul","aria-label":c("commandBulletListAria"),disabled:n,onClick:()=>{const y=!t.listMixed&&t.list==="ul"?null:"ul";l({...t,list:y,listMixed:!1})},children:o.jsx(Ma,{})}),o.jsx("button",{type:"button",className:d.iconButton,"aria-pressed":!t.listMixed&&t.list==="ol","aria-label":c("commandNumberedListAria"),disabled:n,onClick:()=>{const y=!t.listMixed&&t.list==="ol"?null:"ol";l({...t,list:y,listMixed:!1})},children:o.jsx(_a,{})})]})]})]}):null,e==="spacing"?o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:c("paragraphDialogSpacing")}),o.jsx(ga,{legend:c("paragraphDialogMargin"),sides:t.margin,linked:b,disabled:n,allowNegative:!0,onLinkedChange:y=>{h(y),y&&l({...t,margin:Xt(ha(t.margin)),marginMixed:!1})},onSideChange:(y,C)=>S("margin",b,y,C)}),o.jsx(ga,{legend:c("paragraphDialogPadding"),sides:t.padding,linked:w,disabled:n,onLinkedChange:y=>{x(y),y&&l({...t,padding:Xt(ha(t.padding)),paddingMixed:!1})},onSideChange:(y,C)=>S("padding",w,y,C)}),o.jsx(Qg,{value:t.lineHeight,disabled:n,onChange:y=>{l({...t,lineHeight:y,lineHeightMixed:!1})}})]}):null,e==="border"?o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:c("paragraphDialogBorder")}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:p,children:c("paragraphDialogBorderStyle")}),o.jsx("select",{id:p,className:d.select,value:t.border.style,disabled:n,onChange:y=>{const C=y.target.value;l({...t,border:{style:C,width:C==="none"?null:t.border.width??Yg,color:C==="none"?null:t.border.color},borderMixed:!1})},children:ir.map(y=>o.jsx("option",{value:y,children:c(Vg[y])},y))})]}),t.border.style!=="none"?o.jsxs(o.Fragment,{children:[o.jsx(me,{label:c("paragraphDialogBorderWidth"),value:t.border.width,disabled:n,onChange:y=>{l({...t,border:{...t.border,width:y},borderMixed:!1})}}),o.jsx(je,{label:c("paragraphDialogBorderColor"),noneLabel:c("colorNone"),value:t.border.color,mixed:t.borderMixed,disabled:n,onChange:y=>{l({...t,border:{...t.border,color:y},borderMixed:!1})}})]}):null,o.jsx(me,{label:c("paragraphDialogBorderRadius"),value:t.borderRadius,disabled:n,onChange:y=>{l({...t,borderRadius:y,radiusMixed:!1})}}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:t.boxShadow!==null,disabled:n,onChange:()=>{l({...t,boxShadow:t.boxShadow?null:Jg,shadowMixed:!1})}}),c("paragraphDialogBoxShadow")]}),t.boxShadow?o.jsx(ai,{shadow:t.boxShadow,disabled:n,onChange:y=>{l({...t,boxShadow:y,shadowMixed:!1})}}):null]}):null,e==="background"?o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:c("paragraphDialogTabBackground")}),o.jsx(je,{label:c("paragraphDialogBackgroundColor"),noneLabel:c("colorNone"),value:t.backgroundColor,mixed:t.backgroundMixed,disabled:n,onChange:y=>{l({...t,backgroundColor:y,backgroundMixed:!1})}}),o.jsx(Zg,{value:t.opacity,disabled:n,onChange:y=>{l({...t,opacity:y,opacityMixed:!1})}})]}):null]})]})}function Zg({value:e,disabled:t,onChange:n}){const r=V(),i=s.useId(),a=e===null?null:Xn(e),[l,c]=s.useState(()=>a===null?"":Y(a)),[m,p]=s.useState(!1);s.useEffect(()=>{m||c(a===null?"":Y(a))},[a,m]);const b=h=>{const w=h.trim();if(!w){n(null),c("");return}const x=Number(w.replace(",","."));if(!Number.isFinite(x)){c(a===null?"":Y(a));return}const S=jl(x);n(S),c(Y(Xn(S)))};return o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:i,children:r("paragraphDialogOpacity")}),o.jsxs("div",{className:d.lengthRow,children:[o.jsx("input",{id:i,className:d.lengthInput,value:l,disabled:t,inputMode:"decimal",onFocus:()=>p(!0),onChange:h=>c(h.target.value),onBlur:()=>{p(!1),b(l)}}),o.jsx("span",{className:d.lengthUnit,"aria-hidden":"true",children:r("fontSizeUnitPercent")})]})]})}function ga({legend:e,sides:t,linked:n,disabled:r,allowNegative:i=!1,onLinkedChange:a,onSideChange:l}){const c=V(),m=n?["top"]:Oe;return o.jsxs("fieldset",{className:d.nestedGroup,children:[o.jsx("legend",{className:d.subLabel,children:e}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:n,disabled:r,onChange:()=>a(!n)}),c("paragraphDialogLinkSides")]}),o.jsx("div",{className:d.sideGrid,children:m.map(p=>o.jsx(me,{label:n?e:c(Gg[p]),value:t[p],disabled:r,allowNegative:i,onChange:b=>l(p,b)},p))})]})}function Qg({value:e,disabled:t,onChange:n}){const r=V(),i=s.useId(),a=eb(e),l=(e==null?void 0:e.kind)==="number"||(e==null?void 0:e.kind)==="length"?e.value:null,[c,m]=s.useState(()=>l===null?"":Y(l)),p=(e==null?void 0:e.kind)==="length"?e.unit:Dl;return o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:i,children:r("paragraphDialogLineHeight")}),o.jsxs("div",{className:d.lengthRow,children:[o.jsx("input",{id:i,className:d.lengthInput,value:a==="normal"?"":c,disabled:t||a==="normal",inputMode:"decimal",onChange:b=>m(b.target.value),onBlur:()=>{const b=c.trim();if(!b){n(null);return}if(a==="number"||a==="empty"){const w=Number(b.replace(",","."));if(!Number.isFinite(w)||w<0){m(l===null?"":Y(l));return}n({kind:"number",value:w}),m(Y(w));return}const h=Vn(b,p,!1);if(!h){m(l===null?"":Y(l));return}n({kind:"length",value:h.value,unit:h.unit}),m(Y(h.value))}}),o.jsxs("select",{className:d.lengthUnit,value:a==="length"?p:a,disabled:t,"aria-label":r("paragraphDialogLengthUnitAria"),onChange:b=>{const h=b.target.value;if(h==="empty"){n(null),m("");return}if(h==="normal"){n({kind:"normal"}),m("");return}if(h==="number"){const y=Number((c||"1.5").replace(",",".")),C=Number.isFinite(y)&&y>=0?y:1.5;n({kind:"number",value:C}),m(Y(C));return}const w=h,x=Vn(c||"1",w,!1),S=(x==null?void 0:x.value)??1;n({kind:"length",value:S,unit:w}),m(Y(S))},children:[o.jsx("option",{value:"empty"}),o.jsx("option",{value:"normal",children:r("paragraphDialogLineHeightNormal")}),o.jsx("option",{value:"number",children:r("paragraphDialogLineHeightUnitless")}),["pt","px","em","rem","%"].map(b=>o.jsx("option",{value:b,children:r(Xg[b])},b))]})]})]})}function eb(e){return e?e.kind==="normal"?"normal":e.kind==="number"?"number":"length":"empty"}const ba='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])';function tb({open:e,tab:t,value:n,disabled:r,onTabChange:i,onApply:a,onClose:l}){const c=V(),m=s.useId(),p=s.useRef(null),[b,h]=s.useState(n);return s.useEffect(()=>{e&&h(n)},[e,n]),s.useEffect(()=>{if(!e)return;const w=p.current,x=w==null?void 0:w.querySelector(ba);x==null||x.focus();const S=y=>{if(y.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;y.preventDefault(),y.stopPropagation(),l();return}if(y.key!=="Tab"||!w)return;const C=[...w.querySelectorAll(ba)];if(C.length===0)return;const g=C[0],k=C[C.length-1];y.shiftKey&&document.activeElement===g?(y.preventDefault(),k.focus()):!y.shiftKey&&document.activeElement===k&&(y.preventDefault(),g.focus())};return document.addEventListener("keydown",S,!0),()=>document.removeEventListener("keydown",S,!0)},[e,l]),e?le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:l,children:o.jsxs("div",{ref:p,className:`${d.dialog} ${d.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":m,onMouseDown:w=>w.stopPropagation(),children:[o.jsx("h2",{className:d.header,id:m,children:c("paragraphDialogTitle")}),o.jsx(li,{tab:t,value:b,disabled:r,onTabChange:i,onChange:h}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:l,children:c("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:r,onClick:()=>a(b),children:c("fontDialogOk")})]})]})}),document.body):null}const nb=[{id:"spacing",labelKey:"paragraphDialogSpacing",implemented:!0},{id:"border",labelKey:"paragraphDialogTabBorder",implemented:!0},{id:"background",labelKey:"paragraphDialogTabBackground",implemented:!0}],ya='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])',rb=nb.map(e=>e.id);function ob(e){return{...Jt(),...e}}function ib(e){const{align:t,alignMixed:n,list:r,listMixed:i,...a}=e;return a}function ab({open:e,tab:t,value:n,fonts:r,disabled:i,onTabChange:a,onApply:l,onClose:c}){const m=V(),p=s.useId(),b=s.useRef(null),[h,w]=s.useState("general"),[x,S]=s.useState("spacing"),[y,C]=s.useState(n.font),[g,k]=s.useState(n.box);if(s.useEffect(()=>{e&&(w("general"),S("spacing"),C(n.font),k(n.box))},[e,n]),s.useEffect(()=>{if(!e)return;const L=b.current,N=L==null?void 0:L.querySelector(ya);N==null||N.focus();const M=T=>{if(T.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;T.preventDefault(),T.stopPropagation(),c();return}if(T.key!=="Tab"||!L)return;const F=[...L.querySelectorAll(ya)];if(F.length===0)return;const D=F[0],E=F[F.length-1];T.shiftKey&&document.activeElement===D?(T.preventDefault(),E.focus()):!T.shiftKey&&document.activeElement===E&&(T.preventDefault(),D.focus())};return document.addEventListener("keydown",M,!0),()=>document.removeEventListener("keydown",M,!0)},[e,c]),!e)return null;const P=m("pageDialogTitle");return le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:c,children:o.jsxs("div",{ref:b,className:`${d.dialog} ${d.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":p,onMouseDown:L=>L.stopPropagation(),children:[o.jsx("h2",{className:d.header,id:p,children:P}),o.jsxs("div",{className:d.tabs,role:"tablist","aria-label":P,children:[o.jsx("button",{type:"button",className:d.tab,role:"tab","aria-selected":t==="font",onClick:()=>a("font"),children:m("customStyleDialogTabFont")}),o.jsx("button",{type:"button",className:d.tab,role:"tab","aria-selected":t==="paragraph",onClick:()=>a("paragraph"),children:m("customStyleDialogTabParagraph")})]}),t==="font"?o.jsx("div",{className:d.nestedPanel,children:o.jsx(ii,{tab:h,value:y,fonts:r,disabled:i,onTabChange:w,onChange:C})}):o.jsx("div",{className:d.nestedPanel,children:o.jsx(li,{tab:x,value:ob(g),disabled:i,tabs:rb,tablistLabelKey:"pageDialogTitle",onTabChange:L=>{L!=="general"&&S(L)},onChange:L=>k(ib(L))})}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:c,children:m("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:i,onClick:()=>l({font:y,box:g}),children:m("fontDialogOk")})]})]})}),document.body)}const xa='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])';function lb(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`style-${Date.now().toString(16)}-${Math.random().toString(16).slice(2)}`}function wa(e){return{size:e.size,unit:e.unit,marks:e.marks,fontFamily:e.fontFamily??null,fontFamilyMixed:!1,fontColor:e.fontColor,highlightColor:e.highlightColor,fontColorMixed:!1,highlightColorMixed:!1}}function sb(e){return{size:e.size,unit:e.unit,marks:e.marks,fontFamily:e.fontFamilyMixed?null:e.fontFamily,fontColor:e.fontColorMixed?null:e.fontColor,highlightColor:e.highlightColorMixed?null:e.highlightColor}}function cb({open:e,mode:t,styleId:n,name:r="",font:i,paragraph:a,canDelete:l=!1,busy:c,disabled:m,fonts:p,defaultOuterTab:b="font",onSave:h,onDelete:w,onClose:x}){const S=V(),y=s.useId(),C=s.useId(),g=s.useRef(null),[k,P]=s.useState(r),[L,N]=s.useState(b),[M,T]=s.useState("general"),[F,D]=s.useState("general"),[E,_]=s.useState(()=>wa(i)),[z,W]=s.useState(()=>xo(a)),[X,J]=s.useState(!1);if(s.useEffect(()=>{e&&(P(r),N(b),T("general"),D("general"),_(wa(i)),W(xo(a)),J(!1))},[e,r,i,a,b]),s.useEffect(()=>{if(!e)return;const Z=g.current,Q=Z==null?void 0:Z.querySelector(xa);Q==null||Q.focus();const A=K=>{if(K.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;if(K.preventDefault(),K.stopPropagation(),X){J(!1);return}x();return}if(K.key!=="Tab"||!Z)return;const j=[...Z.querySelectorAll(xa)];if(j.length===0)return;const O=j[0],ee=j[j.length-1];K.shiftKey&&document.activeElement===O?(K.preventDefault(),ee.focus()):!K.shiftKey&&document.activeElement===ee&&(K.preventDefault(),O.focus())};return document.addEventListener("keydown",A,!0),()=>document.removeEventListener("keydown",A,!0)},[e,x,X]),!e)return null;const fe=S(t==="create"?"customStyleDialogAddTitle":"customStyleDialogEditTitle"),ce=k.trim().length>0,te=!!(m||c),R=()=>{const Z=k.trim();Z&&h({id:n??lb(),name:Z,font:sb(E),paragraph:Ol(z)})};return le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:x,children:o.jsxs("div",{ref:g,className:`${d.dialog} ${d.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":y,"aria-busy":c||void 0,onMouseDown:Z=>Z.stopPropagation(),children:[o.jsxs("div",{className:d.headerRow,children:[o.jsx("h2",{className:d.header,id:y,children:fe}),o.jsx("button",{type:"button",className:d.close,"aria-label":S("customStyleDialogCloseAria"),onClick:x,children:o.jsx(He,{})})]}),X?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:d.confirmBody,children:S("customStyleDialogDeleteConfirm")}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,disabled:te,onClick:()=>J(!1),children:S("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionDanger}`,disabled:te||!n,onClick:()=>{n&&(w==null||w(n))},children:S("customStyleDialogDelete")})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:d.nameSection,children:o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:C,children:S("customStyleDialogName")}),o.jsx("input",{id:C,className:d.nameInput,value:k,disabled:te,onChange:Z=>P(Z.target.value)})]})}),o.jsxs("div",{className:d.tabs,role:"tablist","aria-label":fe,children:[o.jsx("button",{type:"button",className:d.tab,role:"tab","aria-selected":L==="font",onClick:()=>N("font"),children:S("customStyleDialogTabFont")}),o.jsx("button",{type:"button",className:d.tab,role:"tab","aria-selected":L==="paragraph",onClick:()=>N("paragraph"),children:S("customStyleDialogTabParagraph")})]}),L==="font"?o.jsx("div",{className:d.nestedPanel,children:o.jsx(ii,{tab:M,value:E,fonts:p,disabled:te,onTabChange:T,onChange:_})}):o.jsx("div",{className:d.nestedPanel,children:o.jsx(li,{tab:F,value:z,disabled:te,onTabChange:D,onChange:W})}),o.jsxs("div",{className:t==="edit"&&l?`${d.actions} ${d.actionsSpread}`:d.actions,children:[t==="edit"&&l?o.jsx("button",{type:"button",className:`${d.action} ${d.actionDanger}`,disabled:te,onClick:()=>J(!0),children:S("customStyleDialogDelete")}):null,o.jsxs("div",{className:d.actionsEnd,children:[o.jsx("button",{type:"button",className:d.action,onClick:x,children:S("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:te||!ce,onClick:R,children:S("fontDialogOk")})]})]})]})]})}),document.body)}const Sa='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled])',ub={empty:"bookmarkDialogErrorEmpty",invalid:"bookmarkDialogErrorInvalid",duplicate:"bookmarkDialogErrorDuplicate"};function db({open:e,existingIds:t,disabled:n,onApply:r,onClose:i}){const a=V(),l=s.useId(),c=s.useId(),m=s.useId(),p=s.useRef(null),[b,h]=s.useState(""),[w,x]=s.useState(!1),S=s.useMemo(()=>new Set(t),[t]),y=Wl(b,S);if(s.useEffect(()=>{e&&(h(""),x(!1))},[e]),s.useEffect(()=>{if(!e)return;const P=p.current,L=P==null?void 0:P.querySelector(Sa);L==null||L.focus();const N=M=>{if(M.key==="Escape"){M.preventDefault(),M.stopPropagation(),i();return}if(M.key!=="Tab"||!P)return;const T=[...P.querySelectorAll(Sa)];if(T.length===0)return;const F=T[0],D=T[T.length-1];M.shiftKey&&document.activeElement===F?(M.preventDefault(),D.focus()):!M.shiftKey&&document.activeElement===D&&(M.preventDefault(),F.focus())};return document.addEventListener("keydown",N,!0),()=>document.removeEventListener("keydown",N,!0)},[e,i]),!e)return null;const C=w||b.trim().length>0?y:null,g=y===null&&!n,k=()=>{x(!0),!(y||n)&&r(b.trim())};return le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:i,children:o.jsxs("div",{ref:p,className:d.dialog,role:"dialog","aria-modal":"true","aria-labelledby":l,onMouseDown:P=>P.stopPropagation(),children:[o.jsxs("div",{className:d.headerRow,children:[o.jsx("h2",{className:d.header,id:l,children:a("bookmarkDialogTitle")}),o.jsx("button",{type:"button",className:d.close,"aria-label":a("bookmarkDialogCloseAria"),onClick:i,children:o.jsx(He,{})})]}),o.jsx("div",{className:d.body,children:o.jsxs("div",{className:d.field,children:[o.jsxs("div",{className:d.labelRow,children:[o.jsx("label",{className:d.label,htmlFor:c,children:a("bookmarkDialogName")}),o.jsx(Ie,{label:a("bookmarkDialogHelp"),elevated:!0,children:o.jsx("button",{type:"button",className:d.help,"aria-label":a("bookmarkDialogHelpAria"),children:"?"})})]}),o.jsx("input",{id:c,className:d.textInput,value:b,disabled:n,"aria-invalid":C!==null,"aria-describedby":C?m:void 0,onChange:P=>h(P.target.value)}),C?o.jsx("p",{id:m,className:d.error,children:a(ub[C])}):null]})}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:i,children:a("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:!g,onClick:k,children:a("fontDialogOk")})]})]})}),document.body)}const ka='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([hidden]), select:not([disabled]), textarea:not([disabled])',mb={empty:"imageDialogErrorEmpty",invalid:"imageDialogErrorInvalid"},fb={type:"imageDialogErrorType",tooLarge:"imageDialogErrorTooLarge"};function pb({open:e,disabled:t,customImagePicker:n,onApply:r,onCustomPick:i,onClose:a}){const l=V(),c=s.useId(),m=s.useId(),p=s.useId(),b=s.useId(),h=s.useId(),w=s.useRef(null),x=s.useRef(null),[S,y]=s.useState("file"),[C,g]=s.useState(""),[k,P]=s.useState(""),[L,N]=s.useState(""),[M,T]=s.useState(""),[F,D]=s.useState(""),[E,_]=s.useState(null),[z,W]=s.useState(!1);if(s.useEffect(()=>{e&&(y("file"),g(""),P(""),N(""),T(""),D(""),_(null),W(!1),x.current&&(x.current.value=""))},[e]),s.useEffect(()=>{if(!e)return;const Q=w.current,A=Q==null?void 0:Q.querySelector(ka);A==null||A.focus();const K=j=>{if(j.key==="Escape"){j.preventDefault(),j.stopPropagation(),a();return}if(j.key!=="Tab"||!Q)return;const O=[...Q.querySelectorAll(ka)];if(O.length===0)return;const ee=O[0],ye=O[O.length-1];j.shiftKey&&document.activeElement===ee?(j.preventDefault(),ye.focus()):!j.shiftKey&&document.activeElement===ye&&(j.preventDefault(),ee.focus())};return document.addEventListener("keydown",K,!0),()=>document.removeEventListener("keydown",K,!0)},[e,a]),!e)return null;const X=S==="file"?k:S==="url"?C:"",J=S==="custom"?null:ei(X),fe=S==="custom"?null:S==="file"&&E?fb[E]:J&&(S==="file"||C.trim().length>0)?mb[J]:null,ce=S!=="custom"&&J===null&&!(S==="file"&&E)&&!t&&!z,te=()=>{t||!n||i==null||i()},R=()=>{ce&&r({src:X.trim(),alt:M.trim(),title:F.trim()})},Z=Q=>{var K;const A=(K=Q.target.files)==null?void 0:K[0];A&&(W(!0),_(null),Km(A).then(j=>{P(j),N(A.name),y("file"),W(!1)},j=>{const O=j instanceof Error?j.message:"";P(""),N(""),y("file"),_(O==="tooLarge"||O==="type"?O:"type"),W(!1),x.current&&(x.current.value="")}))};return le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:a,children:o.jsxs("div",{ref:w,className:d.dialog,role:"dialog","aria-modal":"true","aria-labelledby":c,onMouseDown:Q=>Q.stopPropagation(),children:[o.jsxs("div",{className:d.headerRow,children:[o.jsx("h2",{className:d.header,id:c,children:l("imageDialogTitle")}),o.jsx("button",{type:"button",className:d.close,"aria-label":l("imageDialogCloseAria"),onClick:a,children:o.jsx(He,{})})]}),o.jsxs("div",{className:d.body,children:[o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.subLabel,children:l("imageDialogSource")}),o.jsxs("div",{className:d.sizeRow,role:"radiogroup","aria-label":l("imageDialogSource"),children:[o.jsx("button",{type:"button",className:d.action,role:"radio","aria-checked":S==="file",disabled:t,onClick:()=>y("file"),children:l("imageDialogFile")}),o.jsx("button",{type:"button",className:d.action,role:"radio","aria-checked":S==="url",disabled:t,onClick:()=>y("url"),children:l("imageDialogUrl")}),n?o.jsx("button",{type:"button",className:d.action,role:"radio","aria-checked":S==="custom",disabled:t,onClick:()=>y("custom"),children:n.text}):null]}),S==="file"?o.jsxs("div",{className:d.fileRow,children:[o.jsx("input",{ref:x,type:"file",accept:_m,hidden:!0,disabled:t,"aria-label":l("imageDialogChooseFile"),onChange:Z}),o.jsx("button",{type:"button",className:d.action,disabled:t||z,onClick:()=>{var Q;return(Q=x.current)==null?void 0:Q.click()},children:l("imageDialogChooseFile")}),L?o.jsx("span",{className:d.fileName,children:L}):null]}):null,S==="url"?o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:m,children:l("imageDialogUrl")}),o.jsx("input",{id:m,className:d.textInput,value:C,disabled:t,"aria-invalid":fe!==null,"aria-describedby":fe?h:void 0,onChange:Q=>g(Q.target.value)})]}):null,S==="custom"&&n?o.jsxs("div",{className:d.field,children:[o.jsx("p",{className:d.emptyHint,children:n.description}),o.jsx("button",{type:"button",className:d.action,disabled:t,onClick:te,children:n.buttonCaption})]}):null]}),S!=="custom"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:p,children:l("imageDialogAlt")}),o.jsx("input",{id:p,className:d.textInput,value:M,disabled:t,onChange:Q=>T(Q.target.value)})]}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:b,children:l("imageDialogTitleField")}),o.jsx("input",{id:b,className:d.textInput,value:F,disabled:t,onChange:Q=>D(Q.target.value)})]})]}):null,fe?o.jsx("p",{id:h,className:d.error,children:l(fe)}):null]}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:a,children:l("fontDialogCancel")}),S!=="custom"?o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:!ce,onClick:R,children:l("fontDialogOk")}):null]})]})}),document.body)}const Fn=4,hb={pt:"fontSizeUnitPt",px:"fontSizeUnitPx",em:"fontSizeUnitEm",rem:"fontSizeUnitRem","%":"fontSizeUnitPercent",pc:"fontSizeUnitPc"};function Ca({label:e,inputAria:t,value:n,disabled:r,onChange:i}){const a=V(),l=s.useId(),c=s.useId(),m=s.useRef(null),p=s.useRef(null),b=s.useRef(null),h=(n==null?void 0:n.unit)??Vm,[w,x]=s.useState(()=>n?Y(n.value):""),[S,y]=s.useState(!1),[C,g]=s.useState(!1),[k,P]=s.useState({top:0,left:0,width:0});s.useEffect(()=>{S||x(n?Y(n.value):"")},[n,S]);const L=s.useCallback(()=>{const D=p.current,E=b.current;if(!D)return;const _=D.getBoundingClientRect(),z=(E==null?void 0:E.offsetHeight)??0;let W=_.bottom;W+z>window.innerHeight-Fn&&(W=Math.max(Fn,_.top-z));const X=Math.min(Math.max(_.left,Fn),window.innerWidth-Math.max(_.width,72)-Fn);P({top:W,left:X,width:_.width})},[]);s.useLayoutEffect(()=>{if(!C)return;L();const D=()=>L();return window.addEventListener("scroll",D,!0),window.addEventListener("resize",D),()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",D)}},[C,L]),s.useEffect(()=>{if(!C)return;const D=_=>{var W,X;const z=_.target;(W=m.current)!=null&&W.contains(z)||(X=b.current)!=null&&X.contains(z)||g(!1)},E=_=>{_.key==="Escape"&&(_.preventDefault(),_.stopPropagation(),g(!1))};return document.addEventListener("pointerdown",D),document.addEventListener("keydown",E,!0),()=>{document.removeEventListener("pointerdown",D),document.removeEventListener("keydown",E,!0)}},[C]);const N=D=>{const E=D.trim();if(!E){i(null),x("");return}const _=ra(E,h);if(!_){x(n?Y(n.value):"");return}i(_),x(Y(_.value))},M=Xm[h],T=(n==null?void 0:n.value)??null,F=C?le.createPortal(o.jsx("ul",{ref:b,className:ue.list,role:"listbox",id:l,style:{top:k.top,left:k.left,minWidth:k.width},children:M.map(D=>o.jsx("li",{role:"presentation",children:o.jsx("button",{type:"button",className:ue.option,role:"option","aria-selected":T===D,onMouseDown:E=>E.preventDefault(),onClick:()=>{i({value:D,unit:h}),x(Y(D)),g(!1)},children:Y(D)})},D))}),document.body):null;return o.jsxs("div",{className:d.lengthField,children:[o.jsx("label",{className:d.sideLabel,htmlFor:c,children:e}),o.jsxs("div",{className:`${ue.wrap} ${d.lengthRow}`,ref:m,children:[o.jsxs("div",{className:ue.field,ref:p,children:[o.jsx("input",{id:c,className:ue.input,value:w,disabled:r,"aria-label":t,"aria-autocomplete":"list","aria-expanded":C,"aria-controls":l,role:"combobox",inputMode:"decimal",onFocus:()=>y(!0),onBlur:()=>{y(!1),N(w)},onChange:D=>x(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),N(w),g(!1),D.currentTarget.blur()),D.key==="ArrowDown"&&(D.preventDefault(),g(!0))}}),o.jsx("button",{type:"button",className:ue.toggle,tabIndex:-1,disabled:r,"aria-label":t,"aria-expanded":C,"aria-controls":l,onMouseDown:D=>D.preventDefault(),onClick:()=>g(D=>!D)})]}),o.jsxs("div",{className:ue.field,children:[o.jsx("select",{className:ue.unit,value:h,disabled:r,"aria-label":a("imagePropertiesSizeUnitAria"),onChange:D=>{const E=D.target.value;if(n){i({value:n.value,unit:E});return}w.trim()&&i(ra(w,E))},children:Xl.map(D=>o.jsx("option",{value:D,children:a(hb[D])},D))}),o.jsx("span",{className:ue.chevron,"aria-hidden":"true"})]}),F]})]})}const gb=[{id:"general",labelKey:"fontDialogTabGeneral",implemented:!0},{id:"alignment",labelKey:"imagePropertiesTabAlignment",implemented:!0},{id:"border",labelKey:"imagePropertiesTabBorder",implemented:!0},{id:"advanced",labelKey:"imagePropertiesTabAdvanced",implemented:!0},{id:"hover",labelKey:"imagePropertiesTabHover",implemented:!0}],bb={left:No,center:jo,right:Lo},yb=["left","center","right"],xb={left:"commandAlignLeftAria",center:"commandAlignCenterAria",right:"commandAlignRightAria"},wb=["width","height","lock"],Sb={width:"imagePropertiesSizeWidth",height:"imagePropertiesSizeHeight",lock:"imagePropertiesSizeLock"},kb={top:"paragraphDialogSideTop",right:"paragraphDialogSideRight",bottom:"paragraphDialogSideBottom",left:"paragraphDialogSideLeft"},Cb={none:"paragraphDialogBorderStyleNone",solid:"paragraphDialogBorderStyleSolid",dotted:"paragraphDialogBorderStyleDotted",dashed:"paragraphDialogBorderStyleDashed",double:"paragraphDialogBorderStyleDouble",groove:"paragraphDialogBorderStyleGroove",ridge:"paragraphDialogBorderStyleRidge",inset:"paragraphDialogBorderStyleInset",outset:"paragraphDialogBorderStyleOutset"},vb={fill:"imagePropertiesFitFill",contain:"imagePropertiesFitContain",cover:"imagePropertiesFitCover",none:"imagePropertiesFitNoneValue","scale-down":"imagePropertiesFitScaleDown"},Db={center:"imagePropertiesPositionCenter",top:"imagePropertiesPositionTop",bottom:"imagePropertiesPositionBottom",left:"imagePropertiesPositionLeft",right:"imagePropertiesPositionRight","top left":"imagePropertiesPositionTopLeft","top right":"imagePropertiesPositionTopRight","bottom left":"imagePropertiesPositionBottomLeft","bottom right":"imagePropertiesPositionBottomRight"},Ab={value:1,unit:"pt"},Pb={offsetX:{value:0,unit:"px"},offsetY:{value:4,unit:"px"},blur:{value:8,unit:"px"},spread:{value:0,unit:"px"},color:"#000000",inset:!1};function co(e){return{top:e,right:e,bottom:e,left:e}}function Eb(e){for(const t of Oe)if(e[t])return e[t];return null}function jb({tab:e,value:t,aspectRatio:n,disabled:r,onTabChange:i,onChange:a}){const l=V(),c=s.useId(),m=s.useId(),p=s.useId(),b=s.useId(),h=s.useId(),[w,x]=s.useState(()=>qe(t.margin,co(t.margin.top))),S=t.align==="center",y=(g,k)=>{if(t.sizeMode==="lock"&&k){const P=Zt(g,k,n);a({...t,width:P.width,height:P.height});return}a({...t,[g]:k})},C=g=>{if(g==="width"){a({...t,sizeMode:g,height:null});return}if(g==="height"){a({...t,sizeMode:g,width:null});return}if(t.width){const k=Zt("width",t.width,n);a({...t,sizeMode:g,width:k.width,height:k.height});return}if(t.height){const k=Zt("height",t.height,n);a({...t,sizeMode:g,width:k.width,height:k.height});return}a({...t,sizeMode:g})};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:d.tabs,role:"tablist","aria-label":l("imagePropertiesDialogTitle"),children:gb.map(g=>o.jsx("button",{type:"button",className:d.tab,role:"tab","aria-selected":g.id===e,disabled:!g.implemented,onClick:()=>i(g.id),children:l(g.labelKey)},g.id))}),o.jsxs("div",{className:d.body,role:"tabpanel",children:[e==="general"?o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:l("imagePropertiesSize")}),o.jsx("div",{className:d.iconRow,role:"radiogroup","aria-label":l("imagePropertiesSizeMode"),children:wb.map(g=>o.jsx("button",{type:"button",className:d.action,role:"radio","aria-checked":t.sizeMode===g,disabled:r,onClick:()=>C(g),children:l(Sb[g])},g))}),o.jsx(Ca,{label:l("imagePropertiesWidth"),inputAria:l("imagePropertiesWidthAria"),value:t.width,disabled:r||t.sizeMode==="height",onChange:g=>y("width",g)}),o.jsx(Ca,{label:l("imagePropertiesHeight"),inputAria:l("imagePropertiesHeightAria"),value:t.height,disabled:r||t.sizeMode==="width",onChange:g=>y("height",g)})]}):null,e==="alignment"?o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:l("paragraphDialogAlignment")}),o.jsx("div",{className:d.iconRow,role:"radiogroup","aria-label":l("paragraphDialogAlignment"),children:yb.map(g=>{const k=bb[g];return o.jsx("button",{type:"button",className:d.iconButton,role:"radio","aria-checked":t.align===g,"aria-label":l(xb[g]),disabled:r,onClick:()=>{a({...t,align:t.align===g?null:g})},children:o.jsx(k,{})},g)})})]}):null,e==="border"?o.jsxs(o.Fragment,{children:[o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:l("paragraphDialogMargin")}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:w,disabled:r||S,onChange:()=>{const g=!w;x(g),g&&a({...t,margin:co(Eb(t.margin))})}}),l("paragraphDialogLinkSides")]}),o.jsx("div",{className:d.sideGrid,children:(w?["top"]:Oe).map(g=>o.jsx(me,{label:l(w?"paragraphDialogMargin":kb[g]),value:t.margin[g],disabled:r||S&&(g==="left"||g==="right"),allowNegative:!0,onChange:k=>{const P=w?co(k):{...t.margin,[g]:k};a({...t,margin:P})}},g))})]}),o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:l("paragraphDialogBorder")}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:c,children:l("paragraphDialogBorderStyle")}),o.jsx("select",{id:c,className:d.select,value:t.border.style,disabled:r,onChange:g=>{const k=g.target.value;a({...t,border:{style:k,width:k==="none"?null:t.border.width??Ab,color:k==="none"?null:t.border.color}})},children:ir.map(g=>o.jsx("option",{value:g,children:l(Cb[g])},g))})]}),t.border.style!=="none"?o.jsxs(o.Fragment,{children:[o.jsx(me,{label:l("paragraphDialogBorderWidth"),value:t.border.width,disabled:r,onChange:g=>{a({...t,border:{...t.border,width:g}})}}),o.jsx(je,{label:l("paragraphDialogBorderColor"),noneLabel:l("colorNone"),value:t.border.color,disabled:r,onChange:g=>{a({...t,border:{...t.border,color:g}})}})]}):null,o.jsx(me,{label:l("paragraphDialogBorderRadius"),value:t.borderRadius,disabled:r,onChange:g=>{a({...t,borderRadius:g})}}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:t.boxShadow!==null,disabled:r,onChange:()=>{a({...t,boxShadow:t.boxShadow?null:Pb})}}),l("paragraphDialogBoxShadow")]}),t.boxShadow?o.jsx(ai,{shadow:t.boxShadow,disabled:r,onChange:g=>{a({...t,boxShadow:g})}}):null]})]}):null,e==="advanced"?o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:l("imagePropertiesTabAdvanced")}),o.jsx(Nb,{value:t.opacity,disabled:r,onChange:g=>{a({...t,opacity:g})}}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:m,children:l("imagePropertiesFit")}),o.jsxs("select",{id:m,className:d.select,value:t.objectFit??"",disabled:r,onChange:g=>{const k=g.target.value;a(af({...t,objectFit:k||null},n))},children:[o.jsx("option",{value:"",children:l("imagePropertiesFitDefault")}),Yl.map(g=>o.jsx("option",{value:g,children:l(vb[g])},g))]})]}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:p,children:l("imagePropertiesPosition")}),o.jsxs("select",{id:p,className:d.select,value:t.objectPosition??"",disabled:r,onChange:g=>{const k=g.target.value||null;a({...t,objectPosition:k})},children:[o.jsx("option",{value:"",children:l("imagePropertiesPositionDefault")}),Jl.map(g=>o.jsx("option",{value:g,children:l(Db[g])},g))]})]}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:b,children:l("imagePropertiesRotation")}),o.jsxs("div",{className:d.lengthRow,children:[o.jsx("input",{id:b,className:d.lengthInput,value:t.rotateDeg===null?"":Y(t.rotateDeg),disabled:r,inputMode:"decimal",onChange:g=>{const k=g.target.value.trim();if(!k){a({...t,rotateDeg:null});return}const P=Number(k.replace(",","."));Number.isFinite(P)&&a({...t,rotateDeg:P})}}),o.jsx("span",{className:d.lengthUnit,"aria-hidden":"true",children:l("imagePropertiesRotationUnit")})]})]})]}):null,e==="hover"?o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:l("imagePropertiesTabHover")}),o.jsx("p",{className:d.emptyHint,children:l("imagePropertiesHoverHelp")}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:h,children:l("imagePropertiesHoverCss")}),o.jsx("textarea",{id:h,className:d.textarea,value:t.hoverCss,disabled:r,spellCheck:!1,"aria-label":l("imagePropertiesHoverCssAria"),onChange:g=>{a({...t,hoverCss:g.target.value})}})]})]}):null]})]})}function Nb({value:e,disabled:t,onChange:n}){const r=V(),i=s.useId(),a=e===null?null:Xn(e),[l,c]=s.useState(()=>a===null?"":Y(a)),[m,p]=s.useState(!1);s.useEffect(()=>{m||c(a===null?"":Y(a))},[a,m]);const b=h=>{const w=h.trim();if(!w){n(null),c("");return}const x=Number(w.replace(",","."));if(!Number.isFinite(x)){c(a===null?"":Y(a));return}const S=jl(x);n(S),c(Y(Xn(S)))};return o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:i,children:r("paragraphDialogOpacity")}),o.jsxs("div",{className:d.lengthRow,children:[o.jsx("input",{id:i,className:d.lengthInput,value:l,disabled:t,inputMode:"decimal",onFocus:()=>p(!0),onChange:h=>c(h.target.value),onBlur:()=>{p(!1),b(l)}}),o.jsx("span",{className:d.lengthUnit,"aria-hidden":"true",children:r("fontSizeUnitPercent")})]})]})}const va='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function Lb({open:e,tab:t,value:n,aspectRatio:r=1,disabled:i,onTabChange:a,onApply:l,onClose:c}){const m=V(),p=s.useId(),b=s.useRef(null),[h,w]=s.useState(n);return s.useEffect(()=>{e&&w(n)},[e,n]),s.useEffect(()=>{if(!e)return;const x=b.current,S=x==null?void 0:x.querySelector(va);S==null||S.focus();const y=C=>{if(C.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;C.preventDefault(),C.stopPropagation(),c();return}if(C.key!=="Tab"||!x)return;const g=[...x.querySelectorAll(va)];if(g.length===0)return;const k=g[0],P=g[g.length-1];C.shiftKey&&document.activeElement===k?(C.preventDefault(),P.focus()):!C.shiftKey&&document.activeElement===P&&(C.preventDefault(),k.focus())};return document.addEventListener("keydown",y,!0),()=>document.removeEventListener("keydown",y,!0)},[e,c]),e?le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:c,children:o.jsxs("div",{ref:b,className:`${d.dialog} ${d.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":p,onMouseDown:x=>x.stopPropagation(),children:[o.jsxs("div",{className:d.headerRow,children:[o.jsx("h2",{className:d.header,id:p,children:m("imagePropertiesDialogTitle")}),o.jsx("button",{type:"button",className:d.close,"aria-label":m("imagePropertiesDialogCloseAria"),onClick:c,children:o.jsx(He,{})})]}),o.jsx(jb,{tab:t,value:h,aspectRatio:r,disabled:i,onTabChange:a,onChange:w}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:c,children:m("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:i,onClick:()=>l(h),children:m("fontDialogOk")})]})]})}),document.body):null}const Tb="_frame_bwkh8_1",Mb="_handle_bwkh8_9",Rb="_handleEast_bwkh8_29",_b="_handleSouth_bwkh8_37",Fb="_handleSouthEast_bwkh8_45",tn={frame:Tb,handle:Mb,handleEast:Rb,handleSouth:_b,handleSouthEast:Fb};function Yt(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height}}const Ib=[{handle:"e",className:tn.handleEast,cursor:"e-resize",ariaKey:"imageResizeHandleEastAria"},{handle:"s",className:tn.handleSouth,cursor:"s-resize",ariaKey:"imageResizeHandleSouthAria"},{handle:"se",className:tn.handleSouthEast,cursor:"se-resize",ariaKey:"imageResizeHandleSouthEastAria"}];function uo(e){return!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY)?null:{x:e.clientX,y:e.clientY}}function Bb({img:e,onResize:t,onResizeEnd:n}){const r=V(),i=s.useRef(null),a=s.useRef(e),l=s.useRef(t),c=s.useRef(n),m=s.useRef(null);a.current=e,l.current=t,c.current=n;const p=g=>{const k=i.current;k&&(k.style.left=`${g.left}px`,k.style.top=`${g.top}px`,k.style.width=`${g.width}px`,k.style.height=`${g.height}px`)};s.useLayoutEffect(()=>{p(Yt(e));const g=()=>{e.isConnected&&p(Yt(e))};return window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),()=>{window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}},[e]);const b=(g,k)=>{const P=m.current,L=a.current;if(!P||!L)return;const N=vf(P.handle,P.start,{x:g-P.originX,y:k-P.originY});l.current(N.width,N.height),L.isConnected&&p(Yt(L))},h=()=>{if(!m.current)return;m.current=null;const g=a.current;c.current(),g!=null&&g.isConnected&&p(Yt(g))};s.useLayoutEffect(()=>{const g=P=>{if(!m.current)return;const L=uo(P);L&&b(L.x,L.y)},k=()=>{h()};return document.addEventListener("pointermove",g),document.addEventListener("pointerup",k),document.addEventListener("pointercancel",k),document.addEventListener("mousemove",g),document.addEventListener("mouseup",k),()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",k),document.removeEventListener("pointercancel",k),document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",k)}},[]);const w=(g,k)=>{const P=uo(k);P&&(m.current={handle:g,start:Df(a.current),originX:P.x,originY:P.y})},x=g=>k=>{k.preventDefault(),k.stopPropagation(),w(g,k);try{k.currentTarget.setPointerCapture(k.pointerId)}catch{}},S=g=>k=>{k.preventDefault(),k.stopPropagation(),w(g,k)},y=g=>{const k=uo(g);k&&b(k.x,k.y)};if(!e.isConnected)return null;const C=Yt(e);return le.createPortal(o.jsx("div",{ref:i,className:tn.frame,"data-image-resize-overlay":"",style:{left:C.left,top:C.top,width:C.width,height:C.height},children:Ib.map(g=>o.jsx("button",{type:"button",className:`${tn.handle} ${g.className}`,style:{cursor:g.cursor},"aria-label":r(g.ariaKey),"data-resize-handle":g.handle,onPointerDown:x(g.handle),onPointerMove:y,onPointerUp:h,onPointerCancel:h,onMouseDown:S(g.handle),onMouseMove:y,onMouseUp:h},g.handle))}),document.body)}const Da='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function Hb({open:e,tab:t,href:n,title:r,targetBlank:i,textDecorationNone:a,hoverMode:l,hoverColor:c,hoverHtml:m,bookmarks:p,selectedBookmarkId:b,disabled:h,onTabChange:w,onApply:x,onClose:S}){const y=V(),C=s.useId(),g=s.useId(),k=s.useId(),P=s.useId(),L=s.useId(),N=s.useRef(null),[M,T]=s.useState(n),[F,D]=s.useState(r),[E,_]=s.useState(i),[z,W]=s.useState(a),[X,J]=s.useState(l),[fe,ce]=s.useState(c),[te,R]=s.useState(m),[Z,Q]=s.useState(b);if(s.useEffect(()=>{e&&(T(n),D(r),_(i),W(a),J(l),ce(c),R(m),Q(b))},[e,n,r,i,a,l,c,m,b]),s.useEffect(()=>{if(!e)return;const O=N.current,ee=O==null?void 0:O.querySelector(Da);ee==null||ee.focus();const ye=re=>{if(re.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;re.preventDefault(),re.stopPropagation(),S();return}if(re.key!=="Tab"||!O)return;const de=[...O.querySelectorAll(Da)];if(de.length===0)return;const we=de[0],Se=de[de.length-1];re.shiftKey&&document.activeElement===we?(re.preventDefault(),Se.focus()):!re.shiftKey&&document.activeElement===Se&&(re.preventDefault(),we.focus())};return document.addEventListener("keydown",ye,!0),()=>document.removeEventListener("keydown",ye,!0)},[e,S,t,X]),!e)return null;const A=()=>ar({title:F,targetBlank:E,textDecorationNone:z,hoverMode:X,hoverColor:fe,hoverHtml:te}),K=()=>{const O=M.trim();!O||h||x({...A(),href:O})},j=()=>{!Z||h||x({...A(),href:`#${Z}`})};return le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:S,children:o.jsxs("div",{ref:N,className:d.dialog,role:"dialog","aria-modal":"true","aria-labelledby":C,onMouseDown:O=>O.stopPropagation(),children:[o.jsx("h2",{className:d.header,id:C,children:y("linkDialogTitle")}),o.jsxs("div",{className:d.tabs,role:"tablist","aria-label":y("linkDialogTitle"),children:[o.jsx("button",{type:"button",className:d.tab,role:"tab","aria-selected":t==="link",onClick:()=>w("link"),children:y("linkDialogTabLink")}),o.jsx("button",{type:"button",className:d.tab,role:"tab","aria-selected":t==="bookmark",onClick:()=>w("bookmark"),children:y("linkDialogTabBookmark")})]}),o.jsxs("div",{className:d.body,role:"tabpanel",children:[t==="link"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:g,children:y("linkDialogHref")}),o.jsx("input",{id:g,className:d.textInput,value:M,disabled:h,onChange:O=>T(O.target.value)})]}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:k,children:y("linkDialogHoverTitle")}),o.jsx("input",{id:k,className:d.textInput,value:F,disabled:h,onChange:O=>D(O.target.value)})]}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:E,disabled:h,onChange:O=>_(O.target.checked)}),y("linkDialogTargetBlank")]})]}):p.length===0?o.jsx("p",{className:d.emptyHint,children:y("linkDialogBookmarkEmpty")}):o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:P,children:y("linkDialogBookmark")}),o.jsxs("select",{id:P,className:`${d.select} ${d.fullSelect}`,value:Z,disabled:h,onChange:O=>Q(O.target.value),children:[o.jsx("option",{value:""}),p.map(O=>o.jsx("option",{value:O.id,children:O.id},O.id))]})]}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:z,disabled:h,onChange:O=>W(O.target.checked)}),y("linkDialogTextDecorationNone")]}),o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.subLabel,children:y("linkDialogHover")}),o.jsxs("div",{className:d.sizeRow,role:"group","aria-label":y("linkDialogHover"),children:[o.jsx("button",{type:"button",className:d.action,"aria-pressed":X==="color",disabled:h,onClick:()=>J("color"),children:y("linkDialogHoverColor")}),o.jsx("button",{type:"button",className:d.action,"aria-pressed":X==="html",disabled:h,onClick:()=>J("html"),children:y("linkDialogHoverHtml")})]}),X==="color"?o.jsx(je,{label:y("linkDialogHoverColorField"),noneLabel:y("colorNone"),value:fe,disabled:h,onChange:ce}):o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:L,children:y("linkDialogHoverHtmlAria")}),o.jsx("textarea",{id:L,className:d.textarea,value:te,disabled:h,spellCheck:!1,onChange:O=>R(O.target.value)})]})]})]}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,disabled:h||!Z,onClick:j,children:y("linkDialogSelect")}),o.jsx("button",{type:"button",className:d.action,onClick:S,children:y("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:h||!M.trim(),onClick:K,children:y("fontDialogOk")})]})]})}),document.body)}const Ob="_grid_5kups_1",zb="_cell_5kups_8",Kb="_sizeLabel_5kups_27",$b="_sizeFields_5kups_33",Ub="_numberInput_5kups_37",bt={grid:Ob,cell:zb,sizeLabel:Kb,sizeFields:$b,numberInput:Ub},Aa='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([hidden]), select:not([disabled])',Ze={rows:3,cols:3};function Wb({open:e,disabled:t,onApply:n,onClose:r}){const i=V(),a=s.useId(),l=s.useId(),c=s.useId(),m=s.useRef(null),[p,b]=s.useState(Ze.rows),[h,w]=s.useState(Ze.cols),[x,S]=s.useState(String(Ze.rows)),[y,C]=s.useState(String(Ze.cols)),[g,k]=s.useState(!1);if(s.useEffect(()=>{e&&(b(Ze.rows),w(Ze.cols),S(String(Ze.rows)),C(String(Ze.cols)),k(!1))},[e]),s.useEffect(()=>{if(!e)return;const D=m.current,E=D==null?void 0:D.querySelector(Aa);E==null||E.focus();const _=z=>{if(z.key==="Escape"){z.preventDefault(),z.stopPropagation(),r();return}if(z.key!=="Tab"||!D)return;const W=[...D.querySelectorAll(Aa)];if(W.length===0)return;const X=W[0],J=W[W.length-1];z.shiftKey&&document.activeElement===X?(z.preventDefault(),J.focus()):!z.shiftKey&&document.activeElement===J&&(z.preventDefault(),X.focus())};return document.addEventListener("keydown",_,!0),()=>document.removeEventListener("keydown",_,!0)},[e,r]),!e)return null;const L=rs(p,h)&&!t,N=(D,E)=>{const _=Math.min(St,Math.max(wt,D)),z=Math.min(St,Math.max(wt,E));b(_),w(z),S(String(_)),C(String(z))},M=(D,E)=>{const _=Number.parseInt(D,10);if(!Number.isFinite(_)){E==="rows"?S(String(p)):C(String(h));return}k(!0),E==="rows"?N(_,h):N(p,_)},T=(D,E)=>{const _=D.replace(/\D/g,"");if(E==="rows"?S(_):C(_),_==="")return;const z=Number.parseInt(_,10);Number.isFinite(z)&&(k(!0),E==="rows"?N(z,h):N(p,z))},F=D=>{(D.key==="e"||D.key==="E"||D.key==="+"||D.key==="-"||D.key===".")&&D.preventDefault()};return le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:r,children:o.jsxs("div",{ref:m,className:d.dialog,role:"dialog","aria-modal":"true","aria-labelledby":a,onMouseDown:D=>D.stopPropagation(),children:[o.jsxs("div",{className:d.headerRow,children:[o.jsx("h2",{className:d.header,id:a,children:i("tableDialogTitle")}),o.jsx("button",{type:"button",className:d.close,"aria-label":i("tableDialogCloseAria"),onClick:r,children:o.jsx(He,{})})]}),o.jsxs("div",{className:d.body,children:[o.jsx("div",{className:bt.grid,role:"grid","aria-label":i("tableDialogGridAria"),onMouseLeave:()=>{},children:Array.from({length:aa},(D,E)=>Array.from({length:aa},(_,z)=>{const W=E+1,X=z+1,J=W<=p&&X<=h;return o.jsx("button",{type:"button",className:bt.cell,role:"gridcell","data-active":J?"true":void 0,"aria-label":`${W} × ${X}`,"aria-pressed":J&&W===p&&X===h,disabled:t,onMouseEnter:()=>{g||N(W,X)},onClick:()=>{k(!0),N(W,X)}},`${W}-${X}`)}))}),o.jsxs("p",{className:bt.sizeLabel,children:[i("tableDialogSize"),": ",p," × ",h]}),o.jsxs("div",{className:`${d.sizeRow} ${bt.sizeFields}`,children:[o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:l,children:i("tableDialogRows")}),o.jsx("input",{id:l,className:bt.numberInput,type:"number",inputMode:"numeric",min:wt,max:St,step:1,value:x,disabled:t,onKeyDown:F,onChange:D=>T(D.target.value,"rows"),onBlur:()=>M(x,"rows")})]}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:c,children:i("tableDialogColumns")}),o.jsx("input",{id:c,className:bt.numberInput,type:"number",inputMode:"numeric",min:wt,max:St,step:1,value:y,disabled:t,onKeyDown:F,onChange:D=>T(D.target.value,"cols"),onBlur:()=>M(y,"cols")})]})]})]}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:r,children:i("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:!L,onClick:()=>{L&&n({rows:p,cols:h})},children:i("tableDialogInsert")})]})]})}),document.body)}const qb={none:"paragraphDialogBorderStyleNone",solid:"paragraphDialogBorderStyleSolid",dotted:"paragraphDialogBorderStyleDotted",dashed:"paragraphDialogBorderStyleDashed",double:"paragraphDialogBorderStyleDouble",groove:"paragraphDialogBorderStyleGroove",ridge:"paragraphDialogBorderStyleRidge",inset:"paragraphDialogBorderStyleInset",outset:"paragraphDialogBorderStyleOutset"},Gb={value:1,unit:"pt"},Vb={offsetX:{value:0,unit:"px"},offsetY:{value:4,unit:"px"},blur:{value:8,unit:"px"},spread:{value:0,unit:"px"},color:"#000000",inset:!1};function Xb({value:e,disabled:t,onChange:n}){const r=V(),i=s.useId(),a=s.useId();return o.jsxs("div",{className:d.body,children:[o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:r("tablePropertiesWidth")}),o.jsx(me,{label:r("tablePropertiesWidth"),value:e.width,disabled:t,onChange:l=>n({...e,width:l})}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:i,children:r("tablePropertiesCollapse")}),o.jsxs("select",{id:i,className:d.select,value:e.borderCollapse,disabled:t,onChange:l=>{const c=l.target.value==="separate"?"separate":"collapse";n({...e,borderCollapse:c,borderSpacing:c==="separate"?e.borderSpacing:null})},children:[o.jsx("option",{value:"collapse",children:r("tablePropertiesCollapseCollapse")}),o.jsx("option",{value:"separate",children:r("tablePropertiesCollapseSeparate")})]})]}),e.borderCollapse==="separate"?o.jsx(me,{label:r("tablePropertiesSpacing"),value:e.borderSpacing,disabled:t,onChange:l=>n({...e,borderSpacing:l})}):null]}),o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:r("paragraphDialogBorder")}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:a,children:r("paragraphDialogBorderStyle")}),o.jsx("select",{id:a,className:d.select,value:e.border.style,disabled:t,onChange:l=>{const c=l.target.value;n({...e,border:{style:c,width:c==="none"?null:e.border.width??Gb,color:c==="none"?null:e.border.color}})},children:ir.map(l=>o.jsx("option",{value:l,children:r(qb[l])},l))})]}),e.border.style!=="none"?o.jsxs(o.Fragment,{children:[o.jsx(me,{label:r("paragraphDialogBorderWidth"),value:e.border.width,disabled:t,onChange:l=>n({...e,border:{...e.border,width:l}})}),o.jsx(je,{label:r("paragraphDialogBorderColor"),noneLabel:r("colorNone"),value:e.border.color,disabled:t,onChange:l=>n({...e,border:{...e.border,color:l}})})]}):null,o.jsx(me,{label:r("paragraphDialogBorderRadius"),value:e.borderRadius,disabled:t,onChange:l=>n({...e,borderRadius:l})}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:e.boxShadow!==null,disabled:t,onChange:()=>{n({...e,boxShadow:e.boxShadow?null:Vb})}}),r("paragraphDialogBoxShadow")]}),e.boxShadow?o.jsx(ai,{shadow:e.boxShadow,disabled:t,onChange:l=>n({...e,boxShadow:l})}):null]})]})}const Pa='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function Yb({open:e,value:t,disabled:n,onApply:r,onClose:i}){const a=V(),l=s.useId(),c=s.useRef(null),[m,p]=s.useState(t);return s.useEffect(()=>{e&&p(t)},[e,t]),s.useEffect(()=>{if(!e)return;const b=c.current,h=b==null?void 0:b.querySelector(Pa);h==null||h.focus();const w=x=>{if(x.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;x.preventDefault(),x.stopPropagation(),i();return}if(x.key!=="Tab"||!b)return;const S=[...b.querySelectorAll(Pa)];if(S.length===0)return;const y=S[0],C=S[S.length-1];x.shiftKey&&document.activeElement===y?(x.preventDefault(),C.focus()):!x.shiftKey&&document.activeElement===C&&(x.preventDefault(),y.focus())};return document.addEventListener("keydown",w,!0),()=>document.removeEventListener("keydown",w,!0)},[e,i]),e?le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:i,children:o.jsxs("div",{ref:c,className:`${d.dialog} ${d.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":l,onMouseDown:b=>b.stopPropagation(),children:[o.jsxs("div",{className:d.headerRow,children:[o.jsx("h2",{className:d.header,id:l,children:a("tablePropertiesDialogTitle")}),o.jsx("button",{type:"button",className:d.close,"aria-label":a("tablePropertiesDialogCloseAria"),onClick:i,children:o.jsx(He,{})})]}),o.jsx(Xb,{value:m,disabled:n,onChange:p}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:i,children:a("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:n,onClick:()=>r(m),children:a("fontDialogOk")})]})]})}),document.body):null}const Jb={top:"paragraphDialogSideTop",right:"paragraphDialogSideRight",bottom:"paragraphDialogSideBottom",left:"paragraphDialogSideLeft"},Zb={top:"cellPropertiesVerticalAlignTop",middle:"cellPropertiesVerticalAlignMiddle",bottom:"cellPropertiesVerticalAlignBottom",baseline:"cellPropertiesVerticalAlignBaseline"};function In(e){return{top:e,right:e,bottom:e,left:e}}function mo(e){for(const t of Oe)if(e[t])return e[t];return null}function Qb({value:e,disabled:t,onChange:n}){const r=V(),i=s.useId(),[a,l]=s.useState(()=>qe(e.padding,In(mo(e.padding))));return s.useEffect(()=>{l(qe(e.padding,In(mo(e.padding))))},[e.padding]),o.jsxs("div",{className:d.body,children:[o.jsx(je,{label:r("paragraphDialogBackgroundColor"),noneLabel:r("colorNone"),value:e.backgroundColor,disabled:t,onChange:c=>n({...e,backgroundColor:c})}),o.jsx(je,{label:r("cellPropertiesColor"),noneLabel:r("colorNone"),value:e.color,disabled:t,onChange:c=>n({...e,color:c})}),o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:r("paragraphDialogPadding")}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:a,disabled:t,onChange:()=>{const c=!a;l(c),c&&n({...e,padding:In(mo(e.padding))})}}),r("paragraphDialogLinkSides")]}),o.jsx("div",{className:d.sideGrid,children:(a?["top"]:Oe).map(c=>o.jsx(me,{label:r(a?"paragraphDialogPadding":Jb[c]),value:e.padding[c],disabled:t,onChange:m=>{const p=a?In(m):{...e.padding,[c]:m};n({...e,padding:p})}},c))})]}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:i,children:r("cellPropertiesVerticalAlign")}),o.jsxs("select",{id:i,className:d.select,value:e.verticalAlign??"",disabled:t,onChange:c=>{const m=c.target.value;n({...e,verticalAlign:m||null})},children:[o.jsx("option",{value:"",children:r("cellPropertiesVerticalAlignDefault")}),lr.map(c=>o.jsx("option",{value:c,children:r(Zb[c])},c))]})]}),o.jsx(me,{label:r("cellPropertiesWidth"),value:e.width,disabled:t,onChange:c=>n({...e,width:c})})]})}const Ea='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function ey({open:e,value:t,disabled:n,onApply:r,onClose:i}){const a=V(),l=s.useId(),c=s.useRef(null),[m,p]=s.useState(t);return s.useEffect(()=>{e&&p(t)},[e,t]),s.useEffect(()=>{if(!e)return;const b=c.current,h=b==null?void 0:b.querySelector(Ea);h==null||h.focus();const w=x=>{if(x.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;x.preventDefault(),x.stopPropagation(),i();return}if(x.key!=="Tab"||!b)return;const S=[...b.querySelectorAll(Ea)];if(S.length===0)return;const y=S[0],C=S[S.length-1];x.shiftKey&&document.activeElement===y?(x.preventDefault(),C.focus()):!x.shiftKey&&document.activeElement===C&&(x.preventDefault(),y.focus())};return document.addEventListener("keydown",w,!0),()=>document.removeEventListener("keydown",w,!0)},[e,i]),e?le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:i,children:o.jsxs("div",{ref:c,className:`${d.dialog} ${d.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":l,onMouseDown:b=>b.stopPropagation(),children:[o.jsxs("div",{className:d.headerRow,children:[o.jsx("h2",{className:d.header,id:l,children:a("cellPropertiesDialogTitle")}),o.jsx("button",{type:"button",className:d.close,"aria-label":a("cellPropertiesDialogCloseAria"),onClick:i,children:o.jsx(He,{})})]}),o.jsx(Qb,{value:m,disabled:n,onChange:p}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:i,children:a("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:n,onClick:()=>r(m),children:a("fontDialogOk")})]})]})}),document.body):null}const ty={top:"paragraphDialogSideTop",right:"paragraphDialogSideRight",bottom:"paragraphDialogSideBottom",left:"paragraphDialogSideLeft"},ny={top:"cellPropertiesVerticalAlignTop",middle:"cellPropertiesVerticalAlignMiddle",bottom:"cellPropertiesVerticalAlignBottom",baseline:"cellPropertiesVerticalAlignBaseline"};function Bn(e){return{top:e,right:e,bottom:e,left:e}}function fo(e){for(const t of Oe)if(e[t])return e[t];return null}function ry({value:e,disabled:t,onChange:n}){const r=V(),i=s.useId(),[a,l]=s.useState(()=>qe(e.padding,Bn(fo(e.padding))));return s.useEffect(()=>{l(qe(e.padding,Bn(fo(e.padding))))},[e.padding]),o.jsxs("div",{className:d.body,children:[o.jsx(je,{label:r("paragraphDialogBackgroundColor"),noneLabel:r("colorNone"),value:e.backgroundColor,disabled:t,onChange:c=>n({...e,backgroundColor:c})}),o.jsx(je,{label:r("cellPropertiesColor"),noneLabel:r("colorNone"),value:e.color,disabled:t,onChange:c=>n({...e,color:c})}),o.jsxs("fieldset",{className:d.group,children:[o.jsx("legend",{className:d.label,children:r("paragraphDialogPadding")}),o.jsxs("label",{className:d.mark,children:[o.jsx("input",{type:"checkbox",checked:a,disabled:t,onChange:()=>{const c=!a;l(c),c&&n({...e,padding:Bn(fo(e.padding))})}}),r("paragraphDialogLinkSides")]}),o.jsx("div",{className:d.sideGrid,children:(a?["top"]:Oe).map(c=>o.jsx(me,{label:r(a?"paragraphDialogPadding":ty[c]),value:e.padding[c],disabled:t,onChange:m=>{const p=a?Bn(m):{...e.padding,[c]:m};n({...e,padding:p})}},c))})]}),o.jsxs("div",{className:d.field,children:[o.jsx("label",{className:d.label,htmlFor:i,children:r("cellPropertiesVerticalAlign")}),o.jsxs("select",{id:i,className:d.select,value:e.verticalAlign??"",disabled:t,onChange:c=>{const m=c.target.value;n({...e,verticalAlign:m||null})},children:[o.jsx("option",{value:"",children:r("cellPropertiesVerticalAlignDefault")}),lr.map(c=>o.jsx("option",{value:c,children:r(ny[c])},c))]})]}),o.jsx(me,{label:r("rowPropertiesHeight"),value:e.height,disabled:t,onChange:c=>n({...e,height:c})})]})}const ja='button:not([disabled]):not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])';function oy({open:e,value:t,disabled:n,onApply:r,onClose:i}){const a=V(),l=s.useId(),c=s.useRef(null),[m,p]=s.useState(t);return s.useEffect(()=>{e&&p(t)},[e,t]),s.useEffect(()=>{if(!e)return;const b=c.current,h=b==null?void 0:b.querySelector(ja);h==null||h.focus();const w=x=>{if(x.key==="Escape"){if(document.querySelector('[role="listbox"], [data-color-picker]'))return;x.preventDefault(),x.stopPropagation(),i();return}if(x.key!=="Tab"||!b)return;const S=[...b.querySelectorAll(ja)];if(S.length===0)return;const y=S[0],C=S[S.length-1];x.shiftKey&&document.activeElement===y?(x.preventDefault(),C.focus()):!x.shiftKey&&document.activeElement===C&&(x.preventDefault(),y.focus())};return document.addEventListener("keydown",w,!0),()=>document.removeEventListener("keydown",w,!0)},[e,i]),e?le.createPortal(o.jsx("div",{className:d.backdrop,role:"presentation",onMouseDown:i,children:o.jsxs("div",{ref:c,className:`${d.dialog} ${d.dialogWide}`,role:"dialog","aria-modal":"true","aria-labelledby":l,onMouseDown:b=>b.stopPropagation(),children:[o.jsxs("div",{className:d.headerRow,children:[o.jsx("h2",{className:d.header,id:l,children:a("rowPropertiesDialogTitle")}),o.jsx("button",{type:"button",className:d.close,"aria-label":a("rowPropertiesDialogCloseAria"),onClick:i,children:o.jsx(He,{})})]}),o.jsx(ry,{value:m,disabled:n,onChange:p}),o.jsxs("div",{className:d.actions,children:[o.jsx("button",{type:"button",className:d.action,onClick:i,children:a("fontDialogCancel")}),o.jsx("button",{type:"button",className:`${d.action} ${d.actionPrimary}`,disabled:n,onClick:()=>r(m),children:a("fontDialogOk")})]})]})}),document.body):null}const iy={menus:{edit:{id:"edit",labelKey:"menuEdit",ariaKey:"menuEditAria"}},groups:{edit:{id:"edit",labelKey:"toolbarGroupEdit"}},items:{undo:{id:"undo",command:"undo",icon:oc,labelKey:"commandUndo",ariaKey:"commandUndoAria",enabled:"canUndo"},redo:{id:"redo",command:"redo",icon:Qs,labelKey:"commandRedo",ariaKey:"commandRedoAria",enabled:"canRedo"}}},ay=400;function ly(e){let t=[],n=e,r=[],i=!1,a=!1,l=0;function c(h,w){if(i){n=h,i=!1;return}if(h===n)return;const x=Date.now(),S=(w==null?void 0:w.coalesce)===!0;if(S&&a&&x-l<ay){n=h,l=x;return}t.push(n),n=h,r=[],l=x,a=S}function m(){return t.length===0?null:(a=!1,r.push(n),n=t.pop(),n)}function p(){return r.length===0?null:(a=!1,t.push(n),n=r.pop(),n)}function b(h){if(i){n=h,i=!1;return}h!==n&&(t.push(n),n=h,r=[],a=!1)}return{record:c,undo:m,redo:p,canUndo:()=>t.length>0,canRedo:()=>r.length>0,syncExternal:b,markApplying:()=>{i=!0}}}const sy={menus:{file:{id:"file",labelKey:"menuFile",ariaKey:"menuFileAria"}},groups:{file:{id:"file",labelKey:"toolbarGroupFile"},print:{id:"print",labelKey:"toolbarGroupPrint"}},items:{save:{id:"save",command:"save",icon:tc,labelKey:"commandSave",ariaKey:"commandSaveAria"},open:{id:"open",command:"open",icon:Gs,labelKey:"commandOpen",ariaKey:"commandOpenAria"},print:{id:"print",command:"print",icon:Zs,labelKey:"commandPrint",ariaKey:"commandPrintAria"}}},Hn=4;function hs({icon:e,value:t,mixed:n,noneKey:r,labelKey:i,ariaKey:a,fallbackCustom:l,disabled:c,onChange:m}){const p=V(),b=s.useId(),h=s.useRef(null),w=s.useRef(null),x=s.useRef(null),[S,y]=s.useState(!1),[C,g]=s.useState({top:0,left:0}),k=s.useCallback(()=>{const T=w.current,F=x.current;if(!T)return;const D=T.getBoundingClientRect(),E=(F==null?void 0:F.offsetHeight)??0,_=(F==null?void 0:F.offsetWidth)??200;let z=D.bottom;z+E>window.innerHeight-Hn&&(z=Math.max(Hn,D.top-E));const W=Math.min(Math.max(D.left,Hn),window.innerWidth-_-Hn);g({top:z,left:W})},[]);s.useLayoutEffect(()=>{if(!S)return;k();const T=()=>k();return window.addEventListener("scroll",T,!0),window.addEventListener("resize",T),()=>{window.removeEventListener("scroll",T,!0),window.removeEventListener("resize",T)}},[S,k]),s.useEffect(()=>{if(!S)return;const T=D=>{var _,z;const E=D.target;(_=h.current)!=null&&_.contains(E)||(z=x.current)!=null&&z.contains(E)||y(!1)},F=D=>{var E;D.key==="Escape"&&(D.preventDefault(),D.stopPropagation(),y(!1),(E=w.current)==null||E.focus())};return document.addEventListener("pointerdown",T),document.addEventListener("keydown",F,!0),()=>{document.removeEventListener("pointerdown",T),document.removeEventListener("keydown",F,!0)}},[S]);const P=T=>{m(T)},L=`${ct.bar}${!t||n?` ${ct.barEmpty}`:""}`,N=t&&!n?{backgroundColor:t}:void 0,M=o.jsxs("div",{className:ct.wrap,ref:h,children:[o.jsxs("button",{ref:w,type:"button",className:`${U.iconButton} ${ct.button}`,"aria-label":p(a),"aria-expanded":S,"aria-haspopup":"listbox","aria-controls":S?b:void 0,disabled:c,onClick:()=>y(T=>!T),children:[o.jsx(e,{className:`${U.icon} ${ct.icon}`}),o.jsx("span",{className:L,style:N})]}),S?le.createPortal(o.jsx("div",{ref:x,id:b,className:ct.popover,style:{top:C.top,left:C.left},children:o.jsx(oi,{value:t,mixed:n,noneLabel:p(r),ariaLabel:p(a),disabled:c,fallbackCustom:l,onChange:P,onCommit:()=>y(!1)})}),document.body):null]});return o.jsx(Ie,{label:p(i),children:M})}function cy({commands:e,queries:t,disabled:n}){return o.jsx(hs,{icon:Bs,value:t.getFontColor(),mixed:t.isFontColorMixed(),noneKey:"colorAutomatic",labelKey:"commandFontColor",ariaKey:"commandFontColorAria",disabled:!!(n||!t.isVisualMode()),onChange:r=>e.setFontColor(r)})}function uy({commands:e,queries:t,disabled:n}){const r=V(),i=!!(n||!t.isVisualMode());return o.jsx(ps,{size:t.getFontSize(),unit:t.getFontSizeUnit(),disabled:i,tooltip:r("commandFontSize"),toolbar:!0,onSizeChange:(a,l)=>{e.setFontSize(a,l)},onUnitChange:a=>{e.setFontSizeUnit(a)}})}function dy({commands:e,queries:t,disabled:n}){return o.jsx(hs,{icon:zs,value:t.getHighlightColor(),mixed:t.isHighlightColorMixed(),noneKey:"colorNone",labelKey:"commandHighlightColor",ariaKey:"commandHighlightColorAria",fallbackCustom:"#ffff00",disabled:!!(n||!t.isVisualMode()),onChange:r=>e.setHighlightColor(r)})}function my({commands:e,queries:t,disabled:n,onMenuClose:r}){const i=V(),a=!!(n||!t.isVisualMode());return o.jsx(oi,{value:t.getHighlightColor(),mixed:t.isHighlightColorMixed(),noneLabel:i("colorNone"),ariaLabel:i("commandHighlightColorAria"),disabled:a,menu:!0,fallbackCustom:"#ffff00",onChange:l=>e.setHighlightColor(l),onCommit:()=>r==null?void 0:r()})}const fy="_wrap_1wd6e_1",py="_wrapToolbar_1wd6e_7",hy="_field_1wd6e_12",gy="_trigger_1wd6e_20",by="_chevron_1wd6e_46",yy="_list_1wd6e_69",xy="_option_1wd6e_84",wy="_separator_1wd6e_113",Ke={wrap:fy,wrapToolbar:py,field:hy,trigger:gy,chevron:by,list:yy,option:xy,separator:wy},Eo={p:"styleParagraph",h1:"styleHeading1",h2:"styleHeading2",h3:"styleHeading3",h4:"styleHeading4",h5:"styleHeading5",h6:"styleHeading6"},Sy={p:{fontSize:"1rem",fontWeight:"400"},h1:{fontSize:"1.75rem",fontWeight:"600"},h2:{fontSize:"1.5rem",fontWeight:"600"},h3:{fontSize:"1.25rem",fontWeight:"600"},h4:{fontSize:"1.125rem",fontWeight:"600"},h5:{fontSize:"1rem",fontWeight:"600"},h6:{fontSize:"0.875rem",fontWeight:"600"}};function Na(){const e=V();return o.jsx("div",{className:d.spinnerWrap,role:"status","aria-live":"polite","aria-label":e("customStyleLoading"),children:o.jsx("span",{className:d.spinner,"aria-hidden":"true"})})}function gs({value:e,mixed:t=!1,disabled:n,menu:r=!1,listId:i,listRef:a,style:l,customStylesEnabled:c=!1,customStyles:m=[],customStylesLoading:p=!1,onSelect:b,onSelectCustom:h,onAddNew:w}){const x=V(),S=t?null:e,y=c,C=!!(r&&c&&w);return r?o.jsxs(o.Fragment,{children:[Gn.map(g=>o.jsx("button",{type:"button",className:U.menuItem,role:"menuitemradio","aria-checked":S===g,disabled:n,onMouseDown:k=>k.preventDefault(),onClick:()=>b(g),children:x(Eo[g])},g)),y?o.jsx("div",{role:"separator",className:U.menuSeparator}):null,y&&p?o.jsx(Na,{}):null,y&&!p?m.map(g=>o.jsx("button",{type:"button",className:U.menuItem,role:"menuitem",disabled:n,onMouseDown:k=>k.preventDefault(),onClick:()=>h==null?void 0:h(g.id),children:g.name},g.id)):null,C?o.jsxs(o.Fragment,{children:[y&&(p||m.length>0)?o.jsx("div",{role:"separator",className:U.menuSeparator}):null,o.jsxs("button",{type:"button",className:U.menuItem,role:"menuitem","aria-label":x("styleAddNewAria"),disabled:n,onMouseDown:g=>g.preventDefault(),onClick:()=>w==null?void 0:w(),children:[o.jsx(Js,{className:U.icon}),x("styleAddNew")]})]}):null]}):o.jsxs("ul",{ref:a,className:Ke.list,role:"listbox",id:i,style:l,"aria-label":x("commandParagraphStyleAria"),"aria-busy":y&&p?!0:void 0,children:[Gn.map(g=>o.jsx("li",{role:"presentation",children:o.jsx("button",{type:"button",className:Ke.option,role:"option","aria-selected":S===g,disabled:n,style:Sy[g],onMouseDown:k=>k.preventDefault(),onClick:()=>b(g),children:x(Eo[g])})},g)),y&&(p||m.length>0)?o.jsx("li",{role:"separator",className:Ke.separator}):null,y&&p?o.jsx("li",{role:"presentation",children:o.jsx(Na,{})}):null,y&&!p?m.map(g=>o.jsx("li",{role:"presentation",children:o.jsx("button",{type:"button",className:Ke.option,role:"option","aria-selected":!1,disabled:n,onMouseDown:k=>k.preventDefault(),onClick:()=>h==null?void 0:h(g.id),children:g.name})},g.id)):null]})}const On=4;function ky({commands:e,queries:t,disabled:n}){const r=V(),i=s.useId(),a=s.useRef(null),l=s.useRef(null),c=s.useRef(null),[m,p]=s.useState(!1),[b,h]=s.useState({top:0,left:0,width:0}),w=!!(n||!t.isVisualMode()),x=t.isParagraphStyleMixed(),S=x?null:t.getParagraphStyle(),y=S?r(Eo[S]):"",C=t.customParagraphStylesEnabled(),g=C?t.getCustomParagraphStyles():[],k=C&&t.isCustomParagraphStylesLoading(),P=s.useCallback(()=>{const N=l.current,M=c.current;if(!N)return;const T=N.getBoundingClientRect(),F=(M==null?void 0:M.offsetHeight)??0,D=Math.max(T.width,(M==null?void 0:M.offsetWidth)??0);let E=T.bottom;E+F>window.innerHeight-On&&(E=Math.max(On,T.top-F));const _=Math.min(Math.max(T.left,On),window.innerWidth-D-On);h({top:E,left:_,width:D})},[]);s.useLayoutEffect(()=>{if(!m)return;P();const N=()=>P();return window.addEventListener("scroll",N,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",N)}},[m,P,g.length,k]),s.useEffect(()=>{if(!m)return;const N=T=>{var D,E;const F=T.target;(D=a.current)!=null&&D.contains(F)||(E=c.current)!=null&&E.contains(F)||p(!1)},M=T=>{T.key==="Escape"&&(T.preventDefault(),T.stopPropagation(),p(!1))};return document.addEventListener("pointerdown",N),document.addEventListener("keydown",M,!0),()=>{document.removeEventListener("pointerdown",N),document.removeEventListener("keydown",M,!0)}},[m]);const L=o.jsxs("div",{className:`${Ke.wrap} ${Ke.wrapToolbar}`,ref:a,children:[o.jsxs("div",{className:Ke.field,ref:l,children:[o.jsx("button",{type:"button",className:Ke.trigger,disabled:w,"aria-label":r("commandParagraphStyleAria"),"aria-haspopup":"listbox","aria-expanded":m,"aria-controls":m?i:void 0,onMouseDown:N=>N.preventDefault(),onClick:()=>p(N=>!N),children:y}),o.jsx("span",{className:Ke.chevron,"aria-hidden":"true"})]}),m?le.createPortal(o.jsx(gs,{listRef:c,listId:i,value:S,mixed:x,disabled:w,customStylesEnabled:C,customStyles:g,customStylesLoading:k,style:{top:b.top,left:b.left,minWidth:b.width},onSelect:N=>{e.setParagraphStyle(N),p(!1)},onSelectCustom:N=>{e.applyCustomParagraphStyle(N),p(!1)}}),document.body):null]});return o.jsx(Ie,{label:r("commandParagraphStyle"),children:L})}function Cy({commands:e,queries:t,disabled:n,onMenuClose:r}){const i=!!(n||!t.isVisualMode()),a=t.isParagraphStyleMixed(),l=a?null:t.getParagraphStyle(),c=t.customParagraphStylesEnabled(),m=c?t.getCustomParagraphStyles():[],p=c&&t.isCustomParagraphStylesLoading();return o.jsx(gs,{menu:!0,value:l,mixed:a,disabled:i,customStylesEnabled:c,customStyles:m,customStylesLoading:p,onSelect:b=>{e.setParagraphStyle(b),r==null||r()},onSelectCustom:b=>{e.openCustomParagraphStyleDialog(b),r==null||r()},onAddNew:()=>{e.openCustomParagraphStyleDialog(),r==null||r()}})}const vy={menus:{format:{id:"format",labelKey:"menuFormat",ariaKey:"menuFormatAria"}},submenus:{paragraphStyles:{id:"paragraphStyles",labelKey:"menuParagraphStyles",ariaKey:"menuParagraphStylesAria",panel:Cy,enabled:"isVisualMode"},font:{id:"font",labelKey:"menuFont",ariaKey:"menuFontAria"},highlightColor:{id:"highlightColor",labelKey:"commandHighlightColor",ariaKey:"commandHighlightColorAria",panel:my,enabled:"isVisualMode"},paragraph:{id:"paragraph",labelKey:"menuParagraph",ariaKey:"menuParagraphAria"},page:{id:"page",labelKey:"menuPage",ariaKey:"menuPageAria"}},groups:{font:{id:"font",labelKey:"toolbarGroupFont"},align:{id:"align",labelKey:"toolbarGroupAlign"},paragraph:{id:"paragraph",labelKey:"toolbarGroupParagraph"}},items:{fontFamily:{id:"fontFamily",widget:Ih,labelKey:"commandFontFamily",ariaKey:"commandFontFamilyAria",enabled:"isVisualMode"},paragraphStyle:{id:"paragraphStyle",widget:ky,labelKey:"commandParagraphStyle",ariaKey:"commandParagraphStyleAria",enabled:"isVisualMode"},fontSize:{id:"fontSize",widget:uy,labelKey:"commandFontSize",ariaKey:"commandFontSizeAria",enabled:"isVisualMode"},fontProperties:{id:"fontProperties",command:"openFontProperties",icon:Hs,labelKey:"commandFontProperties",ariaKey:"commandFontPropertiesAria",enabled:"isVisualMode"},paragraphProperties:{id:"paragraphProperties",command:"openParagraphProperties",icon:Ys,labelKey:"commandParagraphProperties",ariaKey:"commandParagraphPropertiesAria",enabled:"isVisualMode"},pageProperties:{id:"pageProperties",command:"openPageProperties",icon:Xs,labelKey:"commandPageProperties",ariaKey:"commandPagePropertiesAria",enabled:"isVisualMode"},imageProperties:{id:"imageProperties",command:"openImageProperties",icon:Ra,labelKey:"menuImage",ariaKey:"menuImageAria",enabled:"isImageSelected"},fontColor:{id:"fontColor",widget:cy,labelKey:"commandFontColor",ariaKey:"commandFontColorAria",enabled:"isVisualMode"},highlightColor:{id:"highlightColor",widget:dy,labelKey:"commandHighlightColor",ariaKey:"commandHighlightColorAria",enabled:"isVisualMode"},bold:{id:"bold",command:"toggleBold",icon:Ts,labelKey:"commandBold",ariaKey:"commandBoldAria",active:"isBold",enabled:"isVisualMode",toggle:!0},italic:{id:"italic",command:"toggleItalic",icon:Us,labelKey:"commandItalic",ariaKey:"commandItalicAria",active:"isItalic",enabled:"isVisualMode",toggle:!0},underline:{id:"underline",command:"toggleUnderline",icon:rc,labelKey:"commandUnderline",ariaKey:"commandUnderlineAria",active:"isUnderline",enabled:"isVisualMode",toggle:!0},strikethrough:{id:"strikethrough",command:"toggleStrikethrough",icon:nc,labelKey:"commandStrikethrough",ariaKey:"commandStrikethroughAria",active:"isStrikethrough",enabled:"isVisualMode",toggle:!0},clearFormatting:{id:"clearFormatting",command:"clearFormatting",icon:_s,labelKey:"commandClearFormatting",ariaKey:"commandClearFormattingAria",enabled:"hasTextSelection"},alignLeft:{id:"alignLeft",command:"alignLeft",icon:No,labelKey:"commandAlignLeft",ariaKey:"commandAlignLeftAria",active:"isAlignLeft",enabled:"isVisualMode"},alignCenter:{id:"alignCenter",command:"alignCenter",icon:jo,labelKey:"commandAlignCenter",ariaKey:"commandAlignCenterAria",active:"isAlignCenter",enabled:"isVisualMode"},alignRight:{id:"alignRight",command:"alignRight",icon:Lo,labelKey:"commandAlignRight",ariaKey:"commandAlignRightAria",active:"isAlignRight",enabled:"isVisualMode"},alignJustify:{id:"alignJustify",command:"alignJustify",icon:Ta,labelKey:"commandAlignJustify",ariaKey:"commandAlignJustifyAria",active:"isAlignJustify",enabled:"isVisualMode"},indent:{id:"indent",command:"indent",icon:$s,labelKey:"commandIndent",ariaKey:"commandIndentAria",enabled:"isVisualMode"},outdent:{id:"outdent",command:"outdent",icon:Vs,labelKey:"commandOutdent",ariaKey:"commandOutdentAria",enabled:"canOutdent"},bulletList:{id:"bulletList",command:"toggleBulletList",icon:Ma,labelKey:"commandBulletList",ariaKey:"commandBulletListAria",active:"isBulletList",enabled:"isVisualMode",toggle:!0},numberedList:{id:"numberedList",command:"toggleNumberedList",icon:_a,labelKey:"commandNumberedList",ariaKey:"commandNumberedListAria",active:"isNumberedList",enabled:"isVisualMode",toggle:!0}}},Dy={menus:{insert:{id:"insert",labelKey:"menuInsert",ariaKey:"menuInsertAria"}},groups:{insert:{id:"insert",labelKey:"toolbarGroupInsert"}},items:{link:{id:"link",command:"openLinkDialog",icon:Ws,labelKey:"commandLink",ariaKey:"commandLinkAria",enabled:"isVisualMode",active:"isLink",toggle:!0},bookmark:{id:"bookmark",command:"openBookmarkDialog",icon:Ms,labelKey:"commandBookmark",ariaKey:"commandBookmarkAria",enabled:"isVisualMode"},image:{id:"image",command:"openImageDialog",icon:Ra,labelKey:"commandImage",ariaKey:"commandImageAria",enabled:"isVisualMode"}}},Ay={menus:{},submenus:{insertRow:{id:"insertRow",labelKey:"menuInsertRow",ariaKey:"menuInsertRowAria",enabled:"isInTable"},insertColumn:{id:"insertColumn",labelKey:"menuInsertColumn",ariaKey:"menuInsertColumnAria",enabled:"isInTable"}},groups:{},items:{table:{id:"table",command:"openTableDialog",icon:Bi,labelKey:"commandTable",ariaKey:"commandTableAria",enabled:"isVisualMode"},insertRowBelow:{id:"insertRowBelow",command:"insertRowBelow",icon:Xr,labelKey:"commandInsertRowBelow",ariaKey:"commandInsertRowBelowAria",enabled:"isInTable"},insertRowBefore:{id:"insertRowBefore",command:"insertRowBefore",icon:Xr,labelKey:"commandInsertRowBefore",ariaKey:"commandInsertRowBeforeAria",enabled:"isInTable"},deleteRow:{id:"deleteRow",command:"deleteRow",icon:Xr,labelKey:"commandDeleteRow",ariaKey:"commandDeleteRowAria",enabled:"isInTable"},insertColumnAfter:{id:"insertColumnAfter",command:"insertColumnAfter",icon:Vr,labelKey:"commandInsertColumnAfter",ariaKey:"commandInsertColumnAfterAria",enabled:"isInTable"},insertColumnBefore:{id:"insertColumnBefore",command:"insertColumnBefore",icon:Vr,labelKey:"commandInsertColumnBefore",ariaKey:"commandInsertColumnBeforeAria",enabled:"isInTable"},deleteColumn:{id:"deleteColumn",command:"deleteColumn",icon:Vr,labelKey:"commandDeleteColumn",ariaKey:"commandDeleteColumnAria",enabled:"isInTable"},tableProperties:{id:"tableProperties",command:"openTableProperties",icon:Bi,labelKey:"commandTableProperties",ariaKey:"commandTablePropertiesAria",enabled:"isInTable"},cellProperties:{id:"cellProperties",command:"openCellProperties",icon:Rs,labelKey:"commandCellProperties",ariaKey:"commandCellPropertiesAria",enabled:"isInTable"},rowProperties:{id:"rowProperties",command:"openRowProperties",icon:ec,labelKey:"commandRowProperties",ariaKey:"commandRowPropertiesAria",enabled:"isInTable"}}},Py={menus:{view:{id:"view",labelKey:"menuView",ariaKey:"menuViewAria"}},groups:{view:{id:"view",labelKey:"toolbarGroupView"}},items:{visual:{id:"visual",command:"setVisualMode",icon:ic,labelKey:"modeVisual",ariaKey:"modeVisualAria",active:"isVisualMode"},html:{id:"html",command:"setHtmlMode",icon:Ks,labelKey:"modeHtml",ariaKey:"modeHtmlAria",active:"isHtmlMode"},fullscreen:{id:"fullscreen",command:"toggleFullscreen",icon:Os,labelKey:"modeFullscreen",ariaKey:"modeFullscreenAria",active:"isFullscreen",toggle:!0}}};function Ey(...e){return{menus:Object.assign({},...e.map(t=>t.menus)),submenus:Object.assign({},...e.map(t=>t.submenus??{})),groups:Object.assign({},...e.map(t=>t.groups)),items:Object.assign({},...e.map(t=>t.items))}}const jy=Ey(sy,iy,Dy,Ay,Py,vy),Ny={menus:[{id:"file",items:["save","open",be,"print"]},{id:"edit",items:["undo","redo"]},{id:"insert",items:["link","bookmark",be,"image","table",be,{submenu:"insertRow",items:["insertRowBelow","insertRowBefore","deleteRow"]},{submenu:"insertColumn",items:["insertColumnAfter","insertColumnBefore","deleteColumn"]}]},{id:"view",items:["visual","html",be,"fullscreen"]},{id:"format",items:[{submenu:"paragraphStyles",items:[]},be,{submenu:"font",items:["fontProperties",be,{submenu:"highlightColor",items:[]},be,"bold","italic","underline","strikethrough"]},be,"clearFormatting",be,{submenu:"paragraph",items:["paragraphProperties",be,"alignLeft","alignCenter","alignRight","alignJustify",be,"indent","outdent",be,"bulletList","numberedList"]},be,{submenu:"page",items:["pageProperties"]},be,"imageProperties",be,"tableProperties","cellProperties","rowProperties"]}],iconGroups:[{id:"file",items:["save","open"]},{id:"print",items:["print"]},{id:"edit",items:["undo","redo"]},{id:"insert",items:["link","bookmark","image","table"]},{id:"font",items:["fontFamily","paragraphStyle","fontSize","fontColor","highlightColor","bold","italic","underline","strikethrough","clearFormatting"]},{id:"align",items:["alignLeft","alignCenter","alignRight","alignJustify"]},{id:"paragraph",items:["indent","outdent","bulletList","numberedList"]},{id:"view",items:["visual","html","fullscreen"]}]};function jt(e,t){return t?t.label?t.label:t.labelKey?e(t.labelKey):"":""}function Jn(e,t){return t?t.ariaLabel?t.ariaLabel:t.ariaKey?e(t.ariaKey):jt(e,t):""}function Ly({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"scroll-left",children:[o.jsx("path",{d:"m11 17-5-5 5-5"}),o.jsx("path",{d:"m18 17-5-5 5-5"})]})}function Ty({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true","data-icon":"scroll-right",children:[o.jsx("path",{d:"m6 17 5-5-5-5"}),o.jsx("path",{d:"m13 17 5-5-5-5"})]})}const La=1;function My(e){const t=Math.max(0,e.scrollWidth-e.clientWidth);return{canScrollLeft:e.scrollLeft>La,canScrollRight:e.scrollLeft<t-La}}const Ry=40;function _y(e){const t=e.querySelector("button"),n=t instanceof HTMLElement?t.offsetWidth:0;return Math.max(n||Ry,1)}const Fy={canScrollLeft:!1,canScrollRight:!1};function Iy(e){const t=s.useRef(null),n=s.useRef(null),[r,i]=s.useState(Fy),a=s.useCallback(()=>{const p=t.current;p&&i(My(p))},[]);s.useLayoutEffect(()=>{const p=t.current;if(!p)return;a(),p.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a);const b=typeof ResizeObserver>"u"?null:new ResizeObserver(a);return b==null||b.observe(p),n.current&&(b==null||b.observe(n.current)),()=>{p.removeEventListener("scroll",a),window.removeEventListener("resize",a),b==null||b.disconnect()}},[a,e]);const l=s.useCallback(p=>{const b=t.current;b&&b.scrollBy({left:p*_y(b),behavior:"smooth"})},[]),c=s.useCallback(()=>{l(-1)},[l]),m=s.useCallback(()=>{l(1)},[l]);return{trackRef:t,innerRef:n,canScrollLeft:r.canScrollLeft,canScrollRight:r.canScrollRight,scrollLeft:c,scrollRight:m}}function By({groups:e,catalog:t,commands:n,queries:r,disabled:i}){const a=V(),{trackRef:l,innerRef:c,canScrollLeft:m,canScrollRight:p,scrollLeft:b,scrollRight:h}=Iy(e);return o.jsxs("div",{className:U.iconNav,role:"toolbar","aria-label":a("toolbarAria"),children:[m?o.jsx(Ie,{label:a("toolbarScrollLeftAria"),className:`${U.scrollButton} ${U.scrollButtonLeft}`,children:o.jsx("button",{type:"button",className:U.iconButton,"aria-label":a("toolbarScrollLeftAria"),onClick:b,children:o.jsx(Ly,{className:U.icon})})}):null,o.jsx("div",{ref:l,className:U.iconTrack,"data-icon-track":"",children:o.jsx("div",{ref:c,className:U.iconTrackInner,children:e.map(w=>{const x=t.groups[w.id];return o.jsx("div",{className:U.iconGroup,role:"group","aria-label":x?jt(a,x):void 0,"data-toolbar-group":w.id,children:w.items.map(S=>{const y=t.items[S];if(!y)return null;const C=y.enabled?!r[y.enabled]():!1;if(y.widget){const L=y.widget;return o.jsx(L,{commands:n,queries:r,disabled:i||C},S)}if(!y.icon||!y.command)return null;const g=y.icon,k=y.command,P=y.active?r[y.active]():void 0;return o.jsx(Ie,{label:y.tooltip??jt(a,y),children:o.jsx("button",{type:"button",className:U.iconButton,"aria-label":Jn(a,y),"aria-pressed":P,disabled:i||C,onClick:()=>{Mo(n,k)},children:o.jsx(g,{className:U.icon})})},S)})},w.id)})})}),p?o.jsx(Ie,{label:a("toolbarScrollRightAria"),className:`${U.scrollButton} ${U.scrollButtonRight}`,children:o.jsx("button",{type:"button",className:U.iconButton,"aria-label":a("toolbarScrollRightAria"),onClick:h,children:o.jsx(Ty,{className:U.icon})})}):null]})}function Hy({menus:e,catalog:t,commands:n,queries:r,disabled:i,compact:a,openMenuId:l,onOpenMenuIdChange:c}){const m=V(),[p,b]=s.useState(!1),h=s.useRef(null),w=s.useRef(null),x=s.useRef(null),S=s.useCallback(()=>{b(!1),c(null)},[c]);s.useEffect(()=>{var C;p&&((C=w.current)==null||C.focus())},[p]),s.useEffect(()=>{if(!p)return;const C=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=C}},[p]),s.useEffect(()=>{if(!p)return;const C=k=>{var P;if(k.key==="Escape"){if(k.preventDefault(),k.stopPropagation(),l){c(null);return}S(),(P=h.current)==null||P.focus()}},g=k=>{var P;x.current&&!x.current.contains(k.target)&&(S(),(P=h.current)==null||P.focus())};return document.addEventListener("keydown",C,!0),document.addEventListener("pointerdown",g),()=>{document.removeEventListener("keydown",C,!0),document.removeEventListener("pointerdown",g)}},[p,l,c,S]);const y=C=>e.map(g=>{const k=t.menus[g.id];return k?o.jsx(zy,{def:k,itemIds:g.items,catalog:t,commands:n,queries:r,disabled:i,variant:C,open:(C==="overlay"||!p)&&l===g.id,onOpenChange:P=>c(P?g.id:null),onItemRun:C==="overlay"?()=>{var P;S(),(P=h.current)==null||P.focus()}:void 0},`${C}-${g.id}`):null});return o.jsxs("div",{className:U.menuBar,children:[o.jsx(Ie,{label:m("brandMarkAria"),children:o.jsx("span",{className:U.brandMark,role:"img","aria-label":m("brandMarkAria"),children:o.jsx(Fs,{className:U.brandMarkIcon})})}),o.jsx("div",{className:U.menuBarCompact,hidden:a===void 0?void 0:!a,children:o.jsx(Ie,{label:m("menuHamburgerAria"),children:o.jsx("button",{ref:h,type:"button",className:`${U.menuButton} ${U.hamburgerButton}`,"aria-haspopup":"dialog","aria-expanded":p,"aria-label":m("menuHamburgerAria"),disabled:i,onClick:()=>{if(p){S();return}c(null),b(!0)},children:o.jsx(qs,{className:U.icon})})})}),o.jsx("div",{className:U.menuBarDesktop,hidden:a===void 0?void 0:a,children:y("dropdown")}),p?o.jsxs("div",{ref:x,className:U.menuOverlay,role:"dialog","aria-modal":"true","aria-label":m("menuOverlayAria"),children:[o.jsxs("div",{className:U.menuOverlayHeader,children:[o.jsx("span",{className:U.menuOverlayTitle,children:m("menuOverlayAria")}),o.jsx("button",{ref:w,type:"button",className:U.iconButton,"aria-label":m("menuCloseAria"),onClick:()=>{var C;S(),(C=h.current)==null||C.focus()},children:o.jsx(He,{className:U.icon})})]}),o.jsx("div",{className:U.menuOverlayBody,children:y("overlay")})]}):null]})}function Zn(e,t){var n,r,i;if(Qe(e))return!1;if(an(e)){const a=(n=t.submenus)==null?void 0:n[e.submenu];return a?a.panel?!0:e.items.some(l=>Zn(l,t)):!1}return!!((r=t.items[e])!=null&&r.command&&((i=t.items[e])!=null&&i.icon))}function Oy(e,t,n){if(!Qe(e[t])||!e.slice(t+1).some(a=>Zn(a,n)))return!1;let i=!1;for(let a=t-1;a>=0;a--){const l=e[a];if(Qe(l)){i=!0;continue}if(Zn(l,n))return!i}return!1}function zy({def:e,itemIds:t,catalog:n,commands:r,queries:i,disabled:a,variant:l,open:c,onOpenChange:m,onItemRun:p}){const b=V(),h=s.useRef(null),w=l==="overlay"?`overlay-${e.id}-menu`:`${e.id}-menu`,[x,S]=s.useState(null);s.useEffect(()=>{c||S(null)},[c]),s.useEffect(()=>{if(!c||l==="overlay")return;const C=k=>{h.current&&!h.current.contains(k.target)&&m(!1)},g=k=>{if(k.key==="Escape"){if(k.preventDefault(),k.stopPropagation(),x){S(null);return}m(!1)}};return document.addEventListener("pointerdown",C),document.addEventListener("keydown",g,!0),()=>{document.removeEventListener("pointerdown",C),document.removeEventListener("keydown",g,!0)}},[c,x,m,l]);const y=()=>{m(!1),p==null||p()};return o.jsxs("div",{className:U.menuWrap,ref:h,children:[o.jsx("button",{type:"button",className:U.menuButton,"aria-haspopup":"menu","aria-expanded":c,"aria-controls":w,"aria-label":Jn(b,e),disabled:a,onClick:()=>m(!c),children:jt(b,e)}),c?o.jsx("div",{className:U.menu,role:"menu",id:w,children:o.jsx(bs,{entries:t,catalog:n,commands:r,queries:i,disabled:a,variant:l,onClose:y,openSubmenuId:x,onOpenSubmenuIdChange:S})}):null]})}function bs({entries:e,catalog:t,commands:n,queries:r,disabled:i,variant:a,onClose:l,openSubmenuId:c,onOpenSubmenuIdChange:m}){return o.jsx(o.Fragment,{children:e.map((p,b)=>{if(Qe(p))return Oy(e,b,t)?o.jsx("div",{role:"separator",className:U.menuSeparator},`separator-${b}`):null;if(an(p))return o.jsx($y,{entry:p,catalog:t,commands:n,queries:r,disabled:i,variant:a,onClose:l,open:c===p.submenu,onOpenChange:w=>m==null?void 0:m(w?p.submenu:null)},`submenu-${p.submenu}-${b}`);const h=t.items[p];return!h||!h.command||!h.icon?null:o.jsx(Ky,{item:h,commands:n,queries:r,disabled:i,onClose:l},p)})})}function Ky({item:e,commands:t,queries:n,disabled:r,onClose:i}){const a=V();if(!e.icon||!e.command)return null;const l=e.icon,c=e.command,m=e.active?n[e.active]():void 0,p=e.enabled?!n[e.enabled]():!1,b=e.toggle?"menuitemcheckbox":e.active?"menuitemradio":"menuitem";return o.jsxs("button",{type:"button",role:b,className:U.menuItem,"aria-checked":m,disabled:r||p,onClick:()=>{i(),Mo(t,c)},children:[o.jsx(l,{className:U.icon}),jt(a,e)]})}function $y({entry:e,catalog:t,commands:n,queries:r,disabled:i,variant:a,onClose:l,open:c,onOpenChange:m}){var N;const p=V(),b=s.useRef(null),h=s.useRef(null),[w,x]=s.useState(null),S=(N=t.submenus)==null?void 0:N[e.submenu],y=a==="overlay"?`overlay-${e.submenu}-submenu`:`${e.submenu}-submenu`,C=S==null?void 0:S.panel,g=S!=null&&S.enabled?!r[S.enabled]():!1,k=a==="overlay";if(s.useEffect(()=>{c||x(null)},[c]),!S||!C&&!e.items.some(M=>Zn(M,t)))return null;const P=M=>{(M.key==="ArrowRight"||M.key==="Enter"||M.key===" ")&&(M.preventDefault(),M.stopPropagation(),m(!0),requestAnimationFrame(()=>{var F;const T=(F=h.current)==null?void 0:F.querySelector('[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]');T==null||T.focus()}))},L=M=>{var T;M.key==="ArrowLeft"&&(M.preventDefault(),M.stopPropagation(),m(!1),(T=b.current)==null||T.focus())};return o.jsxs("div",{className:U.submenuWrap,onMouseEnter:k?void 0:()=>m(!0),onMouseLeave:k?void 0:()=>m(!1),children:[o.jsx("button",{ref:b,type:"button",role:"menuitem",className:`${U.menuItem} ${U.submenuTrigger}`,"aria-haspopup":"menu","aria-expanded":c,"aria-controls":y,"aria-label":Jn(p,S),disabled:i||g,onClick:()=>m(k?!c:!0),onKeyDown:P,children:jt(p,S)}),c?o.jsx("div",{ref:h,className:`${U.menu} ${U.submenu}`,role:"menu",id:y,"aria-label":Jn(p,S),onKeyDown:L,children:C?o.jsx(C,{commands:n,queries:r,disabled:i||g,onMenuClose:l}):o.jsx(bs,{entries:e.items,catalog:t,commands:n,queries:r,disabled:i,variant:a,onClose:l,openSubmenuId:w,onOpenSubmenuIdChange:x})}):null]})}function Uy({catalog:e,layout:t,commands:n,queries:r,disabled:i,menuVisible:a=!0,toolbarVisible:l=!0,compact:c}){const[m,p]=s.useState(null);return!a&&!l?null:o.jsxs("div",{className:U.toolbar,"data-compact":c?"":void 0,children:[a?o.jsx(Hy,{menus:t.menus,catalog:e,commands:n,queries:r,disabled:i,compact:c,openMenuId:m,onOpenMenuIdChange:p}):null,l?o.jsx(By,{groups:t.iconGroups,catalog:e,commands:n,queries:r,disabled:i}):null]})}const Wy="_root_14tok_1",qy="_fullscreen_14tok_34",Gy="_exitFullscreen_14tok_46",Vy="_exitFullscreenIcon_14tok_77",Xy="_chrome_14tok_92",Yy="_workspace_14tok_103",Jy="_surface_14tok_113",Zy="_visual_14tok_120",Qy="_html_14tok_136",Fe={root:Wy,fullscreen:qy,exitFullscreen:Gy,exitFullscreenIcon:Vy,chrome:Xy,workspace:Yy,surface:Jy,visual:Zy,html:Qy},ex=s.forwardRef(function({html:t,onChange:n,placeholder:r,disabled:i},a){const l=V();return o.jsx("textarea",{ref:a,className:`${Fe.surface} ${Fe.html}`,value:t,onChange:c=>n(c.target.value),placeholder:r,disabled:i,"aria-label":l("htmlEditorAria"),spellCheck:!1})}),tx=s.forwardRef(function({html:t,onChange:n,placeholder:r,disabled:i,onBeforeInput:a,onPointerDown:l,onContextMenu:c},m){const p=V(),b=s.useRef(null),h=w=>{b.current=w,typeof m=="function"?m(w):m&&(m.current=w)};return s.useLayoutEffect(()=>{const w=b.current;w&&(w.innerHTML!==t&&(w.innerHTML=t),dl(w))},[t]),o.jsx("div",{ref:h,className:`${Fe.surface} ${Fe.visual}`,contentEditable:!i,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":p("visualEditorAria"),"aria-disabled":i||void 0,"data-placeholder":r,onBeforeInput:w=>{a==null||a(w.nativeEvent)},onPointerDown:l,onContextMenu:c,onInput:w=>{n(w.currentTarget.innerHTML)}})});function nx({value:e,defaultValue:t="",onChange:n,mode:r,defaultMode:i="visual",onModeChange:a,fullscreen:l,defaultFullscreen:c=!1,onFullscreenChange:m,placeholder:p,disabled:b,className:h,locale:w="en",toolbarBackground:x,menuColor:S,menuBackground:y,menuFontSize:C,menuFontFamily:g,border:k,menuVisible:P=!0,toolbarVisible:L=!0,customActions:N,customFonts:M,transformHtml:T,loadCustomParagraphStyles:F,onSaveCustomParagraphStyle:D,onDeleteCustomParagraphStyle:E,customImagePicker:_,disableBuiltinImageInsert:z}){const[W,X]=oo({value:e,defaultValue:t,onChange:n}),[J,fe]=oo({value:r,defaultValue:i,onChange:a}),[ce,te]=oo({value:l,defaultValue:c,onChange:m}),R=s.useRef(null),Z=s.useRef(null),Q=s.useRef(null);Q.current===null&&(Q.current=ly(W));const A=Q.current,K=s.useRef(W);K.current=W;const j=s.useRef(J);j.current=J;const O=s.useRef(ce);O.current=ce;const ee=s.useRef(null),ye=s.useRef(T);ye.current=T;const re=s.useRef({}),de=s.useRef(null),we=s.useRef(null),Se=s.useRef(null),Te=s.useRef(null),ve=s.useRef(null),[un,sr]=s.useState($e),cr=s.useRef(un);cr.current=un;const ze=s.useRef(ut),[Ft,dn]=s.useState({value:null,unit:ut,mixed:!1}),Xe=s.useRef(Ft);Xe.current=Ft;const[It,ur]=s.useState({value:null,mixed:!1}),Bt=s.useRef(It);Bt.current=It;const[Ht,dr]=s.useState({value:null,mixed:!1}),Ot=s.useRef(Ht);Ot.current=Ht;const[zt,mr]=s.useState({value:null,mixed:!1}),Kt=s.useRef(zt);Kt.current=zt;const[fr,pr]=s.useState({tag:null,mixed:!1}),hr=s.useRef(fr);hr.current=fr;const[si,gr]=s.useState({align:"left",mixed:!1}),br=s.useRef(si);br.current=si;const[ci,yr]=s.useState({type:null,mixed:!1}),$t=s.useRef(ci);$t.current=ci;const[ui,xr]=s.useState(!1),di=s.useRef(ui);di.current=ui;const[wr,Sr]=s.useState(!1),mi=s.useRef(wr);mi.current=wr;const[fi,pi]=s.useState(!1),hi=s.useRef(fi);hi.current=fi;const[Ut,mn]=s.useState({open:!1,tab:"general"}),[it,fn]=s.useState({open:!1,tab:"general",value:Jt()}),[at,pn]=s.useState({open:!1,tab:"font",value:wo()}),[kr,gi]=s.useState([]),[Cr,vr]=s.useState(!1),[ys,hn]=s.useState(!1),[pe,Wt]=s.useState({open:!1}),[ke,gn]=s.useState({open:!1,tab:"link",href:"",title:"",targetBlank:!1,textDecorationNone:!1,hoverMode:"color",hoverColor:null,hoverHtml:"",bookmarks:[],selectedBookmarkId:""}),[Dr,Ar]=s.useState({open:!1,existingIds:[]}),[xs,bn]=s.useState({open:!1}),[yn,xn]=s.useState({open:!1,tab:"general",value:Zl(),aspectRatio:1}),[Pr,Er]=s.useState({open:!1}),[wn,jr]=s.useState({open:!1,value:$f()}),[Sn,Nr]=s.useState({open:!1,value:Qf()}),[kn,Lr]=s.useState({open:!1,value:sp()}),[qt,Tr]=s.useState({open:!1,x:0,y:0,kind:"caret",inTable:!1}),[he,pt]=s.useState(null),bi=s.useRef(he);bi.current=he;const[Mr,Cn]=s.useState(!1),yi=s.useRef(Mr);yi.current=Mr;const vn=s.useRef(kr);vn.current=kr;const xi=s.useRef(Cr);xi.current=Cr;const Rr=!!(F&&D),_r=s.useRef(Rr);_r.current=Rr;const wi=s.useRef(F);wi.current=F;const Si=s.useRef(D);Si.current=D;const ki=s.useRef(E);ki.current=E;const Ci=s.useRef(_);Ci.current=_;const vi=s.useRef(z);vi.current=z;const Fr=s.useRef(0),Ye=s.useMemo(()=>Ga(M),[M]),Gt=s.useRef(Ye);Gt.current=Ye;const Ir=s.useMemo(()=>Bc(W,Ye).join(`
91
+ `),[W,Ye]);s.useEffect(()=>{const f=(Ir?Ir.split(`
92
+ `):[]).map(v=>{const H=document.createElement("link");return H.rel="stylesheet",H.href=v,H.setAttribute(er,""),document.head.append(H),H});return()=>{for(const v of f)v.remove()}},[Ir]);const Dn=s.useCallback(async()=>{const u=wi.current;if(!u)return;const f=++Fr.current;vr(!0);try{const v=await u();if(f!==Fr.current)return;gi(v)}catch{}finally{f===Fr.current&&vr(!1)}},[]);s.useEffect(()=>{if(!F||!D){gi([]),vr(!1);return}Dn()},[F,D,Dn]);const ht=s.useCallback(u=>{var v;const f=((v=ye.current)==null?void 0:v.call(ye,u))??u;return X(f),f},[X]),De=s.useCallback((u,f)=>{const v=ht(u);return A.record(v,{coalesce:f}),v},[ht,A]),q=s.useCallback((u,f)=>De(Jr(u,Zr(u,K.current,Gt.current)),f),[De]),An=s.useCallback(()=>{const u=A.undo();u!==null&&(A.markApplying(),ht(u))},[ht,A]),Pn=s.useCallback(()=>{const u=A.redo();u!==null&&(A.markApplying(),ht(u))},[ht,A]);s.useEffect(()=>{A.syncExternal(W)},[W,A]);const B=s.useCallback(()=>{ee.current=Je({mode:j.current,visualEl:R.current,htmlEl:Z.current})},[]),ws=s.useCallback(()=>{const u=Je({mode:j.current,visualEl:R.current,htmlEl:Z.current}),f=ee.current;f&&f.mode==="visual"&&f.visualRange&&!f.collapsed&&(u.collapsed||!u.visualRange)||(ee.current=u)},[]),Br=s.useCallback(()=>{const u=R.current;if(j.current!=="visual"||!u){dn({value:null,unit:ze.current,mixed:!1});return}const f=xu(u,ze.current);de.current&&(f.value=de.current.value,f.unit=de.current.unit,f.mixed=!1),ze.current=f.unit,dn(v=>v.value===f.value&&v.unit===f.unit&&v.mixed===f.mixed?v:f)},[]),Hr=s.useCallback(()=>{const u=R.current;if(j.current!=="visual"||!u){ur({value:null,mixed:!1});return}const f=zc(u);we.current&&(f.value=we.current.value,f.mixed=!1),ur(v=>v.value===f.value&&v.mixed===f.mixed?v:f)},[]),Or=s.useCallback(()=>{const u=R.current;if(j.current!=="visual"||!u){dr({value:null,mixed:!1}),mr({value:null,mixed:!1});return}const f=$i(u,"color");Se.current&&(f.value=Se.current.value,f.mixed=!1);const v=$i(u,"backgroundColor");Te.current&&(v.value=Te.current.value,v.mixed=!1),dr(H=>H.value===f.value&&H.mixed===f.mixed?H:f),mr(H=>H.value===v.value&&H.mixed===v.mixed?H:v)},[]),zr=s.useCallback(()=>{const u=R.current;if(j.current!=="visual"||!u){pr({tag:null,mixed:!1});return}const f=pd(u);pr(v=>v.tag===f.tag&&v.mixed===f.mixed?v:f)},[]),Kr=s.useCallback(()=>{const u=R.current;if(j.current!=="visual"||!u){gr({align:null,mixed:!1}),yr({type:null,mixed:!1}),xr(!1),pi(!1);return}const f=Il(u);gr(ne=>ne.align===f.align&&ne.mixed===f.mixed?ne:f);const v=xl(u);yr(ne=>ne.type===v.type&&ne.mixed===v.mixed?ne:v);const H=vd(u);xr(ne=>ne===H?ne:H);const G=hm(u);pi(ne=>ne===G?ne:G)},[]),I=s.useCallback(()=>{const u=R.current;if(j.current!=="visual"||!u){sr($e()),Sr(!1),Br(),Hr(),Or(),zr(),Kr();return}const f=ee.current,v=!!(f&&!f.collapsed);Sr(G=>G===v?G:v);const H=il(Ln(u),re.current);sr(G=>Mu(G,H)?G:H),Br(),Hr(),Or(),zr(),Kr()},[Br,Hr,Or,zr,Kr]),Di=s.useCallback(()=>{const u=ee.current,f=ve.current;!f||!u||u.collapsed&&u.start===f.start&&u.end===f.end||(re.current={},de.current=null,we.current=null,Se.current=null,Te.current=null,ve.current=null)},[]);s.useEffect(()=>{if(J==="visual"){I();return}re.current={},de.current=null,we.current=null,Se.current=null,Te.current=null,ve.current=null,sr($e()),dn({value:null,unit:ze.current,mixed:!1}),ur({value:null,mixed:!1}),dr({value:null,mixed:!1}),mr({value:null,mixed:!1}),pr({tag:null,mixed:!1}),gr({align:null,mixed:!1}),yr({type:null,mixed:!1}),xr(!1),Sr(!1)},[J,W,I]);const gt=s.useCallback((u,f,v)=>{Yu({snapshot:u,visualEl:R.current,htmlEl:Z.current,getHtml:()=>j.current==="visual"&&R.current?R.current.innerHTML:K.current,setHtml:H=>{if(j.current==="visual"){q(rn(H).body,!1);return}De(H,!1)},content:f,asHtml:v})},[De,q]),Ai=s.useCallback(u=>{if(j.current==="visual"&&u==="html"&&R.current){const f=R.current.innerHTML,v=Jr(f,Zr(f,K.current,Gt.current));v!==K.current&&De(v,!0)}fe(u)},[De,fe]);s.useEffect(()=>{if(!ce)return;const u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=u}},[ce]),s.useEffect(()=>{if(!ce)return;const u=f=>{f.key==="Escape"&&(f.defaultPrevented||Ut.open||it.open||at.open||Pr.open||wn.open||Sn.open||kn.open||(f.preventDefault(),te(!1)))};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[ce,te,Ut.open,it.open,at.open,Pr.open,wn.open,Sn.open,kn.open]),s.useEffect(()=>{const u=()=>{if(j.current!=="visual"||!R.current)return;const f=window.getSelection();if(!f||f.rangeCount===0)return;const v=f.anchorNode;!v||!R.current.contains(v)&&R.current!==v||(B(),Di(),I(),pt(Qt(R.current)),Cn(en(R.current)!==null))};return document.addEventListener("selectionchange",u),()=>document.removeEventListener("selectionchange",u)},[B,Di,I]),s.useEffect(()=>{if(J!=="html")return;const u=Z.current;if(!u)return;const f=()=>B();return u.addEventListener("select",f),u.addEventListener("keyup",f),u.addEventListener("mouseup",f),()=>{u.removeEventListener("select",f),u.removeEventListener("keyup",f),u.removeEventListener("mouseup",f)}},[J,B]),s.useLayoutEffect(()=>{if(J!=="visual"||b){pt(null);return}const u=R.current;if(!u)return;const f=Qt(u);pt(v=>f||(v&&v.isConnected&&u.contains(v)?v:null))},[W,J,b]);const $=s.useCallback(u=>{const f=Je({mode:"visual",visualEl:u,htmlEl:Z.current}),v=ee.current,H=v&&v.mode==="visual"&&v.visualRange&&!v.collapsed&&(f.collapsed||!f.visualRange)?v:f.visualRange?f:v??f;if(ee.current=H,u.focus(),H.visualRange){const G=window.getSelection();try{G==null||G.removeAllRanges(),G==null||G.addRange(H.visualRange)}catch{}}return H},[]),$r=s.useCallback((u,f)=>{if(j.current!=="visual")return;const v=R.current;if(!v)return;const H=f??ze.current,G=dt(u,H);if(!G)return;ze.current=G.unit;const ne=$(v);if(ne.collapsed){de.current=G,ve.current={start:ne.start,end:ne.end},I();return}de.current=null,Ki(v,G.value,G.unit)&&(q(v.innerHTML,!1),B(),I())},[$,q,B,I]),Pi=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(!f)return;const v=$(f);if(v.collapsed){we.current={value:u},ve.current={start:v.start,end:v.end},I();return}we.current=null,Oi(f,u)&&(q(f.innerHTML,!1),B(),I())},[$,q,B,I]),Ur=s.useCallback((u,f)=>{if(j.current!=="visual")return;const v=R.current;if(!v)return;const H=$(v),G=u==="color"?Se:Te;if(H.collapsed){G.current={value:f},ve.current={start:H.start,end:H.end},I();return}G.current=null,no(v,u,f)&&(q(v.innerHTML,!1),B(),I())},[$,q,B,I]),Wr=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(!f)return;const v=$(f);if(mn({open:!1,tab:"general"}),v.collapsed){if(u.size!==null){const Ce=dt(u.size,u.unit);Ce&&(de.current=Ce,ze.current=Ce.unit)}const G=Ln(f),ne={};for(const Ce of _e)u.marks[Ce]!==G[Ce]&&(ne[Ce]=u.marks[Ce]);re.current=ne,u.fontColorMixed||(Se.current={value:u.fontColor}),u.highlightColorMixed||(Te.current={value:u.highlightColor}),u.fontFamilyMixed||(we.current={value:u.fontFamily}),ve.current={start:v.start,end:v.end},I();return}if(re.current={},de.current=null,we.current=null,Se.current=null,Te.current=null,ve.current=null,u.size!==null){const G=dt(u.size,u.unit);G&&(ze.current=G.unit,Ki(f,G.value,G.unit))}const H=Ln(f);for(const G of _e)u.marks[G]!==H[G]&&Wi(f,G);u.fontFamilyMixed||Oi(f,u.fontFamily),u.fontColorMixed||no(f,"color",u.fontColor),u.highlightColorMixed||no(f,"backgroundColor",u.highlightColor),q(f.innerHTML,!1),B(),I()},[$,q,B,I]),Ei=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),fn(v=>({...v,open:!1})),!Hl(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I()}},[$,q,B,I]),ji=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),pn(v=>({...v,open:!1})),!lm(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I()}},[$,q,B,I]),Ni=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),gn(v=>({...v,open:!1})),!Sm(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I()}},[$,q,B,I]),Li=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),Ar(v=>({...v,open:!1})),!Dm(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I()}},[$,q,B,I]),En=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),bn({open:!1}),!Wm(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I()}},[$,q,B,I]),Ti=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),Er({open:!1}),!Mf(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I(),Cn(!0)}},[$,q,B,I]),Mi=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),jr(v=>({...v,open:!1})),!Gf(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I()}},[$,q,B,I]),Ri=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),Nr(v=>({...v,open:!1})),!rp(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I()}},[$,q,B,I]),_i=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),Lr(v=>({...v,open:!1})),!mp(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I()}},[$,q,B,I]),lt=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),!u(f)){B(),I();return}q(f.innerHTML,!1),B(),I(),Cn(en(f)!==null)}},[$,q,B,I]),qr=s.useCallback(u=>{En({src:u.src,alt:u.alt??"",title:u.title??"",css:u.css})},[En]),Fi=s.useCallback(u=>{if(j.current!=="visual")return;const f=R.current;if(f){if($(f),xn(v=>({...v,open:!1})),!cf(f,u)){B(),I();return}q(f.innerHTML,!1),B(),I()}},[$,q,B,I]),Ss=s.useCallback((u,f)=>{he!=null&&he.isConnected&&Af(he,u,f)},[he]),ks=s.useCallback(()=>{const u=R.current;!u||!(he!=null&&he.isConnected)||(q(u.innerHTML,!1),ro(u,he),B(),I())},[he,q,B,I]),oe=s.useMemo(()=>({getHtml:()=>{if(j.current==="visual"&&R.current){const u=R.current.innerHTML,f=Jr(u,Zr(u,K.current,Gt.current));if(f!==K.current)return De(f,!0)}return K.current},setHtml:u=>{De(u,!1)},getMode:()=>j.current,setMode:Ai,getFullscreen:()=>O.current,setFullscreen:te,undo:An,redo:Pn,canUndo:()=>A.canUndo(),canRedo:()=>A.canRedo(),getSelection:()=>{const u=ee.current??Je({mode:j.current,visualEl:R.current,htmlEl:Z.current});return qi(u)},insertText:u=>{const f=ee.current??Je({mode:j.current,visualEl:R.current,htmlEl:Z.current});gt(f,u,!1)},insertHtml:(u,f)=>{const v=ee.current??Je({mode:j.current,visualEl:R.current,htmlEl:Z.current}),H=f===void 0;gt(v,H?u:f,H)},toggleFontMark:u=>{if(j.current!=="visual")return;const f=R.current;if(!f)return;const v=$(f);if(v.collapsed){const H=Ln(f);re.current=_u(re.current,H,u),ve.current={start:v.start,end:v.end},I();return}re.current={},ve.current=null,Wi(f,u)&&(q(f.innerHTML,!1),B(),I())},clearFormatting:()=>{if(j.current!=="visual")return;const u=R.current;!u||$(u).collapsed||(re.current={},de.current=null,we.current=null,Se.current=null,Te.current=null,ve.current=null,Mm(u)&&(q(u.innerHTML,!1),B(),I()))},isFontMarkActive:u=>cr.current[u],hasTextSelection:()=>j.current==="visual"&&mi.current,setFontSize:(u,f)=>{$r(u,f)},setFontSizeUnit:u=>{var Ce;const f=R.current,v=Xe.current;if(j.current!=="visual"||!f||v.value===null||v.mixed){ze.current=u,dn(Gr=>({...Gr,unit:u}));return}const H=$(f),G=wu(f,((Ce=H.visualRange)==null?void 0:Ce.startContainer)??f),ne=Ja(v.value,v.unit,u,G.parentPx,G.rootPx);$r(ne,u)},getFontSize:()=>Xe.current.value,getFontSizeUnit:()=>Xe.current.unit,isFontSizeMixed:()=>Xe.current.mixed,setFontFamily:u=>{Pi(u)},getFontFamily:()=>Bt.current.value,isFontFamilyMixed:()=>Bt.current.mixed,getFontFaces:()=>Gt.current,setFontColor:u=>{Ur("color",u)},setHighlightColor:u=>{Ur("backgroundColor",u)},getFontColor:()=>Ot.current.value,isFontColorMixed:()=>Ot.current.mixed,getHighlightColor:()=>Kt.current.value,isHighlightColorMixed:()=>Kt.current.mixed,setParagraphStyle:u=>{if(j.current!=="visual")return;const f=R.current;f&&($(f),hd(f,u)&&(q(f.innerHTML,!1),B(),I()))},getParagraphStyle:()=>hr.current.tag,isParagraphStyleMixed:()=>hr.current.mixed,setTextAlign:u=>{if(j.current!=="visual")return;const f=R.current;f&&($(f),Bl(f,u)&&(q(f.innerHTML,!1),B(),I()))},getTextAlign:()=>br.current.align,isTextAlignMixed:()=>br.current.mixed,indent:()=>{if(j.current!=="visual")return;const u=R.current;u&&($(u),Dd(u)&&(q(u.innerHTML,!1),B(),I()))},outdent:()=>{if(j.current!=="visual")return;const u=R.current;u&&($(u),Ad(u)&&(q(u.innerHTML,!1),B(),I()))},canOutdent:()=>j.current==="visual"&&di.current,toggleList:u=>{if(j.current!=="visual")return;const f=R.current;f&&($(f),yd(f,u)&&(q(f.innerHTML,!1),B(),I()))},isBulletList:()=>$t.current.type==="ul"&&!$t.current.mixed,isNumberedList:()=>$t.current.type==="ol"&&!$t.current.mixed,openFontProperties:u=>{j.current==="visual"&&mn({open:!0,tab:u??"general"})},applyFontProperties:u=>{Wr(u)},openParagraphProperties:u=>{if(j.current!=="visual")return;const f=R.current;f&&$(f),fn({open:!0,tab:u??"general",value:f?ea(f):Jt()})},applyParagraphProperties:u=>{Ei(u)},openPageProperties:u=>{if(j.current!=="visual")return;const f=R.current;f&&$(f),pn({open:!0,tab:u??"font",value:f?am(f):wo()})},applyPageProperties:u=>{ji(u)},openCustomParagraphStyleDialog:u=>{if(j.current!=="visual"||!_r.current)return;if(u){const v=vn.current.find(H=>H.id===u);if(!v)return;Wt({open:!0,mode:"edit",style:v});return}const f=R.current;f&&$(f),Wt({open:!0,mode:"create",font:{size:Xe.current.mixed?null:Xe.current.value,unit:Xe.current.unit,marks:{...cr.current},fontFamily:Bt.current.mixed?null:Bt.current.value,fontColor:Ot.current.mixed?null:Ot.current.value,highlightColor:Kt.current.mixed?null:Kt.current.value},paragraph:Ol(f?ea(f):Jt())})},applyCustomParagraphStyle:u=>{const f=vn.current.find(H=>H.id===u);if(!f||(Wr({size:f.font.size,unit:f.font.unit,marks:f.font.marks,fontFamily:f.font.fontFamily??null,fontFamilyMixed:!1,fontColor:f.font.fontColor,highlightColor:f.font.highlightColor,fontColorMixed:!1,highlightColorMixed:!1}),!f.paragraph))return;const v=R.current;!v||j.current!=="visual"||($(v),Jd(v,f.paragraph)&&(q(v.innerHTML,!1),B(),I()))},customParagraphStylesEnabled:()=>_r.current,getCustomParagraphStyles:()=>vn.current,isCustomParagraphStylesLoading:()=>xi.current,openLinkDialog:u=>{if(j.current!=="visual")return;const f=R.current;f&&$(f);const v=f?$l(f):ar(),H=f?So(f):[],G=(v==null?void 0:v.href)??"",ne=G.startsWith("#")?G.slice(1):"",Ce=H.some(Gr=>Gr.id===ne)?ne:"";gn({open:!0,tab:u??"link",href:G,title:(v==null?void 0:v.title)??"",targetBlank:(v==null?void 0:v.targetBlank)??!1,textDecorationNone:(v==null?void 0:v.textDecorationNone)??!1,hoverMode:(v==null?void 0:v.hoverMode)??"color",hoverColor:(v==null?void 0:v.hoverColor)??null,hoverHtml:(v==null?void 0:v.hoverHtml)??"",bookmarks:H,selectedBookmarkId:Ce})},applyLink:u=>{Ni(u)},openBookmarkDialog:()=>{if(j.current!=="visual")return;const u=R.current;u&&$(u),Ar({open:!0,existingIds:u?So(u).map(f=>f.id):[]})},applyBookmark:u=>{Li(u)},openImageDialog:()=>{if(j.current!=="visual")return;const u=R.current;u&&$(u);const f=Ci.current;if(vi.current&&f){f.onPick(qr);return}bn({open:!0})},applyImage:u=>{En(u)},openImageProperties:u=>{if(j.current!=="visual")return;const f=R.current;if(!f)return;$(f);const v=Qt(f),H=sf(f);!v||!H||xn({open:!0,tab:u??"general",value:H,aspectRatio:of(v)})},applyImageProperties:u=>{Fi(u)},openTableDialog:()=>{if(j.current!=="visual")return;const u=R.current;u&&$(u),Er({open:!0})},applyTable:u=>{Ti(u)},openTableProperties:()=>{if(j.current!=="visual")return;const u=R.current;if(!u)return;$(u);const f=qf(u);f&&jr({open:!0,value:f})},applyTableProperties:u=>{Mi(u)},openCellProperties:()=>{if(j.current!=="visual")return;const u=R.current;if(!u)return;$(u);const f=np(u);f&&Nr({open:!0,value:f})},applyCellProperties:u=>{Ri(u)},openRowProperties:()=>{if(j.current!=="visual")return;const u=R.current;if(!u)return;$(u);const f=dp(u);f&&Lr({open:!0,value:f})},applyRowProperties:u=>{_i(u)},insertRowBelow:()=>{lt(u=>Do(u,"below"))},insertRowBefore:()=>{lt(u=>Do(u,"before"))},deleteRow:()=>{lt(u=>Rf(u))},insertColumnAfter:()=>{lt(u=>la(u,"after"))},insertColumnBefore:()=>{lt(u=>la(u,"before"))},deleteColumn:()=>{lt(u=>_f(u))},cut:async()=>{if(j.current!=="visual")return;const u=R.current;u&&($(u),await Em(u)&&(q(u.innerHTML,!1),B(),I()))},copy:async()=>{if(j.current!=="visual")return;const u=R.current;u&&($(u),await Vl(u))},deleteSelection:()=>{if(j.current!=="visual")return;const u=R.current;u&&($(u),Gl(u)&&(q(u.innerHTML,!1),B(),I()))},isLink:()=>hi.current,isImageSelected:()=>j.current==="visual"&&bi.current!==null,isInTable:()=>j.current==="visual"&&yi.current}),[De,q,Ai,te,gt,An,Pn,B,I,$,$r,Pi,Ur,Wr,Ei,ji,Ni,Li,En,Fi,Ti,Mi,Ri,_i,lt,qr]),Ii=s.useCallback(()=>{const u=ee.current??Je({mode:j.current,visualEl:R.current,htmlEl:Z.current});return{mode:u.mode,selection:qi(u),getHtml:oe.getHtml,setHtml:f=>{De(f,!1)},insertText:f=>gt(u,f,!1),insertHtml:(f,v)=>{const H=v===void 0;gt(u,H?f:v,H)}}},[gt,oe.getHtml,De]),{catalog:Cs,layout:vs}=s.useMemo(()=>fc(N,jy,Ny),[N]),jn=s.useMemo(()=>({...su(oe),...pc(N,Ii)}),[oe,N,Ii]),Ds=s.useMemo(()=>cu(oe),[oe,un,Ft,It,Ht,zt,fr,kr,Cr,Rr,Ye,he,Mr,wr]),As=s.useCallback(u=>{if(b||u.inputType!=="insertText"||!u.data||!Ru(re.current)&&!de.current&&!$c(we.current)&&!Pu({color:Se.current,backgroundColor:Te.current}))return;const f=R.current;f&&(u.preventDefault(),Uu(f,u.data,re.current,de.current,{color:Se.current,backgroundColor:Te.current},we.current),re.current={},de.current=null,we.current=null,Se.current=null,Te.current=null,ve.current=null,q(f.innerHTML,!0),B(),I())},[b,q,B,I]),Ps=s.useCallback(u=>{if(b)return;u.preventDefault(),u.stopPropagation();const f=R.current;if(!f)return;const v=ko(f,u.target),H=Yn(f,u.target);if(H&&If(f,H),v){ro(f,v),B(),pt(v),Tr({open:!0,x:u.clientX,y:u.clientY,kind:"image",inTable:Be(f,v)!==null});return}const G=Je({mode:"visual",visualEl:f,htmlEl:Z.current});ee.current=G,Tr({open:!0,x:u.clientX,y:u.clientY,kind:G.collapsed?"caret":"text",inTable:Be(f,u.target)!==null})},[b,B]),Es=s.useCallback(u=>{if(b)return;const f=R.current;if(!f)return;const v=ko(f,u.target);if(!v){pt(null);return}u.preventDefault(),ro(f,v),B(),pt(v)},[b,B]),js=s.useCallback(u=>{if(b)return;if(u.key==="Tab"&&!u.ctrlKey&&!u.metaKey&&!u.altKey){if(j.current!=="visual")return;const v=R.current;if(!v)return;const H=u.target;if(!(H instanceof Node)||!v.contains(H))return;$(v);const G=Ff(v,u.shiftKey);if(!G)return;u.preventDefault(),typeof G=="object"&&G.changed&&q(v.innerHTML,!1),B(),I(),Cn(en(v)!==null);return}if(!(u.ctrlKey||u.metaKey))return;const f=u.key.toLowerCase();if(f==="z"&&!u.shiftKey){u.preventDefault(),An();return}if(f==="z"&&u.shiftKey||f==="y"){u.preventDefault(),Pn();return}if(f==="b"&&!u.shiftKey){u.preventDefault(),oe.toggleFontMark("bold");return}if(f==="i"&&!u.shiftKey){u.preventDefault(),oe.toggleFontMark("italic");return}if(f==="u"&&!u.shiftKey){u.preventDefault(),oe.toggleFontMark("underline");return}if(f==="x"&&u.shiftKey){u.preventDefault(),oe.toggleFontMark("strikethrough");return}f==="p"&&!u.shiftKey&&(u.preventDefault(),jn.print())},[b,An,Pn,oe,jn,$,q,B,I]),Ns=[Fe.root,ce?Fe.fullscreen:"",h].filter(Boolean).join(" "),Ls=rx({toolbarBackground:x,menuColor:S,menuBackground:y,menuFontSize:C,menuFontFamily:g,border:k});return o.jsx(yc,{locale:w,children:o.jsxs("div",{className:Ns,style:Ls,"data-fullscreen":ce?"":void 0,onKeyDown:js,children:[P||L?o.jsx("div",{className:Fe.chrome,onPointerDownCapture:ws,children:o.jsx(Uy,{catalog:Cs,layout:vs,commands:jn,queries:Ds,disabled:b,menuVisible:P,toolbarVisible:L})}):null,o.jsx("div",{className:Fe.workspace,children:J==="visual"?o.jsx(tx,{ref:R,html:rn(W).body,onChange:u=>q(u,!0),onBeforeInput:As,onPointerDown:Es,onContextMenu:Ps,placeholder:p,disabled:b}):o.jsx(ex,{ref:Z,html:W,onChange:u=>De(u,!0),placeholder:p,disabled:b})}),ce?o.jsx(ox,{onClick:()=>te(!1)}):null,o.jsx($g,{open:Ut.open,tab:Ut.tab,size:Ft.value,unit:Ft.unit,marks:un,fontFamily:It.value,fontFamilyMixed:It.mixed,fontColor:Ht.value,fontColorMixed:Ht.mixed,highlightColor:zt.value,highlightColorMixed:zt.mixed,fonts:Ye,disabled:b,onTabChange:u=>mn({open:!0,tab:u}),onApply:u=>oe.applyFontProperties(u),onClose:()=>mn({open:!1,tab:Ut.tab})}),o.jsx(tb,{open:it.open,tab:it.tab,value:it.value,disabled:b,onTabChange:u=>fn({...it,open:!0,tab:u}),onApply:u=>oe.applyParagraphProperties(u),onClose:()=>fn({...it,open:!1})}),o.jsx(ab,{open:at.open,tab:at.tab,value:at.value,fonts:Ye,disabled:b,onTabChange:u=>pn({...at,open:!0,tab:u}),onApply:u=>oe.applyPageProperties(u),onClose:()=>pn({...at,open:!1})}),o.jsx(cb,{open:pe.open,mode:pe.open?pe.mode:"create",styleId:pe.open&&pe.mode==="edit"?pe.style.id:void 0,name:pe.open&&pe.mode==="edit"?pe.style.name:"",font:pe.open?pe.mode==="edit"?pe.style.font:pe.font:{size:null,unit:ut,marks:$e(),fontFamily:null,fontColor:null,highlightColor:null},paragraph:pe.open?pe.mode==="edit"?pe.style.paragraph:pe.paragraph:void 0,canDelete:!!E,fonts:Ye,busy:ys,disabled:b,onSave:async u=>{const f=Si.current;if(f){hn(!0);try{await f(u),Wt({open:!1}),await Dn()}finally{hn(!1)}}},onDelete:async u=>{const f=ki.current;if(f){hn(!0);try{await f(u),Wt({open:!1}),await Dn()}finally{hn(!1)}}},onClose:()=>Wt({open:!1})}),o.jsx(Hb,{open:ke.open,tab:ke.tab,href:ke.href,title:ke.title,targetBlank:ke.targetBlank,textDecorationNone:ke.textDecorationNone,hoverMode:ke.hoverMode,hoverColor:ke.hoverColor,hoverHtml:ke.hoverHtml,bookmarks:ke.bookmarks,selectedBookmarkId:ke.selectedBookmarkId,disabled:b,onTabChange:u=>gn({...ke,open:!0,tab:u}),onApply:u=>oe.applyLink(u),onClose:()=>gn({...ke,open:!1})}),o.jsx(db,{open:Dr.open,existingIds:Dr.existingIds,disabled:b,onApply:u=>oe.applyBookmark(u),onClose:()=>Ar({...Dr,open:!1})}),o.jsx(pb,{open:xs.open,disabled:b,customImagePicker:_,onApply:u=>oe.applyImage(u),onCustomPick:()=>{bn({open:!1}),_==null||_.onPick(qr)},onClose:()=>bn({open:!1})}),o.jsx(Lb,{open:yn.open,tab:yn.tab,value:yn.value,aspectRatio:yn.aspectRatio,disabled:b,onTabChange:u=>xn(f=>({...f,tab:u})),onApply:u=>oe.applyImageProperties(u),onClose:()=>xn(u=>({...u,open:!1}))}),o.jsx(Wb,{open:Pr.open,disabled:b,onApply:u=>oe.applyTable(u),onClose:()=>Er({open:!1})}),o.jsx(Yb,{open:wn.open,value:wn.value,disabled:b,onApply:u=>oe.applyTableProperties(u),onClose:()=>jr(u=>({...u,open:!1}))}),o.jsx(ey,{open:Sn.open,value:Sn.value,disabled:b,onApply:u=>oe.applyCellProperties(u),onClose:()=>Nr(u=>({...u,open:!1}))}),o.jsx(oy,{open:kn.open,value:kn.value,disabled:b,onApply:u=>oe.applyRowProperties(u),onClose:()=>Lr(u=>({...u,open:!1}))}),J==="visual"&&!b&&(he!=null&&he.isConnected)?o.jsx(Bb,{img:he,onResize:Ss,onResizeEnd:ks}):null,o.jsx(Cc,{open:qt.open,x:qt.x,y:qt.y,kind:qt.kind,inTable:qt.inTable,commands:jn,onClose:()=>Tr(u=>({...u,open:!1}))})]})})}function rx({toolbarBackground:e,menuColor:t,menuBackground:n,menuFontSize:r,menuFontFamily:i,border:a}){const l={};return e&&(l["--wysiwyg-toolbar-background"]=e),t&&(l["--wysiwyg-menu-color"]=t),n&&(l["--wysiwyg-menu-background"]=n),r&&(l["--wysiwyg-menu-font-size"]=r),i&&(l["--wysiwyg-menu-font-family"]=i),a==="none"?(l["--wysiwyg-border-width"]="0",l["--wysiwyg-border-radius"]="0",l["--wysiwyg-border-shadow"]="none"):a&&(a.width&&(l["--wysiwyg-border-width"]=a.width),a.color&&(l["--wysiwyg-border-color"]=a.color),a.radius&&(l["--wysiwyg-border-radius"]=a.radius),a.shadow&&(l["--wysiwyg-border-shadow"]=a.shadow)),Object.keys(l).length?l:void 0}function ox({onClick:e}){const t=V();return o.jsx("button",{type:"button",className:Fe.exitFullscreen,"aria-label":t("exitFullscreenAria"),onClick:e,children:o.jsx(He,{className:Fe.exitFullscreenIcon})})}exports.Editor=nx;