@wangeditor-next/editor 6.4.2 → 6.4.3

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 (434) hide show
  1. package/dist/core.d.ts +996 -0
  2. package/dist/core.js +41 -12
  3. package/dist/core.mjs +41 -12
  4. package/dist/css/style.css +7 -7
  5. package/dist/index.d.ts +971 -0
  6. package/dist/index.js +76 -19
  7. package/dist/index.mjs +76 -19
  8. package/dist/upload.d.ts +450 -0
  9. package/dist/upload.js +16 -12
  10. package/dist/upload.mjs +16 -12
  11. package/package.json +20 -21
  12. package/dist/basic-modules/src/constants/icon-svg.d.ts +0 -49
  13. package/dist/basic-modules/src/index.d.ts +0 -9
  14. package/dist/basic-modules/src/locale/en.d.ts +0 -107
  15. package/dist/basic-modules/src/locale/index.d.ts +0 -5
  16. package/dist/basic-modules/src/locale/zh-CN.d.ts +0 -107
  17. package/dist/basic-modules/src/modules/blockquote/custom-types.d.ts +0 -9
  18. package/dist/basic-modules/src/modules/blockquote/elem-to-html.d.ts +0 -11
  19. package/dist/basic-modules/src/modules/blockquote/index.d.ts +0 -7
  20. package/dist/basic-modules/src/modules/blockquote/menu/BlockquoteMenu.d.ts +0 -20
  21. package/dist/basic-modules/src/modules/blockquote/menu/index.d.ts +0 -9
  22. package/dist/basic-modules/src/modules/blockquote/parse-elem-html.d.ts +0 -14
  23. package/dist/basic-modules/src/modules/blockquote/plugin.d.ts +0 -7
  24. package/dist/basic-modules/src/modules/blockquote/render-elem.d.ts +0 -20
  25. package/dist/basic-modules/src/modules/code-block/custom-types.d.ts +0 -17
  26. package/dist/basic-modules/src/modules/code-block/elem-to-html.d.ts +0 -16
  27. package/dist/basic-modules/src/modules/code-block/index.d.ts +0 -7
  28. package/dist/basic-modules/src/modules/code-block/menu/CodeBlockMenu.d.ts +0 -23
  29. package/dist/basic-modules/src/modules/code-block/menu/index.d.ts +0 -12
  30. package/dist/basic-modules/src/modules/code-block/parse-elem-html.d.ts +0 -19
  31. package/dist/basic-modules/src/modules/code-block/plugin.d.ts +0 -7
  32. package/dist/basic-modules/src/modules/code-block/pre-parse-html.d.ts +0 -15
  33. package/dist/basic-modules/src/modules/code-block/render-elem.d.ts +0 -18
  34. package/dist/basic-modules/src/modules/color/custom-types.d.ts +0 -9
  35. package/dist/basic-modules/src/modules/color/index.d.ts +0 -7
  36. package/dist/basic-modules/src/modules/color/menu/BaseMenu.d.ts +0 -20
  37. package/dist/basic-modules/src/modules/color/menu/BgColorMenu.d.ts +0 -11
  38. package/dist/basic-modules/src/modules/color/menu/ColorMenu.d.ts +0 -11
  39. package/dist/basic-modules/src/modules/color/menu/config.d.ts +0 -6
  40. package/dist/basic-modules/src/modules/color/menu/index.d.ts +0 -20
  41. package/dist/basic-modules/src/modules/color/parse-style-html.d.ts +0 -8
  42. package/dist/basic-modules/src/modules/color/pre-parse-html.d.ts +0 -15
  43. package/dist/basic-modules/src/modules/color/render-style.d.ts +0 -15
  44. package/dist/basic-modules/src/modules/color/style-to-html.d.ts +0 -14
  45. package/dist/basic-modules/src/modules/common/index.d.ts +0 -7
  46. package/dist/basic-modules/src/modules/common/menu/EnterMenu.d.ts +0 -15
  47. package/dist/basic-modules/src/modules/common/menu/index.d.ts +0 -9
  48. package/dist/basic-modules/src/modules/divider/custom-types.d.ts +0 -12
  49. package/dist/basic-modules/src/modules/divider/elem-to-html.d.ts +0 -11
  50. package/dist/basic-modules/src/modules/divider/index.d.ts +0 -7
  51. package/dist/basic-modules/src/modules/divider/menu/InsertDividerMenu.d.ts +0 -15
  52. package/dist/basic-modules/src/modules/divider/menu/index.d.ts +0 -9
  53. package/dist/basic-modules/src/modules/divider/parse-elem-html.d.ts +0 -14
  54. package/dist/basic-modules/src/modules/divider/plugin.d.ts +0 -7
  55. package/dist/basic-modules/src/modules/divider/render-elem.d.ts +0 -13
  56. package/dist/basic-modules/src/modules/emotion/index.d.ts +0 -7
  57. package/dist/basic-modules/src/modules/emotion/menu/EmotionMenu.d.ts +0 -19
  58. package/dist/basic-modules/src/modules/emotion/menu/config.d.ts +0 -5
  59. package/dist/basic-modules/src/modules/emotion/menu/index.d.ts +0 -12
  60. package/dist/basic-modules/src/modules/font-size-family/custom-types.d.ts +0 -9
  61. package/dist/basic-modules/src/modules/font-size-family/index.d.ts +0 -7
  62. package/dist/basic-modules/src/modules/font-size-family/menu/BaseMenu.d.ts +0 -18
  63. package/dist/basic-modules/src/modules/font-size-family/menu/FontFamilyMenu.d.ts +0 -14
  64. package/dist/basic-modules/src/modules/font-size-family/menu/FontSizeMenu.d.ts +0 -13
  65. package/dist/basic-modules/src/modules/font-size-family/menu/config.d.ts +0 -12
  66. package/dist/basic-modules/src/modules/font-size-family/menu/index.d.ts +0 -26
  67. package/dist/basic-modules/src/modules/font-size-family/parse-style-html.d.ts +0 -8
  68. package/dist/basic-modules/src/modules/font-size-family/pre-parse-html.d.ts +0 -15
  69. package/dist/basic-modules/src/modules/font-size-family/render-style.d.ts +0 -15
  70. package/dist/basic-modules/src/modules/font-size-family/style-to-html.d.ts +0 -14
  71. package/dist/basic-modules/src/modules/format-painter/helper.d.ts +0 -3
  72. package/dist/basic-modules/src/modules/format-painter/index.d.ts +0 -7
  73. package/dist/basic-modules/src/modules/format-painter/menu/FormatPainter.d.ts +0 -37
  74. package/dist/basic-modules/src/modules/format-painter/menu/index.d.ts +0 -9
  75. package/dist/basic-modules/src/modules/format-painter/plugin.d.ts +0 -7
  76. package/dist/basic-modules/src/modules/full-screen/index.d.ts +0 -7
  77. package/dist/basic-modules/src/modules/full-screen/menu/FullScreen.d.ts +0 -18
  78. package/dist/basic-modules/src/modules/full-screen/menu/index.d.ts +0 -9
  79. package/dist/basic-modules/src/modules/header/custom-types.d.ts +0 -29
  80. package/dist/basic-modules/src/modules/header/elem-to-html.d.ts +0 -29
  81. package/dist/basic-modules/src/modules/header/helper.d.ts +0 -14
  82. package/dist/basic-modules/src/modules/header/index.d.ts +0 -7
  83. package/dist/basic-modules/src/modules/header/menu/Header1ButtonMenu.d.ts +0 -10
  84. package/dist/basic-modules/src/modules/header/menu/Header2ButtonMenu.d.ts +0 -10
  85. package/dist/basic-modules/src/modules/header/menu/Header3ButtonMenu.d.ts +0 -10
  86. package/dist/basic-modules/src/modules/header/menu/Header4ButtonMenu.d.ts +0 -10
  87. package/dist/basic-modules/src/modules/header/menu/Header5ButtonMenu.d.ts +0 -10
  88. package/dist/basic-modules/src/modules/header/menu/Header6ButtonMenu.d.ts +0 -10
  89. package/dist/basic-modules/src/modules/header/menu/HeaderButtonMenuBase.d.ts +0 -19
  90. package/dist/basic-modules/src/modules/header/menu/HeaderSelectMenu.d.ts +0 -26
  91. package/dist/basic-modules/src/modules/header/menu/index.d.ts +0 -39
  92. package/dist/basic-modules/src/modules/header/parse-elem-html.d.ts +0 -32
  93. package/dist/basic-modules/src/modules/header/plugin.d.ts +0 -7
  94. package/dist/basic-modules/src/modules/header/render-elem.d.ts +0 -32
  95. package/dist/basic-modules/src/modules/image/custom-types.d.ts +0 -22
  96. package/dist/basic-modules/src/modules/image/elem-to-html.d.ts +0 -12
  97. package/dist/basic-modules/src/modules/image/helper.d.ts +0 -13
  98. package/dist/basic-modules/src/modules/image/index.d.ts +0 -7
  99. package/dist/basic-modules/src/modules/image/menu/DeleteImage.d.ts +0 -15
  100. package/dist/basic-modules/src/modules/image/menu/EditImage.d.ts +0 -28
  101. package/dist/basic-modules/src/modules/image/menu/EditImageSizeMenu.d.ts +0 -25
  102. package/dist/basic-modules/src/modules/image/menu/InsertImage.d.ts +0 -27
  103. package/dist/basic-modules/src/modules/image/menu/PreviewImage.d.ts +0 -14
  104. package/dist/basic-modules/src/modules/image/menu/ViewImageLink.d.ts +0 -15
  105. package/dist/basic-modules/src/modules/image/menu/Width100.d.ts +0 -10
  106. package/dist/basic-modules/src/modules/image/menu/Width30.d.ts +0 -10
  107. package/dist/basic-modules/src/modules/image/menu/Width50.d.ts +0 -10
  108. package/dist/basic-modules/src/modules/image/menu/WidthBase.d.ts +0 -17
  109. package/dist/basic-modules/src/modules/image/menu/config.d.ts +0 -30
  110. package/dist/basic-modules/src/modules/image/menu/index.d.ts +0 -61
  111. package/dist/basic-modules/src/modules/image/parse-elem-html.d.ts +0 -14
  112. package/dist/basic-modules/src/modules/image/plugin.d.ts +0 -7
  113. package/dist/basic-modules/src/modules/image/render-elem.d.ts +0 -13
  114. package/dist/basic-modules/src/modules/image/resize.d.ts +0 -14
  115. package/dist/basic-modules/src/modules/indent/custom-types.d.ts +0 -10
  116. package/dist/basic-modules/src/modules/indent/index.d.ts +0 -7
  117. package/dist/basic-modules/src/modules/indent/is-indent-target.d.ts +0 -4
  118. package/dist/basic-modules/src/modules/indent/menu/BaseMenu.d.ts +0 -25
  119. package/dist/basic-modules/src/modules/indent/menu/DecreaseIndentMenu.d.ts +0 -13
  120. package/dist/basic-modules/src/modules/indent/menu/IncreaseIndentMenu.d.ts +0 -15
  121. package/dist/basic-modules/src/modules/indent/menu/index.d.ts +0 -14
  122. package/dist/basic-modules/src/modules/indent/parse-style-html.d.ts +0 -8
  123. package/dist/basic-modules/src/modules/indent/pre-parse-html.d.ts +0 -15
  124. package/dist/basic-modules/src/modules/indent/render-style.d.ts +0 -15
  125. package/dist/basic-modules/src/modules/indent/style-to-html.d.ts +0 -7
  126. package/dist/basic-modules/src/modules/justify/custom-types.d.ts +0 -10
  127. package/dist/basic-modules/src/modules/justify/index.d.ts +0 -7
  128. package/dist/basic-modules/src/modules/justify/menu/BaseMenu.d.ts +0 -15
  129. package/dist/basic-modules/src/modules/justify/menu/JustifyCenterMenu.d.ts +0 -12
  130. package/dist/basic-modules/src/modules/justify/menu/JustifyJustifyMenu.d.ts +0 -12
  131. package/dist/basic-modules/src/modules/justify/menu/JustifyLeftMenu.d.ts +0 -12
  132. package/dist/basic-modules/src/modules/justify/menu/JustifyRightMenu.d.ts +0 -12
  133. package/dist/basic-modules/src/modules/justify/menu/index.d.ts +0 -24
  134. package/dist/basic-modules/src/modules/justify/parse-style-html.d.ts +0 -8
  135. package/dist/basic-modules/src/modules/justify/render-style.d.ts +0 -15
  136. package/dist/basic-modules/src/modules/justify/style-to-html.d.ts +0 -7
  137. package/dist/basic-modules/src/modules/line-height/custom-types.d.ts +0 -10
  138. package/dist/basic-modules/src/modules/line-height/index.d.ts +0 -7
  139. package/dist/basic-modules/src/modules/line-height/menu/LineHeightMenu.d.ts +0 -26
  140. package/dist/basic-modules/src/modules/line-height/menu/config.d.ts +0 -5
  141. package/dist/basic-modules/src/modules/line-height/menu/index.d.ts +0 -12
  142. package/dist/basic-modules/src/modules/line-height/parse-style-html.d.ts +0 -8
  143. package/dist/basic-modules/src/modules/line-height/render-style.d.ts +0 -15
  144. package/dist/basic-modules/src/modules/line-height/style-to-html.d.ts +0 -7
  145. package/dist/basic-modules/src/modules/link/custom-types.d.ts +0 -11
  146. package/dist/basic-modules/src/modules/link/elem-to-html.d.ts +0 -11
  147. package/dist/basic-modules/src/modules/link/helper.d.ts +0 -20
  148. package/dist/basic-modules/src/modules/link/index.d.ts +0 -7
  149. package/dist/basic-modules/src/modules/link/menu/EditLink.d.ts +0 -30
  150. package/dist/basic-modules/src/modules/link/menu/InsertLink.d.ts +0 -25
  151. package/dist/basic-modules/src/modules/link/menu/UnLink.d.ts +0 -15
  152. package/dist/basic-modules/src/modules/link/menu/ViewLink.d.ts +0 -16
  153. package/dist/basic-modules/src/modules/link/menu/config.d.ts +0 -18
  154. package/dist/basic-modules/src/modules/link/menu/index.d.ts +0 -33
  155. package/dist/basic-modules/src/modules/link/parse-elem-html.d.ts +0 -15
  156. package/dist/basic-modules/src/modules/link/plugin.d.ts +0 -7
  157. package/dist/basic-modules/src/modules/link/render-elem.d.ts +0 -20
  158. package/dist/basic-modules/src/modules/link/url.d.ts +0 -10
  159. package/dist/basic-modules/src/modules/paragraph/custom-types.d.ts +0 -9
  160. package/dist/basic-modules/src/modules/paragraph/elem-to-html.d.ts +0 -11
  161. package/dist/basic-modules/src/modules/paragraph/index.d.ts +0 -7
  162. package/dist/basic-modules/src/modules/paragraph/parse-elem-html.d.ts +0 -14
  163. package/dist/basic-modules/src/modules/paragraph/plugin.d.ts +0 -7
  164. package/dist/basic-modules/src/modules/paragraph/render-elem.d.ts +0 -20
  165. package/dist/basic-modules/src/modules/text-style/custom-types.d.ts +0 -16
  166. package/dist/basic-modules/src/modules/text-style/helper.d.ts +0 -8
  167. package/dist/basic-modules/src/modules/text-style/index.d.ts +0 -7
  168. package/dist/basic-modules/src/modules/text-style/menu/BaseMenu.d.ts +0 -27
  169. package/dist/basic-modules/src/modules/text-style/menu/BoldMenu.d.ts +0 -12
  170. package/dist/basic-modules/src/modules/text-style/menu/ClearStyleMenu.d.ts +0 -20
  171. package/dist/basic-modules/src/modules/text-style/menu/CodeMenu.d.ts +0 -12
  172. package/dist/basic-modules/src/modules/text-style/menu/EmphasisDotMenu.d.ts +0 -11
  173. package/dist/basic-modules/src/modules/text-style/menu/ItalicMenu.d.ts +0 -12
  174. package/dist/basic-modules/src/modules/text-style/menu/SubMenu.d.ts +0 -13
  175. package/dist/basic-modules/src/modules/text-style/menu/SupMenu.d.ts +0 -13
  176. package/dist/basic-modules/src/modules/text-style/menu/ThroughMenu.d.ts +0 -12
  177. package/dist/basic-modules/src/modules/text-style/menu/UnderlineMenu.d.ts +0 -12
  178. package/dist/basic-modules/src/modules/text-style/menu/WavyUnderlineMenu.d.ts +0 -11
  179. package/dist/basic-modules/src/modules/text-style/menu/index.d.ts +0 -54
  180. package/dist/basic-modules/src/modules/text-style/parse-style-html.d.ts +0 -8
  181. package/dist/basic-modules/src/modules/text-style/render-style.d.ts +0 -14
  182. package/dist/basic-modules/src/modules/text-style/style-constants.d.ts +0 -35
  183. package/dist/basic-modules/src/modules/text-style/style-to-html.d.ts +0 -13
  184. package/dist/basic-modules/src/modules/todo/custom-types.d.ts +0 -10
  185. package/dist/basic-modules/src/modules/todo/elem-to-html.d.ts +0 -11
  186. package/dist/basic-modules/src/modules/todo/index.d.ts +0 -7
  187. package/dist/basic-modules/src/modules/todo/menu/Todo.d.ts +0 -15
  188. package/dist/basic-modules/src/modules/todo/menu/index.d.ts +0 -9
  189. package/dist/basic-modules/src/modules/todo/parse-elem-html.d.ts +0 -14
  190. package/dist/basic-modules/src/modules/todo/plugin.d.ts +0 -7
  191. package/dist/basic-modules/src/modules/todo/pre-parse-html.d.ts +0 -15
  192. package/dist/basic-modules/src/modules/todo/render-elem.d.ts +0 -20
  193. package/dist/basic-modules/src/modules/undo-redo/index.d.ts +0 -7
  194. package/dist/basic-modules/src/modules/undo-redo/menu/RedoMenu.d.ts +0 -15
  195. package/dist/basic-modules/src/modules/undo-redo/menu/UndoMenu.d.ts +0 -15
  196. package/dist/basic-modules/src/modules/undo-redo/menu/index.d.ts +0 -14
  197. package/dist/basic-modules/src/utils/dom.d.ts +0 -36
  198. package/dist/basic-modules/src/utils/style-class.d.ts +0 -14
  199. package/dist/basic-modules/src/utils/util.d.ts +0 -11
  200. package/dist/basic-modules/src/utils/vdom.d.ts +0 -25
  201. package/dist/code-highlight/src/constants/svg.d.ts +0 -10
  202. package/dist/code-highlight/src/custom-types.d.ts +0 -17
  203. package/dist/code-highlight/src/decorate/index.d.ts +0 -7
  204. package/dist/code-highlight/src/index.d.ts +0 -9
  205. package/dist/code-highlight/src/locale/en.d.ts +0 -10
  206. package/dist/code-highlight/src/locale/index.d.ts +0 -5
  207. package/dist/code-highlight/src/locale/zh-CN.d.ts +0 -10
  208. package/dist/code-highlight/src/module/elem-to-html.d.ts +0 -11
  209. package/dist/code-highlight/src/module/index.d.ts +0 -7
  210. package/dist/code-highlight/src/module/menu/SelectLangMenu.d.ts +0 -24
  211. package/dist/code-highlight/src/module/menu/config.d.ts +0 -8
  212. package/dist/code-highlight/src/module/menu/index.d.ts +0 -15
  213. package/dist/code-highlight/src/module/parse-style-html.d.ts +0 -8
  214. package/dist/code-highlight/src/module/render-style.d.ts +0 -13
  215. package/dist/code-highlight/src/utils/dom.d.ts +0 -15
  216. package/dist/code-highlight/src/utils/vdom.d.ts +0 -11
  217. package/dist/code-highlight/src/vendor/prism.d.ts +0 -37
  218. package/dist/core/src/config/index.d.ts +0 -13
  219. package/dist/core/src/config/interface.d.ts +0 -339
  220. package/dist/core/src/config/register.d.ts +0 -12
  221. package/dist/core/src/config/style-mode.d.ts +0 -8
  222. package/dist/core/src/constants/index.d.ts +0 -1
  223. package/dist/core/src/constants/svg.d.ts +0 -12
  224. package/dist/core/src/create/bind-node-relation.d.ts +0 -15
  225. package/dist/core/src/create/create-editor.d.ts +0 -10
  226. package/dist/core/src/create/create-toolbar.d.ts +0 -14
  227. package/dist/core/src/create/helper.d.ts +0 -37
  228. package/dist/core/src/create/index.d.ts +0 -8
  229. package/dist/core/src/editor/dom-editor.d.ts +0 -154
  230. package/dist/core/src/editor/interface.d.ts +0 -90
  231. package/dist/core/src/editor/plugins/with-config.d.ts +0 -7
  232. package/dist/core/src/editor/plugins/with-content.d.ts +0 -7
  233. package/dist/core/src/editor/plugins/with-dom.d.ts +0 -10
  234. package/dist/core/src/editor/plugins/with-emitter.d.ts +0 -7
  235. package/dist/core/src/editor/plugins/with-event-data.d.ts +0 -7
  236. package/dist/core/src/editor/plugins/with-history.d.ts +0 -7
  237. package/dist/core/src/editor/plugins/with-max-length.d.ts +0 -7
  238. package/dist/core/src/editor/plugins/with-selection.d.ts +0 -7
  239. package/dist/core/src/i18n/index.d.ts +0 -32
  240. package/dist/core/src/index.d.ts +0 -45
  241. package/dist/core/src/menus/bar/HoverBar.d.ts +0 -48
  242. package/dist/core/src/menus/bar/Toolbar.d.ts +0 -38
  243. package/dist/core/src/menus/bar-item/BaseButton.d.ts +0 -26
  244. package/dist/core/src/menus/bar-item/DropPanelButton.d.ts +0 -14
  245. package/dist/core/src/menus/bar-item/GroupButton.d.ts +0 -17
  246. package/dist/core/src/menus/bar-item/ModalButton.d.ts +0 -25
  247. package/dist/core/src/menus/bar-item/Select.d.ts +0 -22
  248. package/dist/core/src/menus/bar-item/SimpleButton.d.ts +0 -11
  249. package/dist/core/src/menus/bar-item/index.d.ts +0 -24
  250. package/dist/core/src/menus/bar-item/tooltip.d.ts +0 -6
  251. package/dist/core/src/menus/helpers/helpers.d.ts +0 -18
  252. package/dist/core/src/menus/helpers/position.d.ts +0 -36
  253. package/dist/core/src/menus/index.d.ts +0 -9
  254. package/dist/core/src/menus/interface.d.ts +0 -65
  255. package/dist/core/src/menus/panel-and-modal/BaseClass.d.ts +0 -26
  256. package/dist/core/src/menus/panel-and-modal/DropPanel.d.ts +0 -12
  257. package/dist/core/src/menus/panel-and-modal/Modal.d.ts +0 -44
  258. package/dist/core/src/menus/panel-and-modal/SelectList.d.ts +0 -20
  259. package/dist/core/src/menus/register.d.ts +0 -15
  260. package/dist/core/src/parse-html/helper.d.ts +0 -10
  261. package/dist/core/src/parse-html/index.d.ts +0 -35
  262. package/dist/core/src/parse-html/parse-common-elem-html.d.ts +0 -15
  263. package/dist/core/src/parse-html/parse-elem-html.d.ts +0 -15
  264. package/dist/core/src/parse-html/parse-text-elem-html.d.ts +0 -16
  265. package/dist/core/src/render/element/getRenderElem.d.ts +0 -11
  266. package/dist/core/src/render/element/renderElement.d.ts +0 -9
  267. package/dist/core/src/render/element/renderStyle.d.ts +0 -15
  268. package/dist/core/src/render/helper.d.ts +0 -6
  269. package/dist/core/src/render/index.d.ts +0 -27
  270. package/dist/core/src/render/node2Vnode.d.ts +0 -15
  271. package/dist/core/src/render/text/genVnode.d.ts +0 -9
  272. package/dist/core/src/render/text/renderStyle.d.ts +0 -15
  273. package/dist/core/src/render/text/renderText.d.ts +0 -9
  274. package/dist/core/src/text-area/TextArea.d.ts +0 -52
  275. package/dist/core/src/text-area/event-handlers/beforeInput.d.ts +0 -8
  276. package/dist/core/src/text-area/event-handlers/blur.d.ts +0 -8
  277. package/dist/core/src/text-area/event-handlers/click.d.ts +0 -8
  278. package/dist/core/src/text-area/event-handlers/composition.d.ts +0 -27
  279. package/dist/core/src/text-area/event-handlers/copy.d.ts +0 -8
  280. package/dist/core/src/text-area/event-handlers/cut.d.ts +0 -8
  281. package/dist/core/src/text-area/event-handlers/drag.d.ts +0 -9
  282. package/dist/core/src/text-area/event-handlers/drop.d.ts +0 -8
  283. package/dist/core/src/text-area/event-handlers/focus.d.ts +0 -8
  284. package/dist/core/src/text-area/event-handlers/index.d.ts +0 -35
  285. package/dist/core/src/text-area/event-handlers/keydown.d.ts +0 -8
  286. package/dist/core/src/text-area/event-handlers/keypress.d.ts +0 -8
  287. package/dist/core/src/text-area/event-handlers/paste.d.ts +0 -8
  288. package/dist/core/src/text-area/helpers.d.ts +0 -30
  289. package/dist/core/src/text-area/place-holder.d.ts +0 -18
  290. package/dist/core/src/text-area/syncSelection.d.ts +0 -19
  291. package/dist/core/src/text-area/update-view.d.ts +0 -13
  292. package/dist/core/src/to-html/elem2html.d.ts +0 -9
  293. package/dist/core/src/to-html/index.d.ts +0 -44
  294. package/dist/core/src/to-html/node2html.d.ts +0 -12
  295. package/dist/core/src/to-html/text2html.d.ts +0 -9
  296. package/dist/core/src/upload/createUploader.d.ts +0 -14
  297. package/dist/core/src/upload/createUppyUploader.d.ts +0 -7
  298. package/dist/core/src/upload/index.d.ts +0 -9
  299. package/dist/core/src/upload/interface.d.ts +0 -72
  300. package/dist/core/src/upload.d.ts +0 -5
  301. package/dist/core/src/utils/dom.d.ts +0 -103
  302. package/dist/core/src/utils/hotkeys.d.ts +0 -35
  303. package/dist/core/src/utils/key.d.ts +0 -11
  304. package/dist/core/src/utils/line.d.ts +0 -14
  305. package/dist/core/src/utils/sanitize-html.d.ts +0 -5
  306. package/dist/core/src/utils/ua.d.ts +0 -14
  307. package/dist/core/src/utils/util.d.ts +0 -28
  308. package/dist/core/src/utils/vdom.d.ts +0 -34
  309. package/dist/core/src/utils/weak-maps.d.ts +0 -60
  310. package/dist/editor/src/Boot.d.ts +0 -31
  311. package/dist/editor/src/constants/svg.d.ts +0 -14
  312. package/dist/editor/src/core.d.ts +0 -54
  313. package/dist/editor/src/create.d.ts +0 -29
  314. package/dist/editor/src/index.d.ts +0 -27
  315. package/dist/editor/src/init-default-config/config/hoverbar.d.ts +0 -47
  316. package/dist/editor/src/init-default-config/config/index.d.ts +0 -67
  317. package/dist/editor/src/init-default-config/config/toolbar.d.ts +0 -16
  318. package/dist/editor/src/init-default-config/index.d.ts +0 -5
  319. package/dist/editor/src/locale/en.d.ts +0 -14
  320. package/dist/editor/src/locale/index.d.ts +0 -5
  321. package/dist/editor/src/locale/zh-CN.d.ts +0 -14
  322. package/dist/editor/src/register-builtin-modules/index.d.ts +0 -5
  323. package/dist/editor/src/register-builtin-modules/register.d.ts +0 -7
  324. package/dist/editor/src/upload.d.ts +0 -6
  325. package/dist/editor/src/utils/browser-polyfill.d.ts +0 -6
  326. package/dist/editor/src/utils/dom.d.ts +0 -6
  327. package/dist/editor/src/utils/node-polyfill.d.ts +0 -4
  328. package/dist/list-module/src/constants/svg.d.ts +0 -11
  329. package/dist/list-module/src/index.d.ts +0 -8
  330. package/dist/list-module/src/locale/en.d.ts +0 -15
  331. package/dist/list-module/src/locale/index.d.ts +0 -5
  332. package/dist/list-module/src/locale/zh-CN.d.ts +0 -15
  333. package/dist/list-module/src/module/custom-types.d.ts +0 -27
  334. package/dist/list-module/src/module/elem-to-html.d.ts +0 -16
  335. package/dist/list-module/src/module/helpers.d.ts +0 -26
  336. package/dist/list-module/src/module/html-transform.d.ts +0 -10
  337. package/dist/list-module/src/module/index.d.ts +0 -7
  338. package/dist/list-module/src/module/menu/BaseMenu.d.ts +0 -20
  339. package/dist/list-module/src/module/menu/BulletedListMenu.d.ts +0 -11
  340. package/dist/list-module/src/module/menu/LowerAlphaListMenu.d.ts +0 -13
  341. package/dist/list-module/src/module/menu/NumberedListMenu.d.ts +0 -11
  342. package/dist/list-module/src/module/menu/index.d.ts +0 -19
  343. package/dist/list-module/src/module/outline-actions.d.ts +0 -9
  344. package/dist/list-module/src/module/parse-elem-html.d.ts +0 -18
  345. package/dist/list-module/src/module/plugin.d.ts +0 -7
  346. package/dist/list-module/src/module/render-elem.d.ts +0 -13
  347. package/dist/list-module/src/module/style-class.d.ts +0 -6
  348. package/dist/list-module/src/utils/dom.d.ts +0 -19
  349. package/dist/list-module/src/utils/maps.d.ts +0 -7
  350. package/dist/list-module/src/utils/util.d.ts +0 -6
  351. package/dist/table-module/src/constants/svg.d.ts +0 -26
  352. package/dist/table-module/src/index.d.ts +0 -8
  353. package/dist/table-module/src/locale/en.d.ts +0 -56
  354. package/dist/table-module/src/locale/index.d.ts +0 -5
  355. package/dist/table-module/src/locale/zh-CN.d.ts +0 -56
  356. package/dist/table-module/src/module/cell-selection.d.ts +0 -11
  357. package/dist/table-module/src/module/column-resize.d.ts +0 -20
  358. package/dist/table-module/src/module/custom-types.d.ts +0 -48
  359. package/dist/table-module/src/module/elem-to-html.d.ts +0 -22
  360. package/dist/table-module/src/module/helpers.d.ts +0 -37
  361. package/dist/table-module/src/module/index.d.ts +0 -7
  362. package/dist/table-module/src/module/menu/CellProperty.d.ts +0 -14
  363. package/dist/table-module/src/module/menu/DeleteCol.d.ts +0 -15
  364. package/dist/table-module/src/module/menu/DeleteRow.d.ts +0 -15
  365. package/dist/table-module/src/module/menu/DeleteTable.d.ts +0 -15
  366. package/dist/table-module/src/module/menu/FullWidth.d.ts +0 -15
  367. package/dist/table-module/src/module/menu/InsertCol.d.ts +0 -15
  368. package/dist/table-module/src/module/menu/InsertRow.d.ts +0 -15
  369. package/dist/table-module/src/module/menu/InsertTable.d.ts +0 -24
  370. package/dist/table-module/src/module/menu/MergeCell.d.ts +0 -24
  371. package/dist/table-module/src/module/menu/SplitCell.d.ts +0 -24
  372. package/dist/table-module/src/module/menu/TableHeader.d.ts +0 -15
  373. package/dist/table-module/src/module/menu/TableProperty.d.ts +0 -49
  374. package/dist/table-module/src/module/menu/index.d.ts +0 -77
  375. package/dist/table-module/src/module/parse-elem-html.d.ts +0 -24
  376. package/dist/table-module/src/module/parse-style-html.d.ts +0 -8
  377. package/dist/table-module/src/module/plugin.d.ts +0 -7
  378. package/dist/table-module/src/module/pre-parse-html.d.ts +0 -15
  379. package/dist/table-module/src/module/render-elem/index.d.ts +0 -19
  380. package/dist/table-module/src/module/render-elem/render-cell.d.ts +0 -9
  381. package/dist/table-module/src/module/render-elem/render-row.d.ts +0 -9
  382. package/dist/table-module/src/module/render-elem/render-table.d.ts +0 -9
  383. package/dist/table-module/src/module/render-elem/selection-overlay.d.ts +0 -21
  384. package/dist/table-module/src/module/render-style.d.ts +0 -9
  385. package/dist/table-module/src/module/row-resize.d.ts +0 -15
  386. package/dist/table-module/src/module/style-to-html.d.ts +0 -6
  387. package/dist/table-module/src/module/table-cursor.d.ts +0 -20
  388. package/dist/table-module/src/module/weak-maps.d.ts +0 -6
  389. package/dist/table-module/src/module/with-selection.d.ts +0 -2
  390. package/dist/table-module/src/utils/dom.d.ts +0 -31
  391. package/dist/table-module/src/utils/has-common.d.ts +0 -7
  392. package/dist/table-module/src/utils/index.d.ts +0 -5
  393. package/dist/table-module/src/utils/is-of-type.d.ts +0 -6
  394. package/dist/table-module/src/utils/matrices.d.ts +0 -9
  395. package/dist/table-module/src/utils/options.d.ts +0 -16
  396. package/dist/table-module/src/utils/point.d.ts +0 -7
  397. package/dist/table-module/src/utils/types.d.ts +0 -19
  398. package/dist/table-module/src/utils/vdom.d.ts +0 -11
  399. package/dist/upload-image-module/src/constants/svg.d.ts +0 -10
  400. package/dist/upload-image-module/src/index.d.ts +0 -8
  401. package/dist/upload-image-module/src/locale/en.d.ts +0 -11
  402. package/dist/upload-image-module/src/locale/index.d.ts +0 -5
  403. package/dist/upload-image-module/src/locale/zh-CN.d.ts +0 -11
  404. package/dist/upload-image-module/src/module/index.d.ts +0 -7
  405. package/dist/upload-image-module/src/module/menu/UploadImageMenu.d.ts +0 -16
  406. package/dist/upload-image-module/src/module/menu/config.d.ts +0 -6
  407. package/dist/upload-image-module/src/module/menu/index.d.ts +0 -10
  408. package/dist/upload-image-module/src/module/plugin.d.ts +0 -7
  409. package/dist/upload-image-module/src/module/upload-images.d.ts +0 -11
  410. package/dist/upload-image-module/src/utils/dom.d.ts +0 -7
  411. package/dist/video-module/src/constants/svg.d.ts +0 -15
  412. package/dist/video-module/src/index.d.ts +0 -8
  413. package/dist/video-module/src/locale/en.d.ts +0 -24
  414. package/dist/video-module/src/locale/index.d.ts +0 -5
  415. package/dist/video-module/src/locale/zh-CN.d.ts +0 -24
  416. package/dist/video-module/src/module/alignment.d.ts +0 -10
  417. package/dist/video-module/src/module/custom-types.d.ts +0 -24
  418. package/dist/video-module/src/module/elem-to-html.d.ts +0 -12
  419. package/dist/video-module/src/module/helper/insert-video.d.ts +0 -12
  420. package/dist/video-module/src/module/helper/upload-videos.d.ts +0 -6
  421. package/dist/video-module/src/module/index.d.ts +0 -7
  422. package/dist/video-module/src/module/menu/EditVideoSizeMenu.d.ts +0 -25
  423. package/dist/video-module/src/module/menu/EditVideoSrcMenu.d.ts +0 -26
  424. package/dist/video-module/src/module/menu/InsertVideoMenu.d.ts +0 -25
  425. package/dist/video-module/src/module/menu/UploadVideoMenu.d.ts +0 -16
  426. package/dist/video-module/src/module/menu/VideoAlignMenu.d.ts +0 -18
  427. package/dist/video-module/src/module/menu/config.d.ts +0 -25
  428. package/dist/video-module/src/module/menu/index.d.ts +0 -43
  429. package/dist/video-module/src/module/parse-elem-html.d.ts +0 -14
  430. package/dist/video-module/src/module/plugin.d.ts +0 -7
  431. package/dist/video-module/src/module/pre-parse-html.d.ts +0 -15
  432. package/dist/video-module/src/module/render-elem.d.ts +0 -13
  433. package/dist/video-module/src/utils/dom.d.ts +0 -29
  434. package/dist/video-module/src/utils/util.d.ts +0 -12
package/dist/index.js CHANGED
@@ -1,21 +1,78 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).wangEditor={})}(this,function(e){"use strict";var t;function n(){"undefined"==typeof globalThis&&(window.globalThis=window)}function r(){"undefined"==typeof AggregateError&&(window.AggregateError=function(e,t){var n=new Error(t);return n.errors=e,n})}if("undefined"==typeof global){if("ActiveXObject"in window){console.error("抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器\n Sorry, wangEditor V5+ versions do not support IE browser.")}n(),r()}else global&&(null===(t=global.navigator)||void 0===t?void 0:t.userAgent.match("QQBrowser"))&&(n(),r());if("object"==typeof global){var o=global.crypto&&"function"==typeof global.crypto.getRandomValues?function(e){return global.crypto.getRandomValues.call(global.crypto,e)}:function(e){return e},i=Object.getOwnPropertyDescriptor(global,"window");global.window&&!i.set||(global.window=global,global.requestAnimationFrame=function(){},global.navigator={userAgent:""},global.location={hostname:"0.0.0.0",port:0,protocol:"http:"},global.btoa=function(){},global.crypto={getRandomValues:function(e){return o(e)}}),null!=global.document&&null==global.document.getElementsByTagName&&(global.document.getElementsByTagName=function(){return[]})}var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},a(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},u.apply(this,arguments)};function l(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})}function c(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function d(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function p(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function h(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=d(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,o,(t=e[n](t)).done,t.value)})}}}"function"==typeof SuppressedError&&SuppressedError;var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function m(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var y,b,E,w,C,D={exports:{}},A={};function S(){if(E)return A;E=1,Object.defineProperty(A,"__esModule",{value:!0}),A.justErrorsLogger=A.debugLogger=void 0;const e=function(){if(b)return y;function e(e){return e<10?`0${e}`:e.toString()}return b=1,y=function(){const t=new Date;return`${e(t.getHours())}:${e(t.getMinutes())}:${e(t.getSeconds())}`}}(),t={debug:()=>{},warn:()=>{},error:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return console.error(`[Uppy] [${e()}]`,...n)}};A.justErrorsLogger=t;const n={debug:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return console.debug(`[Uppy] [${e()}]`,...n)},warn:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return console.warn(`[Uppy] [${e()}]`,...n)},error:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return console.error(`[Uppy] [${e()}]`,...n)}};return A.debugLogger=n,A}function x(){if(C)return w;C=1;return w={nanoid:(e=21)=>{let t="",n=0|e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r="",o=0|n;for(;o--;)r+=e[Math.random()*e.length|0];return r}},w}var T,N,O,B,k,F,I,P,R,_,L,M,j,H,z,$,U,V,W,G,q,K,Y,X,Z,J,Q,ee,te,ne,re,oe,ie,ae={};function se(){return N?T:(N=1,T=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,r));var o=n[r];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+o:(t?"-":"")+e.toFixed(1)+" "+o})}function ue(){if(B)return O;function e(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return B=1,e.prototype.match=function(e){var t,n,r=!0,o=this.parts,i=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t<i;t++)"*"!==o[t]&&(r=t<n.length&&o[t]===n[t]);r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var a in r={},e)this.match(a)&&(r[a]=e[a]);return r},O=function(t,n,r){var o=new e(t,r||/[\/\.]/);return void 0!==n?o.match(n):o},O}function le(){if(I)return ae;I=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.defaultOptions=ae.RestrictionError=ae.Restricter=void 0;const e=se(),t=function(){if(F)return k;F=1;var e=ue(),t=/[\/\+\.]/;return k=function(n,r){function o(r){var o=e(r,n,t);return o&&o.length>=2}return r?o(r.split(";")[0]):o}}();ae.defaultOptions={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class n extends Error{constructor(){super(...arguments),this.isRestriction=!0}}ae.RestrictionError=n,"undefined"==typeof AggregateError&&(globalThis.AggregateError=class extends Error{constructor(e,t){super(t),this.errors=e}});return ae.Restricter=class{constructor(e,t){this.i18n=t,this.getOpts=()=>{const t=e();if(null!=t.restrictions.allowedFileTypes&&!Array.isArray(t.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validate(r,o){const{maxFileSize:i,minFileSize:a,maxTotalFileSize:s,maxNumberOfFiles:u,allowedFileTypes:l}=this.getOpts().restrictions;if(u){const e=o.filter(e=>!e.isGhost);if(e.length+1>u)throw new n(`${this.i18n("youCanOnlyUploadX",{smart_count:u})}`)}if(l){if(!l.some(e=>e.includes("/")?!!r.type&&t(r.type.replace(/;.*?$/,""),e):!("."!==e[0]||!r.extension)&&r.extension.toLowerCase()===e.slice(1).toLowerCase())){const e=l.join(", ");throw new n(this.i18n("youCanOnlyUploadFileTypes",{types:e}))}}if(s&&null!=r.size){const t=o.reduce((e,t)=>e+t.size,r.size);if(t>s)throw new n(this.i18n("exceedsSize",{size:e(s),file:r.name}))}if(i&&null!=r.size&&r.size>i)throw new n(this.i18n("exceedsSize",{size:e(i),file:r.name}));if(a&&null!=r.size&&r.size<a)throw new n(this.i18n("inferiorSize",{size:e(a)}))}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(Object.keys(e).length<t)throw new n(this.i18n("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new n(this.i18n("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:r}=this.getOpts().restrictions,o=Object.prototype.hasOwnProperty,i=[];for(const t of r)o.call(e.meta,t)&&""!==e.meta[t]||i.push(t);return{missingFields:i,error:t}}},ae}function ce(){if(R)return P;return R=1,P=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}function de(){if(L)return _;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}L=1;var t=0;function n(e){return"__private_"+t+++"_"+e}const r=ce();function o(e,t,n){const r=[];return e.forEach(e=>"string"!=typeof e?r.push(e):t[Symbol.split](e).forEach((e,t,o)=>{""!==e&&r.push(e),t<o.length-1&&r.push(n)})),r}
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.wangEditor={}))})(this,function(e){Object.defineProperty(e,`__esModule`,{value:!0});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t&&n(r,Symbol.toStringTag,{value:`Module`}),r},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),f=e=>o.call(e,`module.exports`)?e[`module.exports`]:u(n({},`__esModule`,{value:!0}),e),p;function m(){typeof globalThis>`u`&&(window.globalThis=window)}function h(){typeof AggregateError>`u`&&(window.AggregateError=function(e,t){let n=Error(t);return n.errors=e,n})}if(typeof global>`u`){if(`ActiveXObject`in window){let e=`抱歉,wangEditor V5+ 版本开始,不在支持 IE 浏览器`;e+=`
2
+ Sorry, wangEditor V5+ versions do not support IE browser.`,console.error(e)}m(),h()}else global&&(p=global.navigator)!=null&&p.userAgent.match(`QQBrowser`)&&(m(),h());if(typeof global==`object`){let e=global.crypto&&typeof global.crypto.getRandomValues==`function`?e=>global.crypto.getRandomValues.call(global.crypto,e):e=>e,t=Object.getOwnPropertyDescriptor(global,`window`);(!global.window||t.set)&&(global.window=global,global.requestAnimationFrame=()=>{},global.navigator={userAgent:``},global.location={hostname:`0.0.0.0`,port:0,protocol:`http:`},global.btoa=()=>{},global.crypto={getRandomValues(t){return e(t)}}),global.document!=null&&global.document.getElementsByTagName==null&&(global.document.getElementsByTagName=()=>[])}var g=c(((e,t)=>{function n(e){return e<10?`0${e}`:e.toString()}function r(){let e=new Date;return`${n(e.getHours())}:${n(e.getMinutes())}:${n(e.getSeconds())}`}t.exports=r})),_=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.justErrorsLogger=e.debugLogger=void 0;let t=g();e.justErrorsLogger={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return console.error(`[Uppy] [${t()}]`,...n)}},e.debugLogger={debug:function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return console.debug(`[Uppy] [${t()}]`,...n)},warn:function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return console.warn(`[Uppy] [${t()}]`,...n)},error:function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return console.error(`[Uppy] [${t()}]`,...n)}}}));function v(e){"@babel/helpers - typeof";return v=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},v(e)}var y=s((()=>{}));function b(e,t){if(v(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(v(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var x=s((()=>{y()}));function S(e){var t=b(e,`string`);return v(t)==`symbol`?t:t+``}var C=s((()=>{y(),x()}));function w(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T=s((()=>{C()}));function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?E(Object(n),!0).forEach(function(t){w(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var O=s((()=>{T()}));function k(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function A(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){k(a,r,i,o,s,`next`,e)}function s(e){k(a,r,i,o,s,`throw`,e)}o(void 0)})}}var j=s((()=>{})),ee=c(((e,t)=>{t.exports={nanoid:(e=21)=>{let t=``,n=e|0;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r}}})),M=c(((e,t)=>{t.exports=function(e){if(typeof e!=`number`||isNaN(e))throw TypeError(`Expected a number, got `+typeof e);var t=e<0,n=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`];if(t&&(e=-e),e<1)return(t?`-`:``)+e+` B`;var r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,r));var i=n[r];return e>=10||e%1==0?(t?`-`:``)+e.toFixed(0)+` `+i:(t?`-`:``)+e.toFixed(1)+` `+i}})),N=c(((e,t)=>{function n(e,t){this.text=e=e||``,this.hasWild=~e.indexOf(`*`),this.separator=t,this.parts=e.split(t)}n.prototype.match=function(e){var t=!0,n=this.parts,r,i=n.length,a;if(typeof e==`string`||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(a=(e||``).split(this.separator),r=0;t&&r<i;r++)if(n[r]===`*`)continue;else t=r<a.length?n[r]===a[r]:!1;t=t&&a}else if(typeof e.splice==`function`)for(t=[],r=e.length;r--;)this.match(e[r])&&(t[t.length]=e[r]);else if(typeof e==`object`)for(var o in t={},e)this.match(o)&&(t[o]=e[o]);return t},t.exports=function(e,t,r){var i=new n(e,r||/[\/\.]/);return t===void 0?i:i.match(t)}})),te=c(((e,t)=>{var n=N(),r=/[\/\+\.]/;t.exports=function(e,t){function i(t){var i=n(t,e,r);return i&&i.length>=2}return t?i(t.split(`;`)[0]):i}})),P=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultOptions=e.RestrictionError=e.Restricter=void 0;let t=M(),n=te();e.defaultOptions={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};var r=class extends Error{constructor(){super(...arguments),this.isRestriction=!0}};e.RestrictionError=r,typeof AggregateError>`u`&&(globalThis.AggregateError=class extends Error{constructor(e,t){super(t),this.errors=e}}),e.Restricter=class{constructor(e,t){this.i18n=t,this.getOpts=()=>{let t=e();if(t.restrictions.allowedFileTypes!=null&&!Array.isArray(t.restrictions.allowedFileTypes))throw TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validate(e,i){let{maxFileSize:a,minFileSize:o,maxTotalFileSize:s,maxNumberOfFiles:c,allowedFileTypes:l}=this.getOpts().restrictions;if(c&&i.filter(e=>!e.isGhost).length+1>c)throw new r(`${this.i18n(`youCanOnlyUploadX`,{smart_count:c})}`);if(l&&!l.some(t=>t.includes(`/`)?e.type?n(e.type.replace(/;.*?$/,``),t):!1:t[0]===`.`&&e.extension?e.extension.toLowerCase()===t.slice(1).toLowerCase():!1)){let e=l.join(`, `);throw new r(this.i18n(`youCanOnlyUploadFileTypes`,{types:e}))}if(s&&e.size!=null&&i.reduce((e,t)=>e+t.size,e.size)>s)throw new r(this.i18n(`exceedsSize`,{size:t(s),file:e.name}));if(a&&e.size!=null&&e.size>a)throw new r(this.i18n(`exceedsSize`,{size:t(a),file:e.name}));if(o&&e.size!=null&&e.size<o)throw new r(this.i18n(`inferiorSize`,{size:t(o)}))}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(Object.keys(e).length<t)throw new r(this.i18n(`youHaveToAtLeastSelectX`,{smart_count:t}))}getMissingRequiredMetaFields(e){let t=new r(this.i18n(`missingRequiredMetaFieldOnFile`,{fileName:e.name})),{requiredMetaFields:n}=this.getOpts().restrictions,i=Object.prototype.hasOwnProperty,a=[];for(let t of n)(!i.call(e.meta,t)||e.meta[t]===``)&&a.push(t);return{missingFields:a,error:t}}}})),ne=c(((e,t)=>{function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=n})),re=c(((e,t)=>{O();function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var r=0;function i(e){return`__private_`+ r+++`_`+e}let a=ne();function o(e,t,n){let r=[];return e.forEach(e=>typeof e==`string`?t[Symbol.split](e).forEach((e,t,i)=>{e!==``&&r.push(e),t<i.length-1&&r.push(n)}):r.push(e)),r}
2
3
  /**
3
- * Takes a string with placeholder variables like `%{smart_count} file selected`
4
- * and replaces it with values from options `{smart_count: 5}`
5
- *
6
- * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
7
- * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
8
- *
9
- * @param {string} phrase that needs interpolation, with placeholders
10
- * @param {object} options with values that will be used to replace placeholders
11
- * @returns {any[]} interpolated
12
- */function i(e,t){const n=/\$/g;let r=[e];if(null==t)return r;for(const e of Object.keys(t))if("_"!==e){let i=t[e];"string"==typeof i&&(i=n[Symbol.replace](i,"$$$$")),r=o(r,new RegExp(`%\\{${e}\\}`,"g"),i)}return r}var a=n("apply");function s(e){if(null==e||!e.strings)return;const t=this.locale;this.locale={...t,strings:{...t.strings,...e.strings}},this.locale.pluralize=e.pluralize||t.pluralize}return _=class{constructor(t){Object.defineProperty(this,a,{value:s}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(t)?t.forEach(e(this,a)[a],this):e(this,a)[a](t)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){if(!r(this.locale.strings,e))throw new Error(`missing string: ${e}`);const n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){return i(n[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return i(n,t)}},_}function fe(){return j||(j=1,M=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,a,s){var u=function(e){var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),a=0,s=i.length;for(;a<s;a++){var u=i[a];if("*"===u&&(n=n.concat(t[u])),2===o.length&&o[0]===u){n=n.concat(t[u]);break}}return n}(e);u.length&&function(e,t,n){var r=0,o=t.length;for(;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,u,[n,r,o,i,a,s])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,function r(){n.apply(this,arguments),e.off(t,r)})},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],o=0,i=r?r.length:0;o<i;o++)r[o]!==t&&n.push(r[o]);n.length?this._fns[e]=n:delete this._fns[e]},e}),M}function pe(){if(z)return H;z=1;var e="Expected a function",t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,a="object"==typeof g&&g&&g.Object===Object&&g,s="object"==typeof self&&self&&self.Object===Object&&self,u=a||s||Function("return this")(),l=Object.prototype.toString,c=Math.max,d=Math.min,f=function(){return u.Date.now()};function p(t,n,r){var o,i,a,s,u,l,p=0,g=!1,m=!1,y=!0;if("function"!=typeof t)throw new TypeError(e);function b(e){var n=o,r=i;return o=i=void 0,p=e,s=t.apply(r,n)}function E(e){var t=e-l;return void 0===l||t>=n||t<0||m&&e-p>=a}function w(){var e=f();if(E(e))return C(e);u=setTimeout(w,function(e){var t=n-(e-l);return m?d(t,a-(e-p)):t}(e))}function C(e){return u=void 0,y&&o?b(e):(o=i=void 0,s)}function D(){var e=f(),t=E(e);if(o=arguments,i=this,l=e,t){if(void 0===u)return function(e){return p=e,u=setTimeout(w,n),g?b(e):s}(l);if(m)return u=setTimeout(w,n),b(l)}return void 0===u&&(u=setTimeout(w,n)),s}return n=v(n)||0,h(r)&&(g=!!r.leading,a=(m="maxWait"in r)?c(v(r.maxWait)||0,n):a,y="trailing"in r?!!r.trailing:y),D.cancel=function(){void 0!==u&&clearTimeout(u),p=0,o=l=i=u=void 0},D.flush=function(){return void 0===u?s:C(f())},D}function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(h(e)){var a="function"==typeof e.valueOf?e.valueOf():e;e=h(a)?a+"":a}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var s=r.test(e);return s||o.test(e)?i(e.slice(2),s?2:8):n.test(e)?NaN:+e}return H=function(t,n,r){var o=!0,i=!0;if("function"!=typeof t)throw new TypeError(e);return h(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),p(t,n,{leading:o,maxWait:n,trailing:i})}}function he(){if(U)return $;U=1;var e=0;function t(t){return"__private_"+e+++"_"+t}var n=t("publish");class r{constructor(){Object.defineProperty(this,n,{value:o}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(this,n)[n](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach(e=>{e(...t)})}return r.VERSION="2.1.1",$=function(){return new r}}function ge(){if(W)return V;return W=1,V=function(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}}function ve(){return q?G:(q=1,G={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"})}function me(){if(ie)return oe;ie=1;var e=x(),t=S(),n=le();let r,o;function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var a=0;function s(e){return"__private_"+a+++"_"+e}const u=de(),l=fe(),c=pe(),d=he(),f=function(){if(Y)return K;Y=1;const e=ge(),t=ve();return K=function(n){var r;if(n.type)return n.type;const o=n.name?null==(r=e(n.name).extension)?void 0:r.toLowerCase():null;return o&&o in t?t[o]:"application/octet-stream"}}(),p=ge(),h=function(){if(Z)return X;function e(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}return Z=1,X=function(t){let n="uppy";return"string"==typeof t.name&&(n+=`-${e(t.name.toLowerCase())}`),void 0!==t.type&&(n+=`-${t.type}`),t.meta&&"string"==typeof t.meta.relativePath&&(n+=`-${e(t.meta.relativePath.toLowerCase())}`),void 0!==t.data.size&&(n+=`-${t.data.size}`),void 0!==t.data.lastModified&&(n+=`-${t.data.lastModified}`),n}}(),g=(Q||(Q=1,J=function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const n=t[1];let[r,o]=n.split(".");return r=parseInt(r,10),o=parseInt(o,10),r<15||15===r&&o<15063||r>18||18===r&&o>=18218}),J),v=te?ee:(te=1,ee=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}),m=re?ne:(re=1,ne={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",emptyFolderAdded:"No files were added from empty folder",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}});var y=s("plugins"),b=s("restricter"),E=s("storeUnsubscribe"),w=s("emitter"),C=s("preProcessors"),D=s("uploaders"),A=s("postProcessors"),T=s("informAndEmit"),N=s("checkRequiredMetaFieldsOnFile"),O=s("checkRequiredMetaFields"),B=s("assertNewUploadAllowed"),k=s("checkAndCreateFileStateObject"),F=s("startIfAutoProceed"),I=s("addListeners"),P=s("updateOnlineStatus"),R=s("createUpload"),_=s("getUpload"),L=s("removeUpload"),M=s("runUpload");r=Symbol.for("uppy test: getPlugins"),o=Symbol.for("uppy test: createUpload");class j{constructor(e){Object.defineProperty(this,M,{value:ue}),Object.defineProperty(this,L,{value:se}),Object.defineProperty(this,_,{value:ae}),Object.defineProperty(this,R,{value:q}),Object.defineProperty(this,I,{value:G}),Object.defineProperty(this,F,{value:W}),Object.defineProperty(this,k,{value:V}),Object.defineProperty(this,B,{value:U}),Object.defineProperty(this,O,{value:$}),Object.defineProperty(this,N,{value:z}),Object.defineProperty(this,T,{value:H}),Object.defineProperty(this,y,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,b,{writable:!0,value:void 0}),Object.defineProperty(this,E,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:l()}),Object.defineProperty(this,C,{writable:!0,value:new Set}),Object.defineProperty(this,D,{writable:!0,value:new Set}),Object.defineProperty(this,A,{writable:!0,value:new Set}),Object.defineProperty(this,P,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=m;const r={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:n.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:d(),logger:t.justErrorsLogger,infoTimeout:5e3};this.opts={...r,...e,restrictions:{...r.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=t.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=c(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:g(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:{...this.opts.meta},info:[],recoveredState:null}),i(this,b)[b]=new n.Restricter(()=>this.opts,this.i18n),i(this,E)[E]=this.store.subscribe((e,t,n)=>{this.emit("state-update",e,t,n),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),i(this,I)[I]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i(this,w)[w].emit(e,...n)}on(e,t){return i(this,w)[w].on(e,t),this}once(e,t){return i(this,w)[w].once(e,t),this}off(e,t){return i(this,w)[w].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:{...this.getState().files,[e]:{...this.getState().files[e],...t}}})}i18nInit(){const e=new u([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e&&e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(e=>{e.setOptions()}),this.setState()}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},n={};Object.keys(t).forEach(r=>{const o={...t[r]};o.progress={...o.progress,...e},n[r]=o}),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")}addPreProcessor(e){i(this,C)[C].add(e)}removePreProcessor(e){return i(this,C)[C].delete(e)}addPostProcessor(e){i(this,A)[A].add(e)}removePostProcessor(e){return i(this,A)[A].delete(e)}addUploader(e){i(this,D)[D].add(e)}removeUploader(e){return i(this,D)[D].delete(e)}setMeta(e){const t={...this.getState().meta,...e},n={...this.getState().files};Object.keys(n).forEach(t=>{n[t]={...n[t],meta:{...n[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){const n={...this.getState().files};if(!n[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const r={...n[e].meta,...t};n[e]={...n[e],meta:r},this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=r.filter(e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted}),i=r.filter(e=>!e.progress.uploadStarted),a=r.filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess),s=r.filter(e=>e.progress.uploadStarted),u=r.filter(e=>e.isPaused),l=r.filter(e=>e.progress.uploadComplete),c=r.filter(e=>e.error),d=o.filter(e=>!e.isPaused),f=r.filter(e=>e.progress.preprocess||e.progress.postprocess);return{newFiles:i,startedFiles:a,uploadStartedFiles:s,pausedFiles:u,completeFiles:l,erroredFiles:c,inProgressFiles:o,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:s.length>0,isAllComplete:100===t&&l.length===r.length&&0===f.length,isAllErrored:!!n&&c.length===r.length,isAllPaused:0!==o.length&&u.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(e=>e.isGhost)}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{return i(this,b)[b].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){i(this,B)[B](e);const{files:t}=this.getState();let n=i(this,k)[k](t,e);return t[n.id]&&t[n.id].isGhost&&(n={...t[n.id],data:e.data,isGhost:!1},this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:{...t,[n.id]:n}}),this.emit("file-added",n),this.emit("files-added",[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),i(this,F)[F](),n.id}addFiles(e){i(this,B)[B]();const t={...this.getState().files},n=[],r=[];for(let o=0;o<e.length;o++)try{let r=i(this,k)[k](t,e[o]);t[r.id]&&t[r.id].isGhost&&(r={...t[r.id],data:e[o].data,isGhost:!1},this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach(e=>{this.emit("file-added",e)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach(e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)}),n.length>0&&i(this,F)[F](),r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}}removeFiles(e,t){const{files:n,currentUploads:r}=this.getState(),o={...n},i={...r},a=Object.create(null);function s(e){return void 0===a[e]}e.forEach(e=>{n[e]&&(a[e]=n[e],delete o[e])}),Object.keys(i).forEach(e=>{const t=r[e].fileIDs.filter(s);if(0===t.length)return void delete i[e];const{capabilities:n}=this.getState();if(t.length!==r[e].fileIDs.length&&!n.individualCancellation)throw new Error("individualCancellation is disabled");i[e]={...r[e],fileIDs:t}});const u={currentUploads:i,files:o};0===Object.keys(o).length&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),this.calculateTotalProgress();const l=Object.keys(a);l.forEach(e=>{this.emit("file-removed",a[e],t)}),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e,t){void 0===t&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!0};e[t]=n}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter(t=>e[t].error);if(t.forEach(t=>{const n={...e[t],isPaused:!1,error:null};e[t]=n}),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const n=i(this,R)[R](t,{forceAllowNewUpload:!0});return i(this,M)[M](n)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=i(this,R)[R]([e],{forceAllowNewUpload:!0});return i(this,M)[M](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}calculateTotalProgress(){const e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter(e=>null!=e.progress.bytesTotal),n=e.filter(e=>null==e.progress.bytesTotal);if(0===t.length){const t=100*e.length,r=n.reduce((e,t)=>e+t.progress.percentage,0),o=Math.round(r/t*100);return void this.setState({totalProgress:o})}let r=t.reduce((e,t)=>e+t.progress.bytesTotal,0);const o=r/t.length;r+=o*n.length;let i=0;t.forEach(e=>{i+=e.progress.bytesUploaded}),n.forEach(e=>{i+=o*(e.progress.percentage||0)/100});let a=0===r?0:Math.round(i/r*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}updateOnlineStatus(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`)}const n=new e(this,t),r=n.id;if(!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");const o=this.getPlugin(r);if(o){const e=`Already found a plugin named '${o.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in i(this,y)[y]?i(this,y)[y][n.type].push(n):i(this,y)[y][n.type]=[n],n.install(),this}getPlugin(e){for(const t of Object.values(i(this,y)[y])){const n=t.find(t=>t.id===e);if(null!=n)return n}}[r](e){return i(this,y)[y][e]}iteratePlugins(e){Object.values(i(this,y)[y]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=i(this,y)[y][e.type],n=t.findIndex(t=>t.id===e.id);-1!==n&&t.splice(n,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),i(this,E)[E](),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",i(this,P)[P]),window.removeEventListener("offline",i(this,P)[P]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);const r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,t){const{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?i(this,M)[M](e):(i(this,L)[L](e),Promise.reject(new Error("Nonexistent upload")))}[o](){return i(this,R)[R](...arguments)}addResultData(e,t){if(!i(this,_)[_](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:n}=this.getState(),r={...n[e],result:{...n[e].result,...t}};this.setState({currentUploads:{...n,[e]:r}})}upload(){var e;null!=(e=i(this,y)[y].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const r=this.opts.onBeforeUpload(t);return!1===r?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&"object"==typeof r&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>i(this,b)[b].validateMinNumberOfFiles(t)).catch(e=>{throw i(this,T)[T](e),e}).then(()=>{if(!i(this,O)[O](t))throw new n.RestrictionError(this.i18n("missingRequiredMetaField"))}).catch(e=>{throw e}).then(()=>{const{currentUploads:e}=this.getState(),n=Object.values(e).flatMap(e=>e.fileIDs),r=[];Object.keys(t).forEach(e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==n.indexOf(e)||r.push(t.id)});const o=i(this,R)[R](r);return i(this,M)[M](o)}).catch(e=>{throw this.emit("error",e),this.log(e,"error"),e}))}}function H(e,t){const{message:n,details:r=""}=e;e.isRestriction?this.emit("restriction-failed",t,e):this.emit("error",e),this.info({message:n,details:r},"error",this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),"error")}function z(e){const{missingFields:t,error:n}=i(this,b)[b].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit("restriction-failed",e,n),!1)}function $(e){let t=!0;for(const n of Object.values(e))i(this,N)[N](n)||(t=!1);return t}function U(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new n.RestrictionError(this.i18n("noMoreFilesAllowed"));throw i(this,T)[T](t,e),t}}function V(e,t){const r=f(t),o=v(r,t),a=p(o).extension,s=Boolean(t.isRemote),u=h({...t,type:r});if(this.checkIfFileAlreadyExists(u)){const e=new n.RestrictionError(this.i18n("noDuplicates",{fileName:o}));throw i(this,T)[T](e,t),e}const l=t.meta||{};l.name=o,l.type=r;const c=Number.isFinite(t.data.size)?t.data.size:null;let d={source:t.source||"",id:u,name:o,extension:a||"",meta:{...this.getState().meta,...l},type:r,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isRemote:s,remote:t.remote||"",preview:t.preview};const g=this.opts.onBeforeFileAdded(d,e);if(!1===g){const e=new n.RestrictionError("Cannot add the file because onBeforeFileAdded returned false.");throw this.emit("restriction-failed",t,e),e}"object"==typeof g&&null!==g&&(d=g);try{const t=Object.keys(e).map(t=>e[t]);i(this,b)[b].validate(d,t)}catch(e){throw i(this,T)[T](e,d),e}return d}function W(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function G(){const e=(e,t,n)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on("error",e),this.on("upload-error",(t,n,r)=>{if(e(n,t,r),"object"==typeof n&&n.message){const e=new Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n("failedToUpload",{file:null==t?void 0:t.name}),i(this,T)[T](e)}else i(this,T)[T](n)}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-started",e=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...n,postprocess:i(this,A)[A].size>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("preprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on("postprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)}),this.on("postprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",e=>{e&&i(this,N)[N](e)}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",i(this,P)[P]),window.addEventListener("offline",i(this,P)[P]),setTimeout(i(this,P)[P],3e3))}function q(t,n){void 0===n&&(n={});const{forceAllowNewUpload:r=!1}=n,{allowNewUpload:o,currentUploads:i}=this.getState();if(!o&&!r)throw new Error("Cannot create a new upload: already uploading.");const a=(0,e.nanoid)();return this.emit("upload",{id:a,fileIDs:t}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...i,[a]:{fileIDs:t,step:0,result:{}}}}),a}function ae(e){const{currentUploads:t}=this.getState();return t[e]}function se(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function ue(e){let{currentUploads:t}=this.getState(),n=t[e];const r=n.step||0,o=[...i(this,C)[C],...i(this,D)[D],...i(this,A)[A]];try{for(let i=r;i<o.length&&n;i++){const r=o[i],a={...n,step:i};this.setState({currentUploads:{...t,[e]:a}}),await r(a.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw i(this,L)[L](e),t}if(n){n.fileIDs.forEach(e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)});const r=n.fileIDs.map(e=>this.getFile(e)),o=r.filter(e=>!e.error),i=r.filter(e=>e.error);await this.addResultData(e,{successful:o,failed:i,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let a;return n&&(a=n.result,this.emit("complete",a),i(this,L)[L](e)),null==a&&this.log(`Not setting result for an upload that has been removed: ${e}`),a}return j.VERSION="2.3.4",oe=j}var ye,be,Ee,we,Ce,De,Ae,Se,xe,Te,Ne,Oe,Be,ke={},Fe=[],Ie=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Pe=Array.isArray;function Re(e,t){for(var n in t)e[n]=t[n];return e}function _e(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Le(e,t,n){var r,o,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?ye.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return Me(e,a,r,o,null)}function Me(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++Ee:o,__i:-1,__u:0};return null==o&&null!=be.vnode&&be.vnode(i),i}function je(e){return e.children}function He(e,t){this.props=e,this.context=t}function ze(e,t){if(null==t)return e.__?ze(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?ze(e):null}function $e(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return $e(e)}}function Ue(e){(!e.__d&&(e.__d=!0)&&Ce.push(e)&&!Ve.__r++||De!=be.debounceRendering)&&((De=be.debounceRendering)||Ae)(Ve)}function Ve(){for(var e,t,n,r,o,i,a,s=1;Ce.length;)Ce.length>s&&Ce.sort(Se),e=Ce.shift(),s=Ce.length,e.__d&&(n=void 0,r=void 0,o=(r=(t=e).__v).__e,i=[],a=[],t.__P&&((n=Re({},r)).__v=r.__v+1,be.vnode&&be.vnode(n),Je(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,i,null==o?ze(r):o,!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,et(i,n,a),r.__e=r.__=null,n.__e!=o&&$e(n)));Ve.__r=0}function We(e,t,n,r,o,i,a,s,u,l,c){var d,f,p,h,g,v,m,y=r&&r.__k||Fe,b=t.length;for(u=Ge(n,t,y,u,b),d=0;d<b;d++)null!=(p=n.__k[d])&&(f=-1==p.__i?ke:y[p.__i]||ke,p.__i=d,v=Je(e,p,f,o,i,a,s,u,l,c),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&rt(f.ref,null,p),c.push(p.ref,p.__c||h,p)),null==g&&null!=h&&(g=h),(m=!!(4&p.__u))||f.__k===p.__k?u=qe(p,u,e,m):"function"==typeof p.type&&void 0!==v?u=v:h&&(u=h.nextSibling),p.__u&=-7);return n.__e=g,u}function Ge(e,t,n,r,o){var i,a,s,u,l,c=n.length,d=c,f=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(a=t[i])&&"boolean"!=typeof a&&"function"!=typeof a?(u=i+f,(a=e.__k[i]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?Me(null,a,null,null,null):Pe(a)?Me(je,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?Me(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,-1!=(l=a.__i=Ke(a,n,u,d))&&(d--,(s=n[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(o>c?f--:o<c&&f++),"function"!=typeof a.type&&(a.__u|=4)):l!=u&&(l==u-1?f--:l==u+1?f++:(l>u?f--:f++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<c;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==r&&(r=ze(s)),ot(s,s));return r}function qe(e,t,n,r){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=qe(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=ze(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Ke(e,t,n,r){var o,i,a,s=e.key,u=e.type,l=t[n],c=null!=l&&!(2&l.__u);if(null===l&&null==e.key||c&&s==l.key&&u==l.type)return n;if(r>(c?1:0))for(o=n-1,i=n+1;o>=0||i<t.length;)if(null!=(l=t[a=o>=0?o--:i++])&&!(2&l.__u)&&s==l.key&&u==l.type)return a;return-1}function Ye(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Ie.test(t)?n:n+"px"}function Xe(e,t,n,r,o){var i,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ye(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||Ye(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(xe,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Te,e.addEventListener(t,i?Oe:Ne,i)):e.removeEventListener(t,i?Oe:Ne,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function Ze(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=Te++;else if(t.t<n.u)return;return n(be.event?be.event(t):t)}}}function Je(e,t,n,r,o,i,a,s,u,l){var c,d,f,p,h,g,v,m,y,b,E,w,C,D,A,S,x,T=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(c=be.__b)&&c(t);e:if("function"==typeof T)try{if(m=t.props,y="prototype"in T&&T.prototype.render,b=(c=T.contextType)&&r[c.__c],E=c?b?b.props.value:c.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:(y?t.__c=d=new T(m,E):(t.__c=d=new He(m,E),d.constructor=T,d.render=it),b&&b.sub(d),d.props=m,d.state||(d.state={}),d.context=E,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),y&&null==d.__s&&(d.__s=d.state),y&&null!=T.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Re({},d.__s)),Re(d.__s,T.getDerivedStateFromProps(m,d.__s))),p=d.props,h=d.state,d.__v=t,f)y&&null==T.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),y&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(y&&null==T.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,E),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,E)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,E),y&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,h,g)})}if(d.context=E,d.props=m,d.__P=e,d.__e=!1,C=be.__r,D=0,y){for(d.state=d.__s,d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),A=0;A<d._sb.length;A++)d.__h.push(d._sb[A]);d._sb=[]}else do{d.__d=!1,C&&C(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++D<25);d.state=d.__s,null!=d.getChildContext&&(r=Re(Re({},r),d.getChildContext())),y&&!f&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,h)),S=c,null!=c&&c.type===je&&null==c.key&&(S=tt(c.props.children)),s=We(e,Pe(S)?S:[S],t,n,r,o,i,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),v&&(d.__E=d.__=null)}catch(e){if(t.__v=null,u||null!=i)if(e.then){for(t.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else{for(x=i.length;x--;)_e(i[x]);Qe(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Qe(t);be.__e(e,t,n)}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=nt(n.__e,t,n,r,o,i,a,u,l);return(c=be.diffed)&&c(t),128&t.__u?void 0:s}function Qe(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Qe)}function et(e,t,n){for(var r=0;r<n.length;r++)rt(n[r],n[++r],n[++r]);be.__c&&be.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){be.__e(e,t.__v)}})}function tt(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:Pe(e)?e.map(tt):Re({},e)}function nt(e,t,n,r,o,i,a,s,u){var l,c,d,f,p,h,g,v=n.props,m=t.props,y=t.type;if("svg"==y?o="http://www.w3.org/2000/svg":"math"==y?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((p=i[l])&&"setAttribute"in p==!!y&&(y?p.localName==y:3==p.nodeType)){e=p,i[l]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(o,y,m.is&&m),s&&(be.__m&&be.__m(t,i),s=!1),i=null}if(null==y)v===m||s&&e.data==m||(e.data=m);else{if(i=i&&ye.call(e.childNodes),v=n.props||ke,!s&&null!=i)for(v={},l=0;l<e.attributes.length;l++)v[(p=e.attributes[l]).name]=p.value;for(l in v)if(p=v[l],"children"==l);else if("dangerouslySetInnerHTML"==l)d=p;else if(!(l in m)){if("value"==l&&"defaultValue"in m||"checked"==l&&"defaultChecked"in m)continue;Xe(e,l,null,p,o)}for(l in m)p=m[l],"children"==l?f=p:"dangerouslySetInnerHTML"==l?c=p:"value"==l?h=p:"checked"==l?g=p:s&&"function"!=typeof p||v[l]===p||Xe(e,l,p,v[l],o);if(c)s||d&&(c.__html==d.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),We("template"==t.type?e.content:e,Pe(f)?f:[f],t,n,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&ze(n,0),s,u),null!=i)for(l=i.length;l--;)_e(i[l]);s||(l="value","progress"==y&&null==h?e.removeAttribute("value"):null!=h&&(h!==e[l]||"progress"==y&&!h||"option"==y&&h!=v[l])&&Xe(e,l,h,v[l],o),l="checked",null!=g&&g!=e[l]&&Xe(e,l,g,v[l],o))}return e}function rt(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){be.__e(e,n)}}function ot(e,t,n){var r,o;if(be.unmount&&be.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||rt(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){be.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&ot(r[o],t,n||"function"!=typeof e.type);n||_e(e.__e),e.__c=e.__=e.__e=void 0}function it(e,t,n){return this.constructor(e,n)}function at(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),be.__&&be.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],a=[],Je(t,e=(!r&&n||t).__k=Le(je,null,[e]),o||ke,ke,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?ye.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),et(i,e,a)}ye=Fe.slice,be={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},Ee=0,we=function(e){return null!=e&&void 0===e.constructor},He.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Re({},this.state),"function"==typeof e&&(e=e(Re({},n),this.props)),e&&Re(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ue(this))},He.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ue(this))},He.prototype.render=je,Ce=[],Ae="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Se=function(e,t){return e.__v.__b-t.__v.__b},Ve.__r=0,xe=/(PointerCapture)$|Capture$/i,Te=0,Ne=Ze(!1),Oe=Ze(!0),Be=0;var st,ut,lt,ct,dt,ft,pt,ht,gt,vt,mt,yt=Object.freeze({__proto__:null,Component:He,Fragment:je,cloneElement:function(e,t,n){var r,o,i,a,s=Re({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=void 0===t[i]&&null!=a?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?ye.call(arguments,2):n),Me(e.type,s,r||e.key,o||e.ref,null)},createContext:function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,Ue(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+Be++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createElement:Le,createRef:function(){return{current:null}},h:Le,hydrate:function e(t,n){at(t,n,e)},get isValidElement(){return we},get options(){return be},render:at,toChildArray:function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(Pe(t)?t.some(function(t){e(t,n)}):n.push(t)),n}}),bt=m(yt);function Et(){if(ct)return lt;ct=1;const e=ut?st:(ut=1,st=function(e){return(null==e?void 0:e.nodeType)===Node.ELEMENT_NODE});return lt=function(t,n){return void 0===n&&(n=document),"string"==typeof t?n.querySelector(t):e(t)?t:null}}function wt(){if(ht)return pt;ht=1;const e=de();return pt=class{constructor(e,t){void 0===t&&(t={}),this.uppy=e,this.opts=t}getPluginState(){const{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){const{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(),this.i18nInit()}i18nInit(){const t=new e([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState()}addTarget(){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}render(){throw new Error("Extend the render method to add your plugin to a DOM element")}update(){}afterUpdate(){}}}function Ct(){if(vt)return gt;vt=1;var e=bt;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var n=0;function r(e){return"__private_"+n+++"_"+e}const o=Et(),i=ft?dt:(ft=1,dt=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir}),a=wt();var s=r("updateUI");class u extends a{constructor(){super(...arguments),Object.defineProperty(this,s,{writable:!0,value:void 0})}mount(n,r){const a=r.id,l=o(n);if(l){this.isTargetDOMEl=!0;const r=document.createElement("div");return r.classList.add("uppy-Root"),t(this,s)[s]=function(e){let t=null,n=null;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return n=o,t||(t=Promise.resolve().then(()=>(t=null,e(...n)))),t}}(t=>{this.uppy.getPlugin(this.id)&&((0,e.render)(this.render(t),r),this.afterUpdate())}),this.uppy.log(`Installing ${a} to a DOM element '${n}'`),this.opts.replaceTargetContent&&(l.innerHTML=""),(0,e.render)(this.render(this.uppy.getState()),r),this.el=r,l.appendChild(r),r.dir=this.opts.direction||i(r)||"ltr",this.onMount(),this.el}let c;if("object"==typeof n&&n instanceof u)c=n;else if("function"==typeof n){const e=n;this.uppy.iteratePlugins(t=>{t instanceof e&&(c=t)})}if(c)return this.uppy.log(`Installing ${a} to ${c.id}`),this.parent=c,this.el=c.addTarget(r),this.onMount(),this.el;this.uppy.log(`Not installing ${a}`);let d=`Invalid target option given to ${a}.`;throw d+="function"==typeof n?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(d)}update(e){var n,r;null!=this.el&&(null==(n=(r=t(this,s))[s])||n.call(r,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}return gt=u}var Dt,At,St,xt,Tt,Nt,Ot,Bt,kt,Ft,It=(mt||(mt=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Uppy=t.UIPlugin=t.BasePlugin=void 0,Object.defineProperty(t,"debugLogger",{enumerable:!0,get:function(){return n.debugLogger}});var n=S();e.exports=me();const r=Ct();t.UIPlugin=r;const o=wt();t.BasePlugin=o;const i=me();t.Uppy=i;const a=Ct(),s=wt();i.Uppy=i,i.UIPlugin=a,i.BasePlugin=s,i.debugLogger=n.debugLogger}(D,D.exports)),D.exports),Pt=v(It),Rt={};function _t(){if(At)return Dt;At=1;class e extends Error{constructor(e,t){void 0===t&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}return Dt=e}function Lt(){if(Ft)return kt;let e;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Ft=1;var n=0;function r(e){return"__private_"+n+++"_"+e}const o=function(){if(xt)return St;xt=1;const e=_t();return St=function(){return fetch(...arguments).catch(t=>{throw"AbortError"===t.name?t:new e(t)})},St}(),i=function(){if(Nt)return Tt;Nt=1;const e=ce();class t extends Error{constructor(t,n){void 0===n&&(n={}),super(t),this.cause=n.cause,this.cause&&e(this.cause,"isNetworkError")&&(this.isNetworkError=this.cause.isNetworkError)}}return Tt=t}(),a=function(){if(Bt)return Ot;Bt=1;class e extends Error{constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}return Ot=e}();async function s(e){if(401===e.status)throw new a;const t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{const e=await t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw new Error(n)}}return t}var u=r("companionHeaders"),l=r("getPostResponseFunc"),c=r("getUrl"),d=r("errorHandler");e=Symbol.for("uppy test: getCompanionHeaders");class f{constructor(e,n){Object.defineProperty(this,d,{value:h}),Object.defineProperty(this,c,{value:p}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=n,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1,t(this,u)[u]=null==n?void 0:n.companionHeaders}setCompanionHeaders(e){t(this,u)[u]=e}[e](){return t(this,u)[u]}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}headers(){return Promise.resolve({...f.defaultHeaders,...t(this,u)[u]})}onReceiveResponse(e){const t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has("i-am")&&r.get("i-am")!==t[n]&&this.uppy.setState({companion:{...t,[n]:r.get("i-am")}}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(t(this,c)[c](e),{method:"OPTIONS"}).then(e=>(e.headers.has("access-control-allow-headers")&&(this.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map(e=>e.trim().toLowerCase())),this.preflightDone=!0,this.allowedHeaders.slice())).catch(e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,"warning"),this.preflightDone=!0,this.allowedHeaders.slice()))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then(e=>{let[t,n]=e;return Object.keys(n).forEach(e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])}),n})}get(e,n){return this.preflightAndHeaders(e).then(n=>o(t(this,c)[c](e),{method:"get",headers:n,credentials:this.opts.companionCookiesRule||"same-origin"})).then(t(this,l)[l](n)).then(s).catch(t(this,d)[d]("get",e))}post(e,n,r){const i="post";return this.preflightAndHeaders(e).then(r=>o(t(this,c)[c](e),{method:i,headers:r,credentials:this.opts.companionCookiesRule||"same-origin",body:JSON.stringify(n)})).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}delete(e,n,r){const i="delete";return this.preflightAndHeaders(e).then(t=>o(`${this.hostname}/${e}`,{method:i,headers:t,credentials:this.opts.companionCookiesRule||"same-origin",body:n?JSON.stringify(n):null})).then(t(this,l)[l](r)).then(s).catch(t(this,d)[d](i,e))}}function p(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function h(e,n){return r=>{var o;return null!=(o=r)&&o.isAuthError||(r=new i(`Could not ${e} ${t(this,c)[c](n)}`,{cause:r})),Promise.reject(r)}}return f.VERSION="2.2.2",f.defaultHeaders={Accept:"application/json","Content-Type":"application/json","Uppy-Versions":`@uppy/companion-client=${f.VERSION}`},kt=f}var Mt,jt,Ht,zt,$t,Ut,Vt,Wt,Gt={};function qt(){if(Mt)return Gt;return Mt=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},Gt.removeItem=function(e){return new Promise(t=>{localStorage.removeItem(e),t()})},Gt.setItem=function(e,t){return new Promise(n=>{localStorage.setItem(e,t),n()})},Gt}function Kt(){if(Wt)return Rt;Wt=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.Socket=Rt.SearchProvider=Rt.RequestClient=Rt.Provider=void 0;const e=Lt();Rt.RequestClient=e;const t=function(){if(Ht)return jt;Ht=1;var e=qt();const t=Lt();return jt=class extends t{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then(e=>{let[t,n]=e;const r={};return n&&(r["uppy-auth-token"]=n),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...t,...r}})}onReceiveResponse(e){e=super.onReceiveResponse(e);const t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authUrl(e){void 0===e&&(e={});const t=new URLSearchParams(e);return this.preAuthToken&&t.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e){return this.get(`${this.id}/list/${e||""}`)}logout(){return this.get(`${this.id}/logout`).then(e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)])).then(e=>{let[t]=e;return t})}static initPlugin(t,n,r){if(t.type="acquirer",t.files=[],r&&(t.opts={...r,...n}),n.serverUrl||n.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(n.companionAllowedHosts){const e=n.companionAllowedHosts;if(!("string"==typeof e||Array.isArray(e)||e instanceof RegExp))throw new TypeError(`${t.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);t.opts.companionAllowedHosts=e}else/^(?!https?:\/\/).*$/i.test(n.companionUrl)?t.opts.companionAllowedHosts=`https://${n.companionUrl.replace(/^\/\//,"")}`:t.opts.companionAllowedHosts=new URL(n.companionUrl).origin;t.storage=t.opts.storage||e}},jt}();Rt.Provider=t;const n=function(){if($t)return zt;$t=1;const e=Lt();return zt=class extends e{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}},zt}();Rt.SearchProvider=n;const r=function(){if(Vt)return Ut;let e,t;function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Vt=1;var r=0;function o(e){return"__private_"+r+++"_"+e}const i=fe();var a=o("queued"),s=o("emitter"),u=o("isOpen"),l=o("socket"),c=o("handleMessage");return e=Symbol.for("uppy test: getSocket"),t=Symbol.for("uppy test: getQueued"),Ut=class{constructor(e){Object.defineProperty(this,a,{writable:!0,value:[]}),Object.defineProperty(this,s,{writable:!0,value:i()}),Object.defineProperty(this,u,{writable:!0,value:!1}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:e=>{try{const t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,e&&!1===e.autoOpen||this.open()}get isOpen(){return n(this,u)[u]}[e](){return n(this,l)[l]}[t](){return n(this,a)[a]}open(){n(this,l)[l]=new WebSocket(this.opts.target),n(this,l)[l].onopen=()=>{for(n(this,u)[u]=!0;n(this,a)[a].length>0&&n(this,u)[u];){const e=n(this,a)[a].shift();this.send(e.action,e.payload)}},n(this,l)[l].onclose=()=>{n(this,u)[u]=!1},n(this,l)[l].onmessage=n(this,c)[c]}close(){var e;null==(e=n(this,l)[l])||e.close()}send(e,t){n(this,u)[u]?n(this,l)[l].send(JSON.stringify({action:e,payload:t})):n(this,a)[a].push({action:e,payload:t})}on(e,t){n(this,s)[s].on(e,t)}emit(e,t){n(this,s)[s].emit(e,t)}once(e,t){n(this,s)[s].once(e,t)}},Ut}();return Rt.Socket=r,Rt}var Yt,Xt,Zt,Jt,Qt,en,tn,nn,rn,on,an,sn,un,ln,cn,dn,fn,pn={};function hn(){if(Yt)return pn;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Yt=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.internalRateLimitedQueue=pn.RateLimitedQueue=void 0;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("activeRequests"),o=n("queuedHandlers"),i=n("paused"),a=n("pauseTimer"),s=n("downLimit"),u=n("upperLimit"),l=n("rateLimitingTimer"),c=n("call"),d=n("queueNext"),f=n("next"),p=n("queue"),h=n("dequeue"),g=n("resume"),v=n("increaseLimit");function m(t){e(this,r)[r]+=1;let n,o=!1;try{n=t()}catch(t){throw e(this,r)[r]-=1,t}return{abort:()=>{o||(o=!0,e(this,r)[r]-=1,n(),e(this,d)[d]())},done:()=>{o||(o=!0,e(this,r)[r]-=1,e(this,d)[d]())}}}function y(){queueMicrotask(()=>e(this,f)[f]())}function b(){if(e(this,i)[i]||e(this,r)[r]>=this.limit)return;if(0===e(this,o)[o].length)return;const t=e(this,o)[o].shift(),n=e(this,c)[c](t.fn);t.abort=n.abort,t.done=n.done}function E(t,n){void 0===n&&(n={});const r={fn:t,priority:n.priority||0,abort:()=>{e(this,h)[h](r)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=e(this,o)[o].findIndex(e=>r.priority>e.priority);return-1===i?e(this,o)[o].push(r):e(this,o)[o].splice(i,0,r),r}function w(t){const n=e(this,o)[o].indexOf(t);-1!==n&&e(this,o)[o].splice(n,1)}pn.RateLimitedQueue=class{constructor(t){Object.defineProperty(this,h,{value:w}),Object.defineProperty(this,p,{value:E}),Object.defineProperty(this,f,{value:b}),Object.defineProperty(this,d,{value:y}),Object.defineProperty(this,c,{value:m}),Object.defineProperty(this,r,{writable:!0,value:0}),Object.defineProperty(this,o,{writable:!0,value:[]}),Object.defineProperty(this,i,{writable:!0,value:!1}),Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,g,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,v,{writable:!0,value:()=>{if(e(this,i)[i])e(this,l)[l]=setTimeout(e(this,v)[v],0);else{e(this,s)[s]=this.limit,this.limit=Math.ceil((e(this,u)[u]+e(this,s)[s])/2);for(let t=e(this,s)[s];t<=this.limit;t++)e(this,d)[d]();e(this,u)[u]-e(this,s)[s]>3?e(this,l)[l]=setTimeout(e(this,v)[v],2e3):e(this,s)[s]=Math.floor(e(this,s)[s]/2)}}}),this.limit="number"!=typeof t||0===t?1/0:t}run(t,n){return!e(this,i)[i]&&e(this,r)[r]<this.limit?e(this,c)[c](t):e(this,p)[p](t,n)}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];let a;const s=new Promise((r,i)=>{a=n.run(()=>{let t,n;try{n=Promise.resolve(e(...o))}catch(e){n=Promise.reject(e)}return n.then(e=>{t?i(t):(a.done(),r(e))},e=>{t?i(t):(a.done(),i(e))}),()=>{t=new Error("Cancelled")}},t)});return s.abort=()=>{a.abort()},s}}resume(){e(this,i)[i]=!1,clearTimeout(e(this,a)[a]);for(let t=0;t<this.limit;t++)e(this,d)[d]()}pause(t){void 0===t&&(t=null),e(this,i)[i]=!0,clearTimeout(e(this,a)[a]),null!=t&&(e(this,a)[a]=setTimeout(e(this,g)[g],t))}rateLimit(t){clearTimeout(e(this,l)[l]),this.pause(t),this.limit>1&&Number.isFinite(this.limit)&&(e(this,u)[u]=this.limit-1,this.limit=e(this,s)[s],e(this,l)[l]=setTimeout(e(this,v)[v],t))}get isPaused(){return e(this,i)[i]}};const C=Symbol("__queue");return pn.internalRateLimitedQueue=C,pn}function gn(){return cn?ln:(cn=1,ln={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}})}var vn,mn,yn=function(){if(fn)return dn;fn=1;var e=x(),t=Kt(),n=hn();const r=wt(),o=function(){if(Zt)return Xt;Zt=1;const e=pe();return Xt=e(function(e,t,n){const{progress:r,bytesUploaded:o,bytesTotal:i}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:o,bytesTotal:i}))},300,{leading:!0,trailing:!0})}(),i=Qt?Jt:(Qt=1,Jt=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`}),a=tn?en:(tn=1,en=function(e){const t=[],n=[];function r(e){t.push(e)}function o(e){n.push(e)}return Promise.all(e.map(e=>e.then(r,o))).then(()=>({successful:t,failed:n}))}),s=function(){if(rn)return nn;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}rn=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("emitter"),o=n("events");return nn=class{constructor(t){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:[]}),e(this,r)[r]=t}on(t,n){return e(this,o)[o].push([t,n]),e(this,r)[r].on(t,n)}remove(){for(const[t,n]of e(this,o)[o].splice(0))e(this,r)[r].off(t,n)}}}(),u=function(){if(an)return on;function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}an=1;var t=0;function n(e){return"__private_"+t+++"_"+e}var r=n("aliveTimer"),o=n("isDone"),i=n("onTimedOut"),a=n("timeout");return on=class{constructor(t,n){Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:!1}),Object.defineProperty(this,i,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),e(this,a)[a]=t,e(this,i)[i]=n}progress(){e(this,o)[o]||e(this,a)[a]>0&&(clearTimeout(e(this,r)[r]),e(this,r)[r]=setTimeout(e(this,i)[i],e(this,a)[a]))}done(){e(this,o)[o]||(clearTimeout(e(this,r)[r]),e(this,r)[r]=null,e(this,o)[o]=!0)}}}(),l=_t(),c=un?sn:(un=1,sn=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)}),d=gn();function f(e,t){let n=t;return n||(n=new Error("Upload error")),"string"==typeof n&&(n=new Error(n)),n instanceof Error||(n=Object.assign(new Error("Upload error"),{data:n})),c(e)?(n=new l(n,e),n):(n.request=e,n)}function p(e){return e.data.slice(0,e.data.size,e.meta.type)}class h extends r{constructor(e,t){super(e,t),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.title="XHRUpload",this.defaultLocale=d;const r={formData:!0,fieldName:t.bundle?"files[]":"file",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=new Error("Upload error");return c(t)&&(n=new l(n,t)),n},validateStatus:e=>e>=200&&e<300};if(this.opts={...r,...t},this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),n.internalRateLimitedQueue in this.opts?this.requests=this.opts[n.internalRateLimitedQueue]:this.requests=new n.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof n?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach(n=>{e.append(n,t[n])})}createFormDataUpload(e,t){const n=new FormData;this.addMetadata(n,e.meta,t);const r=p(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){const n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach(e=>{const t=this.getOptions(e),r=p(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)}),n}upload(t,n,r){const o=this.getOptions(t);return this.uppy.log(`uploading ${n} of ${r}`),new Promise((n,r)=>{this.uppy.emit("upload-started",t);const i=o.formData?this.createFormDataUpload(t,o):t.data,a=new XMLHttpRequest;let l;this.uploaderEvents[t.id]=new s(this.uppy);const c=new u(o.timeout,()=>{a.abort(),l.done();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(o.timeout/1e3)}));this.uppy.emit("upload-error",t,e),r(e)}),d=(0,e.nanoid)();a.upload.addEventListener("loadstart",()=>{this.uppy.log(`[XHRUpload] ${d} started`)}),a.upload.addEventListener("progress",e=>{this.uppy.log(`[XHRUpload] ${d} progress: ${e.loaded} / ${e.total}`),c.progress(),e.lengthComputable&&this.uppy.emit("upload-progress",t,{uploader:this,bytesUploaded:e.loaded,bytesTotal:e.total})}),a.addEventListener("load",()=>{if(this.uppy.log(`[XHRUpload] ${d} finished`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null),o.validateStatus(a.status,a.responseText,a)){const e=o.getResponseData(a.responseText,a),r=e[o.responseUrlFieldName],i={status:a.status,body:e,uploadURL:r};return this.uppy.emit("upload-success",t,i),r&&this.uppy.log(`Download ${t.name} from ${r}`),n(t)}const e=o.getResponseData(a.responseText,a),i=f(a,o.getResponseError(a.responseText,a)),s={status:a.status,body:e};return this.uppy.emit("upload-error",t,i,s),r(i)}),a.addEventListener("error",()=>{this.uppy.log(`[XHRUpload] ${d} errored`),c.done(),l.done(),this.uploaderEvents[t.id]&&(this.uploaderEvents[t.id].remove(),this.uploaderEvents[t.id]=null);const e=f(a,o.getResponseError(a.responseText,a));return this.uppy.emit("upload-error",t,e),r(e)}),a.open(o.method.toUpperCase(),o.endpoint,!0),a.withCredentials=o.withCredentials,""!==o.responseType&&(a.responseType=o.responseType),l=this.requests.run(()=>{this.uppy.emit("upload-started",t);const e=this.getOptions(t);return Object.keys(e.headers).forEach(t=>{a.setRequestHeader(t,e.headers[t])}),a.send(i),()=>{c.done(),a.abort()}}),this.onFileRemove(t.id,()=>{l.abort(),r(new Error("File removed"))}),this.onCancelAll(t.id,e=>{let{reason:t}=e;"user"===t&&l.abort(),r(new Error("Upload cancelled"))})})}uploadRemote(e){const n=this.getOptions(e);return new Promise((r,a)=>{this.uppy.emit("upload-started",e);const u={};(Array.isArray(n.metaFields)?n.metaFields:Object.keys(e.meta)).forEach(t=>{u[t]=e.meta[t]});new(e.remote.providerOptions.provider?t.Provider:t.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,{...e.remote.body,endpoint:n.endpoint,size:e.data.size,fieldname:n.fieldName,metadata:u,httpMethod:n.method,useFormData:n.formData,headers:n.headers}).then(u=>{const{token:l}=u,c=i(e.remote.companionUrl),d=new t.Socket({target:`${c}/api/${l}`,autoOpen:!1});let f;this.uploaderEvents[e.id]=new s(this.uppy),this.onFileRemove(e.id,()=>{d.send("cancel",{}),f.abort(),r(`upload ${e.id} was removed`)}),this.onCancelAll(e.id,function(t){let{reason:n}=void 0===t?{}:t;"user"===n&&(d.send("cancel",{}),f.abort()),r(`upload ${e.id} was canceled`)}),this.onRetry(e.id,()=>{d.send("pause",{}),d.send("resume",{})}),this.onRetryAll(e.id,()=>{d.send("pause",{}),d.send("resume",{})}),d.on("progress",t=>o(this,t,e)),d.on("success",t=>{const o=n.getResponseData(t.response.responseText,t.response),i=o[n.responseUrlFieldName],a={status:t.response.status,body:o,uploadURL:i};return this.uppy.emit("upload-success",e,a),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),r()}),d.on("error",t=>{const r=t.response,o=r?n.getResponseError(r.responseText,r):Object.assign(new Error(t.error.message),{cause:t.error});this.uppy.emit("upload-error",e,o),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),a(o)}),f=this.requests.run(()=>(d.open(),e.isPaused&&d.send("pause",{}),()=>d.close()))}).catch(t=>{this.uppy.emit("upload-error",e,t),a(t)})})}uploadBundle(e){return new Promise((t,n)=>{const{endpoint:r}=this.opts,{method:o}=this.opts,i=this.uppy.getState().xhrUpload,a=this.createBundledUpload(e,{...this.opts,...i||{}}),s=new XMLHttpRequest,l=t=>{e.forEach(e=>{this.uppy.emit("upload-error",e,t)})},c=new u(this.opts.timeout,()=>{s.abort();const e=new Error(this.i18n("timedOut",{seconds:Math.ceil(this.opts.timeout/1e3)}));l(e),n(e)});s.upload.addEventListener("loadstart",()=>{this.uppy.log("[XHRUpload] started uploading bundle"),c.progress()}),s.upload.addEventListener("progress",t=>{c.progress(),t.lengthComputable&&e.forEach(e=>{this.uppy.emit("upload-progress",e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})})}),s.addEventListener("load",r=>{if(c.done(),this.opts.validateStatus(r.target.status,s.responseText,s)){const n=this.opts.getResponseData(s.responseText,s),o={status:r.target.status,body:n};return e.forEach(e=>{this.uppy.emit("upload-success",e,o)}),t()}const o=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return o.request=s,l(o),n(o)}),s.addEventListener("error",()=>{c.done();const e=this.opts.getResponseError(s.responseText,s)||new Error("Upload error");return l(e),n(e)}),this.uppy.on("cancel-all",function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(c.done(),s.abort())}),s.open(o.toUpperCase(),r,!0),s.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(s.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach(e=>{s.setRequestHeader(e,this.opts.headers[e])}),s.send(a),e.forEach(e=>{this.uppy.emit("upload-started",e)})})}uploadFiles(e){const t=e.map((t,n)=>{const r=parseInt(n,10)+1,o=e.length;return t.error?Promise.reject(new Error(t.error)):t.isRemote?this.uploadRemote(t,r,o):this.upload(t,r,o)});return a(t)}onFileRemove(e,t){this.uploaderEvents[e].on("file-removed",n=>{e===n.id&&t(n.id)})}onRetry(e,t){this.uploaderEvents[e].on("upload-retry",n=>{e===n&&t()})}onRetryAll(e,t){this.uploaderEvents[e].on("retry-all",()=>{this.uppy.getFile(e)&&t()})}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",function(){n.uppy.getFile(e)&&t(...arguments)})}handleUpload(e){if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts[n.internalRateLimitedQueue]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=e.map(e=>this.uppy.getFile(e));if(this.opts.bundle){if(t.some(e=>e.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then(()=>null)}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.handleUpload)}}return h.VERSION="2.1.3",dn=h}(),bn=v(yn);var En=function(){if(mn)return vn;mn=1;var e=9007199254740991,t="[object Arguments]",n="[object Function]",r="[object GeneratorFunction]",o=/^(?:0|[1-9]\d*)$/;function i(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););return e}var a,s,u=Object.prototype,l=u.hasOwnProperty,c=u.toString,d=u.propertyIsEnumerable,f=(a=Object.keys,s=Object,function(e){return a(s(e))});function p(e,n){var r=b(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&E(e)}(e)&&l.call(e,"callee")&&(!d.call(e,"callee")||c.call(e)==t)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var a in e)!l.call(e,a)||i&&("length"==a||y(a,o))||r.push(a);return r}var h,g=(h=function(e,t){return e&&v(e,t,w)},function(e,t){if(null==e)return e;if(!E(e))return h(e,t);for(var n=e.length,r=-1,o=Object(e);++r<n&&!1!==t(o[r],r,o););return e}),v=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[++r];if(!1===t(o[s],s,o))break}return e};function m(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||u,t!==r)return f(e);var t,n,r,o=[];for(var i in Object(e))l.call(e,i)&&"constructor"!=i&&o.push(i);return o}function y(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||o.test(t))&&t>-1&&t%1==0&&t<n}var b=Array.isArray;function E(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}(e)?c.call(e):"";return t==n||t==r}(t)}function w(e){return E(e)?p(e):m(e)}function C(e){return e}return vn=function(e,t){return(b(e)?i:g)(e,"function"==typeof t?t:C)}}(),wn=v(En);let Cn=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};function Dn(e){Promise.resolve().then(e)}function An(e){return e.replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&reg;/g,"®").replace(/&copy;/g,"©").replace(/&trade;/g,"™").replace(/&quot;/g,'"')}var Sn=function(e){return Object.prototype.toString.call(e)};function xn(e){return e||{name:""}}function Tn(e){return Object.keys(e).reduce(function(t,n){return t[n]=String(e[n]),t},{})}function Nn(e){var t=e.server,n=void 0===t?"":t,r=e.fieldName,o=void 0===r?"":r,i=e.maxFileSize,a=void 0===i?10485760:i,s=e.maxNumberOfFiles,l=void 0===s?100:s,c=e.meta,p=void 0===c?{}:c,h=e.metaWithUrl,g=void 0!==h&&h,v=e.headers,m=void 0===v?{}:v,y=e.withCredentials,b=void 0!==y&&y,E=e.timeout,w=void 0===E?1e4:E,C=e.onBeforeUpload,D=void 0===C?function(e){return e}:C,A=e.onSuccess,S=void 0===A?function(e,t){}:A,x=e.onError,T=void 0===x?function(e,t,n){console.error("".concat(e.name," upload error"),t,n)}:x,N=e.onProgress,O=void 0===N?function(e){}:N;if(!n)throw new Error("Cannot get upload server address\n没有配置上传地址");if(!o)throw new Error("Cannot get fieldName\n没有配置 fieldName");var B=n;g&&(B=function(e,t){var n=f(e.split("#"),2),r=n[0],o=n[1],i=r,a=[];wn(t,function(e,t){a.push("".concat(t,"=").concat(e))});var s=a.join("&");return i=i.indexOf("?")>0?"".concat(i,"&").concat(s):"".concat(i,"?").concat(s),o?"".concat(i,"#").concat(o):i}(B,p)),function(){if("undefined"!=typeof AbortSignal){var e=AbortSignal;"function"!=typeof e.any&&(e.any=function(e){var t,n,r=new AbortController,o=function(t){e.forEach(function(e){return e.removeEventListener("abort",o)});var n=t.target.reason;r.abort(n)};try{for(var i=d(e),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.aborted){var u=s.reason;return r.abort(u),r.signal}s.addEventListener("abort",o,{once:!0})}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r.signal})}}();var k=function(e){if(e)return"function"==typeof e?function(t){return Tn(e(t))}:Tn(e)}(m),F=new Pt(u({onBeforeUpload:function(e){return D(e)},restrictions:{maxFileSize:a,maxNumberOfFiles:l},meta:p},e.uppyConfig)).use(bn,u({endpoint:B,headers:k,formData:!0,fieldName:o,bundle:!1,withCredentials:b,timeout:w},e.xhrConfig));return F.on("upload-success",function(e,t){var n=(null!=t?t:{}).body,r=void 0===n?{}:n,o=xn(e);try{S(o,r)}catch(e){console.error("wangEditor upload file - onSuccess error",e)}}),F.on("progress",function(e){e<1||O(e)}),F.on("upload-error",function(e,t,n){var r=xn(e);try{T(r,t,n)}catch(e){console.error("wangEditor upload file - onError error",e)}}),F.on("restriction-failed",function(e,t){var n=xn(e);try{T(n,t,void 0)}catch(e){console.error("wangEditor upload file - onError error",e)}}),F}function On(e,t){return e.uploadAdapter?e.uploadAdapter({config:e,editor:t}):Nn(e)}var Bn,kn={};function Fn(){if(Bn)return kn;Bn=1;var e={transform:function(e,t){var n=e.current,r=e.affinity;if(null!=n){var o=y.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},t={transform:function(e,t){var n=e.current,r=e.affinity;if(null!=n){var o=Fe.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},n={transform:function(e,t){var n=e.current,r=e.affinity;if(null!=n){var o=P.transform(n,t,{affinity:r});e.current=o,null==o&&e.unref()}}},r=new WeakMap,o=new WeakMap,i=new WeakMap,a=new WeakMap,s=new WeakMap,u=new WeakMap,l=new WeakMap;function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function d(e,t){return e(t={exports:{}},t.exports),t.exports}var f=d(function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports});c(f);var p=d(function(e){e.exports=function(e){if(Array.isArray(e))return f(e)},e.exports.__esModule=!0,e.exports.default=e.exports});c(p);var h=d(function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports});c(h);var g=d(function(e){e.exports=function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports});c(g);var v=d(function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports});c(v);var m=c(d(function(e){e.exports=function(e){return p(e)||h(e)||g(e)||v()},e.exports.__esModule=!0,e.exports.default=e.exports})),y={ancestors:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.reverse,r=void 0!==n&&n,o=y.levels(e,t);return o=r?o.slice(1):o.slice(0,-1)},common:function(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var o=e[r],i=t[r];if("number"!=typeof o||"number"!=typeof i)throw new Error("Got non-numeric path index");if(o!==i)break;n.push(o)}return n},compare:function(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter:function(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return y.equals(r,o)&&i>a},endsAt:function(e,t){var n=e.length,r=e.slice(0,n),o=t.slice(0,n);return y.equals(r,o)},endsBefore:function(e,t){var n=e.length-1,r=e.slice(0,n),o=t.slice(0,n),i=e[n],a=t[n];return y.equals(r,o)&&i<a},equals:function(e,t){return e.length===t.length&&e.every(function(e,n){return e===t[n]})},hasPrevious:function(e){return e[e.length-1]>0},isAfter:function(e,t){return 1===y.compare(e,t)},isAncestor:function(e,t){return e.length<t.length&&0===y.compare(e,t)},isBefore:function(e,t){return-1===y.compare(e,t)},isChild:function(e,t){return e.length===t.length+1&&0===y.compare(e,t)},isCommon:function(e,t){return e.length<=t.length&&0===y.compare(e,t)},isDescendant:function(e,t){return e.length>t.length&&0===y.compare(e,t)},isParent:function(e,t){return e.length+1===t.length&&0===y.compare(e,t)},isPath:function(e){return Array.isArray(e)&&e.every(function(e){return"number"==typeof e})},isSibling:function(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&y.equals(n,r)},levels:function(e){for(var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).reverse,n=void 0!==t&&t,r=[],o=0;o<=e.length;o++)r.push(e.slice(0,o));return n&&r.reverse(),r},next:function(e){if(0===e.length)throw new Error("Cannot get the next path of a root path [".concat(e,"], because it has no next index."));var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath:function(e){switch(e.type){case"insert_node":case"remove_node":case"merge_node":case"split_node":case"move_node":return!0;default:return!1}},parent:function(e){if(0===e.length)throw new Error("Cannot get the parent path of the root path [".concat(e,"]."));return e.slice(0,-1)},previous:function(e){if(0===e.length)throw new Error("Cannot get the previous path of a root path [".concat(e,"], because it has no previous index."));var t=e[e.length-1];if(t<=0)throw new Error("Cannot get the previous path of a first child path [".concat(e,"] because it would result in a negative index."));return e.slice(0,-1).concat(t-1)},relative:function(e,t){if(!y.isAncestor(t,e)&&!y.equals(e,t))throw new Error("Cannot get the relative path of [".concat(e,"] inside ancestor [").concat(t,"], because it is not above or equal to the path."));return e.slice(t.length)},transform:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return null;var r=m(e),o=n.affinity,i=void 0===o?"forward":o;if(0===e.length)return r;switch(t.type){case"insert_node":var a=t.path;(y.equals(a,r)||y.endsBefore(a,r)||y.isAncestor(a,r))&&(r[a.length-1]+=1);break;case"remove_node":var s=t.path;if(y.equals(s,r)||y.isAncestor(s,r))return null;y.endsBefore(s,r)&&(r[s.length-1]-=1);break;case"merge_node":var u=t.path,l=t.position;y.equals(u,r)||y.endsBefore(u,r)?r[u.length-1]-=1:y.isAncestor(u,r)&&(r[u.length-1]-=1,r[u.length]+=l);break;case"split_node":var c=t.path,d=t.position;if(y.equals(c,r)){if("forward"===i)r[r.length-1]+=1;else if("backward"!==i)return null}else y.endsBefore(c,r)?r[c.length-1]+=1:y.isAncestor(c,r)&&e[c.length]>=d&&(r[c.length-1]+=1,r[c.length]-=d);break;case"move_node":var f=t.path,p=t.newPath;if(y.equals(f,p))return r;if(y.isAncestor(f,r)||y.equals(f,r)){var h=p.slice();return y.endsBefore(f,p)&&f.length<p.length&&(h[f.length-1]-=1),h.concat(r.slice(f.length))}y.isSibling(f,p)&&(y.isAncestor(p,r)||y.equals(p,r))?y.endsBefore(f,r)?r[f.length-1]-=1:r[f.length-1]+=1:y.endsBefore(p,r)||y.equals(p,r)||y.isAncestor(p,r)?(y.endsBefore(f,r)&&(r[f.length-1]-=1),r[p.length-1]+=1):y.endsBefore(f,r)&&(y.equals(p,r)&&(r[p.length-1]+=1),r[f.length-1]-=1)}return r}},b=d(function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}),E=c(b),w=d(function(e){var t=b.default;e.exports=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports});c(w);var C=d(function(e){var t=b.default;e.exports=function(e){var n=w(e,"string");return"symbol"===t(n)?n:String(n)},e.exports.__esModule=!0,e.exports.default=e.exports});c(C);var D=c(d(function(e){e.exports=function(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports})),A=d(function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports});c(A);var S=d(function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],u=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports});c(S);var x=d(function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports});c(x);var T=d(function(e){e.exports=function(e,t){return A(e)||S(e,t)||g(e,t)||x()},e.exports.__esModule=!0,e.exports.default=e.exports}),N=c(T),O=d(function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.__esModule=!0,e.exports.default=e.exports});c(O);var B=d(function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o=O(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o},e.exports.__esModule=!0,e.exports.default=e.exports}),k=c(B),F=["anchor","focus"];function I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var P={edges:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).reverse,n=void 0!==t&&t,r=e.anchor,o=e.focus;return P.isBackward(e)===n?[r,o]:[o,r]},end:function(e){var t=P.edges(e),n=N(t,2)[1];return n},equals:function(e,t){return Fe.equals(e.anchor,t.anchor)&&Fe.equals(e.focus,t.focus)},surrounds:function(e,t){var n=P.intersection(e,t);return!!n&&P.equals(n,t)},includes:function(e,t){if(Ne.isRange(t)){if(P.includes(e,t.anchor)||P.includes(e,t.focus))return!0;var n=P.edges(e),r=N(n,2),o=r[0],i=r[1],a=P.edges(t),s=N(a,2),u=s[0],l=s[1];return Fe.isBefore(o,u)&&Fe.isAfter(i,l)}var c=P.edges(e),d=N(c,2),f=d[0],p=d[1],h=!1,g=!1;return Ne.isPoint(t)?(h=Fe.compare(t,f)>=0,g=Fe.compare(t,p)<=0):(h=y.compare(t,f.path)>=0,g=y.compare(t,p.path)<=0),h&&g},intersection:function(e,t){e.anchor,e.focus;var n=k(e,F),r=P.edges(e),o=N(r,2),i=o[0],a=o[1],s=P.edges(t),u=N(s,2),l=u[0],c=u[1],d=Fe.isBefore(i,l)?l:i,f=Fe.isBefore(a,c)?a:c;return Fe.isBefore(f,d)?null:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?I(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({anchor:d,focus:f},n)},isBackward:function(e){var t=e.anchor,n=e.focus;return Fe.isAfter(t,n)},isCollapsed:function(e){var t=e.anchor,n=e.focus;return Fe.equals(t,n)},isExpanded:function(e){return!P.isCollapsed(e)},isForward:function(e){return!P.isBackward(e)},isRange:function(e){return q(e)&&Fe.isPoint(e.anchor)&&Fe.isPoint(e.focus)},points:function*(e){yield[e.anchor,"anchor"],yield[e.focus,"focus"]},start:function(e){var t=P.edges(e),n=N(t,1)[0];return n},transform:function(e,t){if(null===e)return null;var n,r,o=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).affinity,i=void 0===o?"inward":o;if("inward"===i){var a=P.isCollapsed(e);P.isForward(e)?(n="forward",r=a?n:"backward"):(n="backward",r=a?n:"forward")}else"outward"===i?P.isForward(e)?(n="backward",r="forward"):(n="forward",r="backward"):(n=i,r=i);var s=Fe.transform(e.anchor,t,{affinity:n}),u=Fe.transform(e.focus,t,{affinity:r});return s&&u?{anchor:s,focus:u}:null}},R=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).deep,n=void 0!==t&&t;return!!q(e)&&("function"!=typeof e.apply&&(n?U.isNodeList(e.children):Array.isArray(e.children)))},_={isAncestor:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).deep,n=void 0!==t&&t;return q(e)&&U.isNodeList(e.children,{deep:n})},isElement:R,isElementList:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).deep,n=void 0!==t&&t;return Array.isArray(e)&&e.every(function(e){return _.isElement(e,{deep:n})})},isElementProps:function(e){return void 0!==e.children},isElementType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return R(e)&&e[n]===t},matches:function(e,t){for(var n in t)if("children"!==n&&e[n]!==t[n])return!1;return!0}},L=["text"],M=["children"];function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function z(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return $(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var U={ancestor:function(e,t){var n=U.get(e,t);if(U.isText(n))throw new Error("Cannot get the ancestor node at path [".concat(t,"] because it refers to a text node instead: ").concat(Pe.stringify(n)));return n},ancestors:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){var r,o=z(y.ancestors(t,n));try{for(o.s();!(r=o.n()).done;){var i=r.value,a=[U.ancestor(e,i),i];yield a}}catch(e){o.e(e)}finally{o.f()}}()},child:function(e,t){if(U.isText(e))throw new Error("Cannot get the child of a text node: ".concat(Pe.stringify(e)));if("number"!=typeof t)throw new Error("Expected index to be a number");var n=e.children[t];if(null==n)throw new Error("Cannot get child at index `".concat(t,"` in node: ").concat(Pe.stringify(e)));return n},children:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){for(var r=n.reverse,o=void 0!==r&&r,i=U.ancestor(e,t),a=i.children,s=o?a.length-1:0;o?s>=0:s<a.length;){var u=U.child(i,s),l=t.concat(s);yield[u,l],s=o?s-1:s+1}}()},common:function(e,t,n){var r=y.common(t,n);return[U.get(e,r),r]},descendant:function(e,t){var n=U.get(e,t);if(U.isEditor(n))throw new Error("Cannot get the descendant node at path [".concat(t,"] because it refers to the root editor node instead: ").concat(Pe.stringify(n)));return n},descendants:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var n,r=z(U.nodes(e,t));try{for(r.s();!(n=r.n()).done;){var o=N(n.value,2),i=o[0],a=o[1];0!==a.length&&(yield[i,a])}}catch(e){r.e(e)}finally{r.f()}}()},elements:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var n,r=z(U.nodes(e,t));try{for(r.s();!(n=r.n()).done;){var o=N(n.value,2),i=o[0],a=o[1];U.isElement(i)&&(yield[i,a])}}catch(e){r.e(e)}finally{r.f()}}()},extractProps:function(e){return U.isText(e)?(e.text,k(e,L)):(e.children,k(e,M))},first:function(e,t){for(var n=t.slice(),r=U.get(e,n);r&&!U.isText(r)&&0!==r.children.length;)r=r.children[0],n.push(0);return[r,n]},fragment:function(e,t){var n,r={children:e.children},o=P.edges(t),i=N(o,2),a=i[0],s=i[1],u=U.nodes(r,{reverse:!0,pass:function(e){var n=N(e,2)[1];return!P.includes(t,n)}}),l=z(u);try{var c=function(){var e=N(n.value,2)[1];if(!P.includes(t,e)){var o=e[e.length-1];Ke(r,y.parent(e),function(e){return Ge(e,o,1)})}y.equals(e,s.path)&&Ye(r,e,function(e){var t=e.text.slice(0,s.offset);return H(H({},e),{},{text:t})}),y.equals(e,a.path)&&Ye(r,e,function(e){var t=e.text.slice(a.offset);return H(H({},e),{},{text:t})})};for(l.s();!(n=l.n()).done;)c()}catch(e){l.e(e)}finally{l.f()}return r.children},get:function(e,t){var n=U.getIf(e,t);if(void 0===n)throw new Error("Cannot find a descendant at path [".concat(t,"] in node: ").concat(Pe.stringify(e)));return n},getIf:function(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if("number"!=typeof o)throw new Error("Got non-numeric path index");if(U.isText(n)||!n.children[o])return;n=n.children[o]}return n},has:function(e,t){for(var n=e,r=0;r<t.length;r++){var o=t[r];if("number"!=typeof o)throw new Error("Got non-numeric path index");if(U.isText(n)||!n.children[o])return!1;n=n.children[o]}return!0},isAncestor:function(e){return!U.isText(e)},isEditor:function(e){return"function"==typeof e.apply},isElement:function(e){return Array.isArray(e.children)&&"function"!=typeof e.apply},isNode:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).deep,n=void 0!==t&&t;return ze.isText(e)||_.isElement(e,{deep:n})||Te.isEditor(e,{deep:n})},isNodeList:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).deep,n=void 0!==t&&t;return Array.isArray(e)&&e.every(function(e){return U.isNode(e,{deep:n})})},isText:function(e){return"string"==typeof e.text},last:function(e,t){for(var n=t.slice(),r=U.get(e,n);r&&!U.isText(r)&&0!==r.children.length;){var o=r.children.length-1;r=r.children[o],n.push(o)}return[r,n]},leaf:function(e,t){var n=U.get(e,t);if(!U.isText(n))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Pe.stringify(n)));return n},levels:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function*(){var r,o=z(y.levels(t,n));try{for(o.s();!(r=o.n()).done;){var i=r.value,a=U.get(e,i);yield[a,i]}}catch(e){o.e(e)}finally{o.f()}}()},matches:function(e,t){return U.isElement(e)&&_.isElementProps(t)&&_.matches(e,t)||U.isText(e)&&ze.isTextProps(t)&&ze.matches(e,t)},nodes:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){for(var n=t.pass,r=t.reverse,o=void 0!==r&&r,i=t.from,a=void 0===i?[]:i,s=t.to,u=new Set,l=[],c=e;!s||!(o?y.isBefore(l,s):y.isAfter(l,s));)if(u.has(c)||(yield[c,l]),u.has(c)||U.isText(c)||0===c.children.length||null!=n&&!1!==n([c,l])){if(0===l.length)break;if(!o){var d=y.next(l);if(U.has(e,d)){l=d,c=U.get(e,l);continue}}if(o&&0!==l[l.length-1])l=y.previous(l),c=U.get(e,l);else l=y.parent(l),c=U.get(e,l),u.add(c)}else{u.add(c);var f=o?c.children.length-1:0;y.isAncestor(l,a)&&(f=a[l.length]),l=l.concat(f),c=U.get(e,l)}}()},parent:function(e,t){var n=y.parent(t),r=U.get(e,n);if(U.isText(r))throw new Error("Cannot get the parent of path [".concat(t,"] because it does not exist in the root."));return r},string:function(e){return U.isText(e)?e.text:e.children.map(U.string).join("")},texts:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var n,r=z(U.nodes(e,t));try{for(r.s();!(n=r.n()).done;){var o=N(n.value,2),i=o[0],a=o[1];U.isText(i)&&(yield[i,a])}}catch(e){r.e(e)}finally{r.f()}}()}};function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function W(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var G={isNodeOperation:function(e){return G.isOperation(e)&&e.type.endsWith("_node")},isOperation:function(e){if(!q(e))return!1;switch(e.type){case"insert_node":case"remove_node":return y.isPath(e.path)&&U.isNode(e.node);case"insert_text":case"remove_text":return"number"==typeof e.offset&&"string"==typeof e.text&&y.isPath(e.path);case"merge_node":return"number"==typeof e.position&&y.isPath(e.path)&&q(e.properties);case"move_node":return y.isPath(e.path)&&y.isPath(e.newPath);case"set_node":return y.isPath(e.path)&&q(e.properties)&&q(e.newProperties);case"set_selection":return null===e.properties&&P.isRange(e.newProperties)||null===e.newProperties&&P.isRange(e.properties)||q(e.properties)&&q(e.newProperties);case"split_node":return y.isPath(e.path)&&"number"==typeof e.position&&q(e.properties);default:return!1}},isOperationList:function(e){return Array.isArray(e)&&e.every(function(e){return G.isOperation(e)})},isSelectionOperation:function(e){return G.isOperation(e)&&e.type.endsWith("_selection")},isTextOperation:function(e){return G.isOperation(e)&&e.type.endsWith("_text")},inverse:function(e){switch(e.type){case"insert_node":return W(W({},e),{},{type:"remove_node"});case"insert_text":return W(W({},e),{},{type:"remove_text"});case"merge_node":return W(W({},e),{},{type:"split_node",path:y.previous(e.path)});case"move_node":var t=e.newPath,n=e.path;if(y.equals(t,n))return e;if(y.isSibling(n,t))return W(W({},e),{},{path:t,newPath:n});var r=y.transform(n,e),o=y.transform(y.next(n),e);return W(W({},e),{},{path:r,newPath:o});case"remove_node":return W(W({},e),{},{type:"insert_node"});case"remove_text":return W(W({},e),{},{type:"insert_text"});case"set_node":var i=e.properties,a=e.newProperties;return W(W({},e),{},{properties:a,newProperties:i});case"set_selection":var s=e.properties,u=e.newProperties;return W(W({},e),{},null==s?{properties:u,newProperties:null}:null==u?{properties:null,newProperties:s}:{properties:u,newProperties:s});case"split_node":return W(W({},e),{},{type:"merge_node",path:y.next(e.path)})}}},q=function(e){return"object"===E(e)&&null!==e},K=function e(t,n){for(var r in t){var o=Object.hasOwn(t,r)?t[r]:void 0,i=Object.hasOwn(n,r)?n[r]:void 0;if(Array.isArray(o)&&Array.isArray(i)){if(o.length!==i.length)return!1;for(var a=0;a<o.length;a++)if(o[a]!==i[a])return!1}else if(q(o)&&q(i)){if(!e(o,i))return!1}else if(o!==i)return!1}for(var s in n)if(void 0===t[s]&&void 0!==n[s])return!1;return!0},Y=function(e){return e.selection?e.selection:e.children.length>0?Te.end(e,[]):[0]},X=function(e,t){var n=Te.node(e,t),r=N(n,1)[0];return function(e){return e===r}};function Z(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return J(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return J(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function J(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Q,ee=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!n,o=n?ae(e):e,i=Q.None,a=Q.None,s=0,u=null,l=Z(o);try{for(l.s();!(t=l.n()).done;){var c=t.value,d=c.codePointAt(0);if(!d)break;var f=ye(c,d),p=N(r?[a,f]:[f,i],2);if(i=p[0],a=p[1],be(i,Q.ZWJ)&&be(a,Q.ExtPict)&&!De(r?e.substring(0,s):e.substring(0,e.length-s)))break;if(be(i,Q.RI)&&be(a,Q.RI)&&!(u=null!==u?!u:!!r||Se(e.substring(0,e.length-s))))break;if(i!==Q.None&&a!==Q.None&&we(i,a))break;s+=c.length}}catch(e){l.e(e)}finally{l.f()}return s||1},te=/\s/,ne=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,re=/['\u2018\u2019]/,oe=function(e,t,n){if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},ie=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(te.test(t))return!1;if(re.test(t)){var o=ee(n,r),i=oe(n,o,r),a=N(i,2);if(e(a[0],a[1],r))return!0}return!ne.test(t)},ae=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(ue(r.charCodeAt(0))){var o=e.charAt(t-n-1);if(se(o.charCodeAt(0))){yield o+r,n++;continue}}yield r}},se=function(e){return e>=55296&&e<=56319},ue=function(e){return e>=56320&&e<=57343};!function(e){e[e.None=0]="None",e[e.Extend=1]="Extend",e[e.ZWJ=2]="ZWJ",e[e.RI=4]="RI",e[e.Prepend=8]="Prepend",e[e.SpacingMark=16]="SpacingMark",e[e.L=32]="L",e[e.V=64]="V",e[e.T=128]="T",e[e.LV=256]="LV",e[e.LVT=512]="LVT",e[e.ExtPict=1024]="ExtPict",e[e.Any=2048]="Any"}(Q||(Q={}));var le=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,ce=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,de=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,fe=/^[\u1100-\u115F\uA960-\uA97C]$/,pe=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,he=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,ge=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,ve=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,me=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,ye=function(e,t){var n=Q.Any;return-1!==e.search(le)&&(n|=Q.Extend),8205===t&&(n|=Q.ZWJ),t>=127462&&t<=127487&&(n|=Q.RI),-1!==e.search(ce)&&(n|=Q.Prepend),-1!==e.search(de)&&(n|=Q.SpacingMark),-1!==e.search(fe)&&(n|=Q.L),-1!==e.search(pe)&&(n|=Q.V),-1!==e.search(he)&&(n|=Q.T),-1!==e.search(ge)&&(n|=Q.LV),-1!==e.search(ve)&&(n|=Q.LVT),-1!==e.search(me)&&(n|=Q.ExtPict),n};function be(e,t){return 0!==(e&t)}var Ee=[[Q.L,Q.L|Q.V|Q.LV|Q.LVT],[Q.LV|Q.V,Q.V|Q.T],[Q.LVT|Q.T,Q.T],[Q.Any,Q.Extend|Q.ZWJ],[Q.Any,Q.SpacingMark],[Q.Prepend,Q.Any],[Q.ZWJ,Q.ExtPict],[Q.RI,Q.RI]];function we(e,t){return-1===Ee.findIndex(function(n){return be(e,n[0])&&be(t,n[1])})}var Ce=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,De=function(e){return-1!==e.search(Ce)},Ae=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,Se=function(e){var t=e.match(Ae);return null!==t&&t[0].length/2%2==1},xe=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).deep,n=void 0!==t&&t;if(!q(e))return!1;var r="function"==typeof e.above&&"function"==typeof e.addMark&&"function"==typeof e.after&&"function"==typeof e.apply&&"function"==typeof e.before&&"function"==typeof e.collapse&&"function"==typeof e.delete&&"function"==typeof e.deleteBackward&&"function"==typeof e.deleteForward&&"function"==typeof e.deleteFragment&&"function"==typeof e.deselect&&"function"==typeof e.edges&&"function"==typeof e.elementReadOnly&&"function"==typeof e.end&&"function"==typeof e.first&&"function"==typeof e.fragment&&"function"==typeof e.getDirtyPaths&&"function"==typeof e.getFragment&&"function"==typeof e.getMarks&&"function"==typeof e.hasBlocks&&"function"==typeof e.hasInlines&&"function"==typeof e.hasPath&&"function"==typeof e.hasTexts&&"function"==typeof e.insertBreak&&"function"==typeof e.insertFragment&&"function"==typeof e.insertNode&&"function"==typeof e.insertNodes&&"function"==typeof e.insertSoftBreak&&"function"==typeof e.insertText&&"function"==typeof e.isBlock&&"function"==typeof e.isEdge&&"function"==typeof e.isElementReadOnly&&"function"==typeof e.isEmpty&&"function"==typeof e.isEnd&&"function"==typeof e.isInline&&"function"==typeof e.isNormalizing&&"function"==typeof e.isSelectable&&"function"==typeof e.isStart&&"function"==typeof e.isVoid&&"function"==typeof e.last&&"function"==typeof e.leaf&&"function"==typeof e.levels&&"function"==typeof e.liftNodes&&"function"==typeof e.markableVoid&&"function"==typeof e.mergeNodes&&"function"==typeof e.move&&"function"==typeof e.moveNodes&&"function"==typeof e.next&&"function"==typeof e.node&&"function"==typeof e.nodes&&"function"==typeof e.normalize&&"function"==typeof e.normalizeNode&&"function"==typeof e.onChange&&"function"==typeof e.parent&&"function"==typeof e.path&&"function"==typeof e.pathRef&&"function"==typeof e.pathRefs&&"function"==typeof e.point&&"function"==typeof e.pointRef&&"function"==typeof e.pointRefs&&"function"==typeof e.positions&&"function"==typeof e.previous&&"function"==typeof e.range&&"function"==typeof e.rangeRef&&"function"==typeof e.rangeRefs&&"function"==typeof e.removeMark&&"function"==typeof e.removeNodes&&"function"==typeof e.select&&"function"==typeof e.setNodes&&"function"==typeof e.setNormalizing&&"function"==typeof e.setPoint&&"function"==typeof e.setSelection&&"function"==typeof e.shouldMergeNodesRemovePrevNode&&"function"==typeof e.shouldNormalize&&"function"==typeof e.splitNodes&&"function"==typeof e.start&&"function"==typeof e.string&&"function"==typeof e.unhangRange&&"function"==typeof e.unsetNodes&&"function"==typeof e.unwrapNodes&&"function"==typeof e.void&&"function"==typeof e.withoutNormalizing&&"function"==typeof e.wrapNodes&&(null===e.marks||q(e.marks))&&(null===e.selection||P.isRange(e.selection))&&(n?U.isNodeList(e.children)&&G.isOperationList(e.operations):Array.isArray(e.children)&&Array.isArray(e.operations));return r},Te={above:function(e,t){return e.above(t)},addMark:function(e,t,n){e.addMark(t,n)},after:function(e,t,n){return e.after(t,n)},before:function(e,t,n){return e.before(t,n)},deleteBackward:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).unit,n=void 0===t?"character":t;e.deleteBackward(n)},deleteForward:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).unit,n=void 0===t?"character":t;e.deleteForward(n)},deleteFragment:function(e,t){e.deleteFragment(t)},edges:function(e,t){return e.edges(t)},elementReadOnly:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.elementReadOnly(t)},end:function(e,t){return e.end(t)},first:function(e,t){return e.first(t)},fragment:function(e,t){return e.fragment(t)},hasBlocks:function(e,t){return e.hasBlocks(t)},hasInlines:function(e,t){return e.hasInlines(t)},hasPath:function(e,t){return e.hasPath(t)},hasTexts:function(e,t){return e.hasTexts(t)},insertBreak:function(e){e.insertBreak()},insertFragment:function(e,t,n){e.insertFragment(t,n)},insertNode:function(e,t){e.insertNode(t)},insertSoftBreak:function(e){e.insertSoftBreak()},insertText:function(e,t){e.insertText(t)},isBlock:function(e,t){return e.isBlock(t)},isEdge:function(e,t,n){return e.isEdge(t,n)},isEditor:xe,isElementReadOnly:function(e,t){return e.isElementReadOnly(t)},isEmpty:function(e,t){return e.isEmpty(t)},isEnd:function(e,t,n){return e.isEnd(t,n)},isInline:function(e,t){return e.isInline(t)},isNormalizing:function(e){return e.isNormalizing()},isSelectable:function(e,t){return e.isSelectable(t)},isStart:function(e,t,n){return e.isStart(t,n)},isVoid:function(e,t){return e.isVoid(t)},last:function(e,t){return e.last(t)},leaf:function(e,t,n){return e.leaf(t,n)},levels:function(e,t){return e.levels(t)},marks:function(e){return e.getMarks()},next:function(e,t){return e.next(t)},node:function(e,t,n){return e.node(t,n)},nodes:function(e,t){return e.nodes(t)},normalize:function(e,t){e.normalize(t)},parent:function(e,t,n){return e.parent(t,n)},path:function(e,t,n){return e.path(t,n)},pathRef:function(e,t,n){return e.pathRef(t,n)},pathRefs:function(e){return e.pathRefs()},point:function(e,t,n){return e.point(t,n)},pointRef:function(e,t,n){return e.pointRef(t,n)},pointRefs:function(e){return e.pointRefs()},positions:function(e,t){return e.positions(t)},previous:function(e,t){return e.previous(t)},range:function(e,t,n){return e.range(t,n)},rangeRef:function(e,t,n){return e.rangeRef(t,n)},rangeRefs:function(e){return e.rangeRefs()},removeMark:function(e,t){e.removeMark(t)},setNormalizing:function(e,t){e.setNormalizing(t)},start:function(e,t){return e.start(t)},string:function(e,t,n){return e.string(t,n)},unhangRange:function(e,t,n){return e.unhangRange(t,n)},void:function(e,t){return e.void(t)},withoutNormalizing:function(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:function(e,t,n){return e.shouldMergeNodesRemovePrevNode(t,n)}},Ne={isLocation:function(e){return y.isPath(e)||Fe.isPoint(e)||P.isRange(e)},isPath:function(e){return Array.isArray(e)},isPoint:function(e){return"offset"in e},isRange:function(e){return"anchor"in e},isSpan:function(e){return Array.isArray(e)&&Array.isArray(e[0])}},Oe={isSpan:function(e){return Array.isArray(e)&&2===e.length&&e.every(y.isPath)}};function Be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Be(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Fe={compare:function(e,t){var n=y.compare(e.path,t.path);return 0===n?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter:function(e,t){return 1===Fe.compare(e,t)},isBefore:function(e,t){return-1===Fe.compare(e,t)},equals:function(e,t){return e.offset===t.offset&&y.equals(e.path,t.path)},isPoint:function(e){return q(e)&&"number"==typeof e.offset&&y.isPath(e.path)},transform:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===e)return null;var r=n.affinity,o=void 0===r?"forward":r,i=e.path,a=e.offset;switch(t.type){case"insert_node":case"move_node":i=y.transform(i,t,n);break;case"insert_text":y.equals(t.path,i)&&(t.offset<a||t.offset===a&&"forward"===o)&&(a+=t.text.length);break;case"merge_node":y.equals(t.path,i)&&(a+=t.position),i=y.transform(i,t,n);break;case"remove_text":y.equals(t.path,i)&&t.offset<=a&&(a-=Math.min(a-t.offset,t.text.length));break;case"remove_node":if(y.equals(t.path,i)||y.isAncestor(t.path,i))return null;i=y.transform(i,t,n);break;case"split_node":if(y.equals(t.path,i)){if(t.position===a&&null==o)return null;(t.position<a||t.position===a&&"forward"===o)&&(a-=t.position,i=y.transform(i,t,ke(ke({},n),{},{affinity:"forward"})))}else i=y.transform(i,t,n);break;default:return e}return{path:i,offset:a}}},Ie=void 0,Pe={setScrubber:function(e){Ie=e},stringify:function(e){return JSON.stringify(e,Ie)}},Re=["text"],_e=["anchor","focus","merge"];function Le(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Me(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ze={equals:function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).loose,r=void 0!==n&&n;function o(e){return e.text,k(e,Re)}return K(r?o(e):e,r?o(t):t)},isText:function(e){return q(e)&&"string"==typeof e.text},isTextList:function(e){return Array.isArray(e)&&e.every(function(e){return ze.isText(e)})},isTextProps:function(e){return void 0!==e.text},matches:function(e,t){for(var n in t)if("text"!==n&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations:function(e,t){var n,r=[{leaf:He({},e)}],o=Le(t);try{for(o.s();!(n=o.n()).done;){var i,a=n.value,s=(a.anchor,a.focus,a.merge),u=k(a,_e),l=P.edges(a),c=N(l,2),d=c[0],f=c[1],p=[],h=0,g=d.offset,v=f.offset,m=null!=s?s:Object.assign,y=Le(r);try{for(y.s();!(i=y.n()).done;){var b=i.value.leaf,E=b.text.length,w=h;if(h+=E,g<=w&&h<=v)m(b,u),p.push({leaf:b});else if(g!==v&&(g===h||v===w)||g>h||v<w||v===w&&0!==w)p.push({leaf:b});else{var C=b,D=void 0,A=void 0;if(v<h){var S=v-w;A={leaf:He(He({},C),{},{text:C.text.slice(S)})},C=He(He({},C),{},{text:C.text.slice(0,S)})}if(g>w){var x=g-w;D={leaf:He(He({},C),{},{text:C.text.slice(0,x)})},C=He(He({},C),{},{text:C.text.slice(x)})}m(C,u),D&&p.push(D),p.push({leaf:C}),A&&p.push(A)}}}catch(e){y.e(e)}finally{y.f()}r=p}}catch(e){o.e(e)}finally{o.f()}if(r.length>1){var T,O=0,B=Le(r.entries());try{for(B.s();!(T=B.n()).done;){var F=N(T.value,2),I=F[0],R=F[1],_=O,L=_+R.leaf.text.length,M={start:_,end:L};0===I&&(M.isFirst=!0),I===r.length-1&&(M.isLast=!0),R.position=M,O=L}}catch(e){B.e(e)}finally{B.f()}}return r}};function $e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$e(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ve=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return[].concat(m(e.slice(0,t)),r,m(e.slice(t)))},We=function(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];return[].concat(m(e.slice(0,t)),o,m(e.slice(t+n)))},Ge=We,qe=function(e,t,n){if(0===t.length)throw new Error("Cannot modify the editor");for(var r=U.get(e,t),o=t.slice(),i=n(r);o.length>1;){var a=o.pop(),s=U.get(e,o);i=Ue(Ue({},s),{},{children:We(s.children,a,1,i)})}var u=o.pop();e.children=We(e.children,u,1,i)},Ke=function(e,t,n){0===t.length?e.children=n(e.children):qe(e,t,function(e){if(U.isText(e))throw new Error("Cannot get the element at path [".concat(t,"] because it refers to a leaf node: ").concat(Pe.stringify(e)));return Ue(Ue({},e),{},{children:n(e.children)})})},Ye=function(e,t,n){return qe(e,t,function(e){if(!U.isText(e))throw new Error("Cannot get the leaf node at path [".concat(t,"] because it refers to a non-leaf node: ").concat(Pe.stringify(e)));return n(e)})};function Xe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ze(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var et=["children","text"].concat(m(Object.getOwnPropertyNames(Object.prototype))),tt=Object.getOwnPropertyNames(Object.prototype),nt={transform:function(e,t){var n=!1;switch(t.type){case"insert_node":var r=t.path,o=t.node;Ke(e,y.parent(r),function(e){var t=r[r.length-1];if(t>e.length)throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r,"] because the destination is past the end of the node."));return Ve(e,t,o)}),n=!0;break;case"insert_text":var i=t.path,a=t.offset,s=t.text;if(0===s.length)break;Ye(e,i,function(e){var t=e.text.slice(0,a),n=e.text.slice(a);return Qe(Qe({},e),{},{text:t+s+n})}),n=!0;break;case"merge_node":var u=t.path,l=u[u.length-1],c=y.previous(u),d=c[c.length-1];if(0===u.length)throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u,"] because the root node cannot be merged."));if("number"!=typeof l||"number"!=typeof d)throw new Error("Index must be number");Ke(e,y.parent(u),function(e){var t,n=e[l],r=e[d];if(U.isText(n)&&U.isText(r))t=Qe(Qe({},r),{},{text:r.text+n.text});else{if(!U.isElement(n)||!U.isElement(r))throw new Error('Cannot apply a "merge_node" operation at path ['.concat(u,"] to nodes of different interfaces: ").concat(Pe.stringify(n)," ").concat(Pe.stringify(r)));t=Qe(Qe({},r),{},{children:r.children.concat(n.children)})}return We(e,d,2,t)}),n=!0;break;case"move_node":var f=t.path,p=t.newPath,h=f[f.length-1];if(y.isAncestor(f,p))throw new Error("Cannot move a path [".concat(f,"] to new path [").concat(p,"] because the destination is inside itself."));var g=U.get(e,f);Ke(e,y.parent(f),function(e){return Ge(e,h,1)});var v=y.transform(f,t),m=v[v.length-1];Ke(e,y.parent(v),function(e){return Ve(e,m,g)}),n=!0;break;case"remove_node":var b=t.path,E=b[b.length-1];if(Ke(e,y.parent(b),function(e){return Ge(e,E,1)}),e.selection){var w,C=Qe({},e.selection),D=Xe(P.points(C));try{for(D.s();!(w=D.n()).done;){var A=N(w.value,2),S=A[0],x=A[1],T=Fe.transform(S,t);if(null!=C&&null!=T)C[x]=T;else{var O,B=void 0,k=void 0,F=Xe(U.texts(e));try{for(F.s();!(O=F.n()).done;){var I=N(O.value,2),R=I[0],_=I[1];if(-1!==y.compare(_,b)){k=[R,_];break}B=[R,_]}}catch(e){F.e(e)}finally{F.f()}var L=!1;B&&k&&(L=!y.isSibling(B[1],b)&&(!!y.equals(k[1],b)||y.common(B[1],b).length<y.common(k[1],b).length)),B&&!L?C[x]={path:B[1],offset:B[0].text.length}:k?C[x]={path:k[1],offset:0}:C=null}}}catch(e){D.e(e)}finally{D.f()}C&&P.equals(C,e.selection)||(e.selection=C)}break;case"remove_text":var M=t.path,j=t.offset,H=t.text;if(0===H.length)break;Ye(e,M,function(e){var t=e.text.slice(0,j),n=e.text.slice(j+H.length);return Qe(Qe({},e),{},{text:t+n})}),n=!0;break;case"set_node":var z=t.path,$=t.properties,V=t.newProperties;if(0===z.length)throw new Error("Cannot set properties on the root node!");qe(e,z,function(e){var t=Qe({},e);for(var n in V){if(et.includes(n))throw new Error('Cannot set the "'.concat(n,'" property of nodes!'));var r=V[n];if("then"===n&&"function"==typeof r)throw new Error('Cannot set the "then" property of a node to a function');null==r?delete t[n]:t[n]=r}for(var o in $)Object.hasOwn(V,o)||delete t[o];return t});break;case"set_selection":var W=t.newProperties;if(null==W){e.selection=null;break}if(null==e.selection){if(!W.anchor||!W.focus)throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Pe.stringify(W)," when there is no current selection."));e.selection=Qe({},W);break}var G=Qe({},e.selection);for(var q in W){if(tt.includes(q))throw new Error('Cannot set the "'.concat(q,'" property of the selection!'));var K=W[q];if("then"===q&&"function"==typeof K)throw new Error('Cannot set the "then" property of the selection to a function');if(null==K){if("anchor"===q||"focus"===q)throw new Error('Cannot remove the "'.concat(q,'" selection property'));delete G[q]}else G[q]=K}e.selection=G;break;case"split_node":var Y=t.path,X=t.position,Z=t.properties,J=Y[Y.length-1];if(0===Y.length)throw new Error('Cannot apply a "split_node" operation at path ['.concat(Y,"] because the root node cannot be split."));if("number"!=typeof J)throw new Error("Index must be number");Ke(e,y.parent(Y),function(e){var t,n,r=e[J];if(U.isText(r)){var o=r.text.slice(0,X),i=r.text.slice(X);t=Qe(Qe({},r),{},{text:o}),n={text:i}}else{var a=r.children.slice(0,X),s=r.children.slice(X);t=Qe(Qe({},r),{},{children:a}),n={children:s}}for(var u in Z){if(et.includes(u))throw new Error('Cannot set the "'.concat(u,'" property of nodes!'));var l=Z[u];if("then"===u&&"function"==typeof l)throw new Error('Cannot set the "then" property of a node to a function');null!=l&&(n[u]=l)}return We(e,J,1,t,n)}),n=!0}if(n&&e.selection){var Q,ee=Qe({},e.selection),te=Xe(P.points(ee));try{for(te.s();!(Q=te.n()).done;){var ne=N(Q.value,2),re=ne[0];ee[ne[1]]=Fe.transform(re,t)}}catch(e){te.e(e)}finally{te.f()}P.equals(ee,e.selection)||(e.selection=ee)}}},rt={delete:function(e,t){e.delete(t)},insertFragment:function(e,t,n){e.insertFragment(t,n)},insertText:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Te.withoutNormalizing(e,function(){var r=n.voids,o=void 0!==r&&r,i=n.at,a=void 0===i?Y(e):i;if(Ne.isPath(a)&&(a=Te.range(e,a)),Ne.isRange(a))if(P.isCollapsed(a))a=a.anchor;else{var s=P.end(a);if(!o&&Te.void(e,{at:s}))return;var u=P.start(a),l=Te.pointRef(e,u),c=Te.pointRef(e,s);at.delete(e,{at:a,voids:o});var d=l.unref(),f=c.unref();a=d||f,at.setSelection(e,{anchor:a,focus:a})}if(!(!o&&Te.void(e,{at:a})||Te.elementReadOnly(e,{at:a}))){var p=a,h=p.path,g=p.offset;t.length>0&&e.apply({type:"insert_text",path:h,offset:g,text:t})}})}};function ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function it(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var at=it(it(it(it({},nt),{insertNodes:function(e,t,n){e.insertNodes(t,n)},liftNodes:function(e,t){e.liftNodes(t)},mergeNodes:function(e,t){e.mergeNodes(t)},moveNodes:function(e,t){e.moveNodes(t)},removeNodes:function(e,t){e.removeNodes(t)},setNodes:function(e,t,n){e.setNodes(t,n)},splitNodes:function(e,t){e.splitNodes(t)},unsetNodes:function(e,t,n){e.unsetNodes(t,n)},unwrapNodes:function(e,t){e.unwrapNodes(t)},wrapNodes:function(e,t,n){e.wrapNodes(t,n)}}),{collapse:function(e,t){e.collapse(t)},deselect:function(e){e.deselect()},move:function(e,t){e.move(t)},select:function(e,t){e.select(t)},setPoint:function(e,t,n){e.setPoint(t,n)},setSelection:function(e,t){e.setSelection(t)}}),rt),st=new WeakMap;function ut(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lt(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ct(e,t,n){var i,a,s=r.get(e)||[],u=o.get(e)||new Set,l=function(e){if(e){var t=e.join(",");a.has(t)||(a.add(t),i.push(e))}};if(n){i=[],a=new Set;var c,d=ut(s);try{for(d.s();!(c=d.n()).done;){l(n(c.value))}}catch(e){d.e(e)}finally{d.f()}}else i=s,a=u;var f,p=ut(t);try{for(p.s();!(f=p.n()).done;){l(f.value)}}catch(e){p.e(e)}finally{p.f()}r.set(e,i),o.set(e,a)}function dt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ft(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pt=function(r,o){var a,s=dt(Te.pathRefs(r));try{for(s.s();!(a=s.n()).done;){var u=a.value;e.transform(u,o)}}catch(e){s.e(e)}finally{s.f()}var l,c=dt(Te.pointRefs(r));try{for(c.s();!(l=c.n()).done;){var d=l.value;t.transform(d,o)}}catch(e){c.e(e)}finally{c.f()}var f,p=dt(Te.rangeRefs(r));try{for(p.s();!(f=p.n()).done;){var h=f.value;n.transform(h,o)}}catch(e){p.e(e)}finally{p.f()}if(!function(e){return st.get(e)||!1}(r)){var g=y.operationCanTransformPath(o)?function(e){return y.transform(e,o)}:void 0;ct(r,r.getDirtyPaths(o),g)}at.transform(r,o),r.operations.push(o),Te.normalize(r,{operation:o}),"set_selection"===o.type&&(r.marks=null),i.get(r)||(i.set(r,!0),Promise.resolve().then(function(){i.set(r,!1),r.onChange({operation:o}),r.operations=[]}))};function ht(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return gt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gt(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vt=function(e,t){switch(t.type){case"insert_text":case"remove_text":case"set_node":var n=t.path;return y.levels(n);case"insert_node":var r=t.node,o=t.path,i=y.levels(o),a=U.isText(r)?[]:Array.from(U.nodes(r),function(e){var t=N(e,2)[1];return o.concat(t)});return[].concat(m(i),m(a));case"merge_node":var s=t.path,u=y.ancestors(s),l=y.previous(s);return[].concat(m(u),[l]);case"move_node":var c=t.path,d=t.newPath;if(y.equals(c,d))return[];var f,p=[],h=[],g=ht(y.ancestors(c));try{for(g.s();!(f=g.n()).done;){var v=f.value,b=y.transform(v,t);p.push(b)}}catch(e){g.e(e)}finally{g.f()}var E,w=ht(y.ancestors(d));try{for(w.s();!(E=w.n()).done;){var C=E.value,D=y.transform(C,t);h.push(D)}}catch(e){w.e(e)}finally{w.f()}var A=h[h.length-1],S=d[d.length-1],x=A.concat(S);return[].concat(p,h,[x]);case"remove_node":var T=t.path,O=y.ancestors(T);return m(O);case"split_node":var B=t.path,k=y.levels(B),F=y.next(B);return[].concat(m(k),[F]);default:return[]}},mt=function(e){var t=e.selection;return t?U.fragment(e,t):[]},yt=function(e,t,n){var r=N(t,2),o=r[0],i=r[1];if(!U.isText(o)){"children"in o||(o.children=[]);var a=o;if(a!==e&&0===a.children.length){at.insertNodes(e,{text:""},{at:i.concat(0),voids:!0}),a=U.get(e,i)}if(!(a===e)&&(e.isInline(a)||U.isText(a.children[0])||e.isInline(a.children[0])))for(var s=0;s<a.children.length;s++){var u=a.children[s],l=a.children[s-1];if(U.isText(u))null!=l&&U.isText(l)&&(""===u.text?(at.removeNodes(e,{at:i.concat(s),voids:!0}),a=U.get(e,i),s--):""===l.text?(at.removeNodes(e,{at:i.concat(s-1),voids:!0}),a=U.get(e,i),s--):ze.equals(u,l,{loose:!0})&&(at.mergeNodes(e,{at:i.concat(s),voids:!0}),a=U.get(e,i),s--));else if(e.isInline(u)){if(null==l||!U.isText(l)){at.insertNodes(e,{text:""},{at:i.concat(s),voids:!0}),a=U.get(e,i),s++}if(s===a.children.length-1){at.insertNodes(e,{text:""},{at:i.concat(s+1),voids:!0}),a=U.get(e,i),s++}}else at.unwrapNodes(e,{at:i.concat(s),voids:!0}),a=U.get(e,i),s--}else for(var c=0;c<a.children.length;c++){var d=a.children[c];(U.isText(d)||e.isInline(d))&&(null!=n&&n.fallbackElement?at.wrapNodes(e,n.fallbackElement(),{at:i.concat(c),voids:!0}):at.removeNodes(e,{at:i.concat(c),voids:!0}),a=U.get(e,i),c--)}}},bt=function(e,t){var n=t.iteration,r=42*t.initialDirtyPathsLength;if(n>r)throw new Error("Could not completely normalize the editor after ".concat(r," iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state."));return!0},Et=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.voids,r=void 0!==n&&n,o=t.mode,i=void 0===o?"lowest":o,a=t.at,s=void 0===a?e.selection:a,u=t.match;if(s){var l=Te.path(e,s);if(!Ne.isRange(s)||y.equals(s.focus.path,s.anchor.path)){if(0===l.length)return;l=y.parent(l)}var c="lowest"===i,d=Te.levels(e,{at:l,voids:r,match:u,reverse:c});return N(d,1)[0]}};function wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Dt=function(e,t,n){var r=e.selection;if(r){var o=function(t,n){if(!U.isText(t))return!1;var r=Te.parent(e,n),o=N(r,2),i=o[0];return o[1],!e.isVoid(i)||e.markableVoid(i)},a=P.isExpanded(r),s=!1;if(!a){var u=Te.node(e,r),l=N(u,2),c=l[0],d=l[1];if(c&&o(c,d)){var f=Te.parent(e,d),p=N(f,1)[0];s=p&&e.markableVoid(p)}}if(a||s)at.setNodes(e,D({},t,n),{match:o,split:!0,voids:!0});else{var h=Ct(Ct({},Te.marks(e)||{}),{},D({},t,n));e.marks=h,i.get(e)||e.onChange()}}};function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function St(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?At(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Tt(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Nt=function(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={anchor:Te.point(e,t,{edge:"end"}),focus:Te.end(e,[])},a=o.distance,s=void 0===a?1:a,u=0,l=xt(Te.positions(e,St(St({},o),{},{at:i})));try{for(l.s();!(r=l.n()).done;){var c=r.value;if(u>s)break;0!==u&&(n=c),u++}}catch(e){l.e(e)}finally{l.f()}return n};function Ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ot(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ot(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ft(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ft(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var It=function(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={anchor:Te.start(e,[]),focus:Te.point(e,t,{edge:"start"})},a=o.distance,s=void 0===a?1:a,u=0,l=kt(Te.positions(e,Bt(Bt({},o),{},{at:i,reverse:!0})));try{for(l.s();!(r=l.n()).done;){var c=r.value;if(u>s)break;0!==u&&(n=c),u++}}catch(e){l.e(e)}finally{l.f()}return n},Pt=function(e,t){var n=e.selection;n&&P.isCollapsed(n)&&at.delete(e,{unit:t,reverse:!0})},Rt=function(e,t){var n=e.selection;n&&P.isCollapsed(n)&&at.delete(e,{unit:t})},_t=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).direction,n=void 0===t?"forward":t,r=e.selection;r&&P.isExpanded(r)&&at.delete(e,{reverse:"backward"===n})},Lt=function(e,t){return[Te.start(e,t),Te.end(e,t)]};function Mt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mt(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ht=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Te.above(e,jt(jt({},t),{},{match:function(t){return U.isElement(t)&&Te.isElementReadOnly(e,t)}}))},zt=function(e,t){return Te.point(e,t,{edge:"end"})},$t=function(e,t){var n=Te.path(e,t,{edge:"start"});return Te.node(e,n)},Ut=function(e,t){var n=Te.range(e,t);return U.fragment(e,n)};function Vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vt(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Gt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Te.above(e,Wt(Wt({},t),{},{match:function(t){return U.isElement(t)&&Te.isVoid(e,t)}}))},qt=function(e,t){return t.children.some(function(t){return U.isElement(t)&&Te.isBlock(e,t)})},Kt=function(e,t){return t.children.some(function(t){return U.isText(t)||Te.isInline(e,t)})},Yt=function(e,t){return U.has(e,t)},Xt=function(e,t){return t.children.every(function(e){return U.isText(e)})},Zt=function(e){at.splitNodes(e,{always:!0})},Jt=function(e,t,n){at.insertNodes(e,t,n)},Qt=function(e){at.splitNodes(e,{always:!0})};function en(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var tn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=e.marks;if(r){if(o){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?en(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):en(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({text:t},o);at.insertNodes(e,i,{at:n.at,voids:n.voids})}else at.insertText(e,t,n);e.marks=null}},nn=function(e,t){return!e.isInline(t)},rn=function(e,t,n){return Te.isStart(e,t,n)||Te.isEnd(e,t,n)},on=function(e,t){var n=t.children,r=N(n,1)[0];return 0===n.length||1===n.length&&U.isText(r)&&""===r.text&&!e.isVoid(t)},an=function(e,t,n){var r=Te.end(e,n);return Fe.equals(t,r)},sn=function(e){var t=a.get(e);return void 0===t||t},un=function(e,t,n){if(0!==t.offset)return!1;var r=Te.start(e,n);return Fe.equals(t,r)},ln=function(e,t){var n=Te.path(e,t,{edge:"end"});return Te.node(e,n)},cn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Te.path(e,t,n);return[U.leaf(e,r),r]};function dn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return fn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fn(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var n=t.at,r=void 0===n?e.selection:n,o=t.reverse,i=void 0!==o&&o,a=t.voids,s=void 0!==a&&a,u=t.match;if(null==u&&(u=function(){return!0}),r){var l,c=[],d=Te.path(e,r),f=dn(U.levels(e,d));try{for(f.s();!(l=f.n()).done;){var p=N(l.value,2),h=p[0],g=p[1];if(u(h,g)&&(c.push([h,g]),!s&&U.isElement(h)&&Te.isVoid(e,h)))break}}catch(e){f.e(e)}finally{f.f()}i&&c.reverse(),yield*c}}()}var hn=["text"],gn=["text"],vn=function(e){var t=e.marks,n=e.selection;if(!n)return null;var r=n.anchor,o=n.focus;if(t)return t;if(P.isExpanded(n)){if(P.isBackward(n)){var i=[r,o];o=i[0],r=i[1]}if(Te.isEnd(e,r,r.path)){var a=Te.after(e,r);a&&(r=a)}var s=Te.nodes(e,{match:U.isText,at:{anchor:r,focus:o}}),u=N(s,1)[0];if(u){var l=N(u,1)[0];return l.text,k(l,hn)}return{}}var c=r.path,d=Te.leaf(e,c),f=N(d,1)[0];if(0===r.offset){var p=Te.previous(e,{at:c,match:U.isText}),h=Te.above(e,{match:function(t){return U.isElement(t)&&Te.isVoid(e,t)&&e.markableVoid(t)}});if(!h){var g=Te.above(e,{match:function(t){return U.isElement(t)&&Te.isBlock(e,t)}});if(p&&g){var v=N(p,2),m=v[0],b=v[1],E=N(g,2)[1];y.isAncestor(E,b)&&(f=m)}}}var w=f;return w.text,k(w,gn)},mn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.mode,r=void 0===n?"lowest":n,o=t.voids,i=void 0!==o&&o,a=t.match,s=t.at,u=void 0===s?e.selection:s;if(u){var l=Te.after(e,u,{voids:i});if(l){var c=Te.last(e,[]),d=N(c,2)[1],f=[l.path,d];if(Ne.isPath(u)&&0===u.length)throw new Error("Cannot get the next node from the root node!");if(null==a)if(Ne.isPath(u)){var p=Te.parent(e,u),h=N(p,1)[0];a=function(e){return h.children.includes(e)}}else a=function(){return!0};var g=Te.nodes(e,{at:f,match:a,mode:r,voids:i}),v=N(g,1)[0];return v}}},yn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Te.path(e,t,n),o=U.get(e,r);return[o,r]};function bn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return En(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return En(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function En(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var n=t.at,r=void 0===n?e.selection:n,o=t.mode,i=void 0===o?"all":o,a=t.universal,s=void 0!==a&&a,u=t.reverse,l=void 0!==u&&u,c=t.voids,d=void 0!==c&&c,f=t.pass,p=t.match;if(p||(p=function(){return!0}),r){var h,g;if(Ne.isSpan(r))h=r[0],g=r[1];else{var v=Te.path(e,r,{edge:"start"}),m=Te.path(e,r,{edge:"end"});h=l?m:v,g=l?v:m}var b,E,w=U.nodes(e,{reverse:l,from:h,to:g,pass:function(t){var n=N(t,2),r=n[0],o=n[1];return!(!f||!f([r,o]))||!!U.isElement(r)&&!(d||!Te.isVoid(e,r)&&!Te.isElementReadOnly(e,r))}}),C=[],D=bn(w);try{for(D.s();!(E=D.n()).done;){var A=N(E.value,2),S=A[0],x=A[1],T=b&&0===y.compare(x,b[1]);if("highest"!==i||!T)if(p(S,x))if("lowest"===i&&T)b=[S,x];else{var O="lowest"===i?b:[S,x];O&&(s?C.push(O):yield O),b=[S,x]}else if(s&&!T&&U.isText(S))return}}catch(e){D.e(e)}finally{D.f()}"lowest"===i&&b&&(s?C.push(b):yield b),s&&(yield*C)}}()}function Cn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Dn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dn(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var An=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.force,i=void 0!==n&&n,a=t.operation,s=function(e){return r.get(e)||[]},u=function(e){var t=s(e).pop(),n=t.join(",");return function(e){return o.get(e)||new Set}(e).delete(n),t};if(Te.isNormalizing(e)){if(i){var l=Array.from(U.nodes(e),function(e){return N(e,2)[1]}),c=new Set(l.map(function(e){return e.join(",")}));r.set(e,l),o.set(e,c)}0!==s(e).length&&Te.withoutNormalizing(e,function(){var t,n=Cn(s(e));try{for(n.s();!(t=n.n()).done;){var r=t.value;if(U.has(e,r)){var o=Te.node(e,r),l=N(o,2),c=l[0];l[1];U.isElement(c)&&0===c.children.length&&e.normalizeNode(o,{operation:a,force:i})}}}catch(e){n.e(e)}finally{n.f()}for(var d=s(e),f=d.length,p=0;0!==d.length;){if(!e.shouldNormalize({dirtyPaths:d,iteration:p,initialDirtyPathsLength:f,operation:a}))return;var h=u(e);if(U.has(e,h)){var g=Te.node(e,h);e.normalizeNode(g,{operation:a,force:i})}p++,d=s(e)}})}},Sn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Te.path(e,t,n),o=y.parent(r);return Te.node(e,o)},xn=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).affinity,r={current:t,affinity:void 0===n?"forward":n,unref:function(){var t=r.current;return Te.pathRefs(e).delete(r),r.current=null,t}};return Te.pathRefs(e).add(r),r},Tn=function(e){var t=s.get(e);return t||(t=new Set,s.set(e,t)),t},Nn=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.depth,o=n.edge;if(Ne.isPath(t))if("start"===o){var i=U.first(e,t);t=N(i,2)[1]}else if("end"===o){var a=U.last(e,t);t=N(a,2)[1]}return Ne.isRange(t)&&(t="start"===o?P.start(t):"end"===o?P.end(t):y.common(t.anchor.path,t.focus.path)),Ne.isPoint(t)&&(t=t.path),null!=r&&(t=t.slice(0,r)),t},On=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).affinity,r={current:t,affinity:void 0===n?"forward":n,unref:function(){var t=r.current;return Te.pointRefs(e).delete(r),r.current=null,t}};return Te.pointRefs(e).add(r),r},Fn=function(e){var t=u.get(e);return t||(t=new Set,u.set(e,t)),t},In=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).edge,r=void 0===n?"start":n;if(Ne.isPath(t)){var o;if("end"===r){var i=U.last(e,t);o=N(i,2)[1]}else{var a=U.first(e,t);o=N(a,2)[1]}var s=U.get(e,o);if(!U.isText(s))throw new Error("Cannot get the ".concat(r," point in the node at path [").concat(t,"] because it has no ").concat(r," text node."));return{path:o,offset:"end"===r?s.text.length:0}}if(Ne.isRange(t)){var u=P.edges(t),l=N(u,2),c=l[0],d=l[1];return"start"===r?c:d}return t};function Pn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Rn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rn(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){var n=t.at,r=void 0===n?e.selection:n,o=t.unit,i=void 0===o?"offset":o,a=t.reverse,s=void 0!==a&&a,u=t.voids,l=void 0!==u&&u;if(r){var c,d=Te.range(e,r),f=P.edges(d),p=N(f,2),h=p[0],g=p[1],v=s?g:h,m=!1,b="",E=0,w=0,C=0,D=[],A=Pn(Te.nodes(e,{at:r,reverse:s,voids:l}));try{var S=function*(){var t=N(c.value,2),n=t[0],r=t[1],o=D.some(function(e){return y.isAncestor(e,r)});function*a(e){o||(yield e)}if(U.isElement(n)){if(!e.isSelectable(n)){if(D.push(r),s)return y.hasPrevious(r)&&(yield*a(Te.end(e,y.previous(r)))),0;var u=y.next(r);return Te.hasPath(e,u)&&(yield*a(Te.start(e,u))),0}if(!l&&(e.isVoid(n)||e.isElementReadOnly(n)))return yield*a(Te.start(e,r)),0;if(e.isInline(n))return 0;if(Te.hasInlines(e,n)){var d=y.isAncestor(r,g.path)?g:Te.end(e,r),f=y.isAncestor(r,h.path)?h:Te.start(e,r);b=Te.string(e,{anchor:f,focus:d},{voids:l}),m=!0}}if(U.isText(n)){var p=y.equals(r,v.path);for(p?(w=s?v.offset:n.text.length-v.offset,C=v.offset):(w=n.text.length,C=s?w:0),(p||m||"offset"===i)&&(yield*a({path:r,offset:C}),m=!1);;){if(0===E){if(""===b)break;E=x(b,i,s),b=oe(b,E,s)[1]}if(C=s?C-E:C+E,(w-=E)<0){E=-w;break}E=0,yield*a({path:r,offset:C})}}};for(A.s();!(c=A.n()).done;)yield*S()}catch(e){A.e(e)}finally{A.f()}}function x(e,t,n){return"character"===t?ee(e,n):"word"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=!1;e.length>0;){var o=ee(e,t),i=oe(e,o,t),a=N(i,2),s=a[0],u=a[1];if(ie(s,u,t))r=!0,n+=o;else{if(r)break;n+=o}e=u}return n}(e,n):"line"===t||"block"===t?e.length:1}}()}var Ln=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.mode,r=void 0===n?"lowest":n,o=t.voids,i=void 0!==o&&o,a=t.match,s=t.at,u=void 0===s?e.selection:s;if(u){var l=Te.before(e,u,{voids:i});if(l){var c=Te.first(e,[]),d=N(c,2)[1],f=[l.path,d];if(Ne.isPath(u)&&0===u.length)throw new Error("Cannot get the previous node from the root node!");if(null==a)if(Ne.isPath(u)){var p=Te.parent(e,u),h=N(p,1)[0];a=function(e){return h.children.includes(e)}}else a=function(){return!0};var g=Te.nodes(e,{reverse:!0,at:f,match:a,mode:r,voids:i}),v=N(g,1)[0];return v}}},Mn=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).affinity,r={current:t,affinity:void 0===n?"forward":n,unref:function(){var t=r.current;return Te.rangeRefs(e).delete(r),r.current=null,t}};return Te.rangeRefs(e).add(r),r},jn=function(e){var t=l.get(e);return t||(t=new Set,l.set(e,t)),t},Hn=function(e,t,n){return Ne.isRange(t)&&!n?t:{anchor:Te.start(e,t),focus:Te.end(e,n||t)}};function zn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var $n=function(e,t){var n=e.selection;if(n){var r=function(t,n){if(!U.isText(t))return!1;var r=Te.parent(e,n),o=N(r,2),i=o[0];return o[1],!e.isVoid(i)||e.markableVoid(i)},o=P.isExpanded(n),a=!1;if(!o){var s=Te.node(e,n),u=N(s,2),l=u[0],c=u[1];if(l&&r(l,c)){var d=Te.parent(e,c),f=N(d,1)[0];a=f&&e.markableVoid(f)}}if(o||a)at.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var p=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zn(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},Te.marks(e)||{});delete p[t],e.marks=p,i.get(e)||e.onChange()}}},Un=function(e,t){a.set(e,t)},Vn=function(e,t){return Te.point(e,t,{edge:"start"})};function Wn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Gn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gn(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qn=function(e,t){var n,r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).voids,o=void 0!==r&&r,i=Te.range(e,t),a=P.edges(i),s=N(a,2),u=s[0],l=s[1],c="",d=Wn(Te.nodes(e,{at:i,match:U.isText,voids:o}));try{for(d.s();!(n=d.n()).done;){var f=N(n.value,2),p=f[0],h=f[1],g=p.text;y.equals(h,l.path)&&(g=g.slice(0,l.offset)),y.equals(h,u.path)&&(g=g.slice(u.offset)),c+=g}}catch(e){d.e(e)}finally{d.f()}return c};function Kn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Yn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yn(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Yn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xn=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).voids,r=void 0!==n&&n,o=P.edges(t),i=N(o,2),a=i[0],s=i[1];if(0!==a.offset||0!==s.offset||P.isCollapsed(t)||y.hasPrevious(s.path))return t;var u,l=Te.above(e,{at:s,match:function(t){return U.isElement(t)&&Te.isBlock(e,t)},voids:r}),c=l?l[1]:[],d={anchor:Te.start(e,a),focus:s},f=!0,p=Kn(Te.nodes(e,{at:d,match:U.isText,reverse:!0,voids:r}));try{for(p.s();!(u=p.n()).done;){var h=N(u.value,2),g=h[0],v=h[1];if(f)f=!1;else if(""!==g.text||y.isBefore(v,c)){s={path:v,offset:g.text.length};break}}}catch(e){p.e(e)}finally{p.f()}return{anchor:a,focus:s}},Zn=function(e,t){var n=Te.isNormalizing(e);Te.setNormalizing(e,!1);try{t()}finally{Te.setNormalizing(e,n)}Te.normalize(e)},Jn=function(e,t,n){var r=N(t,2),o=r[0],i=r[1],a=N(n,2);return a[0],a[1],U.isElement(o)&&Te.isEmpty(e,o)||U.isText(o)&&""===o.text&&0!==i[i.length-1]};function Qn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return er(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return er(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function er(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var tr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Te.withoutNormalizing(e,function(){var n,r,o=t.reverse,i=void 0!==o&&o,a=t.unit,s=void 0===a?"character":a,u=t.distance,l=void 0===u?1:u,c=t.voids,d=void 0!==c&&c,f=t.at,p=void 0===f?e.selection:f,h=t.hanging,g=void 0!==h&&h;if(p){var v=!1;if(Ne.isRange(p)&&P.isCollapsed(p)&&(v=!0,p=p.anchor),Ne.isPoint(p)){var m=Te.void(e,{at:p,mode:"highest"});if(!d&&m){p=N(m,2)[1]}else{var b={unit:s,distance:l};p={anchor:p,focus:i?Te.before(e,p,b)||Te.start(e,[]):Te.after(e,p,b)||Te.end(e,[])},g=!0}}if(Ne.isPath(p))at.removeNodes(e,{at:p,voids:d});else if(!P.isCollapsed(p)){if(!g){var E=P.edges(p),w=N(E,2)[1],C=Te.end(e,[]);Fe.equals(w,C)||(p=Te.unhangRange(e,p,{voids:d}))}var D=P.edges(p),A=N(D,2),S=A[0],x=A[1],T=Te.above(e,{match:function(t){return U.isElement(t)&&Te.isBlock(e,t)},at:S,voids:d}),O=Te.above(e,{match:function(t){return U.isElement(t)&&Te.isBlock(e,t)},at:x,voids:d}),B=T&&O&&!y.equals(T[1],O[1]),k=y.equals(S.path,x.path),F=d?null:null!==(n=Te.void(e,{at:S,mode:"highest"}))&&void 0!==n?n:Te.elementReadOnly(e,{at:S,mode:"highest"}),I=d?null:null!==(r=Te.void(e,{at:x,mode:"highest"}))&&void 0!==r?r:Te.elementReadOnly(e,{at:x,mode:"highest"});if(F){var R=Te.before(e,S);R&&T&&y.isAncestor(T[1],R.path)&&(S=R)}if(I){var _=Te.after(e,x);_&&O&&y.isAncestor(O[1],_.path)&&(x=_)}var L,M,j=[],H=Qn(Te.nodes(e,{at:p,voids:d}));try{for(H.s();!(M=H.n()).done;){var z=M.value,$=N(z,2),V=$[0],W=$[1];L&&0===y.compare(W,L)||(!d&&U.isElement(V)&&(Te.isVoid(e,V)||Te.isElementReadOnly(e,V))||!y.isCommon(W,S.path)&&!y.isCommon(W,x.path))&&(j.push(z),L=W)}}catch(e){H.e(e)}finally{H.f()}var G=Array.from(j,function(t){var n=N(t,2)[1];return Te.pathRef(e,n)}),q=Te.pointRef(e,S),K=Te.pointRef(e,x),Y="";if(!k&&!F){var X=q.current,Z=Te.leaf(e,X),J=N(Z,1)[0],Q=X.path,ee=S.offset,te=J.text.slice(ee);te.length>0&&(e.apply({type:"remove_text",path:Q,offset:ee,text:te}),Y=te)}if(G.reverse().map(function(e){return e.unref()}).filter(function(e){return null!==e}).forEach(function(t){return at.removeNodes(e,{at:t,voids:d})}),!I){var ne=K.current,re=Te.leaf(e,ne),oe=N(re,1)[0],ie=ne.path,ae=k?S.offset:0,se=oe.text.slice(ae,x.offset);se.length>0&&(e.apply({type:"remove_text",path:ie,offset:ae,text:se}),Y=se)}!k&&B&&K.current&&q.current&&at.mergeNodes(e,{at:K.current,hanging:!0,voids:d}),v&&i&&"character"===s&&Y.length>1&&Y.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/)&&at.insertText(e,Y.slice(0,Y.length-l));var ue=q.unref(),le=K.unref(),ce=i?ue||le:le||ue;null==t.at&&ce&&at.select(e,ce)}}})};function nr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return rr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rr(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var or=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Te.withoutNormalizing(e,function(){var r=n.hanging,o=void 0!==r&&r,i=n.voids,a=void 0!==i&&i,s=n.at,u=void 0===s?Y(e):s,l=n.batchDirty,c=void 0===l||l;if(t.length){if(Ne.isRange(u))if(o||(u=Te.unhangRange(e,u,{voids:a})),P.isCollapsed(u))u=u.anchor;else{var d=P.edges(u),f=N(d,2)[1];if(!a&&Te.void(e,{at:f}))return;var p=Te.pointRef(e,f);at.delete(e,{at:u}),u=p.unref()}else Ne.isPath(u)&&(u=Te.start(e,u));if(a||!Te.void(e,{at:u})){var h=Te.above(e,{at:u,match:function(t){return U.isElement(t)&&Te.isInline(e,t)},mode:"highest",voids:a});if(h){var g=N(h,2)[1];if(Te.isEnd(e,u,g))u=Te.after(e,g);else if(Te.isStart(e,u,g)){u=Te.before(e,g)}}var v,m=Te.above(e,{match:function(t){return U.isElement(t)&&Te.isBlock(e,t)},at:u,voids:a}),b=N(m,2)[1],E=Te.isStart(e,u,b),w=Te.isEnd(e,u,b),C=E&&w,D=U.first({children:t},[]),A=N(D,2)[1],S=U.last({children:t},[]),x=N(S,2)[1],T=function(t){var n=N(t,2),r=n[0],o=n[1];return!(0===o.length)&&(!!C||!(!E&&y.isAncestor(o,A)&&U.isElement(r)&&!e.isVoid(r)&&!e.isInline(r))&&!(!w&&y.isAncestor(o,x)&&U.isElement(r)&&!e.isVoid(r)&&!e.isInline(r)))},O=!0,B=[],k=[],F=[],I=nr(U.nodes({children:t},{pass:T}));try{for(I.s();!(v=I.n()).done;){var R=v.value,_=N(R,2),L=_[0],M=_[1];O&&U.isElement(L)&&!e.isInline(L)&&!y.isAncestor(M,A)&&(O=!1),T(R)&&(U.isElement(L)&&!e.isInline(L)?(O=!1,k.push(L)):O?B.push(L):F.push(L))}}catch(e){I.e(e)}finally{I.f()}var j=Te.nodes(e,{at:u,match:function(t){return U.isText(t)||Te.isInline(e,t)},mode:"highest",voids:a}),H=N(j,1)[0],z=N(H,2)[1],$=Te.isStart(e,u,z),V=Te.isEnd(e,u,z),W=Te.pathRef(e,w&&!F.length?y.next(b):b),G=Te.pathRef(e,V?y.next(z):z),q=F.length>0;at.splitNodes(e,{at:u,match:function(t){return q?U.isElement(t)&&Te.isBlock(e,t):U.isText(t)||Te.isInline(e,t)},mode:q?"lowest":"highest",always:q&&(!E||B.length>0)&&(!w||F.length>0),voids:a});var K,X=Te.pathRef(e,!$||$&&V?y.next(z):z);if(at.insertNodes(e,B,{at:X.current,match:function(t){return U.isText(t)||Te.isInline(e,t)},mode:"highest",voids:a,batchDirty:c}),C&&!B.length&&k.length&&!F.length&&at.delete(e,{at:b,voids:a}),at.insertNodes(e,k,{at:W.current,match:function(t){return U.isElement(t)&&Te.isBlock(e,t)},mode:"lowest",voids:a,batchDirty:c}),at.insertNodes(e,F,{at:G.current,match:function(t){return U.isText(t)||Te.isInline(e,t)},mode:"highest",voids:a,batchDirty:c}),!n.at)if(F.length>0&&G.current?K=y.previous(G.current):k.length>0&&W.current?K=y.previous(W.current):X.current&&(K=y.previous(X.current)),K){var Z=Te.end(e,K);at.select(e,Z)}X.unref(),W.unref(),G.unref()}}})},ir=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).edge,n=void 0===t?"anchor":t,r=e.selection;if(r)if("anchor"===n)at.select(e,r.anchor);else if("focus"===n)at.select(e,r.focus);else if("start"===n){var o=P.edges(r),i=N(o,1)[0];at.select(e,i)}else if("end"===n){var a=P.edges(r),s=N(a,2)[1];at.select(e,s)}},ar=function(e){var t=e.selection;t&&e.apply({type:"set_selection",properties:t,newProperties:null})},sr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.selection,r=t.distance,o=void 0===r?1:r,i=t.unit,a=void 0===i?"character":i,s=t.reverse,u=void 0!==s&&s,l=t.edge,c=void 0===l?null:l;if(n){"start"===c&&(c=P.isBackward(n)?"focus":"anchor"),"end"===c&&(c=P.isBackward(n)?"anchor":"focus");var d=n.anchor,f=n.focus,p={distance:o,unit:a},h={};if(null==c||"anchor"===c){var g=u?Te.before(e,d,p):Te.after(e,d,p);g&&(h.anchor=g)}if(null==c||"focus"===c){var v=u?Te.before(e,f,p):Te.after(e,f,p);v&&(h.focus=v)}at.setSelection(e,h)}},ur=function(e,t){var n=e.selection;if(t=Te.range(e,t),n)at.setSelection(e,t);else{if(!Ne.isRange(t))throw new Error("When setting the selection and the current selection is `null` you must provide at least an `anchor` and `focus`, but you passed: ".concat(Pe.stringify(t)));e.apply({type:"set_selection",properties:n,newProperties:t})}};function lr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lr(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var dr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=n.edge,i=void 0===o?"both":o;if(r){"start"===i&&(i=P.isBackward(r)?"focus":"anchor"),"end"===i&&(i=P.isBackward(r)?"anchor":"focus");var a=r.anchor,s=r.focus,u="anchor"===i?a:s;at.setSelection(e,D({},"anchor"===i?"anchor":"focus",cr(cr({},u),t)))}},fr=function(e,t){var n=e.selection,r={},o={};if(n){for(var i in t){if(!tt.includes(i))pr(i,Object.hasOwn(n,i)?n[i]:void 0,t[i])&&(r[i]=n[i],o[i]=t[i])}Object.keys(r).length>0&&e.apply({type:"set_selection",properties:r,newProperties:o})}};function pr(e,t,n){return("anchor"===e||"focus"===e)&&Fe.isPoint(t)&&Fe.isPoint(n)?!Fe.equals(t,n):t!==n}function hr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return gr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gr(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function gr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Te.withoutNormalizing(e,function(){var r=n.hanging,o=void 0!==r&&r,i=n.voids,a=void 0!==i&&i,s=n.mode,u=void 0===s?"lowest":s,l=n.batchDirty,c=void 0===l||l,d=n.at,f=n.match,p=n.select;if(U.isNode(t)&&(t=[t]),0!==t.length){var h=N(t,1)[0];if(d||(d=Y(e),!1!==p&&(p=!0)),null==p&&(p=!1),Ne.isRange(d))if(o||(d=Te.unhangRange(e,d,{voids:a})),P.isCollapsed(d))d=d.anchor;else{var g=P.edges(d),v=N(g,2)[1],b=Te.pointRef(e,v);at.delete(e,{at:d}),d=b.unref()}if(Ne.isPoint(d)){null==f&&(f=U.isText(h)?function(e){return U.isText(e)}:e.isInline(h)?function(t){return U.isText(t)||Te.isInline(e,t)}:function(t){return U.isElement(t)&&Te.isBlock(e,t)});var E=Te.nodes(e,{at:d.path,match:f,mode:u,voids:a}),w=N(E,1)[0];if(!w)return;var C=N(w,2)[1],D=Te.pathRef(e,C),A=Te.isEnd(e,d,C);at.splitNodes(e,{at:d,match:f,mode:u,voids:a});var S=D.unref();d=A?y.next(S):S}var x=y.parent(d),T=d[d.length-1];if(a||!Te.void(e,{at:x})){if(c){var O=[],B=y.levels(x);!function(e,t,n){var r=st.get(e)||!1;st.set(e,!0);try{t(),n()}finally{st.set(e,r)}}(e,function(){var n,r=hr(t);try{var o=function(){var t=n.value,r=x.concat(T);T++;var o={type:"insert_node",path:r,node:t};e.apply(o),d=y.next(d),O.push(o),U.isText(t)?B.push(r):B.push.apply(B,m(Array.from(U.nodes(t),function(e){var t=N(e,2)[1];return r.concat(t)})))};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}},function(){ct(e,B,function(e){for(var t=e,n=0,r=O;n<r.length;n++){var o=r[n];if(y.operationCanTransformPath(o)&&!(t=y.transform(t,o)))return null}return t})})}else{var k,F=hr(t);try{for(F.s();!(k=F.n()).done;){var I=k.value,R=x.concat(T);T++,e.apply({type:"insert_node",path:R,node:I}),d=y.next(d)}}catch(e){F.e(e)}finally{F.f()}}if(d=y.previous(d),p){var _=Te.end(e,d);_&&at.select(e,_)}}}})},mr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Te.withoutNormalizing(e,function(){var n=t.at,r=void 0===n?e.selection:n,o=t.mode,i=void 0===o?"lowest":o,a=t.voids,s=void 0!==a&&a,u=t.match;if(r){null==u&&(u=Ne.isPath(r)?X(e,r):function(t){return U.isElement(t)&&Te.isBlock(e,t)});for(var l=Te.nodes(e,{at:r,match:u,mode:i,voids:s}),c=Array.from(l,function(t){var n=N(t,2)[1];return Te.pathRef(e,n)}),d=0,f=c;d<f.length;d++){var p=f[d].unref();if(p.length<2)throw new Error("Cannot lift node at a path [".concat(p,"] because it has a depth of less than `2`."));var h=Te.node(e,y.parent(p)),g=N(h,2),v=g[0],m=g[1],b=p[p.length-1],E=v.children.length;if(1===E){var w=y.next(m);at.moveNodes(e,{at:p,to:w,voids:s}),at.removeNodes(e,{at:m,voids:s})}else if(0===b)at.moveNodes(e,{at:p,to:m,voids:s});else if(b===E-1){var C=y.next(m);at.moveNodes(e,{at:p,to:C,voids:s})}else{var D=y.next(p),A=y.next(m);at.splitNodes(e,{at:D,voids:s}),at.moveNodes(e,{at:p,to:A,voids:s})}}}})},yr=["text"],br=["children"],Er=function e(t,n){return n!==t&&(U.isText(n)||Te.isVoid(t,n)||1===n.children.length&&e(t,n.children[0]))},wr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Te.withoutNormalizing(e,function(){var n=t.match,r=t.at,o=void 0===r?e.selection:r,i=t.hanging,a=void 0!==i&&i,s=t.voids,u=void 0!==s&&s,l=t.mode,c=void 0===l?"lowest":l;if(o){var d=Ne.isPath(o),f=d?o:null,p=null==n&&d;if(null==n)if(d){var h=Te.parent(e,o),g=N(h,1)[0];n=function(e){return g.children.includes(e)}}else n=function(t){return U.isElement(t)&&Te.isBlock(e,t)};if(!a&&Ne.isRange(o)&&(o=Te.unhangRange(e,o,{voids:u})),Ne.isRange(o))if(P.isCollapsed(o))o=o.anchor;else{var v=P.edges(o),m=N(v,2)[1],b=Te.pointRef(e,m);at.delete(e,{at:o}),o=b.unref(),null==t.at&&at.select(e,o)}var E=Te.nodes(e,{at:o,match:n,voids:u,mode:c}),w=N(E,1)[0],C=p&&f&&y.hasPrevious(f)?y.previous(f):null,D=C?Te.node(e,C):Te.previous(e,{at:o,match:n,voids:u,mode:c});if(w&&D){var A=N(w,2),S=A[0],x=A[1],T=N(D,2),O=T[0],B=T[1];if(0!==x.length&&0!==B.length){var F,I,R=y.next(B),_=y.common(x,B),L=y.isSibling(x,B),M=Array.from(Te.levels(e,{at:x}),function(e){return N(e,1)[0]}).slice(_.length).slice(0,-1),j=Te.above(e,{at:x,mode:"highest",match:function(t){return M.includes(t)&&Er(e,t)}}),H=j&&Te.pathRef(e,j[1]);if(U.isText(S)&&U.isText(O)){S.text;var z=k(S,yr);I=O.text.length,F=z}else{if(!U.isElement(S)||!U.isElement(O))throw new Error("Cannot merge the node at path [".concat(x,"] with the previous sibling because it is not the same kind: ").concat(Pe.stringify(S)," ").concat(Pe.stringify(O)));S.children;var $=k(S,br);I=O.children.length,F=$}L||at.moveNodes(e,{at:x,to:R,voids:u}),H&&at.removeNodes(e,{at:H.current,voids:u}),Te.shouldMergeNodesRemovePrevNode(e,D,w)?at.removeNodes(e,{at:B,voids:u}):e.apply({type:"merge_node",path:R,position:I,properties:F}),H&&H.unref()}}}})},Cr=function(e,t){Te.withoutNormalizing(e,function(){var n=t.to,r=t.at,o=void 0===r?e.selection:r,i=t.mode,a=void 0===i?"lowest":i,s=t.voids,u=void 0!==s&&s,l=t.match;if(o){null==l&&(l=Ne.isPath(o)?X(e,o):function(t){return U.isElement(t)&&Te.isBlock(e,t)});for(var c=Te.pathRef(e,n),d=Te.nodes(e,{at:o,match:l,mode:a,voids:u}),f=Array.from(d,function(t){var n=N(t,2)[1];return Te.pathRef(e,n)}),p=0,h=f;p<h.length;p++){var g=h[p].unref(),v=c.current;0!==g.length&&e.apply({type:"move_node",path:g,newPath:v}),c.current&&y.isSibling(v,g)&&y.isAfter(v,g)&&(c.current=y.next(c.current))}c.unref()}})},Dr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Te.withoutNormalizing(e,function(){var n=t.hanging,r=void 0!==n&&n,o=t.voids,i=void 0!==o&&o,a=t.mode,s=void 0===a?"lowest":a,u=t.at,l=void 0===u?e.selection:u,c=t.match;if(l){null==c&&(c=Ne.isPath(l)?X(e,l):function(t){return U.isElement(t)&&Te.isBlock(e,t)}),!r&&Ne.isRange(l)&&(l=Te.unhangRange(e,l,{voids:i}));for(var d=Te.nodes(e,{at:l,match:c,mode:s,voids:i}),f=Array.from(d,function(t){var n=N(t,2)[1];return Te.pathRef(e,n)}),p=0,h=f;p<h.length;p++){var g=h[p].unref();if(g){var v=Te.node(e,g),m=N(v,1)[0];e.apply({type:"remove_node",path:g,node:m})}}}})};function Ar(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Sr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sr(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Te.withoutNormalizing(e,function(){var r=n.match,o=n.at,i=void 0===o?e.selection:o,a=n.compare,s=n.merge,u=n.hanging,l=void 0!==u&&u,c=n.mode,d=void 0===c?"lowest":c,f=n.split,p=void 0!==f&&f,h=n.voids,g=void 0!==h&&h;if(i){if(null==r&&(r=Ne.isPath(i)?X(e,i):function(t){return U.isElement(t)&&Te.isBlock(e,t)}),!l&&Ne.isRange(i)&&(i=Te.unhangRange(e,i,{voids:g})),p&&Ne.isRange(i)){if(P.isCollapsed(i)&&Te.leaf(e,i.anchor)[0].text.length>0)return;var v=Te.rangeRef(e,i,{affinity:"inward"}),m=P.edges(i),y=N(m,2),b=y[0],E=y[1],w="lowest"===d?"lowest":"highest",C=Te.isEnd(e,E,E.path);at.splitNodes(e,{at:E,match:r,mode:w,voids:g,always:!C});var D=Te.isStart(e,b,b.path);at.splitNodes(e,{at:b,match:r,mode:w,voids:g,always:!D}),i=v.unref(),null==n.at&&at.select(e,i)}a||(a=function(e,t){return e!==t});var A,S=Ar(Te.nodes(e,{at:i,match:r,mode:d,voids:g}));try{for(S.s();!(A=S.n()).done;){var x=N(A.value,2),T=x[0],O=x[1],B={},k={};if(0!==O.length){var F=!1;for(var I in t)if(!et.includes(I)){var R=Object.hasOwn(T,I)?T[I]:void 0,_=t[I];a(_,R)&&(F=!0,Object.hasOwn(T,I)&&(B[I]=R),s?null!=_&&(k[I]=s(R,_)):null!=_&&(k[I]=_))}F&&e.apply({type:"set_node",path:O,properties:B,newProperties:k})}}}catch(e){S.e(e)}finally{S.f()}}})};function Tr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Nr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nr(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Nr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Or=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Te.withoutNormalizing(e,function(){var n=t.mode,r=void 0===n?"lowest":n,o=t.voids,i=void 0!==o&&o,a=t.match,s=t.at,u=void 0===s?e.selection:s,l=t.height,c=void 0===l?0:l,d=t.always,f=void 0!==d&&d;if(u&&(null==a&&(a=function(t){return U.isElement(t)&&Te.isBlock(e,t)}),!Ne.isRange(u)||(u=function(e,t){if(P.isCollapsed(t))return t.anchor;var n=P.edges(t),r=N(n,2)[1],o=Te.pointRef(e,r);return at.delete(e,{at:t}),o.unref()}(e,u),u))){if(Ne.isPath(u)){var p=u,h=Te.point(e,p),g=Te.parent(e,p),v=N(g,1)[0];a=function(e){return e===v},c=h.path.length-p.length+1,u=h,f=!0}var m,b=Te.pointRef(e,u,{affinity:"backward"});try{var E=Te.nodes(e,{at:u,match:a,mode:r,voids:i}),w=N(E,1)[0];if(!w)return;var C=Te.void(e,{at:u,mode:"highest"});if(!i&&C){var D=N(C,2),A=D[0],S=D[1];if(e.isInline(A)){var x=Te.after(e,S);if(!x){var T=y.next(S);at.insertNodes(e,{text:""},{at:T,voids:i}),x=Te.point(e,T)}u=x,f=!0}c=u.path.length-S.length+1,f=!0}m=Te.pointRef(e,u);var O,B=u.path.length-c,k=N(w,2)[1],F=u.path.slice(0,B),I=0===c?u.offset:u.path[B]+0,R=Tr(Te.levels(e,{at:F,reverse:!0,voids:i}));try{for(R.s();!(O=R.n()).done;){var _=N(O.value,2),L=_[0],M=_[1],j=!1;if(M.length<k.length||0===M.length||!i&&U.isElement(L)&&Te.isVoid(e,L))break;var H=b.current,z=Te.isEnd(e,H,M);if(f||!b||!Te.isEdge(e,H,M)){j=!0;var $=U.extractProps(L);e.apply({type:"split_node",path:M,position:I,properties:$})}I=M[M.length-1]+(j||z?1:0)}}catch(e){R.e(e)}finally{R.f()}if(null==t.at){var V=m.current||Te.end(e,[]);at.select(e,V)}}finally{var W;b.unref(),null===(W=m)||void 0===W||W.unref()}}})};function Br(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return kr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kr(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function kr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Fr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Array.isArray(t)||(t=[t]);var r,o={},i=Br(t);try{for(i.s();!(r=i.n()).done;){o[r.value]=null}}catch(e){i.e(e)}finally{i.f()}at.setNodes(e,o,n)};function Ir(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Pr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pr(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Pr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Rr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Te.withoutNormalizing(e,function(){var n=t.mode,r=void 0===n?"lowest":n,o=t.split,i=void 0!==o&&o,a=t.voids,s=void 0!==a&&a,u=t.at,l=void 0===u?e.selection:u,c=t.match;if(l){null==c&&(c=Ne.isPath(l)?X(e,l):function(t){return U.isElement(t)&&Te.isBlock(e,t)}),Ne.isPath(l)&&(l=Te.range(e,l));var d,f=Ne.isRange(l)?Te.rangeRef(e,l):null,p=Te.nodes(e,{at:l,match:c,mode:r,voids:s}),h=Array.from(p,function(t){var n=N(t,2)[1];return Te.pathRef(e,n)}).reverse(),g=Ir(h);try{var v=function(){var t=d.value.unref(),n=Te.node(e,t),r=N(n,1)[0],o=Te.range(e,t);i&&f&&(o=P.intersection(f.current,o)),at.liftNodes(e,{at:o,match:function(e){return!U.isText(r)&&r.children.includes(e)},voids:s})};for(g.s();!(d=g.n()).done;)v()}catch(e){g.e(e)}finally{g.f()}f&&f.unref()}})};function _r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Lr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_r(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Mr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Te.withoutNormalizing(e,function(){var r=n.mode,o=void 0===r?"lowest":r,i=n.split,a=void 0!==i&&i,s=n.voids,u=void 0!==s&&s,l=n.match,c=n.at,d=void 0===c?e.selection:c;if(d){if(null==l&&(l=Ne.isPath(d)?X(e,d):e.isInline(t)?function(t){return U.isElement(t)&&Te.isInline(e,t)||U.isText(t)}:function(t){return U.isElement(t)&&Te.isBlock(e,t)}),a&&Ne.isRange(d)){var f=P.edges(d),p=N(f,2),h=p[0],g=p[1],v=Te.rangeRef(e,d,{affinity:"inward"}),m=function(t){var n=Te.above(e,{at:t,match:function(t){return U.isElement(t)&&Te.isBlock(e,t)}});return n&&Te.isEdge(e,t,n[1])};at.splitNodes(e,{at:g,match:l,voids:u,always:!m(g)}),at.splitNodes(e,{at:h,match:l,voids:u,always:!m(h)}),d=v.unref(),null==n.at&&at.select(e,d)}for(var b=Array.from(Te.nodes(e,{at:d,match:e.isInline(t)?function(t){return U.isElement(t)&&Te.isBlock(e,t)}:function(e){return U.isEditor(e)},mode:"lowest",voids:u})),E=function(){var n=N(C[w],2)[1],r=Ne.isRange(d)?P.intersection(d,Te.range(e,n)):d;if(!r)return 0;var i=Array.from(Te.nodes(e,{at:r,match:l,mode:o,voids:u}));if(i.length>0){var a=i[0],s=i[i.length-1],c=N(a,2)[1],f=N(s,2)[1];if(0===c.length&&0===f.length)return 0;var p=y.equals(c,f)?y.parent(c):y.common(c,f),h=Te.range(e,c,f),g=Te.node(e,p),v=N(g,1)[0],m=p.length+1,b=y.next(f.slice(0,m)),E=Lr(Lr({},t),{},{children:[]});at.insertNodes(e,E,{at:b,voids:u}),at.moveNodes(e,{at:h,match:function(e){return!U.isText(v)&&v.children.includes(e)},to:b.concat(0),voids:u})}},w=0,C=b;w<C.length;w++)E()}})};return kn.Editor=Te,kn.Element=_,kn.Location=Ne,kn.Node=U,kn.Operation=G,kn.Path=y,kn.PathRef=e,kn.Point=Fe,kn.PointRef=t,kn.Range=P,kn.RangeRef=n,kn.Scrubber=Pe,kn.Span=Oe,kn.Text=ze,kn.Transforms=at,kn.above=Et,kn.addMark=Dt,kn.after=Nt,kn.apply=pt,kn.before=It,kn.collapse=ir,kn.createEditor=function(){var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:function(){return!1},isInline:function(){return!1},isSelectable:function(){return!0},isVoid:function(){return!1},markableVoid:function(){return!1},onChange:function(){},apply:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return pt.apply(void 0,[e].concat(n))},addMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Dt.apply(void 0,[e].concat(n))},deleteBackward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Pt.apply(void 0,[e].concat(n))},deleteForward:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Rt.apply(void 0,[e].concat(n))},deleteFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return _t.apply(void 0,[e].concat(n))},getFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return mt.apply(void 0,[e].concat(n))},insertBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Zt.apply(void 0,[e].concat(n))},insertSoftBreak:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Qt.apply(void 0,[e].concat(n))},insertFragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return or.apply(void 0,[e].concat(n))},insertNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Jt.apply(void 0,[e].concat(n))},insertText:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tn.apply(void 0,[e].concat(n))},normalizeNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return yt.apply(void 0,[e].concat(n))},removeMark:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $n.apply(void 0,[e].concat(n))},getDirtyPaths:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return vt.apply(void 0,[e].concat(n))},shouldNormalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return bt.apply(void 0,[e].concat(n))},above:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Et.apply(void 0,[e].concat(n))},after:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Nt.apply(void 0,[e].concat(n))},before:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return It.apply(void 0,[e].concat(n))},collapse:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ir.apply(void 0,[e].concat(n))},delete:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return tr.apply(void 0,[e].concat(n))},deselect:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ar.apply(void 0,[e].concat(n))},edges:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Lt.apply(void 0,[e].concat(n))},elementReadOnly:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ht.apply(void 0,[e].concat(n))},end:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return zt.apply(void 0,[e].concat(n))},first:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return $t.apply(void 0,[e].concat(n))},fragment:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ut.apply(void 0,[e].concat(n))},getMarks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return vn.apply(void 0,[e].concat(n))},hasBlocks:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return qt.apply(void 0,[e].concat(n))},hasInlines:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Kt.apply(void 0,[e].concat(n))},hasPath:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Yt.apply(void 0,[e].concat(n))},hasTexts:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xt.apply(void 0,[e].concat(n))},insertNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return vr.apply(void 0,[e].concat(n))},isBlock:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return nn.apply(void 0,[e].concat(n))},isEdge:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return rn.apply(void 0,[e].concat(n))},isEmpty:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return on.apply(void 0,[e].concat(n))},isEnd:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return an.apply(void 0,[e].concat(n))},isNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return sn.apply(void 0,[e].concat(n))},isStart:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return un.apply(void 0,[e].concat(n))},last:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ln.apply(void 0,[e].concat(n))},leaf:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return cn.apply(void 0,[e].concat(n))},levels:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return pn.apply(void 0,[e].concat(n))},liftNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return mr.apply(void 0,[e].concat(n))},mergeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return wr.apply(void 0,[e].concat(n))},move:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return sr.apply(void 0,[e].concat(n))},moveNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Cr.apply(void 0,[e].concat(n))},next:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return mn.apply(void 0,[e].concat(n))},node:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return yn.apply(void 0,[e].concat(n))},nodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return wn.apply(void 0,[e].concat(n))},normalize:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return An.apply(void 0,[e].concat(n))},parent:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Sn.apply(void 0,[e].concat(n))},path:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Nn.apply(void 0,[e].concat(n))},pathRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return xn.apply(void 0,[e].concat(n))},pathRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Tn.apply(void 0,[e].concat(n))},point:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return In.apply(void 0,[e].concat(n))},pointRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return On.apply(void 0,[e].concat(n))},pointRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fn.apply(void 0,[e].concat(n))},positions:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return _n.apply(void 0,[e].concat(n))},previous:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ln.apply(void 0,[e].concat(n))},range:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Hn.apply(void 0,[e].concat(n))},rangeRef:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Mn.apply(void 0,[e].concat(n))},rangeRefs:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return jn.apply(void 0,[e].concat(n))},removeNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Dr.apply(void 0,[e].concat(n))},select:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ur.apply(void 0,[e].concat(n))},setNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return xr.apply(void 0,[e].concat(n))},setNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Un.apply(void 0,[e].concat(n))},setPoint:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return dr.apply(void 0,[e].concat(n))},setSelection:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return fr.apply(void 0,[e].concat(n))},splitNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Or.apply(void 0,[e].concat(n))},start:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Vn.apply(void 0,[e].concat(n))},string:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return qn.apply(void 0,[e].concat(n))},unhangRange:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xn.apply(void 0,[e].concat(n))},unsetNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fr.apply(void 0,[e].concat(n))},unwrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Rr.apply(void 0,[e].concat(n))},void:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Gt.apply(void 0,[e].concat(n))},withoutNormalizing:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Zn.apply(void 0,[e].concat(n))},wrapNodes:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Mr.apply(void 0,[e].concat(n))},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Jn.apply(void 0,[e].concat(n))}};return e},kn.deleteBackward=Pt,kn.deleteForward=Rt,kn.deleteFragment=_t,kn.deleteText=tr,kn.deselect=ar,kn.edges=Lt,kn.elementReadOnly=Ht,kn.end=zt,kn.first=$t,kn.fragment=Ut,kn.getDirtyPaths=vt,kn.getFragment=mt,kn.getVoid=Gt,kn.hasBlocks=qt,kn.hasInlines=Kt,kn.hasPath=Yt,kn.hasTexts=Xt,kn.insertBreak=Zt,kn.insertFragment=or,kn.insertNode=Jt,kn.insertNodes=vr,kn.insertSoftBreak=Qt,kn.insertText=tn,kn.isBlock=nn,kn.isEdge=rn,kn.isEditor=xe,kn.isEmpty=on,kn.isEnd=an,kn.isNormalizing=sn,kn.isObject=q,kn.isStart=un,kn.last=ln,kn.leaf=cn,kn.levels=pn,kn.liftNodes=mr,kn.marks=vn,kn.mergeNodes=wr,kn.move=sr,kn.moveNodes=Cr,kn.next=mn,kn.node=yn,kn.nodes=wn,kn.normalize=An,kn.normalizeNode=yt,kn.parent=Sn,kn.path=Nn,kn.pathRef=xn,kn.pathRefs=Tn,kn.point=In,kn.pointRef=On,kn.pointRefs=Fn,kn.positions=_n,kn.previous=Ln,kn.range=Hn,kn.rangeRef=Mn,kn.rangeRefs=jn,kn.removeMark=$n,kn.removeNodes=Dr,kn.select=ur,kn.setNodes=xr,kn.setNormalizing=Un,kn.setPoint=dr,kn.setSelection=fr,kn.shouldMergeNodesRemovePrevNode=Jn,kn.shouldNormalize=bt,kn.splitNodes=Or,kn.start=Vn,kn.string=qn,kn.unhangRange=Xn,kn.unsetNodes=Fr,kn.unwrapNodes=Rr,kn.withoutNormalizing=Zn,kn.wrapNodes=Mr,kn}var In,Pn=Fn(),Rn={exports:{}};var _n=(In||(In=1,function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Boolean]",a="[object Date]",s="[object Function]",u="[object GeneratorFunction]",l="[object Map]",c="[object Number]",d="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",v="[object String]",m="[object Symbol]",y="[object WeakMap]",b="[object ArrayBuffer]",E="[object DataView]",w="[object Float32Array]",C="[object Float64Array]",D="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",x="[object Uint8Array]",T="[object Uint8ClampedArray]",N="[object Uint16Array]",O="[object Uint32Array]",B=/\w*$/,k=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,I={};I[o]=I["[object Array]"]=I[b]=I[E]=I[i]=I[a]=I[w]=I[C]=I[D]=I[A]=I[S]=I[l]=I[c]=I[d]=I[p]=I[h]=I[v]=I[m]=I[x]=I[T]=I[N]=I[O]=!0,I["[object Error]"]=I[s]=I[y]=!1;var P="object"==typeof g&&g&&g.Object===Object&&g,R="object"==typeof self&&self&&self.Object===Object&&self,_=P||R||Function("return this")(),L=t&&!t.nodeType&&t,M=L&&e&&!e.nodeType&&e,j=M&&M.exports===L;function H(e,t){return e.set(t[0],t[1]),e}function z(e,t){return e.add(t),e}function $(e,t,n,r){for(var o=-1,i=e?e.length:0;++o<i;)n=t(n,e[o],o,e);return n}function U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function W(e,t){return function(n){return e(t(n))}}function G(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var q,K=Array.prototype,Y=Function.prototype,X=Object.prototype,Z=_["__core-js_shared__"],J=(q=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"",Q=Y.toString,ee=X.hasOwnProperty,te=X.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=j?_.Buffer:void 0,oe=_.Symbol,ie=_.Uint8Array,ae=W(Object.getPrototypeOf,Object),se=Object.create,ue=X.propertyIsEnumerable,le=K.splice,ce=Object.getOwnPropertySymbols,de=re?re.isBuffer:void 0,fe=W(Object.keys,Object),pe=Me(_,"DataView"),he=Me(_,"Map"),ge=Me(_,"Promise"),ve=Me(_,"Set"),me=Me(_,"WeakMap"),ye=Me(Object,"create"),be=Ue(pe),Ee=Ue(he),we=Ue(ge),Ce=Ue(ve),De=Ue(me),Ae=oe?oe.prototype:void 0,Se=Ae?Ae.valueOf:void 0;function xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Te(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ne(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Oe(e){this.__data__=new Te(e)}function Be(e,t){var n=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ge(e)}(e)&&ee.call(e,"callee")&&(!ue.call(e,"callee")||te.call(e)==o)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!ee.call(e,a)||i&&("length"==a||ze(a,r))||n.push(a);return n}function ke(e,t,n){var r=e[t];ee.call(e,t)&&Ve(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Fe(e,t){for(var n=e.length;n--;)if(Ve(e[n][0],t))return n;return-1}function Ie(e,t,n,r,f,g,y){var k;if(r&&(k=g?r(e,f,g,y):r(e)),void 0!==k)return k;if(!Ye(e))return e;var F=We(e);if(F){if(k=function(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!t)return function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,k)}else{var P=He(e),R=P==s||P==u;if(qe(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(P==d||P==o||R&&!g){if(U(e))return g?e:{};if(k=function(e){return"function"!=typeof e.constructor||$e(e)?{}:Ye(t=ae(e))?se(t):{};var t}(R?{}:e),!t)return function(e,t){return _e(e,je(e),t)}(e,function(e,t){return e&&_e(t,Xe(t),e)}(k,e))}else{if(!I[P])return g?e:{};k=function(e,t,n,r){var o,s=e.constructor;switch(t){case b:return Re(e);case i:case a:return new s(+e);case E:return function(e,t){var n=t?Re(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case w:case C:case D:case A:case S:case x:case T:case N:case O:return function(e,t){var n=t?Re(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case l:return function(e,t,n){var r=t?n(V(e),!0):V(e);return $(r,H,new e.constructor)}(e,r,n);case c:case v:return new s(e);case p:return function(e){var t=new e.constructor(e.source,B.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,n){var r=t?n(G(e),!0):G(e);return $(r,z,new e.constructor)}(e,r,n);case m:return o=e,Se?Object(Se.call(o)):{}}}(e,P,Ie,t)}}y||(y=new Oe);var _=y.get(e);if(_)return _;if(y.set(e,k),!F)var L=n?function(e){return function(e,t,n){var r=t(e);return We(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Xe,je)}(e):Xe(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(L||e,function(o,i){L&&(o=e[i=o]),ke(k,i,Ie(o,t,n,r,i,e,y))}),k}function Pe(e){return!(!Ye(e)||(t=e,J&&J in t))&&(Ke(e)||U(e)?ne:k).test(Ue(e));var t}function Re(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function _e(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o];ke(n,a,e[a])}return n}function Le(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Pe(n)?n:void 0}xe.prototype.clear=function(){this.__data__=ye?ye(null):{}},xe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},xe.prototype.get=function(e){var t=this.__data__;if(ye){var r=t[e];return r===n?void 0:r}return ee.call(t,e)?t[e]:void 0},xe.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:ee.call(t,e)},xe.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?n:t,this},Te.prototype.clear=function(){this.__data__=[]},Te.prototype.delete=function(e){var t=this.__data__,n=Fe(t,e);return!(n<0||(n==t.length-1?t.pop():le.call(t,n,1),0))},Te.prototype.get=function(e){var t=this.__data__,n=Fe(t,e);return n<0?void 0:t[n][1]},Te.prototype.has=function(e){return Fe(this.__data__,e)>-1},Te.prototype.set=function(e,t){var n=this.__data__,r=Fe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Ne.prototype.clear=function(){this.__data__={hash:new xe,map:new(he||Te),string:new xe}},Ne.prototype.delete=function(e){return Le(this,e).delete(e)},Ne.prototype.get=function(e){return Le(this,e).get(e)},Ne.prototype.has=function(e){return Le(this,e).has(e)},Ne.prototype.set=function(e,t){return Le(this,e).set(e,t),this},Oe.prototype.clear=function(){this.__data__=new Te},Oe.prototype.delete=function(e){return this.__data__.delete(e)},Oe.prototype.get=function(e){return this.__data__.get(e)},Oe.prototype.has=function(e){return this.__data__.has(e)},Oe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Te){var r=n.__data__;if(!he||r.length<199)return r.push([e,t]),this;n=this.__data__=new Ne(r)}return n.set(e,t),this};var je=ce?W(ce,Object):function(){return[]},He=function(e){return te.call(e)};function ze(e,t){return!!(t=null==t?r:t)&&("number"==typeof e||F.test(e))&&e>-1&&e%1==0&&e<t}function $e(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||X)}function Ue(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ve(e,t){return e===t||e!=e&&t!=t}(pe&&He(new pe(new ArrayBuffer(1)))!=E||he&&He(new he)!=l||ge&&He(ge.resolve())!=f||ve&&He(new ve)!=h||me&&He(new me)!=y)&&(He=function(e){var t=te.call(e),n=t==d?e.constructor:void 0,r=n?Ue(n):void 0;if(r)switch(r){case be:return E;case Ee:return l;case we:return f;case Ce:return h;case De:return y}return t});var We=Array.isArray;function Ge(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}(e.length)&&!Ke(e)}var qe=de||function(){return!1};function Ke(e){var t=Ye(e)?te.call(e):"";return t==s||t==u}function Ye(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Xe(e){return Ge(e)?Be(e):function(e){if(!$e(e))return fe(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return Ie(e,!0,!0)}}(Rn,Rn.exports)),Rn.exports),Ln=v(_n),Mn=new Set(["base","embed","math","meta","object","script","svg"]),jn=new Set(["href","poster","src","xlink:href"]),Hn=["java","script:"].join("");function zn(e,t,n){var r=function(e){return Array.from(e).filter(function(e){return e>" "}).join("").toLowerCase()}(n);return!r||!r.startsWith(Hn)&&!r.startsWith("vbscript:")&&(!r.startsWith("data:")||"href"!==t&&"xlink:href"!==t&&(("img"===e||"poster"===t)&&r.startsWith("data:image/")))}function $n(e){if(void 0===e&&(e=""),!e)return"";var t=document.createElement("div");t.innerHTML=e;var n=function(e){Array.from(e.childNodes).forEach(function(e){if(e instanceof Element){var t=e,r=t.tagName.toLowerCase();if("template"===r){var o=t,i=$n(o.innerHTML);return i?(o.insertAdjacentHTML("beforebegin",i),void o.remove()):void o.remove()}Mn.has(r)?t.remove():(Array.from(t.attributes).forEach(function(e){var n=e.name.toLowerCase(),o=e.value||"";("srcdoc"===n||n.startsWith("on")||jn.has(n)&&!zn(r,n,o))&&t.removeAttribute(e.name)}),n(t))}})};return n(t),t.innerHTML}var Un={};var Vn="created",Wn="destroyed",Gn="change",qn="scroll",Kn="fullscreen",Yn="unFullScreen",Xn="modalOrPanelShow",Zn="modalOrPanelHide",Jn={};function Qn(e,t){var n=e.key,r=e.factory,o=e.config,i=u(u({},o),t||{});if(null!=Jn[n])throw new Error("Duplicated key '".concat(n,"' in menu items"));Jn[n]=r,function(e,t){null!=t&&(Un[e]=t)}(n,i)}var er=new WeakMap,tr=new WeakMap,nr=new WeakMap,rr=new WeakMap,or=new WeakMap,ir=new WeakMap,ar=new WeakMap,sr=new WeakMap,ur=new WeakMap,lr=new WeakMap,cr=new WeakMap,dr=new WeakMap,fr=new WeakMap,pr=new WeakMap,hr=new WeakMap,gr=new WeakMap,vr=new WeakMap,mr=new WeakMap,yr=new WeakMap,br=new WeakMap,Er=new WeakMap,wr=new WeakMap,Cr=new WeakMap,Dr=new WeakMap,Ar=new WeakMap,Sr=new WeakMap,xr=new WeakMap,Tr=new WeakMap,Nr=new WeakMap,Or=function(e){var t=e;return t.getAllMenuKeys=function(){var e=[];for(var t in Jn)e.push(t);return e},t.getConfig=function(){var e=lr.get(t);if(null==e)throw new Error("Can not get editor config");return e},t.getMenuConfig=function(e){var n=t.getConfig().MENU_CONF;return(void 0===n?{}:n)[e]||{}},t.alert=function(e,n){void 0===n&&(n="info");var r=t.getConfig().customAlert;r&&r(e,n)},t},Br=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function kr(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function Fr(e={},t={}){Object.keys(t).forEach(n=>{void 0===e[n]?e[n]=t[n]:kr(t[n])&&kr(e[n])&&Object.keys(t[n]).length>0&&Fr(e[n],t[n])})}const Ir={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Pr(){const e="undefined"!=typeof document?document:{};return Fr(e,Ir),e}const Rr={document:Ir,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function _r(){const e="undefined"!=typeof window?window:{};return Fr(e,Rr),e}class Lr extends Array{constructor(e){"number"==typeof e?super(e):(super(...e||[]),function(e){const t=e.__proto__;Object.defineProperty(e,"__proto__",{get:()=>t,set(e){t.__proto__=e}})}(this))}}function Mr(e=[]){const t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...Mr(e)):t.push(e)}),t}function jr(e,t){return Array.prototype.filter.call(e,t)}function Hr(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function zr(e,t){const n=_r(),r=Pr();let o=[];if(!t&&e instanceof Lr)return e;if(!e)return new Lr(o);if("string"==typeof e){const n=e.trim();if(n.indexOf("<")>=0&&n.indexOf(">")>=0){let e="div";0===n.indexOf("<li")&&(e="ul"),0===n.indexOf("<tr")&&(e="tbody"),0!==n.indexOf("<td")&&0!==n.indexOf("<th")||(e="tr"),0===n.indexOf("<tbody")&&(e="table"),0===n.indexOf("<option")&&(e="select");const t=r.createElement(e);t.innerHTML=n;for(let e=0;e<t.childNodes.length;e+=1)o.push(t.childNodes[e])}else o=function(e,t){if("string"!=typeof e)return[e];const n=[],r=t.querySelectorAll(e);for(let e=0;e<r.length;e+=1)n.push(r[e]);return n}(e.trim(),t||r)}else if(e.nodeType||e===n||e===r)o.push(e);else if(Array.isArray(e)){if(e instanceof Lr)return e;o=e}return new Lr(function(e){const t=[];for(let n=0;n<e.length;n+=1)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(o))}function $r(...e){const t=Mr(e.map(e=>e.split(" ")));return this.forEach(e=>{e.classList.add(...t)}),this}function Ur(...e){const t=Mr(e.map(e=>e.split(" ")));return this.forEach(e=>{e.classList.remove(...t)}),this}function Vr(...e){const t=Mr(e.map(e=>e.split(" ")));return jr(this,e=>t.filter(t=>e.classList.contains(t)).length>0).length>0}function Wr(e,t){if(1===arguments.length&&"string"==typeof e)return this[0]?this[0].getAttribute(e):void 0;for(let n=0;n<this.length;n+=1)if(2===arguments.length)this[n].setAttribute(e,t);else for(const t in e)this[n][t]=e[t],this[n].setAttribute(t,e[t]);return this}function Gr(e){for(let t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this}function qr(e,t){let n;if(void 0===t){if(n=this[0],!n)return;if(n.dom7ElementDataStorage&&e in n.dom7ElementDataStorage)return n.dom7ElementDataStorage[e];const t=n.getAttribute(`data-${e}`);return t||void 0}for(let r=0;r<this.length;r+=1)n=this[r],n.dom7ElementDataStorage||(n.dom7ElementDataStorage={}),n.dom7ElementDataStorage[e]=t;return this}function Kr(){const e=this[0];if(!e)return;const t={};if(e.dataset)for(const n in e.dataset)t[n]=e.dataset[n];else for(let n=0;n<e.attributes.length;n+=1){const r=e.attributes[n];r.name.indexOf("data-")>=0&&(t[Hr(r.name.split("data-")[1])]=r.value)}for(const e in t)"false"===t[e]?t[e]=!1:"true"===t[e]?t[e]=!0:parseFloat(t[e])===1*t[e]&&(t[e]*=1);return t}function Yr(e){if(void 0===e){const e=this[0];if(!e)return;if(e.multiple&&"select"===e.nodeName.toLowerCase()){const t=[];for(let n=0;n<e.selectedOptions.length;n+=1)t.push(e.selectedOptions[n].value);return t}return e.value}for(let t=0;t<this.length;t+=1){const n=this[t];if(Array.isArray(e)&&n.multiple&&"select"===n.nodeName.toLowerCase())for(let t=0;t<n.options.length;t+=1)n.options[t].selected=e.indexOf(n.options[t].value)>=0;else n.value=e}return this}function Xr(...e){let[t,n,r,o]=e;function i(e){const t=e.target;if(!t)return;const o=e.target.dom7EventData||[];if(o.indexOf(e)<0&&o.unshift(e),zr(t).is(n))r.apply(t,o);else{const e=zr(t).parents();for(let t=0;t<e.length;t+=1)zr(e[t]).is(n)&&r.apply(e[t],o)}}function a(e){const t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),r.apply(this,t)}"function"==typeof e[1]&&([t,r,o]=e,n=void 0),o||(o=!1);const s=t.split(" ");let u;for(let e=0;e<this.length;e+=1){const t=this[e];if(n)for(u=0;u<s.length;u+=1){const e=s[u];t.dom7LiveListeners||(t.dom7LiveListeners={}),t.dom7LiveListeners[e]||(t.dom7LiveListeners[e]=[]),t.dom7LiveListeners[e].push({listener:r,proxyListener:i}),t.addEventListener(e,i,o)}else for(u=0;u<s.length;u+=1){const e=s[u];t.dom7Listeners||(t.dom7Listeners={}),t.dom7Listeners[e]||(t.dom7Listeners[e]=[]),t.dom7Listeners[e].push({listener:r,proxyListener:a}),t.addEventListener(e,a,o)}}return this}function Zr(...e){let[t,n,r,o]=e;"function"==typeof e[1]&&([t,r,o]=e,n=void 0),o||(o=!1);const i=t.split(" ");for(let e=0;e<i.length;e+=1){const t=i[e];for(let e=0;e<this.length;e+=1){const i=this[e];let a;if(!n&&i.dom7Listeners?a=i.dom7Listeners[t]:n&&i.dom7LiveListeners&&(a=i.dom7LiveListeners[t]),a&&a.length)for(let e=a.length-1;e>=0;e-=1){const n=a[e];r&&n.listener===r||r&&n.listener&&n.listener.dom7proxy&&n.listener.dom7proxy===r?(i.removeEventListener(t,n.proxyListener,o),a.splice(e,1)):r||(i.removeEventListener(t,n.proxyListener,o),a.splice(e,1))}}}return this}function Jr(){const e=_r();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css("width")):null}function Qr(){const e=_r();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css("height")):null}function eo(){if(this.length>0){const e=_r(),t=Pr(),n=this[0],r=n.getBoundingClientRect(),o=t.body,i=n.clientTop||o.clientTop||0,a=n.clientLeft||o.clientLeft||0,s=n===e?e.scrollY:n.scrollTop,u=n===e?e.scrollX:n.scrollLeft;return{top:r.top+s-i,left:r.left+u-a}}return null}function to(){for(let e=0;e<this.length;e+=1)this[e].style.display="none";return this}function no(){const e=_r();for(let t=0;t<this.length;t+=1){const n=this[t];"none"===n.style.display&&(n.style.display=""),"none"===e.getComputedStyle(n,null).getPropertyValue("display")&&(n.style.display="block")}return this}function ro(e,t){const n=_r();let r;if(1===arguments.length){if("string"!=typeof e){for(r=0;r<this.length;r+=1)for(const t in e)this[r].style[t]=e[t];return this}if(this[0])return n.getComputedStyle(this[0],null).getPropertyValue(e)}if(2===arguments.length&&"string"==typeof e){for(r=0;r<this.length;r+=1)this[r].style[e]=t;return this}return this}function oo(e){return e?(this.forEach((t,n)=>{e.apply(t,[t,n])}),this):this}function io(e){return zr(jr(this,e))}function ao(e){if(void 0===e)return this[0]?this[0].innerHTML:null;for(let t=0;t<this.length;t+=1)this[t].innerHTML=e;return this}function so(e){if(void 0===e)return this[0]?this[0].textContent.trim():null;for(let t=0;t<this.length;t+=1)this[t].textContent=e;return this}function uo(e){const t=_r(),n=Pr(),r=this[0];let o,i;if(!r||void 0===e)return!1;if("string"==typeof e){if(r.matches)return r.matches(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);for(o=zr(e),i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}if(e===n)return r===n;if(e===t)return r===t;if(e.nodeType||e instanceof Lr){for(o=e.nodeType?[e]:e,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function lo(...e){let t;const n=Pr();for(let r=0;r<e.length;r+=1){t=e[r];for(let e=0;e<this.length;e+=1)if("string"==typeof t){const r=n.createElement("div");for(r.innerHTML=t;r.firstChild;)this[e].appendChild(r.firstChild)}else if(t instanceof Lr)for(let n=0;n<t.length;n+=1)this[e].appendChild(t[n]);else this[e].appendChild(t)}return this}function co(e){const t=Pr();let n,r;for(n=0;n<this.length;n+=1)if("string"==typeof e){const o=t.createElement("div");for(o.innerHTML=e,r=o.childNodes.length-1;r>=0;r-=1)this[n].insertBefore(o.childNodes[r],this[n].childNodes[0])}else if(e instanceof Lr)for(r=0;r<e.length;r+=1)this[n].insertBefore(e[r],this[n].childNodes[0]);else this[n].insertBefore(e,this[n].childNodes[0]);return this}function fo(e){const t=[];for(let n=0;n<this.length;n+=1)null!==this[n].parentNode&&(e?zr(this[n].parentNode).is(e)&&t.push(this[n].parentNode):t.push(this[n].parentNode));return zr(t)}function po(e){const t=[];for(let n=0;n<this.length;n+=1){let r=this[n].parentNode;for(;r;)e?zr(r).is(e)&&t.push(r):t.push(r),r=r.parentNode}return zr(t)}function ho(e){const t=[];for(let n=0;n<this.length;n+=1){const r=this[n].querySelectorAll(e);for(let e=0;e<r.length;e+=1)t.push(r[e])}return zr(t)}function go(e){const t=[];for(let n=0;n<this.length;n+=1){const r=this[n].children;for(let n=0;n<r.length;n+=1)e&&!zr(r[n]).is(e)||t.push(r[n])}return zr(t)}function vo(){for(let e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this}function mo(){for(let e=0;e<this.length;e+=1){const t=this[e];if(1===t.nodeType){for(let e=0;e<t.childNodes.length;e+=1)t.childNodes[e].parentNode&&t.childNodes[e].parentNode.removeChild(t.childNodes[e]);t.textContent=""}}return this}zr.fn=Lr.prototype;const yo="resize scroll".split(" ");function bo(e){return function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)yo.indexOf(e)<0&&(e in this[t]?this[t][e]():zr(this[t]).trigger(e));return this}return this.on(e,...t)}}const Eo=bo("click"),wo=bo("focus"),Co=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Do,Ao=globalThis.Node;ro&&(zr.fn.css=ro),lo&&(zr.fn.append=lo),$r&&(zr.fn.addClass=$r),Ur&&(zr.fn.removeClass=Ur),Vr&&(zr.fn.hasClass=Vr),Xr&&(zr.fn.on=Xr),wo&&(zr.fn.focus=wo),Wr&&(zr.fn.attr=Wr),Gr&&(zr.fn.removeAttr=Gr),to&&(zr.fn.hide=to),no&&(zr.fn.show=no),eo&&(zr.fn.offset=eo),Jr&&(zr.fn.width=Jr),Qr&&(zr.fn.height=Qr),fo&&(zr.fn.parent=fo),po&&(zr.fn.parents=po),uo&&(zr.fn.is=uo),Kr&&(zr.fn.dataset=Kr),Yr&&(zr.fn.val=Yr),so&&(zr.fn.text=so),ao&&(zr.fn.html=ao),go&&(zr.fn.children=go),vo&&(zr.fn.remove=vo),ho&&(zr.fn.find=ho),oo&&(zr.fn.each=oo),mo&&(zr.fn.empty=mo),function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(Do||(Do={}));var So=/\[object HTML([A-Z][a-z]*)*Element\]/,xo=function(e){return So.test(Sn(e))},To=function(e){return null!=e&&"number"==typeof e.nodeType},No=function(e){return To(e)&&e.nodeType===Do.COMMENT_NODE},Oo=function(e){return To(e)&&e.nodeType===Do.ELEMENT_NODE},Bo=function(e){return"[object Selection]"===Sn(e)},ko=function(e){return To(e)&&e.nodeType===Do.TEXT_NODE},Fo=function(e,t,n){for(var r=e.childNodes,o=r[t],i=t,a=!1,s=!1;(No(o)||Oo(o)&&0===o.childNodes.length||Oo(o)&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=t-1,n="backward"):i<0?(s=!0,i=t+1,n="forward"):(o=r[i],t=i,i+="forward"===n?1:-1);return[o,t]},Io=function(e,t,n){return f(Fo(e,t,n),1)[0]},Po=function(e){var t,n,r="";if(ko(e)&&e.nodeValue)return e.nodeValue;if(Oo(e)){try{for(var o=d(Array.from(e.childNodes)),i=o.next();!i.done;i=o.next()){var a=i.value;r+=Po(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}var s=getComputedStyle(e).getPropertyValue("display");"block"!==s&&"list"!==s&&"table-row"!==s&&"BR"!==e.tagName||(r+="\n")}return r};function Ro(e,t){if(!xo(e)||"true"!==e.dataset.slateVoid)for(var n=e.childNodes,r=n.length;r-=1;){var o=n[r],i=o.nodeType;ko(o)?t(o,e):[Do.ELEMENT_NODE,Do.DOCUMENT_NODE,Do.DOCUMENT_FRAGMENT_NODE].includes(i)&&Ro(o,t)}}function _o(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==Do.ELEMENT_NODE?"":t.tagName.toLowerCase()}var Lo=new RegExp(String.fromCharCode(160),"g");function Mo(e){return e.replace(Lo," ")}var jo=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Ho=[];var zo=[];var $o={};function Uo(e,t){var n=e.length;if(n){var r=e[n-1];if(Pn.Text.isText(r)){var o=Object.keys(r);if(1===o.length&&"text"===o[0])return r.text+=t,!0}}return!1}function Vo(e,t,n){return{type:"paragraph",children:[{text:zr(e).text().replace(/\s+/gm," ")}]}}function Wo(e,t){var n=function(e,t){var n=[];if(null!=e.attr("data-w-e-is-void"))return n;var r=e[0].childNodes;return 1===r.length&&"BR"===r[0].nodeName?(n.push({text:""}),n):(r.forEach(function(e){if(Oo(e)){if("BR"===e.nodeName)return void(Uo(n,"\n")||n.push({text:"\n"}));var r=Zo(zr(e),t);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}else if(ko(e)){var o=e.textContent||"";if(""===o.trim()&&o.indexOf("\n")>=0)return;o&&(o=Mo(o),Uo(n,o)||n.push({text:o}))}}),n)}(e,t),r=function(e){for(var t in $o)if(e[0].matches(t))return $o[t];return Vo}(e),o=r(e[0],n,t);return Array.isArray(o)||(o=[o]),o.forEach(function(r){Pn.Editor.isVoid(t,r)||(0===n.length&&(r.children=[{text:e.text().replace(/\s+/gm," ")}]),zo.forEach(function(n){r=n(e[0],r,t)}))}),o}function Go(e,t){0===e.parents("pre").length&&(e[0].innerHTML=e[0].innerHTML.replace(/[\r\n\t]+/g,"").replace(/<br>/g,"\n"));var n=e[0].textContent||"",r={text:n=Mo(n=An(n))};return zo.forEach(function(n){r=n(e[0],r,t)}),r}function qo(e,t){var n={text:""};return zo.forEach(function(r){n=r(e[0],n,t)}),n}function Ko(e,t){var n=t.parentElement;return null==n?e:(null==n.closest("pre")&&(e=e.replace(/[\r\n\t]+/g,"")),e=Mo(e=An(e)))}function Yo(e,t){var n=u(u({},e),t);return Object.keys(t).forEach(function(e){!1===t[e]&&delete n[e]}),n}function Xo(e,t,n){var r=e[0];if(Oo(r)){var o=Zo(e,n),i=u({},t);return delete i.text,Array.isArray(o)?o.map(function(e){return Yo(i,e)}):[Yo(i,o)]}return No(r)?null:[Yo(t,ko(r)?{text:Ko(r.textContent||"",r)}:Go(e,n))]}function Zo(e,t){Ho.forEach(function(t){var n=t.selector,r=t.preParseHtml;e[0].matches(n)&&(e=zr(r(e[0])))});var n=_o(e);if("span"===n){if(e.attr("data-w-e-type"))return Wo(e,t);if((o=Array.from(e[0].childNodes)).some(function(e){return!ko(e)&&!No(e)})){var r=qo(zr(e[0]),t);return o.flatMap(function(e){return Xo(zr(e),r,t)||[]})}return Go(e,t)}if("code"===n)return"pre"===_o(e.parent())?Wo(e,t):Go(e,t);if(jo.includes(n)){var o;if((o=Array.from(e[0].childNodes)).some(function(e){return!ko(e)&&!No(e)})){var i=qo(zr(e[0]),t);return o.flatMap(function(e){return Xo(zr(e),i,t)||[]})}return Go(e,t)}return Wo(e,t)}function Jo(e,t,n){var r=zr(n);return!!r.attr(t)||(r.attr(t,"true"),e.on(Wn,function(){r.removeAttr(t)}),!1)}function Qo(e,t){void 0===t&&(t="");var n=[],r=e.getConfig().sanitizeHtml;""===t&&(t="<p><br></p>"),0!==t.indexOf("<")&&(t=t.split(/\n/).map(function(e){return"<p>".concat(e,"</p>")}).join("")),t=r?r(t):t;var o=zr("<div>".concat(t,"</div>"));return Array.from(o.children()).forEach(function(t){var r=Zo(zr(t),e);Array.isArray(r)?r.forEach(function(e){return n.push(e)}):n.push(r)}),n}function ei(e,t){return"w-e-element-".concat(e,"-").concat(t)}var ti=[];var ni=[];function ri(e,t,n,r){return void 0===r&&(r={}),ni.reduce(function(e,o){return o(e,t,n,r)},e)}var oi,ii,ai={};var si=function(){if(ii)return oi;ii=1;var e=9007199254740991,t="[object Arguments]",n="[object Map]",r="[object Promise]",o="[object Set]",i="[object WeakMap]",a="[object DataView]",s=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l="\\ud800-\\udfff",c="\\u0300-\\u036f\\ufe20-\\ufe23",d="\\u20d0-\\u20f0",f="\\ufe0e\\ufe0f",p="["+l+"]",h="["+c+d+"]",v="\\ud83c[\\udffb-\\udfff]",m="[^"+l+"]",y="(?:\\ud83c[\\udde6-\\uddff]){2}",b="[\\ud800-\\udbff][\\udc00-\\udfff]",E="\\u200d",w="(?:"+h+"|"+v+")"+"?",C="["+f+"]?",D=C+w+("(?:"+E+"(?:"+[m,y,b].join("|")+")"+C+w+")*"),A="(?:"+[m+h+"?",h,y,b,p].join("|")+")",S=RegExp(v+"(?="+v+")|"+A+D,"g"),x=RegExp("["+E+l+c+d+f+"]"),T="object"==typeof g&&g&&g.Object===Object&&g,N="object"==typeof self&&self&&self.Object===Object&&self,O=T||N||Function("return this")();function B(e,t){return function(e,t){for(var n=-1,r=e?e.length:0,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}(t,function(t){return e[t]})}function k(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function F(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function I(e){return function(e){return x.test(e)}(e)?function(e){return e.match(S)||[]}(e):function(e){return e.split("")}(e)}var P,R,_,L=Function.prototype,M=Object.prototype,j=O["__core-js_shared__"],H=(P=/[^.]+$/.exec(j&&j.keys&&j.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",z=L.toString,$=M.hasOwnProperty,U=M.toString,V=RegExp("^"+z.call($).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),W=O.Symbol,G=W?W.iterator:void 0,q=M.propertyIsEnumerable,K=(R=Object.keys,_=Object,function(e){return R(_(e))}),Y=ue(O,"DataView"),X=ue(O,"Map"),Z=ue(O,"Promise"),J=ue(O,"Set"),Q=ue(O,"WeakMap"),ee=de(Y),te=de(X),ne=de(Z),re=de(J),oe=de(Q);function ie(e,n){var r=fe(e)||function(e){return function(e){return ve(e)&&pe(e)}(e)&&$.call(e,"callee")&&(!q.call(e,"callee")||U.call(e)==t)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=r.length,i=!!o;for(var a in e)!$.call(e,a)||i&&("length"==a||ce(a,o))||r.push(a);return r}function ae(e){if(!ge(e)||function(e){return!!H&&H in e}(e))return!1;var t=he(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?V:s;return t.test(de(e))}function se(e){if(n=(t=e)&&t.constructor,r="function"==typeof n&&n.prototype||M,t!==r)return K(e);var t,n,r,o=[];for(var i in Object(e))$.call(e,i)&&"constructor"!=i&&o.push(i);return o}function ue(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ae(n)?n:void 0}var le=function(e){return U.call(e)};function ce(t,n){return!!(n=null==n?e:n)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<n}function de(e){if(null!=e){try{return z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(Y&&le(new Y(new ArrayBuffer(1)))!=a||X&&le(new X)!=n||Z&&le(Z.resolve())!=r||J&&le(new J)!=o||Q&&le(new Q)!=i)&&(le=function(e){var t=U.call(e),s="[object Object]"==t?e.constructor:void 0,u=s?de(s):void 0;if(u)switch(u){case ee:return a;case te:return n;case ne:return r;case re:return o;case oe:return i}return t});var fe=Array.isArray;function pe(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=e}(t.length)&&!he(t)}function he(e){var t=ge(e)?U.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ve(e){return!!e&&"object"==typeof e}function me(e){return e?B(e,function(e){return pe(e)?ie(e):se(e)}(e)):[]}return oi=function(e){if(!e)return[];if(pe(e))return function(e){return"string"==typeof e||!fe(e)&&ve(e)&&"[object String]"==U.call(e)}(e)?I(e):function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e);if(G&&e[G])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[G]());var t=le(e);return(t==n?k:t==o?F:me)(e)},oi}(),ui=v(si),li=0,ci=function(){this.id="".concat(li),li+=1},di="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),fi="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),pi="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),hi="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),gi="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),vi="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent),mi=!gi&&!hi&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,yi=function(e,t){return Boolean(e.compareDocumentPosition(t)&Ao.DOCUMENT_POSITION_PRECEDING)},bi=function(e,t){return Boolean(e.compareDocumentPosition(t)&Ao.DOCUMENT_POSITION_FOLLOWING)},Ei={getWindow:function(e){var t=Cr.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},findKey:function(e,t){var n=wr.get(t);return n||(n=new ci,wr.set(t,n)),n},setNewKey:function(e){var t=new ci;wr.set(e,t)},findPath:function(e,t){for(var n=[],r=t;;){var o=vr.get(r);if(null==o){if(Pn.Editor.isEditor(r))return n;break}var i=gr.get(r);if(null==i)break;n.unshift(i),r=o}throw new Error("Unable to find the path for Slate node: ".concat(JSON.stringify(t)))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=Ei.toDOMNode(e,e),n=t.getRootNode();return"[object HTMLDocument]"!==Sn(n)&&!function(e){return"[object ShadowRoot]"===Sn(e)}(n)||null==Reflect.get(n,"getSelection")?t.ownerDocument:n},getParentNode:function(e,t){return vr.get(t)||null},getParentsNodes:function(e,t){for(var n=[],r=t;r!==e&&null!=r;){var o=Ei.getParentNode(e,r);if(null==o)break;n.push(o),r=o}return n},getTopNode:function(e,t){var n=[Ei.findPath(e,t)[0]];return Pn.Node.get(e,n)},toDOMNode:function(e,t){var n;if(Pn.Editor.isEditor(t))n=mr.get(e);else{var r=Ei.findKey(e,t);n=br.get(r)}if(!n)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(JSON.stringify(t)));return n},hasDOMNodeBySlateNode:function(e,t){if(Pn.Editor.isEditor(t))return!!mr.get(e);var n=Ei.findKey(e,t);return!!br.get(n)},canResolveDOMRange:function(e,t){try{var n=f(Pn.Editor.node(e,t.anchor.path),1)[0],r=f(Pn.Range.isCollapsed(t)?[n]:Pn.Editor.node(e,t.focus.path),1)[0];return Ei.hasDOMNodeBySlateNode(e,n)&&Ei.hasDOMNodeBySlateNode(e,r)}catch(e){return!1}},hasDOMNode:function(e,t,n){void 0===n&&(n={});var r,o=n.editable,i=void 0!==o&&o,a=Ei.toDOMNode(e,e);try{r=Oo(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!r&&(r.closest("[data-slate-editor]")===a&&(!i||r.isContentEditable||r.closest('[contenteditable="false"]')===a||!!r.getAttribute("data-slate-zero-width"))||!!r.getAttribute("data-slate-string"))},toDOMRange:function(e,t){var n=t.anchor,r=t.focus,o=Pn.Range.isBackward(t),i=Ei.toDOMPoint(e,n),a=Pn.Range.isCollapsed(t)?i:Ei.toDOMPoint(e,r),s=Ei.getWindow(e).document.createRange(),u=f(o?a:i,2),l=u[0],c=u[1],d=f(o?i:a,2),p=d[0],h=d[1],g=!!(Oo(l)?l:l.parentElement).getAttribute("data-slate-zero-width"),v=!!(Oo(p)?p:p.parentElement).getAttribute("data-slate-zero-width");return s.setStart(l,g?1:c),s.setEnd(p,v?1:h),s},toDOMPoint:function(e,t){var n,r,o,i=f(Pn.Editor.node(e,t.path),1)[0],a=Ei.toDOMNode(e,i);Pn.Editor.void(e,{at:t})&&(t={path:t.path,offset:0});var s=Array.from(a.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),u=0;try{for(var l=d(s),c=l.next();!c.done;c=l.next()){var p=c.value,h=p.childNodes[0];if(null!=h&&null!=h.textContent){var g=h.textContent.length,v=p.getAttribute("data-slate-length"),m=u+(null==v?g:parseInt(v,10));if(t.offset<=m){o=[h,Math.min(g,Math.max(0,t.offset-u))];break}u=m}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}if(!o)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(JSON.stringify(t)));return o},toSlateNode:function(e,t){var n=Oo(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?yr.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},findEventRange:function(e,t){"nativeEvent"in t&&(t=t.nativeEvent);var n=t.clientX,r=t.clientY,o=t.target;if(null==n||null==r)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));var i,a=Ei.toSlateNode(e,t.target),s=Ei.findPath(e,a);if(Pn.Element.isElement(a)&&Pn.Editor.isVoid(e,a)){var u=o.getBoundingClientRect(),l=e.isInline(a)?n-u.left<u.left+u.width-n:r-u.top<u.top+u.height-r,c=Pn.Editor.point(e,s,{edge:l?"start":"end"}),d=l?Pn.Editor.before(e,c):Pn.Editor.after(e,c);if(d)return Pn.Editor.range(e,d)}var f=this.getWindow(e).document;if(f.caretRangeFromPoint)i=f.caretRangeFromPoint(n,r);else{var p=f.caretPositionFromPoint(n,r);p&&((i=f.createRange()).setStart(p.offsetNode,p.offset),i.setEnd(p.offsetNode,p.offset))}if(!i)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(t));return Ei.toSlateRange(e,i,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(e,t,n){var r,o,i,a,s,u=n.exactMatch,l=n.suppressThrow;if((Bo(t)?t.anchorNode:t.startContainer)&&(Bo(t)?(r=t.anchorNode,o=t.anchorOffset,i=t.focusNode,a=t.focusOffset,s=vi&&window.document.activeElement&&window.document.activeElement.shadowRoot?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed):(r=t.startContainer,o=t.startOffset,i=t.endContainer,a=t.endOffset,s=t.collapsed)),null==r||null==i||null==o||null==a){if(l)return null;throw new Error("Cannot resolve a Slate range from DOM range: ".concat(t))}var c=Ei.toSlatePoint(e,[r,o],{exactMatch:u,suppressThrow:l});if(!c)return null;var d=s?c:Ei.toSlatePoint(e,[i,a],{exactMatch:u,suppressThrow:l,searchDirection:yi(r,i)||r===i&&a<o?"forward":"backward"});if(!d)return null;var f={anchor:c,focus:d};return Pn.Range.isExpanded(f)&&Pn.Range.isForward(f)&&Oo(i)&&Pn.Editor.void(e,{at:f.focus,mode:"highest"})&&(f=Pn.Editor.unhangRange(e,f,{voids:!0})),f},toSlatePoint:function(e,t,n){var r,o,i,a,s=n.exactMatch,u=n.suppressThrow,l=f(s?t:function(e){var t,n=f(e,2),r=n[0],o=n[1];if(Oo(r)&&r.childNodes.length){var i=o===r.childNodes.length,a=i?o-1:o;for(r=(t=f(Fo(r,a,i?"backward":"forward"),2))[0],i=(a=t[1])<o;Oo(r)&&r.childNodes.length;){var s=i?r.childNodes.length-1:0;r=Io(r,s,i?"backward":"forward")}o=i&&null!=r.textContent?r.textContent.length:0}return[r,o]}(t),2),c=l[0],h=l[1],g=c.parentNode,v=n.searchDirection,m=null,y=0;if(g){var b=Ei.toDOMNode(e,e),E=g.closest('[data-slate-void="true"]'),w=E&&b.contains(E)?E:null,C=g.closest('[contenteditable="false"]'),D=C&&b.contains(C)?C:null,A=g.closest("[data-slate-leaf]"),S=null,x=Ei.getWindow(e);if(A&&x.document.createRange){m=A.closest('[data-slate-node="text"]');var T=x.document.createRange();T.setStart(m,0),T.setEnd(c,h);var N=T.cloneContents();p(p([],f(ui(N.querySelectorAll("[data-slate-zero-width]"))),!1),f(ui(N.querySelectorAll("[contenteditable=false]"))),!1).forEach(function(e){e.parentNode.removeChild(e)}),y=N.textContent.length,S=m}else if(w)(A=Array.from(w.querySelectorAll("[data-slate-leaf]")).find(function(t){return Ei.hasDOMNode(e,t)})||null)?(m=A.closest('[data-slate-node="text"]'),y=(S=A).textContent.length,S.querySelectorAll("[data-slate-zero-width]").forEach(function(e){y-=e.textContent.length})):y=1;else if(D){var O=Boolean(D.closest("[data-w-e-reserve]"));!v&&O&&(v="forward");var B=v,k=function(t){return t?Array.from(t.querySelectorAll("[data-slate-leaf]")).filter(function(t){return Ei.hasDOMNode(e,t)}):[]},F=D.closest('[data-slate-node="element"]');if("backward"===v||!v)for(var I=(R=p(p([],f(k(null==F?void 0:F.previousElementSibling)),!1),f(k(F)),!1)).length-1;I>=0;I-=1){var P=R[I];if(yi(D,P)){A=P,v="backward";break}}if(!A&&("forward"===v||!v||O)){var R=p(p([],f(k(F)),!1),f(k(null==F?void 0:F.nextElementSibling)),!1);try{for(var _=d(R),L=_.next();!L.done;L=_.next()){P=L.value;if(bi(D,P)){A=P,B="backward"===v&&O?"backward":"forward";break}}}catch(e){r={error:e}}finally{try{L&&!L.done&&(o=_.return)&&o.call(_)}finally{if(r)throw r.error}}}A&&(m=A.closest('[data-slate-node="text"]'),S=A,"forward"===B?y=0:(y=S.textContent.length,S.querySelectorAll("[data-slate-zero-width]").forEach(function(e){y-=e.textContent.length})))}S&&y===S.textContent.length&&(g.hasAttribute("data-slate-zero-width")||fi&&(null===(i=S.textContent)||void 0===i?void 0:i.endsWith("\n")))&&(y-=1)}if(!m){if(u)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}try{var M=Ei.toSlateNode(e,m);a=Ei.findPath(e,M)}catch(e){if(u)return null;throw e}return{path:a,offset:y}},hasRange:function(e,t){var n=t.anchor,r=t.focus;return Pn.Editor.hasPath(e,n.path)&&Pn.Editor.hasPath(e,r.path)},getNodeType:function(e){return Pn.Element.isElement(e)?e.type:""},checkNodeType:function(e,t){return this.getNodeType(e)===t},getNodesStr:function(e){return e.map(function(e){return Pn.Node.string(e)}).join("")},getSelectedVoidNode:function(e){var t=e.selection;if(!t)return null;var n=Pn.Editor.void(e,{at:t});if(!n)return null;var r=f(n,1)[0];return Pn.Element.isElement(r)?r:null},getSelectedElems:function(e){var t,n,r=[],o=Ei.getSelectedVoidNode(e);o&&r.push(o);var i=Pn.Editor.nodes(e,{universal:!0});try{for(var a=d(i),s=a.next();!s.done;s=a.next()){var u=f(s.value,1)[0];Pn.Element.isElement(u)&&u!==o&&r.push(u)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return r},getSelectedNodeByType:function(e,t){var n=this,r=Ei.getSelectedVoidNode(e);if(r&&this.checkNodeType(r,t))return r;var o=f(Pn.Editor.nodes(e,{match:function(e){return n.checkNodeType(e,t)},universal:!0}),1),i=o[0];return null==i?null:i[0]},getSelectedTextNode:function(e){var t=f(Pn.Editor.nodes(e,{match:function(e){return Pn.Text.isText(e)},universal:!0}),1),n=t[0];return null==n?null:n[0]},isNodeSelected:function(e,t){if(Ei.getSelectedVoidNode(e)===t)return!0;var n=f(Pn.Editor.nodes(e,{match:function(e){return e===t},universal:!0}),1),r=n[0];return null!=r&&f(r,1)[0]===t},isSelectionAtLineEnd:function(e,t){var n=e.selection;return!!n&&(Pn.Editor.isEnd(e,n.anchor,t)||Pn.Editor.isEnd(e,n.focus,t))},getTextarea:function(e){var t=er.get(e);if(null==t)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return rr.get(e)||null},getHoverbar:function(e){return ir.get(e)||null},normalizeContent:function(e){e.children.forEach(function(t,n){e.normalizeNode([t,[n]])})},getLeftLengthOfMaxLength:function(e){var t=e.getConfig(),n=t.maxLength,r=t.onMaxLength;if("number"!=typeof n||n<=0)return 1/0;var o=n-e.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,"").length;return o<=0&&r&&r(e),o},cleanExposedTexNodeInSelectionBlock:function(e){var t,n,r,o,i=Ei.getTextarea(e).$textArea,a=null==i?void 0:i[0].childNodes;if(a)try{for(var s=d(Array.from(a)),u=s.next();!u.done;u=s.next()){var l=u.value;if(!ko(l))break;l.remove()}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}var c=Pn.Editor.nodes(e,{match:function(t){return!(!Pn.Element.isElement(t)||e.isInline(t))},universal:!0});try{for(var f=d(c),p=f.next();!p.done;p=f.next()){var h=p.value;if(null!=h){var g=h[0];if(!Ei.hasDOMNodeBySlateNode(e,g))continue;Ro(Ei.toDOMNode(e,g),function(e,t){var n=zr(t);n.attr("data-slate-string")||n.attr("data-slate-zero-width")||n.attr("data-w-e-reserve")||t.removeChild(e)})}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}},isLastNode:function(e,t){var n=e.children||[];return n[n.length-1]===t},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(e){return null!=Ei.getSelectedVoidNode(e)},isSelectedEmptyParagraph:function(e){var t=e.selection;if(null==t)return!1;if(Pn.Range.isExpanded(t))return!1;var n=[t.focus.path[0]];if(!Pn.Editor.hasPath(e,n))return!1;var r=f(Pn.Editor.node(e,n),1)[0];if(!Pn.Element.isElement(r)||"paragraph"!==r.type)return!1;var o=r.children;return 1===o.length&&(""===o[0].text||void 0)},isEmptyPath:function(e,t){var n=Pn.Editor.node(e,t);if(null==n)return!1;var r=f(n,1)[0].children;if(1===r.length&&""===r[0].text)return!0;return!1}};function wi(e,t,n){var r=n.isInline(e)?"span":"div";return"<".concat(r,">").concat(t,"</").concat(r,">")}var Ci="data-w-e-id",Di=/^[A-Za-z_:-][A-Za-z0-9_:.-]*$/;function Ai(e,t,n,r){if(!r.includeId)return e;var o=function(e){return e&&Di.test(e)?e:Ci}(r.idKey),i=Ei.findKey(n,t);return function(e,t,n){if(!e)return e;var r=e.match(/^<([A-Za-z][A-Za-z0-9-]*)([^>]*)>/);if(!r)return e;var o=f(r,3),i=o[0],a=o[1],s=o[2],u=void 0===s?"":s;if(new RegExp("\\s".concat(t,"=")).test(u))return e;var l=/\/\s*$/.test(u),c=u.replace(/\s*\/\s*$/,""),d=c.trim()?" ".concat(c.trim()):"",p=l?" /":"";return"<".concat(a).concat(d," ").concat(t,'="').concat(n,'"').concat(p,">")+e.slice(i.length)}(e,o,ei(Ei.getNodeType(t),i.id))}function Si(e,t,n){void 0===n&&(n={});var r=e.type,o=void 0===r?"":r,i=e.children,a=void 0===i?[]:i,s=Pn.Editor.isVoid(t,e),u="";s||(u=a.map(function(e){return xi(e,t,n)}).join(""));var l=function(e){return ai[e]||wi}(o),c=l(e,u,t),d="";if(d="string"==typeof c?c:c.html||"",s||ti.forEach(function(n){return d=n(e,d,t)}),d=Ai(d,e,t,n),"string"==typeof c)return d;var f=c.prefix,p=void 0===f?"":f,h=c.suffix,g=void 0===h?"":h;return p&&(d=p+d),g&&(d+=g),d}function xi(e,t,n){return void 0===n&&(n={}),Pn.Element.isElement(e)?Si(e,t,n):function(e,t){var n=e.text;if(null==n)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=n;r=function(e){return e.replace(/ {2}/g," &nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/®/g,"&reg;").replace(/©/g,"&copy;").replace(/™/g,"&trade;")}(r);var o=Ei.getParentsNodes(t,e).some(function(e){return"pre"===Ei.getNodeType(e)});if(o||(r=r.replace(/\n\r|\r\n|\r|\n/g,"<br>")),o&&(r=r.replace(/&nbsp;/g," ")),""===r){var i=Ei.getParentNode(null,e);if(!i||0!==i.children.length)return r;r="<br>"}return ti.forEach(function(n){return r=n(e,r,t)}),r}(e,t)}var Ti=function(e,t){var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},Ni=function(e,t,n){var r=Ei.toDOMRange(e,t).getBoundingClientRect(),o=Ei.toDOMRange(e,n).getBoundingClientRect();return Ti(r,o)&&Ti(o,r)},Oi=function(e,t){var n,r,o=[];try{for(var i=d(Pn.Editor.levels(e,{at:t})),a=i.next();!a.done;a=i.next()){var s=f(a.value,2),u=s[0],l=s[1],c=Ei.findKey(e,u);o.push([l,c])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o};var Bi,ki,Fi,Ii,Pi,Ri,_i,Li,Mi,ji,Hi,zi,$i,Ui,Vi,Wi,Gi,qi,Ki,Yi,Xi,Zi,Ji,Qi,ea,ta,na,ra,oa,ia,aa,sa,ua,la,ca,da,fa,pa,ha,ga,va=function(e){var t=e,n=t.onChange,r=t.insertText,o=t.apply,i=t.deleteBackward,a=t.deleteFragment;return t.insertText=function(e){t.getConfig().readOnly||r(e)},t.apply=function(e){var n,r,i,a,s,u,l,c,h=[];switch(e.type){case"insert_text":case"remove_text":case"set_node":case"split_node":h.push.apply(h,p([],f(Oi(t,e.path)),!1));break;case"insert_node":case"remove_node":h.push.apply(h,p([],f(Oi(t,Pn.Path.parent(e.path))),!1));break;case"merge_node":var g=Pn.Path.previous(e.path);h.push.apply(h,p([],f(Oi(t,g)),!1));break;case"move_node":var v=Pn.Path.common(Pn.Path.parent(e.path),Pn.Path.parent(e.newPath));h.push.apply(h,p([],f(Oi(t,v)),!1));break;case"set_selection":(null===(a=null===(i=e.newProperties)||void 0===i?void 0:i.focus)||void 0===a?void 0:a.path)&&(h.push.apply(h,p([],f(Oi(t,null===(u=null===(s=e.newProperties)||void 0===s?void 0:s.focus)||void 0===u?void 0:u.path)),!1)),h.push.apply(h,p([],f(Oi(t,null===(c=null===(l=e.properties)||void 0===l?void 0:l.focus)||void 0===c?void 0:c.path)),!1)))}o(e);try{for(var m=d(h),y=m.next();!y.done;y=m.next()){var b=f(y.value,2),E=b[0],w=b[1],C=f(Pn.Editor.node(t,E),1)[0];wr.set(C,w),"type"in C&&(pr.has(C)&&pr.delete(C),hr.has(C)&&hr.delete(C))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}},t.deleteBackward=function(n){if("line"!==n)return i(n);if(e.selection&&Pn.Range.isCollapsed(e.selection)){var r=Pn.Editor.above(e,{match:function(t){return Pn.Element.isElement(t)&&Pn.Editor.isBlock(e,t)},at:e.selection});if(r){var o=f(r,2)[1],a=Pn.Editor.range(e,o,e.selection.anchor),s=function(e,t){var n=Pn.Editor.range(e,Pn.Range.end(t)),r=Array.from(Pn.Editor.positions(e,{at:t})),o=0,i=r.length,a=Math.floor(i/2);if(Ni(e,Pn.Editor.range(e,r[o]),n))return Pn.Editor.range(e,r[o],n);if(r.length<2)return Pn.Editor.range(e,r[r.length-1],n);for(;a!==r.length&&a!==o;)Ni(e,Pn.Editor.range(e,r[a]),n)?i=a:o=a,a=Math.floor((o+i)/2);return Pn.Editor.range(e,r[i],n)}(t,a);Pn.Range.isCollapsed(s)||Pn.Transforms.delete(e,{at:s})}}},t.deleteFragment=function(e){var n=function(e){var t=e.selection;if(null==t||Pn.Range.isCollapsed(t))return!1;var n=f(Pn.Range.edges(t),2),r=n[0],o=n[1],i=f(Pn.Editor.edges(e,[]),2),a=i[0],s=i[1];return Pn.Point.equals(r,a)&&Pn.Point.equals(o,s)}(t);a(e),n&&(!function(e){var t=[{type:"paragraph",children:[{text:""}]}];Pn.Editor.withoutNormalizing(e,function(){for(var n=e.children.length-1;n>=0;n-=1)Pn.Transforms.removeNodes(e,{at:[n]});Pn.Transforms.insertNodes(e,t,{at:[0]})})}(t),t.children.length>0&&Pn.Transforms.select(t,Pn.Editor.start(t,[])))},t.onChange=function(){var e=t.selection;null!=e&&Ar.set(t,e),t.emit(Gn),n()},t.handleTab=function(){t.insertText(" ")},t.getHtml=function(){var e=t.children,n=void 0===e?[]:e,r=t.getConfig().skipCacheTypes,o=void 0===r?["list-item"]:r;return ri(n.map(function(e){var n=Ei.getNodeType(e);if(o.includes(n))return xi(e,t);var r=hr.get(e);if(r)return r.toString();var i=xi(e,t);return hr.set(e,i),i}),n,t).join("")},t.getHtmlWithId=function(e){void 0===e&&(e="data-w-e-id");var n=t.children,r=void 0===n?[]:n;return ri(r.map(function(n){return xi(n,t,{includeId:!0,idKey:e})}),r,t,{includeId:!0,idKey:e}).join("")},t.getText=function(){var e=t.children;return(void 0===e?[]:e).map(function(e){return Pn.Node.string(e)}).join("\n")},t.getSelectionText=function(){var n=t.selection;return null==n?"":Pn.Editor.string(e,n)},t.getElemsByType=function(e,n){var r,o;void 0===n&&(n=!1);var i=[],a=Pn.Editor.nodes(t,{at:[],universal:!0});try{for(var s=d(a),l=s.next();!l.done;l=s.next()){var c=f(l.value,1)[0];if(Pn.Element.isElement(c))if(n?c.type.indexOf(e)>=0:c.type===e){var p=Ei.findKey(t,c),h=ei(c.type,p.id);i.push(u(u({},c),{id:h}))}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i},t.getElemsByTypePrefix=function(e){return t.getElemsByType(e,!0)},t.isEmpty=function(){var e=t.children,n=void 0===e?[]:e;if(n.length>1)return!1;var r=n[0];if(null==r)return!0;if(!Pn.Element.isElement(r)||"paragraph"!==r.type)return!1;var o=r.children,i=void 0===o?[]:o;if(i.length>1)return!1;var a=i[0];return null==a||Pn.Text.isText(a)&&""===a.text},t.clear=function(){for(var e=t.children.length-1;e>=0;e-=1)Pn.Transforms.removeNodes(t,{at:[e]});0!==t.children.length?function(e){var t=e.children[0];if(1===e.children.length&&Pn.Element.isElement(t)&&("paragraph"!==t.type||""!==Pn.Node.string(t))&&""===Pn.Node.string(t)){var n=[{type:"paragraph",children:[{text:""}]}];Pn.Editor.withoutNormalizing(e,function(){Pn.Transforms.removeNodes(e,{at:[0]}),Pn.Transforms.insertNodes(e,n,{at:[0]})})}}(t):Pn.Transforms.insertNodes(t,[{type:"paragraph",children:[{text:""}]}])},t.getParentNode=function(e){return Ei.getParentNode(t,e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e){var r=document.createElement("div");r.innerHTML=e;var o=Array.from(r.childNodes);if(o=o.filter(function(e){var t=e.nodeName;return!!ko(e)||!!Oo(e)&&!Br.has(t.toLowerCase())}),0!==o.length){var i=t.selection;if(null!=i){var a=null;if(Ei.isSelectedEmptyParagraph(t)&&!n)a=[i.focus.path[0]];r.setAttribute("hidden","true"),document.body.appendChild(r);var s=0;o.forEach(function(e,n){var r=e.nodeName,i=e.textContent,a=void 0===i?"":i;if(ko(e)){if(!a||!a.trim())return;t.insertNode({text:a})}else if("BR"!==r){var u=e,l=!1;if(jo.includes(r.toLowerCase()))l=!0;else for(var c in $o)if(u.matches(c)){l=!0;break}if(l){var d=Zo(zr(u),t),p=Array.isArray(d)?d:[d];if(p.forEach(function(e){return function(e,t){if(Pn.Text.isText(t))e.insertNode(t);else if(Pn.Element.isElement(t))if(e.isInline(t))e.insertNode(t),"link"===t.type&&e.insertFragment([{text:""}]);else{var n=e.selection;if(!n)return;var r=[n.focus.path[0]];if(Ei.isSelectedEmptyParagraph(e))return Pn.Transforms.removeNodes(e,{at:r}),Pn.Transforms.insertNodes(e,t,{at:r}),void Pn.Transforms.select(e,Pn.Editor.end(e,r));var o=Pn.Path.next(r);Pn.Transforms.insertNodes(e,t,{at:o}),Pn.Transforms.select(e,Pn.Editor.end(e,o))}}(t,e)}),s+=p.length,Ei.isSelectedVoidNode(t)&&t.move(1),p.some(function(e){return!!Pn.Element.isElement(e)&&(!!t.isInline(e)||e.children.some(function(e){return Pn.Element.isElement(e)&&t.isInline(e)}))})&&t.selection){var h=Pn.Editor.nodes(t,{at:t.selection,match:function(e){return Pn.Element.isElement(e)&&t.isInline(e)},universal:!0}).next().value;if(h){var g=f(h,2)[1],v=Pn.Path.next(g);Pn.Editor.hasPath(t,v)?Pn.Transforms.select(t,{anchor:{path:v,offset:0},focus:{path:v,offset:0}}):t.move(1)}}}else{var m=window.getComputedStyle(u).display;if(!Ei.isSelectedEmptyParagraph(t)&&m.indexOf("inline")<0){if(n>=1)(function(e){return"matches"in e&&/^[ou]l$/i.test(e.tagName)&&!e.hasAttribute("data-w-e-type")})(o[n-1])&&t.insertBreak();t.insertBreak()}t.dangerouslyInsertHtml(u.innerHTML,!0)}}else t.insertText("\n")}),s&&a&&Ei.isEmptyPath(t,a)&&Pn.Transforms.removeNodes(t,{at:a}),r.remove()}}}},t.setHtml=function(e){void 0===e&&(e="");var n=t.isDisabled(),r=t.isFocused(),o=JSON.stringify(t.selection);t.enable(),Ar.delete(t),t.focus(),t.clear();var i=Qo(t,null==e?"":e);if(Pn.Transforms.insertFragment(t,i),r||(t.deselect(),t.blur()),n&&(t.deselect(),t.disable()),t.isFocused())try{var a=JSON.parse(o);Pn.Range.isRange(a)&&Ei.hasRange(t,a)?t.select(a):t.select(Pn.Editor.start(t,[]))}catch(e){t.select(Pn.Editor.start(t,[]))}},t},ma=1,ya=function(e){var t=e;return t.id="wangEditor-".concat(ma),ma+=1,t.isDestroyed=!1,t.isFullScreen=!1,t.focus=function(e){if(Ei.toDOMNode(t,t).focus({preventScroll:!0}),Dr.set(t,!0),e){var n=Pn.Editor.end(t,[]);Pn.Transforms.select(t,n)}else{var r=Ar.get(t);r?Pn.Transforms.select(t,r):Pn.Transforms.select(t,Pn.Editor.start(t,[]))}},t.isFocused=function(){return!!Dr.get(t)},t.blur=function(){Ei.toDOMNode(t,t).blur(),Pn.Transforms.deselect(t),Dr.set(t,!1)},t.updateView=function(){Ei.getTextarea(t).changeViewState();var e=Ei.getToolbar(t);e&&e.changeToolbarState();var n=Ei.getHoverbar(t);n&&n.changeHoverbarState()},t.destroy=function(){if(!t.isDestroyed){var e=Ei.getTextarea(t);e.destroy(),er.delete(t),tr.delete(e);var n=Ei.getToolbar(t);n&&(n.destroy(),rr.delete(t),nr.delete(n));var r=Ei.getHoverbar(t);r&&(r.destroy(),ir.delete(t),or.delete(r)),t.isDestroyed=!0,t.emit(Wn)}},t.scrollToElem=function(e){if(!t.getConfig().scroll){var n="编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";return n+="\nYou has disabled editor scroll, please do this yourself",void console.warn(n)}var r=zr("#".concat(e));if(0!==r.length){var o=r[0];if(!Ei.hasDOMNode(t,o)){n="Element (found by id is '".concat(e,"') is not in editor DOM");return n+="\n 通过 id '".concat(e,"' 找到的 element 不在 editor DOM 之内"),void console.error(n,o)}var i=Ei.getTextarea(t),a=i.$textAreaContainer,s=i.$scroll,u=r.offset().top,l=a.offset().top;s[0].scrollBy({top:u-l,behavior:"smooth"})}},t.showProgressBar=function(e){e<1||Ei.getTextarea(t).changeProgress(e)},t.hidePanelOrModal=function(){var e=sr.get(t);null!=e&&e.forEach(function(e){return e.hide()})},t.enable=function(){t.getConfig().readOnly=!1,t.updateView()},t.disable=function(){t.getConfig().readOnly=!0,t.updateView()},t.isDisabled=function(){return t.getConfig().readOnly},t.toDOMNode=function(e){return Ei.toDOMNode(t,e)},t.fullScreen=function(){if(!t.isFullScreen){var e=null,n=Ei.getToolbar(t);n&&(e=n.$box);var r=Ei.getTextarea(t).$box.parent();if(e&&e.parent()[0]!==r[0]){throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致")}r.addClass("w-e-full-screen-container");var o=r.css("z-index");r.attr("data-z-index",o.toString()),t.isFullScreen=!0,t.emit(Kn)}},t.unFullScreen=function(){if(t.isFullScreen){var e=Ei.getTextarea(t).$box.parent();setTimeout(function(){e.removeClass("w-e-full-screen-container"),t.isFullScreen=!1,t.emit(Yn)},200)}},t.getEditableContainer=function(){return Ei.getTextarea(t).$textAreaContainer[0]},t},ba={exports:{}},Ea={exports:{}};function wa(){if(ki)return Bi;ki=1;return Bi=function(e){return null!=e}}function Ca(){if(Ri)return Pi;Ri=1;var e=function(){if(Ii)return Fi;Ii=1;var e=wa(),t={object:!0,function:!0,undefined:!0};return Fi=function(n){return!!e(n)&&hasOwnProperty.call(t,typeof n)}}();return Pi=function(t){if(!e(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(e){return!1}}}function Da(){if(ji)return Mi;ji=1;var e=function(){if(Li)return _i;Li=1;var e=Ca();return _i=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(e){return!1}return!e(t)}}(),t=/^\s*class[\s{/}]/,n=Function.prototype.toString;return Mi=function(r){return!!e(r)&&!t.test(n.call(r))}}function Aa(){if(qi)return Gi;qi=1;var e=(Wi?Vi:(Wi=1,Vi=function(){}))();return Gi=function(t){return t!==e&&null!==t},Gi}function Sa(){return Zi||(Zi=1,Xi=(Ui?$i:(Ui=1,$i=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}))()?Object.keys:function(){if(Yi)return Ki;Yi=1;var e=Aa(),t=Object.keys;return Ki=function(n){return t(e(n)?Object(n):n)}}()),Xi}function xa(){if(ta)return ea;ta=1;var e=Sa(),t=function(){if(Qi)return Ji;Qi=1;var e=Aa();return Ji=function(t){if(!e(t))throw new TypeError("Cannot use null or undefined");return t}}(),n=Math.max;return ea=function(r,o){var i,a,s,u=n(arguments.length,2);for(r=Object(t(r)),s=function(e){try{r[e]=o[e]}catch(e){i||(i=e)}},a=1;a<u;++a)e(o=arguments[a]).forEach(s);if(void 0!==i)throw i;return r},ea}function Ta(){return ra?na:(ra=1,na=(zi||(zi=1,Hi=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}),Hi)()?Object.assign:xa())}function Na(){return da||(da=1,ca=function(){if(sa)return aa;sa=1;var e="razdwatrzy";return aa=function(){return"function"==typeof e.contains&&!0===e.contains("dwa")&&!1===e.contains("foo")}}()()?String.prototype.contains:function(){if(la)return ua;la=1;var e=String.prototype.indexOf;return ua=function(t){return e.call(this,t,arguments[1])>-1},ua}()),ca}function Oa(){if(fa)return Ea.exports;fa=1;var e=wa(),t=Da(),n=Ta(),r=function(){if(ia)return oa;ia=1;var e=Aa(),t=Array.prototype.forEach,n=Object.create;return oa=function(r){var o=n(null);return t.call(arguments,function(t){e(t)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(t),o)}),o},oa}(),o=Na(),i=Ea.exports=function(t,i){var a,s,u,l,c;return arguments.length<2||"string"!=typeof t?(l=i,i=t,t=null):l=arguments[2],e(t)?(a=o.call(t,"c"),s=o.call(t,"e"),u=o.call(t,"w")):(a=u=!0,s=!1),c={value:i,configurable:a,enumerable:s,writable:u},l?n(r(l),c):c};return i.gs=function(i,a,s){var u,l,c,d;return"string"!=typeof i?(c=s,s=a,a=i,i=null):c=arguments[3],e(a)?t(a)?e(s)?t(s)||(c=s,s=void 0):s=void 0:(c=a,a=s=void 0):a=void 0,e(i)?(u=o.call(i,"c"),l=o.call(i,"e")):(u=!0,l=!1),d={get:a,set:s,configurable:u,enumerable:l},c?n(r(c),d):d},Ea.exports}var Ba=(ga||(ga=1,function(e,t){var n,r,o,i,a,s,u,l=Oa(),c=ha?pa:(ha=1,pa=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}),d=Function.prototype.apply,f=Function.prototype.call,p=Object.create,h=Object.defineProperty,g=Object.defineProperties,v=Object.prototype.hasOwnProperty,m={configurable:!0,enumerable:!1,writable:!0};n=function(e,t){var n;return c(t),v.call(this,"__ee__")?n=this.__ee__:(n=m.value=p(null),h(this,"__ee__",m),m.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},r=function(e,t){var r,i;return c(t),i=this,n.call(this,e,r=function(){o.call(i,e,r),d.call(t,this,arguments)}),r.__eeOnceListener__=t,this},o=function(e,t){var n,r,o,i;if(c(t),!v.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},i=function(e){var t,n,r,o,i;if(v.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)d.call(r,this,i)}else switch(arguments.length){case 1:f.call(o,this);break;case 2:f.call(o,this,arguments[1]);break;case 3:f.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];d.call(o,this,i)}},a={on:n,once:r,off:o,emit:i},s={on:l(n),once:l(r),off:l(o),emit:l(i)},u=g({},s),e.exports=t=function(e){return null==e?p(u):g(Object(e),s)},t.methods=a}(ba,ba.exports)),ba.exports),ka=v(Ba);function Fa(e){var t=Sr.get(e);return null==t&&(t=ka(),Sr.set(e,t)),t}var Ia=new WeakMap;function Pa(e,t){var n=Ia.get(e);null==n&&(n=new Set,Ia.set(e,n)),n.add(t)}var Ra=function(e){var t=e;return t.on=function(e,n){var r=Fa(t);if(r.on(e,n),"destroyed"===e&&Pa(t,n),"destroyed"!==e){var o=function(){return r.off(e,n)};r.on("destroyed",o),Pa(t,o)}},t.once=function(e,n){Fa(t).once(e,n)},t.off=function(e,n){Fa(t).off(e,n)},t.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=Fa(t);if(o.emit.apply(o,p([e],f(n),!1)),"destroyed"===e){var i=function(e){return Ia.get(e)||new Set}(t);i.forEach(function(e){return o.off("destroyed",e)}),function(e){Ia.set(e,new Set)}(t)}},t};var _a,La=function(e){var t=e;return t.setFragmentData=function(e){var n=t.selection;if(n){var r=f(Pn.Range.edges(n),2),o=r[0],i=r[1],a=Pn.Editor.void(t,{at:o.path}),s=Pn.Editor.void(t,{at:i.path});if(!Pn.Range.isCollapsed(n)||a){var u=Ei.toDOMRange(t,n),l=u.cloneContents(),c=l.childNodes[0];if(l.childNodes.forEach(function(e){e.textContent&&""!==e.textContent.trim()&&(c=e)}),s){var d=f(s,1)[0],p=u.cloneRange(),h=Ei.toDOMNode(t,d);p.setEndAfter(h),l=p.cloneContents()}if(a&&(c=l.querySelector("[data-slate-spacer]")),Array.from(l.querySelectorAll("[data-slate-zero-width]")).forEach(function(e){var t="n"===e.getAttribute("data-slate-zero-width");e.textContent=t?"\n":""}),ko(c)){var g=c.ownerDocument.createElement("span");g.style.whiteSpace="pre",g.appendChild(c),l.appendChild(g),c=g}var v=t.getFragment(),m=JSON.stringify(v),y=window.btoa(encodeURIComponent(m));c.setAttribute("data-slate-fragment",y),e.setData("application/x-slate-fragment",y);var b=l.ownerDocument.createElement("div");return b.appendChild(l),b.setAttribute("hidden","true"),l.ownerDocument.body.appendChild(b),e.setData("text/html",b.innerHTML),e.setData("text/plain",Po(b)),l.ownerDocument.body.removeChild(b),e}}},t.insertData=function(e){var n=e.getData("application/x-slate-fragment");if(n){var r=decodeURIComponent(window.atob(n)),o=JSON.parse(r);t.insertFragment(o)}else{var i=e.getData("text/plain"),a=e.getData("text/html");if(a){var s=t.getConfig().sanitizeHtml;t.dangerouslyInsertHtml(s?s(a):a)}else if(i){if(!/[\r\n]/.test(i))return void t.insertText(i);var u=function(e){return e.replace(/\n\r|\r\n|\r/g,"\n").split("\n").map(function(e){return{type:"paragraph",children:[{text:e}]}})}(i);t.insertFragment(u)}}},t},Ma={};function ja(){if(_a)return Ma;_a=1;var e=Fn(),t={isHistory:function(t){return e.isObject(t)&&Array.isArray(t.redos)&&Array.isArray(t.undos)&&(0===t.redos.length||e.Operation.isOperationList(t.redos[0].operations))&&(0===t.undos.length||e.Operation.isOperationList(t.undos[0].operations))}},n=new WeakMap,r=new WeakMap,o=new WeakMap,i=new WeakMap,a={isHistoryEditor:function(n){return t.isHistory(n.history)&&e.Editor.isEditor(n)},isMerging:function(e){return o.get(e)},isSplittingOnce:function(e){return i.get(e)},setSplittingOnce:function(e,t){i.set(e,t)},isSaving:function(e){return r.get(e)},redo:function(e){e.redo()},undo:function(e){e.undo()},withMerging:function(e,t){var n=a.isMerging(e);o.set(e,!0),t(),o.set(e,n)},withNewBatch:function(e,t){var n=a.isMerging(e);o.set(e,!0),i.set(e,!0),t(),o.set(e,n),i.delete(e)},withoutMerging:function(e,t){var n=a.isMerging(e);o.set(e,!1),t(),o.set(e,n)},withoutSaving:function(e,t){var n=a.isSaving(e);r.set(e,!1);try{t()}finally{r.set(e,n)}}};function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var l=function(t,n){return!(!n||"insert_text"!==t.type||"insert_text"!==n.type||t.offset!==n.offset+n.text.length||!e.Path.equals(t.path,n.path))||!(!n||"remove_text"!==t.type||"remove_text"!==n.type||t.offset+t.text.length!==n.offset||!e.Path.equals(t.path,n.path))},c=function(e,t){return"set_selection"!==e.type};return Ma.HISTORY=n,Ma.History=t,Ma.HistoryEditor=a,Ma.MERGING=o,Ma.SAVING=r,Ma.SPLITTING_ONCE=i,Ma.withHistory=function(t){var n=t,r=n.apply;return n.history={undos:[],redos:[]},n.redo=function(){var t=n.history,r=t.redos;if(r.length>0){var o=r[r.length-1];o.selectionBefore&&e.Transforms.setSelection(n,o.selectionBefore),a.withoutSaving(n,function(){e.Editor.withoutNormalizing(n,function(){var e,t=s(o.operations);try{for(t.s();!(e=t.n()).done;){var r=e.value;n.apply(r)}}catch(e){t.e(e)}finally{t.f()}})}),t.redos.pop(),n.writeHistory("undos",o)}},n.undo=function(){var t=n.history,r=t.undos;if(r.length>0){var o=r[r.length-1];a.withoutSaving(n,function(){e.Editor.withoutNormalizing(n,function(){var t,r=s(o.operations.map(e.Operation.inverse).reverse());try{for(r.s();!(t=r.n()).done;){var i=t.value;n.apply(i)}}catch(e){r.e(e)}finally{r.f()}o.selectionBefore&&e.Transforms.setSelection(n,o.selectionBefore)})}),n.writeHistory("redos",o),t.undos.pop()}},n.apply=function(e){var t=n.operations,o=n.history,i=o.undos,s=i[i.length-1],u=s&&s.operations[s.operations.length-1],d=a.isSaving(n),f=a.isMerging(n);if(null==d&&(d=c(e)),d){if(null==f&&(f=null!=s&&(!!t.includes(u)||l(e,u))),a.isSplittingOnce(n)&&(f=!1,a.setSplittingOnce(n,void 0)),s&&f)s.operations.push(e);else{var p={operations:[e],selectionBefore:n.selection};n.writeHistory("undos",p)}for(;i.length>100;)i.shift();o.redos=[]}r(e)},n.writeHistory=function(e,t){n.history[e].push(t)},n},Ma}var Ha=ja(),za=function(e){var t=Ha.withHistory(e);return t.clearHistory=function(){t.history.undos=[],t.history.redos=[]},t};function $a(e){return e.replace(/\n\r|\r\n|\r|\n/g,"").length}function Ua(e,t){var n,r;if(t<=0)return"";var o=t,i="";try{for(var a=d(e),s=a.next();!s.done;s=a.next()){var u=s.value;if(/\r|\n/.test(u))i+=u;else{if(o<=0)break;i+=u,o-=1}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}var Va=function(e){var t=e,n=t.insertText,r=t.insertNode,o=t.insertFragment,i=t.dangerouslyInsertHtml;return t.insertText=function(e){if(t.getConfig().maxLength){var r=Ei.getLeftLengthOfMaxLength(t);r<=0||(r<e.length?n(e.slice(0,r)):n(e))}else n(e)},t.insertNode=function(e){if(t.getConfig().maxLength){var n=Ei.getLeftLengthOfMaxLength(t);if(!(n<=0))n<Pn.Node.string(e).length||r(e)}else r(e)},t.insertFragment=function(e){if(t.getConfig().maxLength){if(e.length>0){var n=e[0];if(Ei.getLeftLengthOfMaxLength(t)<Pn.Node.string(n).length)return;o([n]);for(var r=1;r<e.length;r+=1)t.insertNode(e[r])}}else o(e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e)if(t.getConfig().maxLength){var r=Ei.getLeftLengthOfMaxLength(t);if(!(r<=0)){var o=function(e,t){if(t<=0)return"";var n=document.createElement("div");n.innerHTML=e;var r=function(e){e.forEach(function(e){return e.remove()})},o=function(e){for(var n=Array.from(e.childNodes),i=0;i<n.length;i+=1){var a=n[i];if(ko(a)){var s=a.textContent||"",u=$a(s);if(u<=t){t-=u;continue}return a.textContent=Ua(s,t),t=0,r(n.slice(i+1)),!1}if(Oo(a)){if(Br.has(a.nodeName.toLowerCase())){a.remove();continue}if(!o(a))return r(n.slice(i+1)),!1}else a.remove()}return t>0};return o(n),n.innerHTML}(e,r);o&&i(o,n)}}else i(e,n)},t};function Wa(e){return e<0?0:e}function Ga(e){var t=Ei.getTextarea(e).$textAreaContainer,n=t.width(),r=t.height(),o=t.offset();return{top:o.top,left:o.left,width:n,height:r}}function qa(e){var t={top:"0",left:"0"},n=e.selection;if(null==n)return t;var r=Ga(e);if(null==r)return t;var o=r.top,i=r.left,a=r.width,s=r.height,u=Ei.toDOMRange(e,n).getClientRects(),l=u?u[0]:null;if(null==l)return t;var c={},d=l.top-o,f=l.left-i;if(f>a/2){var p=Wa(a-f);c.right="".concat(p+5,"px")}else{var h=Wa(f);c.left="".concat(h+5,"px")}if(d>s/2){var g=Wa(s-d);c.bottom="".concat(g+5,"px")}else{var v=u[u.length-1],m=v.top-o+v.height;m<0&&(m=0),c.top="".concat(m+5,"px")}return c}function Ka(e,t,n){void 0===n&&(n="modal");var r={top:"0",left:"0"};if(null==e.selection)return r;var o=Pn.Element.isElement(t)&&e.isVoid(t),i=Pn.Element.isElement(t)&&e.isInline(t),a=Er.get(t);if(null==a)return r;var s=a.getBoundingClientRect(),u=s.top,l=s.left,c=s.height,d=s.width;if(o){var f=function(e){var t=[];t.push(e);for(var n=0;t.length>0;){var r=t.pop();if(null==r)break;if((n+=1)>1e4)break;var o=r.nodeName;if(r.nodeType===Do.ELEMENT_NODE){var i=o.toLowerCase();if(Co.includes(i)||"iframe"===i||"video"===i)return r;var a=r.children||[],s=a.length;if(s)for(var u=s-1;u>=0;u-=1)t.push(a[u])}}return null}(a);if(null!=f){var p=f.getBoundingClientRect();u=p.top,c=p.height}}var h=Ga(e);if(null==h)return r;var g=h.top,v=h.left,m=h.width,y=h.height,b={},E=u-g,w=l-v;if("bar"===n){if(b.left="".concat(Wa(w),"px"),E>40){var C=Wa(y-E);b.bottom="".concat(C+5,"px")}else b.top="".concat(E+c+5,"px");return b}if("modal"===n){if(o)if(i)if(w>(m-d)/2){var D=Wa(m-w);b.right="".concat(D+5,"px")}else{var A=Wa(w+d);b.left="".concat(A+5,"px")}else b.left="20px";else b.left="".concat(Wa(w),"px");if(o)(S=E)<0&&(S=0),b.top="".concat(S,"px");else if(E>(y-c)/2){C=Wa(y-E);b.bottom="".concat(C+5,"px")}else{var S;(S=E+c)<0&&(S=0),b.top="".concat(S+5,"px")}return b}throw new Error("type '".concat(n,"' is invalid"))}function Ya(e,t){Dn(function(){var n=Ga(e);if(null!=n){var r,o=n.top,i=n.left,a=n.width,s=n.height,u=t.offset(),l=u.top,c=u.left,d=t.width(),f=t.height(),p=l-o,h=c-i,g=t.attr("style");if(g.indexOf("top")>=0)if((r=p+f-s)>0){var v=t.css("top"),m=parseInt(v.toString(),10)-r;m<0&&(m=0),t.css("top","".concat(m,"px"))}if(g.indexOf("bottom")>=0&&l<0){var y=t.css("bottom"),b=parseInt(y.toString(),10)-Math.abs(l);t.css("bottom","".concat(b,"px"))}if(g.indexOf("left")>=0)if((r=h+d-a)>0){var E=t.css("left"),w=parseInt(E.toString(),10)-r;w<0&&(w=0),t.css("left","".concat(w,"px"))}if(g.indexOf("right")>=0&&h<0){var C=t.css("right"),D=parseInt(C.toString(),10)-Math.abs(h);t.css("right","".concat(D,"px"))}}})}var Xa,Za,Ja=function(e){var t=e,n=t.select,r=t.deselect,o=t.move;return t.select=function(e){n(e)},t.deselect=function(){var e=t.selection,n=Ei.findDocumentOrShadowRoot(t).getSelection();n&&n.rangeCount>0&&Ei.hasDOMNode(t,n.anchorNode)&&Ei.hasDOMNode(t,n.focusNode)&&n.removeAllRanges(),e&&r()},t.move=function(e,t){void 0===t&&(t=!1),"number"==typeof e?e&&(e<0||o({distance:e,unit:"character",reverse:t})):o(e)},t.moveReverse=function(e){t.move(e,!0)},t.restoreSelection=function(){var e=Ar.get(t);null!=e&&(t.focus(),n(e))},t.getSelectionPosition=function(){return qa(t)},t.getNodePosition=function(e){return Ka(t,e)},t.isSelectedAll=function(){var e=t.selection;if(null==e)return!1;var n=f(Pn.Range.edges(e),2),r=n[0],o=n[1],i=f(Pn.Editor.edges(t,[]),2),a=i[0],s=i[1];return!(!Pn.Point.equals(r,a)||!Pn.Point.equals(o,s))},t.selectAll=function(){var e=Pn.Editor.start(t,[]),r=Pn.Editor.end(t,[]);n({anchor:e,focus:r})},t};var Qa=function(){if(Za)return Xa;Za=1;var e=/^\s+|\s+$/g,t=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,r=/^0o[0-7]+$/i,o=parseInt,i="object"==typeof g&&g&&g.Object===Object&&g,a="object"==typeof self&&self&&self.Object===Object&&self,s=i||a||Function("return this")(),u=Object.prototype.toString,l=Math.max,c=Math.min,d=function(){return s.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function p(i){if("number"==typeof i)return i;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(i))return NaN;if(f(i)){var a="function"==typeof i.valueOf?i.valueOf():i;i=f(a)?a+"":a}if("string"!=typeof i)return 0===i?i:+i;i=i.replace(e,"");var s=n.test(i);return s||r.test(i)?o(i.slice(2),s?2:8):t.test(i)?NaN:+i}return Xa=function(e,t,n){var r,o,i,a,s,u,h=0,g=!1,v=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,h=t,a=e.apply(i,n)}function b(e){var n=e-u;return void 0===u||n>=t||n<0||v&&e-h>=i}function E(){var e=d();if(b(e))return w(e);s=setTimeout(E,function(e){var n=t-(e-u);return v?c(n,i-(e-h)):n}(e))}function w(e){return s=void 0,m&&r?y(e):(r=o=void 0,a)}function C(){var e=d(),n=b(e);if(r=arguments,o=this,u=e,n){if(void 0===s)return function(e){return h=e,s=setTimeout(E,t),g?y(e):a}(u);if(v)return s=setTimeout(E,t),y(u)}return void 0===s&&(s=setTimeout(E,t)),a}return t=p(t)||0,f(n)&&(g=!!n.leading,i=(v="maxWait"in n)?l(p(n.maxWait)||0,t):i,m="trailing"in n?!!n.trailing:m),C.cancel=function(){void 0!==s&&clearTimeout(s),h=0,r=u=o=s=void 0},C.flush=function(){return void 0===s?a:w(d())},C},Xa}(),es=v(Qa);const ts=e=>"string"==typeof e,ns=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},rs=e=>null==e?"":""+e,os=/###/g,is=e=>e&&e.indexOf("###")>-1?e.replace(os,"."):e,as=e=>!e||ts(e),ss=(e,t,n)=>{const r=ts(t)?t.split("."):t;let o=0;for(;o<r.length-1;){if(as(e))return{};const t=is(r[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return as(e)?{}:{obj:e,k:is(r[o])}},us=(e,t,n)=>{const{obj:r,k:o}=ss(e,t,Object);if(void 0!==r||1===t.length)return void(r[o]=n);let i=t[t.length-1],a=t.slice(0,t.length-1),s=ss(e,a,Object);for(;void 0===s.obj&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=ss(e,a,Object),s&&s.obj&&void 0!==s.obj[`${s.k}.${i}`]&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=n},ls=(e,t)=>{const{obj:n,k:r}=ss(e,t);if(n)return n[r]},cs=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?ts(e[r])||e[r]instanceof String||ts(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):cs(e[r],t[r],n):e[r]=t[r]);return e},ds=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var fs={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const ps=e=>ts(e)?e.replace(/[&<>"'\/]/g,e=>fs[e]):e;const hs=[" ",",","?","!",";"],gs=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),vs=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let e=0;e<r.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let a=e;a<r.length;++a)if(a!==e&&(i+=n),i+=r[a],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<r.length-1)continue;e+=a-e+1;break}o=t}return o},ms=e=>e&&e.replace("_","-"),ys={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class bs{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||ys,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(ts(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new bs(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new bs(this.logger,e)}}var Es=new bs;class ws{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(e=>{let[t,r]=e;for(let e=0;e<r;e++)t(...n)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(t=>{let[r,o]=t;for(let t=0;t<o;t++)r.apply(r,[e,...n])})}}}class Cs extends ws{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):ts(n)&&o?a.push(...n.split(o)):a.push(n)));const s=ls(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&i&&ts(n)?vs(this.data&&this.data[e]&&this.data[e][t],n,o):s}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),us(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in n)(ts(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=ls(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?cs(s,n,o):s={...s,...n},us(this.data,a,s),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Ds={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))}),t}};const As={};class Ss extends ws{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Es.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=hs.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const o=gs.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,n,r));if(i&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:ts(o)?[o]:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return{key:e,namespaces:ts(o)?[o]:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),s=a[a.length-1],u=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:`${s}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:u,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:i}const c=this.resolve(e,t);let d=c&&c.res;const f=c&&c.usedKey||i,p=c&&c.exactUsedKey||i,h=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,m=!ts(d)&&"boolean"!=typeof d&&"number"!=typeof d;if(!(v&&d&&m&&["[object Number]","[object Function]","[object RegExp]"].indexOf(h)<0)||ts(g)&&Array.isArray(d))if(v&&ts(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,a=!1;const l=void 0!==t.count&&!ts(t.count),f=Ss.hasDefaultValue(t),p=l?this.pluralResolver.getSuffix(u,t.count,t):"",h=t.ordinal&&l?this.pluralResolver.getSuffix(u,t.count,{ordinal:!1}):"",g=l&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),v=g&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(d)&&f&&(r=!0,d=v),this.isValidLookup(d)||(a=!0,d=i);const m=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:d,y=f&&v!==d&&this.options.updateMissing;if(a||r||y){if(this.logger.log(y?"updateKey":"missingKey",u,s,i,y?v:d),o){const e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{const o=f&&r!==d?r:m;this.options.missingKeyHandler?this.options.missingKeyHandler(e,s,n,o,y,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,s,n,o,y,t),this.emit("missingKey",e,s,n,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&l?e.forEach(e=>{const n=this.pluralResolver.getSuffixes(e,t);g&&t[`defaultValue${this.options.pluralSeparator}zero`]&&n.indexOf(`${this.options.pluralSeparator}zero`)<0&&n.push(`${this.options.pluralSeparator}zero`),n.forEach(n=>{r([e],i+n,t[`defaultValue${n}`]||v)})}):r(e,i,v))}d=this.extendTranslation(d,e,t,c,n),a&&d===i&&this.options.appendNamespaceToMissingKey&&(d=`${s}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${i}`:i,r?d:void 0):this.options.parseMissingKeyHandler(d))}else{if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,d,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(o){const e=Array.isArray(d),n=e?[]:{},r=e?p:f;for(const e in d)if(Object.prototype.hasOwnProperty.call(d,e)){const i=`${r}${o}${e}`;n[e]=this.translate(i,{...t,joinArrays:!1,ns:a}),n[e]===i&&(n[e]=d[e])}d=n}}return r?(c.res=d,c.usedParams=this.getUsedParamsDetails(t),c):d}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a=ts(e)&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(a){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let u=n.replace&&!ts(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,n.lng||this.language||r.usedLng,n),a){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null):i.translate(...r,t)},n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,s=ts(a)?[a]:a;return null!=e&&s&&s.length&&!1!==n.applyPostProcessor&&(e=Ds.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ts(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;const s=this.extractFromKey(e,a),u=s.key;n=u;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==a.count&&!ts(a.count),d=c&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),f=void 0!==a.context&&(ts(a.context)||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);l.forEach(e=>{this.isValidLookup(t)||(i=e,!As[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(As[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(n=>{if(this.isValidLookup(t))return;o=n;const i=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(i,u,n,e,a);else{let e;c&&(e=this.pluralResolver.getSuffix(n,a.count,a));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.push(u+e),a.ordinal&&0===e.indexOf(r)&&i.push(u+e.replace(r,this.options.pluralSeparator)),d&&i.push(u+t)),f){const n=`${u}${this.options.contextSeparator}${a.context}`;i.push(n),c&&(i.push(n+e),a.ordinal&&0===e.indexOf(r)&&i.push(n+e.replace(r,this.options.pluralSeparator)),d&&i.push(n+t))}}let s;for(;s=i.pop();)this.isValidLookup(t)||(r=s,t=this.getResource(n,e,s,a))}))})}),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!ts(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}const xs=e=>e.charAt(0).toUpperCase()+e.slice(1);class Ts{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Es.create("languageUtils")}getScriptPartFromCode(e){if(!(e=ms(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=ms(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(ts(e)&&e.indexOf("-")>-1){if("undefined"!=typeof Intl&&void 0!==Intl.getCanonicalLocales)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(e){}const t=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=xs(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=xs(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=xs(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),ts(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return ts(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):ts(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))}),r}}let Ns=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Os={1:e=>Number(e>1),2:e=>Number(1!=e),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)};const Bs=["v1","v2","v3"],ks=["v4"],Fs={zero:0,one:1,two:2,few:3,many:4,other:5};class Is{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=Es.create("pluralResolver"),this.options.compatibilityJSON&&!ks.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(()=>{const e={};return Ns.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Os[t.fc]}})}),e})(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi()){const n=ms("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!e.match(/-|_/))return;const r=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(r,t)}return this.pluralRulesCache[o]=i,i}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>Fs[e]-Fs[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Bs.includes(this.options.compatibilityJSON)}}const Ps=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=((e,t,n)=>{const r=ls(e,n);return void 0!==r?r:ls(t,n)})(e,t,n);return!i&&o&&ts(n)&&(i=vs(e,n,r),void 0===i&&(i=vs(t,n,r))),i},Rs=e=>e.replace(/\$/g,"$$$$");class _s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Es.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:a,suffixEscaped:s,formatSeparator:u,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:m}=e.interpolation;this.escape=void 0!==t?t:ps,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?ds(o):i||"{{",this.suffix=a?ds(a):s||"}}",this.formatSeparator=u||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=d?ds(d):f||ds("$t("),this.nestingSuffix=p?ds(p):h||ds(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let o,i,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(e.indexOf(this.formatSeparator)<0){const o=Ps(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(Ps(t,s,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,c=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,d=[{regex:this.regexpUnescape,safeValue:e=>Rs(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Rs(this.escape(e)):Rs(e)}];return d.forEach(t=>{for(a=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=u(n),void 0===i)if("function"==typeof l){const t=l(e,o,r);i=ts(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else ts(i)||this.useRawValueToEscape||(i=rs(i));const s=t.safeValue(i);if(e=e.replace(o[0],s),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];o={...i},o=o.replace&&!ts(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map(e=>e.trim());n[1]=e.shift(),s=e,u=!0}if(r=t(a.call(this,n[1].trim(),o),o),r&&n[0]===e&&!ts(r))return r;ts(r)||(r=rs(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),u&&(r=s.reduce((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const Ls=e=>{const t={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const a=r+JSON.stringify(i);let s=t[a];return s||(s=e(ms(r),o),t[a]=s),s(n)}};class Ms{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=Es.create("formatter"),this.options=e,this.formats={number:Ls((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:Ls((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:Ls((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:Ls((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:Ls((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};this.formatSeparator=t.interpolation.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Ls(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}const i=o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e);return i}}class js extends ws{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Es.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const o={},i={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),!t&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:o}=ss(e,t,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*o,i)},o):i(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();ts(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ts(t)&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)})}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const s={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let o;o=5===u.length?u(e,t,n,r,s):u(e,t,n,r),o&&"function"==typeof o.then?o.then(e=>a(null,e)).catch(a):a(null,o)}catch(e){a(e)}else u(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}const Hs=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),ts(e[1])&&(t.defaultValue=e[1]),ts(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),zs=e=>(ts(e.ns)&&(e.ns=[e.ns]),ts(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ts(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),$s=()=>{};class Us extends ws{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=zs(e),this.services={},this.logger=Es,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&(ts(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Hs();this.options={...r,...this.options,...zs(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?Es.init(o(this.modules.logger),this.options):Es.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=Ms);const n=new Ts(this.options);this.store=new Cs(this.options.resources,this.options);const i=this.services;i.logger=Es,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new Is(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=o(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new _s(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new js(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)}),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Ss(this.services,this.options),this.translator.on("*",function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=$s),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});const i=ns(),a=()=>{const e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),i}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$s;const n=ts(e)?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e))}this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){const r=ns();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=$s),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ds.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=ns();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n=ts(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{i(e,n)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const o=function(e,t){let i;if("object"!=typeof t){for(var a=arguments.length,s=new Array(a>2?a-2:0),u=2;u<a;u++)s[u-2]=arguments[u];i=r.options.overloadTranslationOptionHandler([e,t].concat(s))}else i={...t};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||o.keyPrefix);const l=r.options.keySeparator||".";let c;return c=i.keyPrefix&&Array.isArray(e)?e.map(e=>`${i.keyPrefix}${l}${e}`):i.keyPrefix?`${i.keyPrefix}${l}${e}`:e,r.t(c,i)};return ts(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=ns();return this.options.ns?(ts(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=ns();ts(e)&&(e=[e]);const r=this.options.preload||[],o=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=r.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new Ts(Hs());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new Us(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$s;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new Us(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));return["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new Cs(this.store.data,r),o.services.resourceStore=o.store),o.translator=new Ss(o.services,r),o.translator.on("*",function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit(e,...n)}),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Vs=Us.createInstance();Vs.createInstance=Us.createInstance,Vs.createInstance,Vs.dir,Vs.init,Vs.loadResources,Vs.reloadResources,Vs.use,Vs.changeLanguage,Vs.getFixedT,Vs.t,Vs.exists,Vs.setDefaultNamespace,Vs.hasLoadedNamespace,Vs.loadNamespaces,Vs.loadLanguages;var Ws="translation";function Gs(e,t){Vs.addResourceBundle(e,Ws,t,!0,!0)}function qs(e){return Vs.on("languageChanged",e),function(){return Vs.off("languageChanged",e)}}Vs.init({lng:"zh-CN",resources:{}});var Ks=Vs.t.bind(Vs);function Ys(e){if(e.removeAttr){e.removeAttr("width"),e.removeAttr("height"),e.removeAttr("fill"),e.removeAttr("class"),e.removeAttr("t"),e.removeAttr("p-id");var t=e.children();t.length&&Ys(t)}}function Xs(){return zr('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function Zs(){return zr('<div class="w-e-bar-divider"></div>')}var Js=function(){function e(e){this.isShow=!1,this.showTime=0,this.record(e)}return e.prototype.record=function(e){var t=sr.get(e);null==t&&(t=new Set,sr.set(e,t)),t.add(this),ur.set(this,e)},e.prototype.renderContent=function(e){var t=this.$elem;t.empty(),t.append(e);var n=this.genSelfElem();n&&t.append(n)},e.prototype.appendTo=function(e){var t=this.$elem;e.append(t)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var e=ur.get(this);e&&e.emit(Xn,this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var e=ur.get(this);e&&e.emit(Zn)}},e}(),Qs=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.type="dropPanel",t.$elem=zr('<div class="w-e-drop-panel"></div>'),t}return s(t,e),t.prototype.genSelfElem=function(){return null},t}(Js);function eu(e,t,n,r,o){if(void 0===r&&(r=""),void 0===o&&(o=!1),t){if(r){var i=di?"cmd":"ctrl";r=r.replace("mod",i)}if(o)r&&(e.attr("data-tooltip",r),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var a=r?"".concat(n,"\n").concat(r):n;e.attr("data-tooltip",a),e.addClass("w-e-menu-tooltip-v5")}}}var tu=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=zr('<div class="w-e-bar-item"></div>'),this.$button=zr('<button type="button"></button>'),this.disabled=!1,this.menu=t;var o=t.tag,i=t.width;if("button"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'button'"));var a=t.title,s=t.hotkey,u=void 0===s?"":s,l=t.iconSvg,c=void 0===l?"":l,d=this.$button;if(c){var f=zr(c);Ys(f),d.append(f)}else d.text(a);eu(d,c,a,u,n),n&&c&&d.append(zr('<span class="title">'.concat(a,"</span>"))),i&&d.css("width","".concat(i,"px")),d.attr("data-menu-key",e),this.$elem.append(d),Dn(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setActive(),this.setDisabled(),this.$button.on("click",function(t){t.preventDefault(),fu(e).hidePanelOrModal(),e.disabled||(e.exec(),e.onButtonClick())})},e.prototype.exec=function(){var e=fu(this),t=this.menu,n=t.getValue(e);t.exec(e,n),this.changeMenuState()},e.prototype.setActive=function(){var e=fu(this),t=this.$button,n="active";this.menu.isActive(e)?t.addClass(n):t.removeClass(n)},e.prototype.setDisabled=function(){var e=fu(this),t=this.$button,n=this.menu.isDisabled(e);(null==e.selection||e.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var r="disabled";n?t.addClass(r):t.removeClass(r),this.disabled=n},e.prototype.setIcon=function(){var e=fu(this),t=this.$button;if(this.menu.getIcon){var n=this.menu.getIcon(e);if(n){t.find("svg").remove();var r=zr(n);Ys(r),t.append(r)}}},e.prototype.setTooltip=function(){var e=fu(this),t=this.$button;if(this.menu.getTitle){var n=this.menu.getTitle(e),r=this.menu.iconSvg;n&&r&&eu(t,r,n)}},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled(),this.setIcon(),this.setTooltip()},e}(),nu=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var i=Xs();o.$button.append(i)}return o}return s(t,e),t.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},t.prototype.handleDropPanel=function(){var e=this.menu;if(null!=e.getPanelContentElem){var t=fu(this);if(null==this.dropPanel){var n=new Qs(t),r=e.getPanelContentElem(t);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{var o=this.dropPanel;if(o.isShow)o.hide();else{r=e.getPanelContentElem(t);o.renderContent(r),o.show()}}var i=this.dropPanel;if(i.isShow){var a=this.$elem,s=a.offset().left,u=a.parents(".w-e-bar");s-u.offset().left>=u.width()/2?i.$elem.css({left:"none",right:"0"}):i.$elem.css({left:"0",right:"none"})}}},t}(tu),ru=function(){function e(e){this.$elem=zr('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=zr('<div class="w-e-bar-item-menus-container"></div>'),this.$button=zr('<button type="button"></button>');var t=e.key,n=e.iconSvg,r=e.title,o=this.$elem,i=this.$button;if(n){var a=zr(n);Ys(a),i.append(a)}else i.text(r);i.attr("data-menu-key",t);var s=Xs();i.append(s),o.append(i);var u=this.$container;o.append(u);var l=this.createObserver();this.observe(l)}return e.prototype.appendBarItem=function(e){var t=e.$elem;this.$container.append(t)},e.prototype.observe=function(e){var t=this.$container;e.observe(t[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var e=this,t=this.$container,n=this.$button,r=new MutationObserver(function(){var o=t.find("button"),i=o.length;if(0!==i){var a=0;o.each(function(e){zr(e).hasClass("disabled")&&(a+=1)}),r.disconnect(),a===i?n.addClass("disabled"):n.removeClass("disabled"),e.observe(r)}});return r},e}(),ou=function(e){function t(t,n){void 0===n&&(n=0);var r=e.call(this,t)||this;r.type="modal",r.$elem=zr('<div class="w-e-modal"></div>'),r.width=0,n&&(r.width=n);var o=r.$elem;return o.on("click",function(e){return e.stopPropagation()}),o.on("keyup",function(e){"Escape"===e.code&&(r.hide(),t.restoreSelection())}),r}return s(t,e),t.prototype.genSelfElem=function(){var e=this,t=zr('<span class="btn-close">'.concat('<svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg>',"</span>")),n=ur.get(this);return t.on("click",function(){e.hide(),null==n||n.restoreSelection()}),t},t.prototype.setStyle=function(e){var t=this.width,n=this.$elem;n.attr("style",""),t&&n.css("width","".concat(t,"px")),n.css(e)},t}(Js);function iu(e,t,n){var r=zr('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=zr('<input type="text" id="'.concat(t,'" placeholder="').concat(n||"",'">'));return r.append(o),[r[0],o[0]]}function au(e,t){var n=zr('<div class="button-container"></div>'),r=zr('<button type="button" id="'.concat(e,'">').concat(t,"</button>"));return n.append(r),[n[0],r[0]]}var su=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;return o.$body=zr("body"),o.modal=null,o.menu=n,o}return s(t,e),t.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},t.prototype.getPosition=function(){var e=fu(this),t=this.menu.getModalPositionNode(e);return Pn.Element.isElement(t)?Ka(e,t,"modal"):qa(e)},t.prototype.handleModal=function(){var e=fu(this),t=this.menu;if(null==this.modal){var n=new ou(e,t.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{(n=this.modal).isShow?n.hide():this.renderAndShowModal(n,!1)}},t.prototype.renderAndShowModal=function(e,t){void 0===t&&(t=!1);var n=fu(this),r=this.menu;if(null!=r.getModalContentElem){var o=Ei.getTextarea(n),i=Ei.getToolbar(n),a=((null==i?void 0:i.getConfig())||{}).modalAppendToBody,s=r.getModalContentElem(n);if(e.renderContent(s),a)e.setStyle({left:"0",right:"0"});else{var u=this.getPosition();e.setStyle(u)}t&&(a?e.appendTo(this.$body):e.appendTo(o.$textAreaContainer)),e.show(),a||Ya(n,e.$elem),setTimeout(function(){n.blur()})}},t}(tu);var uu=function(e){function t(t,n){var r=e.call(this,t)||this;return r.type="selectList",r.$elem=zr('<div class="w-e-select-list"></div>'),n&&r.$elem.css("width","".concat(n,"px")),r.$elem.on("click",function(e){e.stopPropagation()}),r}return s(t,e),t.prototype.renderList=function(e){var t=this.$elem;t.empty();var n=zr("<ul></ul>");e.forEach(function(e){var t=e.value,r=e.text,o=e.selected,i=e.styleForRenderMenuList,a=zr('<li data-value="'.concat(t,'"></li>'));if(i&&a.css(i),o){var s=zr('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');a.append(s),a.addClass("selected")}a.append(zr('<span data-value="'.concat(t,'">').concat(r,"</span>"))),a.attr("title",r),n.append(a)}),t.append(n)},t.prototype.genSelfElem=function(){return null},t}(Js);var lu=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=zr('<div class="w-e-bar-item"></div>'),this.$button=zr('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var o=t.tag,i=t.title,a=t.width,s=t.iconSvg,u=void 0===s?"":s,l=t.hotkey,c=void 0===l?"":l;if("select"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'select'"));var d=this.$button;a&&d.css("width","".concat(a,"px")),d.attr("data-menu-key",e),eu(d,u,i,c,n),this.$elem.append(d),this.menu=t,Dn(function(){return r.init()})}return e.prototype.init=function(){var e=this;this.setSelectedValue(),this.$button.on("click",function(t){t.preventDefault(),fu(e).hidePanelOrModal(),e.trigger()})},e.prototype.trigger=function(){var e=this,t=fu(this);if(!t.isDisabled()&&!this.disabled){var n=this.menu;if(null==this.selectList){this.selectList=new uu(t,n.selectPanelWidth);var r=this.selectList,o=n.getOptions(t);r.renderList(o),r.appendTo(this.$elem),r.show(),r.$elem.on("click","li",function(t){var n=t.target;if(null!=n){t.preventDefault();var r=zr(n).attr("data-value");e.onChange(r)}})}else{if((r=this.selectList).isShow)r.hide();else{o=n.getOptions(t);r.renderList(o),r.show()}}}},e.prototype.onChange=function(e){var t=fu(this),n=this.menu;null!=n.exec&&n.exec(t,e)},e.prototype.setSelectedValue=function(){var e=fu(this),t=this.menu,n=t.getValue(e),r=function(e,t){for(var n=e.length,r="",o=0;o<n;o+=1){var i=e[o];if(i.value===t){r=i.text;break}}return r}(t.getOptions(e),n.toString()),o=this.$button,i=Xs();o.empty(),o.text(r),o.append(i)},e.prototype.setDisabled=function(){var e=fu(this),t=this.menu.isDisabled(e),n=this.$button;(null==e.selection||e.isDisabled())&&(t=!0);var r="disabled";t?n.addClass(r):n.removeClass(r),this.disabled=t},e.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},e}(),cu=function(e){function t(t,n,r){return void 0===r&&(r=!1),e.call(this,t,n,r)||this}return s(t,e),t.prototype.onButtonClick=function(){},t}(tu),du=new WeakMap;function fu(e){var t=ar.get(e);if(null==t)throw new Error("Can not get editor instance");return t}function pu(e,t,n){void 0===n&&(n=!1);var r=du.get(t);if(r)return r;var o=t.tag;if("button"===o){var i=t.showDropPanel,a=t.showModal;r=i?new nu(e,t,n):a?new su(e,t,n):new cu(e,t,n)}if("select"===o&&(r=new lu(e,t,n)),null==r)throw new Error("Invalid tag in menu ".concat(JSON.stringify(t)));return du.set(t,r),r}function hu(e,t){var n=e.selection;return null!=n&&(!Pn.Range.isCollapsed(n)&&(!Ei.getSelectedElems(e).some(function(t){if(e.isVoid(t))return!0;var n=t.type;return!!["pre","code","table"].includes(n)})&&!!Pn.Text.isText(t)))}var gu=function(){function e(){var e=this;this.$elem=zr('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=es(function(){var t=e.isShow,n=e.getSelectedNodeAndMenuKeys()||{},r=n.node,o=void 0===r?null:r,i=n.menuKeys,a=void 0===i?[]:i,s=e.getEditorInstance();if(null!=o&&e.changeItemsState(),o&&Pn.Element.isElement(o)&&t){var u=e.isSamePath(o,e.prevSelectedNode);if(!Pn.Editor.isBlock(s,o)&&u)return}e.hideAndClean(),null!=o&&(e.registerItems(a),e.setPosition(o),e.show()),e.prevSelectedNode=o},200),Dn(function(){var t=e.getEditorInstance(),n=e.$elem;n.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),Ei.getTextarea(t).$textAreaContainer.append(n),t.on(Gn,e.changeHoverbarState);var r=e.hideAndClean.bind(e);t.on(qn,r),t.on(Kn,r),t.on(Yn,r)}),this.lngListen=qs(function(){e.menus={},e.hideAndClean(),e.getEditorInstance().deselect()})}return e.prototype.getMenus=function(){return this.menus},e.prototype.hideAndClean=function(){var e=this.$elem;e.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],e.empty(),this.isShow=!1},e.prototype.checkPositionBottom=function(){var e=this.$elem,t=!1,n="undefined"!=typeof window?window.innerHeight:null;n&&n>=360&&(n-e[0].getBoundingClientRect().bottom<360&&(t=!0));t?e.addClass("w-e-bar-bottom"):e.removeClass("w-e-bar-bottom")},e.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},e.prototype.changeItemsState=function(){var e=this;Dn(function(){e.hoverbarItems.forEach(function(e){e.changeMenuState()})})},e.prototype.registerItems=function(e){var t=this,n=this.$elem;e.forEach(function(e){if("|"!==e)t.registerSingleItem(e);else{var r=Zs();n.append(r)}})},e.prototype.registerSingleItem=function(e){var t=this.getEditorInstance(),n=this.menus,r=n[e];if(null==r){var o=Jn[e];if(null==o)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof o)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));r=o(),n[e]=r}var i=t.getMenuConfig(e);i&&void 0!==i.iconSvg&&(r.iconSvg=i.iconSvg);var a=pu(e,r);this.hoverbarItems.push(a),ar.set(a,t),this.$elem.append(a.$elem)},e.prototype.setPosition=function(e){var t=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),Pn.Element.isElement(e)){var r=Ka(t,e,"bar");return n.css(r),void Ya(t,n)}if(Pn.Text.isText(e)){r=qa(t);return n.css(r),void Ya(t,n)}throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},e.prototype.getSelectedNodeAndMenuKeys=function(){var e=this.getEditorInstance();if(null==e.selection)return null;var t=this.getHoverbarKeysConf(),n=null,r=[],o=function(o){var i=t[o],a=i.match,s=i.menuKeys,u=void 0===s?[]:s,l=a||function(e,t){return Ei.checkNodeType(t,o)},c=a?null:Ei.getSelectedNodeByType(e,o),d=f(c?[[c]]:Pn.Editor.nodes(e,{match:function(t){return l(e,t)},universal:!0}),1),p=d[0];if(null!=p)return n=p[0],r=u,"break"};for(var i in t){if("break"===o(i))break}return null==n||0===r.length?null:{node:n,menuKeys:r}},e.prototype.getEditorInstance=function(){var e=or.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.getHoverbarKeysConf=function(){var e=this.getEditorInstance().getConfig().hoverbarKeys,t=void 0===e?{}:e,n=t.text;return n&&null==n.match&&(n.match=hu),t},e.prototype.isSamePath=function(e,t){if(null==e||null==t)return!1;var n=Ei.findPath(null,e),r=Ei.findPath(null,t);return Pn.Path.equals(n,r)},e.prototype.destroy=function(){var e;this.changeHoverbarState.cancel(),this.$elem.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},e}(),vu=v(pe());function mu(e,t){return To(t)&&Ei.hasDOMNode(e,t,{editable:!0})}function yu(e,t){return To(t)&&Ei.hasDOMNode(e,t)}function bu(e,t){if(mu(e,t))return!0;if(!yu(e,t))return!1;var n=null;return Oo(t)?n=t:ko(t)&&(n=t.parentElement),!!(null==n?void 0:n.closest("[data-w-e-reserve]"))||function(e,t){if(e.getConfig().readOnly)return!1;var n=yu(e,t)&&Ei.toSlateNode(e,t);return!!n&&Pn.Element.isElement(n)&&Pn.Editor.isVoid(e,n)}(e,t)}const Eu=e=>"object"==typeof e&&null!=e&&1===e.nodeType,wu=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,Cu=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return wu(n.overflowY,t)||wu(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Du=(e,t,n,r,o,i,a,s)=>i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0,Au=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},Su=(e,t)=>{var n,r,o,i;if("undefined"==typeof document)return[];const{scrollMode:a,block:s,inline:u,boundary:l,skipOverflowHiddenElements:c}=t,d="function"==typeof l?l:e=>e!==l;if(!Eu(e))throw new TypeError("Invalid target");const f=document.scrollingElement||document.documentElement,p=[];let h=e;for(;Eu(h)&&d(h);){if(h=Au(h),h===f){p.push(h);break}null!=h&&h===document.body&&Cu(h)&&!Cu(document.documentElement)||null!=h&&Cu(h,c)&&p.push(h)}const g=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,v=null!=(i=null==(o=window.visualViewport)?void 0:o.height)?i:innerHeight,{scrollX:m,scrollY:y}=window,{height:b,width:E,top:w,right:C,bottom:D,left:A}=e.getBoundingClientRect(),{top:S,right:x,bottom:T,left:N}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let O="start"===s||"nearest"===s?w-S:"end"===s?D+T:w+b/2-S+T,B="center"===u?A+E/2-N+x:"end"===u?C+x:A-N;const k=[];for(let e=0;e<p.length;e++){const t=p[e],{height:n,width:r,top:o,right:i,bottom:l,left:c}=t.getBoundingClientRect();if("if-needed"===a&&w>=0&&A>=0&&D<=v&&C<=g&&(t===f&&!Cu(t)||w>=o&&D<=l&&A>=c&&C<=i))return k;const d=getComputedStyle(t),h=parseInt(d.borderLeftWidth,10),S=parseInt(d.borderTopWidth,10),x=parseInt(d.borderRightWidth,10),T=parseInt(d.borderBottomWidth,10);let N=0,F=0;const I="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-x:0,P="offsetHeight"in t?t.offsetHeight-t.clientHeight-S-T:0,R="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,_="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(f===t)N="start"===s?O:"end"===s?O-v:"nearest"===s?Du(y,y+v,v,S,T,y+O,y+O+b,b):O-v/2,F="start"===u?B:"center"===u?B-g/2:"end"===u?B-g:Du(m,m+g,g,h,x,m+B,m+B+E,E),N=Math.max(0,N+y),F=Math.max(0,F+m);else{N="start"===s?O-o-S:"end"===s?O-l+T+P:"nearest"===s?Du(o,l,n,S,T+P,O,O+b,b):O-(o+n/2)+P/2,F="start"===u?B-c-h:"center"===u?B-(c+r/2)+I/2:"end"===u?B-i+x+I:Du(c,i,r,h,x+I,B,B+E,E);const{scrollLeft:e,scrollTop:a}=t;N=0===_?0:Math.max(0,Math.min(a+N/_,t.scrollHeight-n/_+P)),F=0===R?0:Math.max(0,Math.min(e+F/R,t.scrollWidth-r/R+I)),O+=a-N,B+=e-F}k.push({el:t,top:N,left:F})}return k};function xu(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(Su(e,t));const r="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:o,top:i,left:a}of Su(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=i-n.top+n.bottom,t=a-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}function Tu(e){null!=e.selection&&(e.selection=null,e.onChange())}function Nu(e,t,n){void 0===n&&(n=!1);var r=t.selection,o=t.getConfig(),i=Ei.findDocumentOrShadowRoot(t).getSelection();if(i&&(!e.isComposing||n)&&t.isFocused()){var a="None"!==i.type;if(r||a){var s=mr.get(t),u=!1;if(s.contains(i.anchorNode)&&s.contains(i.focusNode)&&(u=!0),a&&u&&r){var l=Ei.toSlateRange(t,i,{exactMatch:!0,suppressThrow:!0});if(l&&Pn.Range.equals(l,r)){var c=!0;if(Pn.Range.isCollapsed(r)){var d=i.anchorNode,f=i.anchorOffset;if(d===s){var p=s.childNodes,h=void 0;(h=p[f])&&h.matches("table")&&(c=!1),(h=p[f-1])&&h.matches("table")&&(c=!1)}}if(c)return}}if(!r||Ei.hasRange(t,r)){e.isUpdatingSelection=!0;var g=null;try{g=r&&Ei.toDOMRange(t,r)}catch(e){g=null}if(g){Pn.Range.isBackward(r)?i.setBaseAndExtent(g.endContainer,g.endOffset,g.startContainer,g.startOffset):i.setBaseAndExtent(g.startContainer,g.startOffset,g.endContainer,g.endOffset);var v=g.startContainer.parentElement;if(!v.closest("[data-slate-spacer]")&&g.getBoundingClientRect){var m=g.getBoundingClientRect.bind(g)();0===m.top&&0===m.right&&0===m.bottom&&0===m.left&&0===m.height&&0===m.width||(v.getBoundingClientRect=g.getBoundingClientRect.bind(g));var y=document.body;if(xu(v,{scrollMode:"if-needed",boundary:o.scroll&&s.parentElement||y,block:"end",behavior:"auto"}),o.scroll){var b=s.parentElement;if(b){var E=function(){var e=g.getBoundingClientRect(),t=b.getBoundingClientRect(),n=e.bottom-t.bottom,r=t.top-e.top;n>0?b.scrollTop+=n+1:r>0&&(b.scrollTop-=r+1)};E(),requestAnimationFrame(E)}}delete v.getBoundingClientRect}}else i.removeAllRanges();setTimeout(function(){g&&fi&&s.focus(),e.isUpdatingSelection=!1})}else t.selection=Ei.toSlateRange(t,i,{exactMatch:!1,suppressThrow:!0})}}}var Ou=new WeakMap,Bu=new WeakMap;function ku(e){var t;try{t=Ei.findDocumentOrShadowRoot(e)}catch(e){return null}var n=t.getSelection();if(!n||n.rangeCount<=0)return null;try{return n.getRangeAt(0).startContainer}catch(e){return null}}var Fu,Iu={};var Pu=function(){if(Fu)return Iu;Fu=1,Object.defineProperty(Iu,"__esModule",{value:!0});for(var e="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),t={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},n={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:e?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},r={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},o=1;o<20;o++)r["f"+o]=111+o;function i(e,t,n){t&&!("byKey"in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(e){return a(e,t)}),o=function(e){return r.some(function(t){return s(t,e)})};return null==n?o:o(n)}function a(e,o){var i=o&&o.byKey,a={},s=(e=e.replace("++","+add")).split("+"),c=s.length;for(var d in t)a[t[d]]=!1;var f=!0,p=!1,h=void 0;try{for(var g,v=s[Symbol.iterator]();!(f=(g=v.next()).done);f=!0){var m=g.value,y=m.endsWith("?")&&m.length>1;y&&(m=m.slice(0,-1));var b=l(m),E=t[b];if(m.length>1&&!E&&!n[m]&&!r[b])throw new TypeError('Unknown modifier: "'+m+'"');1!==c&&E||(i?a.key=b:a.which=u(m)),E&&(a[E]=!y||null)}}catch(e){p=!0,h=e}finally{try{!f&&v.return&&v.return()}finally{if(p)throw h}}return a}function s(e,t){for(var n in e){var r=e[n],o=void 0;if(null!=r&&((null!=(o="key"===n&&null!=t.key?t.key.toLowerCase():"which"===n?91===r&&93===t.which?91:t.which:t[n])||!1!==r)&&o!==r))return!1}return!0}function u(e){return e=l(e),r[e]||e.toUpperCase().charCodeAt(0)}function l(e){return e=e.toLowerCase(),e=n[e]||e}return Iu.default=i,Iu.isHotkey=i,Iu.isCodeHotkey=function(e,t){return i(e,t)},Iu.isKeyHotkey=function(e,t){return i(e,{byKey:!0},t)},Iu.parseHotkey=a,Iu.compareHotkey=s,Iu.toKeyCode=u,Iu.toKeyName=l,Iu}(),Ru={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},_u={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Lu={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Mu=function(e){var t=Ru[e],n=_u[e],r=Lu[e],o=t&&Pu.isKeyHotkey(t),i=n&&Pu.isKeyHotkey(n),a=r&&Pu.isKeyHotkey(r);return function(e){return!(!o||!o(e))||(!!(di&&i&&i(e))||!(di||!a||!a(e)))}},ju={isBold:Mu("bold"),isCompose:Mu("compose"),isMoveBackward:Mu("moveBackward"),isMoveForward:Mu("moveForward"),isDeleteBackward:Mu("deleteBackward"),isDeleteForward:Mu("deleteForward"),isDeleteLineBackward:Mu("deleteLineBackward"),isDeleteLineForward:Mu("deleteLineForward"),isDeleteWordBackward:Mu("deleteWordBackward"),isDeleteWordForward:Mu("deleteWordForward"),isExtendBackward:Mu("extendBackward"),isExtendForward:Mu("extendForward"),isExtendLineBackward:Mu("extendLineBackward"),isExtendLineForward:Mu("extendLineForward"),isItalic:Mu("italic"),isMoveLineBackward:Mu("moveLineBackward"),isMoveLineForward:Mu("moveLineForward"),isMoveWordBackward:Mu("moveWordBackward"),isMoveWordForward:Mu("moveWordForward"),isRedo:Mu("redo"),isSplitBlock:Mu("splitBlock"),isTransposeCharacter:Mu("transposeCharacter"),isUndo:Mu("undo"),isTab:Mu("tab"),isSelectAll:Mu("selectAll")};function Hu(e){e.preventDefault()}var zu={beforeinput:function(e,t,n){var r,o,i=e,a=n.getConfig().readOnly;if(mi&&!a&&mu(n,i.target)){null===(r=t.flushDOMSelectionChange)||void 0===r||r.call(t);var s=n.selection,u=i.inputType,l=i.dataTransfer||i.data||void 0;if("insertCompositionText"!==u&&"deleteCompositionText"!==u){if(i.preventDefault(),!u.startsWith("delete")||u.startsWith("deleteBy")){var c=f(i.getTargetRanges(),1)[0];if(c){var d=null;try{d=Ei.toSlateRange(n,c,{exactMatch:!1,suppressThrow:!0})}catch(e){d=null}!d||s&&Pn.Range.equals(s,d)||(Pn.Transforms.select(n,d),s=d)}}if(s&&Pn.Range.isExpanded(s)){var p=Ei.getSelectedElems(n),h="table"===p[0].type,g="table-cell"!==p[p.length-1].type;if(h&&g)return;if(u.startsWith("delete")){var v=u.endsWith("Backward")?"backward":"forward";return void Pn.Editor.deleteFragment(n,{direction:v})}}if(null==s&&u.startsWith("insert")){var m=Ei.findDocumentOrShadowRoot(n).getSelection();if(m){var y=Ei.toSlateRange(n,m,{exactMatch:!1,suppressThrow:!0});y&&(Pn.Transforms.select(n,y),s=y)}if(null==s){try{null===(o=n.restoreSelection)||void 0===o||o.call(n)}catch(e){}s=n.selection}if(null==s){var b=Pn.Editor.end(n,[]),E={anchor:b,focus:b};Pn.Transforms.select(n,E),s=E}}switch(u){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":Pn.Editor.deleteFragment(n);break;case"deleteContent":case"deleteContentForward":Pn.Editor.deleteForward(n);break;case"deleteContentBackward":Pn.Editor.deleteBackward(n);break;case"deleteEntireSoftLine":Pn.Editor.deleteBackward(n,{unit:"line"}),Pn.Editor.deleteForward(n,{unit:"line"});break;case"deleteHardLineBackward":Pn.Editor.deleteBackward(n,{unit:"block"});break;case"deleteSoftLineBackward":Pn.Editor.deleteBackward(n,{unit:"line"});break;case"deleteHardLineForward":Pn.Editor.deleteForward(n,{unit:"block"});break;case"deleteSoftLineForward":Pn.Editor.deleteForward(n,{unit:"line"});break;case"deleteWordBackward":Pn.Editor.deleteBackward(n,{unit:"word"});break;case"deleteWordForward":Pn.Editor.deleteForward(n,{unit:"word"});break;case"insertLineBreak":Pn.Editor.insertText(n,"\n");break;case"insertParagraph":Pn.Editor.insertBreak(n);break;case"insertFromDrop":case"insertFromComposition":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("insertFromComposition"===u&&(t.isComposing=!1,Tr.set(n,!0)),"insertFromPaste"===u&&!xr.get(n))break;"[object DataTransfer]"===Sn(l)?n.insertData(l):"string"==typeof l&&Pn.Editor.insertText(n,l)}}}},blur:function(e,t,n){var r=e,o=t.isUpdatingSelection,i=t.latestElement;if(!n.getConfig().readOnly&&!o&&mu(n,r.target)){var a=Ei.findDocumentOrShadowRoot(n);if(i!==a.activeElement){var s=r.relatedTarget;if(!(s===Ei.toDOMNode(n,n)||Oo(s)&&s.hasAttribute("data-slate-spacer"))){if(null!=s&&To(s)&&Ei.hasDOMNode(n,s)){var u=Ei.toSlateNode(n,s);if(Pn.Element.isElement(u)&&!n.isVoid(u))return}if(pi){var l=a.getSelection();null==l||l.removeAllRanges()}Dr.delete(n)}}}},focus:function(e,t,n){var r=Ei.toDOMNode(n,n),o=Ei.findDocumentOrShadowRoot(n);t.latestElement=o.activeElement,fi&&e.target!==r?r.focus():Dr.set(n,!0)},click:function(e,t,n){if(!n.getConfig().readOnly&&yu(n,e.target)&&To(e.target)){var r=Ei.toSlateNode(n,e.target),o=Ei.findPath(n,r);if(Pn.Editor.hasPath(n,o))if(Pn.Node.get(n,o)===r){var i=Pn.Editor.start(n,o),a=Pn.Editor.end(n,o),s=Pn.Editor.void(n,{at:i}),u=Pn.Editor.void(n,{at:a});if(s&&u&&Pn.Path.equals(s[1],u[1])){var l=Pn.Editor.range(n,i);Pn.Transforms.select(n,l)}}}},compositionstart:function(e,t,n){if(mu(n,e.target)){Nr.delete(n),t.isComposing=!0;var r=n.selection;if(r&&Pn.Range.isCollapsed(r)){var o=ku(n);if(o){var i=o.textContent||"";Ou.set(n,i),Bu.set(n,o)}}r&&Pn.Range.isExpanded(r)&&(Pn.Editor.deleteFragment(n),t.changeViewState(),Promise.resolve().then(function(){Nu(t,n,!0)})),function(e,t){var n;t.getConfig().placeholder&&t.isEmpty()&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}(t,n)}},compositionend:function(e,t,n){var r=e;if(mu(n,r.target)){t.isComposing=!1;var o=!0===Tr.get(n);o?(Tr.delete(n),Nr.delete(n)):Nr.delete(n);var i=function(e){var t,n=e.selection;if(n)return n;try{var r=Ei.findDocumentOrShadowRoot(e).getSelection();if(r){var o=Ei.toSlateRange(e,r,{exactMatch:!1,suppressThrow:!0});o&&(Pn.Transforms.select(e,o),n=o)}}catch(e){}if(!n){try{null===(t=e.restoreSelection)||void 0===t||t.call(e)}catch(e){}n=e.selection}if(!n){var i=Pn.Editor.end(e,[]),a={anchor:i,focus:i};Pn.Transforms.select(e,a),n=a}return n}(n);if(null!=i){(vi||fi)&&Ei.cleanExposedTexNodeInSelectionBlock(n);for(var a=Pn.Range.isBackward(i)?i.focus:i.anchor,s=f(Pn.Editor.node(n,[a.path[0]]),1)[0],u=0;u<a.path.length;u+=1){var l=f(Pn.Editor.node(n,a.path.slice(0,u+1)),1)[0];if(Pn.Element.isElement(l)&&((pi||fi)&&"link"===l.type||"code"===l.type)){Ei.setNewKey(s);break}}var c=r.data;if(c&&!o){if(n.getConfig().maxLength){var d=Ei.getLeftLengthOfMaxLength(n);if(d<c.length){var p=ku(n);p&&p.nodeType===Node.TEXT_NODE&&(p.textContent=Ou.get(n)||""),d>0&&Pn.Editor.insertText(n,c.slice(0,d)),t.changeViewState()}else Pn.Editor.insertText(n,c)}else{var h=Ei.findDocumentOrShadowRoot(n).getSelection();if(h&&function(e,t){if(Pn.Range.isCollapsed(t)){var n=t.anchor,r=t.focus;if([2,3].includes(n.path.length)&&[2,3].includes(r.path.length)&&(0===n.offset||0===r.offset)){var o=Pn.Editor.node(e,n.path),i=0===n.offset?n.path:r.path,a=[i[0],i[1]-1];if(0===i[1])return!1;var s=Pn.Editor.node(e,a);if(Pn.Text.isText(s[0])&&Pn.Text.isText(o[0]))return!0}}}(n,i)){var g=Ei.toSlateRange(n,h,{exactMatch:!1,suppressThrow:!1});g&&(n.selection=g)}Pn.Editor.insertText(n,c)}pi||setTimeout(function(){if(null!=n.selection){var e=Bu.get(n);if(null!=e&&e.nodeType===Node.TEXT_NODE){var t=ku(n);null!=t&&t.nodeType===Node.TEXT_NODE&&t!==e&&(e.textContent=Ou.get(n)||"")}}})}}}},compositionupdate:function(e,t,n){mu(n,e.target)&&(t.isComposing=!0)},keydown:function(e,t,n){var r=e,o=n.selection;if(!n.getConfig().readOnly&&!t.isComposing&&mu(n,r.target)){if(function(e,t){var n,r,o=rr.get(e),i=o&&o.getMenus(),a=ir.get(e),s=a&&a.getMenus(),l=u(u({},i),s);try{for(var c=d(Object.keys(l)),f=c.next();!f.done;f=c.next()){var p=l[f.value],h=p.hotkey;if(h&&Pu.isHotkey(h,t)&&!p.isDisabled(e)){var g=p.getValue(e);p.exec(e,g)}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}(n,r),ju.isTab(r))return Hu(r),void n.handleTab();if(ju.isRedo(r))return Hu(r),void("function"==typeof n.redo&&n.redo());if(ju.isUndo(r))return Hu(r),void("function"==typeof n.undo&&n.undo());if(ju.isMoveLineBackward(r))return Hu(r),void Pn.Transforms.move(n,{unit:"line",reverse:!0});if(ju.isMoveLineForward(r))return Hu(r),void Pn.Transforms.move(n,{unit:"line"});if(ju.isExtendLineBackward(r))return Hu(r),void Pn.Transforms.move(n,{unit:"line",edge:"focus",reverse:!0});if(ju.isExtendLineForward(r))return Hu(r),void Pn.Transforms.move(n,{unit:"line",edge:"focus"});if(ju.isMoveBackward(r))return Hu(r),void(o&&Pn.Range.isCollapsed(o)?Pn.Transforms.move(n,{reverse:!0}):Pn.Transforms.collapse(n,{edge:"start"}));if(ju.isMoveForward(r))return Hu(r),void(o&&Pn.Range.isCollapsed(o)?Pn.Transforms.move(n):Pn.Transforms.collapse(n,{edge:"end"}));if(ju.isMoveWordBackward(r))return Hu(r),o&&Pn.Range.isExpanded(o)&&Pn.Transforms.collapse(n,{edge:"focus"}),void Pn.Transforms.move(n,{unit:"word",reverse:!0});if(ju.isMoveWordForward(r))return Hu(r),o&&Pn.Range.isExpanded(o)&&Pn.Transforms.collapse(n,{edge:"focus"}),void Pn.Transforms.move(n,{unit:"word"});if(ju.isSelectAll(r))return Hu(r),void n.selectAll();if(mi){if((vi||pi)&&o&&(ju.isDeleteBackward(r)||ju.isDeleteForward(r))&&Pn.Range.isCollapsed(o)){var i=Pn.Node.parent(n,o.anchor.path);Pn.Element.isElement(i)&&Pn.Editor.isVoid(n,i)&&Pn.Editor.isInline(n,i)&&(r.preventDefault(),Pn.Transforms.delete(n,{unit:"block"}))}}else{if(ju.isBold(r)||ju.isItalic(r)||ju.isTransposeCharacter(r))return void Hu(r);if(ju.isSplitBlock(r))return Hu(r),void(r.shiftKey?Pn.Editor.insertText(n,"\n"):Pn.Editor.insertBreak(n));if(ju.isDeleteBackward(r))return Hu(r),void(o&&Pn.Range.isExpanded(o)?Pn.Editor.deleteFragment(n,{direction:"backward"}):Pn.Editor.deleteBackward(n));if(ju.isDeleteForward(r))return Hu(r),void(o&&Pn.Range.isExpanded(o)?Pn.Editor.deleteFragment(n,{direction:"forward"}):Pn.Editor.deleteForward(n));if(ju.isDeleteLineBackward(r))return Hu(r),void(o&&Pn.Range.isExpanded(o)?Pn.Editor.deleteFragment(n,{direction:"backward"}):Pn.Editor.deleteBackward(n,{unit:"line"}));if(ju.isDeleteLineForward(r))return Hu(r),void(o&&Pn.Range.isExpanded(o)?Pn.Editor.deleteFragment(n,{direction:"forward"}):Pn.Editor.deleteForward(n,{unit:"line"}));if(ju.isDeleteWordBackward(r))return Hu(r),void(o&&Pn.Range.isExpanded(o)?Pn.Editor.deleteFragment(n,{direction:"backward"}):Pn.Editor.deleteBackward(n,{unit:"word"}));ju.isDeleteWordForward(r)&&(Hu(r),o&&Pn.Range.isExpanded(o)?Pn.Editor.deleteFragment(n,{direction:"forward"}):Pn.Editor.deleteForward(n,{unit:"word"}))}}},keypress:function(e,t,n){if(!mi&&!n.getConfig().readOnly&&mu(n,e.target)){e.preventDefault();var r=e.key;Pn.Editor.insertText(n,r)}},copy:function(e,t,n){var r=e;if(mu(n,r.target)){n.getConfig().readOnly||r.preventDefault();var o=r.clipboardData;if(null!=o){n.setFragmentData(o);var i=n.getConfig().customCopy;i&&i(n,r)}}},cut:function(e,t,n){var r=e,o=n.selection;if(!n.getConfig().readOnly&&(r.preventDefault(),mu(n,r.target))){var i=r.clipboardData;if(null!=i&&(n.setFragmentData(i),o))if(Pn.Range.isExpanded(o))Pn.Editor.deleteFragment(n);else{var a=Pn.Node.parent(n,o.anchor.path);Pn.Element.isElement(a)&&Pn.Editor.isVoid(n,a)&&Pn.Transforms.delete(n)}}},paste:function(e,t,n){xr.set(n,!0);var r=e;if(!n.getConfig().readOnly&&mu(n,r.target)){var o=n.getConfig().customPaste;if(o)if(!1===o(n,r))return xr.set(n,!1),void r.preventDefault();if(pi||!mi||function(e){return e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length}(r)){r.preventDefault();var i=r.clipboardData;null!=i&&n.insertData(i)}}},dragover:function(e,t,n){if(yu(n,e.target)){var r=Ei.toSlateNode(n,e.target);Pn.Element.isElement(r)&&Pn.Editor.isVoid(n,r)&&e.preventDefault()}},dragstart:function(e,t,n){var r=e;if(yu(n,r.target)&&!n.getConfig().readOnly){var o=Ei.toSlateNode(n,r.target),i=Ei.findPath(n,o);if(Pn.Element.isElement(o)&&Pn.Editor.isVoid(n,o)||Pn.Editor.void(n,{at:i,voids:!0})){var a=Pn.Editor.range(n,i);Pn.Transforms.select(n,a)}var s=r.dataTransfer;if(null!=s)Ei.getSelectedNodeByType(n,"table")||(t.isDraggingInternally=!0,n.setFragmentData(s))}},dragend:function(e,t,n){var r=e;n.getConfig().readOnly||t.isDraggingInternally&&yu(n,r.target)&&(t.isDraggingInternally=!1)},drop:function(e,t,n){var r=e,o=r.dataTransfer;if(!n.getConfig().readOnly&&yu(n,r.target)&&null!=o&&!(mi&&pi&&o.files.length>0)){r.preventDefault();var i=n.selection,a=Ei.findEventRange(n,r);Pn.Transforms.select(n,a),t.isDraggingInternally&&(i&&Pn.Transforms.delete(n,{at:i}),t.isDraggingInternally=!1),n.insertData(o),n.isFocused()||n.focus()}}};function $u(e){if(Uu(e)){for(;e&&Uu(e);){e=Vu(e).parent}return null!=e?e:null}return e.parentNode}function Uu(e){return 11===e.nodeType}function Vu(e,t){var n,r,o;const i=e;return null!==(n=i.parent)&&void 0!==n||(i.parent=null!=t?t:null),null!==(r=i.firstChildNode)&&void 0!==r||(i.firstChildNode=e.firstChild),null!==(o=i.lastChildNode)&&void 0!==o||(i.lastChildNode=e.lastChild),i}const Wu={createElement:function(e,t){return document.createElement(e,t)},createElementNS:function(e,t,n){return document.createElementNS(e,t,n)},createTextNode:function(e){return document.createTextNode(e)},createDocumentFragment:function(){return Vu(document.createDocumentFragment())},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){if(Uu(e)){let t=e;for(;t&&Uu(t);){t=Vu(t).parent}e=null!=t?t:e}Uu(t)&&(t=Vu(t,e)),n&&Uu(n)&&(n=Vu(n).firstChildNode),e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){Uu(t)&&(t=Vu(t,e)),e.appendChild(t)},parentNode:$u,nextSibling:function(e){var t;if(Uu(e)){const n=Vu(e),r=$u(n);if(r&&n.lastChildNode){const e=Array.from(r.childNodes),o=e.indexOf(n.lastChildNode);return null!==(t=e[o+1])&&void 0!==t?t:null}return null}return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},getTextContent:function(e){return e.textContent},isElement:function(e){return 1===e.nodeType},isText:function(e){return 3===e.nodeType},isComment:function(e){return 8===e.nodeType},isDocumentFragment:Uu};function Gu(e,t,n,r,o){return{sel:e,data:t,children:n,text:r,elm:o,key:void 0===t?void 0:t.key}}const qu=Array.isArray;function Ku(e){return"string"==typeof e||"number"==typeof e||e instanceof String||e instanceof Number}const Yu=Gu("",{},[],void 0,void 0);function Xu(e,t){var n,r;const o=e.key===t.key,i=(null===(n=e.data)||void 0===n?void 0:n.is)===(null===(r=t.data)||void 0===r?void 0:r.is),a=e.sel===t.sel,s=!(!e.sel&&e.sel===t.sel)||typeof e.text==typeof t.text;return a&&o&&i&&s}function Zu(e,t,n){var r;const o={};for(let i=t;i<=n;++i){const t=null===(r=e[i])||void 0===r?void 0:r.key;void 0!==t&&(o[t]=i)}return o}const Ju=["create","update","remove","destroy","pre","post"];function Qu(e,t,n){const r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},o=Wu;for(const t of Ju)for(const n of e){const e=n[t];void 0!==e&&r[t].push(e)}function i(e){const t=e.id?"#"+e.id:"",n=e.getAttribute("class"),r=n?"."+n.split(" ").join("."):"";return Gu(o.tagName(e).toLowerCase()+t+r,{},[],void 0,e)}function a(e){return Gu(void 0,{},[],void 0,e)}function s(e,t){return function(){if(0===--t){const t=o.parentNode(e);null!==t&&o.removeChild(t,e)}}}function u(e,t){var n,i,a;let s;const l=e.data,c=null==l?void 0:l.hook;null===(n=null==c?void 0:c.init)||void 0===n||n.call(c,e);const d=e.children,f=e.sel;if("!"===f)null!==(i=e.text)&&void 0!==i||(e.text=""),e.elm=o.createComment(e.text);else if(""===f)e.elm=o.createTextNode(e.text);else if(void 0!==f){const n=f.indexOf("#"),i=f.indexOf(".",n),p=n>0?n:f.length,h=i>0?i:f.length,g=-1!==n||-1!==i?f.slice(0,Math.min(p,h)):f,v=null==l?void 0:l.ns,m=void 0===v?o.createElement(g,l):o.createElementNS(v,g,l);for(e.elm=m,p<h&&m.setAttribute("id",f.slice(p+1,h)),i>0&&m.setAttribute("class",f.slice(h+1).replace(/\./g," ")),s=0;s<r.create.length;++s)r.create[s](Yu,e);if(!Ku(e.text)||qu(d)&&0!==d.length||o.appendChild(m,o.createTextNode(e.text)),qu(d))for(s=0;s<d.length;++s){const e=d[s];null!=e&&o.appendChild(m,u(e,t))}void 0!==c&&(null===(a=c.create)||void 0===a||a.call(c,Yu,e),void 0!==c.insert&&t.push(e))}else e.elm=o.createTextNode(e.text);return e.elm}function l(e,t,n,r,i,a){for(;r<=i;++r){const i=n[r];null!=i&&o.insertBefore(e,u(i,a),t)}}function c(e){var t,n;const o=e.data;if(void 0!==o){null===(n=null===(t=null==o?void 0:o.hook)||void 0===t?void 0:t.destroy)||void 0===n||n.call(t,e);for(let t=0;t<r.destroy.length;++t)r.destroy[t](e);if(void 0!==e.children)for(let t=0;t<e.children.length;++t){const n=e.children[t];null!=n&&"string"!=typeof n&&c(n)}}}function d(e,t,n,i){for(var a,u;n<=i;++n){let i;const l=t[n];if(null!=l)if(void 0!==l.sel){c(l),i=r.remove.length+1;const e=s(l.elm,i);for(let t=0;t<r.remove.length;++t)r.remove[t](l,e);const t=null===(u=null===(a=null==l?void 0:l.data)||void 0===a?void 0:a.hook)||void 0===u?void 0:u.remove;void 0!==t?t(l,e):e()}else l.children?(c(l),d(e,l.children,0,l.children.length-1)):o.removeChild(e,l.elm)}}function f(e,t,n){var i,a,s,c,p,h,g,v;const m=null===(i=t.data)||void 0===i?void 0:i.hook;null===(a=null==m?void 0:m.prepatch)||void 0===a||a.call(m,e,t);const y=t.elm=e.elm;if(e===t)return;if(void 0!==t.data||void 0!==t.text&&t.text!==e.text){null!==(s=t.data)&&void 0!==s||(t.data={}),null!==(c=e.data)&&void 0!==c||(e.data={});for(let n=0;n<r.update.length;++n)r.update[n](e,t);null===(g=null===(h=null===(p=t.data)||void 0===p?void 0:p.hook)||void 0===h?void 0:h.update)||void 0===g||g.call(h,e,t)}const b=e.children,E=t.children;void 0===t.text?void 0!==b&&void 0!==E?b!==E&&function(e,t,n,r){let i,a,s,c,p=0,h=0,g=t.length-1,v=t[0],m=t[g],y=n.length-1,b=n[0],E=n[y];for(;p<=g&&h<=y;)null==v?v=t[++p]:null==m?m=t[--g]:null==b?b=n[++h]:null==E?E=n[--y]:Xu(v,b)?(f(v,b,r),v=t[++p],b=n[++h]):Xu(m,E)?(f(m,E,r),m=t[--g],E=n[--y]):Xu(v,E)?(f(v,E,r),o.insertBefore(e,v.elm,o.nextSibling(m.elm)),v=t[++p],E=n[--y]):Xu(m,b)?(f(m,b,r),o.insertBefore(e,m.elm,v.elm),m=t[--g],b=n[++h]):(void 0===i&&(i=Zu(t,p,g)),a=i[b.key],void 0===a?(o.insertBefore(e,u(b,r),v.elm),b=n[++h]):void 0===i[E.key]?(o.insertBefore(e,u(E,r),o.nextSibling(m.elm)),E=n[--y]):(s=t[a],s.sel!==b.sel?o.insertBefore(e,u(b,r),v.elm):(f(s,b,r),t[a]=void 0,o.insertBefore(e,s.elm,v.elm)),b=n[++h]));h<=y&&(c=null==n[y+1]?null:n[y+1].elm,l(e,c,n,h,y,r)),p<=g&&d(e,t,p,g)}(y,b,E,n):void 0!==E?(void 0!==e.text&&o.setTextContent(y,""),l(y,null,E,0,E.length-1,n)):void 0!==b?d(y,b,0,b.length-1):void 0!==e.text&&o.setTextContent(y,""):e.text!==t.text&&(void 0!==b&&d(y,b,0,b.length-1),o.setTextContent(y,t.text)),null===(v=null==m?void 0:m.postpatch)||void 0===v||v.call(m,e,t)}return function(e,t){let n,s,l;const c=[];for(n=0;n<r.pre.length;++n)r.pre[n]();for(!function(e,t){return e.isElement(t)}(o,e)?function(e,t){return e.isDocumentFragment(t)}(o,e)&&(e=a(e)):e=i(e),Xu(e,t)?f(e,t,c):(s=e.elm,l=o.parentNode(s),u(t,c),null!==l&&(o.insertBefore(l,t.elm,o.nextSibling(s)),d(l,[e],0,0))),n=0;n<c.length;++n)c[n].data.hook.insert(c[n]);for(n=0;n<r.post.length;++n)r.post[n]();return t}}function el(e,t,n){if(e.ns="http://www.w3.org/2000/svg","foreignObject"!==n&&void 0!==t)for(let e=0;e<t.length;++e){const n=t[e];if("string"==typeof n)continue;const r=n.data;void 0!==r&&el(r,n.children,n.sel)}}function tl(e,t,n){let r,o,i,a={};if(void 0!==n?(null!==t&&(a=t),qu(n)?r=n:Ku(n)?o=n.toString():n&&n.sel&&(r=[n])):null!=t&&(qu(t)?r=t:Ku(t)?o=t.toString():t&&t.sel?r=[t]:a=t),void 0!==r)for(i=0;i<r.length;++i)Ku(r[i])&&(r[i]=Gu(void 0,void 0,void 0,r[i],void 0));return!e.startsWith("svg")||3!==e.length&&"."!==e[3]&&"#"!==e[3]||el(a,r,e),Gu(e,a,r,o,void 0)}function nl(e,t){let n;const r=t.elm;let o=e.data.attrs,i=t.data.attrs;if((o||i)&&o!==i){for(n in o=o||{},i=i||{},i){const e=i[n];o[n]!==e&&(!0===e?r.setAttribute(n,""):!1===e?r.removeAttribute(n):120!==n.charCodeAt(0)?r.setAttribute(n,e):58===n.charCodeAt(3)?r.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,e):58===n.charCodeAt(5)?109===n.charCodeAt(1)?r.setAttributeNS("http://www.w3.org/2000/xmlns/",n,e):r.setAttributeNS("http://www.w3.org/1999/xlink",n,e):r.setAttribute(n,e))}for(n in o)n in i||r.removeAttribute(n)}}const rl={create:nl,update:nl};function ol(e,t){let n,r;const o=t.elm;let i=e.data.class,a=t.data.class;if((i||a)&&i!==a){for(r in i=i||{},a=a||{},i)i[r]&&!Object.prototype.hasOwnProperty.call(a,r)&&o.classList.remove(r);for(r in a)n=a[r],n!==i[r]&&o.classList[n?"add":"remove"](r)}}const il={create:ol,update:ol},al=/[A-Z]/g;function sl(e,t){const n=t.elm;let r,o=e.data.dataset,i=t.data.dataset;if(!o&&!i)return;if(o===i)return;o=o||{},i=i||{};const a=n.dataset;for(r in o)r in i||(a?r in a&&delete a[r]:n.removeAttribute("data-"+r.replace(al,"-$&").toLowerCase()));for(r in i)o[r]!==i[r]&&(a?a[r]=i[r]:n.setAttribute("data-"+r.replace(al,"-$&").toLowerCase(),i[r]))}const ul={create:sl,update:sl};function ll(e,t,n){if("function"==typeof e)e.call(t,n,t);else if("object"==typeof e)for(let r=0;r<e.length;r++)ll(e[r],t,n)}function cl(e,t){const n=e.type,r=t.data.on;r&&r[n]&&ll(r[n],t,e)}function dl(e,t){const n=e.data.on,r=e.listener,o=e.elm,i=t&&t.data.on,a=t&&t.elm;let s;if(n!==i){if(n&&r)if(i)for(s in n)i[s]||o.removeEventListener(s,r,!1);else for(s in n)o.removeEventListener(s,r,!1);if(i){const r=t.listener=e.listener||function e(t){cl(t,e.vnode)};if(r.vnode=t,n)for(s in i)n[s]||a.addEventListener(s,r,!1);else for(s in i)a.addEventListener(s,r,!1)}}}const fl={create:dl,update:dl,destroy:dl};function pl(e,t){let n,r,o;const i=t.elm;let a=e.data.props,s=t.data.props;if((a||s)&&a!==s)for(n in a=a||{},s=s||{},s)r=s[n],o=a[n],o===r||"value"===n&&i[n]===r||(i[n]=r)}const hl={create:pl,update:pl},gl="function"==typeof(null===window||void 0===window?void 0:window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):setTimeout;let vl=!1;function ml(e,t,n){var r;r=()=>{e[t]=n},gl(()=>{gl(r)})}function yl(e,t){let n,r;const o=t.elm;let i=e.data.style,a=t.data.style;if(!i&&!a)return;if(i===a)return;i=i||{},a=a||{};const s="delayed"in i;for(r in i)r in a||("-"===r[0]&&"-"===r[1]?o.style.removeProperty(r):o.style[r]="");for(r in a)if(n=a[r],"delayed"===r&&a.delayed)for(const e in a.delayed)n=a.delayed[e],s&&n===i.delayed[e]||ml(o.style,e,n);else"remove"!==r&&n!==i[r]&&("-"===r[0]&&"-"===r[1]?o.style.setProperty(r,n):o.style[r]=n)}const bl={pre:function(){vl=!1},create:yl,update:yl,destroy:function(e){let t,n;const r=e.elm,o=e.data.style;if(o&&(t=o.destroy))for(n in t)r.style[n]=t[n]},remove:function(e,t){const n=e.data.style;if(!n||!n.remove)return void t();let r;vl||(e.elm.offsetLeft,vl=!0);const o=e.elm;let i=0;const a=n.remove;let s=0;const u=[];for(r in a)u.push(r),o.style[r]=a[r];const l=getComputedStyle(o)["transition-property"].split(", ");for(;i<l.length;++i)-1!==u.indexOf(l[i])&&s++;o.addEventListener("transitionend",e=>{e.target===o&&--s,0===s&&t()})}};function El(e,t){for(const n of e)null!=n&&!1!==n&&""!==n&&(Array.isArray(n)?El(n,t):"string"==typeof n||"number"==typeof n||"boolean"==typeof n?t.push(Gu(void 0,void 0,void 0,String(n),void 0)):t.push(n));return t}function wl(e,t,...n){const r=El(n,[]);return"function"==typeof e?e(t,r):1===r.length&&!r[0].sel&&r[0].text?tl(e,t,r[0].text):tl(e,t,r)}var Cl=[];var Dl,Al,Sl={};function xl(e,t,n){return wl(n.isInline(e)?"span":"div",null,t)}function Tl(e,t){var n,r=Ei.findKey(t,e),o=t.isInline(e),i=Pn.Editor.isVoid(t,e),a=ei(e.type,r.id),s={id:a,key:r.id,"data-slate-node":"element","data-slate-inline":o},u=e.type,l=e.children,c=void 0===l?[]:l,d=function(e){return Sl[e]||xl}(u);n=i?null:c.map(function(n,r){return kl(n,r,e,t)});var p=d(e,n,t);if(i){s["data-slate-void"]=!0;var h=o?"span":"div",g=f(Pn.Node.texts(e),1),v=f(g[0],1)[0],m=wl(h,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},kl(v,0,e,t));p=wl(h,{style:{position:"relative"}},p,m),gr.set(v,0),vr.set(v,e)}return null==p.data&&(p.data={}),Object.assign(p.data,s),i||o||(p=function(e,t,n){var r=t;return Cl.forEach(function(t){r=t(e,r,n)}),r}(e,p,t)),Dn(function(){var n=mr.get(t),o=null==n?void 0:n.querySelector("#".concat(a));null!=o&&(br.set(r,o),Er.set(e,o),yr.set(o,e))}),p}function Nl(e,t){return void 0===t&&(t=!1),wl("span",{"data-slate-string":!0},t?"".concat(e,"\n"):e)}function Ol(e,t){return void 0===e&&(e=0),void 0===t&&(t=!1),wl("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\ufeff",t?wl("br",null):null)}function Bl(e,t,n){if(null==e.text)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=Ei.findKey(n,e),o=n.getConfig().decorate;if(null==o)throw new Error("Can not get config.decorate");var i,a=Ei.findPath(n,e),s=o([e,a]),u=Pn.Text.decorations(e,s),l=u.map(function(r){var o,i=r.leaf,a=r.position,s=null!==(o=null==a?void 0:a.isLast)&&void 0!==o?o:1===u.length,l=function(e,t,n,r,o){void 0===o&&(o=!1);var i=e.text,a=Ei.findPath(r,t),s=Pn.Path.parent(a);if(Pn.Editor.isEditor(n))throw new Error("Text node ".concat(JSON.stringify(t)," parent is Editor"));return r.isVoid(n)?Ol(Pn.Node.string(n).length):""!==i||n.children[n.children.length-1]!==t||r.isInline(n)||""!==Pn.Editor.string(r,s)?""===i?Ol():o&&"\n"===i.slice(-1)?Nl(i,!0):Nl(i):Ol(0,!0)}(i,e,t,n,s);return l=function(e,t,n){var r=t;return Cl.forEach(function(t){r=t(e,r,n)}),r}(i,l,n),wl("span",{"data-slate-leaf":!0},l)}),c=(i=r.id,"w-e-text-".concat(i)),d=wl("span",{"data-slate-node":"text",id:c,key:r.id},l);return Dn(function(){var t=mr.get(n),o=null==t?void 0:t.querySelector("#".concat(c));null!=o&&(br.set(r,o),Er.set(e,o),yr.set(o,e))}),d}function kl(e,t,n,r){return gr.set(e,t),vr.set(e,n),Pn.Element.isElement(e)?Tl(e,r):Bl(e,n,r)}var Fl=function(){if(Al)return Dl;Al=1;var e,t="[object Symbol]",n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,r=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",i="\\u0300-\\u036f\\ufe20-\\ufe23",a="\\u20d0-\\u20f0",s="\\u2700-\\u27bf",u="a-z\\xdf-\\xf6\\xf8-\\xff",l="A-Z\\xc0-\\xd6\\xd8-\\xde",c="\\ufe0e\\ufe0f",d="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",f="['’]",p="["+o+"]",h="["+d+"]",v="["+i+a+"]",m="\\d+",y="["+s+"]",b="["+u+"]",E="[^"+o+d+m+s+u+l+"]",w="\\ud83c[\\udffb-\\udfff]",C="[^"+o+"]",D="(?:\\ud83c[\\udde6-\\uddff]){2}",A="[\\ud800-\\udbff][\\udc00-\\udfff]",S="["+l+"]",x="\\u200d",T="(?:"+b+"|"+E+")",N="(?:"+S+"|"+E+")",O="(?:['’](?:d|ll|m|re|s|t|ve))?",B="(?:['’](?:D|LL|M|RE|S|T|VE))?",k="(?:"+v+"|"+w+")"+"?",F="["+c+"]?",I=F+k+("(?:"+x+"(?:"+[C,D,A].join("|")+")"+F+k+")*"),P="(?:"+[y,D,A].join("|")+")"+I,R="(?:"+[C+v+"?",v,D,A,p].join("|")+")",_=RegExp(f,"g"),L=RegExp(v,"g"),M=RegExp(w+"(?="+w+")|"+R+I,"g"),j=RegExp([S+"?"+b+"+"+O+"(?="+[h,S,"$"].join("|")+")",N+"+"+B+"(?="+[h,S+T,"$"].join("|")+")",S+"?"+T+"+"+O,S+"+"+B,m,P].join("|"),"g"),H=RegExp("["+x+o+i+a+c+"]"),z=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$="object"==typeof g&&g&&g.Object===Object&&g,U="object"==typeof self&&self&&self.Object===Object&&self,V=$||U||Function("return this")(),W=(e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},function(t){return null==e?void 0:e[t]});function G(e){return H.test(e)}function q(e){return G(e)?function(e){return e.match(M)||[]}(e):function(e){return e.split("")}(e)}var K=Object.prototype.toString,Y=V.Symbol,X=Y?Y.prototype:void 0,Z=X?X.toString:void 0;function J(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&K.call(e)==t}(e))return Z?Z.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}function Q(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(e,t,n)}function ee(e){return null==e?"":J(e)}var te,ne,re=(te=function(e,t,n){return t=t.toLowerCase(),e+(n?oe(ee(t).toLowerCase()):t)},function(e){return function(e,t,n){for(var r=-1,o=e?e.length:0;++r<o;)n=t(n,e[r],r,e);return n}(function(e,t){return e=ee(e),void 0===t?function(e){return z.test(e)}(e)?function(e){return e.match(j)||[]}(e):function(e){return e.match(n)||[]}(e):e.match(t)||[]}(function(e){return(e=ee(e))&&e.replace(r,W).replace(L,"")}(e).replace(_,"")),te,"")}),oe=(ne="toUpperCase",function(e){var t=G(e=ee(e))?q(e):void 0,n=t?t[0]:e.charAt(0),r=t?Q(t,1).join(""):e.slice(1);return n[ne]()+r});return Dl=re}(),Il=v(Fl);var Pl=["props","attrs","style","dataset","on","hook","ns"];function Rl(e){var t=e.data,n=void 0===t?{}:t,r=e.children,o=void 0===r?[]:r;Object.keys(n).forEach(function(t){var r,o,i=n[t];if("key"!==t){if(!Pl.includes(t)){if(t.startsWith("data-")){var a=t.slice(5);return a=Il(a),function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.dataset&&(n.dataset={}),Object.assign(n.dataset,t)}(e,((r={})[a]=i,r)),void delete n[t]}!function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={}),Object.assign(n.props,t)}(e,(o={},o[t]=i,o)),delete n[t]}}else e.key=i}),o.length>0&&o.forEach(function(e){"string"!=typeof e&&Rl(e)})}function _l(e,t){var n,r,o=e.$scroll,i=(n=e.id,"w-e-textarea-".concat(n)),a=t.getConfig(),s=a.readOnly,u=a.autoFocus,l=function(e,t){return void 0===t&&(t=!1),tl("div#".concat(e),{props:{contentEditable:!t}})}(i,s),c=t.children||[];l.children=c.map(function(e,n){if(pr.has(e)){var r=pr.get(e);if(r){var o=f(r,2),i=o[0],a=o[1];if(a)return i!==n&&(gr.set(e,n),pr.set(e,[n,a])),a}}var s=kl(e,n,t,t);Rl(s);var u=t.getConfig().skipCacheTypes,l=void 0===u?["list-item"]:u;return Pn.Element.isElement(e)&&l.includes(e.type)||pr.set(e,[n,s]),s});var d,p=cr.get(e);if(null==p&&(p=!0),p){var h=function(e){return zr('<div\n id="'.concat(e,'"\n data-slate-editor\n data-slate-node="value"\n suppressContentEditableWarning\n role="textarea"\n spellCheck="true"\n autoCorrect="true"\n autoCapitalize="true"\n ></div>'))}(i);o.append(h),e.$textArea=h,r=h[0],mr.set(t,r),Er.set(t,r),yr.set(r,t),(v=Qu([il,hl,bl,ul,fl,rl]))(r,l),cr.set(e,!1),dr.set(e,v)}else{var g=fr.get(e),v=dr.get(e);if(null==g||null==v)return;r=g.elm,v(g,l)}if(null==r){var m=o[0];if(r=(null==m?void 0:m.querySelector("#".concat(i)))||function(e){var t,n,r;return null!==(t=window&&window.document.getElementById(e))&&void 0!==t?t:window&&(null===(r=null===(n=window.document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.getElementById(e))||null}(i),null==r)return}if((p?u:t.isFocused())&&r.focus({preventScroll:!0}),p){var y=(d=r)&&d.ownerDocument&&d.ownerDocument.defaultView||null;y&&Cr.set(t,y)}mr.set(t,r),Er.set(t,r),yr.set(r,t),fr.set(e,l)}var Ll=1,Ml=function(){function e(e){var t=this;this.selectionChangeRoot=null,this.destroyed=!1,this.id=Ll++,this.$textArea=null,this.$progressBar=zr('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=zr('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=vu(function(e){var n=Oo(null==e?void 0:e.target)?e.target:null,r=null==n?void 0:n.tagName;if("INPUT"!==r&&"TEXTAREA"!==r){var o=t.getActiveEditor();null!=o&&function(e,t){var n=e.isComposing,r=e.isUpdatingSelection,o=e.isDraggingInternally,i=t.getConfig();if(!r&&!o){var a=Ei.findDocumentOrShadowRoot(t),s=a.activeElement,u=Ei.toDOMNode(t,t),l=a.getSelection();if(s!==u)return Dr.delete(t),void Tu(t);if(e.latestElement=s,Dr.set(t,!0),!l)return Tu(t);var c=l.anchorNode,d=l.focusNode,f=bu(t,c),p=yu(t,d);if(!n)if(f&&p){var h=Ei.toSlateRange(t,l,{exactMatch:!1,suppressThrow:!0});h&&Pn.Transforms.select(t,h)}else i.readOnly&&Tu(t)}}(t,o)}},100);var n=zr(e);if(0===n.length)throw new Error("Cannot find textarea DOM by selector '".concat(e,"'"));this.$box=n;var r=zr('<div class="w-e-text-container"></div>');r.append(this.$progressBar),r.append(this.$maxLengthInfo),n.append(r);var o=zr('<div class="w-e-scroll"></div>');r.append(o),this.$scroll=o,this.$textAreaContainer=r,Dn(function(){var e=t.getActiveEditor();if(null!=e){t.bindSelectionChange(e),r.on("click",function(){return e.hidePanelOrModal()}),e.on(Gn,t.changeViewState.bind(t));var o=e.getConfig(),i=o.onChange,a=o.scroll;i&&e.on(Gn,function(){return i(e)}),a||(n.css("position","relative"),r.addClass("no-scroll")),t.onFocusAndOnBlur(),e.on(Gn,t.changeMaxLengthInfo.bind(t)),t.bindEvent()}})}return Object.defineProperty(e.prototype,"editorInstance",{get:function(){var e=tr.get(this);if(null==e)throw new Error("Can not get editor instance");return e},enumerable:!1,configurable:!0}),e.prototype.getActiveEditor=function(){if(this.destroyed)return null;var e=tr.get(this);return null==e||e.isDestroyed?null:e},e.prototype.bindSelectionChange=function(e,t){var n=this;if(void 0===t&&(t=5),null==this.selectionChangeRoot&&!e.isDestroyed){try{var r=Ei.findDocumentOrShadowRoot(e);r.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=r}catch(r){if(t>0)return void setTimeout(function(){return n.bindSelectionChange(e,t-1)},0);window.document.addEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=window.document}e.on(Wn,function(){var e;null===(e=n.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",n.onDOMSelectionChange),n.selectionChangeRoot=null})}},e.prototype.flushDOMSelectionChange=function(){this.onDOMSelectionChange.flush()},e.prototype.bindEvent=function(){var e=this,t=this.$textArea,n=this.$scroll,r=this.editorInstance;null!=t&&(wn(zu,function(n,o){t.on(o,function(t){n(t,e,r)})}),r.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",vu(function(){r.emit(qn)},100))))},e.prototype.onFocusAndOnBlur=function(){var e=this,t=this.getActiveEditor();if(null!=t){var n=t.getConfig(),r=n.onBlur,o=n.onFocus;this.latestEditorSelection=t.selection,t.on(Gn,function(){null==e.latestEditorSelection&&null!=t.selection?setTimeout(function(){e.destroyed||t.isDestroyed||o&&o(t)}):null!=e.latestEditorSelection&&null==t.selection&&setTimeout(function(){e.destroyed||t.isDestroyed||r&&r(t)}),e.latestEditorSelection=t.selection})}},e.prototype.changeMaxLengthInfo=function(){var e=this.getActiveEditor();if(null!=e){var t=e.getConfig().maxLength;if(t){var n=t-Ei.getLeftLengthOfMaxLength(e);this.$maxLengthInfo[0].innerHTML="".concat(n,"/").concat(t)}}},e.prototype.changeProgress=function(e){var t=this.$progressBar;t.css("width","".concat(e,"%")),e>=100&&setTimeout(function(){t.hide(),t.css("width","0"),t.show()},1e3)},e.prototype.changeViewState=function(){var e=this,t=this.getActiveEditor();null!=t&&(_l(this,t),function(e,t){var n,r=t.getConfig().placeholder;if(r){var o=t.isEmpty();if(o&&!e.showPlaceholder&&!e.isComposing){if(null==e.$placeholder){var i=zr('<div class="w-e-text-placeholder">'.concat(r,"</div>"));e.$textAreaContainer.append(i),e.$placeholder=i}return e.$placeholder.show(),void(e.showPlaceholder=!0)}!o&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}}(this,t),Dn(function(){e.destroyed||t.isDestroyed||Nu(e,t)}))},e.prototype.destroy=function(){var e;this.destroyed=!0,this.onDOMSelectionChange.cancel(),null===(e=this.selectionChangeRoot)||void 0===e||e.removeEventListener("selectionchange",this.onDOMSelectionChange),this.selectionChangeRoot=null,this.$textAreaContainer.remove()},e}();function jl(e,t,n,r){if(gr.set(e,t),vr.set(e,n),Pn.Element.isElement(e)){var o=e.children;if((void 0===o?[]:o).forEach(function(t,n){return jl(t,n,e,r)}),Pn.Editor.isVoid(r,e)){var i=f(Pn.Node.texts(e),1),a=f(i[0],1)[0];gr.set(a,0),vr.set(a,e)}}}function Hl(e){var t=e.selector,n=void 0===t?"":t,r=e.config,o=void 0===r?{}:r,i=e.content,a=e.html,s=e.plugins,l=void 0===s?[]:s,c=function(e){return[La,ya,Or,va,Ja,Ra,Va,za].reduce(function(e,t){return t(e)},e)}(Pn.createEditor());if(n&&function(e,t){return Jo(e,"data-w-e-textarea",t)}(c,n))throw new Error("Repeated create editor by selector '".concat(n,"'"));var d=function(e){void 0===e&&(e={});var t=Ln(Un),n={},r=e.MENU_CONF,o=void 0===r?{}:r;return wn(t,function(e,t){n[t]=u(u({},e),o[t]||{})}),delete e.MENU_CONF,u({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,imageResize:{},MENU_CONF:n,hoverbarKeys:{},textStyleMode:"inline",classStylePolicy:"preserve-data",sanitizeHtml:$n,customAlert:function(e,t){window.alert("".concat(t,":\n").concat(e))}},e)}(o);lr.set(c,d);var f=d.hoverbarKeys,p=void 0===f?{}:f;if(l.forEach(function(e){c=e(c)}),function(e,t){var n,r=t.html,o=t.content;null!=r?n=Qo(e,r):o&&o.length&&(n=o),n&&(e.children=e.transformInitialContent?e.transformInitialContent(n):n),0===e.children.length&&(e.children=[{type:"paragraph",children:[{text:""}]}])}(c,{html:a,content:i}),n){var h=new Ml(n);er.set(c,h),tr.set(h,c),h.changeViewState();var g=void 0;Object.keys(p).length>0&&(g=new gu,or.set(g,c),ir.set(c,g)),c.on(Gn,function(){c.hidePanelOrModal()}),c.on(qn,function(){c.hidePanelOrModal()})}else c.children.forEach(function(e,t){return jl(e,t,c,c)});var v=d.onCreated,m=d.onDestroyed;return v&&c.on(Vn,function(){return v(c)}),m&&c.on(Wn,function(){return m(c)}),Dn(function(){return c.emit(Vn)}),c}var zl=function(){function e(e,t){var n=this;this.$toolbar=zr('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.syncToolbarState=function(){n.toolbarItems.forEach(function(e){e.changeMenuState()})},this.changeToolbarState=es(function(){n.syncToolbarState()},200),this.config=t;var r=zr(e);if(0===r.length)throw new Error("Cannot find toolbar DOM by selector '".concat(e,"'"));this.$box=r;var o=this.$toolbar;o.on("mousedown",function(e){return e.preventDefault()},{passive:!1}),r.append(o),Dn(function(){n.initToolbar(),n.lngListen=qs(function(){return n.initToolbar()});var e=n.getEditorInstance();e.on(Gn,n.changeToolbarState),e.on(Kn,n.syncToolbarState),e.on(Yn,n.syncToolbarState)})}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.initToolbar=function(){this.menus={};var e=this.$toolbar;null==e||e.empty(),this.registerItems(),this.changeToolbarState()},e.prototype.registerItems=function(){var e=this,t="",n=this.$toolbar,r=this.config,o=r.toolbarKeys,i=void 0===o?[]:o,a=r.insertKeys,s=void 0===a?{index:0,keys:[]}:a,u=r.excludeKeys,l=void 0===u?[]:u,c=Ln(i),d=[];d=Array.isArray(s)?s:[s];var f=0;d.forEach(function(e){var t=e.index+f;if(e.replaceFn&&c[t]){var n=e.replaceFn(c[t]);if(!n)throw new Error("This function needs to return the menu configuration: IToolbarMenuKey");c[t]=n}e.keys.length>0&&("string"==typeof e.keys&&(e.keys=[e.keys]),e.keys.forEach(function(e,n){c.splice(t+n,0,e)}),f+=e.keys.length)});var p=c.filter(function(e){var t="string"==typeof e?e:e.key;return!l.includes(t)}),h=p.length;p.forEach(function(r,o){if("|"===r){if(0===o)return;if(o+1===h)return;if("|"===t)return;var i=Zs();return n.append(i),void(t=r)}return"string"==typeof r?(e.registerSingleItem(r,e),void(t=r)):e.isMenuGroup(r)?(e.registerGroup(r),void(t="group")):(e.registerSingleMenuByConf(r),void(t=r.key))})},e.prototype.isMenuGroup=function(e){return"string"!=typeof e&&Array.isArray(e.menuKeys)},e.prototype.registerSingleMenuByConf=function(e){var t=e.key,n=e.title,r=e.iconSvg;this.registerSingleItem(t,this,{title:n,iconSvg:r})},e.prototype.registerGroup=function(e){var t=this,n=this.$toolbar,r=function(e){return new ru(e)}(e),o=e.menuKeys,i=void 0===o?[]:o,a=this.config.excludeKeys,s=void 0===a?[]:a;i.forEach(function(e){s.includes(e)||t.registerSingleItem(e,r)}),n.append(r.$elem)},e.prototype.registerSingleItem=function(e,t,n){void 0===n&&(n={});var r=this.getEditorInstance(),o=t instanceof ru,i=this.menus,a=i[e];if(null==a){var s=Jn[e];if(null==s)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof s)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));a=s(),i[e]=a}else console.warn("Duplicated toolbar menu key '".concat(e,"'\n重复注册了菜单栏 menu '").concat(e,"'"));var u=r.getMenuConfig(e);u&&void 0!==u.iconSvg&&(a.iconSvg=u.iconSvg),void 0!==n.iconSvg&&(a.iconSvg=n.iconSvg),void 0!==n.title&&(a.title=n.title);var l=pu(e,a,o);(this.toolbarItems.push(l),ar.set(l,r),o)?t.appendBarItem(l):t.$toolbar.append(l.$elem)},e.prototype.getEditorInstance=function(){var e=nr.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.destroy=function(){var e;this.$toolbar.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.toolbarItems=[]},e}();function $l(e,t){if(null==e)throw new Error("Cannot create toolbar, because editor is null");var n=t.selector,r=t.config,o=void 0===r?{}:r;if(function(e,t){return Jo(e,"data-w-e-toolbar",t)}(e,n))throw new Error("Repeated create toolbar by selector '".concat(n,"'"));var i=u({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},o||{}),a=new zl(n,i);return nr.set(a,e),rr.set(e,a),a}function Ul(e){return e&&"class"===e.getConfig().textStyleMode?"class":"inline"}function Vl(e){if(!e)return"preserve-data";var t=e.getConfig().classStylePolicy;return"fallback-inline"===t?"fallback-inline":"strict"===t?"strict":"preserve-data"}function Wl(e,t){var n=null==e?void 0:e.getConfig().onClassStyleUnsupported;n?n(t):console.warn(t.message)}Gs("en",{editor:{more:"More",justify:"Justify",indent:"Indent",image:"Image",video:"Video"}}),Gs("zh-CN",{editor:{more:"更多",justify:"对齐",indent:"缩进",image:"图片",video:"视频"}});Gs("en",{common:{ok:"OK",delete:"Delete",enter:"Enter"},blockQuote:{title:"Quote"},codeBlock:{title:"Code block",copy:"Copy",copied:"Copied",copyFailed:"Copy failed"},color:{color:"Font color",bgColor:"Back color",default:"Default color",clear:"Clear back color"},divider:{title:"Divider"},emotion:{title:"Emotion"},fontSize:{title:"Font size",default:"Default"},fontFamily:{title:"Font family",default:"Default"},fullScreen:{title:"Full screen",cancelTitle:"Cancel full screen"},header:{title:"Header",text:"Text"},image:{netImage:"Net image",delete:"Delete image",edit:"Edit image",editSize:"Edit size",preview:"Preview image",viewLink:"View link",src:"Image src",desc:"Description",link:"Image link",ok:"Ok",width:"Width",height:"Height"},indent:{decrease:"Decrease",increase:"Increase"},justify:{left:"Left",right:"Right",center:"Center",justify:"Justify"},lineHeight:{title:"Line height",default:"Default"},link:{insert:"Insert link",text:"Link text",url:"Link source",unLink:"Unlink",edit:"Edit link",view:"View link"},textStyle:{bold:"Bold",clear:"Clear styles",code:"Inline code",italic:"Italic",sub:"Sub",sup:"Sup",through:"Through",underline:"Underline",wavyUnderline:"Wavy underline",emphasisDot:"Lower dot emphasis"},undo:{undo:"undo",redo:"Redo"},todo:{todo:"Todo"},formatPainter:{title:"Format Painter"}}),Gs("zh-CN",{common:{ok:"确定",delete:"删除",enter:"回车"},blockQuote:{title:"引用"},codeBlock:{title:"代码块",copy:"复制",copied:"已复制",copyFailed:"复制失败"},color:{color:"文字颜色",bgColor:"背景色",default:"默认颜色",clear:"清除背景色"},divider:{title:"分割线"},emotion:{title:"表情"},fontSize:{title:"字号",default:"默认字号"},fontFamily:{title:"字体",default:"默认字体"},fullScreen:{title:"全屏",cancelTitle:"取消全屏"},header:{title:"标题",text:"正文"},image:{netImage:"网络图片",delete:"删除图片",edit:"编辑图片",editSize:"修改尺寸",preview:"预览图片",viewLink:"查看链接",src:"图片地址",desc:"图片描述",link:"图片链接",ok:"确定",width:"宽度",height:"高度"},indent:{decrease:"减少缩进",increase:"增加缩进"},justify:{left:"左对齐",right:"右对齐",center:"居中对齐",justify:"两端对齐"},lineHeight:{title:"行高",default:"默认行高"},link:{insert:"插入链接",text:"链接文本",url:"链接地址",unLink:"取消链接",edit:"修改链接",view:"查看链接"},textStyle:{bold:"粗体",clear:"清除格式",code:"行内代码",italic:"斜体",sub:"下标",sup:"上标",through:"删除线",underline:"下划线",wavyUnderline:"波浪下划线",emphasisDot:"下方着重号"},undo:{undo:"撤销",redo:"重做"},todo:{todo:"待办"},formatPainter:{title:"格式刷"}});var Gl={type:"blockquote",elemToHtml:function(e,t){return"<blockquote>".concat(t,"</blockquote>")}},ql='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',Kl='<svg viewBox="0 0 1024 1024"><path d="M924.402464 1023.068211H0.679665V99.345412h461.861399v98.909208H99.596867v725.896389h725.896389V561.206811h98.909208z" p-id="10909"></path><path d="M930.805104 22.977336l69.965436 69.965436-453.492405 453.492404-69.965435-69.901489z" p-id="10910"></path><path d="M1022.464381 304.030081h-98.917201V99.345412H709.230573V0.428211h313.233808z"></path></svg>',Yl='<svg viewBox="0 0 1024 1024"><path d="M133.705143 335.433143V133.851429h201.581714a29.622857 29.622857 0 0 0 29.622857-29.549715V68.754286a29.622857 29.622857 0 0 0-29.622857-29.622857H61.732571A22.893714 22.893714 0 0 0 38.765714 62.025143V335.725714c0 16.310857 13.238857 29.622857 29.622857 29.622857h35.547429a29.842286 29.842286 0 0 0 29.696-29.842285zM690.980571 133.851429h201.581715v201.654857c0 16.310857 13.238857 29.549714 29.622857 29.549714h35.547428a29.622857 29.622857 0 0 0 29.549715-29.549714V61.952a22.893714 22.893714 0 0 0-22.820572-22.893714h-273.554285a29.622857 29.622857 0 0 0-29.549715 29.622857v35.547428c0 16.310857 13.238857 29.696 29.622857 29.696zM335.286857 892.781714H133.705143V691.2a29.622857 29.622857 0 0 0-29.622857-29.622857H68.534857a29.622857 29.622857 0 0 0-29.549714 29.622857v273.554286c0 12.653714 10.24 22.893714 22.820571 22.893714h273.554286a29.622857 29.622857 0 0 0 29.696-29.622857v-35.547429a29.769143 29.769143 0 0 0-29.769143-29.696z m557.348572-201.581714v201.581714H690.907429a29.622857 29.622857 0 0 0-29.622858 29.622857v35.547429c0 16.310857 13.238857 29.622857 29.622858 29.622857h273.554285c12.580571 0 22.893714-10.313143 22.893715-22.893714V691.2a29.622857 29.622857 0 0 0-29.622858-29.622857h-35.547428a29.622857 29.622857 0 0 0-29.696 29.622857z"></path></svg>',Xl=function(){function e(){this.title=Ks("blockQuote.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M894.6 907.1H605.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C752.7 180.4 711.3 315.8 711.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z m-472 0H133.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C280.7 180.4 239.3 315.8 239.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!Ei.getSelectedNodeByType(e,"blockquote")},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=f(Pn.Editor.nodes(e,{match:function(e){var t=Ei.getNodeType(e);return"paragraph"===t||"blockquote"===t},universal:!0,mode:"highest"}),1);return!t[0]},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.isActive(e)?"paragraph":"blockquote";Pn.Transforms.setNodes(e,{type:n},{mode:"highest"})}},e}(),Zl={key:"blockquote",factory:function(){return new Xl}},Jl=globalThis.Node;function Ql(e){return 0===zr("<div>".concat(e,"</div>")).children().filter(function(e){return"BR"!==e.tagName}).length}function ec(e){return 0===e.length?"":e[0].outerHTML}function tc(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==Jl.ELEMENT_NODE?"":t.tagName.toLowerCase()}function nc(e,t){for(var n="",r=(e.attr("style")||"").split(";"),o=r.length,i=0;i<o;i+=1){var a=r[i];if(a){var s=a.split(":");s[0].trim()===t&&(n=s[1].trim())}}return n}function rc(e,t){return!!Pn.Text.isText(e)||!!t.isInline(e)}ro&&(zr.fn.css=ro),lo&&(zr.fn.append=lo),co&&(zr.fn.prepend=co),$r&&(zr.fn.addClass=$r),Ur&&(zr.fn.removeClass=Ur),Vr&&(zr.fn.hasClass=Vr),Xr&&(zr.fn.on=Xr),Zr&&(zr.fn.off=Zr),wo&&(zr.fn.focus=wo),Wr&&(zr.fn.attr=Wr),Gr&&(zr.fn.removeAttr=Gr),to&&(zr.fn.hide=to),no&&(zr.fn.show=no),po&&(zr.fn.parents=po),Kr&&(zr.fn.dataset=Kr),Yr&&(zr.fn.val=Yr),so&&(zr.fn.text=so),ao&&(zr.fn.html=ao),go&&(zr.fn.children=go),vo&&(zr.fn.remove=vo),ho&&(zr.fn.find=ho),Jr&&(zr.fn.width=Jr),Qr&&(zr.fn.height=Qr),io&&(zr.fn.filter=io),mo&&(zr.fn.empty=mo);var oc={selector:"blockquote:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=zr(e),o=[];return t.forEach(function(e,r){rc(e,n)?o.push(e):Pn.Element.isElement(e)&&(o.push.apply(o,p([],f(function(e,t){var n=e.children.filter(function(e){return rc(e,t)});if(n.length>0)return n;var r=Pn.Node.string(e);return r?[{text:r}]:[]}(e,n)),!1)),function(e,t,n){for(var r=t+1;r<e.length;r+=1){var o=e[r];if(Pn.Element.isElement(o)&&!n.isInline(o))return!0}return!1}(t,r,n)&&function(e){var t=e[e.length-1];Pn.Text.isText(t)&&t.text.endsWith("\n")||e.push({text:"\n"})}(o))}),0===(t=o).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"blockquote",children:t}}};function ic(e){e.deleteBackward("character");Pn.Transforms.insertNodes(e,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}var ac={type:"blockquote",renderElem:function(e,t,n){return wl("blockquote",null,t)}},sc={renderElems:[ac],elemsToHtml:[Gl],parseElemsHtml:[oc],menus:[Zl],editorPlugin:function(e){var t=e.insertBreak,n=e.insertText,r=e;return r.insertBreak=function(){var o=r.selection;if(null==o)return t();var i=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"blockquote")},universal:!0}),1),a=i[0];if(!a)return t();var s=a[0];if(Ei.getParentNode(e,s)){var u=Ei.findPath(e,s),l=Pn.Editor.end(e,u);if(Pn.Point.equals(l,o.focus)){var c=Pn.Editor.last(e,l.path),d=Pn.Node.string(c[0]);if(d&&"\n"===d.slice(-1))return void ic(r)}n("\n")}else ic(r)},r}};var uc={type:"code",elemToHtml:function(e,t){return"<code>".concat(t,"</code>")}};var lc={type:"pre",elemToHtml:function(e,t){return"<pre>".concat(t,"</pre>")}},cc=function(){function e(){this.title=Ks("codeBlock.title"),this.iconSvg='<svg viewBox="0 0 1280 1024"><path d="M832 736l96 96 320-320L928 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224zM701.312 150.528l69.472 18.944-192 704.032-69.472-18.944 192-704.032z"></path></svg>',this.tag="button"}return e.prototype.getSelectCodeElem=function(e){var t=Ei.getSelectedNodeByType(e,"code");if(null==t)return null;var n=Ei.getParentNode(e,t);return null==n||"pre"!==Ei.getNodeType(n)?null:t},e.prototype.getSelectedTableCellBlock=function(e){if(null==Ei.getSelectedNodeByType(e,"table-cell"))return null;var t=Pn.Editor.above(e,{match:function(e){return!!Pn.Element.isElement(e)&&("paragraph"===e.type||"pre"===e.type)}});return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectCodeElem(e);if(null==t){var n=e.getMenuConfig("codeSelectLang").codeLangs,r=(void 0===n?[]:n).find(function(e){return e.selected});return(null==r?void 0:r.value)||""}return t.language||""},e.prototype.isActive=function(e){return!!this.getSelectCodeElem(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=Ei.getSelectedElems(e);return!!t.some(function(t){return e.isVoid(t)})||!t.some(function(e){var t=Ei.getNodeType(e);return"pre"===t||"paragraph"===t})},e.prototype.exec=function(e,t){this.isActive(e)?this.changeToPlainText(e):this.changeToCodeBlock(e,t.toString())},e.prototype.changeToPlainText=function(e){var t=this.getSelectCodeElem(e);if(null!=t){var n=Pn.Node.string(t),r=this.getSelectedTableCellBlock(e);if(r){var o=f(r,2)[1],i=n.split("\n").map(function(e){return{type:"paragraph",children:[{text:e}]}});return Pn.Transforms.removeNodes(e,{at:o}),void Pn.Transforms.insertNodes(e,i,{at:o})}Pn.Transforms.removeNodes(e,{mode:"highest"});var a=n.split("\n").map(function(e){return{type:"paragraph",children:[{text:e}]}});Pn.Transforms.insertNodes(e,a,{mode:"highest"})}},e.prototype.changeToCodeBlock=function(e,t){var n,r,o=this.getSelectedTableCellBlock(e);if(o){var i=f(o,2),a=i[0],s=i[1],u={type:"pre",children:[{type:"code",language:t,children:[{text:Pn.Node.string(a)}]}]};return Pn.Transforms.removeNodes(e,{at:s}),void Pn.Transforms.insertNodes(e,u,{at:s})}var l=[],c=Pn.Editor.nodes(e,{match:function(t){return e.children.includes(t)},universal:!0});try{for(var p=d(c),h=p.next();!h.done;h=p.next()){var g=f(h.value,1)[0];g&&l.push(Pn.Node.string(g))}}catch(e){n={error:e}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}Pn.Transforms.removeNodes(e,{mode:"highest"});var v={type:"pre",children:[{type:"code",language:t,children:[{text:l.join("\n")}]}]};Pn.Transforms.insertNodes(e,v,{mode:"highest"})},e}();var dc={selector:"pre:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=zr(e);return 0===(t=t.filter(function(e){return"code"===Ei.getNodeType(e)})).length&&(t=[{type:"code",language:"",children:[{text:r[0].textContent||""}]}]),{type:"pre",children:t.filter(function(e){return"code"===Ei.getNodeType(e)})}}};function fc(e){var t=document.createElement("textarea");t.value=e,t.setAttribute("readonly","readonly"),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",document.body.appendChild(t),t.select(),t.setSelectionRange(0,t.value.length);var n=document.execCommand("copy");return document.body.removeChild(t),n}function pc(e){return l(this,void 0,void 0,function(){var t;return c(this,function(n){switch(n.label){case 0:if(""===e)return[2,!0];n.label=1;case 1:return n.trys.push([1,4,,5]),"undefined"!=typeof navigator&&(null===(t=navigator.clipboard)||void 0===t?void 0:t.writeText)?[4,navigator.clipboard.writeText(e)]:[3,3];case 2:return n.sent(),[2,!0];case 3:return[3,5];case 4:return n.sent(),[3,5];case 5:try{return[2,fc(e)]}catch(e){return[2,!1]}return[2]}})})}var hc={type:"pre",renderElem:function(e,t,n){var r=this,o=(n.getMenuConfig("codeBlock")||{}).showCopyButton;if(!(void 0!==o&&o))return wl("pre",null,t);var i=function(e){var t=e.children;return(void 0===t?[]:t).map(function(e){return(e.children||[]).map(function(e){return e.text||""}).join("")}).join("\n")}(e),a=Ks("codeBlock.copy"),s=Ks("codeBlock.copied"),u=Ks("codeBlock.copyFailed"),d=wl("pre",{className:"w-e-code-block"},wl("button",{className:"w-e-code-block-copy-button",contentEditable:!1,on:{mousedown:function(e){e.preventDefault(),e.stopPropagation()},click:function(e){return l(r,void 0,void 0,function(){var t,n;return c(this,function(r){switch(r.label){case 0:return e.preventDefault(),e.stopPropagation(),null==(t=e.currentTarget||e.target)?[2]:[4,pc(i)];case 1:return n=r.sent(),function(e,t,n){var r=Number(e.dataset.copyResetTimer||0);r&&window.clearTimeout(r),e.textContent=t;var o=window.setTimeout(function(){e.textContent=n,delete e.dataset.copyResetTimer},1200);e.dataset.copyResetTimer="".concat(o)}(t,n?s:u,a),[2]}})})}}},a),t);return d}},gc={type:"code",renderElem:function(e,t,n){return wl("code",null,t)}},vc={menus:[{key:"codeBlock",config:{showCopyButton:!1},factory:function(){return new cc}}],editorPlugin:function(e){var t=e.insertBreak,n=e.normalizeNode,r=e.insertData,o=e.handleTab,i=e;return i.insertBreak=function(){var e=Ei.getSelectedNodeByType(i,"code");if(null!=e){var n=function(e,t){var n=t.selection;if(null==n)return"";var r=Pn.Node.string(e),o=n.anchor.offset,i=r.slice(0,o).split("\n"),a=i.length;return 0===a?"":i[a-1]}(e,i);if(n){var r=n.match(/^\s+/);if(null!=r&&null!=r[0]){var o=r[0];return void i.insertText("\n".concat(o))}}i.insertText("\n")}else t()},e.handleTab=function(){var t=e.selection;if(t){var n=Ei.getSelectedNodeByType(e,"code");if(n&&!Pn.Range.isCollapsed(t)){var r=f([t.anchor,t.focus].sort(function(e,t){return e.offset-t.offset}),2),i=r[0],a=r[1],s=n.children[0].text,u=s.split("\n"),l=s.slice(0,i.offset).split("\n").length-1,c=s.slice(0,a.offset).split("\n").length-1,d=u.map(function(e,t){return t>=l&&t<=c?" ".concat(e):e}),p=d.join("\n"),h={anchor:{path:i.path,offset:i.offset+2},focus:{path:a.path,offset:a.offset+2}};Pn.Transforms.insertText(e,p,{at:{anchor:{path:i.path,offset:0},focus:{path:a.path,offset:s.length}}}),Pn.Transforms.select(e,h)}else o()}},i.normalizeNode=function(e){var t=f(e,2),r=t[0],o=t[1],a=Ei.getNodeType(r);("code"===a&&o.length<=1&&Pn.Transforms.setNodes(i,{type:"paragraph"},{at:o}),"pre"===a)&&(Ei.isLastNode(i,r)&&Pn.Transforms.insertNodes(i,Ei.genEmptyParagraph(),{at:[o[0]+1]}),"code"!==Ei.getNodeType(r.children[0])&&(Pn.Transforms.unwrapNodes(i),Pn.Transforms.setNodes(i,{type:"paragraph"},{mode:"highest"})));return n([r,o])},i.insertData=function(e){if(null!=Ei.getSelectedNodeByType(i,"code")){var t=e.getData("text/plain");Pn.Editor.insertText(i,t)}else r(e)},i},renderElems:[hc,gc],elemsToHtml:[uc,lc],preParseHtml:[{selector:"pre>code",preParseHtml:function(e){var t=zr(e);if("code"!==tc(t))return e;var n=t.find("xmp");if(0===n.length)return e;var r=n.text();return n.remove(),t.text(r),t[0]}}],parseElemsHtml:[{selector:"pre:not([data-w-e-type])>code",parseElemHtml:function(e,t,n){return{type:"code",language:"",children:[{text:zr(e)[0].textContent||""}]}}},dc]},mc=function(){function e(){this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){var t=this.mark,n=Pn.Editor.marks(e);return n&&n[t]?n[t]:""},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=f(Pn.Editor.nodes(e,{match:function(t){return"pre"===Ei.getNodeType(t)||!(!Pn.Element.isElement(t)||!Pn.Editor.isVoid(e,t))},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){var t=this.mark;if(null==this.$content){var n=zr('<ul class="w-e-panel-content-color"></ul>');n.on("click","li",function(n){var r=n.target;if(null!=r&&(n.preventDefault(),null!=e.selection)){var o=zr(r).attr("data-value");"0"===o?Pn.Editor.removeMark(e,t):Pn.Editor.addMark(e,t,o)}}),this.$content=n}var r=this.$content;if(null==r)return document.createElement("ul");r.empty();var o=this.getValue(e),i=e.getMenuConfig(t).colors;(void 0===i?[]:i).forEach(function(e){var t=zr('<div class="color-block" data-value="'.concat(e,'"></div>'));t.css("background-color",e);var n=zr('<li data-value="'.concat(e,'"></li>'));o===e&&n.addClass("active"),n.append(t),r.append(n)});var a="";"color"===t&&(a=Ks("color.default")),"bgColor"===t&&(a=Ks("color.clear"));var s=zr('\n <li data-value="0" class="clear">\n '.concat('<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>',"\n ").concat(a,"\n </li>\n "));return r.prepend(s),r[0]},e}(),yc=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("color.bgColor"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M510.030769 315.076923l84.676923 196.923077h-177.230769l76.8-196.923077h15.753846zM945.230769 157.538462v708.923076c0 43.323077-35.446154 78.769231-78.769231 78.769231H157.538462c-43.323077 0-78.769231-35.446154-78.769231-78.769231V157.538462c0-43.323077 35.446154-78.769231 78.769231-78.769231h708.923076c43.323077 0 78.769231 35.446154 78.769231 78.769231z m-108.307692 643.938461L600.615385 216.615385c-5.907692-11.815385-15.753846-19.692308-29.538462-19.692308h-139.815385c-11.815385 0-23.630769 7.876923-27.56923 19.692308l-216.615385 584.861538c-3.938462 11.815385 3.938462 25.6 17.723077 25.6h80.738462c11.815385 0 23.630769-9.846154 27.56923-21.661538l63.015385-175.261539h263.876923l68.923077 175.261539c3.938462 11.815385 15.753846 21.661538 27.569231 21.661538h80.738461c13.784615 0 23.630769-13.784615 19.692308-25.6z"></path></svg>',t.mark="bgColor",t}return s(t,e),t}(mc),bc=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("color.color"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 864h896v96H64zM360.58 576h302.85l81.53 224h102.16L579.24 64H444.77L176.89 800h102.16l81.53-224zM512 159.96L628.49 480H395.52L512 159.96z"></path></svg>',t.mark="color",t}return s(t,e),t}(mc),Ec=["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"];function wc(){return Ec}var Cc={key:"color",factory:function(){return new bc},config:{colors:wc()}},Dc={key:"bgColor",factory:function(){return new yc},config:{colors:Ec}};function Ac(e,t){null==e.data&&(e.data={});var n=e.data;null==n.style&&(n.style={}),Object.assign(n.style,t)}function Sc(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={});var r=String(n.props.className||"").trim(),o=r?r.split(/\s+/):[];o.includes(t)||o.push(t),n.props.className=o.join(" ")}var xc={color:"w-e-color",bgColor:"w-e-bg-color",fontSize:"w-e-font-size",fontFamily:"w-e-font-family",textAlign:"w-e-text-align",lineHeight:"w-e-line-height",indent:"w-e-indent"},Tc={color:"data-w-e-color",bgColor:"data-w-e-bg-color",fontSize:"data-w-e-font-size",fontFamily:"data-w-e-font-family",textAlign:"data-w-e-text-align",lineHeight:"data-w-e-line-height",indent:"data-w-e-indent"},Nc={color:"wEColor",bgColor:"wEBgColor",fontSize:"wEFontSize",fontFamily:"wEFontFamily",textAlign:"wETextAlign",lineHeight:"wELineHeight",indent:"wEIndent"},Oc=new Set;function Bc(e,t){var n=(t||"").trim();return n?"fontFamily"===e?n.replace(/"/g,"").replace(/\s+/g," ").toLowerCase():n.replace(/\s+/g,"").toLowerCase():""}function kc(e,t){var n=Bc(e,t),r=function(e){var t,n,r=7;try{for(var o=d(e),i=o.next();!i.done;i=o.next())r=(31*r+(i.value.codePointAt(0)||0))%2147483647}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.toString(36)}("".concat(e,":").concat(n));return"".concat(xc[e],"-").concat(r)}function Fc(e,t){var n,r,o,i=(o=["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"].map(function(e){return"string"==typeof e?e:e.value}),{color:wc(),bgColor:wc(),fontSize:o,fontFamily:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"].map(function(e){return"string"==typeof e?e:e.value}),textAlign:["left","center","right","justify"],lineHeight:["1","1.15","1.5","2","2.5","3"],indent:(n=o,r=new Set(["2em"]),n.forEach(function(e){var t="".concat(e||"").trim().match(/^(-?\d+(\.\d+)?)([a-z%]+)$/i);if(t){var n=parseFloat(t[1]),o=t[3];!Number.isFinite(n)||n<=0||!o||r.add("".concat(2*n).concat(o))}}),Array.from(r))})[t],a=function(e,t){var n,r=null===(n=null==e?void 0:e.getConfig().styleClassTokens)||void 0===n?void 0:n[t];return Array.isArray(r)?r:[]}(e,t),s=p(p([],f(i),!1),f(a),!1),u=new Set;return s.forEach(function(e){var t="".concat(e||"").trim();t&&u.add(t)}),Array.from(u)}function Ic(e,t,n,r){if(function(e,t,n){var r=Bc(t,n);if(!r)return!1;for(var o=Fc(e,t),i=0;i<o.length;i+=1)if(Bc(t,o[i])===r)return!0;return!1}(e,t,n))return"class";var o=Vl(e),i="preserve-data";"fallback-inline"===o&&(i="inline"),"strict"===o&&(i="throw");var a='[wangeditor] Unsupported class style token "'.concat(t,"=").concat(n,'" in ').concat(r,". policy=").concat(o),s="".concat(t,"|").concat(n,"|").concat(r,"|").concat(i);if(Oc.has(s)||(Oc.add(s),Wl(e,{type:t,value:n,scene:r,fallback:i,message:a})),"throw"===i)throw new Error(a);return"inline"===i?"inline":"preserve-data"}function Pc(e){return Ul(e)}function Rc(e,t,n,r,o,i){var a="".concat(n||"").trim();if(a){e.attr(Tc[t],a);var s=Ic(r,t,a,o);"class"!==s?"inline"===s&&i&&i():e.addClass(kc(t,a))}}function _c(e,t,n,r,o,i){var a,s="".concat(n||"").trim();if(s){!function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.dataset&&(n.dataset={}),Object.assign(n.dataset,t)}(e,(a={},a[Nc[t]]=s,a));var u=Ic(r,t,s,o);"class"!==u?"inline"===u&&i&&Ac(e,i):Sc(e,kc(t,s))}}function Lc(e,t,n){var r=e.attr(Tc[t])||"";if(r)return r;for(var o=(e.attr("class")||"").trim().split(/\s+/).filter(Boolean),i="".concat(xc[t],"-"),a=function(e,t){var n=Fc(e,t),r={};return n.forEach(function(e){r[kc(t,e)]=e}),r}(n,t),s=0;s<o.length;s+=1){var u=o[s];if(u.startsWith(i)){var l=a[u];if(l)return l}}return""}var Mc={selector:"font",preParseHtml:function(e){var t=zr(e);if("font"!==tc(t))return e;var n=t.attr("color")||"";return n&&(t.removeAttr("color"),t.css("color",n)),t[0]}};var jc={renderStyle:function(e,t,n){var r=e,o=r.color,i=r.bgColor,a=t;return"class"===Pc(n)?(o&&_c(a,"color",o,n,"render",{color:o}),i&&_c(a,"bgColor",i,n,"render",{backgroundColor:i})):(o&&Ac(a,{color:o}),i&&Ac(a,{backgroundColor:i})),a},styleToHtml:function(e,t,n){if(!Pn.Text.isText(e))return t;var r,o=e,i=o.color,a=o.bgColor;return i||a?((Ql(t)||"span"!==tc(r=zr(t)))&&(r=zr("<span>".concat(t,"</span>"))),"class"===Pc(n)?(i&&Rc(r,"color",i,n,"toHtml",function(){r.css("color",i)}),a&&Rc(r,"bgColor",a,n,"toHtml",function(){r.css("background-color",a)})):(i&&r.css("color",i),a&&r.css("background-color",a)),ec(r)):t},preParseHtml:[Mc],parseStyleHtml:function(e,t,n){var r=zr(e);if(!Pn.Text.isText(t))return t;var o=t,i=nc(r,"color");i||(i=Lc(r,"color",n)),i&&(o.color=i);var a=nc(r,"background-color");return a||(a=nc(r,"background")),a||(a=Lc(r,"bgColor",n)),a&&(o.bgColor=a),o},menus:[Cc,Dc]},Hc=function(){function e(){this.title=Ks("common.enter"),this.iconSvg='<svg viewBox="0 0 1255 1024"><path d="M1095.111111 731.477333h-625.777778V1024L0 658.318222 469.333333 292.408889v292.636444h625.777778V0h156.444445v731.477333z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||!!Pn.Range.isExpanded(t)},e.prototype.exec=function(e,t){var n=e.selection;if(null!=n){var r=[n.anchor.path[0]];Pn.Transforms.insertNodes(e,{type:"paragraph",children:[{text:""}]},{at:r}),e.select(Pn.Editor.start(e,r))}},e}(),zc={menus:[{key:"enter",factory:function(){return new Hc}}]};var $c={type:"divider",elemToHtml:function(e,t){return"<hr/>"}},Uc=function(){function e(){this.title=Ks("divider.title"),this.iconSvg='<svg viewBox="0 0 1092 1024"><path d="M0 51.2m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M819.2 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M409.6 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 870.4m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!Ei.getSelectedElems(e).some(function(t){if(e.isVoid(t))return!0;var n=Ei.getNodeType(t);return"table"===n||"pre"===n})},e.prototype.exec=function(e,t){Ei.isSelectedEmptyParagraph(e)&&Pn.Transforms.removeNodes(e,{mode:"highest"}),Pn.Transforms.insertNodes(e,{type:"divider",children:[{text:""}]},{mode:"highest"})},e}();var Vc={renderElems:[{type:"divider",renderElem:function(e,t,n){return tl("div",{props:{contentEditable:!1,className:"w-e-textarea-divider"},dataset:{selected:Ei.isNodeSelected(n,e)?"true":""},style:{},on:{mousedown:function(e){return e.preventDefault()}}},[tl("hr")])}}],elemsToHtml:[$c],parseElemsHtml:[{selector:"hr:not([data-w-e-type])",parseElemHtml:function(e,t,n){return{type:"divider",children:[{text:""}]}}}],menus:[{key:"divider",factory:function(){return new Uc}}],editorPlugin:function(e){var t=e.isVoid,n=e.normalizeNode,r=e;return r.isVoid=function(e){return"divider"===e.type||t(e)},r.normalizeNode=function(e){var t=f(e,2),o=t[0],i=t[1];if("divider"!==Ei.getNodeType(o))return n([o,i]);Ei.isLastNode(r,o)&&Pn.Transforms.insertNodes(r,Ei.genEmptyParagraph(),{at:[i[0]+1]})},r}};var Wc=function(){function e(){this.title=Ks("emotion.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m0-102.4c226.742857 0 409.6-182.857143 409.6-409.6S738.742857 102.4 512 102.4 102.4 285.257143 102.4 512s182.857143 409.6 409.6 409.6z m-204.8-358.4h409.6c0 113.371429-91.428571 204.8-204.8 204.8s-204.8-91.428571-204.8-204.8z m0-102.4c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8 76.8 32.914286 76.8 76.8-32.914286 76.8-76.8 76.8z m409.6 0c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8c43.885714 0 76.8 32.914286 76.8 76.8s-32.914286 76.8-76.8 76.8z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.exec=function(e,t){},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=f(Pn.Editor.nodes(e,{match:function(t){return"pre"===Ei.getNodeType(t)||!(!Pn.Element.isElement(t)||!Pn.Editor.isVoid(e,t))},universal:!0}),1);return!!t[0]},e.prototype.getPanelContentElem=function(e){if(null==this.$content){var t=zr('<ul class="w-e-panel-content-emotion"></ul>');t.on("click","li",function(t){var n=t.target;if(null!=n){t.preventDefault();var r=zr(n).text();e.insertText(r)}}),this.$content=t}var n=this.$content;if(null==n)return document.createElement("ul");n.empty();var r=e.getMenuConfig("emotion").emotions;return(void 0===r?[]:r).forEach(function(e){var t=zr("<li>".concat(e,"</li>"));n.append(t)}),n[0]},e}(),Gc={menus:[{key:"emotion",factory:function(){return new Wc},config:{emotions:"😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣 👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏".split(" ")}}]},qc=function(){function e(){this.tag="select",this.width=80}return e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.mark,n=Pn.Editor.marks(e);return n&&n[t]?n[t]:""},e.prototype.isDisabled=function(e){if(null==e.selection)return!0;var t=f(Pn.Editor.nodes(e,{match:function(t){return"pre"===Ei.getNodeType(t)||!(!Pn.Element.isElement(t)||!Pn.Editor.isVoid(e,t))},universal:!0}),1);return!!t[0]},e.prototype.exec=function(e,t){var n=this.mark;t?e.addMark(n,t):e.removeMark(n)},e}(),Kc=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("fontFamily.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M956.788364 152.110545h-24.110546l23.924364 9.029819 0.186182 121.018181h-65.070546l-86.574545-130.048H566.551273v650.14691l130.048 64.977454v65.163636h-390.050909v-65.163636l129.954909-64.977454V152.110545H198.283636L111.429818 282.065455H46.545455V69.259636C46.545455 33.792 82.664727 22.062545 98.955636 22.062545h812.683637c23.738182 0 45.056 15.173818 45.056 41.053091V169.425455v-17.221819z"></path></svg>',t.mark="fontFamily",t.selectPanelWidth=150,t}return s(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontFamilyList,r=void 0===n?[]:n;t.push({text:Ks("fontFamily.default"),value:""}),r.forEach(function(e){if("string"==typeof e)t.push({text:e,value:e,styleForRenderMenuList:{"font-family":e}});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r,styleForRenderMenuList:{"font-family":r}})}});var o=this.getValue(e),i=!1;return t.forEach(function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0}),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(qc),Yc=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("fontSize.title"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 512h384v128h-128V1024h-128V640h-128z m896-256H708.2496v768h-136.4992V256H320V128h640z"></path></svg>',t.mark="fontSize",t}return s(t,e),t.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig(this.mark).fontSizeList,r=void 0===n?[]:n;t.push({text:Ks("fontSize.default"),value:""}),r.forEach(function(e){if("string"==typeof e)t.push({text:e,value:e});else if("object"==typeof e){var n=e.name,r=e.value;t.push({text:n,value:r})}});var o=this.getValue(e),i=!1;return t.forEach(function(e){e.value===o?(i=!0,e.selected=!0):e.selected=void 0}),i||"string"!=typeof o||t.push({text:o,value:o,selected:!0}),t},t}(qc);var Xc={1:"12px",2:"14px",3:"16px",4:"19px",5:"24px",6:"32px",7:"48px"};var Zc={renderStyle:function(e,t,n){var r=e,o=r.fontSize,i=r.fontFamily,a=t;return"class"===Pc(n)?(o&&_c(a,"fontSize",o,n,"render",{fontSize:o}),i&&_c(a,"fontFamily",i,n,"render",{fontFamily:i})):(o&&Ac(a,{fontSize:o}),i&&Ac(a,{fontFamily:i})),a},styleToHtml:function(e,t,n){if(!Pn.Text.isText(e))return t;var r,o=e,i=o.fontSize,a=o.fontFamily;return i||a?((Ql(t)||"span"!==tc(r=zr(t)))&&(r=zr("<span>".concat(t,"</span>"))),"class"===Pc(n)?(i&&Rc(r,"fontSize",i,n,"toHtml",function(){r.css("font-size",i)}),a&&Rc(r,"fontFamily",a,n,"toHtml",function(){r.css("font-family",a)})):(i&&r.css("font-size",i),a&&r.css("font-family",a)),ec(r)):t},preParseHtml:[{selector:"font",preParseHtml:function(e){var t=zr(e);if("font"!==tc(t))return e;var n=t.attr("size")||"";n&&(t.removeAttr("size"),t.css("font-size",Xc[n]));var r=t.attr("face")||"";return r&&(t.removeAttr("face"),t.css("font-family",r)),t[0]}}],parseStyleHtml:function(e,t,n){var r=zr(e);if(!Pn.Text.isText(t))return t;var o=t,i=nc(r,"font-size");i||(i=Lc(r,"fontSize",n)),i&&(o.fontSize=i);var a=nc(r,"font-family"),s=Lc(r,"fontFamily",n),u=(a||s).replace(/"/g,"");return u&&(o.fontFamily=u),o},menus:[{key:"fontSize",factory:function(){return new Yc},config:{fontSizeList:["12px",{name:"13px",value:"13px"},"14px","15px","16px","19px",{name:"22px",value:"22px"},"24px","29px","32px","40px","48px"]}},{key:"fontFamily",factory:function(){return new Kc},config:{fontFamilyList:["黑体",{name:"仿宋",value:"仿宋"},"楷体","标楷体","华文仿宋","华文楷体",{name:"宋体",value:"宋体"},"微软雅黑","Arial","Tahoma","Verdana","Times New Roman","Courier New"]}}]};var Jc=function(){function e(){this.title=Ks("formatPainter.title"),this.iconSvg='<svg viewBox="0 0 24 24"><path d="M8 19.997v-5h2v5h9v-7H5v7zm-4-9h16v-3h-6v-4h-4v4H4zm-1 10v-8H2v-6a1 1 0 0 1 1-1h5v-3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3h5a1 1 0 0 1 1 1v6h-1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1"/></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(t){return e.attrs.isSelect},e.prototype.isDisabled=function(e){return!1},e.prototype.isSourceBlockType=function(e){return"blockquote"===e||"header1"===e||"header2"===e||"header3"===e||"header4"===e||"header5"===e||"header6"===e||"list-item"===e||"todo"===e},e.prototype.isTargetBlockType=function(e){return"paragraph"===e||this.isSourceBlockType(e)},e.prototype.getTopLevelSelectedBlocks=function(e,t){return Array.from(Pn.Editor.nodes(e,{at:e.selection||void 0,match:function(e){return Pn.Element.isElement(e)}})).filter(function(e){var n=f(e,2),r=n[0];return 1===n[1].length&&t(r.type)}).map(function(e){return f(e,2)[1]})},e.prototype.normalizeListOrderType=function(e){return"a"===e||"A"===e||"i"===e||"I"===e?e:"1"===e?"1":void 0},e.prototype.getSelectedBlockStyle=function(e){var t=this,n=f(this.getTopLevelSelectedBlocks(e,function(e){return t.isSourceBlockType(e)}),1)[0];if(!n)return null;var r=f(Pn.Editor.node(e,n),1)[0];return Pn.Element.isElement(r)&&this.isSourceBlockType(r.type)?"blockquote"===r.type||"header1"===r.type||"header2"===r.type||"header3"===r.type||"header4"===r.type||"header5"===r.type||"header6"===r.type||"todo"===r.type?{type:r.type}:"list-item"===r.type?{type:"list-item",ordered:"ordered"in r&&!!r.ordered,orderType:"orderType"in r?this.normalizeListOrderType(r.orderType):void 0}:null:null},e.prototype.unsetListAttrs=function(e,t){Pn.Transforms.unsetNodes(e,"ordered",{at:t}),Pn.Transforms.unsetNodes(e,"level",{at:t}),Pn.Transforms.unsetNodes(e,"start",{at:t}),Pn.Transforms.unsetNodes(e,"orderType",{at:t})},e.prototype.applyBlockStyle=function(e,t){var n=this,r=this.getTopLevelSelectedBlocks(e,function(e){return n.isTargetBlockType(e)});0!==r.length&&("list-item"!==t.type?"todo"!==t.type?r.forEach(function(r){Pn.Transforms.setNodes(e,{type:t.type},{at:r}),n.unsetListAttrs(e,r),Pn.Transforms.unsetNodes(e,"checked",{at:r})}):r.forEach(function(t){Pn.Transforms.setNodes(e,{type:"todo",checked:!1},{at:t}),n.unsetListAttrs(e,t)}):r.forEach(function(n){Pn.Transforms.setNodes(e,{type:"list-item",ordered:t.ordered,orderType:t.orderType,level:0},{at:n}),Pn.Transforms.unsetNodes(e,"checked",{at:n}),Pn.Transforms.unsetNodes(e,"start",{at:n})}))},e.prototype.setFormatHtml=function(t){var n,r;if(t.getSelectionText().length){if(e.attrs.formatStyle){!function(e){var t=Pn.Editor.marks(e);t&&Object.keys(t).forEach(function(t){e.removeMark(t)})}(t);try{for(var o=d(Object.entries(e.attrs.formatStyle)),i=o.next();!i.done;i=o.next()){var a=f(i.value,2),s=a[0],u=a[1];t.addMark(s,u)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}e.attrs.formatBlockStyle&&this.applyBlockStyle(t,e.attrs.formatBlockStyle),e.attrs.formatStyle=null,e.attrs.formatBlockStyle=null,e.attrs.isSelect=!1}},e.prototype.exec=function(t){e.attrs.isSelect?(e.attrs.isSelect=!1,e.attrs.formatStyle=null,e.attrs.formatBlockStyle=null):t.getSelectionText().length&&(e.attrs.formatStyle=Pn.Editor.marks(t),e.attrs.formatBlockStyle=this.getSelectedBlockStyle(t),e.attrs.isSelect=!0);t.blur(),t.focus()},e.attrs={isSelect:!1,formatStyle:null,formatBlockStyle:null},e}();var Qc={menus:[{key:"formatPainter",factory:function(){return new Jc}}],editorPlugin:function(e){var t=new Jc,n=e.onChange,r=e,o=function(){t.setFormatHtml(r),document.removeEventListener("mouseup",o)};return r.onChange=function(){n(),Jc.attrs.isSelect&&(document.removeEventListener("mouseup",o),document.addEventListener("mouseup",o))},r}},ed=function(){function e(){this.title=Ks("fullScreen.title"),this.iconSvg=Yl,this.tag="button",this.alwaysEnable=!0}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return e.isFullScreen},e.prototype.isDisabled=function(e){return!1},e.prototype.getIcon=function(e){return e.isFullScreen?'<svg t="1723361745825" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8705" width="200" height="200"><path d="M703.926857 362.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V128a42.642286 42.642286 0 1 1 85.357715 0v149.357714h149.357714c21.211429 0 38.765714 15.433143 42.057143 35.693715l0.585143 6.948571a42.642286 42.642286 0 0 1-42.642286 42.642286H703.926857zM703.926857 938.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V704c0-23.552 19.090286-42.642286 42.642286-42.642286h192.073143a42.642286 42.642286 0 1 1 0 85.284572l-149.357714 0.073143v149.284571c0 21.211429-15.506286 38.765714-35.84 42.130286l-6.875429 0.512zM319.853714 938.642286a42.642286 42.642286 0 0 1-42.642285-42.642286v-149.284571H127.853714a42.642286 42.642286 0 0 1-42.130285-35.84l-0.585143-6.875429c0-23.552 19.163429-42.642286 42.715428-42.642286h192c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286zM127.853714 362.642286a42.642286 42.642286 0 1 1 0-85.284572H277.211429V128c0-21.211429 15.433143-38.765714 35.766857-42.130286l6.875428-0.512c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286H127.853714z" fill="#333333" p-id="8706"></path></svg>':Yl},e.prototype.getTitle=function(e){return e.isFullScreen?Ks("fullScreen.cancelTitle"):Ks("fullScreen.title")},e.prototype.exec=function(e,t){e.isFullScreen?e.unFullScreen():e.fullScreen()},e}(),td={menus:[{key:"fullScreen",factory:function(){return new ed}}]};function nd(e){return function(t,n){return"<h".concat(e,">").concat(n,"</h").concat(e,">")}}var rd={type:"header1",elemToHtml:nd(1)},od={type:"header2",elemToHtml:nd(2)},id={type:"header3",elemToHtml:nd(3)},ad={type:"header4",elemToHtml:nd(4)},sd={type:"header5",elemToHtml:nd(5)},ud={type:"header6",elemToHtml:nd(6)};function ld(e){var t=f(Pn.Editor.nodes(e,{match:function(e){var t=Ei.getNodeType(e),n=e.headingType;return t.startsWith("header")||/^header[1-6]$/.test(n)},universal:!0}),1),n=t[0];if(null==n)return"paragraph";var r=f(n,1)[0];return r.headingType||Ei.getNodeType(r)}function cd(e){if(null==e.selection)return!0;var t=f(Pn.Editor.nodes(e,{match:function(e){var t=Ei.getNodeType(e);return"paragraph"===t||(!!t.startsWith("header")||"list-item"===t&&!0===e.ordered)},universal:!0,mode:"highest"}),1);return!t[0]}function dd(e,t){if(t){var n=Array.from(Pn.Editor.nodes(e,{match:function(e){var t=Ei.getNodeType(e);return"paragraph"===t||t.startsWith("header")||"list-item"===t},mode:"highest"}));Pn.Editor.withoutNormalizing(e,function(){n.forEach(function(n){var r=f(n,2),o=r[0],i=r[1];if("list-item"===Ei.getNodeType(o)){var a=o,s=function(e){return/^header[1-6]$/.test(e)}(t)?t:void 0,u=s?Number.parseInt(s.slice(6),10)-1:a.level;Pn.Transforms.setNodes(e,{headingType:s,listMode:s&&a.ordered?"outline":void 0,level:u},{at:i})}else Pn.Transforms.setNodes(e,{type:t},{at:i})})})}}var fd=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return ld(e)},e.prototype.isActive=function(e){return this.getValue(e)===this.type},e.prototype.isDisabled=function(e){return cd(e)},e.prototype.exec=function(e,t){var n=this.type;dd(e,t===n?"paragraph":n)},e}(),pd=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title="H1",t.type="header1",t}return s(t,e),t}(fd),hd=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title="H2",t.type="header2",t}return s(t,e),t}(fd),gd=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title="H3",t.type="header3",t}return s(t,e),t}(fd),vd=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title="H4",t.type="header4",t}return s(t,e),t}(fd),md=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title="H5",t.type="header5",t}return s(t,e),t}(fd),yd=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title="H6",t.type="header6",t}return s(t,e),t}(fd),bd=function(){function e(){this.title=Ks("header.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M960 960c-51.2 0-102.4-3.2-153.6-3.2-51.2 0-99.2 3.2-150.4 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 57.6-28.8 86.4-48 19.2-12.8 19.2-60.8 19.2-80v-224-19.2c-9.6-3.2-19.2-3.2-28.8-3.2H320c-9.6 0-19.2 0-28.8 3.2V780.8c0 22.4 0 80 22.4 92.8 28.8 19.2 96-6.4 96 44.8 0 16-9.6 41.6-28.8 41.6-54.4 0-105.6-3.2-160-3.2-48 0-96 3.2-147.2 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 51.2-28.8 80-48 19.2-12.8 19.2-60.8 19.2-83.2V294.4c0-28.8 3.2-115.2-22.4-131.2-25.6-16-86.4 9.6-86.4-41.6 0-16 6.4-41.6 28.8-41.6 51.2 0 105.6 3.2 156.8 3.2 48 0 96-3.2 144-3.2 19.2 0 28.8 22.4 28.8 41.6 0 48-57.6 25.6-83.2 41.6-19.2 12.8-19.2 73.6-19.2 92.8v201.6c6.4 3.2 16 3.2 22.4 3.2h400c6.4 0 12.8 0 22.4-3.2V256c0-22.4 0-80-19.2-92.8-28.8-16-86.4 6.4-86.4-41.6 0-16 9.6-41.6 28.8-41.6 51.2 0 99.2 3.2 150.4 3.2 48 0 99.2-3.2 147.2-3.2 19.2 0 28.8 22.4 28.8 41.6 0 51.2-57.6 25.6-86.4 41.6-19.2 12.8-19.2 70.4-19.2 92.8v537.6c0 19.2 0 67.2 19.2 80 28.8 19.2 89.6-6.4 89.6 44.8 0 19.2-6.4 41.6-28.8 41.6z"></path></svg>',this.tag="select",this.width=60}return e.prototype.getOptions=function(e){var t=[{value:"header1",text:"H1",styleForRenderMenuList:{"font-size":"32px","font-weight":"bold"}},{value:"header2",text:"H2",styleForRenderMenuList:{"font-size":"24px","font-weight":"bold"}},{value:"header3",text:"H3",styleForRenderMenuList:{"font-size":"18px","font-weight":"bold"}},{value:"header4",text:"H4",styleForRenderMenuList:{"font-size":"16px","font-weight":"bold"}},{value:"header5",text:"H5",styleForRenderMenuList:{"font-size":"13px","font-weight":"bold"}},{value:"header6",text:"H6",styleForRenderMenuList:{"font-size":"11px","font-weight":"bold"}},{value:"paragraph",text:Ks("header.text")}],n=this.getValue(e).toString();return t.forEach(function(e){e.value===n?e.selected=!0:e.selected=void 0}),t},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){return ld(e)},e.prototype.isDisabled=function(e){return cd(e)},e.prototype.exec=function(e,t){dd(e,t.toString())},e}(),Ed={key:"headerSelect",factory:function(){return new bd}},wd={key:"header1",factory:function(){return new pd}},Cd={key:"header2",factory:function(){return new hd}},Dd={key:"header3",factory:function(){return new gd}},Ad={key:"header4",factory:function(){return new vd}},Sd={key:"header5",factory:function(){return new md}},xd={key:"header6",factory:function(){return new yd}};function Td(e){return function(t,n,r){var o=zr(t);return 0===(n=n.filter(function(e){return!!Pn.Text.isText(e)||!!r.isInline(e)})).length&&(n=[{text:o.text().replace(/\s+/gm," ")}]),{type:"header".concat(e),children:n}}}var Nd={selector:"h1:not([data-w-e-type])",parseElemHtml:Td(1)},Od={selector:"h2:not([data-w-e-type])",parseElemHtml:Td(2)},Bd={selector:"h3:not([data-w-e-type])",parseElemHtml:Td(3)},kd={selector:"h4:not([data-w-e-type])",parseElemHtml:Td(4)},Fd={selector:"h5:not([data-w-e-type])",parseElemHtml:Td(5)},Id={selector:"h6:not([data-w-e-type])",parseElemHtml:Td(6)};function Pd(e){return function(t,n,r){return wl("h".concat(e),null,n)}}var Rd={renderElems:[{type:"header1",renderElem:Pd(1)},{type:"header2",renderElem:Pd(2)},{type:"header3",renderElem:Pd(3)},{type:"header4",renderElem:Pd(4)},{type:"header5",renderElem:Pd(5)},{type:"header6",renderElem:Pd(6)}],elemsToHtml:[rd,od,id,ad,sd,ud],parseElemsHtml:[Nd,Od,Bd,kd,Fd,Id],menus:[Ed,wd,Cd,Dd,Ad,Sd,xd],editorPlugin:function(e){var t=e.insertBreak,n=e;return n.insertBreak=function(){var r=f(Pn.Editor.nodes(n,{match:function(e){return Ei.getNodeType(e).startsWith("header")},universal:!0}),1),o=r[0];if(o)if(Ei.isSelectionAtLineEnd(e,o[1])){Pn.Transforms.insertNodes(n,{type:"paragraph",children:[{text:""}]},{mode:"highest"})}else t();else t()},n}};var _d={type:"image",elemToHtml:function(e,t,n){var r=e,o=r.src,i=r.alt,a=void 0===i?"":i,s=r.href,u=void 0===s?"":s,l=r.width,c=void 0===l?"":l,d=r.height,f=void 0===d?"":d,p=r.style,h=void 0===p?{}:p,g=h.width,v=void 0===g?"":g,m=h.height,y=void 0===m?"":m,b="";if("class"===Ul(n)){var E=c||v,w=f||y,C=v?' data-w-e-style-width="'.concat(v,'"'):"",D=y?' data-w-e-style-height="'.concat(y,'"'):"";b='<img src="'.concat(o,'" alt="').concat(a,'" data-href="').concat(u,'" width="').concat(E,'" height="').concat(w,'"').concat(C).concat(D,"/>")}else{var A="";v&&(A+="width: ".concat(v,";")),y&&(A+="height: ".concat(y,";")),b='<img src="'.concat(o,'" alt="').concat(a,'" data-href="').concat(u,'" width="').concat(c,'" height="').concat(f,'" style="').concat(A,'"/>')}return u?'<a href="'.concat(u,'" target="_blank">').concat(b,"</a>"):b}};var Ld=function(){function e(){this.title=Ks("image.delete"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==Ei.getSelectedNodeByType(e,"image")},e.prototype.exec=function(e,t){this.isDisabled(e)||Pn.Transforms.removeNodes(e,{match:function(e){return Ei.checkNodeType(e,"image")}})},e}();function Md(e){return void 0===e&&(e="r"),"".concat(e,"-").concat(Cn())}function jd(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Hd(e){var t=e.selection;if(null==t)return!0;if(!Pn.Range.isCollapsed(t))return!0;var n=f(Pn.Editor.nodes(e,{match:function(t){var n=Ei.getNodeType(t);return"code"===n||("pre"===n||("link"===n||(!!n.startsWith("header")||("blockquote"===n||!(!Pn.Element.isElement(t)||!Pn.Editor.isVoid(e,t))))))},universal:!0}),1);return!!n[0]}function zd(e,t,n){return l(this,arguments,void 0,function(e,t,n,r,o){var i,a;return void 0===r&&(r=""),void 0===o&&(o=""),c(this,function(s){switch(s.label){case 0:return(i=t.getMenuConfig(e).checkImage)?[4,i(n,r,o)]:[3,2];case 1:if("string"==typeof(a=s.sent()))return t.alert(a,"error"),[2,!1];if(null==a)return[2,!1];s.label=2;case 2:return[2,!0]}})})}function $d(e,t,n){return l(this,void 0,void 0,function(){var r;return c(this,function(o){switch(o.label){case 0:return(r=t.getMenuConfig(e).parseImageSrc)?[4,r(n)]:[3,2];case 1:return[2,o.sent()];case 2:return[2,n]}})})}function Ud(e,t){return l(this,arguments,void 0,function(e,t,n,r){var o,i,a,s,u,l;return void 0===n&&(n=""),void 0===r&&(r=""),c(this,function(c){switch(c.label){case 0:return[4,zd("insertImage",e,t,n,r)];case 1:return c.sent()?[4,$d("insertImage",e,t)]:[2];case 2:return o=c.sent(),i={type:"image",src:jd(o),href:r,alt:n,style:{},children:[{text:""}]},null===e.selection&&e.restoreSelection(),a=(null===(l=e.getMarks)||void 0===l?void 0:l.call(e))||{},s={},Object.keys(a).forEach(function(e){var t=a[e];null!=t&&!1!==t&&(s[e]=t)}),Ei.getSelectedNodeByType(e,"image")&&e.move(1),Hd(e)?[2]:(Pn.Transforms.insertNodes(e,i),Object.keys(s).forEach(function(t){Pn.Editor.addMark(e,t,s[t])}),(u=e.getMenuConfig("insertImage").onInsertedImage)&&u(i),[2])}})})}function Vd(){return Md("w-e-edit-image")}var Wd=function(){function e(){this.title=Ks("image.edit"),this.iconSvg=ql,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=Vd(),this.altInputId=Vd(),this.hrefInputId=Vd(),this.buttonId=Vd()}return e.prototype.getValue=function(e){return""},e.prototype.getImageNode=function(e){return Ei.getSelectedNodeByType(e,"image")},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Pn.Range.isCollapsed(t)||null==Ei.getSelectedNodeByType(e,"image"))},e.prototype.getModalPositionNode=function(e){return this.getImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=this.getImageNode(e);if(null==s)throw new Error("Not found selected image node");var u=f(iu(Ks("image.src"),r),2),l=u[0],c=zr(u[1]),d=f(iu(Ks("image.desc"),o),2),p=d[0],h=zr(d[1]),g=f(iu(Ks("image.link"),i),2),v=g[0],m=zr(g[1]),y=f(au(a,Ks("common.ok")),1)[0];if(null==this.$content){var b=zr("<div></div>");b.on("click","#".concat(a),function(n){n.preventDefault();var a=b.find("#".concat(r)).val(),s=b.find("#".concat(o)).val(),u=b.find("#".concat(i)).val();t.updateImage(e,a,s,u),e.hidePanelOrModal()}),this.$content=b}var E=this.$content;E.empty(),E.append(l),E.append(p),E.append(v),E.append(y);var w=s,C=w.src,D=w.alt,A=void 0===D?"":D,S=w.href,x=void 0===S?"":S;return c.val(C),h.val(A),m.val(x),setTimeout(function(){c.focus()}),E[0]},e.prototype.updateImage=function(e,t,n,r,o){void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),t&&(e.restoreSelection(),this.isDisabled(e)||function(e,t){l(this,arguments,void 0,function(e,t,n,r,o){var i,a,s,l,d,f;return void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o={}),c(this,function(c){switch(c.label){case 0:return[4,zd("editImage",e,t,n,r)];case 1:return c.sent()?[4,$d("editImage",e,t)]:[2];case 2:return i=c.sent(),null==(a=Ei.getSelectedNodeByType(e,"image"))||(s=a.style,l={src:i,alt:n,href:r,style:u(u({},void 0===s?{}:s),o)},Pn.Transforms.setNodes(e,l,{match:function(e){return Ei.checkNodeType(e,"image")}}),d=Ei.getSelectedNodeByType(e,"image"),(f=e.getMenuConfig("editImage").onUpdatedImage)&&f(d)),[2]}})})}(e,t,n,r,o))},e}(),Gd=/^\d+(\.\d+)?px$/,qd=/^\d+(\.\d+)?%$/,Kd=/^\d+(\.\d+)?$/,Yd=["30%","50%","100%"];function Xd(e,t){var n,r,o=Yd.indexOf(t);return(null===(r=null===(n=e.getConfig().imageResize)||void 0===n?void 0:n.resizeOptions)||void 0===r?void 0:r[o])||{label:t,value:t}}function Zd(e,t){return"".concat(Number(e)).concat(t)}function Jd(e,t,n){void 0===n&&(n="modal");var r=e.trim();return""===r||"auto"===r?"":"px"===t?Kd.test(r)?Zd(r,"px"):Gd.test(r)?r:"preset"===n&&qd.test(r)?Zd(r.slice(0,-1),"px"):null:"%"===t?Kd.test(r)?Zd(r,"%"):qd.test(r)?r:null:qd.test(r)||Gd.test(r)?r:Kd.test(r)?Zd(r,"px"):"auto"}function Qd(e,t,n,r,o){var i=function(e,t,n,r){var o=e.getConfig().imageResize||{},i=o.resizeUnit,a=o.checkImageSize,s=Jd(t,i,r),u=Jd(n,i,r);if(null==s||null==u)return e.alert("px"===i?"图片宽高只能使用 px 单位":"图片宽高只能使用 % 单位","error"),null;var l=null==a?void 0:a({width:s,height:u,rawWidth:t,rawHeight:n,source:r});return"string"==typeof l?(e.alert(l,"error"),null):a&&!0!==l?null:{width:s,height:u}}(e,n,r,o);if(null==i)return!1;var a,s=t.style,l=void 0===s?{}:s;try{a=Ei.findPath(e,t)}catch(e){a=void 0}var c={style:u(u({},l),i)};return null!=a?(Pn.Transforms.setNodes(e,c,{at:a}),!0):null!=e.selection&&(Pn.Transforms.setNodes(e,c,{at:e.selection,match:function(e){return Ei.checkNodeType(e,"image")}}),!0)}function ef(){return Md("w-e-insert-image")}var tf=function(){function e(){this.title=Ks("image.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=ef(),this.heightInputId=ef(),this.buttonId=ef()}return e.prototype.getSelectedImageNode=function(e){return Ei.getSelectedNodeByType(e,"image")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedImageNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedImageNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=t.widthInputId,r=t.heightInputId,o=t.buttonId,i=f(iu(Ks("image.width"),n,"auto"),2),a=i[0],s=zr(i[1]),u=f(iu(Ks("image.height"),r,"auto"),2),l=u[0],c=zr(u[1]),d=f(au(o,Ks("image.ok")),1)[0],p=this.getSelectedImageNode(e);if(null==this.$content){var h=zr("<div></div>");h.on("click","#".concat(o),function(t){t.preventDefault();var o=h.find("#".concat(n)).val().trim(),i=h.find("#".concat(r)).val().trim();e.restoreSelection(),Qd(e,p,o,i,"modal")&&e.hidePanelOrModal()}),this.$content=h}var g=this.$content;if(g.empty(),g.append(a),g.append(l),g.append(d),null==p)return g[0];var v=p.style,m=void 0===v?{}:v,y=m.width,b=void 0===y?"auto":y,E=m.height,w=void 0===E?"auto":E;return s.val(b),c.val(w),setTimeout(function(){s.focus()}),g[0]},e}();function nf(){return Md("w-e-insert-image")}var rf=function(){function e(){this.title=Ks("image.netImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=nf(),this.altInputId=nf(),this.hrefInputId=nf(),this.buttonId=nf()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return Hd(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.altInputId,i=n.hrefInputId,a=n.buttonId,s=f(iu(Ks("image.src"),r),2),u=s[0],l=zr(s[1]),c=f(iu(Ks("image.desc"),o),2),d=c[0],p=zr(c[1]),h=f(iu(Ks("image.link"),i),2),g=h[0],v=zr(h[1]),m=f(au(a,Ks("common.ok")),1)[0];if(null==this.$content){var y=zr("<div></div>");y.on("click","#".concat(a),function(n){n.preventDefault();var a=y.find("#".concat(r)).val().trim(),s=y.find("#".concat(o)).val().trim(),u=y.find("#".concat(i)).val().trim();t.insertImage(e,a,s,u),e.hidePanelOrModal()}),this.$content=y}var b=this.$content;return b.empty(),b.append(u),b.append(d),b.append(g),b.append(m),l.val(""),p.val(""),v.val(""),setTimeout(function(){l.focus()}),b[0]},e.prototype.insertImage=function(e,t,n,r){void 0===n&&(n=""),void 0===r&&(r=""),t&&(e.restoreSelection(),this.isDisabled(e)||Ud(e,t,n,r))},e}(),of=function(){function e(){this.title=Ks("image.preview"),this.iconSvg=Kl,this.tag="button"}return e.prototype.getValue=function(e){var t=Ei.getSelectedNodeByType(e,"image");return t&&t.src||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!this.getValue(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("Preview image failed, image.src is '".concat(t,"'"));window.open(t,"_blank")}},e}(),af=function(){function e(){this.title=Ks("image.viewLink"),this.iconSvg=Kl,this.tag="button"}return e.prototype.getValue=function(e){var t=Ei.getSelectedNodeByType(e,"image");return t&&t.href||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!this.getValue(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View image link failed, image.href is '".concat(t,"'"));window.open(t,"_blank")}},e}(),sf=function(){function e(){this.tag="button"}return e.prototype.getTitle=function(e){return Xd(e,this.value).label},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.getSelectedNode=function(e){return Ei.getSelectedNodeByType(e,"image")},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedNode(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=this.getSelectedNode(e);if(null!=n)if(Qd(e,n,Xd(e,this.value).value,"","preset")){var r=Ei.getHoverbar(e);r&&r.hideAndClean()}}},e}(),uf=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title="30%",t.value="30%",t}return s(t,e),t}(sf),lf=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title="50%",t.value="50%",t}return s(t,e),t}(sf),cf=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title="100%",t.value="100%",t}return s(t,e),t}(sf),df={onInsertedImage:function(e){},onUpdatedImage:function(e){},checkImage:function(e,t,n){return!0},parseImageSrc:function(e){return e}};function ff(e,t){var n=Ei.findKey(e,t).id;return"w-e-image-container-".concat(n)}function pf(e,t,n,r){var o=zr("body"),i=ff(e,t),a=r.width,s=r.height,l=0,c=0,d=0,f=0,p=!1,h=null;var g=vu(function(e){e.preventDefault();var t=e.clientX,n=c+(p?l-t:t-l),r=d*(n/c);n>f-6||null!=h&&(n<=15||r<=15||(h.css("width","".concat(n,"px")),h.css("height","".concat(r,"px"))))},100);function v(n){if(o.off("mousemove",g),null!=h){var r=h.width().toFixed(2),i=h.height().toFixed(2),a={style:u(u({},t.style),{width:"".concat(r,"px"),height:"".concat(i,"px")})};Pn.Transforms.setNodes(e,a,{at:Ei.findPath(e,t)}),o.off("mouseup",v)}}function m(t,n){h=function(){var e=zr("#".concat(i));if(0===e.length)throw new Error("Cannot find image container elem");return e}(),l=t,f=n;var r=h.find("img");if(0===r.length)throw new Error("Cannot find image elem");c=r.width(),d=r.height(),o.on("mousemove",g),o.on("mouseup",v);var a=Ei.getHoverbar(e);a&&a.hideAndClean()}var y={};return a&&(y.width=a),s&&(y.height=s),y.boxShadow="0 0 0 1px #B4D5FF",wl("div",{id:i,style:y,className:"w-e-image-container w-e-selected-image-container",on:{mousedown:function(n){var r=zr(n.target);if(r.hasClass("w-e-image-dragger")){n.preventDefault(),(r.hasClass("left-top")||r.hasClass("left-bottom"))&&(p=!0);var o=Ei.getParentNode(e,t);if(null!=o){var i=Ei.toDOMNode(e,o),a=i.getBoundingClientRect?i.getBoundingClientRect():{width:0},s=window.getComputedStyle(i),u=parseFloat(s.paddingLeft),l=parseFloat(s.paddingRight),c=parseFloat(s.borderLeftWidth),d=parseFloat(s.borderRightWidth);m(n.clientX,a.width-u-l-c-d)}}}}},n,wl("div",{className:"w-e-image-dragger left-top"}),wl("div",{className:"w-e-image-dragger right-top"}),wl("div",{className:"w-e-image-dragger left-bottom"}),wl("div",{className:"w-e-image-dragger right-bottom"}))}var hf={type:"image",renderElem:function(e,t,n){var r=e,o=r.src,i=r.alt,a=void 0===i?"":i,s=r.href,u=void 0===s?"":s,l=r.style,c=void 0===l?{}:l,d=c.width,f=void 0===d?"":d,p=c.height,h=void 0===p?"":p,g=Ei.isNodeSelected(n,e),v={maxWidth:"100%"};f&&(v.width="100%"),h&&(v.height="100%");var m=wl("img",{style:v,src:o,alt:a,"data-href":u}),y=u?wl("a",{href:u,target:"_blank"},m):m,b=n.isDisabled();return g&&!b?pf(n,e,y,{width:f,height:h}):function(e,t,n,r){var o=r.width,i=r.height,a={};return o&&(a.width=o),i&&(a.height=i),wl("div",{id:ff(e,t),style:a,className:"w-e-image-container"},n)}(n,e,y,{width:f,height:h})}},gf={renderElems:[hf],elemsToHtml:[_d],parseElemsHtml:[{selector:"img:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=zr(e),o=r.attr("data-href")||"",i=r.attr("width")||"",a=r.attr("height")||"",s=nc(r,"width")||r.attr("data-w-e-style-width")||i,u=nc(r,"height")||r.attr("data-w-e-style-height")||a;return o=decodeURIComponent(o),{type:"image",src:r.attr("src")||"",alt:r.attr("alt")||"",href:o,style:{width:s,height:u},width:i,height:a,children:[{text:""}]}}}],menus:[{key:"insertImage",factory:function(){return new rf},config:df},{key:"deleteImage",factory:function(){return new Ld}},{key:"editImage",factory:function(){return new Wd},config:df},{key:"previewImage",factory:function(){return new of}},{key:"viewImageLink",factory:function(){return new af}},{key:"imageWidth30",factory:function(){return new uf}},{key:"imageWidth50",factory:function(){return new lf}},{key:"imageWidth100",factory:function(){return new cf}},{key:"editorImageSizeMenu",factory:function(){return new tf}}],editorPlugin:function(e){var t=e.isInline,n=e.isVoid,r=e;return r.isInline=function(e){return"image"===e.type||t(e)},r.isVoid=function(e){return"image"===e.type||n(e)},r}};function vf(e){if(!Pn.Element.isElement(e))return!1;var t=e.type;return"paragraph"===t||!("string"!=typeof t||!t.startsWith("header"))}var mf=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){var t=f(Pn.Editor.nodes(e,{match:function(e){return!!e.indent},universal:!0}),1),n=t[0];return null==n?"":f(n,1)[0].indent||""},e.prototype.isActive=function(e){return!1},e.prototype.getMatchNode=function(e){var t=f(Pn.Editor.nodes(e,{match:vf,universal:!0,mode:"highest"}),1)[0];return null==t?null:t[0]},e}(),yf=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("indent.decrease"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m256-512v384l-256-192z"></path></svg>',t}return s(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!t.indent},t.prototype.exec=function(e,t){Pn.Transforms.setNodes(e,{indent:null},{match:vf,mode:"highest"})},t}(mf),bf=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("indent.increase"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',t.DEFAULT_INDENT_VALUE="2em",t}return s(t,e),t.prototype.isDisabled=function(e){var t=this.getMatchNode(e);return null==t||!!t.indent},t.prototype.getIndentValue=function(e){var t=this.getMatchNode(e);if(!t)return this.DEFAULT_INDENT_VALUE;var n=t.children.filter(Pn.Text.isText)[0];if(!n||!n.fontSize)return this.DEFAULT_INDENT_VALUE;var r=n.fontSize,o=parseInt(n.fontSize,10),i=r.replace("".concat(o),"");return"".concat(2*o).concat(i)},t.prototype.exec=function(e,t){var n=this.getIndentValue(e);Pn.Transforms.setNodes(e,{indent:n},{match:vf,mode:"highest"})},t}(mf);var Ef={renderStyle:function(e,t,n){if(!Pn.Element.isElement(e))return t;if(!vf(e))return t;var r=e.indent,o=t;return r&&("class"===Pc(n)?_c(o,"indent",r,n,"render",{textIndent:r}):Ac(o,{textIndent:r})),o},styleToHtml:function(e,t,n){if(!Pn.Element.isElement(e))return t;if(!vf(e))return t;var r=e.indent;if(!r)return t;var o=zr(t);return"class"===Pc(n)?Rc(o,"indent",r,n,"toHtml",function(){o.css("text-indent",r)}):o.css("text-indent",r),ec(o)},preParseHtml:[{selector:"p,h1,h2,h3,h4,h5",preParseHtml:function(e){var t=zr(e),n=nc(t,"padding-left");return/^[1-9]\d*em$/.test(n)&&t.css("text-indent","2em"),/^[1-9]\d*px$/.test(n)&&parseInt(n,10)%32==0&&t.css("text-indent","2em"),t[0]}}],parseStyleHtml:function(e,t,n){var r=zr(e);if(!Pn.Element.isElement(t))return t;if(!vf(t))return t;var o=t,i=nc(r,"text-indent")||Lc(r,"indent",n),a=parseInt(i,10);return i&&a>0&&(o.indent=i),o},menus:[{key:"indent",factory:function(){return new bf}},{key:"delIndent",factory:function(){return new yf}}]},wf=function(){function e(){this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||!!Ei.getSelectedElems(e).some(function(t){var n=t.type;return!(!Pn.Editor.isVoid(e,t)||!Pn.Editor.isBlock(e,t))||!!["pre","code"].includes(n)})},e}(),Cf=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("justify.center"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return s(t,e),t.prototype.exec=function(e,t){Pn.Transforms.setNodes(e,{textAlign:"center"},{match:function(t){return Pn.Element.isElement(t)&&!e.isInline(t)}})},t}(wf),Df=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("justify.justify"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>',t}return s(t,e),t.prototype.exec=function(e,t){Pn.Transforms.setNodes(e,{textAlign:"justify"},{match:function(t){return Pn.Element.isElement(t)&&!e.isInline(t)}})},t}(wf),Af=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("justify.left"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return s(t,e),t.prototype.exec=function(e,t){Pn.Transforms.setNodes(e,{textAlign:"left"},{match:function(t){return Pn.Element.isElement(t)&&!e.isInline(t)}})},t}(wf),Sf=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("justify.right"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',t}return s(t,e),t.prototype.exec=function(e,t){Pn.Transforms.setNodes(e,{textAlign:"right"},{match:function(t){return Pn.Element.isElement(t)&&!e.isInline(t)}})},t}(wf);var xf={renderStyle:function(e,t,n){if(!Pn.Element.isElement(e))return t;var r=e.textAlign,o=t;return r&&("class"===Pc(n)?_c(o,"textAlign",r,n,"render",{textAlign:r}):Ac(o,{textAlign:r})),o},styleToHtml:function(e,t,n){if(!Pn.Element.isElement(e))return t;var r=e.textAlign;if(!r)return t;var o=zr(t);return"class"===Pc(n)?Rc(o,"textAlign",r,n,"toHtml",function(){o.css("text-align",r)}):o.css("text-align",r),ec(o)},parseStyleHtml:function(e,t,n){var r=zr(e);if(!Pn.Element.isElement(t))return t;var o=t,i=nc(r,"text-align")||Lc(r,"textAlign",n);return i&&(o.textAlign=i),o},menus:[{key:"justifyLeft",factory:function(){return new Af}},{key:"justifyRight",factory:function(){return new Sf}},{key:"justifyCenter",factory:function(){return new Cf}},{key:"justifyJustify",factory:function(){return new Df}}]},Tf=function(){function e(){this.title=Ks("lineHeight.title"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M964 788a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526zM198.93 144.306c6.668-5.798 16.774-5.094 22.573 1.574l122.26 140.582a16 16 0 0 1 3.927 10.5c0 8.836-7.164 16-16 16h-61.8a8 8 0 0 0-8 8v390.077h69.819a16 16 0 0 1 10.502 3.928c6.666 5.8 7.37 15.906 1.57 22.573L221.476 878.123a16 16 0 0 1-1.57 1.57c-6.668 5.8-16.774 5.097-22.574-1.57L75.051 737.538a16 16 0 0 1-3.928-10.5c0-8.837 7.163-16 16-16h69.822V312.96H87.127a16 16 0 0 1-10.502-3.928c-6.666-5.8-7.37-15.906-1.57-22.573l122.303-140.582a16 16 0 0 1 1.572-1.572zM964 465a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z m0-323a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z"></path></svg>',this.tag="select",this.width=80}return e.prototype.getOptions=function(e){var t=[],n=e.getMenuConfig("lineHeight").lineHeightList,r=void 0===n?[]:n;t.push({text:Ks("lineHeight.default"),value:""}),r.forEach(function(e){t.push({text:e,value:e})});var o=this.getValue(e);return t.forEach(function(e){e.value===o?e.selected=!0:e.selected=void 0}),t},e.prototype.getMatchNode=function(e){var t=f(Pn.Editor.nodes(e,{match:function(e){var t=Ei.getNodeType(e);return!!t.startsWith("header")||!!["paragraph","blockquote","list-item"].includes(t)},universal:!0,mode:"highest"}),1),n=t[0];return null==n?null:n[0]},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.getMatchNode(e);return null==t?"":Pn.Element.isElement(t)&&t.lineHeight||""},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getMatchNode(e)},e.prototype.exec=function(e,t){Pn.Transforms.setNodes(e,{lineHeight:t.toString()},{mode:"highest"})},e}();var Nf={renderStyle:function(e,t,n){if(!Pn.Element.isElement(e))return t;var r=e.lineHeight,o=t;return r&&("class"===Pc(n)?_c(o,"lineHeight",r,n,"render",{lineHeight:r}):Ac(o,{lineHeight:r})),o},styleToHtml:function(e,t,n){if(!Pn.Element.isElement(e))return t;var r=e.lineHeight;if(!r)return t;var o=zr(t);return"class"===Pc(n)?Rc(o,"lineHeight",r,n,"toHtml",function(){o.css("line-height",r)}):o.css("line-height",r),ec(o)},parseStyleHtml:function(e,t,n){var r=zr(e);if(!Pn.Element.isElement(t))return t;var o=t,i=n.getMenuConfig("lineHeight").lineHeightList,a=void 0===i?[]:i,s=nc(r,"line-height")||Lc(r,"lineHeight",n);return s&&a.includes(s)&&(o.lineHeight=s),o},menus:[{key:"lineHeight",factory:function(){return new Tf},config:{lineHeightList:["1","1.15","1.5","2","2.5","3"]}}]};var Of={type:"link",elemToHtml:function(e,t){var n=e,r=n.url,o=n.target,i=void 0===o?"_blank":o;return'<a href="'.concat(r,'" target="').concat(i,'">').concat(t,"</a>")}};var Bf=/[\t\n\f\r]+/g,kf=/ /g;function Ff(e){var t=e.replace(Bf,"").trim();return t.indexOf(" ")<0?t:t.replace(kf,"%20")}function If(e,t,n,r){return l(this,void 0,void 0,function(){var o,i,a;return c(this,function(s){switch(s.label){case 0:return o=Ff(r),(i=t.getMenuConfig(e).checkLink)?[4,i(n,o)]:[3,2];case 1:if("string"==typeof(a=s.sent()))return t.alert(a,"error"),[2,!1];if(null==a)return[2,!1];s.label=2;case 2:return[2,!0]}})})}function Pf(e,t,n){return l(this,void 0,void 0,function(){var r,o;return c(this,function(i){switch(i.label){case 0:return r=Ff(n),(o=t.getMenuConfig(e).parseLinkUrl)?[4,o(r)]:[3,2];case 1:return[2,Ff(i.sent())];case 2:return[2,r]}})})}function Rf(e){return null==e.selection||!!Ei.getSelectedElems(e).some(function(t){var n=t.type;return!!e.isVoid(t)||!!["pre","code","link"].includes(n)})}function _f(e,t){return{type:"link",url:jd(e),children:t?[{text:t}]:[]}}function Lf(e,t,n){return l(this,void 0,void 0,function(){var r,o,i,a,s;return c(this,function(u){switch(u.label){case 0:return t||(t=n),e.restoreSelection(),Rf(e)?[2]:[4,If("insertLink",e,t,n)];case 1:return u.sent()?[4,Pf("insertLink",e,n)]:[2];case 2:if(!(r=u.sent()))return[2];if(null==(o=e.selection))return[2];if(Pn.Range.isCollapsed(o)){if((a=Ei.getLeftLengthOfMaxLength(e))<=0)return[2];e.insertText(" "),a<t.length+1&&(t=t.slice(0,a-1)),s=_f(r,t),Pn.Transforms.insertNodes(e,s),e.insertFragment([{text:" "}])}else if((i=Pn.Editor.string(e,o))!==t){if((a=Ei.getLeftLengthOfMaxLength(e))<=0)return[2];a<i.length-t.length&&(t=t.slice(0,a)),e.deleteFragment(),s=_f(r,t),Pn.Transforms.insertNodes(e,s)}else s=_f(r),Pn.Transforms.wrapNodes(e,s,{split:!0}),Pn.Transforms.collapse(e,{edge:"end"});return[2]}})})}function Mf(){return Md("w-e-update-link")}var jf=function(){function e(){this.title=Ks("link.edit"),this.iconSvg=ql,this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=Mf(),this.urlInputId=Mf(),this.buttonId=Mf()}return e.prototype.getSelectedLinkElem=function(e){var t=Ei.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.getModalPositionNode=function(e){return Ei.getSelectedNodeByType(e,"link")},e.prototype.getModalContentElem=function(e){var t=this,n=t.textInputId,r=t.urlInputId,o=t.buttonId,i=f(iu(Ks("link.text"),n),2),a=i[0],s=zr(i[1]),d=f(iu(Ks("link.url"),r),2),p=d[0],h=zr(d[1]),g=f(au(o,Ks("common.ok")),1)[0];if(null==this.$content){var v=zr("<div></div>");v.on("click","#".concat(o),function(t){t.preventDefault(),e.restoreSelection();var o=v.find("#".concat(n)).val(),i=v.find("#".concat(r)).val();!function(e,t,n){l(this,void 0,void 0,function(){var r,o,i,a,s;return c(this,function(l){switch(l.label){case 0:return[4,If("editLink",e,t,n)];case 1:return l.sent()?[4,Pf("editLink",e,n)]:[2];case 2:return(r=l.sent())?null==(o=Ei.getSelectedNodeByType(e,"link"))?[2]:(i=Ei.findPath(e,o),a=jd(r),t&&t!==Pn.Node.string(o)?(s=u(u({},o),{url:a,children:[{text:t}]}),Pn.Editor.withoutNormalizing(e,function(){Pn.Transforms.removeNodes(e,{at:i}),Pn.Transforms.insertNodes(e,s,{at:i})}),[2]):(Pn.Transforms.setNodes(e,{url:a},{at:i}),[2])):[2]}})})}(e,o,i),e.hidePanelOrModal()}),this.$content=v}var m=this.$content;m.empty(),m.append(a),m.append(p),m.append(g);var y=this.getSelectedLinkElem(e),b=y?Pn.Node.string(y):"",E=this.getValue(e);return s.val(b),h.val(E),setTimeout(function(){s.focus()}),m[0]},e}();function Hf(){return Md("w-e-insert-link")}var zf=function(){function e(){this.title=Ks("link.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M440.224 635.776a51.84 51.84 0 0 1-36.768-15.232c-95.136-95.136-95.136-249.92 0-345.056l192-192C641.536 37.408 702.816 12.032 768 12.032s126.432 25.376 172.544 71.456c95.136 95.136 95.136 249.92 0 345.056l-87.776 87.776a51.968 51.968 0 1 1-73.536-73.536l87.776-87.776a140.16 140.16 0 0 0 0-197.984c-26.432-26.432-61.6-40.992-99.008-40.992s-72.544 14.56-99.008 40.992l-192 192a140.16 140.16 0 0 0 0 197.984 51.968 51.968 0 0 1-36.768 88.768z"></path><path d="M256 1012a242.4 242.4 0 0 1-172.544-71.456c-95.136-95.136-95.136-249.92 0-345.056l87.776-87.776a51.968 51.968 0 1 1 73.536 73.536l-87.776 87.776a140.16 140.16 0 0 0 0 197.984c26.432 26.432 61.6 40.992 99.008 40.992s72.544-14.56 99.008-40.992l192-192a140.16 140.16 0 0 0 0-197.984 51.968 51.968 0 1 1 73.536-73.536c95.136 95.136 95.136 249.92 0 345.056l-192 192A242.4 242.4 0 0 1 256 1012z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=Hf(),this.urlInputId=Hf(),this.buttonId=Hf()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return Rf(e)},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=e.selection,n=this,r=n.textInputId,o=n.urlInputId,i=n.buttonId,a=f(iu(Ks("link.text"),r),2),s=a[0],u=zr(a[1]),l=f(iu(Ks("link.url"),o),2),c=l[0],d=zr(l[1]),p=f(au(i,Ks("common.ok")),1)[0];if(null==this.$content){var h=zr("<div></div>");h.on("click","#".concat(i),function(t){t.preventDefault();var n=h.find("#".concat(r)).val(),i=h.find("#".concat(o)).val();Lf(e,n,i),e.hidePanelOrModal()}),this.$content=h}var g=this.$content;if(g.empty(),g.append(s),g.append(c),g.append(p),null==t||Pn.Range.isCollapsed(t))u.val("");else{var v=Pn.Editor.string(e,t);u.val(v)}return d.val(""),setTimeout(function(){u.focus()}),g[0]},e}(),$f=function(){function e(){this.title=Ks("link.unLink"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M608.16328 811.815036c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.347563 89.347564c-118.525421 118.523421-311.38448 118.531421-429.919901 0-118.527421-118.529421-118.527421-311.39048 0-429.917901l89.349564-89.349563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.195613 79.195613c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.349563 89.347564c-56.143726 56.145726-56.143726 147.49928 0 203.645005 56.143726 56.143726 147.49928 56.145726 203.647005 0l89.347564-89.347563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.193613 79.195613z m-113.135447-520.429459c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.347564-89.347564c56.143726-56.149726 147.49928-56.145726 203.647006 0 56.143726 56.145726 56.143726 147.49928 0 203.645006l-89.349564 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.195613 79.195613c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.349564-89.349563c118.529421-118.529421 118.529421-311.38848 0-429.917901-118.531421-118.527421-311.38848-118.527421-429.919901 0l-89.347563 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.193613 79.195613z m469.653707 718.556492l45.253779-45.253779c18.745908-18.745908 18.745908-49.13776 0-67.881669L127.195629 14.062931c-18.745908-18.745908-49.13776-18.745908-67.881669 0L14.058181 59.31871c-18.745908 18.745908-18.745908 49.13776 0 67.881669l882.74169 882.74169c18.745908 18.743908 49.13776 18.743908 67.881669 0z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==Ei.getSelectedNodeByType(e,"link")},e.prototype.exec=function(e,t){this.isDisabled(e)||Pn.Transforms.unwrapNodes(e,{match:function(e){return Ei.checkNodeType(e,"link")}})},e}(),Uf=function(){function e(){this.title=Ks("link.view"),this.iconSvg=Kl,this.tag="button"}return e.prototype.getSelectedLinkElem=function(e){var t=Ei.getSelectedNodeByType(e,"link");return null==t?null:t},e.prototype.getValue=function(e){var t=this.getSelectedLinkElem(e);return t&&t.url||""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedLinkElem(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){if(!t||"string"!=typeof t)throw new Error("View link failed, link url is '".concat(t,"'"));window.open(t,"_blank")}},e}(),Vf={checkLink:function(e,t){return!0},parseLinkUrl:function(e){return e}},Wf={key:"insertLink",factory:function(){return new zf},config:Vf},Gf={key:"editLink",factory:function(){return new jf},config:Vf},qf={key:"unLink",factory:function(){return new $f}},Kf={key:"viewLink",factory:function(){return new Uf}};var Yf,Xf,Zf={selector:"a:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=zr(e);0===(t=t.filter(function(e){return!!Pn.Text.isText(e)||!!n.isInline(e)})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=t[0],i=Pn.Element.isElement(o)&&"image"===o.type&&o.href||"",a=r.find("img").attr("data-href")||"";return 1===t.length&&Pn.Element.isElement(o)&&"image"===o.type&&(i||a)?u(u({},o),{href:Ff(r.attr("href")||"")}):{type:"link",url:Ff(r.attr("href")||""),target:r.attr("target")||"",children:t}}};var Jf=v(function(){if(Xf)return Yf;Xf=1,Yf=function(r){if("string"!=typeof r)return!1;var o=r.match(e);if(!o)return!1;var i=o[1];if(!i)return!1;if(t.test(i)||n.test(i))return!0;return!1};var e=/^(?:\w+:)?\/\/(\S+)$/,t=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;return Yf}());var Qf={type:"link",renderElem:function(e,t,n){var r=e,o=r.url,i=r.target;return wl("a",{href:o,target:void 0===i?"_blank":i},t)}},ep={renderElems:[Qf],elemsToHtml:[Of],parseElemsHtml:[Zf],menus:[Wf,Gf,qf,Kf],editorPlugin:function(e){var t=e.isInline,n=e.insertData,r=e.normalizeNode,o=e;return o.isInline=function(e){return"link"===e.type||t(e)},o.insertData=function(e){var t=e.getData("text/plain");if(Jf(t)){if(/<img[^>]+>/.test(e.getData("text/html")))n(e);else if(!Rf(o)){var r=o.selection;if(null!=r){var i=Pn.Editor.string(o,r);Lf(o,i,t)}}}else n(e)},o.normalizeNode=function(e){var t=f(e,2),n=t[0],i=t[1];return"link"!==Ei.getNodeType(n)?r([n,i]):""===Pn.Node.string(n)?Pn.Transforms.removeNodes(o,{at:i}):r([n,i])},o}};var tp={selector:"p:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=zr(e);return 0===(t=t.filter(function(e){return!!Pn.Text.isText(e)||!!n.isInline(e)})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),{type:"paragraph",children:t}}};function np(e){var t=f(Pn.Editor.nodes(e,{match:function(t){return e.children[0]===t},mode:"highest"}),1),n=t[0];if(null==n)return!1;var r=n[0];if(!Pn.Element.isElement(r))return!1;if("paragraph"===r.type)return!1;if(""!==Pn.Node.string(r))return!1;var o=r.children,i=void 0===o?[]:o;return!!Pn.Text.isText(i[0])&&(Pn.Transforms.setNodes(e,{type:"paragraph"}),!0)}var rp={type:"paragraph",renderElem:function(e,t,n){return wl("p",null,t)}},op={renderElems:[rp],elemsToHtml:[{type:"paragraph",elemToHtml:function(e,t){return""===t?"<p><br></p>":"<p>".concat(t,"</p>")}}],parseElemsHtml:[tp],editorPlugin:function(e){var t=e.deleteBackward,n=e.deleteForward,r=e;return r.deleteBackward=function(e){np(r)||t(e)},r.deleteForward=function(e){np(r)||n(e)},r}};function ip(e,t){if(null==e.selection)return!0;var n=f(Pn.Editor.nodes(e,{match:function(t){return"pre"===Ei.getNodeType(t)||!(!Pn.Element.isElement(t)||!Pn.Editor.isVoid(e,t))},universal:!0}),1);return!!n[0]}function ap(e,t){Object.keys(t).forEach(function(t){"text"!==t&&Pn.Editor.removeMark(e,t)})}var sp=function(){function e(){this.marksNeedToRemove=[],this.tag="button"}return e.prototype.getValue=function(e){var t=this.mark,n=Pn.Editor.marks(e);if(n)return n[t];var r=f(Pn.Editor.nodes(e,{match:function(e){return!0===e[t]}}),1);return!!r[0]},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){return ip(e,this.mark)},e.prototype.exec=function(e,t){var n=this.mark,r=this.marksNeedToRemove;t?e.removeMark(n):(e.addMark(n,!0),r&&r.forEach(function(t){return e.removeMark(t)}))},e}(),up=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.mark="bold",t.title=Ks("textStyle.bold"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M707.872 484.64A254.88 254.88 0 0 0 768 320c0-141.152-114.848-256-256-256H192v896h384c141.152 0 256-114.848 256-256a256.096 256.096 0 0 0-124.128-219.36zM384 192h101.504c55.968 0 101.504 57.408 101.504 128s-45.536 128-101.504 128H384V192z m159.008 640H384v-256h159.008c58.464 0 106.016 57.408 106.016 128s-47.552 128-106.016 128z"></path></svg>',t.hotkey="mod+b",t}return s(t,e),t}(sp),lp=function(){function e(){this.title=Ks("textStyle.clear"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M969.382408 288.738615l-319.401123-270.852152a67.074236 67.074236 0 0 0-96.459139 5.74922l-505.931379 574.922021a68.35184 68.35184 0 0 0-17.886463 47.910169 74.101061 74.101061 0 0 0 24.274486 47.910168l156.50655 132.232065h373.060512L975.131628 383.281347a67.074236 67.074236 0 0 0-5.74922-96.459139z m-440.134747 433.746725H264.144729l-90.071117-78.572676c-5.74922-5.74922-12.137243-12.137243-12.137243-17.886463a36.411728 36.411728 0 0 1 5.749221-24.274485l210.804741-240.828447 265.102932 228.691204z m-439.495945 180.781036h843.218964a60.047411 60.047411 0 1 1 0 120.733624H89.751716a60.047411 60.047411 0 1 1 0-120.733624z m0 0"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return ip(e)},e.prototype.exec=function(e,t){var n,r,o=Pn.Editor.nodes(e,{match:function(e){return Pn.Text.isText(e)},universal:!0});try{for(var i=d(o),a=i.next();!a.done;a=i.next()){ap(e,a.value[0])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e}(),cp=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.mark="code",t.title=Ks("textStyle.code"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M576 736l96 96 320-320L672 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224z"></path></svg>',t.hotkey="mod+e",t}return s(t,e),t}(sp),dp=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.mark="emphasisDot",t.title=Ks("textStyle.emphasisDot"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M256 128h128v512H256zM448 128h128v512H448zM640 128h128v512H640z"></path><path d="M320 832m-64 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0zM512 832m-64 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0zM704 832m-64 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0z"></path></svg>',t.hotkey="",t}return s(t,e),t}(sp),fp=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.mark="italic",t.title=Ks("textStyle.italic"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M896 64v64h-128L448 896h128v64H128v-64h128L576 128h-128V64z"></path></svg>',t.hotkey="mod+i",t}return s(t,e),t}(sp),pp=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.mark="sub",t.marksNeedToRemove=["sup"],t.title=Ks("textStyle.sub"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 910.016v50.016h128v64h-192v-146.016l128-60V768h-128v-64h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return s(t,e),t}(sp),hp=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.mark="sup",t.marksNeedToRemove=["sub"],t.title=Ks("textStyle.sup"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M768 206.016v50.016h128v64h-192V174.016l128-60V64h-128V0h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>',t.hotkey="",t}return s(t,e),t}(sp),gp=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.mark="through",t.title=Ks("textStyle.through"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M1024 512v64h-234.496c27.52 38.496 42.496 82.688 42.496 128 0 70.88-36.672 139.04-100.576 186.976C672.064 935.488 594.144 960 512 960s-160.064-24.512-219.424-69.024C228.64 843.04 192 774.88 192 704h128c0 69.376 87.936 128 192 128s192-58.624 192-128-87.936-128-192-128H0v-64h299.52a385.984 385.984 0 0 1-6.944-5.024C228.64 459.04 192 390.88 192 320s36.672-139.04 100.576-186.976C351.936 88.512 429.856 64 512 64s160.064 24.512 219.424 69.024C795.328 180.96 832 249.12 832 320h-128c0-69.376-87.936-128-192-128s-192 58.624-192 128 87.936 128 192 128c78.976 0 154.048 22.688 212.48 64H1024z"></path></svg>',t.hotkey="mod+shift+x",t}return s(t,e),t}(sp),vp=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.mark="underline",t.title=Ks("textStyle.underline"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 64l128 0 0 416c0 159.072-143.264 288-320 288s-320-128.928-320-288l0-416 128 0 0 416c0 40.16 18.24 78.688 51.36 108.512 36.896 33.216 86.848 51.488 140.64 51.488s103.744-18.304 140.64-51.488c33.12-29.792 51.36-68.352 51.36-108.512l0-416zM192 832l640 0 0 128-640 0z"></path></svg>',t.hotkey="mod+u",t}return s(t,e),t}(sp),mp=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.mark="wavyUnderline",t.title=Ks("textStyle.wavyUnderline"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 704c64-96 128-96 192 0s128 96 192 0 128-96 192 0 128 96 192 0 128-96 192 0v128c-64 96-128 96-192 0s-128-96-192 0-128 96-192 0-128-96-192 0-128 96-192 0V704z"></path></svg>',t.hotkey="",t}return s(t,e),t}(sp),yp={key:"bold",factory:function(){return new up}},bp={key:"code",factory:function(){return new cp}},Ep={key:"italic",factory:function(){return new fp}},wp={key:"through",factory:function(){return new gp}},Cp={key:"underline",factory:function(){return new vp}},Dp={key:"wavyUnderline",factory:function(){return new mp}},Ap={key:"emphasisDot",factory:function(){return new dp}},Sp={key:"sup",factory:function(){return new hp}},xp={key:"sub",factory:function(){return new pp}},Tp={key:"clearStyle",factory:function(){return new lp}},Np="0.15em",Op="0.3em",Bp="0.8em",kp="w-e-text-style-underline-offset",Fp="w-e-text-style-wavy-underline",Ip="w-e-text-style-wavy-underline-with-emphasis",Pp="w-e-text-style-emphasis-dot",Rp="w-e-text-style-emphasis-dot-with-wavy",_p={textDecorationLine:"underline",textDecorationStyle:"wavy",textUnderlineOffset:Op},Lp="text-decoration-line: underline; text-decoration-style: wavy; text-underline-offset: ".concat(Op,";"),Mp=u(u({},_p),{textUnderlineOffset:Bp}),jp="text-decoration-line: underline; text-decoration-style: wavy; text-underline-offset: ".concat(Bp,";"),Hp={textEmphasisStyle:"filled dot",textEmphasisPosition:"under left"},zp=u(u({},Hp),{lineHeight:"2"}),$p="text-emphasis-style: filled dot; text-emphasis-position: under left; line-height: ".concat("2",";");function Up(e,t){return 0!==e.length&&e[0].matches(t)}function Vp(e){return(e.attr("style")||"").split(";").reduce(function(e,t){var n=t.indexOf(":");if(-1===n)return e;var r=t.slice(0,n).trim().toLowerCase(),o=t.slice(n+1).trim().toLowerCase();return r&&o&&e.push([r,o]),e},[])}function Wp(e,t){return(e.attr("class")||"").split(/\s+/).includes(t)}function Gp(e){var t=Up(e,"u"),n=Wp(e,Fp),r=t?"underline":"",o="solid",i=!1,a=!1;Vp(e).forEach(function(e){var t=f(e,2),n=t[0],s=t[1];if("text-decoration"===n){var u=s.split(/\s+/);r=u.includes("none")?"none":u.filter(function(e){return["underline","overline","line-through"].includes(e)}).join(" "),o=u.find(function(e){return["solid","double","dotted","dashed","wavy"].includes(e)})||"solid",i=!0,a=!0}"text-decoration-line"===n&&(r=s,i=!0),"text-decoration-style"===n&&(o=s,a=!0)});var s=r.split(/\s+/).includes("underline"),u=!!t||void 0,l=!!n||void 0;return i?s?"wavy"===o?l=!0:(u=!0,l=!1):(u=!1,l=!1):a&&("wavy"===o?(u=!t&&u,l=!0):l=!1),{line:r,underline:u,wavyUnderline:l}}function qp(e,t,n){var r=t,o=e,i=o.bold,a=o.italic,s=o.underline,u=o.wavyUnderline,l=o.emphasisDot,c=o.code,d=o.through,f=o.sub,p=o.sup,h=Pc(n);if(i&&(r="<strong>".concat(r,"</strong>")),c&&(r="<code>".concat(r,"</code>")),a&&(r="<em>".concat(r,"</em>")),s)if(u||l){var g="class"===h?' class="'.concat(kp,'"'):' style="text-underline-offset: '.concat(Np,';"');r="<u".concat(g,">").concat(r,"</u>")}else r="<u>".concat(r,"</u>");if(u){var v="class"===h?' class="'.concat(Fp).concat(l?" ".concat(Ip):"",'"'):' style="'.concat(l?jp:Lp,'"');r="<span".concat(v,">").concat(r,"</span>")}if(l){var m="class"===h?' class="'.concat(Pp).concat(u?" ".concat(Rp):"",'"'):' style="'.concat(u?$p:"text-emphasis-style: filled dot; text-emphasis-position: under left;",'"');r="<span".concat(m,">").concat(r,"</span>")}return d&&(r="<s>".concat(r,"</s>")),f&&(r="<sub>".concat(r,"</sub>")),p&&(r="<sup>".concat(r,"</sup>")),r}var Kp={renderStyle:function(e,t,n){var r=e,o=r.bold,i=r.italic,a=r.underline,s=r.wavyUnderline,u=r.emphasisDot,l=r.code,c=r.through,d=r.sub,f=r.sup,p=t,h=Pc(n);return o&&(p=wl("strong",null,p)),l&&(p=wl("code",null,p)),i&&(p=wl("em",null,p)),a&&(s||u?(p=wl("u",null,p),"class"===h?Sc(p,kp):Ac(p,{textUnderlineOffset:Np})):p=wl("u",null,p)),s&&(p=wl("span",null,p),"class"===h?(Sc(p,Fp),u&&Sc(p,Ip)):Ac(p,u?Mp:_p)),u&&(p=wl("span",null,p),"class"===h?(Sc(p,Pp),s&&Sc(p,Rp)):Ac(p,s?zp:Hp)),c&&(p=wl("s",null,p)),d&&(p=wl("sub",null,p)),f&&(p=wl("sup",null,p)),p},menus:[yp,Cp,Ep,Dp,Ap,wp,bp,xp,Sp,Tp],styleToHtml:function(e,t,n){if(!Pn.Text.isText(e))return t;if(Ql(t))return qp(e,t,n);var r=zr(t),o=r.html();return o=qp(e,o,n),r.html(o),ec(r)},parseStyleHtml:function(e,t,n){var r=zr(e);if(!Pn.Text.isText(t))return t;var o=t;nc(r,"font-weight")?o.bold=function(e){var t=nc(e,"font-weight");if(!t)return!1;if("bold"===t||"bolder"===t)return!0;var n=Number(t);return!Number.isNaN(n)&&n>=600}(r):Up(r,"b,strong")&&(o.bold=!0),(Up(r,"i,em")||["italic","oblique"].includes(nc(r,"font-style")))&&(o.italic=!0);var i=Gp(r);void 0!==i.underline&&(o.underline=i.underline),void 0!==i.wavyUnderline&&(o.wavyUnderline=i.wavyUnderline);var a=function(e){var t="",n="",r=!1,o=!1;Vp(e).forEach(function(e){var i=f(e,2),a=i[0],s=i[1];"text-emphasis"===a&&(t=s,r=!0),"text-emphasis-style"===a&&(t=s,r=!0),"text-emphasis-position"===a&&(n=s,o=!0)});var i=t.split(/\s+/).filter(Boolean),a=n.split(/\s+/).includes("under"),s=i.includes("dot")&&!i.includes("open");return!(r&&!s)&&!(o&&!a)&&(!!(r&&o&&s&&a)||(r&&!o?!!Wp(e,Pp):!!Wp(e,Pp)||void 0))}(r);return void 0!==a&&(o.emphasisDot=a),(Up(r,"s,strike")||function(e,t){return Gp(e).line.split(/\s+/).includes(t.toLowerCase())}(r,"line-through"))&&(o.through=!0),(Up(r,"sub")||"sub"===nc(r,"vertical-align"))&&(o.sub=!0),(Up(r,"sup")||"super"===nc(r,"vertical-align"))&&(o.sup=!0),Up(r,"code")&&(o.code=!0),o}};var Yp={type:"todo",elemToHtml:function(e,t){var n=e.checked;return'<div data-w-e-type="todo"><input type="checkbox" disabled '.concat(n?"checked":"",">").concat(t,"</div>")}},Xp=function(){function e(){this.title=Ks("todo.todo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M278.755556 403.911111l-79.644445 79.644445L455.111111 739.555556l568.888889-568.888889-79.644444-79.644445L455.111111 580.266667l-176.355555-176.355556zM910.222222 910.222222H113.777778V113.777778h568.888889V0H113.777778C51.2 0 0 51.2 0 113.777778v796.444444c0 62.577778 51.2 113.777778 113.777778 113.777778h796.444444c62.577778 0 113.777778-51.2 113.777778-113.777778V455.111111h-113.777778v455.111111z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!!Ei.getSelectedNodeByType(e,"todo")},e.prototype.isDisabled=function(e){return null==e.selection||!!Ei.getSelectedElems(e).some(function(t){if(Pn.Editor.isVoid(e,t)&&Pn.Editor.isBlock(e,t))return!0;var n=t.type;return!!["pre","table","list-item"].includes(n)})},e.prototype.exec=function(e,t){var n=this.isActive(e);Pn.Transforms.setNodes(e,{type:n?"paragraph":"todo"})},e}();var Zp={selector:'div[data-w-e-type="todo"]',parseElemHtml:function(e,t,n){var r=zr(e);0===(t=t.filter(function(e){return!!Pn.Text.isText(e)||!!n.isInline(e)})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]);var o=!1;return null!=r.find('input[type="checkbox"]').attr("checked")&&(o=!0),{type:"todo",checked:o,children:t}}};var Jp={type:"todo",renderElem:function(e,t,n){var r=!1;return n.isDisabled()&&(r=!0),wl("div",{style:{margin:"5px 0"}},wl("span",{contentEditable:!1,style:{marginRight:"0.5em"}},wl("input",{type:"checkbox",checked:e.checked,disabled:r,on:{change:function(t){var r=Ei.findPath(n,e),o={checked:t.target.checked};Pn.Transforms.setNodes(n,o,{at:r})}}})),wl("span",null,t))}},Qp={renderElems:[Jp],elemsToHtml:[Yp],preParseHtml:[{selector:"ul.w-e-todo",preParseHtml:function(e){var t=zr(e).find("li"),n=zr('<div data-w-e-type="todo"></div>'),r=t.find("input[type]");return n.append(r),t.children()[0].remove(),n[0].innerHTML+=t[0].innerHTML,n[0]}}],parseElemsHtml:[Zp],menus:[{key:"todo",factory:function(){return new Xp}}],editorPlugin:function(e){var t=e.deleteBackward,n=e;return n.deleteBackward=function(n){var r=e.selection;if(r&&Pn.Range.isCollapsed(r)){var o=Ei.getSelectedNodeByType(e,"todo");if(o&&0===Pn.Node.string(o).length)return void Pn.Transforms.setNodes(e,{type:"paragraph"},{mode:"highest"})}t(n)},n}},eh=function(){function e(){this.title=Ks("undo.redo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0.00032 576a510.72 510.72 0 0 0 173.344 384l84.672-96A383.136 383.136 0 0 1 128.00032 576C128.00032 363.936 299.93632 192 512.00032 192c106.048 0 202.048 42.976 271.52 112.48L640.00032 448h384V64l-149.984 149.984A510.272 510.272 0 0 0 512.00032 64C229.21632 64 0.00032 293.216 0.00032 576z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.redo&&e.redo()},e}(),th=function(){function e(){this.title=Ks("undo.undo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M512 64A510.272 510.272 0 0 0 149.984 213.984L0.032 64v384h384L240.512 304.48A382.784 382.784 0 0 1 512.032 192c212.064 0 384 171.936 384 384 0 114.688-50.304 217.632-130.016 288l84.672 96a510.72 510.72 0 0 0 173.344-384c0-282.784-229.216-512-512-512z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection},e.prototype.exec=function(e,t){"function"==typeof e.undo&&e.undo()},e}(),nh=[Kp,jc,Zc,Ef,xf,Nf,gf,Vc,Gc,ep,vc,sc,Rd,op,Qp,Qc,{menus:[{key:"redo",factory:function(){return new eh}},{key:"undo",factory:function(){return new th}}]},td,zc];Gs("en",{highLightModule:{selectLang:"Language"}}),Gs("zh-CN",{highLightModule:{selectLang:"选择语言"}});var rh,oh={exports:{}};var ih=(rh||(rh=1,function(e){var t=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},o.util.type(t)){case"Object":if(i=o.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case"Array":return i=o.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,o){r[o]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var o=e.classList;if(o.contains(t))return!0;if(o.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=o.util.clone(o.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||o.languages)[e],a={};for(var s in i)if(i.hasOwnProperty(s)){if(s==t)for(var u in n)n.hasOwnProperty(u)&&(a[u]=n[u]);n.hasOwnProperty(s)||(a[s]=i[s])}var l=r[e];return r[e]=a,o.languages.DFS(o.languages,function(t,n){n===l&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i=i||{};var a=o.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var u=t[s],l=o.util.type(u);"Object"!==l||i[a(u)]?"Array"!==l||i[a(u)]||(i[a(u)]=!0,e(u,n,s,i)):(i[a(u)]=!0,e(u,n,null,i))}}},plugins:{},highlightAll:function(e,t){o.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),o.hooks.run("before-all-elements-highlight",r);for(var i,a=0;i=r.elements[a++];)o.highlightElement(i,!0===t,r.callback)},highlightElement:function(t,n,r){var i=o.util.getLanguage(t),a=o.languages[i];o.util.setLanguage(t,i);var s=t.parentElement;s&&"pre"===s.nodeName.toLowerCase()&&o.util.setLanguage(s,i);var u={element:t,language:i,grammar:a,code:t.textContent};function l(e){u.highlightedCode=e,o.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,o.hooks.run("after-highlight",u),o.hooks.run("complete",u),r&&r.call(u.element)}if(o.hooks.run("before-sanity-check",u),(s=u.element.parentElement)&&"pre"===s.nodeName.toLowerCase()&&!s.hasAttribute("tabindex")&&s.setAttribute("tabindex","0"),!u.code)return o.hooks.run("complete",u),void(r&&r.call(u.element));if(o.hooks.run("before-highlight",u),u.grammar)if(n&&e.Worker){var c=new Worker(o.filename);c.onmessage=function(e){l(e.data)},c.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else l(o.highlight(u.code,u.grammar,u.language));else l(o.util.encode(u.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(o.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=o.tokenize(r.code,r.grammar),o.hooks.run("after-tokenize",r),i.stringify(o.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new u;return l(o,o.head,e),s(e,o,t,o.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=o.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=o.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function a(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function s(e,t,n,r,u,d){for(var f in n)if(n.hasOwnProperty(f)&&n[f]){var p=n[f];p=Array.isArray(p)?p:[p];for(var h=0;h<p.length;++h){if(d&&d.cause==f+","+h)return;var g=p[h],v=g.inside,m=!!g.lookbehind,y=!!g.greedy,b=g.alias;if(y&&!g.pattern.global){var E=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,E+"g")}for(var w=g.pattern||g,C=r.next,D=u;C!==t.tail&&!(d&&D>=d.reach);D+=C.value.length,C=C.next){var A=C.value;if(t.length>e.length)return;if(!(A instanceof i)){var S,x=1;if(y){if(!(S=a(w,D,e,m))||S.index>=e.length)break;var T=S.index,N=S.index+S[0].length,O=D;for(O+=C.value.length;T>=O;)O+=(C=C.next).value.length;if(D=O-=C.value.length,C.value instanceof i)continue;for(var B=C;B!==t.tail&&(O<N||"string"==typeof B.value);B=B.next)x++,O+=B.value.length;x--,A=e.slice(D,O),S.index-=D}else if(!(S=a(w,0,A,m)))continue;T=S.index;var k=S[0],F=A.slice(0,T),I=A.slice(T+k.length),P=D+A.length;d&&P>d.reach&&(d.reach=P);var R=C.prev;if(F&&(R=l(t,R,F),D+=F.length),c(t,R,x),C=l(t,R,new i(f,v?o.tokenize(k,v):k,b,k)),I&&l(t,C,I),x>1){var _={cause:f+","+h,reach:P};s(e,t,n,C.prev,D,_),d&&_.reach>d.reach&&(d.reach=_.reach)}}}}}}function u(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function c(e,t,n){for(var r=t.next,o=0;o<n&&r!==e.tail;o++)r=r.next;t.next=r,r.prev=t,e.length-=o}if(e.Prism=o,i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach(function(t){r+=e(t,n)}),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},a=t.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(i.classes,a):i.classes.push(a)),o.hooks.run("wrap",i);var s="";for(var u in i.attributes)s+=" "+u+'="'+(i.attributes[u]||"").replace(/"/g,"&quot;")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+s+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(o.disableWorkerMessageHandler||e.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,a=n.immediateClose;e.postMessage(o.highlight(i,o.languages[r],r)),a&&e.close()},!1),o):o;var d=o.util.currentScript();function f(){o.manual||o.highlightAll()}if(d&&(o.filename=d.src,d.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});
4
+ * Takes a string with placeholder variables like `%{smart_count} file selected`
5
+ * and replaces it with values from options `{smart_count: 5}`
6
+ *
7
+ * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
8
+ * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
9
+ *
10
+ * @param {string} phrase that needs interpolation, with placeholders
11
+ * @param {object} options with values that will be used to replace placeholders
12
+ * @returns {any[]} interpolated
13
+ */
14
+ function s(e,t){let n=/\$/g,r=[e];if(t==null)return r;for(let e of Object.keys(t))if(e!==`_`){let i=t[e];typeof i==`string`&&(i=n[Symbol.replace](i,`$$$$`)),r=o(r,RegExp(`%\\{${e}\\}`,`g`),i)}return r}var c=i(`apply`),l=class{constructor(e){Object.defineProperty(this,c,{value:u}),this.locale={strings:{},pluralize(e){return e===1?0:1}},Array.isArray(e)?e.forEach(n(this,c)[c],this):n(this,c)[c](e)}translate(e,t){return this.translateArray(e,t).join(``)}translateArray(e,t){if(!a(this.locale.strings,e))throw Error(`missing string: ${e}`);let n=this.locale.strings[e];if(typeof n==`object`){if(t&&t.smart_count!==void 0)return s(n[this.locale.pluralize(t.smart_count)],t);throw Error(`Attempted to use a string with plural forms, but no value was given for %{smart_count}`)}return s(n,t)}};function u(e){if(!(e!=null&&e.strings))return;let t=this.locale;this.locale=D(D({},t),{},{strings:D(D({},t.strings),e.strings)}),this.locale.pluralize=e.pluralize||t.pluralize}t.exports=l})),ie=c(((e,t)=>{t.exports=function(){var e={},t=e._fns={};e.emit=function(e,t,i,a,o,s,c){var l=n(e);l.length&&r(e,l,[t,i,a,o,s,c])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){function r(){n.apply(this,arguments),e.off(t,r)}this.on(t,r)},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],i=0,a=r?r.length:0;i<a;i++)r[i]!==t&&n.push(r[i]);n.length?this._fns[e]=n:delete this._fns[e]};function n(e){for(var n=t[e]?t[e]:[],r=e.indexOf(`:`),i=r===-1?[e]:[e.substring(0,r),e.substring(r+1)],a=Object.keys(t),o=0,s=a.length;o<s;o++){var c=a[o];if(c===`*`&&(n=n.concat(t[c])),i.length===2&&i[0]===c){n=n.concat(t[c]);break}}return n}function r(e,t,n){for(var r=0,i=t.length;r<i&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}return e}})),ae=c(((e,t)=>{var n=`Expected a function`,r=NaN,i=`[object Symbol]`,a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt,u=typeof global==`object`&&global&&global.Object===Object&&global,d=typeof self==`object`&&self&&self.Object===Object&&self,f=u||d||Function(`return this`)(),p=Object.prototype.toString,m=Math.max,h=Math.min,g=function(){return f.Date.now()};function _(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(n);t=S(t)||0,y(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?m(S(r.maxWait)||0,t):o,p=`trailing`in r?!!r.trailing:p);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function v(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?h(i,o-r):i}function x(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(x(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,p&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(g())}function D(){var e=g(),n=x(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return v(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return D.cancel=T,D.flush=E,D}function v(e,t,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(n);return y(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),_(e,t,{leading:i,maxWait:t,trailing:a})}function y(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function b(e){return!!e&&typeof e==`object`}function x(e){return typeof e==`symbol`||b(e)&&p.call(e)==i}function S(e){if(typeof e==`number`)return e;if(x(e))return r;if(y(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=y(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(a,``);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?r:+e}t.exports=v})),oe=c(((e,t)=>{O();function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var r=0;function i(e){return`__private_`+ r+++`_`+e}let a={version:`2.1.1`};var o=i(`publish`),s=class{constructor(){Object.defineProperty(this,o,{value:c}),this.state={},this.callbacks=[]}getState(){return this.state}setState(e){let t=D({},this.state),r=D(D({},this.state),e);this.state=r,n(this,o)[o](t,r,e)}subscribe(e){return this.callbacks.push(e),()=>{this.callbacks.splice(this.callbacks.indexOf(e),1)}}};function c(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach(e=>{e(...t)})}s.VERSION=a.version;function l(){return new s}t.exports=l})),se=c(((e,t)=>{function n(e){let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}t.exports=n})),ce=c(((e,t)=>{t.exports={md:`text/markdown`,markdown:`text/markdown`,mp4:`video/mp4`,mp3:`audio/mp3`,svg:`image/svg+xml`,jpg:`image/jpeg`,png:`image/png`,gif:`image/gif`,heic:`image/heic`,heif:`image/heif`,yaml:`text/yaml`,yml:`text/yaml`,csv:`text/csv`,tsv:`text/tab-separated-values`,tab:`text/tab-separated-values`,avi:`video/x-msvideo`,mks:`video/x-matroska`,mkv:`video/x-matroska`,mov:`video/quicktime`,dicom:`application/dicom`,doc:`application/msword`,docm:`application/vnd.ms-word.document.macroenabled.12`,docx:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,dot:`application/msword`,dotm:`application/vnd.ms-word.template.macroenabled.12`,dotx:`application/vnd.openxmlformats-officedocument.wordprocessingml.template`,xla:`application/vnd.ms-excel`,xlam:`application/vnd.ms-excel.addin.macroenabled.12`,xlc:`application/vnd.ms-excel`,xlf:`application/x-xliff+xml`,xlm:`application/vnd.ms-excel`,xls:`application/vnd.ms-excel`,xlsb:`application/vnd.ms-excel.sheet.binary.macroenabled.12`,xlsm:`application/vnd.ms-excel.sheet.macroenabled.12`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,xlt:`application/vnd.ms-excel`,xltm:`application/vnd.ms-excel.template.macroenabled.12`,xltx:`application/vnd.openxmlformats-officedocument.spreadsheetml.template`,xlw:`application/vnd.ms-excel`,txt:`text/plain`,text:`text/plain`,conf:`text/plain`,log:`text/plain`,pdf:`application/pdf`,zip:`application/zip`,"7z":`application/x-7z-compressed`,rar:`application/x-rar-compressed`,tar:`application/x-tar`,gz:`application/gzip`,dmg:`application/x-apple-diskimage`}})),le=c(((e,t)=>{let n=se(),r=ce();function i(e){var t;if(e.type)return e.type;let i=e.name?(t=n(e.name).extension)==null?void 0:t.toLowerCase():null;return i&&i in r?r[i]:`application/octet-stream`}t.exports=i})),ue=c(((e,t)=>{function n(e){return e.charCodeAt(0).toString(32)}function r(e){let t=``;return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${n(e)}`,`/`))+t}function i(e){let t=`uppy`;return typeof e.name==`string`&&(t+=`-${r(e.name.toLowerCase())}`),e.type!==void 0&&(t+=`-${e.type}`),e.meta&&typeof e.meta.relativePath==`string`&&(t+=`-${r(e.meta.relativePath.toLowerCase())}`),e.data.size!==void 0&&(t+=`-${e.data.size}`),e.data.lastModified!==void 0&&(t+=`-${e.data.lastModified}`),t}t.exports=i})),de=c(((e,t)=>{function n(e){if(e==null&&typeof navigator<`u`&&(e=navigator.userAgent),!e)return!0;let t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;let[n,r]=t[1].split(`.`);return n=parseInt(n,10),r=parseInt(r,10),n<15||n===15&&r<15063||n>18||n===18&&r>=18218}t.exports=n})),fe=c(((e,t)=>{function n(e,t){return t.name?t.name:e.split(`/`)[0]===`image`?`${e.split(`/`)[0]}.${e.split(`/`)[1]}`:`noname`}t.exports=n})),pe=c(((e,t)=>{t.exports={strings:{addBulkFilesFailed:{0:`Failed to add %{smart_count} file due to an internal error`,1:`Failed to add %{smart_count} files due to internal errors`},youCanOnlyUploadX:{0:`You can only upload %{smart_count} file`,1:`You can only upload %{smart_count} files`},youHaveToAtLeastSelectX:{0:`You have to select at least %{smart_count} file`,1:`You have to select at least %{smart_count} files`},exceedsSize:`%{file} exceeds maximum allowed size of %{size}`,missingRequiredMetaField:`Missing required meta fields`,missingRequiredMetaFieldOnFile:`Missing required meta fields in %{fileName}`,inferiorSize:`This file is smaller than the allowed size of %{size}`,youCanOnlyUploadFileTypes:`You can only upload: %{types}`,noMoreFilesAllowed:`Cannot add more files`,noDuplicates:`Cannot add the duplicate file '%{fileName}', it already exists`,companionError:`Connection with Companion failed`,authAborted:`Authentication aborted`,companionUnauthorizeHint:`To unauthorize to your %{provider} account, please go to %{url}`,failedToUpload:`Failed to upload %{file}`,noInternetConnection:`No Internet connection`,connectedToInternet:`Connected to the Internet`,noFilesFound:`You have no files or folders here`,selectX:{0:`Select %{smart_count}`,1:`Select %{smart_count}`},allFilesFromFolderNamed:`All files from folder %{name}`,openFolderNamed:`Open folder %{name}`,cancel:`Cancel`,logOut:`Log out`,filter:`Filter`,resetFilter:`Reset filter`,loading:`Loading...`,authenticateWithTitle:`Please authenticate with %{pluginName} to select files`,authenticateWith:`Connect to %{pluginName}`,signInWithGoogle:`Sign in with Google`,searchImages:`Search for images`,enterTextToSearch:`Enter text to search for images`,search:`Search`,emptyFolderAdded:`No files were added from empty folder`,folderAlreadyAdded:`The folder "%{folder}" was already added`,folderAdded:{0:`Added %{smart_count} file from %{folder}`,1:`Added %{smart_count} files from %{folder}`}}}})),me=c(((e,t)=>{O(),j();var n=ee(),r=_(),i=P();let a,o;function s(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var c=0;function l(e){return`__private_`+ c+++`_`+e}let u=re(),d=ie(),f=ae(),p=oe(),m=le(),h=se(),g=ue(),v=de(),y=fe(),b={version:`2.3.4`},x=pe();var S=l(`plugins`),C=l(`restricter`),w=l(`storeUnsubscribe`),T=l(`emitter`),E=l(`preProcessors`),k=l(`uploaders`),M=l(`postProcessors`),N=l(`informAndEmit`),te=l(`checkRequiredMetaFieldsOnFile`),ne=l(`checkRequiredMetaFields`),ce=l(`assertNewUploadAllowed`),me=l(`checkAndCreateFileStateObject`),he=l(`startIfAutoProceed`),ge=l(`addListeners`),_e=l(`updateOnlineStatus`),ve=l(`createUpload`),ye=l(`getUpload`),be=l(`removeUpload`),xe=l(`runUpload`);a=Symbol.for(`uppy test: getPlugins`),o=Symbol.for(`uppy test: createUpload`);var Se=class{constructor(e){Object.defineProperty(this,xe,{value:Ne}),Object.defineProperty(this,be,{value:Me}),Object.defineProperty(this,ye,{value:je}),Object.defineProperty(this,ve,{value:Ae}),Object.defineProperty(this,ge,{value:ke}),Object.defineProperty(this,he,{value:Oe}),Object.defineProperty(this,me,{value:De}),Object.defineProperty(this,ce,{value:Ee}),Object.defineProperty(this,ne,{value:Te}),Object.defineProperty(this,te,{value:we}),Object.defineProperty(this,N,{value:Ce}),Object.defineProperty(this,S,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,C,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:void 0}),Object.defineProperty(this,T,{writable:!0,value:d()}),Object.defineProperty(this,E,{writable:!0,value:new Set}),Object.defineProperty(this,k,{writable:!0,value:new Set}),Object.defineProperty(this,M,{writable:!0,value:new Set}),Object.defineProperty(this,_e,{writable:!0,value:this.updateOnlineStatus.bind(this)}),this.defaultLocale=x;let t={id:`uppy`,autoProceed:!1,allowMultipleUploads:!0,allowMultipleUploadBatches:!0,debug:!1,restrictions:i.defaultOptions,meta:{},onBeforeFileAdded:e=>e,onBeforeUpload:e=>e,store:p(),logger:r.justErrorsLogger,infoTimeout:5e3};this.opts=D(D(D({},t),e),{},{restrictions:D(D({},t.restrictions),e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.",`warning`):e&&e.debug&&(this.opts.logger=r.debugLogger),this.log(`Using Core v${this.constructor.VERSION}`),this.i18nInit(),this.calculateProgress=f(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:v(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:D({},this.opts.meta),info:[],recoveredState:null}),s(this,C)[C]=new i.Restricter(()=>this.opts,this.i18n),s(this,w)[w]=this.store.subscribe((e,t,n)=>{this.emit(`state-update`,e,t,n),this.updateAll(t)}),this.opts.debug&&typeof window<`u`&&(window[this.opts.id]=this),s(this,ge)[ge]()}emit(e){var t=[...arguments].slice(1);s(this,T)[T].emit(e,...t)}on(e,t){return s(this,T)[T].on(e,t),this}once(e,t){return s(this,T)[T].once(e,t),this}off(e,t){return s(this,T)[T].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}get state(){return this.getState()}setFileState(e,t){if(!this.getState().files[e])throw Error(`Can’t set state for ${e} (the file could have been removed)`);this.setState({files:D(D({},this.getState().files),{},{[e]:D(D({},this.getState().files[e]),t)})})}i18nInit(){let e=new u([this.defaultLocale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts=D(D(D({},this.opts),e),{},{restrictions:D(D({},this.opts.restrictions),e&&e.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(e=>{e.setOptions()}),this.setState()}resetProgress(){let e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t=D({},this.getState().files),n={};Object.keys(t).forEach(r=>{let i=D({},t[r]);i.progress=D(D({},i.progress),e),n[r]=i}),this.setState({files:n,totalProgress:0}),this.emit(`reset-progress`)}addPreProcessor(e){s(this,E)[E].add(e)}removePreProcessor(e){return s(this,E)[E].delete(e)}addPostProcessor(e){s(this,M)[M].add(e)}removePostProcessor(e){return s(this,M)[M].delete(e)}addUploader(e){s(this,k)[k].add(e)}removeUploader(e){return s(this,k)[k].delete(e)}setMeta(e){let t=D(D({},this.getState().meta),e),n=D({},this.getState().files);Object.keys(n).forEach(t=>{n[t]=D(D({},n[t]),{},{meta:D(D({},n[t].meta),e)})}),this.log(`Adding metadata:`),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){let n=D({},this.getState().files);if(!n[e]){this.log(`Was trying to set metadata for a file that has been removed: `,e);return}let r=D(D({},n[e].meta),t);n[e]=D(D({},n[e]),{},{meta:r}),this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),i=r.filter(e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted}),a=r.filter(e=>!e.progress.uploadStarted),o=r.filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess),s=r.filter(e=>e.progress.uploadStarted),c=r.filter(e=>e.isPaused),l=r.filter(e=>e.progress.uploadComplete),u=r.filter(e=>e.error),d=i.filter(e=>!e.isPaused),f=r.filter(e=>e.progress.preprocess||e.progress.postprocess);return{newFiles:a,startedFiles:o,uploadStartedFiles:s,pausedFiles:c,completeFiles:l,erroredFiles:u,inProgressFiles:i,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:s.length>0,isAllComplete:t===100&&l.length===r.length&&f.length===0,isAllErrored:!!n&&u.length===r.length,isAllPaused:i.length!==0&&c.length===i.length,isUploadInProgress:i.length>0,isSomeGhost:r.some(e=>e.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{return s(this,C)[C].validate(e,t),{result:!0}}catch(e){return{result:!1,reason:e.message}}}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){s(this,ce)[ce](e);let{files:t}=this.getState(),n=s(this,me)[me](t,e);return t[n.id]&&t[n.id].isGhost&&(n=D(D({},t[n.id]),{},{data:e.data,isGhost:!1}),this.log(`Replaced the blob in the restored ghost file: ${n.name}, ${n.id}`)),this.setState({files:D(D({},t),{},{[n.id]:n})}),this.emit(`file-added`,n),this.emit(`files-added`,[n]),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),s(this,he)[he](),n.id}addFiles(e){s(this,ce)[ce]();let t=D({},this.getState().files),n=[],r=[];for(let i=0;i<e.length;i++)try{let r=s(this,me)[me](t,e[i]);t[r.id]&&t[r.id].isGhost&&(r=D(D({},t[r.id]),{},{data:e[i].data,isGhost:!1}),this.log(`Replaced blob in a ghost file: ${r.name}, ${r.id}`)),t[r.id]=r,n.push(r)}catch(e){e.isRestriction||r.push(e)}if(this.setState({files:t}),n.forEach(e=>{this.emit(`file-added`,e)}),this.emit(`files-added`,n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.keys(n).forEach(e=>{this.log(`Added file: ${n[e].name}\n id: ${n[e].id}\n type: ${n[e].type}`)}),n.length>0&&s(this,he)[he](),r.length>0){let e=`Multiple errors occurred while adding files:
15
+ `;if(r.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n(`addBulkFilesFailed`,{smart_count:r.length}),details:e},`error`,this.opts.infoTimeout),typeof AggregateError==`function`)throw AggregateError(r,e);{let t=Error(e);throw t.errors=r,t}}}removeFiles(e,t){let{files:n,currentUploads:r}=this.getState(),i=D({},n),a=D({},r),o=Object.create(null);e.forEach(e=>{n[e]&&(o[e]=n[e],delete i[e])});function s(e){return o[e]===void 0}Object.keys(a).forEach(e=>{let t=r[e].fileIDs.filter(s);if(t.length===0){delete a[e];return}let{capabilities:n}=this.getState();if(t.length!==r[e].fileIDs.length&&!n.individualCancellation)throw Error(`individualCancellation is disabled`);a[e]=D(D({},r[e]),{},{fileIDs:t})});let c={currentUploads:a,files:i};Object.keys(i).length===0&&(c.allowNewUpload=!0,c.error=null,c.recoveredState=null),this.setState(c),this.calculateTotalProgress();let l=Object.keys(o);l.forEach(e=>{this.emit(`file-removed`,o[e],t)}),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(`, `)}`)}removeFile(e,t){t===void 0&&(t=null),this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).uploadComplete)return;let t=!this.getFile(e).isPaused;return this.setFileState(e,{isPaused:t}),this.emit(`upload-pause`,e,t),t}pauseAll(){let e=D({},this.getState().files);Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{e[t]=D(D({},e[t]),{},{isPaused:!0})}),this.setState({files:e}),this.emit(`pause-all`)}resumeAll(){let e=D({},this.getState().files);Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{e[t]=D(D({},e[t]),{},{isPaused:!1,error:null})}),this.setState({files:e}),this.emit(`resume-all`)}retryAll(){let e=D({},this.getState().files),t=Object.keys(e).filter(t=>e[t].error);if(t.forEach(t=>{e[t]=D(D({},e[t]),{},{isPaused:!1,error:null})}),this.setState({files:e,error:null}),this.emit(`retry-all`,t),t.length===0)return Promise.resolve({successful:[],failed:[]});let n=s(this,ve)[ve](t,{forceAllowNewUpload:!0});return s(this,xe)[xe](n)}cancelAll(e){let{reason:t=`user`}=e===void 0?{}:e;if(this.emit(`cancel-all`,{reason:t}),t===`user`){let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,`cancel-all`),this.setState({totalProgress:0,error:null,recoveredState:null})}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit(`upload-retry`,e);let t=s(this,ve)[ve]([e],{forceAllowNewUpload:!0});return s(this,xe)[xe](t)}reset(){this.cancelAll(...arguments)}logout(){this.iteratePlugins(e=>{e.provider&&e.provider.logout&&e.provider.logout()})}calculateProgress(e,t){if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}let n=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:D(D({},this.getFile(e.id).progress),{},{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?Math.round(t.bytesUploaded/t.bytesTotal*100):0})}),this.calculateTotalProgress()}calculateTotalProgress(){let e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(e.length===0){this.emit(`progress`,0),this.setState({totalProgress:0});return}let t=e.filter(e=>e.progress.bytesTotal!=null),n=e.filter(e=>e.progress.bytesTotal==null);if(t.length===0){let t=e.length*100,r=n.reduce((e,t)=>e+t.progress.percentage,0),i=Math.round(r/t*100);this.setState({totalProgress:i});return}let r=t.reduce((e,t)=>e+t.progress.bytesTotal,0),i=r/t.length;r+=i*n.length;let a=0;t.forEach(e=>{a+=e.progress.bytesUploaded}),n.forEach(e=>{a+=i*(e.progress.percentage||0)/100});let o=r===0?0:Math.round(a/r*100);o>100&&(o=100),this.setState({totalProgress:o}),this.emit(`progress`,o)}updateOnlineStatus(){window.navigator.onLine===void 0||window.navigator.onLine?(this.emit(`is-online`),this.wasOffline&&(this.emit(`back-online`),this.info(this.i18n(`connectedToInternet`),`success`,3e3),this.wasOffline=!1)):(this.emit(`is-offline`),this.info(this.i18n(`noInternetConnection`),`error`,0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if(typeof e!=`function`){let t=`Expected a plugin class, but got ${e===null?`null`:typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw TypeError(t)}let n=new e(this,t),r=n.id;if(!r)throw Error(`Your plugin must have an id`);if(!n.type)throw Error(`Your plugin must have a type`);let i=this.getPlugin(r);if(i){let e=`Already found a plugin named '${i.id}'. Tried to use: '${r}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw Error(e)}return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),n.type in s(this,S)[S]?s(this,S)[S][n.type].push(n):s(this,S)[S][n.type]=[n],n.install(),this}getPlugin(e){for(let t of Object.values(s(this,S)[S])){let n=t.find(t=>t.id===e);if(n!=null)return n}}[a](e){return s(this,S)[S][e]}iteratePlugins(e){Object.values(s(this,S)[S]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit(`plugin-remove`,e),e.uninstall&&e.uninstall();let t=s(this,S)[S][e.type],n=t.findIndex(t=>t.id===e.id);n!==-1&&t.splice(n,1);let r={plugins:D(D({},this.getState().plugins),{},{[e.id]:void 0})};this.setState(r)}close(e){let{reason:t}=e===void 0?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),s(this,w)[w](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<`u`&&window.removeEventListener&&(window.removeEventListener(`online`,s(this,_e)[_e]),window.removeEventListener(`offline`,s(this,_e)[_e]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit(`info-hidden`)}info(e,t,n){t===void 0&&(t=`info`),n===void 0&&(n=3e3);let r=typeof e==`object`;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit(`info-visible`)}log(e,t){let{logger:n}=this.opts;switch(t){case`error`:n.error(e);break;case`warning`:n.warn(e);break;default:n.debug(e);break}}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?s(this,xe)[xe](e):(s(this,be)[be](e),Promise.reject(Error(`Nonexistent upload`)))}[o](){return s(this,ve)[ve](...arguments)}addResultData(e,t){if(!s(this,ye)[ye](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:n}=this.getState(),r=D(D({},n[e]),{},{result:D(D({},n[e].result),t)});this.setState({currentUploads:D(D({},n),{},{[e]:r})})}upload(){var e;(e=s(this,S)[S].uploader)!=null&&e.length||this.log(`No uploader type plugins are used`,`warning`);let{files:t}=this.getState(),n=this.opts.onBeforeUpload(t);return n===!1?Promise.reject(Error(`Not starting the upload because onBeforeUpload returned false`)):(n&&typeof n==`object`&&(t=n,this.setState({files:t})),Promise.resolve().then(()=>s(this,C)[C].validateMinNumberOfFiles(t)).catch(e=>{throw s(this,N)[N](e),e}).then(()=>{if(!s(this,ne)[ne](t))throw new i.RestrictionError(this.i18n(`missingRequiredMetaField`))}).catch(e=>{throw e}).then(()=>{let{currentUploads:e}=this.getState(),n=Object.values(e).flatMap(e=>e.fileIDs),r=[];Object.keys(t).forEach(e=>{let t=this.getFile(e);!t.progress.uploadStarted&&n.indexOf(e)===-1&&r.push(t.id)});let i=s(this,ve)[ve](r);return s(this,xe)[xe](i)}).catch(e=>{throw this.emit(`error`,e),this.log(e,`error`),e}))}};function Ce(e,t){let{message:n,details:r=``}=e;e.isRestriction?this.emit(`restriction-failed`,t,e):this.emit(`error`,e),this.info({message:n,details:r},`error`,this.opts.infoTimeout),this.log(`${n} ${r}`.trim(),`error`)}function we(e){let{missingFields:t,error:n}=s(this,C)[C].getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(n.message),this.emit(`restriction-failed`,e,n),!1):!0}function Te(e){let t=!0;for(let n of Object.values(e))s(this,te)[te](n)||(t=!1);return t}function Ee(e){let{allowNewUpload:t}=this.getState();if(t===!1){let t=new i.RestrictionError(this.i18n(`noMoreFilesAllowed`));throw s(this,N)[N](t,e),t}}function De(e,t){let n=m(t),r=y(n,t),a=h(r).extension,o=!!t.isRemote,c=g(D(D({},t),{},{type:n}));if(this.checkIfFileAlreadyExists(c)){let e=new i.RestrictionError(this.i18n(`noDuplicates`,{fileName:r}));throw s(this,N)[N](e,t),e}let l=t.meta||{};l.name=r,l.type=n;let u=Number.isFinite(t.data.size)?t.data.size:null,d={source:t.source||``,id:c,name:r,extension:a||``,meta:D(D({},this.getState().meta),l),type:n,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:u,uploadComplete:!1,uploadStarted:null},size:u,isRemote:o,remote:t.remote||``,preview:t.preview},f=this.opts.onBeforeFileAdded(d,e);if(f===!1){let e=new i.RestrictionError(`Cannot add the file because onBeforeFileAdded returned false.`);throw this.emit(`restriction-failed`,t,e),e}else typeof f==`object`&&f&&(d=f);try{let t=Object.keys(e).map(t=>e[t]);s(this,C)[C].validate(d,t)}catch(e){throw s(this,N)[N](e,d),e}return d}function Oe(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}function ke(){let e=(e,t,n)=>{let r=e.message||`Unknown error`;e.details&&(r+=` ${e.details}`),this.setState({error:r}),t!=null&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:n})};this.on(`error`,e),this.on(`upload-error`,(t,n,r)=>{if(e(n,t,r),typeof n==`object`&&n.message){let e=Error(n.message);e.details=n.message,n.details&&(e.details+=` ${n.details}`),e.message=this.i18n(`failedToUpload`,{file:t==null?void 0:t.name}),s(this,N)[N](e)}else s(this,N)[N](n)}),this.on(`upload`,()=>{this.setState({error:null})}),this.on(`upload-started`,e=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}this.setFileState(e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}})}),this.on(`upload-progress`,this.calculateProgress),this.on(`upload-success`,(e,t)=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}let n=this.getFile(e.id).progress;this.setFileState(e.id,{progress:D(D({},n),{},{postprocess:s(this,M)[M].size>0?{mode:`indeterminate`}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal}),response:t,uploadURL:t.uploadURL,isPaused:!1}),e.size==null&&this.setFileState(e.id,{size:t.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on(`preprocess-progress`,(e,t)=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}this.setFileState(e.id,{progress:D(D({},this.getFile(e.id).progress),{},{preprocess:t})})}),this.on(`preprocess-complete`,e=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}let t=D({},this.getState().files);t[e.id]=D(D({},t[e.id]),{},{progress:D({},t[e.id].progress)}),delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on(`postprocess-progress`,(e,t)=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}this.setFileState(e.id,{progress:D(D({},this.getState().files[e.id].progress),{},{postprocess:t})})}),this.on(`postprocess-complete`,e=>{if(e==null||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e==null?void 0:e.id}`);return}let t=D({},this.getState().files);t[e.id]=D(D({},t[e.id]),{},{progress:D({},t[e.id].progress)}),delete t[e.id].progress.postprocess,this.setState({files:t})}),this.on(`restored`,()=>{this.calculateTotalProgress()}),this.on(`dashboard:file-edit-complete`,e=>{e&&s(this,te)[te](e)}),typeof window<`u`&&window.addEventListener&&(window.addEventListener(`online`,s(this,_e)[_e]),window.addEventListener(`offline`,s(this,_e)[_e]),setTimeout(s(this,_e)[_e],3e3))}function Ae(e,t){t===void 0&&(t={});let{forceAllowNewUpload:r=!1}=t,{allowNewUpload:i,currentUploads:a}=this.getState();if(!i&&!r)throw Error(`Cannot create a new upload: already uploading.`);let o=(0,n.nanoid)();return this.emit(`upload`,{id:o,fileIDs:e}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:D(D({},a),{},{[o]:{fileIDs:e,step:0,result:{}}})}),o}function je(e){let{currentUploads:t}=this.getState();return t[e]}function Me(e){let t=D({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})}function Ne(e){return Pe.apply(this,arguments)}function Pe(){return Pe=A(function*(e){let{currentUploads:t}=this.getState(),n=t[e],r=n.step||0,i=[...s(this,E)[E],...s(this,k)[k],...s(this,M)[M]];try{for(let a=r;a<i.length&&n;a++){let r=i[a],o=D(D({},n),{},{step:a});this.setState({currentUploads:D(D({},t),{},{[e]:o})}),yield r(o.fileIDs,e),t=this.getState().currentUploads,n=t[e]}}catch(t){throw s(this,be)[be](e),t}if(n){n.fileIDs.forEach(e=>{let t=this.getFile(e);t&&t.progress.postprocess&&this.emit(`postprocess-complete`,t)});let r=n.fileIDs.map(e=>this.getFile(e)),i=r.filter(e=>!e.error),a=r.filter(e=>e.error);yield this.addResultData(e,{successful:i,failed:a,uploadID:e}),t=this.getState().currentUploads,n=t[e]}let a;return n&&(a=n.result,this.emit(`complete`,a),s(this,be)[be](e)),a==null&&this.log(`Not setting result for an upload that has been removed: ${e}`),a}),Pe.apply(this,arguments)}Se.VERSION=b.version,t.exports=Se})),he=l({Component:()=>Se,Fragment:()=>xe,cloneElement:()=>Ge,createContext:()=>Ke,createElement:()=>ve,createRef:()=>be,h:()=>ve,hydrate:()=>We,isValidElement:()=>Ye,options:()=>F,render:()=>Ue,toChildArray:()=>Ae});function ge(e,t){for(var n in t)e[n]=t[n];return e}function _e(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ve(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?qe.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return ye(e,o,r,i,null)}function ye(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++Je:i,__i:-1,__u:0};return i==null&&F.vnode!=null&&F.vnode(a),a}function be(){return{current:null}}function xe(e){return e.children}function Se(e,t){this.props=e,this.context=t}function Ce(e,t){if(t==null)return e.__?Ce(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?Ce(e):null}function we(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return we(e)}}function Te(e){(!e.__d&&(e.__d=!0)&&Xe.push(e)&&!Ee.__r++||Ze!=F.debounceRendering)&&((Ze=F.debounceRendering)||Qe)(Ee)}function Ee(){for(var e,t,n,r,i,a,o,s=1;Xe.length;)Xe.length>s&&Xe.sort($e),e=Xe.shift(),s=Xe.length,e.__d&&(n=void 0,r=void 0,i=(r=(t=e).__v).__e,a=[],o=[],t.__P&&((n=ge({},r)).__v=r.__v+1,F.vnode&&F.vnode(n),Fe(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,a,i==null?Ce(r):i,!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,Le(a,n,o),r.__e=r.__=null,n.__e!=i&&we(n)));Ee.__r=0}function De(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v=r&&r.__k||ot,y=t.length;for(c=Oe(n,t,v,c,y),d=0;d<y;d++)(p=n.__k[d])!=null&&(f=p.__i==-1?at:v[p.__i]||at,p.__i=d,g=Fe(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&Be(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),(_=!!(4&p.__u))||f.__k===p.__k?c=ke(p,c,e,_):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function Oe(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?ye(null,o,null,null,null):ct(o)?ye(xe,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?ye(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=je(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Ce(s)),Ve(s,s));return r}function ke(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=ke(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Ce(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ae(e,t){return t=t||[],e==null||typeof e==`boolean`||(ct(e)?e.some(function(e){Ae(e,t)}):t.push(e)),t}function je(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Me(e,t,n){t[0]==`-`?e.setProperty(t,n==null?``:n):e[t]=n==null?``:typeof n!=`number`||st.test(t)?n:n+`px`}function Ne(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Me(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Me(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(et,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=tt,e.addEventListener(t,a?rt:nt,a)):e.removeEventListener(t,a?rt:nt,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n==null?``:n;break n}catch(e){}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function Pe(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=tt++;else if(t.t<n.u)return;return n(F.event?F.event(t):t)}}}function Fe(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=F.__b)&&u(t);n:if(typeof D==`function`)try{if(_=t.props,v=`prototype`in D&&D.prototype.render,y=(u=D.contextType)&&r[u.__c],b=u?y?y.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:(v?t.__c=d=new D(_,b):(t.__c=d=new Se(_,b),d.constructor=D,d.render=He),y&&y.sub(d),d.props=_,d.state||(d.state={}),d.context=b,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),v&&d.__s==null&&(d.__s=d.state),v&&D.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ge({},d.__s)),ge(d.__s,D.getDerivedStateFromProps(_,d.__s))),p=d.props,m=d.state,d.__v=t,f)v&&D.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),v&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(v&&D.getDerivedStateFromProps==null&&_!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(_,b),!d.__e&&d.shouldComponentUpdate!=null&&!1===d.shouldComponentUpdate(_,d.__s,b)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),x=0;x<d._sb.length;x++)d.__h.push(d._sb[x]);d._sb=[],d.__h.length&&o.push(d);break n}d.componentWillUpdate!=null&&d.componentWillUpdate(_,d.__s,b),v&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,m,h)})}if(d.context=b,d.props=_,d.__P=e,d.__e=!1,S=F.__r,C=0,v){for(d.state=d.__s,d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),w=0;w<d._sb.length;w++)d.__h.push(d._sb[w]);d._sb=[]}else do d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++C<25);d.state=d.__s,d.getChildContext!=null&&(r=ge(ge({},r),d.getChildContext())),v&&!f&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(p,m)),T=u,u!=null&&u.type===xe&&u.key==null&&(T=Re(u.props.children)),s=De(e,ct(T)?T:[T],t,n,r,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else{for(E=a.length;E--;)_e(a[E]);Ie(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Ie(t);F.__e(e,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ze(n.__e,t,n,r,i,a,o,c,l);return(u=F.diffed)&&u(t),128&t.__u?void 0:s}function Ie(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Ie)}function Le(e,t,n){for(var r=0;r<n.length;r++)Be(n[r],n[++r],n[++r]);F.__c&&F.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){F.__e(e,t.__v)}})}function Re(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:ct(e)?e.map(Re):ge({},e)}function ze(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,m,h,g=n.props,_=t.props,v=t.type;if(v==`svg`?i=`http://www.w3.org/2000/svg`:v==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||(i=`http://www.w3.org/1999/xhtml`),a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!v&&(v?p.localName==v:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(v==null)return document.createTextNode(_);e=document.createElementNS(i,v,_.is&&_),s&&(F.__m&&F.__m(t,a),s=!1),a=null}if(v==null)g===_||s&&e.data==_||(e.data=_);else{if(a=a&&qe.call(e.childNodes),g=n.props||at,!s&&a!=null)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)if(p=g[l],l!=`children`){if(l==`dangerouslySetInnerHTML`)d=p;else if(!(l in _)){if(l==`value`&&`defaultValue`in _||l==`checked`&&`defaultChecked`in _)continue;Ne(e,l,null,p,i)}}for(l in _)p=_[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?m=p:l==`checked`?h=p:s&&typeof p!=`function`||g[l]===p||Ne(e,l,p,g[l],i);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),De(t.type==`template`?e.content:e,ct(f)?f:[f],t,n,r,v==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&Ce(n,0),s,c),a!=null)for(l=a.length;l--;)_e(a[l]);s||(l=`value`,v==`progress`&&m==null?e.removeAttribute(`value`):m!=null&&(m!==e[l]||v==`progress`&&!m||v==`option`&&m!=g[l])&&Ne(e,l,m,g[l],i),l=`checked`,h!=null&&h!=e[l]&&Ne(e,l,h,g[l],i))}return e}function Be(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){F.__e(e,n)}}function Ve(e,t,n){var r,i;if(F.unmount&&F.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Be(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){F.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Ve(r[i],t,n||typeof e.type!=`function`);n||_e(e.__e),e.__c=e.__=e.__e=void 0}function He(e,t,n){return this.constructor(e,n)}function Ue(e,t,n){var r,i,a,o;t==document&&(t=document.documentElement),F.__&&F.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,a=[],o=[],Fe(t,e=(!r&&n||t).__k=ve(xe,null,[e]),i||at,at,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?qe.call(t.childNodes):null,a,!r&&n?n:i?i.__e:t.firstChild,r,o),Le(a,e,o)}function We(e,t){Ue(e,t,We)}function Ge(e,t,n){var r,i,a,o,s=ge({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)a==`key`?r=t[a]:a==`ref`?i=t[a]:s[a]=t[a]===void 0&&o!=null?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?qe.call(arguments,2):n),ye(e.type,s,r||e.key,i||e.ref,null)}function Ke(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,Te(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+ it++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}var qe,F,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt=s((()=>{at={},ot=[],st=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ct=Array.isArray,qe=ot.slice,F={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},Je=0,Ye=function(e){return e!=null&&e.constructor===void 0},Se.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ge({},this.state);typeof e==`function`&&(e=e(ge({},n),this.props)),e&&ge(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Te(this))},Se.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Te(this))},Se.prototype.render=xe,Xe=[],Qe=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,$e=function(e,t){return e.__v.__b-t.__v.__b},Ee.__r=0,et=/(PointerCapture)$|Capture$/i,tt=0,nt=Pe(!1),rt=Pe(!0),it=0})),ut=c(((e,t)=>{function n(e){return(e==null?void 0:e.nodeType)===Node.ELEMENT_NODE}t.exports=n})),dt=c(((e,t)=>{let n=ut();function r(e,t){return t===void 0&&(t=document),typeof e==`string`?t.querySelector(e):n(e)?e:null}t.exports=r})),ft=c(((e,t)=>{function n(e){for(var t;e&&!e.dir;)e=e.parentNode;return(t=e)==null?void 0:t.dir}t.exports=n})),pt=c(((e,t)=>{O();let n=re();t.exports=class{constructor(e,t){t===void 0&&(t={}),this.uppy=e,this.opts=t}getPluginState(){let{plugins:e}=this.uppy.getState();return e[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:D(D({},t),{},{[this.id]:D(D({},t[this.id]),e)})})}setOptions(e){this.opts=D(D({},this.opts),e),this.setPluginState(),this.i18nInit()}i18nInit(){let e=new n([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState()}addTarget(){throw Error(`Extend the addTarget method to add your plugin to another plugin's target`)}install(){}uninstall(){}render(){throw Error(`Extend the render method to add your plugin to a DOM element`)}update(){}afterUpdate(){}}})),mt=c(((e,t)=>{var n=(lt(),f(he));function r(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var i=0;function a(e){return`__private_`+ i+++`_`+e}let o=dt(),s=ft(),c=pt();function l(e){let t=null,n=null;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=i,t||(t=Promise.resolve().then(()=>(t=null,e(...n)))),t}}var u=a(`updateUI`);t.exports=class e extends c{constructor(){super(...arguments),Object.defineProperty(this,u,{writable:!0,value:void 0})}mount(t,i){let a=i.id,c=o(t);if(c){this.isTargetDOMEl=!0;let e=document.createElement(`div`);return e.classList.add(`uppy-Root`),r(this,u)[u]=l(t=>{this.uppy.getPlugin(this.id)&&((0,n.render)(this.render(t),e),this.afterUpdate())}),this.uppy.log(`Installing ${a} to a DOM element '${t}'`),this.opts.replaceTargetContent&&(c.innerHTML=``),(0,n.render)(this.render(this.uppy.getState()),e),this.el=e,c.appendChild(e),e.dir=this.opts.direction||s(e)||`ltr`,this.onMount(),this.el}let d;if(typeof t==`object`&&t instanceof e)d=t;else if(typeof t==`function`){let e=t;this.uppy.iteratePlugins(t=>{t instanceof e&&(d=t)})}if(d)return this.uppy.log(`Installing ${a} to ${d.id}`),this.parent=d,this.el=d.addTarget(i),this.onMount(),this.el;this.uppy.log(`Not installing ${a}`);let f=`Invalid target option given to ${a}.`;throw typeof t==`function`?f+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":f+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",Error(f)}update(e){if(this.el!=null){var t,n;(t=(n=r(this,u))[u])==null||t.call(n,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}}})),ht=c(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Uppy=e.UIPlugin=e.BasePlugin=void 0,Object.defineProperty(e,`debugLogger`,{enumerable:!0,get:function(){return n.debugLogger}});var n=_();t.exports=me(),e.UIPlugin=mt(),e.BasePlugin=pt();let r=me();e.Uppy=r;let i=mt(),a=pt();r.Uppy=r,r.UIPlugin=i,r.BasePlugin=a,r.debugLogger=n.debugLogger})),gt=c(((e,t)=>{t.exports=class extends Error{constructor(e,t){t===void 0&&(t=null),super(`This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.`),this.cause=e,this.isNetworkError=!0,this.request=t}}})),_t=c(((e,t)=>{let n=gt();function r(){return fetch(...arguments).catch(e=>{throw e.name===`AbortError`?e:new n(e)})}t.exports=r})),vt=c(((e,t)=>{let n=ne();t.exports=class extends Error{constructor(e,t){t===void 0&&(t={}),super(e),this.cause=t.cause,this.cause&&n(this.cause,`isNetworkError`)&&(this.isNetworkError=this.cause.isNetworkError)}}})),yt=c(((e,t)=>{t.exports=class extends Error{constructor(){super(`Authorization required`),this.name=`AuthError`,this.isAuthError=!0}}})),bt=c(((e,t)=>{j(),O();let n;function r(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var i=0;function a(e){return`__private_`+ i+++`_`+e}let o=_t(),s=vt(),c=yt(),l={version:`2.2.2`};function u(e){return e.replace(/\/$/,``)}function d(e){return f.apply(this,arguments)}function f(){return f=A(function*(e){if(e.status===401)throw new c;let t=e.json();if(e.status<200||e.status>300){let n=`Failed request with status: ${e.status}. ${e.statusText}`;try{let e=yield t;n=e.message?`${n} message: ${e.message}`:n,n=e.requestId?`${n} request-Id: ${e.requestId}`:n}finally{throw Error(n)}}return t}),f.apply(this,arguments)}var p=a(`companionHeaders`),m=a(`getPostResponseFunc`),h=a(`getUrl`),g=a(`errorHandler`);n=Symbol.for(`uppy test: getCompanionHeaders`);var _=class e{constructor(e,t){Object.defineProperty(this,g,{value:y}),Object.defineProperty(this,h,{value:v}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,m,{writable:!0,value:e=>t=>e?t:this.onReceiveResponse(t)}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=[`accept`,`content-type`,`uppy-auth-token`],this.preflightDone=!1,r(this,p)[p]=t==null?void 0:t.companionHeaders}setCompanionHeaders(e){r(this,p)[p]=e}[n](){return r(this,p)[p]}get hostname(){let{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return u(e&&e[t]?e[t]:t)}headers(){return Promise.resolve(D(D({},e.defaultHeaders),r(this,p)[p]))}onReceiveResponse(e){let t=this.uppy.getState().companion||{},n=this.opts.companionUrl,{headers:r}=e;return r.has(`i-am`)&&r.get(`i-am`)!==t[n]&&this.uppy.setState({companion:D(D({},t),{},{[n]:r.get(`i-am`)})}),e}preflight(e){return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(r(this,h)[h](e),{method:`OPTIONS`}).then(e=>(e.headers.has(`access-control-allow-headers`)&&(this.allowedHeaders=e.headers.get(`access-control-allow-headers`).split(`,`).map(e=>e.trim().toLowerCase())),this.preflightDone=!0,this.allowedHeaders.slice())).catch(e=>(this.uppy.log(`[CompanionClient] unable to make preflight request ${e}`,`warning`),this.preflightDone=!0,this.allowedHeaders.slice()))}preflightAndHeaders(e){return Promise.all([this.preflight(e),this.headers()]).then(e=>{let[t,n]=e;return Object.keys(n).forEach(e=>{t.includes(e.toLowerCase())||(this.uppy.log(`[CompanionClient] excluding disallowed header ${e}`),delete n[e])}),n})}get(e,t){return this.preflightAndHeaders(e).then(t=>o(r(this,h)[h](e),{method:`get`,headers:t,credentials:this.opts.companionCookiesRule||`same-origin`})).then(r(this,m)[m](t)).then(d).catch(r(this,g)[g](`get`,e))}post(e,t,n){let i=`post`;return this.preflightAndHeaders(e).then(n=>o(r(this,h)[h](e),{method:i,headers:n,credentials:this.opts.companionCookiesRule||`same-origin`,body:JSON.stringify(t)})).then(r(this,m)[m](n)).then(d).catch(r(this,g)[g](i,e))}delete(e,t,n){let i=`delete`;return this.preflightAndHeaders(e).then(n=>o(`${this.hostname}/${e}`,{method:i,headers:n,credentials:this.opts.companionCookiesRule||`same-origin`,body:t?JSON.stringify(t):null})).then(r(this,m)[m](n)).then(d).catch(r(this,g)[g](i,e))}};function v(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}function y(e,t){return n=>{var i;return(i=n)!=null&&i.isAuthError||(n=new s(`Could not ${e} ${r(this,h)[h](t)}`,{cause:n})),Promise.reject(n)}}_.VERSION=l.version,_.defaultHeaders={Accept:`application/json`,"Content-Type":`application/json`,"Uppy-Versions":`@uppy/companion-client=${_.VERSION}`},t.exports=_})),xt=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getItem=n,e.removeItem=r,e.setItem=t;function t(e,t){return new Promise(n=>{localStorage.setItem(e,t),n()})}function n(e){return Promise.resolve(localStorage.getItem(e))}function r(e){return new Promise(t=>{localStorage.removeItem(e),t()})}})),St=c(((e,t)=>{O(),j();var n=xt();let r=bt(),i=e=>e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);t.exports=class extends r{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||i(this.id),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null}headers(){return Promise.all([super.headers(),this.getAuthToken()]).then(e=>{let[t,n]=e,r={};return n&&(r[`uppy-auth-token`]=n),this.companionKeysParams&&(r[`uppy-credentials-params`]=btoa(JSON.stringify({params:this.companionKeysParams}))),D(D({},t),r)})}onReceiveResponse(e){e=super.onReceiveResponse(e);let t=this.uppy.getPlugin(this.pluginId),n=t.getPluginState().authenticated?e.status!==401:e.status<400;return t.setPluginState({authenticated:n}),e}setAuthToken(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)}getAuthToken(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)}ensurePreAuth(){var e=this;return A(function*(){if(e.companionKeysParams&&!e.preAuthToken&&(yield e.fetchPreAuthToken(),!e.preAuthToken))throw Error(`Could not load authentication data required for third-party login. Please try again later.`)})()}authUrl(e){e===void 0&&(e={});let t=new URLSearchParams(e);return this.preAuthToken&&t.set(`uppyPreAuthToken`,this.preAuthToken),`${this.hostname}/${this.id}/connect?${t}`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}fetchPreAuthToken(){var e=this;return A(function*(){if(e.companionKeysParams)try{e.preAuthToken=(yield e.post(`${e.id}/preauth/`,{params:e.companionKeysParams})).token}catch(t){e.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${t}`,`warning`)}})()}list(e){return this.get(`${this.id}/list/${e||``}`)}logout(){return this.get(`${this.id}/logout`).then(e=>Promise.all([e,this.uppy.getPlugin(this.pluginId).storage.removeItem(this.tokenKey)])).then(e=>{let[t]=e;return t})}static initPlugin(e,t,r){if(e.type=`acquirer`,e.files=[],r&&(e.opts=D(D({},r),t)),t.serverUrl||t.serverPattern)throw Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(t.companionAllowedHosts){let n=t.companionAllowedHosts;if(typeof n!=`string`&&!Array.isArray(n)&&!(n instanceof RegExp))throw TypeError(`${e.id}: the option "companionAllowedHosts" must be one of string, Array, RegExp`);e.opts.companionAllowedHosts=n}else /^(?!https?:\/\/).*$/i.test(t.companionUrl)?e.opts.companionAllowedHosts=`https://${t.companionUrl.replace(/^\/\//,``)}`:e.opts.companionAllowedHosts=new URL(t.companionUrl).origin;e.storage=e.opts.storage||n}}})),Ct=c(((e,t)=>{let n=bt(),r=e=>e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `);t.exports=class extends n{constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||r(this.id),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:``}`)}}})),wt=c(((e,t)=>{let n,r;function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var a=0;function o(e){return`__private_`+ a+++`_`+e}let s=ie();var c=o(`queued`),l=o(`emitter`),u=o(`isOpen`),d=o(`socket`),f=o(`handleMessage`);n=Symbol.for(`uppy test: getSocket`),r=Symbol.for(`uppy test: getQueued`),t.exports=class{constructor(e){Object.defineProperty(this,c,{writable:!0,value:[]}),Object.defineProperty(this,l,{writable:!0,value:s()}),Object.defineProperty(this,u,{writable:!0,value:!1}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:e=>{try{let t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}}}),this.opts=e,(!e||e.autoOpen!==!1)&&this.open()}get isOpen(){return i(this,u)[u]}[n](){return i(this,d)[d]}[r](){return i(this,c)[c]}open(){i(this,d)[d]=new WebSocket(this.opts.target),i(this,d)[d].onopen=()=>{for(i(this,u)[u]=!0;i(this,c)[c].length>0&&i(this,u)[u];){let e=i(this,c)[c].shift();this.send(e.action,e.payload)}},i(this,d)[d].onclose=()=>{i(this,u)[u]=!1},i(this,d)[d].onmessage=i(this,f)[f]}close(){var e;(e=i(this,d)[d])==null||e.close()}send(e,t){if(!i(this,u)[u]){i(this,c)[c].push({action:e,payload:t});return}i(this,d)[d].send(JSON.stringify({action:e,payload:t}))}on(e,t){i(this,l)[l].on(e,t)}emit(e,t){i(this,l)[l].emit(e,t)}once(e,t){i(this,l)[l].once(e,t)}}})),Tt=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Socket=e.SearchProvider=e.RequestClient=e.Provider=void 0,e.RequestClient=bt(),e.Provider=St(),e.SearchProvider=Ct(),e.Socket=wt()})),Et=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.internalRateLimitedQueue=e.RateLimitedQueue=void 0;function t(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var n=0;function r(e){return`__private_`+ n+++`_`+e}function i(){return Error(`Cancelled`)}var a=r(`activeRequests`),o=r(`queuedHandlers`),s=r(`paused`),c=r(`pauseTimer`),l=r(`downLimit`),u=r(`upperLimit`),d=r(`rateLimitingTimer`),f=r(`call`),p=r(`queueNext`),m=r(`next`),h=r(`queue`),g=r(`dequeue`),_=r(`resume`),v=r(`increaseLimit`);e.RateLimitedQueue=class{constructor(e){Object.defineProperty(this,g,{value:C}),Object.defineProperty(this,h,{value:S}),Object.defineProperty(this,m,{value:x}),Object.defineProperty(this,p,{value:b}),Object.defineProperty(this,f,{value:y}),Object.defineProperty(this,a,{writable:!0,value:0}),Object.defineProperty(this,o,{writable:!0,value:[]}),Object.defineProperty(this,s,{writable:!0,value:!1}),Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:1}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,d,{writable:!0,value:void 0}),Object.defineProperty(this,_,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,v,{writable:!0,value:()=>{if(t(this,s)[s]){t(this,d)[d]=setTimeout(t(this,v)[v],0);return}t(this,l)[l]=this.limit,this.limit=Math.ceil((t(this,u)[u]+t(this,l)[l])/2);for(let e=t(this,l)[l];e<=this.limit;e++)t(this,p)[p]();t(this,u)[u]-t(this,l)[l]>3?t(this,d)[d]=setTimeout(t(this,v)[v],2e3):t(this,l)[l]=Math.floor(t(this,l)[l]/2)}}),typeof e!=`number`||e===0?this.limit=1/0:this.limit=e}run(e,n){return!t(this,s)[s]&&t(this,a)[a]<this.limit?t(this,f)[f](e):t(this,h)[h](e,n)}wrapPromiseFunction(e,t){var n=this;return function(){var r=[...arguments];let a,o=new Promise((o,s)=>{a=n.run(()=>{let t,n;try{n=Promise.resolve(e(...r))}catch(e){n=Promise.reject(e)}return n.then(e=>{t?s(t):(a.done(),o(e))},e=>{t?s(t):(a.done(),s(e))}),()=>{t=i()}},t)});return o.abort=()=>{a.abort()},o}}resume(){t(this,s)[s]=!1,clearTimeout(t(this,c)[c]);for(let e=0;e<this.limit;e++)t(this,p)[p]()}pause(e){e===void 0&&(e=null),t(this,s)[s]=!0,clearTimeout(t(this,c)[c]),e!=null&&(t(this,c)[c]=setTimeout(t(this,_)[_],e))}rateLimit(e){clearTimeout(t(this,d)[d]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(t(this,u)[u]=this.limit-1,this.limit=t(this,l)[l],t(this,d)[d]=setTimeout(t(this,v)[v],e))}get isPaused(){return t(this,s)[s]}};function y(e){t(this,a)[a]+=1;let n=!1,r;try{r=e()}catch(e){throw--t(this,a)[a],e}return{abort:()=>{n||(n=!0,--t(this,a)[a],r(),t(this,p)[p]())},done:()=>{n||(n=!0,--t(this,a)[a],t(this,p)[p]())}}}function b(){queueMicrotask(()=>t(this,m)[m]())}function x(){if(t(this,s)[s]||t(this,a)[a]>=this.limit||t(this,o)[o].length===0)return;let e=t(this,o)[o].shift(),n=t(this,f)[f](e.fn);e.abort=n.abort,e.done=n.done}function S(e,n){n===void 0&&(n={});let r={fn:e,priority:n.priority||0,abort:()=>{t(this,g)[g](r)},done:()=>{throw Error(`Cannot mark a queued request as done: this indicates a bug`)}},i=t(this,o)[o].findIndex(e=>r.priority>e.priority);return i===-1?t(this,o)[o].push(r):t(this,o)[o].splice(i,0,r),r}function C(e){let n=t(this,o)[o].indexOf(e);n!==-1&&t(this,o)[o].splice(n,1)}e.internalRateLimitedQueue=Symbol(`__queue`)})),Dt=c(((e,t)=>{let n=ae();function r(e,t,n){let{progress:r,bytesUploaded:i,bytesTotal:a}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit(`upload-progress`,n,{uploader:e,bytesUploaded:i,bytesTotal:a}))}t.exports=n(r,300,{leading:!0,trailing:!0})})),Ot=c(((e,t)=>{function n(e){let t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return`${/^http:\/\//i.test(e)?`ws`:`wss`}://${t}`}t.exports=n})),kt=c(((e,t)=>{function n(e){let t=[],n=[];function r(e){t.push(e)}function i(e){n.push(e)}return Promise.all(e.map(e=>e.then(r,i))).then(()=>({successful:t,failed:n}))}t.exports=n})),At=c(((e,t)=>{function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var r=0;function i(e){return`__private_`+ r+++`_`+e}var a=i(`emitter`),o=i(`events`);t.exports=class{constructor(e){Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:[]}),n(this,a)[a]=e}on(e,t){return n(this,o)[o].push([e,t]),n(this,a)[a].on(e,t)}remove(){for(let[e,t]of n(this,o)[o].splice(0))n(this,a)[a].off(e,t)}}})),jt=c(((e,t)=>{function n(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError(`attempted to use private field on non-instance`);return e}var r=0;function i(e){return`__private_`+ r+++`_`+e}var a=i(`aliveTimer`),o=i(`isDone`),s=i(`onTimedOut`),c=i(`timeout`);t.exports=class{constructor(e,t){Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,o,{writable:!0,value:!1}),Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,c,{writable:!0,value:void 0}),n(this,c)[c]=e,n(this,s)[s]=t}progress(){n(this,o)[o]||n(this,c)[c]>0&&(clearTimeout(n(this,a)[a]),n(this,a)[a]=setTimeout(n(this,s)[s],n(this,c)[c]))}done(){n(this,o)[o]||(clearTimeout(n(this,a)[a]),n(this,a)[a]=null,n(this,o)[o]=!0)}}})),Mt=c(((e,t)=>{function n(e){return e?e.readyState!==0&&e.readyState!==4||e.status===0:!1}t.exports=n})),Nt=c(((e,t)=>{t.exports={strings:{timedOut:`Upload stalled for %{seconds} seconds, aborting.`}}})),Pt=c(((e,t)=>{O();var n=ee(),r=Tt(),i=Et();let a=pt(),o=Dt(),s=Ot(),c=kt(),l=At(),u=jt(),d=gt(),f=Mt(),p={version:`2.1.3`},m=Nt();function h(e,t){let n=t;return n||(n=Error(`Upload error`)),typeof n==`string`&&(n=Error(n)),n instanceof Error||(n=Object.assign(Error(`Upload error`),{data:n})),f(e)?(n=new d(n,e),n):(n.request=e,n)}function g(e){return e.data.slice(0,e.data.size,e.meta.type)}var _=class extends a{constructor(e,t){if(super(e,t),this.type=`uploader`,this.id=this.opts.id||`XHRUpload`,this.title=`XHRUpload`,this.defaultLocale=m,this.opts=D(D({},{formData:!0,fieldName:t.bundle?`files[]`:`file`,method:`post`,metaFields:null,responseUrlFieldName:`url`,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:``,getResponseData(t){let n={};try{n=JSON.parse(t)}catch(t){e.log(t)}return n},getResponseError(e,t){let n=Error(`Upload error`);return f(t)&&(n=new d(n,t)),n},validateStatus(e){return e>=200&&e<300}}),t),this.i18nInit(),this.handleUpload=this.handleUpload.bind(this),i.internalRateLimitedQueue in this.opts?this.requests=this.opts[i.internalRateLimitedQueue]:this.requests=new i.RateLimitedQueue(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw Error("`opts.formData` must be true when `opts.bundle` is enabled.");this.uploaderEvents=Object.create(null)}getOptions(e){let t=this.uppy.getState().xhrUpload,{headers:n}=this.opts,r=D(D(D(D({},this.opts),t||{}),e.xhrUpload||{}),{},{headers:{}});return typeof n==`function`?r.headers=n(e):Object.assign(r.headers,this.opts.headers),t&&Object.assign(r.headers,t.headers),e.xhrUpload&&Object.assign(r.headers,e.xhrUpload.headers),r}addMetadata(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach(n=>{e.append(n,t[n])})}createFormDataUpload(e,t){let n=new FormData;this.addMetadata(n,e.meta,t);let r=g(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n}createBundledUpload(e,t){let n=new FormData,{meta:r}=this.uppy.getState();return this.addMetadata(n,r,t),e.forEach(e=>{let t=this.getOptions(e),r=g(e);e.name?n.append(t.fieldName,r,e.name):n.append(t.fieldName,r)}),n}upload(e,t,r){let i=this.getOptions(e);return this.uppy.log(`uploading ${t} of ${r}`),new Promise((t,r)=>{this.uppy.emit(`upload-started`,e);let a=i.formData?this.createFormDataUpload(e,i):e.data,o=new XMLHttpRequest;this.uploaderEvents[e.id]=new l(this.uppy);let s,c=new u(i.timeout,()=>{o.abort(),s.done();let t=Error(this.i18n(`timedOut`,{seconds:Math.ceil(i.timeout/1e3)}));this.uppy.emit(`upload-error`,e,t),r(t)}),d=(0,n.nanoid)();o.upload.addEventListener(`loadstart`,()=>{this.uppy.log(`[XHRUpload] ${d} started`)}),o.upload.addEventListener(`progress`,t=>{this.uppy.log(`[XHRUpload] ${d} progress: ${t.loaded} / ${t.total}`),c.progress(),t.lengthComputable&&this.uppy.emit(`upload-progress`,e,{uploader:this,bytesUploaded:t.loaded,bytesTotal:t.total})}),o.addEventListener(`load`,()=>{if(this.uppy.log(`[XHRUpload] ${d} finished`),c.done(),s.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),i.validateStatus(o.status,o.responseText,o)){let n=i.getResponseData(o.responseText,o),r=n[i.responseUrlFieldName],a={status:o.status,body:n,uploadURL:r};return this.uppy.emit(`upload-success`,e,a),r&&this.uppy.log(`Download ${e.name} from ${r}`),t(e)}let n=i.getResponseData(o.responseText,o),a=h(o,i.getResponseError(o.responseText,o)),l={status:o.status,body:n};return this.uppy.emit(`upload-error`,e,a,l),r(a)}),o.addEventListener(`error`,()=>{this.uppy.log(`[XHRUpload] ${d} errored`),c.done(),s.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null);let t=h(o,i.getResponseError(o.responseText,o));return this.uppy.emit(`upload-error`,e,t),r(t)}),o.open(i.method.toUpperCase(),i.endpoint,!0),o.withCredentials=i.withCredentials,i.responseType!==``&&(o.responseType=i.responseType),s=this.requests.run(()=>{this.uppy.emit(`upload-started`,e);let t=this.getOptions(e);return Object.keys(t.headers).forEach(e=>{o.setRequestHeader(e,t.headers[e])}),o.send(a),()=>{c.done(),o.abort()}}),this.onFileRemove(e.id,()=>{s.abort(),r(Error(`File removed`))}),this.onCancelAll(e.id,e=>{let{reason:t}=e;t===`user`&&s.abort(),r(Error(`Upload cancelled`))})})}uploadRemote(e){let t=this.getOptions(e);return new Promise((n,i)=>{this.uppy.emit(`upload-started`,e);let a={};(Array.isArray(t.metaFields)?t.metaFields:Object.keys(e.meta)).forEach(t=>{a[t]=e.meta[t]}),new(e.remote.providerOptions.provider?r.Provider:r.RequestClient)(this.uppy,e.remote.providerOptions).post(e.remote.url,D(D({},e.remote.body),{},{endpoint:t.endpoint,size:e.data.size,fieldname:t.fieldName,metadata:a,httpMethod:t.method,useFormData:t.formData,headers:t.headers})).then(a=>{let{token:c}=a,u=s(e.remote.companionUrl),d=new r.Socket({target:`${u}/api/${c}`,autoOpen:!1});this.uploaderEvents[e.id]=new l(this.uppy);let f;this.onFileRemove(e.id,()=>{d.send(`cancel`,{}),f.abort(),n(`upload ${e.id} was removed`)}),this.onCancelAll(e.id,function(t){let{reason:r}=t===void 0?{}:t;r===`user`&&(d.send(`cancel`,{}),f.abort()),n(`upload ${e.id} was canceled`)}),this.onRetry(e.id,()=>{d.send(`pause`,{}),d.send(`resume`,{})}),this.onRetryAll(e.id,()=>{d.send(`pause`,{}),d.send(`resume`,{})}),d.on(`progress`,t=>o(this,t,e)),d.on(`success`,r=>{let i=t.getResponseData(r.response.responseText,r.response),a=i[t.responseUrlFieldName],o={status:r.response.status,body:i,uploadURL:a};return this.uppy.emit(`upload-success`,e,o),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),n()}),d.on(`error`,n=>{let r=n.response,a=r?t.getResponseError(r.responseText,r):Object.assign(Error(n.error.message),{cause:n.error});this.uppy.emit(`upload-error`,e,a),f.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),i(a)}),f=this.requests.run(()=>(d.open(),e.isPaused&&d.send(`pause`,{}),()=>d.close()))}).catch(t=>{this.uppy.emit(`upload-error`,e,t),i(t)})})}uploadBundle(e){return new Promise((t,n)=>{let{endpoint:r}=this.opts,{method:i}=this.opts,a=this.uppy.getState().xhrUpload,o=this.createBundledUpload(e,D(D({},this.opts),a||{})),s=new XMLHttpRequest,c=t=>{e.forEach(e=>{this.uppy.emit(`upload-error`,e,t)})},l=new u(this.opts.timeout,()=>{s.abort();let e=Error(this.i18n(`timedOut`,{seconds:Math.ceil(this.opts.timeout/1e3)}));c(e),n(e)});s.upload.addEventListener(`loadstart`,()=>{this.uppy.log(`[XHRUpload] started uploading bundle`),l.progress()}),s.upload.addEventListener(`progress`,t=>{l.progress(),t.lengthComputable&&e.forEach(e=>{this.uppy.emit(`upload-progress`,e,{uploader:this,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})})}),s.addEventListener(`load`,r=>{if(l.done(),this.opts.validateStatus(r.target.status,s.responseText,s)){let n=this.opts.getResponseData(s.responseText,s),i={status:r.target.status,body:n};return e.forEach(e=>{this.uppy.emit(`upload-success`,e,i)}),t()}let i=this.opts.getResponseError(s.responseText,s)||Error(`Upload error`);return i.request=s,c(i),n(i)}),s.addEventListener(`error`,()=>{l.done();let e=this.opts.getResponseError(s.responseText,s)||Error(`Upload error`);return c(e),n(e)}),this.uppy.on(`cancel-all`,function(e){let{reason:t}=e===void 0?{}:e;t===`user`&&(l.done(),s.abort())}),s.open(i.toUpperCase(),r,!0),s.withCredentials=this.opts.withCredentials,this.opts.responseType!==``&&(s.responseType=this.opts.responseType),Object.keys(this.opts.headers).forEach(e=>{s.setRequestHeader(e,this.opts.headers[e])}),s.send(o),e.forEach(e=>{this.uppy.emit(`upload-started`,e)})})}uploadFiles(e){return c(e.map((t,n)=>{let r=parseInt(n,10)+1,i=e.length;return t.error?Promise.reject(Error(t.error)):t.isRemote?this.uploadRemote(t,r,i):this.upload(t,r,i)}))}onFileRemove(e,t){this.uploaderEvents[e].on(`file-removed`,n=>{e===n.id&&t(n.id)})}onRetry(e,t){this.uploaderEvents[e].on(`upload-retry`,n=>{e===n&&t()})}onRetryAll(e,t){this.uploaderEvents[e].on(`retry-all`,()=>{this.uppy.getFile(e)&&t()})}onCancelAll(e,t){var n=this;this.uploaderEvents[e].on(`cancel-all`,function(){n.uppy.getFile(e)&&t(...arguments)})}handleUpload(e){if(e.length===0)return this.uppy.log(`[XHRUpload] No files to upload!`),Promise.resolve();this.opts.limit===0&&!this.opts[i.internalRateLimitedQueue]&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0",`warning`),this.uppy.log(`[XHRUpload] Uploading...`);let t=e.map(e=>this.uppy.getFile(e));if(this.opts.bundle){if(t.some(e=>e.isRemote))throw Error("Can’t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers==`function`)throw TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(t)}return this.uploadFiles(t).then(()=>null)}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:D(D({},e),{},{individualCancellation:!1})})}this.uppy.addUploader(this.handleUpload)}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:D(D({},e),{},{individualCancellation:!0})})}this.uppy.removeUploader(this.handleUpload)}};_.VERSION=p.version,t.exports=_})),Ft=d(c(((e,t)=>{var n=9007199254740991,r=`[object Arguments]`,i=`[object Function]`,a=`[object GeneratorFunction]`,o=/^(?:0|[1-9]\d*)$/;function s(e,t){for(var n=-1,r=e?e.length:0;++n<r&&t(e[n],n,e)!==!1;);return e}function c(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function l(e,t){return function(n){return e(t(n))}}var u=Object.prototype,d=u.hasOwnProperty,f=u.toString,p=u.propertyIsEnumerable,m=l(Object.keys,Object);function h(e,t){var n=E(e)||T(e)?c(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||d.call(e,a))&&!(i&&(a==`length`||S(a,r)))&&n.push(a);return n}var g=b(v),_=x();function v(e,t){return e&&_(e,t,M)}function y(e){if(!C(e))return m(e);var t=[];for(var n in Object(e))d.call(e,n)&&n!=`constructor`&&t.push(n);return t}function b(e,t){return function(n,r){if(n==null)return n;if(!D(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function x(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function S(e,t){return t=t==null?n:t,!!t&&(typeof e==`number`||o.test(e))&&e>-1&&e%1==0&&e<t}function C(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||u)}function w(e,t){return(E(e)?s:g)(e,typeof t==`function`?t:N)}function T(e){return O(e)&&d.call(e,`callee`)&&(!p.call(e,`callee`)||f.call(e)==r)}var E=Array.isArray;function D(e){return e!=null&&A(e.length)&&!k(e)}function O(e){return ee(e)&&D(e)}function k(e){var t=j(e)?f.call(e):``;return t==i||t==a}function A(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}function j(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function ee(e){return!!e&&typeof e==`object`}function M(e){return D(e)?h(e):y(e)}function N(e){return e}t.exports=w}))(),1),It=d(Pt(),1),Lt=d(ht(),1);let Rt=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[n[e]&63];return t};function zt(e){Promise.resolve().then(e)}function Bt(e,t){let[n,r]=e.split(`#`),i=n,a=[];(0,Ft.default)(t,(e,t)=>{a.push(`${t}=${e}`)});let o=a.join(`&`);return i=i.indexOf(`?`)>0?`${i}&${o}`:`${i}?${o}`,r?`${i}#${r}`:i}function Vt(e){return e.replace(/ {2}/g,` &nbsp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/®/g,`&reg;`).replace(/©/g,`&copy;`).replace(/™/g,`&trade;`)}function Ht(e){return e.replace(/&nbsp;/g,` `).replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&reg;/g,`®`).replace(/&copy;/g,`©`).replace(/&trade;/g,`™`).replace(/&quot;/g,`"`)}let Ut=e=>Object.prototype.toString.call(e);O();function Wt(e){return e||{name:``}}function Gt(e){return Object.keys(e).reduce((t,n)=>(t[n]=String(e[n]),t),{})}function Kt(e){if(e)return typeof e==`function`?t=>Gt(e(t)):Gt(e)}function qt(){if(typeof AbortSignal>`u`)return;let e=AbortSignal;typeof e.any!=`function`&&(e.any=e=>{let t=new AbortController,n=r=>{e.forEach(e=>e.removeEventListener(`abort`,n));let i=r.target.reason;t.abort(i)};for(let r of e){if(r.aborted){let e=r.reason;return t.abort(e),t.signal}r.addEventListener(`abort`,n,{once:!0})}return t.signal})}function Jt(e){let{server:t=``,fieldName:n=``,maxFileSize:r=10*1024*1024,maxNumberOfFiles:i=100,meta:a={},metaWithUrl:o=!1,headers:s={},withCredentials:c=!1,timeout:l=10*1e3,onBeforeUpload:u=e=>e,onSuccess:d=(e,t)=>{},onError:f=(e,t,n)=>{console.error(`${e.name} upload error`,t,n)},onProgress:p=e=>{}}=e;if(!t)throw Error(`Cannot get upload server address
16
+ 没有配置上传地址`);if(!n)throw Error(`Cannot get fieldName
17
+ 没有配置 fieldName`);let m=t;o&&(m=Bt(m,a)),qt();let h=Kt(s),g=new Lt.default(D({onBeforeUpload:e=>u(e),restrictions:{maxFileSize:r,maxNumberOfFiles:i},meta:a},e.uppyConfig)).use(It.default,D({endpoint:m,headers:h,formData:!0,fieldName:n,bundle:!1,withCredentials:c,timeout:l},e.xhrConfig));return g.on(`upload-success`,(e,t)=>{let{body:n={}}=t==null?{}:t,r=Wt(e);try{d(r,n)}catch(e){console.error(`wangEditor upload file - onSuccess error`,e)}}),g.on(`progress`,e=>{e<1||p(e)}),g.on(`upload-error`,(e,t,n)=>{let r=Wt(e);try{f(r,t,n)}catch(e){console.error(`wangEditor upload file - onError error`,e)}}),g.on(`restriction-failed`,(e,t)=>{let n=Wt(e);try{f(n,t,void 0)}catch(e){console.error(`wangEditor upload file - onError error`,e)}}),g}var Yt=Jt;function Xt(e,t){return e.uploadAdapter?e.uploadAdapter({config:e,editor:t}):Yt(e)}var Zt=Xt,Qt={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var i=I.transform(n,t,{affinity:r});e.current=i,i==null&&e.unref()}}},$t={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var i=U.transform(n,t,{affinity:r});e.current=i,i==null&&e.unref()}}},en={transform(e,t){var{current:n,affinity:r}=e;if(n!=null){var i=L.transform(n,t,{affinity:r});e.current=i,i==null&&e.unref()}}},tn=new WeakMap,nn=new WeakMap,rn=new WeakMap,an=new WeakMap,on=new WeakMap,sn=new WeakMap,cn=new WeakMap,I={ancestors(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{reverse:n=!1}=t,r=I.levels(e,t);return r=n?r.slice(1):r.slice(0,-1),r},common(e,t){for(var n=[],r=0;r<e.length&&r<t.length;r++){var i=e[r],a=t[r];if(typeof i!=`number`||typeof a!=`number`)throw Error(`Got non-numeric path index`);if(i!==a)break;n.push(i)}return n},compare(e,t){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return 0},endsAfter(e,t){var n=e.length-1,r=e.slice(0,n),i=t.slice(0,n),a=e[n],o=t[n];return I.equals(r,i)&&a>o},endsAt(e,t){var n=e.length,r=e.slice(0,n),i=t.slice(0,n);return I.equals(r,i)},endsBefore(e,t){var n=e.length-1,r=e.slice(0,n),i=t.slice(0,n),a=e[n],o=t[n];return I.equals(r,i)&&a<o},equals(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])},hasPrevious(e){return e[e.length-1]>0},isAfter(e,t){return I.compare(e,t)===1},isAncestor(e,t){return e.length<t.length&&I.compare(e,t)===0},isBefore(e,t){return I.compare(e,t)===-1},isChild(e,t){return e.length===t.length+1&&I.compare(e,t)===0},isCommon(e,t){return e.length<=t.length&&I.compare(e,t)===0},isDescendant(e,t){return e.length>t.length&&I.compare(e,t)===0},isParent(e,t){return e.length+1===t.length&&I.compare(e,t)===0},isPath(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)},isSibling(e,t){if(e.length!==t.length)return!1;var n=e.slice(0,-1),r=t.slice(0,-1);return e[e.length-1]!==t[t.length-1]&&I.equals(n,r)},levels(e){for(var{reverse:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=0;r<=e.length;r++)n.push(e.slice(0,r));return t&&n.reverse(),n},next(e){if(e.length===0)throw Error(`Cannot get the next path of a root path [${e}], because it has no next index.`);var t=e[e.length-1];return e.slice(0,-1).concat(t+1)},operationCanTransformPath(e){switch(e.type){case`insert_node`:case`remove_node`:case`merge_node`:case`split_node`:case`move_node`:return!0;default:return!1}},parent(e){if(e.length===0)throw Error(`Cannot get the parent path of the root path [${e}].`);return e.slice(0,-1)},previous(e){if(e.length===0)throw Error(`Cannot get the previous path of a root path [${e}], because it has no previous index.`);var t=e[e.length-1];if(t<=0)throw Error(`Cannot get the previous path of a first child path [${e}] because it would result in a negative index.`);return e.slice(0,-1).concat(t-1)},relative(e,t){if(!I.isAncestor(t,e)&&!I.equals(e,t))throw Error(`Cannot get the relative path of [${e}] inside ancestor [${t}], because it is not above or equal to the path.`);return e.slice(t.length)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e)return null;var r=[...e],{affinity:i=`forward`}=n;if(e.length===0)return r;switch(t.type){case`insert_node`:var{path:a}=t;(I.equals(a,r)||I.endsBefore(a,r)||I.isAncestor(a,r))&&(r[a.length-1]+=1);break;case`remove_node`:var{path:o}=t;if(I.equals(o,r)||I.isAncestor(o,r))return null;I.endsBefore(o,r)&&--r[o.length-1];break;case`merge_node`:var{path:s,position:c}=t;I.equals(s,r)||I.endsBefore(s,r)?--r[s.length-1]:I.isAncestor(s,r)&&(--r[s.length-1],r[s.length]+=c);break;case`split_node`:var{path:l,position:u}=t;if(I.equals(l,r)){if(i===`forward`)r[r.length-1]+=1;else if(i!==`backward`)return null}else I.endsBefore(l,r)?r[l.length-1]+=1:I.isAncestor(l,r)&&e[l.length]>=u&&(r[l.length-1]+=1,r[l.length]-=u);break;case`move_node`:var{path:d,newPath:f}=t;if(I.equals(d,f))return r;if(I.isAncestor(d,r)||I.equals(d,r)){var p=f.slice();return I.endsBefore(d,f)&&d.length<f.length&&--p[d.length-1],p.concat(r.slice(d.length))}else I.isSibling(d,f)&&(I.isAncestor(f,r)||I.equals(f,r))?I.endsBefore(d,r)?--r[d.length-1]:r[d.length-1]+=1:I.endsBefore(f,r)||I.equals(f,r)||I.isAncestor(f,r)?(I.endsBefore(d,r)&&--r[d.length-1],r[f.length-1]+=1):I.endsBefore(d,r)&&(I.equals(f,r)&&(r[f.length-1]+=1),--r[d.length-1]);break}return r}};function ln(e){"@babel/helpers - typeof";return ln=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ln(e)}function un(e,t){if(ln(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ln(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dn(e){var t=un(e,`string`);return ln(t)===`symbol`?t:String(t)}function fn(e,t,n){return t=dn(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pn(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function mn(e,t){if(e==null)return{};var n=pn(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var hn=[`anchor`,`focus`];function gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gn(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var L={edges(e){var{reverse:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{anchor:n,focus:r}=e;return L.isBackward(e)===t?[n,r]:[r,n]},end(e){var[,t]=L.edges(e);return t},equals(e,t){return U.equals(e.anchor,t.anchor)&&U.equals(e.focus,t.focus)},surrounds(e,t){var n=L.intersection(e,t);return n?L.equals(n,t):!1},includes(e,t){if(H.isRange(t)){if(L.includes(e,t.anchor)||L.includes(e,t.focus))return!0;var[n,r]=L.edges(e),[i,a]=L.edges(t);return U.isBefore(n,i)&&U.isAfter(r,a)}var[o,s]=L.edges(e),c=!1,l=!1;return H.isPoint(t)?(c=U.compare(t,o)>=0,l=U.compare(t,s)<=0):(c=I.compare(t,o.path)>=0,l=I.compare(t,s.path)<=0),c&&l},intersection(e,t){var{anchor:n,focus:r}=e,i=mn(e,hn),[a,o]=L.edges(e),[s,c]=L.edges(t),l=U.isBefore(a,s)?s:a,u=U.isBefore(o,c)?o:c;return U.isBefore(u,l)?null:_n({anchor:l,focus:u},i)},isBackward(e){var{anchor:t,focus:n}=e;return U.isAfter(t,n)},isCollapsed(e){var{anchor:t,focus:n}=e;return U.equals(t,n)},isExpanded(e){return!L.isCollapsed(e)},isForward(e){return!L.isBackward(e)},isRange(e){return En(e)&&U.isPoint(e.anchor)&&U.isPoint(e.focus)},*points(e){yield[e.anchor,`anchor`],yield[e.focus,`focus`]},start(e){var[t]=L.edges(e);return t},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(e===null)return null;var{affinity:r=`inward`}=n,i,a;if(r===`inward`){var o=L.isCollapsed(e);L.isForward(e)?(i=`forward`,a=o?i:`backward`):(i=`backward`,a=o?i:`forward`)}else r===`outward`?L.isForward(e)?(i=`backward`,a=`forward`):(i=`forward`,a=`backward`):(i=r,a=r);var s=U.transform(e.anchor,t,{affinity:i}),c=U.transform(e.focus,t,{affinity:a});return!s||!c?null:{anchor:s,focus:c}}},vn=function(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return!En(e)||typeof e.apply==`function`?!1:t?z.isNodeList(e.children):Array.isArray(e.children)},R={isAncestor(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return En(e)&&z.isNodeList(e.children,{deep:t})},isElement:vn,isElementList(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Array.isArray(e)&&e.every(e=>R.isElement(e,{deep:t}))},isElementProps(e){return e.children!==void 0},isElementType:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`type`;return vn(e)&&e[n]===t},matches(e,t){for(var n in t)if(n!==`children`&&e[n]!==t[n])return!1;return!0}},yn=[`text`],bn=[`children`];function xn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Sn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?xn(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var z={ancestor(e,t){var n=z.get(e,t);if(z.isText(n))throw Error(`Cannot get the ancestor node at path [${t}] because it refers to a text node instead: ${or.stringify(n)}`);return n},ancestors(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of I.ancestors(t,n))yield[z.ancestor(e,r),r]}()},child(e,t){if(z.isText(e))throw Error(`Cannot get the child of a text node: ${or.stringify(e)}`);if(typeof t!=`number`)throw Error(`Expected index to be a number`);var n=e.children[t];if(n==null)throw Error(`Cannot get child at index \`${t}\` in node: ${or.stringify(e)}`);return n},children(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var{reverse:r=!1}=n,i=z.ancestor(e,t),{children:a}=i,o=r?a.length-1:0;r?o>=0:o<a.length;)yield[z.child(i,o),t.concat(o)],o=r?o-1:o+1}()},common(e,t,n){var r=I.common(t,n);return[z.get(e,r),r]},descendant(e,t){var n=z.get(e,t);if(z.isEditor(n))throw Error(`Cannot get the descendant node at path [${t}] because it refers to the root editor node instead: ${or.stringify(n)}`);return n},descendants(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of z.nodes(e,t))r.length!==0&&(yield[n,r])}()},elements(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of z.nodes(e,t))z.isElement(n)&&(yield[n,r])}()},extractProps(e){if(z.isText(e)){var{text:t}=e,n=mn(e,yn);return n}else{var{children:r}=e,n=mn(e,bn);return n}},first(e,t){for(var n=t.slice(),r=z.get(e,n);r&&!(z.isText(r)||r.children.length===0);)r=r.children[0],n.push(0);return[r,n]},fragment(e,t){var n={children:e.children},[r,i]=L.edges(t),a=z.nodes(n,{reverse:!0,pass:e=>{var[,n]=e;return!L.includes(t,n)}}),o=function(){if(!L.includes(t,s)){var e=s[s.length-1];_r(n,I.parent(s),t=>hr(t,e,1))}I.equals(s,i.path)&&vr(n,s,e=>{var t=e.text.slice(0,i.offset);return Sn(Sn({},e),{},{text:t})}),I.equals(s,r.path)&&vr(n,s,e=>{var t=e.text.slice(r.offset);return Sn(Sn({},e),{},{text:t})})};for(var[,s]of a)o();return n.children},get(e,t){var n=z.getIf(e,t);if(n===void 0)throw Error(`Cannot find a descendant at path [${t}] in node: ${or.stringify(e)}`);return n},getIf(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(typeof i!=`number`)throw Error(`Got non-numeric path index`);if(z.isText(n)||!n.children[i])return;n=n.children[i]}return n},has(e,t){for(var n=e,r=0;r<t.length;r++){var i=t[r];if(typeof i!=`number`)throw Error(`Got non-numeric path index`);if(z.isText(n)||!n.children[i])return!1;n=n.children[i]}return!0},isAncestor(e){return!z.isText(e)},isEditor(e){return typeof e.apply==`function`},isElement(e){return Array.isArray(e.children)&&typeof e.apply!=`function`},isNode(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return W.isText(e)||R.isElement(e,{deep:t})||V.isEditor(e,{deep:t})},isNodeList(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Array.isArray(e)&&e.every(e=>z.isNode(e,{deep:t}))},isText(e){return typeof e.text==`string`},last(e,t){for(var n=t.slice(),r=z.get(e,n);r&&!(z.isText(r)||r.children.length===0);){var i=r.children.length-1;r=r.children[i],n.push(i)}return[r,n]},leaf(e,t){var n=z.get(e,t);if(!z.isText(n))throw Error(`Cannot get the leaf node at path [${t}] because it refers to a non-leaf node: ${or.stringify(n)}`);return n},levels(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){for(var r of I.levels(t,n))yield[z.get(e,r),r]}()},matches(e,t){return z.isElement(e)&&R.isElementProps(t)&&R.matches(e,t)||z.isText(e)&&W.isTextProps(t)&&W.matches(e,t)},nodes(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var{pass:n,reverse:r=!1}=t,{from:i=[],to:a}=t,o=new Set,s=[],c=e;!(a&&(r?I.isBefore(s,a):I.isAfter(s,a)));){if(o.has(c)||(yield[c,s]),!o.has(c)&&!z.isText(c)&&c.children.length!==0&&(n==null||n([c,s])===!1)){o.add(c);var l=r?c.children.length-1:0;I.isAncestor(s,i)&&(l=i[s.length]),s=s.concat(l),c=z.get(e,s);continue}if(s.length===0)break;if(!r){var u=I.next(s);if(z.has(e,u)){s=u,c=z.get(e,s);continue}}if(r&&s[s.length-1]!==0){s=I.previous(s),c=z.get(e,s);continue}s=I.parent(s),c=z.get(e,s),o.add(c)}}()},parent(e,t){var n=I.parent(t),r=z.get(e,n);if(z.isText(r))throw Error(`Cannot get the parent of path [${t}] because it does not exist in the root.`);return r},string(e){return z.isText(e)?e.text:e.children.map(z.string).join(``)},texts(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){for(var[n,r]of z.nodes(e,t))z.isText(n)&&(yield[n,r])}()}};function Cn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Cn(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Tn={isNodeOperation(e){return Tn.isOperation(e)&&e.type.endsWith(`_node`)},isOperation(e){if(!En(e))return!1;switch(e.type){case`insert_node`:return I.isPath(e.path)&&z.isNode(e.node);case`insert_text`:return typeof e.offset==`number`&&typeof e.text==`string`&&I.isPath(e.path);case`merge_node`:return typeof e.position==`number`&&I.isPath(e.path)&&En(e.properties);case`move_node`:return I.isPath(e.path)&&I.isPath(e.newPath);case`remove_node`:return I.isPath(e.path)&&z.isNode(e.node);case`remove_text`:return typeof e.offset==`number`&&typeof e.text==`string`&&I.isPath(e.path);case`set_node`:return I.isPath(e.path)&&En(e.properties)&&En(e.newProperties);case`set_selection`:return e.properties===null&&L.isRange(e.newProperties)||e.newProperties===null&&L.isRange(e.properties)||En(e.properties)&&En(e.newProperties);case`split_node`:return I.isPath(e.path)&&typeof e.position==`number`&&En(e.properties);default:return!1}},isOperationList(e){return Array.isArray(e)&&e.every(e=>Tn.isOperation(e))},isSelectionOperation(e){return Tn.isOperation(e)&&e.type.endsWith(`_selection`)},isTextOperation(e){return Tn.isOperation(e)&&e.type.endsWith(`_text`)},inverse(e){switch(e.type){case`insert_node`:return wn(wn({},e),{},{type:`remove_node`});case`insert_text`:return wn(wn({},e),{},{type:`remove_text`});case`merge_node`:return wn(wn({},e),{},{type:`split_node`,path:I.previous(e.path)});case`move_node`:var{newPath:t,path:n}=e;if(I.equals(t,n))return e;if(I.isSibling(n,t))return wn(wn({},e),{},{path:t,newPath:n});var r=I.transform(n,e),i=I.transform(I.next(n),e);return wn(wn({},e),{},{path:r,newPath:i});case`remove_node`:return wn(wn({},e),{},{type:`insert_node`});case`remove_text`:return wn(wn({},e),{},{type:`insert_text`});case`set_node`:var{properties:a,newProperties:o}=e;return wn(wn({},e),{},{properties:o,newProperties:a});case`set_selection`:var{properties:s,newProperties:c}=e;return s==null?wn(wn({},e),{},{properties:c,newProperties:null}):c==null?wn(wn({},e),{},{properties:null,newProperties:s}):wn(wn({},e),{},{properties:c,newProperties:s});case`split_node`:return wn(wn({},e),{},{type:`merge_node`,path:I.next(e.path)})}}},En=e=>typeof e==`object`&&!!e,Dn=(e,t)=>{for(var n in e){var r=Object.hasOwn(e,n)?e[n]:void 0,i=Object.hasOwn(t,n)?t[n]:void 0;if(Array.isArray(r)&&Array.isArray(i)){if(r.length!==i.length)return!1;for(var a=0;a<r.length;a++)if(r[a]!==i[a])return!1}else if(En(r)&&En(i)){if(!Dn(r,i))return!1}else if(r!==i)return!1}for(var o in t)if(e[o]===void 0&&t[o]!==void 0)return!1;return!0},On=e=>e.selection?e.selection:e.children.length>0?V.end(e,[]):[0],kn=(e,t)=>{var[n]=V.node(e,t);return e=>e===n},An=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=!t,r=t?Ln(e):e,i=B.None,a=B.None,o=0,s=null,c=null;for(var l of r){var u=l.codePointAt(0);if(!u)break;var d=Yn(l,u);if([i,a]=n?[a,d]:[d,i],Xn(i,B.ZWJ)&&Xn(a,B.ExtPict)&&(s=er(n?e.substring(0,o):e.substring(0,e.length-o)),!s)||Xn(i,B.RI)&&Xn(a,B.RI)&&(c=c===null?n?!0:nr(e.substring(0,e.length-o)):!c,!c)||i!==B.None&&a!==B.None&&Qn(i,a))break;o+=l.length}return o||1},jn=/\s/,Mn=/[\u002B\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Nn=/['\u2018\u2019]/,Pn=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=0,r=!1;e.length>0;){var i=An(e,t),[a,o]=Fn(e,i,t);if(In(a,o,t))r=!0,n+=i;else if(!r)n+=i;else break;e=o}return n},Fn=(e,t,n)=>{if(n){var r=e.length-t;return[e.slice(r,e.length),e.slice(0,r)]}return[e.slice(0,t),e.slice(t)]},In=function e(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(jn.test(t))return!1;if(Nn.test(t)){var[i,a]=Fn(n,An(n,r),r);if(e(i,a,r))return!0}return!Mn.test(t)},Ln=function*(e){for(var t=e.length-1,n=0;n<e.length;n++){var r=e.charAt(t-n);if(zn(r.charCodeAt(0))){var i=e.charAt(t-n-1);if(Rn(i.charCodeAt(0))){yield i+r,n++;continue}}yield r}},Rn=e=>e>=55296&&e<=56319,zn=e=>e>=56320&&e<=57343,B;(function(e){e[e.None=0]=`None`,e[e.Extend=1]=`Extend`,e[e.ZWJ=2]=`ZWJ`,e[e.RI=4]=`RI`,e[e.Prepend=8]=`Prepend`,e[e.SpacingMark=16]=`SpacingMark`,e[e.L=32]=`L`,e[e.V=64]=`V`,e[e.T=128]=`T`,e[e.LV=256]=`LV`,e[e.LVT=512]=`LVT`,e[e.ExtPict=1024]=`ExtPict`,e[e.Any=2048]=`Any`})(B||(B={}));var Bn=/^(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])$/,Vn=/^(?:[\u0600-\u0605\u06DD\u070F\u0890\u0891\u08E2\u0D4E]|\uD804[\uDCBD\uDCCD\uDDC2\uDDC3]|\uD806[\uDD3F\uDD41\uDE3A\uDE84-\uDE89]|\uD807\uDD46)$/,Hn=/^(?:[\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BF\u09C0\u09C7\u09C8\u09CB\u09CC\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0\u0CC1\u0CC3\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0D02\u0D03\u0D3F\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D82\u0D83\u0DD0\u0DD1\u0DD8-\u0DDE\u0DF2\u0DF3\u0E33\u0EB3\u0F3E\u0F3F\u0F7F\u1031\u103B\u103C\u1056\u1057\u1084\u1715\u1734\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A6D-\u1A72\u1B04\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF7\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD45\uDD46\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDDCE\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF62\uDF63]|\uD805[\uDC35-\uDC37\uDC40\uDC41\uDC45\uDCB1\uDCB2\uDCB9\uDCBB\uDCBC\uDCBE\uDCC1\uDDB0\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF26]|\uD806[\uDC2C-\uDC2E\uDC38\uDD31-\uDD35\uDD37\uDD38\uDD3D\uDD40\uDD42\uDDD1-\uDDD3\uDDDC-\uDDDF\uDDE4\uDE39\uDE57\uDE58\uDE97]|\uD807[\uDC2F\uDC3E\uDCA9\uDCB1\uDCB4\uDD8A-\uDD8E\uDD93\uDD94\uDD96\uDEF5\uDEF6]|\uD81B[\uDF51-\uDF87\uDFF0\uDFF1]|\uD834[\uDD66\uDD6D])$/,Un=/^[\u1100-\u115F\uA960-\uA97C]$/,Wn=/^[\u1160-\u11A7\uD7B0-\uD7C6]$/,Gn=/^[\u11A8-\u11FF\uD7CB-\uD7FB]$/,Kn=/^[\uAC00\uAC1C\uAC38\uAC54\uAC70\uAC8C\uACA8\uACC4\uACE0\uACFC\uAD18\uAD34\uAD50\uAD6C\uAD88\uADA4\uADC0\uADDC\uADF8\uAE14\uAE30\uAE4C\uAE68\uAE84\uAEA0\uAEBC\uAED8\uAEF4\uAF10\uAF2C\uAF48\uAF64\uAF80\uAF9C\uAFB8\uAFD4\uAFF0\uB00C\uB028\uB044\uB060\uB07C\uB098\uB0B4\uB0D0\uB0EC\uB108\uB124\uB140\uB15C\uB178\uB194\uB1B0\uB1CC\uB1E8\uB204\uB220\uB23C\uB258\uB274\uB290\uB2AC\uB2C8\uB2E4\uB300\uB31C\uB338\uB354\uB370\uB38C\uB3A8\uB3C4\uB3E0\uB3FC\uB418\uB434\uB450\uB46C\uB488\uB4A4\uB4C0\uB4DC\uB4F8\uB514\uB530\uB54C\uB568\uB584\uB5A0\uB5BC\uB5D8\uB5F4\uB610\uB62C\uB648\uB664\uB680\uB69C\uB6B8\uB6D4\uB6F0\uB70C\uB728\uB744\uB760\uB77C\uB798\uB7B4\uB7D0\uB7EC\uB808\uB824\uB840\uB85C\uB878\uB894\uB8B0\uB8CC\uB8E8\uB904\uB920\uB93C\uB958\uB974\uB990\uB9AC\uB9C8\uB9E4\uBA00\uBA1C\uBA38\uBA54\uBA70\uBA8C\uBAA8\uBAC4\uBAE0\uBAFC\uBB18\uBB34\uBB50\uBB6C\uBB88\uBBA4\uBBC0\uBBDC\uBBF8\uBC14\uBC30\uBC4C\uBC68\uBC84\uBCA0\uBCBC\uBCD8\uBCF4\uBD10\uBD2C\uBD48\uBD64\uBD80\uBD9C\uBDB8\uBDD4\uBDF0\uBE0C\uBE28\uBE44\uBE60\uBE7C\uBE98\uBEB4\uBED0\uBEEC\uBF08\uBF24\uBF40\uBF5C\uBF78\uBF94\uBFB0\uBFCC\uBFE8\uC004\uC020\uC03C\uC058\uC074\uC090\uC0AC\uC0C8\uC0E4\uC100\uC11C\uC138\uC154\uC170\uC18C\uC1A8\uC1C4\uC1E0\uC1FC\uC218\uC234\uC250\uC26C\uC288\uC2A4\uC2C0\uC2DC\uC2F8\uC314\uC330\uC34C\uC368\uC384\uC3A0\uC3BC\uC3D8\uC3F4\uC410\uC42C\uC448\uC464\uC480\uC49C\uC4B8\uC4D4\uC4F0\uC50C\uC528\uC544\uC560\uC57C\uC598\uC5B4\uC5D0\uC5EC\uC608\uC624\uC640\uC65C\uC678\uC694\uC6B0\uC6CC\uC6E8\uC704\uC720\uC73C\uC758\uC774\uC790\uC7AC\uC7C8\uC7E4\uC800\uC81C\uC838\uC854\uC870\uC88C\uC8A8\uC8C4\uC8E0\uC8FC\uC918\uC934\uC950\uC96C\uC988\uC9A4\uC9C0\uC9DC\uC9F8\uCA14\uCA30\uCA4C\uCA68\uCA84\uCAA0\uCABC\uCAD8\uCAF4\uCB10\uCB2C\uCB48\uCB64\uCB80\uCB9C\uCBB8\uCBD4\uCBF0\uCC0C\uCC28\uCC44\uCC60\uCC7C\uCC98\uCCB4\uCCD0\uCCEC\uCD08\uCD24\uCD40\uCD5C\uCD78\uCD94\uCDB0\uCDCC\uCDE8\uCE04\uCE20\uCE3C\uCE58\uCE74\uCE90\uCEAC\uCEC8\uCEE4\uCF00\uCF1C\uCF38\uCF54\uCF70\uCF8C\uCFA8\uCFC4\uCFE0\uCFFC\uD018\uD034\uD050\uD06C\uD088\uD0A4\uD0C0\uD0DC\uD0F8\uD114\uD130\uD14C\uD168\uD184\uD1A0\uD1BC\uD1D8\uD1F4\uD210\uD22C\uD248\uD264\uD280\uD29C\uD2B8\uD2D4\uD2F0\uD30C\uD328\uD344\uD360\uD37C\uD398\uD3B4\uD3D0\uD3EC\uD408\uD424\uD440\uD45C\uD478\uD494\uD4B0\uD4CC\uD4E8\uD504\uD520\uD53C\uD558\uD574\uD590\uD5AC\uD5C8\uD5E4\uD600\uD61C\uD638\uD654\uD670\uD68C\uD6A8\uD6C4\uD6E0\uD6FC\uD718\uD734\uD750\uD76C\uD788]$/,qn=/^[\uAC01-\uAC1B\uAC1D-\uAC37\uAC39-\uAC53\uAC55-\uAC6F\uAC71-\uAC8B\uAC8D-\uACA7\uACA9-\uACC3\uACC5-\uACDF\uACE1-\uACFB\uACFD-\uAD17\uAD19-\uAD33\uAD35-\uAD4F\uAD51-\uAD6B\uAD6D-\uAD87\uAD89-\uADA3\uADA5-\uADBF\uADC1-\uADDB\uADDD-\uADF7\uADF9-\uAE13\uAE15-\uAE2F\uAE31-\uAE4B\uAE4D-\uAE67\uAE69-\uAE83\uAE85-\uAE9F\uAEA1-\uAEBB\uAEBD-\uAED7\uAED9-\uAEF3\uAEF5-\uAF0F\uAF11-\uAF2B\uAF2D-\uAF47\uAF49-\uAF63\uAF65-\uAF7F\uAF81-\uAF9B\uAF9D-\uAFB7\uAFB9-\uAFD3\uAFD5-\uAFEF\uAFF1-\uB00B\uB00D-\uB027\uB029-\uB043\uB045-\uB05F\uB061-\uB07B\uB07D-\uB097\uB099-\uB0B3\uB0B5-\uB0CF\uB0D1-\uB0EB\uB0ED-\uB107\uB109-\uB123\uB125-\uB13F\uB141-\uB15B\uB15D-\uB177\uB179-\uB193\uB195-\uB1AF\uB1B1-\uB1CB\uB1CD-\uB1E7\uB1E9-\uB203\uB205-\uB21F\uB221-\uB23B\uB23D-\uB257\uB259-\uB273\uB275-\uB28F\uB291-\uB2AB\uB2AD-\uB2C7\uB2C9-\uB2E3\uB2E5-\uB2FF\uB301-\uB31B\uB31D-\uB337\uB339-\uB353\uB355-\uB36F\uB371-\uB38B\uB38D-\uB3A7\uB3A9-\uB3C3\uB3C5-\uB3DF\uB3E1-\uB3FB\uB3FD-\uB417\uB419-\uB433\uB435-\uB44F\uB451-\uB46B\uB46D-\uB487\uB489-\uB4A3\uB4A5-\uB4BF\uB4C1-\uB4DB\uB4DD-\uB4F7\uB4F9-\uB513\uB515-\uB52F\uB531-\uB54B\uB54D-\uB567\uB569-\uB583\uB585-\uB59F\uB5A1-\uB5BB\uB5BD-\uB5D7\uB5D9-\uB5F3\uB5F5-\uB60F\uB611-\uB62B\uB62D-\uB647\uB649-\uB663\uB665-\uB67F\uB681-\uB69B\uB69D-\uB6B7\uB6B9-\uB6D3\uB6D5-\uB6EF\uB6F1-\uB70B\uB70D-\uB727\uB729-\uB743\uB745-\uB75F\uB761-\uB77B\uB77D-\uB797\uB799-\uB7B3\uB7B5-\uB7CF\uB7D1-\uB7EB\uB7ED-\uB807\uB809-\uB823\uB825-\uB83F\uB841-\uB85B\uB85D-\uB877\uB879-\uB893\uB895-\uB8AF\uB8B1-\uB8CB\uB8CD-\uB8E7\uB8E9-\uB903\uB905-\uB91F\uB921-\uB93B\uB93D-\uB957\uB959-\uB973\uB975-\uB98F\uB991-\uB9AB\uB9AD-\uB9C7\uB9C9-\uB9E3\uB9E5-\uB9FF\uBA01-\uBA1B\uBA1D-\uBA37\uBA39-\uBA53\uBA55-\uBA6F\uBA71-\uBA8B\uBA8D-\uBAA7\uBAA9-\uBAC3\uBAC5-\uBADF\uBAE1-\uBAFB\uBAFD-\uBB17\uBB19-\uBB33\uBB35-\uBB4F\uBB51-\uBB6B\uBB6D-\uBB87\uBB89-\uBBA3\uBBA5-\uBBBF\uBBC1-\uBBDB\uBBDD-\uBBF7\uBBF9-\uBC13\uBC15-\uBC2F\uBC31-\uBC4B\uBC4D-\uBC67\uBC69-\uBC83\uBC85-\uBC9F\uBCA1-\uBCBB\uBCBD-\uBCD7\uBCD9-\uBCF3\uBCF5-\uBD0F\uBD11-\uBD2B\uBD2D-\uBD47\uBD49-\uBD63\uBD65-\uBD7F\uBD81-\uBD9B\uBD9D-\uBDB7\uBDB9-\uBDD3\uBDD5-\uBDEF\uBDF1-\uBE0B\uBE0D-\uBE27\uBE29-\uBE43\uBE45-\uBE5F\uBE61-\uBE7B\uBE7D-\uBE97\uBE99-\uBEB3\uBEB5-\uBECF\uBED1-\uBEEB\uBEED-\uBF07\uBF09-\uBF23\uBF25-\uBF3F\uBF41-\uBF5B\uBF5D-\uBF77\uBF79-\uBF93\uBF95-\uBFAF\uBFB1-\uBFCB\uBFCD-\uBFE7\uBFE9-\uC003\uC005-\uC01F\uC021-\uC03B\uC03D-\uC057\uC059-\uC073\uC075-\uC08F\uC091-\uC0AB\uC0AD-\uC0C7\uC0C9-\uC0E3\uC0E5-\uC0FF\uC101-\uC11B\uC11D-\uC137\uC139-\uC153\uC155-\uC16F\uC171-\uC18B\uC18D-\uC1A7\uC1A9-\uC1C3\uC1C5-\uC1DF\uC1E1-\uC1FB\uC1FD-\uC217\uC219-\uC233\uC235-\uC24F\uC251-\uC26B\uC26D-\uC287\uC289-\uC2A3\uC2A5-\uC2BF\uC2C1-\uC2DB\uC2DD-\uC2F7\uC2F9-\uC313\uC315-\uC32F\uC331-\uC34B\uC34D-\uC367\uC369-\uC383\uC385-\uC39F\uC3A1-\uC3BB\uC3BD-\uC3D7\uC3D9-\uC3F3\uC3F5-\uC40F\uC411-\uC42B\uC42D-\uC447\uC449-\uC463\uC465-\uC47F\uC481-\uC49B\uC49D-\uC4B7\uC4B9-\uC4D3\uC4D5-\uC4EF\uC4F1-\uC50B\uC50D-\uC527\uC529-\uC543\uC545-\uC55F\uC561-\uC57B\uC57D-\uC597\uC599-\uC5B3\uC5B5-\uC5CF\uC5D1-\uC5EB\uC5ED-\uC607\uC609-\uC623\uC625-\uC63F\uC641-\uC65B\uC65D-\uC677\uC679-\uC693\uC695-\uC6AF\uC6B1-\uC6CB\uC6CD-\uC6E7\uC6E9-\uC703\uC705-\uC71F\uC721-\uC73B\uC73D-\uC757\uC759-\uC773\uC775-\uC78F\uC791-\uC7AB\uC7AD-\uC7C7\uC7C9-\uC7E3\uC7E5-\uC7FF\uC801-\uC81B\uC81D-\uC837\uC839-\uC853\uC855-\uC86F\uC871-\uC88B\uC88D-\uC8A7\uC8A9-\uC8C3\uC8C5-\uC8DF\uC8E1-\uC8FB\uC8FD-\uC917\uC919-\uC933\uC935-\uC94F\uC951-\uC96B\uC96D-\uC987\uC989-\uC9A3\uC9A5-\uC9BF\uC9C1-\uC9DB\uC9DD-\uC9F7\uC9F9-\uCA13\uCA15-\uCA2F\uCA31-\uCA4B\uCA4D-\uCA67\uCA69-\uCA83\uCA85-\uCA9F\uCAA1-\uCABB\uCABD-\uCAD7\uCAD9-\uCAF3\uCAF5-\uCB0F\uCB11-\uCB2B\uCB2D-\uCB47\uCB49-\uCB63\uCB65-\uCB7F\uCB81-\uCB9B\uCB9D-\uCBB7\uCBB9-\uCBD3\uCBD5-\uCBEF\uCBF1-\uCC0B\uCC0D-\uCC27\uCC29-\uCC43\uCC45-\uCC5F\uCC61-\uCC7B\uCC7D-\uCC97\uCC99-\uCCB3\uCCB5-\uCCCF\uCCD1-\uCCEB\uCCED-\uCD07\uCD09-\uCD23\uCD25-\uCD3F\uCD41-\uCD5B\uCD5D-\uCD77\uCD79-\uCD93\uCD95-\uCDAF\uCDB1-\uCDCB\uCDCD-\uCDE7\uCDE9-\uCE03\uCE05-\uCE1F\uCE21-\uCE3B\uCE3D-\uCE57\uCE59-\uCE73\uCE75-\uCE8F\uCE91-\uCEAB\uCEAD-\uCEC7\uCEC9-\uCEE3\uCEE5-\uCEFF\uCF01-\uCF1B\uCF1D-\uCF37\uCF39-\uCF53\uCF55-\uCF6F\uCF71-\uCF8B\uCF8D-\uCFA7\uCFA9-\uCFC3\uCFC5-\uCFDF\uCFE1-\uCFFB\uCFFD-\uD017\uD019-\uD033\uD035-\uD04F\uD051-\uD06B\uD06D-\uD087\uD089-\uD0A3\uD0A5-\uD0BF\uD0C1-\uD0DB\uD0DD-\uD0F7\uD0F9-\uD113\uD115-\uD12F\uD131-\uD14B\uD14D-\uD167\uD169-\uD183\uD185-\uD19F\uD1A1-\uD1BB\uD1BD-\uD1D7\uD1D9-\uD1F3\uD1F5-\uD20F\uD211-\uD22B\uD22D-\uD247\uD249-\uD263\uD265-\uD27F\uD281-\uD29B\uD29D-\uD2B7\uD2B9-\uD2D3\uD2D5-\uD2EF\uD2F1-\uD30B\uD30D-\uD327\uD329-\uD343\uD345-\uD35F\uD361-\uD37B\uD37D-\uD397\uD399-\uD3B3\uD3B5-\uD3CF\uD3D1-\uD3EB\uD3ED-\uD407\uD409-\uD423\uD425-\uD43F\uD441-\uD45B\uD45D-\uD477\uD479-\uD493\uD495-\uD4AF\uD4B1-\uD4CB\uD4CD-\uD4E7\uD4E9-\uD503\uD505-\uD51F\uD521-\uD53B\uD53D-\uD557\uD559-\uD573\uD575-\uD58F\uD591-\uD5AB\uD5AD-\uD5C7\uD5C9-\uD5E3\uD5E5-\uD5FF\uD601-\uD61B\uD61D-\uD637\uD639-\uD653\uD655-\uD66F\uD671-\uD68B\uD68D-\uD6A7\uD6A9-\uD6C3\uD6C5-\uD6DF\uD6E1-\uD6FB\uD6FD-\uD717\uD719-\uD733\uD735-\uD74F\uD751-\uD76B\uD76D-\uD787\uD789-\uD7A3]$/,Jn=/^(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])$/,Yn=(e,t)=>{var n=B.Any;return e.search(Bn)!==-1&&(n|=B.Extend),t===8205&&(n|=B.ZWJ),t>=127462&&t<=127487&&(n|=B.RI),e.search(Vn)!==-1&&(n|=B.Prepend),e.search(Hn)!==-1&&(n|=B.SpacingMark),e.search(Un)!==-1&&(n|=B.L),e.search(Wn)!==-1&&(n|=B.V),e.search(Gn)!==-1&&(n|=B.T),e.search(Kn)!==-1&&(n|=B.LV),e.search(qn)!==-1&&(n|=B.LVT),e.search(Jn)!==-1&&(n|=B.ExtPict),n};function Xn(e,t){return(e&t)!==0}var Zn=[[B.L,B.L|B.V|B.LV|B.LVT],[B.LV|B.V,B.V|B.T],[B.LVT|B.T,B.T],[B.Any,B.Extend|B.ZWJ],[B.Any,B.SpacingMark],[B.Prepend,B.Any],[B.ZWJ,B.ExtPict],[B.RI,B.RI]];function Qn(e,t){return Zn.findIndex(n=>Xn(e,n[0])&&Xn(t,n[1]))===-1}var $n=/(?:[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDE5\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFA]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62\u0D63\u0D81\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200C\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDEFD-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDE41\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF3E\uDF40\uDF57\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB0\uDCB3-\uDCB8\uDCBA\uDCBD\uDCBF\uDCC0\uDCC2\uDCC3\uDDAF\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD30\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDF00\uDF01\uDF36-\uDF3A\uDF40\uDF42]|\uD80D[\uDC40\uDC47-\uDC55]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65\uDD67-\uDD69\uDD6E-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF])*\u200D$/,er=e=>e.search($n)!==-1,tr=/(?:\uD83C[\uDDE6-\uDDFF])+$/g,nr=e=>{var t=e.match(tr);return t===null?!1:t[0].length/2%2==1},V={above(e,t){return e.above(t)},addMark(e,t,n){e.addMark(t,n)},after(e,t,n){return e.after(t,n)},before(e,t,n){return e.before(t,n)},deleteBackward(e){var{unit:t=`character`}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e.deleteBackward(t)},deleteForward(e){var{unit:t=`character`}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e.deleteForward(t)},deleteFragment(e,t){e.deleteFragment(t)},edges(e,t){return e.edges(t)},elementReadOnly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.elementReadOnly(t)},end(e,t){return e.end(t)},first(e,t){return e.first(t)},fragment(e,t){return e.fragment(t)},hasBlocks(e,t){return e.hasBlocks(t)},hasInlines(e,t){return e.hasInlines(t)},hasPath(e,t){return e.hasPath(t)},hasTexts(e,t){return e.hasTexts(t)},insertBreak(e){e.insertBreak()},insertFragment(e,t,n){e.insertFragment(t,n)},insertNode(e,t){e.insertNode(t)},insertSoftBreak(e){e.insertSoftBreak()},insertText(e,t){e.insertText(t)},isBlock(e,t){return e.isBlock(t)},isEdge(e,t,n){return e.isEdge(t,n)},isEditor:function(e){var{deep:t=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return En(e)?typeof e.above==`function`&&typeof e.addMark==`function`&&typeof e.after==`function`&&typeof e.apply==`function`&&typeof e.before==`function`&&typeof e.collapse==`function`&&typeof e.delete==`function`&&typeof e.deleteBackward==`function`&&typeof e.deleteForward==`function`&&typeof e.deleteFragment==`function`&&typeof e.deselect==`function`&&typeof e.edges==`function`&&typeof e.elementReadOnly==`function`&&typeof e.end==`function`&&typeof e.first==`function`&&typeof e.fragment==`function`&&typeof e.getDirtyPaths==`function`&&typeof e.getFragment==`function`&&typeof e.getMarks==`function`&&typeof e.hasBlocks==`function`&&typeof e.hasInlines==`function`&&typeof e.hasPath==`function`&&typeof e.hasTexts==`function`&&typeof e.insertBreak==`function`&&typeof e.insertFragment==`function`&&typeof e.insertNode==`function`&&typeof e.insertNodes==`function`&&typeof e.insertSoftBreak==`function`&&typeof e.insertText==`function`&&typeof e.isBlock==`function`&&typeof e.isEdge==`function`&&typeof e.isElementReadOnly==`function`&&typeof e.isEmpty==`function`&&typeof e.isEnd==`function`&&typeof e.isInline==`function`&&typeof e.isNormalizing==`function`&&typeof e.isSelectable==`function`&&typeof e.isStart==`function`&&typeof e.isVoid==`function`&&typeof e.last==`function`&&typeof e.leaf==`function`&&typeof e.levels==`function`&&typeof e.liftNodes==`function`&&typeof e.markableVoid==`function`&&typeof e.mergeNodes==`function`&&typeof e.move==`function`&&typeof e.moveNodes==`function`&&typeof e.next==`function`&&typeof e.node==`function`&&typeof e.nodes==`function`&&typeof e.normalize==`function`&&typeof e.normalizeNode==`function`&&typeof e.onChange==`function`&&typeof e.parent==`function`&&typeof e.path==`function`&&typeof e.pathRef==`function`&&typeof e.pathRefs==`function`&&typeof e.point==`function`&&typeof e.pointRef==`function`&&typeof e.pointRefs==`function`&&typeof e.positions==`function`&&typeof e.previous==`function`&&typeof e.range==`function`&&typeof e.rangeRef==`function`&&typeof e.rangeRefs==`function`&&typeof e.removeMark==`function`&&typeof e.removeNodes==`function`&&typeof e.select==`function`&&typeof e.setNodes==`function`&&typeof e.setNormalizing==`function`&&typeof e.setPoint==`function`&&typeof e.setSelection==`function`&&typeof e.shouldMergeNodesRemovePrevNode==`function`&&typeof e.shouldNormalize==`function`&&typeof e.splitNodes==`function`&&typeof e.start==`function`&&typeof e.string==`function`&&typeof e.unhangRange==`function`&&typeof e.unsetNodes==`function`&&typeof e.unwrapNodes==`function`&&typeof e.void==`function`&&typeof e.withoutNormalizing==`function`&&typeof e.wrapNodes==`function`&&(e.marks===null||En(e.marks))&&(e.selection===null||L.isRange(e.selection))&&(t?z.isNodeList(e.children)&&Tn.isOperationList(e.operations):Array.isArray(e.children)&&Array.isArray(e.operations)):!1},isElementReadOnly(e,t){return e.isElementReadOnly(t)},isEmpty(e,t){return e.isEmpty(t)},isEnd(e,t,n){return e.isEnd(t,n)},isInline(e,t){return e.isInline(t)},isNormalizing(e){return e.isNormalizing()},isSelectable(e,t){return e.isSelectable(t)},isStart(e,t,n){return e.isStart(t,n)},isVoid(e,t){return e.isVoid(t)},last(e,t){return e.last(t)},leaf(e,t,n){return e.leaf(t,n)},levels(e,t){return e.levels(t)},marks(e){return e.getMarks()},next(e,t){return e.next(t)},node(e,t,n){return e.node(t,n)},nodes(e,t){return e.nodes(t)},normalize(e,t){e.normalize(t)},parent(e,t,n){return e.parent(t,n)},path(e,t,n){return e.path(t,n)},pathRef(e,t,n){return e.pathRef(t,n)},pathRefs(e){return e.pathRefs()},point(e,t,n){return e.point(t,n)},pointRef(e,t,n){return e.pointRef(t,n)},pointRefs(e){return e.pointRefs()},positions(e,t){return e.positions(t)},previous(e,t){return e.previous(t)},range(e,t,n){return e.range(t,n)},rangeRef(e,t,n){return e.rangeRef(t,n)},rangeRefs(e){return e.rangeRefs()},removeMark(e,t){e.removeMark(t)},setNormalizing(e,t){e.setNormalizing(t)},start(e,t){return e.start(t)},string(e,t,n){return e.string(t,n)},unhangRange(e,t,n){return e.unhangRange(t,n)},void(e,t){return e.void(t)},withoutNormalizing(e,t){e.withoutNormalizing(t)},shouldMergeNodesRemovePrevNode:(e,t,n)=>e.shouldMergeNodesRemovePrevNode(t,n)},H={isLocation(e){return I.isPath(e)||U.isPoint(e)||L.isRange(e)},isPath(e){return Array.isArray(e)},isPoint(e){return`offset`in e},isRange(e){return`anchor`in e},isSpan(e){return Array.isArray(e)&&Array.isArray(e[0])}};function rr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?rr(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var U={compare(e,t){var n=I.compare(e.path,t.path);return n===0?e.offset<t.offset?-1:e.offset>t.offset?1:0:n},isAfter(e,t){return U.compare(e,t)===1},isBefore(e,t){return U.compare(e,t)===-1},equals(e,t){return e.offset===t.offset&&I.equals(e.path,t.path)},isPoint(e){return En(e)&&typeof e.offset==`number`&&I.isPath(e.path)},transform(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(e===null)return null;var{affinity:r=`forward`}=n,{path:i,offset:a}=e;switch(t.type){case`insert_node`:case`move_node`:i=I.transform(i,t,n);break;case`insert_text`:I.equals(t.path,i)&&(t.offset<a||t.offset===a&&r===`forward`)&&(a+=t.text.length);break;case`merge_node`:I.equals(t.path,i)&&(a+=t.position),i=I.transform(i,t,n);break;case`remove_text`:I.equals(t.path,i)&&t.offset<=a&&(a-=Math.min(a-t.offset,t.text.length));break;case`remove_node`:if(I.equals(t.path,i)||I.isAncestor(t.path,i))return null;i=I.transform(i,t,n);break;case`split_node`:if(I.equals(t.path,i)){if(t.position===a&&r==null)return null;(t.position<a||t.position===a&&r===`forward`)&&(a-=t.position,i=I.transform(i,t,ir(ir({},n),{},{affinity:`forward`})))}else i=I.transform(i,t,n);break;default:return e}return{path:i,offset:a}}},ar=void 0,or={setScrubber(e){ar=e},stringify(e){return JSON.stringify(e,ar)}},sr=[`text`],cr=[`anchor`,`focus`,`merge`];function lr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lr(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var W={equals(e,t){var{loose:n=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};function r(e){var{text:t}=e;return mn(e,sr)}return Dn(n?r(e):e,n?r(t):t)},isText(e){return En(e)&&typeof e.text==`string`},isTextList(e){return Array.isArray(e)&&e.every(e=>W.isText(e))},isTextProps(e){return e.text!==void 0},matches(e,t){for(var n in t)if(n!==`text`&&(!e.hasOwnProperty(n)||e[n]!==t[n]))return!1;return!0},decorations(e,t){var n=[{leaf:ur({},e)}];for(var r of t){var{anchor:i,focus:a,merge:o}=r,s=mn(r,cr),[c,l]=L.edges(r),u=[],d=0,f=c.offset,p=l.offset,m=o==null?Object.assign:o;for(var{leaf:h}of n){var{length:g}=h.text,_=d;if(d+=g,f<=_&&d<=p){m(h,s),u.push({leaf:h});continue}if(f!==p&&(f===d||p===_)||f>d||p<_||p===_&&_!==0){u.push({leaf:h});continue}var v=h,y=void 0,b=void 0;if(p<d){var x=p-_;b={leaf:ur(ur({},v),{},{text:v.text.slice(x)})},v=ur(ur({},v),{},{text:v.text.slice(0,x)})}if(f>_){var S=f-_;y={leaf:ur(ur({},v),{},{text:v.text.slice(0,S)})},v=ur(ur({},v),{},{text:v.text.slice(S)})}m(v,s),y&&u.push(y),u.push({leaf:v}),b&&u.push(b)}n=u}if(n.length>1){var C=0;for(var[w,T]of n.entries()){var E=C,D=E+T.leaf.text.length,O={start:E,end:D};w===0&&(O.isFirst=!0),w===n.length-1&&(O.isLast=!0),T.position=O,C=D}}return n}};function dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dr(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var pr=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return[...e.slice(0,t),...r,...e.slice(t)]},mr=function(e,t,n){for(var r=arguments.length,i=Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];return[...e.slice(0,t),...i,...e.slice(t+n)]},hr=mr,gr=(e,t,n)=>{if(t.length===0)throw Error(`Cannot modify the editor`);for(var r=z.get(e,t),i=t.slice(),a=n(r);i.length>1;){var o=i.pop(),s=z.get(e,i);a=fr(fr({},s),{},{children:mr(s.children,o,1,a)})}var c=i.pop();e.children=mr(e.children,c,1,a)},_r=(e,t,n)=>{t.length===0?e.children=n(e.children):gr(e,t,e=>{if(z.isText(e))throw Error(`Cannot get the element at path [${t}] because it refers to a leaf node: ${or.stringify(e)}`);return fr(fr({},e),{},{children:n(e.children)})})},vr=(e,t,n)=>gr(e,t,e=>{if(!z.isText(e))throw Error(`Cannot get the leaf node at path [${t}] because it refers to a non-leaf node: ${or.stringify(e)}`);return n(e)});function yr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yr(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var xr=[`children`,`text`,...Object.getOwnPropertyNames(Object.prototype)],Sr=Object.getOwnPropertyNames(Object.prototype),Cr={transform(e,t){var n=!1;switch(t.type){case`insert_node`:var{path:r,node:i}=t;_r(e,I.parent(r),e=>{var t=r[r.length-1];if(t>e.length)throw Error(`Cannot apply an "insert_node" operation at path [${r}] because the destination is past the end of the node.`);return pr(e,t,i)}),n=!0;break;case`insert_text`:var{path:a,offset:o,text:s}=t;if(s.length===0)break;vr(e,a,e=>{var t=e.text.slice(0,o),n=e.text.slice(o);return br(br({},e),{},{text:t+s+n})}),n=!0;break;case`merge_node`:var{path:c}=t,l=c[c.length-1],u=I.previous(c),d=u[u.length-1];if(c.length===0)throw Error(`Cannot apply a "merge_node" operation at path [${c}] because the root node cannot be merged.`);if(typeof l!=`number`||typeof d!=`number`)throw Error(`Index must be number`);_r(e,I.parent(c),e=>{var t=e[l],n=e[d],r;if(z.isText(t)&&z.isText(n))r=br(br({},n),{},{text:n.text+t.text});else if(z.isElement(t)&&z.isElement(n))r=br(br({},n),{},{children:n.children.concat(t.children)});else throw Error(`Cannot apply a "merge_node" operation at path [${c}] to nodes of different interfaces: ${or.stringify(t)} ${or.stringify(n)}`);return mr(e,d,2,r)}),n=!0;break;case`move_node`:var{path:f,newPath:p}=t,m=f[f.length-1];if(I.isAncestor(f,p))throw Error(`Cannot move a path [${f}] to new path [${p}] because the destination is inside itself.`);var h=z.get(e,f);_r(e,I.parent(f),e=>hr(e,m,1));var g=I.transform(f,t),_=g[g.length-1];_r(e,I.parent(g),e=>pr(e,_,h)),n=!0;break;case`remove_node`:var{path:v}=t,y=v[v.length-1];if(_r(e,I.parent(v),e=>hr(e,y,1)),e.selection){var b=br({},e.selection);for(var[x,S]of L.points(b)){var C=U.transform(x,t);if(b!=null&&C!=null)b[S]=C;else{var w=void 0,T=void 0;for(var[E,D]of z.texts(e))if(I.compare(D,v)===-1)w=[E,D];else{T=[E,D];break}var O=!1;w&&T&&(O=I.isSibling(w[1],v)?!1:I.equals(T[1],v)?!0:I.common(w[1],v).length<I.common(T[1],v).length),w&&!O?b[S]={path:w[1],offset:w[0].text.length}:T?b[S]={path:T[1],offset:0}:b=null}}(!b||!L.equals(b,e.selection))&&(e.selection=b)}break;case`remove_text`:var{path:k,offset:A,text:j}=t;if(j.length===0)break;vr(e,k,e=>{var t=e.text.slice(0,A),n=e.text.slice(A+j.length);return br(br({},e),{},{text:t+n})}),n=!0;break;case`set_node`:var{path:ee,properties:M,newProperties:N}=t;if(ee.length===0)throw Error(`Cannot set properties on the root node!`);gr(e,ee,e=>{var t=br({},e);for(var n in N){if(xr.includes(n))throw Error(`Cannot set the "${n}" property of nodes!`);var r=N[n];if(n===`then`&&typeof r==`function`)throw Error(`Cannot set the "then" property of a node to a function`);r==null?delete t[n]:t[n]=r}for(var i in M)Object.hasOwn(N,i)||delete t[i];return t});break;case`set_selection`:var{newProperties:te}=t;if(te==null){e.selection=null;break}if(e.selection==null){if(!(te.anchor&&te.focus))throw Error(`Cannot apply an incomplete "set_selection" operation properties ${or.stringify(te)} when there is no current selection.`);e.selection=br({},te);break}var P=br({},e.selection);for(var ne in te){if(Sr.includes(ne))throw Error(`Cannot set the "${ne}" property of the selection!`);var re=te[ne];if(ne===`then`&&typeof re==`function`)throw Error(`Cannot set the "then" property of the selection to a function`);if(re==null){if(ne===`anchor`||ne===`focus`)throw Error(`Cannot remove the "${ne}" selection property`);delete P[ne]}else P[ne]=re}e.selection=P;break;case`split_node`:var{path:ie,position:ae,properties:oe}=t,se=ie[ie.length-1];if(ie.length===0)throw Error(`Cannot apply a "split_node" operation at path [${ie}] because the root node cannot be split.`);if(typeof se!=`number`)throw Error(`Index must be number`);_r(e,I.parent(ie),e=>{var t=e[se],n,r;if(z.isText(t)){var i=t.text.slice(0,ae),a=t.text.slice(ae);n=br(br({},t),{},{text:i}),r={text:a}}else{var o=t.children.slice(0,ae),s=t.children.slice(ae);n=br(br({},t),{},{children:o}),r={children:s}}for(var c in oe){if(xr.includes(c))throw Error(`Cannot set the "${c}" property of nodes!`);var l=oe[c];if(c===`then`&&typeof l==`function`)throw Error(`Cannot set the "then" property of a node to a function`);l!=null&&(r[c]=l)}return mr(e,se,1,n,r)}),n=!0;break}if(n&&e.selection){var ce=br({},e.selection);for(var[le,ue]of L.points(ce))ce[ue]=U.transform(le,t);L.equals(ce,e.selection)||(e.selection=ce)}}},wr={insertNodes(e,t,n){e.insertNodes(t,n)},liftNodes(e,t){e.liftNodes(t)},mergeNodes(e,t){e.mergeNodes(t)},moveNodes(e,t){e.moveNodes(t)},removeNodes(e,t){e.removeNodes(t)},setNodes(e,t,n){e.setNodes(t,n)},splitNodes(e,t){e.splitNodes(t)},unsetNodes(e,t,n){e.unsetNodes(t,n)},unwrapNodes(e,t){e.unwrapNodes(t)},wrapNodes(e,t,n){e.wrapNodes(t,n)}},Tr={collapse(e,t){e.collapse(t)},deselect(e){e.deselect()},move(e,t){e.move(t)},select(e,t){e.select(t)},setPoint(e,t,n){e.setPoint(t,n)},setSelection(e,t){e.setSelection(t)}},Er={delete(e,t){e.delete(t)},insertFragment(e,t,n){e.insertFragment(t,n)},insertText(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};V.withoutNormalizing(e,()=>{var{voids:r=!1}=n,{at:i=On(e)}=n;if(H.isPath(i)&&(i=V.range(e,i)),H.isRange(i))if(L.isCollapsed(i))i=i.anchor;else{var a=L.end(i);if(!r&&V.void(e,{at:a}))return;var o=L.start(i),s=V.pointRef(e,o),c=V.pointRef(e,a);G.delete(e,{at:i,voids:r});var l=s.unref(),u=c.unref();i=l||u,G.setSelection(e,{anchor:i,focus:i})}if(!(!r&&V.void(e,{at:i})||V.elementReadOnly(e,{at:i}))){var{path:d,offset:f}=i;t.length>0&&e.apply({type:`insert_text`,path:d,offset:f,text:t})}})}};function Dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Or(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Dr(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var G=Or(Or(Or(Or({},Cr),wr),Tr),Er),kr=new WeakMap,Ar=e=>kr.get(e)||!1,jr=(e,t,n)=>{var r=kr.get(e)||!1;kr.set(e,!0);try{t(),n()}finally{kr.set(e,r)}};function Mr(e,t,n){var r=tn.get(e)||[],i=nn.get(e)||new Set,a,o,s=e=>{if(e){var t=e.join(`,`);o.has(t)||(o.add(t),a.push(e))}};if(n){a=[],o=new Set;for(var c of r)s(n(c))}else a=r,o=i;for(var l of t)s(l);tn.set(e,a),nn.set(e,o)}var Nr=(e,t)=>{for(var n of V.pathRefs(e))Qt.transform(n,t);for(var r of V.pointRefs(e))$t.transform(r,t);for(var i of V.rangeRefs(e))en.transform(i,t);if(!Ar(e)){var a=I.operationCanTransformPath(t)?e=>I.transform(e,t):void 0;Mr(e,e.getDirtyPaths(t),a)}G.transform(e,t),e.operations.push(t),V.normalize(e,{operation:t}),t.type===`set_selection`&&(e.marks=null),rn.get(e)||(rn.set(e,!0),Promise.resolve().then(()=>{rn.set(e,!1),e.onChange({operation:t}),e.operations=[]}))},Pr=(e,t)=>{switch(t.type){case`insert_text`:case`remove_text`:case`set_node`:var{path:n}=t;return I.levels(n);case`insert_node`:var{node:r,path:i}=t,a=I.levels(i),o=z.isText(r)?[]:Array.from(z.nodes(r),e=>{var[,t]=e;return i.concat(t)});return[...a,...o];case`merge_node`:var{path:s}=t,c=I.ancestors(s),l=I.previous(s);return[...c,l];case`move_node`:var{path:u,newPath:d}=t;if(I.equals(u,d))return[];var f=[],p=[];for(var m of I.ancestors(u)){var h=I.transform(m,t);f.push(h)}for(var g of I.ancestors(d)){var _=I.transform(g,t);p.push(_)}var v=p[p.length-1],y=d[d.length-1],b=v.concat(y);return[...f,...p,b];case`remove_node`:var{path:x}=t;return[...I.ancestors(x)];case`split_node`:var{path:S}=t,C=I.levels(S),w=I.next(S);return[...C,w];default:return[]}},Fr=e=>{var{selection:t}=e;return t?z.fragment(e,t):[]},Ir=(e,t,n)=>{var[r,i]=t;if(!z.isText(r)){`children`in r||(r.children=[]);var a=r;if(a!==e&&a.children.length===0&&(G.insertNodes(e,{text:``},{at:i.concat(0),voids:!0}),a=z.get(e,i)),a!==e&&(e.isInline(a)||z.isText(a.children[0])||e.isInline(a.children[0])))for(var o=0;o<a.children.length;o++){var s=a.children[o],c=a.children[o-1];z.isText(s)?c!=null&&z.isText(c)&&(s.text===``?(G.removeNodes(e,{at:i.concat(o),voids:!0}),a=z.get(e,i),o--):c.text===``?(G.removeNodes(e,{at:i.concat(o-1),voids:!0}),a=z.get(e,i),o--):W.equals(s,c,{loose:!0})&&(G.mergeNodes(e,{at:i.concat(o),voids:!0}),a=z.get(e,i),o--)):e.isInline(s)?((c==null||!z.isText(c))&&(G.insertNodes(e,{text:``},{at:i.concat(o),voids:!0}),a=z.get(e,i),o++),o===a.children.length-1&&(G.insertNodes(e,{text:``},{at:i.concat(o+1),voids:!0}),a=z.get(e,i),o++)):(G.unwrapNodes(e,{at:i.concat(o),voids:!0}),a=z.get(e,i),o--)}else for(var l=0;l<a.children.length;l++){var u=a.children[l];(z.isText(u)||e.isInline(u))&&(n!=null&&n.fallbackElement?G.wrapNodes(e,n.fallbackElement(),{at:i.concat(l),voids:!0}):G.removeNodes(e,{at:i.concat(l),voids:!0}),a=z.get(e,i),l--)}}},Lr=(e,t)=>{var{iteration:n,initialDirtyPathsLength:r}=t,i=r*42;if(n>i)throw Error(`Could not completely normalize the editor after ${i} iterations! This is usually due to incorrect normalization logic that leaves a node in an invalid state.`);return!0},Rr=function(e){var{voids:t=!1,mode:n=`lowest`,at:r=e.selection,match:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r){var a=V.path(e,r);if(!H.isRange(r)||I.equals(r.focus.path,r.anchor.path)){if(a.length===0)return;a=I.parent(a)}var o=n===`lowest`,[s]=V.levels(e,{at:a,voids:t,match:i,reverse:o});return s}};function zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zr(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Vr=(e,t,n)=>{var{selection:r}=e;if(r){var i=(t,n)=>{if(!z.isText(t))return!1;var[r,i]=V.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},a=L.isExpanded(r),o=!1;if(!a){var[s,c]=V.node(e,r);if(s&&i(s,c)){var[l]=V.parent(e,c);o=l&&e.markableVoid(l)}}a||o?G.setNodes(e,{[t]:n},{match:i,split:!0,voids:!0}):(e.marks=Br(Br({},V.marks(e)||{}),{},{[t]:n}),rn.get(e)||e.onChange())}};function Hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Hr(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Wr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={anchor:V.point(e,t,{edge:`end`}),focus:V.end(e,[])},{distance:i=1}=n,a=0,o;for(var s of V.positions(e,Ur(Ur({},n),{},{at:r}))){if(a>i)break;a!==0&&(o=s),a++}return o};function Gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gr(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var qr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={anchor:V.start(e,[]),focus:V.point(e,t,{edge:`start`})},{distance:i=1}=n,a=0,o;for(var s of V.positions(e,Kr(Kr({},n),{},{at:r,reverse:!0}))){if(a>i)break;a!==0&&(o=s),a++}return o},Jr=(e,t)=>{var{selection:n}=e;n&&L.isCollapsed(n)&&G.delete(e,{unit:t,reverse:!0})},Yr=(e,t)=>{var{selection:n}=e;n&&L.isCollapsed(n)&&G.delete(e,{unit:t})},Xr=function(e){var{direction:t=`forward`}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:n}=e;n&&L.isExpanded(n)&&G.delete(e,{reverse:t===`backward`})},Zr=(e,t)=>[V.start(e,t),V.end(e,t)];function Qr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Qr(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ei=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return V.above(e,$r($r({},t),{},{match:t=>z.isElement(t)&&V.isElementReadOnly(e,t)}))},ti=(e,t)=>V.point(e,t,{edge:`end`}),ni=(e,t)=>{var n=V.path(e,t,{edge:`start`});return V.node(e,n)},ri=(e,t)=>{var n=V.range(e,t);return z.fragment(e,n)};function ii(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ai(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ii(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ii(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var oi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return V.above(e,ai(ai({},t),{},{match:t=>z.isElement(t)&&V.isVoid(e,t)}))},si=(e,t)=>t.children.some(t=>z.isElement(t)&&V.isBlock(e,t)),ci=(e,t)=>t.children.some(t=>z.isText(t)||V.isInline(e,t)),li=(e,t)=>z.has(e,t),ui=(e,t)=>t.children.every(e=>z.isText(e)),di=e=>{G.splitNodes(e,{always:!0})},fi=(e,t,n)=>{G.insertNodes(e,t,n)},pi=e=>{G.splitNodes(e,{always:!0})};function mi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function hi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mi(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var gi=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:r,marks:i}=e;if(r){if(i){var a=hi({text:t},i);G.insertNodes(e,a,{at:n.at,voids:n.voids})}else G.insertText(e,t,n);e.marks=null}},_i=(e,t)=>!e.isInline(t),vi=(e,t,n)=>V.isStart(e,t,n)||V.isEnd(e,t,n),yi=(e,t)=>{var{children:n}=t,[r]=n;return n.length===0||n.length===1&&z.isText(r)&&r.text===``&&!e.isVoid(t)},bi=(e,t,n)=>{var r=V.end(e,n);return U.equals(t,r)},xi=e=>{var t=an.get(e);return t===void 0?!0:t},Si=(e,t,n)=>{if(t.offset!==0)return!1;var r=V.start(e,n);return U.equals(t,r)},Ci=(e,t)=>{var n=V.path(e,t,{edge:`end`});return V.node(e,n)},wi=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=V.path(e,t,n);return[z.leaf(e,r),r]};function Ti(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,reverse:r=!1,voids:i=!1}=t,{match:a}=t;if(a==null&&(a=()=>!0),n){var o=[],s=V.path(e,n);for(var[c,l]of z.levels(e,s))if(a(c,l)&&(o.push([c,l]),!i&&z.isElement(c)&&V.isVoid(e,c)))break;r&&o.reverse(),yield*o}}()}var Ei=[`text`],Di=[`text`],Oi=function(e){var{marks:t,selection:n}=e;if(!n)return null;var{anchor:r,focus:i}=n;if(t)return t;if(L.isExpanded(n)){if(L.isBackward(n)&&([i,r]=[r,i]),V.isEnd(e,r,r.path)){var a=V.after(e,r);a&&(r=a)}var[o]=V.nodes(e,{match:z.isText,at:{anchor:r,focus:i}});if(o){var[s]=o,{text:c}=s;return mn(s,Ei)}else return{}}var{path:l}=r,[u]=V.leaf(e,l);if(r.offset===0){var d=V.previous(e,{at:l,match:z.isText});if(!V.above(e,{match:t=>z.isElement(t)&&V.isVoid(e,t)&&e.markableVoid(t)})){var f=V.above(e,{match:t=>z.isElement(t)&&V.isBlock(e,t)});if(d&&f){var[p,m]=d,[,h]=f;I.isAncestor(h,m)&&(u=p)}}}var{text:g}=u;return mn(u,Di)},ki=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:n=`lowest`,voids:r=!1}=t,{match:i,at:a=e.selection}=t;if(a){var o=V.after(e,a,{voids:r});if(o){var[,s]=V.last(e,[]),c=[o.path,s];if(H.isPath(a)&&a.length===0)throw Error(`Cannot get the next node from the root node!`);if(i==null)if(H.isPath(a)){var[l]=V.parent(e,a);i=e=>l.children.includes(e)}else i=()=>!0;var[u]=V.nodes(e,{at:c,match:i,mode:n,voids:r});return u}}},Ai=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=V.path(e,t,n);return[z.get(e,r),r]};function ji(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,mode:r=`all`,universal:i=!1,reverse:a=!1,voids:o=!1,pass:s}=t,{match:c}=t;if(c||(c=()=>!0),n){var l,u;if(H.isSpan(n))l=n[0],u=n[1];else{var d=V.path(e,n,{edge:`start`}),f=V.path(e,n,{edge:`end`});l=a?f:d,u=a?d:f}var p=z.nodes(e,{reverse:a,from:l,to:u,pass:t=>{var[n,r]=t;return s&&s([n,r])?!0:z.isElement(n)?!!(!o&&(V.isVoid(e,n)||V.isElementReadOnly(e,n))):!1}}),m=[],h;for(var[g,_]of p){var v=h&&I.compare(_,h[1])===0;if(!(r===`highest`&&v)){if(!c(g,_)){if(i&&!v&&z.isText(g))return;continue}if(r===`lowest`&&v){h=[g,_];continue}var y=r===`lowest`?h:[g,_];y&&(i?m.push(y):yield y),h=[g,_]}}r===`lowest`&&h&&(i?m.push(h):yield h),i&&(yield*m)}}()}var Mi=function(e){var{force:t=!1,operation:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e=>tn.get(e)||[],i=e=>nn.get(e)||new Set,a=e=>{var t=r(e).pop(),n=t.join(`,`);return i(e).delete(n),t};if(V.isNormalizing(e)){if(t){var o=Array.from(z.nodes(e),e=>{var[,t]=e;return t}),s=new Set(o.map(e=>e.join(`,`)));tn.set(e,o),nn.set(e,s)}r(e).length!==0&&V.withoutNormalizing(e,()=>{for(var i of r(e))if(z.has(e,i)){var o=V.node(e,i),[s,c]=o;z.isElement(s)&&s.children.length===0&&e.normalizeNode(o,{operation:n,force:t})}for(var l=r(e),u=l.length,d=0;l.length!==0;){if(!e.shouldNormalize({dirtyPaths:l,iteration:d,initialDirtyPathsLength:u,operation:n}))return;var f=a(e);if(z.has(e,f)){var p=V.node(e,f);e.normalizeNode(p,{operation:n,force:t})}d++,l=r(e)}})}},Ni=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=V.path(e,t,n),i=I.parent(r);return V.node(e,i)},Pi=function(e,t){var{affinity:n=`forward`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={current:t,affinity:n,unref(){var{current:t}=r;return V.pathRefs(e).delete(r),r.current=null,t}};return V.pathRefs(e).add(r),r},Fi=e=>{var t=on.get(e);return t||(t=new Set,on.set(e,t)),t},Ii=function(e,t){var{depth:n,edge:r}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(H.isPath(t)){if(r===`start`){var[,i]=z.first(e,t);t=i}else if(r===`end`){var[,a]=z.last(e,t);t=a}}return H.isRange(t)&&(t=r===`start`?L.start(t):r===`end`?L.end(t):I.common(t.anchor.path,t.focus.path)),H.isPoint(t)&&(t=t.path),n!=null&&(t=t.slice(0,n)),t},Li=function(e,t){var{affinity:n=`forward`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={current:t,affinity:n,unref(){var{current:t}=r;return V.pointRefs(e).delete(r),r.current=null,t}};return V.pointRefs(e).add(r),r},Ri=e=>{var t=sn.get(e);return t||(t=new Set,sn.set(e,t)),t},zi=function(e,t){var{edge:n=`start`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(H.isPath(t)){var r;if(n===`end`){var[,i]=z.last(e,t);r=i}else{var[,a]=z.first(e,t);r=a}var o=z.get(e,r);if(!z.isText(o))throw Error(`Cannot get the ${n} point in the node at path [${t}] because it has no ${n} text node.`);return{path:r,offset:n===`end`?o.text.length:0}}if(H.isRange(t)){var[s,c]=L.edges(t);return n===`start`?s:c}return t};function Bi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){var{at:n=e.selection,unit:r=`offset`,reverse:i=!1,voids:a=!1}=t;if(!n)return;var o=V.range(e,n),[s,c]=L.edges(o),l=i?c:s,u=!1,d=``,f=0,p=0,m=0,h=[],g=function*(t){var n=h.some(e=>I.isAncestor(e,t));function*o(e){n||(yield e)}if(z.isElement(_)){if(!e.isSelectable(_)){if(h.push(t),i)return I.hasPrevious(t)&&(yield*o(V.end(e,I.previous(t)))),0;var g=I.next(t);return V.hasPath(e,g)&&(yield*o(V.start(e,g))),0}if(!a&&(e.isVoid(_)||e.isElementReadOnly(_)))return yield*o(V.start(e,t)),0;if(e.isInline(_))return 0;if(V.hasInlines(e,_)){var v=I.isAncestor(t,c.path)?c:V.end(e,t),b=I.isAncestor(t,s.path)?s:V.start(e,t);d=V.string(e,{anchor:b,focus:v},{voids:a}),u=!0}}if(z.isText(_)){var x=I.equals(t,l.path);for(x?(p=i?l.offset:_.text.length-l.offset,m=l.offset):(p=_.text.length,m=i?p:0),(x||u||r===`offset`)&&(yield*o({path:t,offset:m}),u=!1);;){if(f===0){if(d===``)break;f=y(d,r,i),d=Fn(d,f,i)[1]}if(m=i?m-f:m+f,p-=f,p<0){f=-p;break}f=0,yield*o({path:t,offset:m})}}};for(var[_,v]of V.nodes(e,{at:n,reverse:i,voids:a}))yield*g(v);function y(e,t,n){return t===`character`?An(e,n):t===`word`?Pn(e,n):t===`line`||t===`block`?e.length:1}}()}var Vi=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{mode:n=`lowest`,voids:r=!1}=t,{match:i,at:a=e.selection}=t;if(a){var o=V.before(e,a,{voids:r});if(o){var[,s]=V.first(e,[]),c=[o.path,s];if(H.isPath(a)&&a.length===0)throw Error(`Cannot get the previous node from the root node!`);if(i==null)if(H.isPath(a)){var[l]=V.parent(e,a);i=e=>l.children.includes(e)}else i=()=>!0;var[u]=V.nodes(e,{reverse:!0,at:c,match:i,mode:n,voids:r});return u}}},Hi=function(e,t){var{affinity:n=`forward`}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r={current:t,affinity:n,unref(){var{current:t}=r;return V.rangeRefs(e).delete(r),r.current=null,t}};return V.rangeRefs(e).add(r),r},Ui=e=>{var t=cn.get(e);return t||(t=new Set,cn.set(e,t)),t},Wi=(e,t,n)=>H.isRange(t)&&!n?t:{anchor:V.start(e,t),focus:V.end(e,n||t)};function Gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ki(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Gi(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var qi=(e,t)=>{var{selection:n}=e;if(n){var r=(t,n)=>{if(!z.isText(t))return!1;var[r,i]=V.parent(e,n);return!e.isVoid(r)||e.markableVoid(r)},i=L.isExpanded(n),a=!1;if(!i){var[o,s]=V.node(e,n);if(o&&r(o,s)){var[c]=V.parent(e,s);a=c&&e.markableVoid(c)}}if(i||a)G.unsetNodes(e,t,{match:r,split:!0,voids:!0});else{var l=Ki({},V.marks(e)||{});delete l[t],e.marks=l,rn.get(e)||e.onChange()}}},Ji=(e,t)=>{an.set(e,t)},Yi=(e,t)=>V.point(e,t,{edge:`start`}),Xi=function(e,t){var{voids:n=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=V.range(e,t),[i,a]=L.edges(r),o=``;for(var[s,c]of V.nodes(e,{at:r,match:z.isText,voids:n})){var l=s.text;I.equals(c,a.path)&&(l=l.slice(0,a.offset)),I.equals(c,i.path)&&(l=l.slice(i.offset)),o+=l}return o},Zi=function(e,t){var{voids:n=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[r,i]=L.edges(t);if(r.offset!==0||i.offset!==0||L.isCollapsed(t)||I.hasPrevious(i.path))return t;var a=V.above(e,{at:i,match:t=>z.isElement(t)&&V.isBlock(e,t),voids:n}),o=a?a[1]:[],s={anchor:V.start(e,r),focus:i},c=!0;for(var[l,u]of V.nodes(e,{at:s,match:z.isText,reverse:!0,voids:n})){if(c){c=!1;continue}if(l.text!==``||I.isBefore(u,o)){i={path:u,offset:l.text.length};break}}return{anchor:r,focus:i}},Qi=(e,t)=>{var n=V.isNormalizing(e);V.setNormalizing(e,!1);try{t()}finally{V.setNormalizing(e,n)}V.normalize(e)},$i=(e,t,n)=>{var[r,i]=t,[a,o]=n;return z.isElement(r)&&V.isEmpty(e,r)||z.isText(r)&&r.text===``&&i[i.length-1]!==0},ea=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V.withoutNormalizing(e,()=>{var n,r,{reverse:i=!1,unit:a=`character`,distance:o=1,voids:s=!1}=t,{at:c=e.selection,hanging:l=!1}=t;if(c){var u=!1;if(H.isRange(c)&&L.isCollapsed(c)&&(u=!0,c=c.anchor),H.isPoint(c)){var d=V.void(e,{at:c,mode:`highest`});if(!s&&d){var[,f]=d;c=f}else{var p={unit:a,distance:o},m=i?V.before(e,c,p)||V.start(e,[]):V.after(e,c,p)||V.end(e,[]);c={anchor:c,focus:m},l=!0}}if(H.isPath(c)){G.removeNodes(e,{at:c,voids:s});return}if(!L.isCollapsed(c)){if(!l){var[,h]=L.edges(c),g=V.end(e,[]);U.equals(h,g)||(c=V.unhangRange(e,c,{voids:s}))}var[_,v]=L.edges(c),y=V.above(e,{match:t=>z.isElement(t)&&V.isBlock(e,t),at:_,voids:s}),b=V.above(e,{match:t=>z.isElement(t)&&V.isBlock(e,t),at:v,voids:s}),x=y&&b&&!I.equals(y[1],b[1]),S=I.equals(_.path,v.path),C=s?null:(n=V.void(e,{at:_,mode:`highest`}))==null?V.elementReadOnly(e,{at:_,mode:`highest`}):n,w=s?null:(r=V.void(e,{at:v,mode:`highest`}))==null?V.elementReadOnly(e,{at:v,mode:`highest`}):r;if(C){var T=V.before(e,_);T&&y&&I.isAncestor(y[1],T.path)&&(_=T)}if(w){var E=V.after(e,v);E&&b&&I.isAncestor(b[1],E.path)&&(v=E)}var D=[],O;for(var k of V.nodes(e,{at:c,voids:s})){var[A,j]=k;O&&I.compare(j,O)===0||(!s&&z.isElement(A)&&(V.isVoid(e,A)||V.isElementReadOnly(e,A))||!I.isCommon(j,_.path)&&!I.isCommon(j,v.path))&&(D.push(k),O=j)}var ee=Array.from(D,t=>{var[,n]=t;return V.pathRef(e,n)}),M=V.pointRef(e,_),N=V.pointRef(e,v),te=``;if(!S&&!C){var P=M.current,[ne]=V.leaf(e,P),{path:re}=P,{offset:ie}=_,ae=ne.text.slice(ie);ae.length>0&&(e.apply({type:`remove_text`,path:re,offset:ie,text:ae}),te=ae)}if(ee.reverse().map(e=>e.unref()).filter(e=>e!==null).forEach(t=>G.removeNodes(e,{at:t,voids:s})),!w){var oe=N.current,[se]=V.leaf(e,oe),{path:ce}=oe,le=S?_.offset:0,ue=se.text.slice(le,v.offset);ue.length>0&&(e.apply({type:`remove_text`,path:ce,offset:le,text:ue}),te=ue)}!S&&x&&N.current&&M.current&&G.mergeNodes(e,{at:N.current,hanging:!0,voids:s}),u&&i&&a===`character`&&te.length>1&&te.match(/[\u0980-\u09FF\u0E00-\u0E7F\u1000-\u109F\u0900-\u097F\u1780-\u17FF\u0D00-\u0D7F\u0B00-\u0B7F\u0A00-\u0A7F\u0B80-\u0BFF\u0C00-\u0C7F]+/)&&G.insertText(e,te.slice(0,te.length-o));var de=M.unref(),fe=N.unref(),pe=i?de||fe:fe||de;t.at==null&&pe&&G.select(e,pe)}}})},ta=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};V.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:i=!1}=n,{at:a=On(e),batchDirty:o=!0}=n;if(t.length){if(H.isRange(a))if(r||(a=V.unhangRange(e,a,{voids:i})),L.isCollapsed(a))a=a.anchor;else{var[,s]=L.edges(a);if(!i&&V.void(e,{at:s}))return;var c=V.pointRef(e,s);G.delete(e,{at:a}),a=c.unref()}else H.isPath(a)&&(a=V.start(e,a));if(!(!i&&V.void(e,{at:a}))){var l=V.above(e,{at:a,match:t=>z.isElement(t)&&V.isInline(e,t),mode:`highest`,voids:i});if(l){var[,u]=l;V.isEnd(e,a,u)?a=V.after(e,u):V.isStart(e,a,u)&&(a=V.before(e,u))}var[,d]=V.above(e,{match:t=>z.isElement(t)&&V.isBlock(e,t),at:a,voids:i}),f=V.isStart(e,a,d),p=V.isEnd(e,a,d),m=f&&p,[,h]=z.first({children:t},[]),[,g]=z.last({children:t},[]),_=t=>{var[n,r]=t;return r.length===0?!1:m?!0:!(!f&&I.isAncestor(r,h)&&z.isElement(n)&&!e.isVoid(n)&&!e.isInline(n)||!p&&I.isAncestor(r,g)&&z.isElement(n)&&!e.isVoid(n)&&!e.isInline(n))},v=!0,y=[],b=[],x=[];for(var S of z.nodes({children:t},{pass:_})){var[C,w]=S;v&&z.isElement(C)&&!e.isInline(C)&&!I.isAncestor(w,h)&&(v=!1),_(S)&&(z.isElement(C)&&!e.isInline(C)?(v=!1,b.push(C)):v?y.push(C):x.push(C))}var[T]=V.nodes(e,{at:a,match:t=>z.isText(t)||V.isInline(e,t),mode:`highest`,voids:i}),[,E]=T,D=V.isStart(e,a,E),O=V.isEnd(e,a,E),k=V.pathRef(e,p&&!x.length?I.next(d):d),A=V.pathRef(e,O?I.next(E):E),j=x.length>0;G.splitNodes(e,{at:a,match:t=>j?z.isElement(t)&&V.isBlock(e,t):z.isText(t)||V.isInline(e,t),mode:j?`lowest`:`highest`,always:j&&(!f||y.length>0)&&(!p||x.length>0),voids:i});var ee=V.pathRef(e,!D||D&&O?I.next(E):E);if(G.insertNodes(e,y,{at:ee.current,match:t=>z.isText(t)||V.isInline(e,t),mode:`highest`,voids:i,batchDirty:o}),m&&!y.length&&b.length&&!x.length&&G.delete(e,{at:d,voids:i}),G.insertNodes(e,b,{at:k.current,match:t=>z.isElement(t)&&V.isBlock(e,t),mode:`lowest`,voids:i,batchDirty:o}),G.insertNodes(e,x,{at:A.current,match:t=>z.isText(t)||V.isInline(e,t),mode:`highest`,voids:i,batchDirty:o}),!n.at){var M;if(x.length>0&&A.current?M=I.previous(A.current):b.length>0&&k.current?M=I.previous(k.current):ee.current&&(M=I.previous(ee.current)),M){var N=V.end(e,M);G.select(e,N)}}ee.unref(),k.unref(),A.unref()}}})},na=function(e){var{edge:t=`anchor`}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:n}=e;if(n){if(t===`anchor`)G.select(e,n.anchor);else if(t===`focus`)G.select(e,n.focus);else if(t===`start`){var[r]=L.edges(n);G.select(e,r)}else if(t===`end`){var[,i]=L.edges(n);G.select(e,i)}}else return},ra=e=>{var{selection:t}=e;t&&e.apply({type:`set_selection`,properties:t,newProperties:null})},ia=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{selection:n}=e,{distance:r=1,unit:i=`character`,reverse:a=!1}=t,{edge:o=null}=t;if(n){o===`start`&&(o=L.isBackward(n)?`focus`:`anchor`),o===`end`&&(o=L.isBackward(n)?`anchor`:`focus`);var{anchor:s,focus:c}=n,l={distance:r,unit:i},u={};if(o==null||o===`anchor`){var d=a?V.before(e,s,l):V.after(e,s,l);d&&(u.anchor=d)}if(o==null||o===`focus`){var f=a?V.before(e,c,l):V.after(e,c,l);f&&(u.focus=f)}G.setSelection(e,u)}},aa=(e,t)=>{var{selection:n}=e;if(t=V.range(e,t),n){G.setSelection(e,t);return}if(!H.isRange(t))throw Error(`When setting the selection and the current selection is \`null\` you must provide at least an \`anchor\` and \`focus\`, but you passed: ${or.stringify(t)}`);e.apply({type:`set_selection`,properties:n,newProperties:t})};function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oa(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ca=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},{selection:r}=e,{edge:i=`both`}=n;if(r){i===`start`&&(i=L.isBackward(r)?`focus`:`anchor`),i===`end`&&(i=L.isBackward(r)?`anchor`:`focus`);var{anchor:a,focus:o}=r,s=i===`anchor`?a:o;G.setSelection(e,{[i===`anchor`?`anchor`:`focus`]:sa(sa({},s),t)})}},la=(e,t)=>{var{selection:n}=e,r={},i={};if(n){for(var a in t)if(!Sr.includes(a)){var o=Object.hasOwn(n,a)?n[a]:void 0,s=t[a];ua(a,o,s)&&(r[a]=n[a],i[a]=t[a])}Object.keys(r).length>0&&e.apply({type:`set_selection`,properties:r,newProperties:i})}};function ua(e,t,n){return(e===`anchor`||e===`focus`)&&U.isPoint(t)&&U.isPoint(n)?!U.equals(t,n):t!==n}var da=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};V.withoutNormalizing(e,()=>{var{hanging:r=!1,voids:i=!1,mode:a=`lowest`,batchDirty:o=!0}=n,{at:s,match:c,select:l}=n;if(z.isNode(t)&&(t=[t]),t.length!==0){var[u]=t;if(s||(s=On(e),l!==!1&&(l=!0)),l==null&&(l=!1),H.isRange(s))if(r||(s=V.unhangRange(e,s,{voids:i})),L.isCollapsed(s))s=s.anchor;else{var[,d]=L.edges(s),f=V.pointRef(e,d);G.delete(e,{at:s}),s=f.unref()}if(H.isPoint(s)){c==null&&(c=z.isText(u)?e=>z.isText(e):e.isInline(u)?t=>z.isText(t)||V.isInline(e,t):t=>z.isElement(t)&&V.isBlock(e,t));var[p]=V.nodes(e,{at:s.path,match:c,mode:a,voids:i});if(p){var[,m]=p,h=V.pathRef(e,m),g=V.isEnd(e,s,m);G.splitNodes(e,{at:s,match:c,mode:a,voids:i});var _=h.unref();s=g?I.next(_):_}else return}var v=I.parent(s),y=s[s.length-1];if(!(!i&&V.void(e,{at:v}))){if(o){var b=[],x=I.levels(v);jr(e,()=>{var n=function(){var t=v.concat(y);y++;var n={type:`insert_node`,path:t,node:r};e.apply(n),s=I.next(s),b.push(n),z.isText(r)?x.push(t):x.push(...Array.from(z.nodes(r),e=>{var[,n]=e;return t.concat(n)}))};for(var r of t)n()},()=>{Mr(e,x,e=>{var t=e;for(var n of b)if(I.operationCanTransformPath(n)&&(t=I.transform(t,n),!t))return null;return t})})}else for(var S of t){var C=v.concat(y);y++,e.apply({type:`insert_node`,path:C,node:S}),s=I.next(s)}if(s=I.previous(s),l){var w=V.end(e,s);w&&G.select(e,w)}}}})},fa=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V.withoutNormalizing(e,()=>{var{at:n=e.selection,mode:r=`lowest`,voids:i=!1}=t,{match:a}=t;if(n){a==null&&(a=H.isPath(n)?kn(e,n):t=>z.isElement(t)&&V.isBlock(e,t));var o=V.nodes(e,{at:n,match:a,mode:r,voids:i});for(var s of Array.from(o,t=>{var[,n]=t;return V.pathRef(e,n)})){var c=s.unref();if(c.length<2)throw Error(`Cannot lift node at a path [${c}] because it has a depth of less than \`2\`.`);var[l,u]=V.node(e,I.parent(c)),d=c[c.length-1],{length:f}=l.children;if(f===1){var p=I.next(u);G.moveNodes(e,{at:c,to:p,voids:i}),G.removeNodes(e,{at:u,voids:i})}else if(d===0)G.moveNodes(e,{at:c,to:u,voids:i});else if(d===f-1){var m=I.next(u);G.moveNodes(e,{at:c,to:m,voids:i})}else{var h=I.next(c),g=I.next(u);G.splitNodes(e,{at:h,voids:i}),G.moveNodes(e,{at:c,to:g,voids:i})}}}})},pa=[`text`],ma=[`children`],ha=(e,t)=>t!==e&&(z.isText(t)||V.isVoid(e,t)||t.children.length===1&&ha(e,t.children[0])),ga=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V.withoutNormalizing(e,()=>{var{match:n,at:r=e.selection}=t,{hanging:i=!1,voids:a=!1,mode:o=`lowest`}=t;if(r){var s=H.isPath(r),c=s?r:null,l=n==null&&s;if(n==null)if(s){var[u]=V.parent(e,r);n=e=>u.children.includes(e)}else n=t=>z.isElement(t)&&V.isBlock(e,t);if(!i&&H.isRange(r)&&(r=V.unhangRange(e,r,{voids:a})),H.isRange(r))if(L.isCollapsed(r))r=r.anchor;else{var[,d]=L.edges(r),f=V.pointRef(e,d);G.delete(e,{at:r}),r=f.unref(),t.at==null&&G.select(e,r)}var[p]=V.nodes(e,{at:r,match:n,voids:a,mode:o}),m=l&&c&&I.hasPrevious(c)?I.previous(c):null,h=m?V.node(e,m):V.previous(e,{at:r,match:n,voids:a,mode:o});if(!(!p||!h)){var[g,_]=p,[v,y]=h;if(!(_.length===0||y.length===0)){var b=I.next(y),x=I.common(_,y),S=I.isSibling(_,y),C=Array.from(V.levels(e,{at:_}),e=>{var[t]=e;return t}).slice(x.length).slice(0,-1),w=V.above(e,{at:_,mode:`highest`,match:t=>C.includes(t)&&ha(e,t)}),T=w&&V.pathRef(e,w[1]),E,D;if(z.isText(g)&&z.isText(v)){var{text:O}=g,k=mn(g,pa);D=v.text.length,E=k}else if(z.isElement(g)&&z.isElement(v)){var{children:A}=g,k=mn(g,ma);D=v.children.length,E=k}else throw Error(`Cannot merge the node at path [${_}] with the previous sibling because it is not the same kind: ${or.stringify(g)} ${or.stringify(v)}`);S||G.moveNodes(e,{at:_,to:b,voids:a}),T&&G.removeNodes(e,{at:T.current,voids:a}),V.shouldMergeNodesRemovePrevNode(e,h,p)?G.removeNodes(e,{at:y,voids:a}):e.apply({type:`merge_node`,path:b,position:D,properties:E}),T&&T.unref()}}}})},_a=(e,t)=>{V.withoutNormalizing(e,()=>{var{to:n,at:r=e.selection,mode:i=`lowest`,voids:a=!1}=t,{match:o}=t;if(r){o==null&&(o=H.isPath(r)?kn(e,r):t=>z.isElement(t)&&V.isBlock(e,t));var s=V.pathRef(e,n),c=V.nodes(e,{at:r,match:o,mode:i,voids:a});for(var l of Array.from(c,t=>{var[,n]=t;return V.pathRef(e,n)})){var u=l.unref(),d=s.current;u.length!==0&&e.apply({type:`move_node`,path:u,newPath:d}),s.current&&I.isSibling(d,u)&&I.isAfter(d,u)&&(s.current=I.next(s.current))}s.unref()}})},va=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V.withoutNormalizing(e,()=>{var{hanging:n=!1,voids:r=!1,mode:i=`lowest`}=t,{at:a=e.selection,match:o}=t;if(a){o==null&&(o=H.isPath(a)?kn(e,a):t=>z.isElement(t)&&V.isBlock(e,t)),!n&&H.isRange(a)&&(a=V.unhangRange(e,a,{voids:r}));var s=V.nodes(e,{at:a,match:o,mode:i,voids:r});for(var c of Array.from(s,t=>{var[,n]=t;return V.pathRef(e,n)})){var l=c.unref();if(l){var[u]=V.node(e,l);e.apply({type:`remove_node`,path:l,node:u})}}}})},ya=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};V.withoutNormalizing(e,()=>{var{match:r,at:i=e.selection,compare:a,merge:o}=n,{hanging:s=!1,mode:c=`lowest`,split:l=!1,voids:u=!1}=n;if(i){if(r==null&&(r=H.isPath(i)?kn(e,i):t=>z.isElement(t)&&V.isBlock(e,t)),!s&&H.isRange(i)&&(i=V.unhangRange(e,i,{voids:u})),l&&H.isRange(i)){if(L.isCollapsed(i)&&V.leaf(e,i.anchor)[0].text.length>0)return;var d=V.rangeRef(e,i,{affinity:`inward`}),[f,p]=L.edges(i),m=c===`lowest`?`lowest`:`highest`,h=V.isEnd(e,p,p.path);G.splitNodes(e,{at:p,match:r,mode:m,voids:u,always:!h});var g=V.isStart(e,f,f.path);G.splitNodes(e,{at:f,match:r,mode:m,voids:u,always:!g}),i=d.unref(),n.at==null&&G.select(e,i)}a||(a=(e,t)=>e!==t);for(var[_,v]of V.nodes(e,{at:i,match:r,mode:c,voids:u})){var y={},b={};if(v.length!==0){var x=!1;for(var S in t)if(!xr.includes(S)){var C=Object.hasOwn(_,S)?_[S]:void 0,w=t[S];a(w,C)&&(x=!0,Object.hasOwn(_,S)&&(y[S]=C),o?w!=null&&(b[S]=o(C,w)):w!=null&&(b[S]=w))}x&&e.apply({type:`set_node`,path:v,properties:y,newProperties:b})}}}})},ba=(e,t)=>{if(L.isCollapsed(t))return t.anchor;var[,n]=L.edges(t),r=V.pointRef(e,n);return G.delete(e,{at:t}),r.unref()},xa=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V.withoutNormalizing(e,()=>{var{mode:n=`lowest`,voids:r=!1}=t,{match:i,at:a=e.selection,height:o=0,always:s=!1}=t;if(a&&(i==null&&(i=t=>z.isElement(t)&&V.isBlock(e,t)),!(H.isRange(a)&&(a=ba(e,a),!a)))){if(H.isPath(a)){var c=a,l=V.point(e,c),[u]=V.parent(e,c);i=e=>e===u,o=l.path.length-c.length+1,a=l,s=!0}var d=V.pointRef(e,a,{affinity:`backward`}),f;try{var[p]=V.nodes(e,{at:a,match:i,mode:n,voids:r});if(!p)return;var m=V.void(e,{at:a,mode:`highest`}),h=0;if(!r&&m){var[g,_]=m;if(e.isInline(g)){var v=V.after(e,_);if(!v){var y={text:``},b=I.next(_);G.insertNodes(e,y,{at:b,voids:r}),v=V.point(e,b)}a=v,s=!0}o=a.path.length-_.length+1,s=!0}f=V.pointRef(e,a);var x=a.path.length-o,[,S]=p,C=a.path.slice(0,x),w=o===0?a.offset:a.path[x]+h;for(var[T,E]of V.levels(e,{at:C,reverse:!0,voids:r})){var D=!1;if(E.length<S.length||E.length===0||!r&&z.isElement(T)&&V.isVoid(e,T))break;var O=d.current,k=V.isEnd(e,O,E);if(s||!d||!V.isEdge(e,O,E)){D=!0;var A=z.extractProps(T);e.apply({type:`split_node`,path:E,position:w,properties:A})}w=E[E.length-1]+(D||k?1:0)}if(t.at==null){var j=f.current||V.end(e,[]);G.select(e,j)}}finally{var ee;d.unref(),(ee=f)==null||ee.unref()}}})},Sa=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Array.isArray(t)||(t=[t]);var r={};for(var i of t)r[i]=null;G.setNodes(e,r,n)},Ca=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};V.withoutNormalizing(e,()=>{var{mode:n=`lowest`,split:r=!1,voids:i=!1}=t,{at:a=e.selection,match:o}=t;if(a){o==null&&(o=H.isPath(a)?kn(e,a):t=>z.isElement(t)&&V.isBlock(e,t)),H.isPath(a)&&(a=V.range(e,a));var s=H.isRange(a)?V.rangeRef(e,a):null,c=V.nodes(e,{at:a,match:o,mode:n,voids:i}),l=Array.from(c,t=>{var[,n]=t;return V.pathRef(e,n)}).reverse(),u=function(){var t=d.unref(),[n]=V.node(e,t),a=V.range(e,t);r&&s&&(a=L.intersection(s.current,a)),G.liftNodes(e,{at:a,match:e=>!z.isText(n)&&n.children.includes(e),voids:i})};for(var d of l)u();s&&s.unref()}})};function wa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wa(Object(n),!0).forEach(function(t){fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ea=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};V.withoutNormalizing(e,()=>{var{mode:r=`lowest`,split:i=!1,voids:a=!1}=n,{match:o,at:s=e.selection}=n;if(s){if(o==null&&(o=H.isPath(s)?kn(e,s):e.isInline(t)?t=>z.isElement(t)&&V.isInline(e,t)||z.isText(t):t=>z.isElement(t)&&V.isBlock(e,t)),i&&H.isRange(s)){var[c,l]=L.edges(s),u=V.rangeRef(e,s,{affinity:`inward`}),d=t=>{var n=V.above(e,{at:t,match:t=>z.isElement(t)&&V.isBlock(e,t)});return n&&V.isEdge(e,t,n[1])};G.splitNodes(e,{at:l,match:o,voids:a,always:!d(l)}),G.splitNodes(e,{at:c,match:o,voids:a,always:!d(c)}),s=u.unref(),n.at==null&&G.select(e,s)}var f=Array.from(V.nodes(e,{at:s,match:e.isInline(t)?t=>z.isElement(t)&&V.isBlock(e,t):e=>z.isEditor(e),mode:`lowest`,voids:a})),p=function(){var n=H.isRange(s)?L.intersection(s,V.range(e,m)):s;if(!n)return 0;var i=Array.from(V.nodes(e,{at:n,match:o,mode:r,voids:a}));if(i.length>0){var[c]=i,l=i[i.length-1],[,u]=c,[,d]=l;if(u.length===0&&d.length===0)return 0;var f=I.equals(u,d)?I.parent(u):I.common(u,d),p=V.range(e,u,d),[h]=V.node(e,f),g=f.length+1,_=I.next(d.slice(0,g)),v=Ta(Ta({},t),{},{children:[]});G.insertNodes(e,v,{at:_,voids:a}),G.moveNodes(e,{at:p,match:e=>!z.isText(h)&&h.children.includes(e),to:_.concat(0),voids:a})}};for(var[,m]of f)p()}})},Da=()=>{var e={children:[],operations:[],selection:null,marks:null,isElementReadOnly:()=>!1,isInline:()=>!1,isSelectable:()=>!0,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Nr(e,...n)},addMark:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Vr(e,...n)},deleteBackward:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Jr(e,...n)},deleteForward:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Yr(e,...n)},deleteFragment:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xr(e,...n)},getFragment:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fr(e,...n)},insertBreak:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return di(e,...n)},insertSoftBreak:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return pi(e,...n)},insertFragment:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ta(e,...n)},insertNode:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return fi(e,...n)},insertText:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return gi(e,...n)},normalizeNode:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ir(e,...n)},removeMark:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return qi(e,...n)},getDirtyPaths:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Pr(e,...n)},shouldNormalize:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Lr(e,...n)},above:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Rr(e,...n)},after:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Wr(e,...n)},before:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return qr(e,...n)},collapse:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return na(e,...n)},delete:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ea(e,...n)},deselect:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ra(e,...n)},edges:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Zr(e,...n)},elementReadOnly:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ei(e,...n)},end:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ti(e,...n)},first:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ni(e,...n)},fragment:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ri(e,...n)},getMarks:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Oi(e,...n)},hasBlocks:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return si(e,...n)},hasInlines:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ci(e,...n)},hasPath:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return li(e,...n)},hasTexts:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ui(e,...n)},insertNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return da(e,...n)},isBlock:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return _i(e,...n)},isEdge:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return vi(e,...n)},isEmpty:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return yi(e,...n)},isEnd:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return bi(e,...n)},isNormalizing:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return xi(e,...n)},isStart:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Si(e,...n)},last:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ci(e,...n)},leaf:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return wi(e,...n)},levels:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ti(e,...n)},liftNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return fa(e,...n)},mergeNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ga(e,...n)},move:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ia(e,...n)},moveNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return _a(e,...n)},next:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ki(e,...n)},node:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ai(e,...n)},nodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ji(e,...n)},normalize:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Mi(e,...n)},parent:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ni(e,...n)},path:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ii(e,...n)},pathRef:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Pi(e,...n)},pathRefs:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fi(e,...n)},point:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return zi(e,...n)},pointRef:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Li(e,...n)},pointRefs:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ri(e,...n)},positions:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Bi(e,...n)},previous:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Vi(e,...n)},range:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Wi(e,...n)},rangeRef:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Hi(e,...n)},rangeRefs:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ui(e,...n)},removeNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return va(e,...n)},select:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return aa(e,...n)},setNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ya(e,...n)},setNormalizing:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ji(e,...n)},setPoint:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ca(e,...n)},setSelection:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return la(e,...n)},splitNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return xa(e,...n)},start:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Yi(e,...n)},string:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Xi(e,...n)},unhangRange:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Zi(e,...n)},unsetNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Sa(e,...n)},unwrapNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ca(e,...n)},void:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return oi(e,...n)},withoutNormalizing:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Qi(e,...n)},wrapNodes:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ea(e,...n)},shouldMergeNodesRemovePrevNode:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return $i(e,...n)}};return e},Oa=d(c(((e,t)=>{var n=200,r=`__lodash_hash_undefined__`,i=9007199254740991,a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object GeneratorFunction]`,f=`[object Map]`,p=`[object Number]`,m=`[object Object]`,h=`[object Promise]`,g=`[object RegExp]`,_=`[object Set]`,v=`[object String]`,y=`[object Symbol]`,b=`[object WeakMap]`,x=`[object ArrayBuffer]`,S=`[object DataView]`,C=`[object Float32Array]`,w=`[object Float64Array]`,T=`[object Int8Array]`,E=`[object Int16Array]`,D=`[object Int32Array]`,O=`[object Uint8Array]`,k=`[object Uint8ClampedArray]`,A=`[object Uint16Array]`,j=`[object Uint32Array]`,ee=/[\\^$.*+?()[\]{}|]/g,M=/\w*$/,N=/^\[object .+?Constructor\]$/,te=/^(?:0|[1-9]\d*)$/,P={};P[a]=P[o]=P[x]=P[S]=P[s]=P[c]=P[C]=P[w]=P[T]=P[E]=P[D]=P[f]=P[p]=P[m]=P[g]=P[_]=P[v]=P[y]=P[O]=P[k]=P[A]=P[j]=!0,P[l]=P[u]=P[b]=!1;var ne=typeof global==`object`&&global&&global.Object===Object&&global,re=typeof self==`object`&&self&&self.Object===Object&&self,ie=ne||re||Function(`return this`)(),ae=typeof e==`object`&&e&&!e.nodeType&&e,oe=ae&&typeof t==`object`&&t&&!t.nodeType&&t,se=oe&&oe.exports===ae;function ce(e,t){return e.set(t[0],t[1]),e}function le(e,t){return e.add(t),e}function ue(e,t){for(var n=-1,r=e?e.length:0;++n<r&&t(e[n],n,e)!==!1;);return e}function de(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function fe(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function pe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function me(e,t){return e==null?void 0:e[t]}function he(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch(e){}return t}function ge(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function _e(e,t){return function(n){return e(t(n))}}function ve(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var ye=Array.prototype,be=Function.prototype,xe=Object.prototype,Se=ie[`__core-js_shared__`],Ce=function(){var e=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),we=be.toString,Te=xe.hasOwnProperty,Ee=xe.toString,De=RegExp(`^`+we.call(Te).replace(ee,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Oe=se?ie.Buffer:void 0,ke=ie.Symbol,Ae=ie.Uint8Array,je=_e(Object.getPrototypeOf,Object),Me=Object.create,Ne=xe.propertyIsEnumerable,Pe=ye.splice,Fe=Object.getOwnPropertySymbols,Ie=Oe?Oe.isBuffer:void 0,Le=_e(Object.keys,Object),Re=Ut(ie,`DataView`),ze=Ut(ie,`Map`),Be=Ut(ie,`Promise`),Ve=Ut(ie,`Set`),He=Ut(ie,`WeakMap`),Ue=Ut(Object,`create`),We=$t(Re),Ge=$t(ze),Ke=$t(Be),qe=$t(Ve),F=$t(He),Je=ke?ke.prototype:void 0,Ye=Je?Je.valueOf:void 0;function Xe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ze(){this.__data__=Ue?Ue(null):{}}function Qe(e){return this.has(e)&&delete this.__data__[e]}function $e(e){var t=this.__data__;if(Ue){var n=t[e];return n===r?void 0:n}return Te.call(t,e)?t[e]:void 0}function et(e){var t=this.__data__;return Ue?t[e]!==void 0:Te.call(t,e)}function tt(e,t){var n=this.__data__;return n[e]=Ue&&t===void 0?r:t,this}Xe.prototype.clear=Ze,Xe.prototype.delete=Qe,Xe.prototype.get=$e,Xe.prototype.has=et,Xe.prototype.set=tt;function nt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function rt(){this.__data__=[]}function it(e){var t=this.__data__,n=St(t,e);return n<0?!1:(n==t.length-1?t.pop():Pe.call(t,n,1),!0)}function at(e){var t=this.__data__,n=St(t,e);return n<0?void 0:t[n][1]}function ot(e){return St(this.__data__,e)>-1}function st(e,t){var n=this.__data__,r=St(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}nt.prototype.clear=rt,nt.prototype.delete=it,nt.prototype.get=at,nt.prototype.has=ot,nt.prototype.set=st;function ct(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function lt(){this.__data__={hash:new Xe,map:new(ze||nt),string:new Xe}}function ut(e){return Ht(this,e).delete(e)}function dt(e){return Ht(this,e).get(e)}function ft(e){return Ht(this,e).has(e)}function pt(e,t){return Ht(this,e).set(e,t),this}ct.prototype.clear=lt,ct.prototype.delete=ut,ct.prototype.get=dt,ct.prototype.has=ft,ct.prototype.set=pt;function mt(e){this.__data__=new nt(e)}function ht(){this.__data__=new nt}function gt(e){return this.__data__.delete(e)}function _t(e){return this.__data__.get(e)}function vt(e){return this.__data__.has(e)}function yt(e,t){var r=this.__data__;if(r instanceof nt){var i=r.__data__;if(!ze||i.length<n-1)return i.push([e,t]),this;r=this.__data__=new ct(i)}return r.set(e,t),this}mt.prototype.clear=ht,mt.prototype.delete=gt,mt.prototype.get=_t,mt.prototype.has=vt,mt.prototype.set=yt;function bt(e,t){var n=rn(e)||nn(e)?pe(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||Te.call(e,a))&&!(i&&(a==`length`||Yt(a,r)))&&n.push(a);return n}function xt(e,t,n){var r=e[t];(!(Te.call(e,t)&&tn(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function St(e,t){for(var n=e.length;n--;)if(tn(e[n][0],t))return n;return-1}function Ct(e,t){return e&&zt(t,dn(t),e)}function wt(e,t,n,r,i,o,s){var c;if(r&&(c=o?r(e,i,o,s):r(e)),c!==void 0)return c;if(!ln(e))return e;var l=rn(e);if(l){if(c=Kt(e),!t)return Rt(e,c)}else{var f=Gt(e),p=f==u||f==d;if(sn(e))return At(e,t);if(f==m||f==a||p&&!o){if(he(e))return o?e:{};if(c=qt(p?{}:e),!t)return Bt(e,Ct(c,e))}else{if(!P[f])return o?e:{};c=Jt(e,f,wt,t)}}s||(s=new mt);var h=s.get(e);if(h)return h;if(s.set(e,c),!l)var g=n?Vt(e):dn(e);return ue(g||e,function(i,a){g&&(a=i,i=e[a]),xt(c,a,wt(i,t,n,r,a,e,s))}),c}function Tt(e){return ln(e)?Me(e):{}}function Et(e,t,n){var r=t(e);return rn(e)?r:de(r,n(e))}function Dt(e){return Ee.call(e)}function Ot(e){return!ln(e)||Zt(e)?!1:(cn(e)||he(e)?De:N).test($t(e))}function kt(e){if(!Qt(e))return Le(e);var t=[];for(var n in Object(e))Te.call(e,n)&&n!=`constructor`&&t.push(n);return t}function At(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function jt(e){var t=new e.constructor(e.byteLength);return new Ae(t).set(new Ae(e)),t}function Mt(e,t){var n=t?jt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Nt(e,t,n){return fe(t?n(ge(e),!0):ge(e),ce,new e.constructor)}function Pt(e){var t=new e.constructor(e.source,M.exec(e));return t.lastIndex=e.lastIndex,t}function Ft(e,t,n){return fe(t?n(ve(e),!0):ve(e),le,new e.constructor)}function It(e){return Ye?Object(Ye.call(e)):{}}function Lt(e,t){var n=t?jt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Rt(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function zt(e,t,n,r){n||(n={});for(var i=-1,a=t.length;++i<a;){var o=t[i],s=r?r(n[o],e[o],o,n,e):void 0;xt(n,o,s===void 0?e[o]:s)}return n}function Bt(e,t){return zt(e,Wt(e),t)}function Vt(e){return Et(e,dn,Wt)}function Ht(e,t){var n=e.__data__;return Xt(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Ut(e,t){var n=me(e,t);return Ot(n)?n:void 0}var Wt=Fe?_e(Fe,Object):fn,Gt=Dt;(Re&&Gt(new Re(new ArrayBuffer(1)))!=S||ze&&Gt(new ze)!=f||Be&&Gt(Be.resolve())!=h||Ve&&Gt(new Ve)!=_||He&&Gt(new He)!=b)&&(Gt=function(e){var t=Ee.call(e),n=t==m?e.constructor:void 0,r=n?$t(n):void 0;if(r)switch(r){case We:return S;case Ge:return f;case Ke:return h;case qe:return _;case F:return b}return t});function Kt(e){var t=e.length,n=e.constructor(t);return t&&typeof e[0]==`string`&&Te.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function qt(e){return typeof e.constructor==`function`&&!Qt(e)?Tt(je(e)):{}}function Jt(e,t,n,r){var i=e.constructor;switch(t){case x:return jt(e);case s:case c:return new i(+e);case S:return Mt(e,r);case C:case w:case T:case E:case D:case O:case k:case A:case j:return Lt(e,r);case f:return Nt(e,r,n);case p:case v:return new i(e);case g:return Pt(e);case _:return Ft(e,r,n);case y:return It(e)}}function Yt(e,t){return t=t==null?i:t,!!t&&(typeof e==`number`||te.test(e))&&e>-1&&e%1==0&&e<t}function Xt(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Zt(e){return!!Ce&&Ce in e}function Qt(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||xe)}function $t(e){if(e!=null){try{return we.call(e)}catch(e){}try{return e+``}catch(e){}}return``}function en(e){return wt(e,!0,!0)}function tn(e,t){return e===t||e!==e&&t!==t}function nn(e){return on(e)&&Te.call(e,`callee`)&&(!Ne.call(e,`callee`)||Ee.call(e)==a)}var rn=Array.isArray;function an(e){return e!=null&&I(e.length)&&!cn(e)}function on(e){return un(e)&&an(e)}var sn=Ie||pn;function cn(e){var t=ln(e)?Ee.call(e):``;return t==u||t==d}function I(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=i}function ln(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function un(e){return!!e&&typeof e==`object`}function dn(e){return an(e)?bt(e):kt(e)}function fn(){return[]}function pn(){return!1}t.exports=en}))(),1);let ka=new Set([`base`,`embed`,`math`,`meta`,`object`,`script`,`svg`]),Aa=new Set([`href`,`poster`,`src`,`xlink:href`]),ja=[`java`,`script:`].join(``);function Ma(e){return Array.from(e).filter(e=>e>` `).join(``).toLowerCase()}function Na(e,t,n){let r=Ma(n);return r?r.startsWith(ja)||r.startsWith(`vbscript:`)?!1:r.startsWith(`data:`)?t===`href`||t===`xlink:href`?!1:e===`img`||t===`poster`?r.startsWith(`data:image/`):!1:!0:!0}function Pa(e=``){if(!e)return``;let t=document.createElement(`div`);t.innerHTML=e;let n=e=>{Array.from(e.childNodes).forEach(e=>{if(!(e instanceof Element))return;let t=e,r=t.tagName.toLowerCase();if(r===`template`){let e=t,n=Pa(e.innerHTML);if(!n){e.remove();return}e.insertAdjacentHTML(`beforebegin`,n),e.remove();return}if(ka.has(r)){t.remove();return}Array.from(t.attributes).forEach(e=>{let n=e.name.toLowerCase(),i=e.value||``;if(n===`srcdoc`||n.startsWith(`on`)){t.removeAttribute(e.name);return}Aa.has(n)&&!Na(r,n,i)&&t.removeAttribute(e.name)}),n(t)})};return n(t),t.innerHTML}let Fa={};function Ia(e,t){t!=null&&(Fa[e]=t)}O();function La(e={}){let t=(0,Oa.default)(Fa),n={},{MENU_CONF:r={}}=e;return(0,Ft.default)(t,(e,t)=>{n[t]=D(D({},e),r[t]||{})}),delete e.MENU_CONF,D({scroll:!0,readOnly:!1,autoFocus:!0,decorate:()=>[],maxLength:0,imageResize:{},MENU_CONF:n,hoverbarKeys:{},textStyleMode:`inline`,classStylePolicy:`preserve-data`,sanitizeHtml:Pa,customAlert(e,t){window.alert(`${t}:\n${e}`)}},e)}function Ra(e){return D({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},e||{})}let za={CREATED:`created`,DESTROYED:`destroyed`,CHANGE:`change`,SCROLL:`scroll`,FULLSCREEN:`fullscreen`,UNFULLSCREEN:`unFullScreen`,MODALORPANELSHOW:`modalOrPanelShow`,MODALORPANELHIDE:`modalOrPanelHide`};O();let Ba={};function Va(e,t){let{key:n,factory:r,config:i}=e,a=D(D({},i),t||{});if(Ba[n]!=null)throw Error(`Duplicated key '${n}' in menu items`);Ba[n]=r,Ia(n,a)}let Ha=new WeakMap,Ua=new WeakMap,Wa=new WeakMap,Ga=new WeakMap,Ka=new WeakMap,qa=new WeakMap,Ja=new WeakMap,Ya=new WeakMap,Xa=new WeakMap,Za=new WeakMap,Qa=new WeakMap,$a=new WeakMap,eo=new WeakMap,to=new WeakMap,no=new WeakMap,ro=new WeakMap,io=new WeakMap,ao=new WeakMap,oo=new WeakMap,so=new WeakMap,co=new WeakMap,lo=new WeakMap,uo=new WeakMap,fo=new WeakMap,po=new WeakMap,mo=new WeakMap,ho=new WeakMap,go=new WeakMap,_o=new WeakMap,vo=e=>{let t=e;return t.getAllMenuKeys=()=>{let e=[];for(let t in Ba)e.push(t);return e},t.getConfig=()=>{let e=Za.get(t);if(e==null)throw Error(`Can not get editor config`);return e},t.getMenuConfig=e=>{let{MENU_CONF:n={}}=t.getConfig();return n[e]||{}},t.alert=(e,n=`info`)=>{let{customAlert:r}=t.getConfig();r&&r(e,n)},t},yo=new Set([`doctype`,`!doctype`,`meta`,`script`,`style`,`link`,`frame`,`iframe`,`title`,`svg`]);function bo(e){return typeof e==`object`&&!!e&&`constructor`in e&&e.constructor===Object}function xo(e={},t={}){Object.keys(t).forEach(n=>{e[n]===void 0?e[n]=t[n]:bo(t[n])&&bo(e[n])&&Object.keys(t[n]).length>0&&xo(e[n],t[n])})}let So={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:``},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:``,host:``,hostname:``,href:``,origin:``,pathname:``,protocol:``,search:``}};function Co(){let e=typeof document<`u`?document:{};return xo(e,So),e}let wo={document:So,navigator:{userAgent:``},location:{hash:``,host:``,hostname:``,href:``,origin:``,pathname:``,protocol:``,search:``},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return``}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(e){return typeof setTimeout>`u`?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>`u`||clearTimeout(e)}};function To(){let e=typeof window<`u`?window:{};return xo(e,wo),e}function Eo(e){let t=e.__proto__;Object.defineProperty(e,`__proto__`,{get(){return t},set(e){t.__proto__=e}})}var Do=class extends Array{constructor(e){typeof e==`number`?super(e):(super(...e||[]),Eo(this))}};function Oo(e=[]){let t=[];return e.forEach(e=>{Array.isArray(e)?t.push(...Oo(e)):t.push(e)}),t}function ko(e,t){return Array.prototype.filter.call(e,t)}function Ao(e){let t=[];for(let n=0;n<e.length;n+=1)t.indexOf(e[n])===-1&&t.push(e[n]);return t}function jo(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function Mo(e,t){if(typeof e!=`string`)return[e];let n=[],r=t.querySelectorAll(e);for(let e=0;e<r.length;e+=1)n.push(r[e]);return n}function No(e,t){let n=To(),r=Co(),i=[];if(!t&&e instanceof Do)return e;if(!e)return new Do(i);if(typeof e==`string`){let n=e.trim();if(n.indexOf(`<`)>=0&&n.indexOf(`>`)>=0){let e=`div`;n.indexOf(`<li`)===0&&(e=`ul`),n.indexOf(`<tr`)===0&&(e=`tbody`),(n.indexOf(`<td`)===0||n.indexOf(`<th`)===0)&&(e=`tr`),n.indexOf(`<tbody`)===0&&(e=`table`),n.indexOf(`<option`)===0&&(e=`select`);let t=r.createElement(e);t.innerHTML=n;for(let e=0;e<t.childNodes.length;e+=1)i.push(t.childNodes[e])}else i=Mo(e.trim(),t||r)}else if(e.nodeType||e===n||e===r)i.push(e);else if(Array.isArray(e)){if(e instanceof Do)return e;i=e}return new Do(Ao(i))}No.fn=Do.prototype;function Po(...e){let t=Oo(e.map(e=>e.split(` `)));return this.forEach(e=>{e.classList.add(...t)}),this}function Fo(...e){let t=Oo(e.map(e=>e.split(` `)));return this.forEach(e=>{e.classList.remove(...t)}),this}function Io(...e){let t=Oo(e.map(e=>e.split(` `)));return ko(this,e=>t.filter(t=>e.classList.contains(t)).length>0).length>0}function Lo(e,t){if(arguments.length===1&&typeof e==`string`)return this[0]?this[0].getAttribute(e):void 0;for(let n=0;n<this.length;n+=1)if(arguments.length===2)this[n].setAttribute(e,t);else for(let t in e)this[n][t]=e[t],this[n].setAttribute(t,e[t]);return this}function Ro(e){for(let t=0;t<this.length;t+=1)this[t].removeAttribute(e);return this}function zo(e,t){let n;if(t===void 0)return n=this[0],n?n.dom7ElementDataStorage&&e in n.dom7ElementDataStorage?n.dom7ElementDataStorage[e]:n.getAttribute(`data-${e}`)||void 0:void 0;for(let r=0;r<this.length;r+=1)n=this[r],n.dom7ElementDataStorage||(n.dom7ElementDataStorage={}),n.dom7ElementDataStorage[e]=t;return this}function Bo(){let e=this[0];if(!e)return;let t={};if(e.dataset)for(let n in e.dataset)t[n]=e.dataset[n];else for(let n=0;n<e.attributes.length;n+=1){let r=e.attributes[n];r.name.indexOf(`data-`)>=0&&(t[jo(r.name.split(`data-`)[1])]=r.value)}for(let e in t)t[e]===`false`?t[e]=!1:t[e]===`true`?t[e]=!0:parseFloat(t[e])===t[e]*1&&(t[e]*=1);return t}function Vo(e){if(e===void 0){let e=this[0];if(!e)return;if(e.multiple&&e.nodeName.toLowerCase()===`select`){let t=[];for(let n=0;n<e.selectedOptions.length;n+=1)t.push(e.selectedOptions[n].value);return t}return e.value}for(let t=0;t<this.length;t+=1){let n=this[t];if(Array.isArray(e)&&n.multiple&&n.nodeName.toLowerCase()===`select`)for(let t=0;t<n.options.length;t+=1)n.options[t].selected=e.indexOf(n.options[t].value)>=0;else n.value=e}return this}function Ho(...e){let[t,n,r,i]=e;typeof e[1]==`function`&&([t,r,i]=e,n=void 0),i||(i=!1);function a(e){let t=e.target;if(!t)return;let i=e.target.dom7EventData||[];if(i.indexOf(e)<0&&i.unshift(e),No(t).is(n))r.apply(t,i);else{let e=No(t).parents();for(let t=0;t<e.length;t+=1)No(e[t]).is(n)&&r.apply(e[t],i)}}function o(e){let t=e&&e.target&&e.target.dom7EventData||[];t.indexOf(e)<0&&t.unshift(e),r.apply(this,t)}let s=t.split(` `),c;for(let e=0;e<this.length;e+=1){let t=this[e];if(n)for(c=0;c<s.length;c+=1){let e=s[c];t.dom7LiveListeners||(t.dom7LiveListeners={}),t.dom7LiveListeners[e]||(t.dom7LiveListeners[e]=[]),t.dom7LiveListeners[e].push({listener:r,proxyListener:a}),t.addEventListener(e,a,i)}else for(c=0;c<s.length;c+=1){let e=s[c];t.dom7Listeners||(t.dom7Listeners={}),t.dom7Listeners[e]||(t.dom7Listeners[e]=[]),t.dom7Listeners[e].push({listener:r,proxyListener:o}),t.addEventListener(e,o,i)}}return this}function Uo(...e){let[t,n,r,i]=e;typeof e[1]==`function`&&([t,r,i]=e,n=void 0),i||(i=!1);let a=t.split(` `);for(let e=0;e<a.length;e+=1){let t=a[e];for(let e=0;e<this.length;e+=1){let a=this[e],o;if(!n&&a.dom7Listeners?o=a.dom7Listeners[t]:n&&a.dom7LiveListeners&&(o=a.dom7LiveListeners[t]),o&&o.length)for(let e=o.length-1;e>=0;--e){let n=o[e];r&&n.listener===r||r&&n.listener&&n.listener.dom7proxy&&n.listener.dom7proxy===r?(a.removeEventListener(t,n.proxyListener,i),o.splice(e,1)):r||(a.removeEventListener(t,n.proxyListener,i),o.splice(e,1))}}}return this}function Wo(){let e=To();return this[0]===e?e.innerWidth:this.length>0?parseFloat(this.css(`width`)):null}function Go(){let e=To();return this[0]===e?e.innerHeight:this.length>0?parseFloat(this.css(`height`)):null}function Ko(){if(this.length>0){let e=To(),t=Co(),n=this[0],r=n.getBoundingClientRect(),i=t.body,a=n.clientTop||i.clientTop||0,o=n.clientLeft||i.clientLeft||0,s=n===e?e.scrollY:n.scrollTop,c=n===e?e.scrollX:n.scrollLeft;return{top:r.top+s-a,left:r.left+c-o}}return null}function qo(){for(let e=0;e<this.length;e+=1)this[e].style.display=`none`;return this}function Jo(){let e=To();for(let t=0;t<this.length;t+=1){let n=this[t];n.style.display===`none`&&(n.style.display=``),e.getComputedStyle(n,null).getPropertyValue(`display`)===`none`&&(n.style.display=`block`)}return this}function Yo(e,t){let n=To(),r;if(arguments.length===1)if(typeof e==`string`){if(this[0])return n.getComputedStyle(this[0],null).getPropertyValue(e)}else{for(r=0;r<this.length;r+=1)for(let t in e)this[r].style[t]=e[t];return this}if(arguments.length===2&&typeof e==`string`){for(r=0;r<this.length;r+=1)this[r].style[e]=t;return this}return this}function Xo(e){return e&&this.forEach((t,n)=>{e.apply(t,[t,n])}),this}function Zo(e){return No(ko(this,e))}function Qo(e){if(e===void 0)return this[0]?this[0].innerHTML:null;for(let t=0;t<this.length;t+=1)this[t].innerHTML=e;return this}function $o(e){if(e===void 0)return this[0]?this[0].textContent.trim():null;for(let t=0;t<this.length;t+=1)this[t].textContent=e;return this}function es(e){let t=To(),n=Co(),r=this[0],i,a;if(!r||e===void 0)return!1;if(typeof e==`string`){if(r.matches)return r.matches(e);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(r.msMatchesSelector)return r.msMatchesSelector(e);for(i=No(e),a=0;a<i.length;a+=1)if(i[a]===r)return!0;return!1}if(e===n)return r===n;if(e===t)return r===t;if(e.nodeType||e instanceof Do){for(i=e.nodeType?[e]:e,a=0;a<i.length;a+=1)if(i[a]===r)return!0;return!1}return!1}function ts(...e){let t,n=Co();for(let r=0;r<e.length;r+=1){t=e[r];for(let e=0;e<this.length;e+=1)if(typeof t==`string`){let r=n.createElement(`div`);for(r.innerHTML=t;r.firstChild;)this[e].appendChild(r.firstChild)}else if(t instanceof Do)for(let n=0;n<t.length;n+=1)this[e].appendChild(t[n]);else this[e].appendChild(t)}return this}function ns(e){let t=Co(),n,r;for(n=0;n<this.length;n+=1)if(typeof e==`string`){let i=t.createElement(`div`);for(i.innerHTML=e,r=i.childNodes.length-1;r>=0;--r)this[n].insertBefore(i.childNodes[r],this[n].childNodes[0])}else if(e instanceof Do)for(r=0;r<e.length;r+=1)this[n].insertBefore(e[r],this[n].childNodes[0]);else this[n].insertBefore(e,this[n].childNodes[0]);return this}function rs(e){let t=[];for(let n=0;n<this.length;n+=1)this[n].parentNode!==null&&(e?No(this[n].parentNode).is(e)&&t.push(this[n].parentNode):t.push(this[n].parentNode));return No(t)}function is(e){let t=[];for(let n=0;n<this.length;n+=1){let r=this[n].parentNode;for(;r;)e?No(r).is(e)&&t.push(r):t.push(r),r=r.parentNode}return No(t)}function as(e){let t=[];for(let n=0;n<this.length;n+=1){let r=this[n].querySelectorAll(e);for(let e=0;e<r.length;e+=1)t.push(r[e])}return No(t)}function os(e){let t=[];for(let n=0;n<this.length;n+=1){let r=this[n].children;for(let n=0;n<r.length;n+=1)(!e||No(r[n]).is(e))&&t.push(r[n])}return No(t)}function ss(){for(let e=0;e<this.length;e+=1)this[e].parentNode&&this[e].parentNode.removeChild(this[e]);return this}function cs(){for(let e=0;e<this.length;e+=1){let t=this[e];if(t.nodeType===1){for(let e=0;e<t.childNodes.length;e+=1)t.childNodes[e].parentNode&&t.childNodes[e].parentNode.removeChild(t.childNodes[e]);t.textContent=``}}return this}let ls=`resize scroll`.split(` `);function us(e){function t(...t){if(t[0]===void 0){for(let t=0;t<this.length;t+=1)ls.indexOf(e)<0&&(e in this[t]?this[t][e]():No(this[t]).trigger(e));return this}return this.on(e,...t)}return t}let ds=us(`click`),fs=us(`focus`);var K=No;let ps=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];var ms=globalThis.Node;globalThis.Comment,globalThis.Element,globalThis.Text,globalThis.Range,globalThis.Selection,globalThis.StaticRange,Yo&&(K.fn.css=Yo),ts&&(K.fn.append=ts),Po&&(K.fn.addClass=Po),Fo&&(K.fn.removeClass=Fo),Io&&(K.fn.hasClass=Io),Ho&&(K.fn.on=Ho),fs&&(K.fn.focus=fs),Lo&&(K.fn.attr=Lo),Ro&&(K.fn.removeAttr=Ro),qo&&(K.fn.hide=qo),Jo&&(K.fn.show=Jo),Ko&&(K.fn.offset=Ko),Wo&&(K.fn.width=Wo),Go&&(K.fn.height=Go),rs&&(K.fn.parent=rs),is&&(K.fn.parents=is),es&&(K.fn.is=es),Bo&&(K.fn.dataset=Bo),Vo&&(K.fn.val=Vo),$o&&(K.fn.text=$o),Qo&&(K.fn.html=Qo),os&&(K.fn.children=os),ss&&(K.fn.remove=ss),as&&(K.fn.find=as),Xo&&(K.fn.each=Xo),cs&&(K.fn.empty=cs);var q=K;let hs=function(e){return e[e.ELEMENT_NODE=1]=`ELEMENT_NODE`,e[e.TEXT_NODE=3]=`TEXT_NODE`,e[e.CDATA_SECTION_NODE=4]=`CDATA_SECTION_NODE`,e[e.PROCESSING_INSTRUCTION_NODE=7]=`PROCESSING_INSTRUCTION_NODE`,e[e.COMMENT_NODE=8]=`COMMENT_NODE`,e[e.DOCUMENT_NODE=9]=`DOCUMENT_NODE`,e[e.DOCUMENT_TYPE_NODE=10]=`DOCUMENT_TYPE_NODE`,e[e.DOCUMENT_FRAGMENT_NODE=11]=`DOCUMENT_FRAGMENT_NODE`,e}({}),gs=e=>Ut(e)===`[object HTMLDocument]`,_s=e=>Ut(e)===`[object ShadowRoot]`,vs=e=>Ut(e)===`[object DataTransfer]`,ys=/\[object HTML([A-Z][a-z]*)*Element\]/,bs=e=>`matches`in e&&/^[ou]l$/i.test(e.tagName)&&!e.hasAttribute(`data-w-e-type`),xs=e=>ys.test(Ut(e)),Ss=e=>e&&e.ownerDocument&&e.ownerDocument.defaultView||null,Cs=e=>e!=null&&typeof e.nodeType==`number`,ws=e=>Cs(e)&&e.nodeType===hs.COMMENT_NODE,Ts=e=>Cs(e)&&e.nodeType===hs.ELEMENT_NODE,Es=e=>Ut(e)===`[object Selection]`,Ds=e=>Cs(e)&&e.nodeType===hs.TEXT_NODE,Os=e=>e.clipboardData&&e.clipboardData.getData(`text/plain`)!==``&&e.clipboardData.types.length===1,ks=e=>{let[t,n]=e;if(Ts(t)&&t.childNodes.length){let e=n===t.childNodes.length,r=e?n-1:n;for([t,r]=Ms(t,r,e?`backward`:`forward`),e=r<n;Ts(t)&&t.childNodes.length;){let n=e?t.childNodes.length-1:0;t=Ns(t,n,e?`backward`:`forward`)}n=e&&t.textContent!=null?t.textContent.length:0}return[t,n]},As=()=>!!(window.document.activeElement&&window.document.activeElement.shadowRoot),js=e=>{var t,n;return(t=window&&window.document.getElementById(e))==null?window&&((n=window.document.activeElement)==null||(n=n.shadowRoot)==null?void 0:n.getElementById(e))||null:t},Ms=(e,t,n)=>{let{childNodes:r}=e,i=r[t],a=t,o=!1,s=!1;for(;(ws(i)||Ts(i)&&i.childNodes.length===0||Ts(i)&&i.getAttribute(`contenteditable`)===`false`)&&!(o&&s);){if(a>=r.length){o=!0,a=t-1,n=`backward`;continue}if(a<0){s=!0,a=t+1,n=`forward`;continue}i=r[a],t=a,a+=n===`forward`?1:-1}return[i,t]},Ns=(e,t,n)=>{let[r]=Ms(e,t,n);return r},Ps=e=>{let t=``;if(Ds(e)&&e.nodeValue)return e.nodeValue;if(Ts(e)){for(let n of Array.from(e.childNodes))t+=Ps(n);let n=getComputedStyle(e).getPropertyValue(`display`);(n===`block`||n===`list`||n===`table-row`||e.tagName===`BR`)&&(t+=`
18
+ `)}return t};function Fs(e){let t=[];t.push(e);let n=0;for(;t.length>0;){let e=t.pop();if(e==null||(n+=1,n>1e4))break;let{nodeName:r,nodeType:i}=e;if(i===hs.ELEMENT_NODE){let n=r.toLowerCase();if(ps.includes(n)||n===`iframe`||n===`video`)return e;let i=e.children||[],a=i.length;if(a)for(let e=a-1;e>=0;--e)t.push(i[e])}}return null}function Is(e,t){if(!(xs(e)&&e.dataset.slateVoid===`true`))for(let n=e.childNodes,r=n.length;--r;){let i=n[r],a=i.nodeType;Ds(i)?t(i,e):[hs.ELEMENT_NODE,hs.DOCUMENT_NODE,hs.DOCUMENT_FRAGMENT_NODE].includes(a)&&Is(i,t)}}function Ls(e){if(e.length===0)return``;let t=e[0];return t.nodeType===hs.ELEMENT_NODE?t.tagName.toLowerCase():``}let Rs=RegExp(`\xA0`,`g`);function zs(e){return e.replace(Rs,` `)}let Bs=[`span`,`b`,`strong`,`i`,`em`,`s`,`strike`,`u`,`font`,`sub`,`sup`],Vs=[];function Hs(e){Vs.push(e)}let Us=[];function Ws(e){Us.push(e)}let Gs={};function Ks(e){let{selector:t,parseElemHtml:n}=e;Gs[t]=n}function qs(e,t){let n=e.length;if(n){let r=e[n-1];if(W.isText(r)){let e=Object.keys(r);if(e.length===1&&e[0]===`text`)return r.text+=t,!0}}return!1}function Js(e,t){let n=[];if(e.attr(`data-w-e-is-void`)!=null)return n;let r=e[0].childNodes;return r.length===1&&r[0].nodeName===`BR`?(n.push({text:``}),n):(r.forEach(e=>{if(Ts(e)){if(e.nodeName===`BR`){qs(n,`
19
+ `)||n.push({text:`
20
+ `});return}let r=oc(K(e),t);Array.isArray(r)?r.forEach(e=>n.push(e)):n.push(r);return}if(Ds(e)){let t=e.textContent||``;if(t.trim()===``&&t.indexOf(`
21
+ `)>=0)return;t&&(t=zs(t),qs(n,t)||n.push({text:t}))}}),n)}function Ys(e,t,n){return{type:`paragraph`,children:[{text:K(e).text().replace(/\s+/gm,` `)}]}}function Xs(e){for(let t in Gs)if(e[0].matches(t))return Gs[t];return Ys}function Zs(e,t){let n=Js(e,t),r=Xs(e)(e[0],n,t);return Array.isArray(r)||(r=[r]),r.forEach(r=>{V.isVoid(t,r)||(n.length===0&&(r.children=[{text:e.text().replace(/\s+/gm,` `)}]),Us.forEach(n=>{r=n(e[0],r,t)}))}),r}var Qs=Zs;function $s(e,t){e.parents(`pre`).length===0&&(e[0].innerHTML=e[0].innerHTML.replace(/[\r\n\t]+/g,``).replace(/<br>/g,`
22
+ `));let n=e[0].textContent||``;n=Ht(n),n=zs(n);let r={text:n};return Us.forEach(n=>{r=n(e[0],r,t)}),r}function ec(e,t){let n={text:``};return Us.forEach(r=>{n=r(e[0],n,t)}),n}var tc=$s;O();function nc(e,t){let n=t.parentElement;return n==null?e:(n.closest(`pre`)==null&&(e=e.replace(/[\r\n\t]+/g,``)),e=Ht(e),e=zs(e),e)}function rc(e,t){let n=D(D({},e),t);return Object.keys(t).forEach(e=>{t[e]===!1&&delete n[e]}),n}function ic(e,t,n){let r=e[0];if(Ts(r)){let r=ac(e,n),i=D({},t);return delete i.text,Array.isArray(r)?r.map(e=>rc(i,e)):[rc(i,r)]}return ws(r)?null:[rc(t,Ds(r)?{text:nc(r.textContent||``,r)}:tc(e,n))]}function ac(e,t){Vs.forEach(t=>{let{selector:n,preParseHtml:r}=t;e[0].matches(n)&&(e=K(r(e[0])))});let n=Ls(e);if(n===`span`){if(e.attr(`data-w-e-type`))return Qs(e,t);let n=Array.from(e[0].childNodes);if(n.some(e=>!Ds(e)&&!ws(e))){let r=ec(K(e[0]),t);return n.flatMap(e=>ic(K(e),r,t)||[])}return tc(e,t)}if(n===`code`)return Ls(e.parent())===`pre`?Qs(e,t):tc(e,t);if(Bs.includes(n)){let n=Array.from(e[0].childNodes);if(n.some(e=>!Ds(e)&&!ws(e))){let r=ec(K(e[0]),t);return n.flatMap(e=>ic(K(e),r,t)||[])}return tc(e,t)}return Qs(e,t)}var oc=ac;function sc(e,t,n){let r=q(n);return r.attr(t)?!0:(r.attr(t,`true`),e.on(za.DESTROYED,()=>{r.removeAttr(t)}),!1)}function cc(e,t){return sc(e,`data-w-e-textarea`,t)}function lc(e,t){return sc(e,`data-w-e-toolbar`,t)}function uc(){return[{type:`paragraph`,children:[{text:``}]}]}function dc(e,t=``){let n=[],{sanitizeHtml:r}=e.getConfig();t===``&&(t=`<p><br></p>`),t.indexOf(`<`)!==0&&(t=t.split(/\n/).map(e=>`<p>${e}</p>`).join(``)),t=r?r(t):t;let i=q(`<div>${t}</div>`);return Array.from(i.children()).forEach(t=>{let r=oc(q(t),e);Array.isArray(r)?r.forEach(e=>n.push(e)):n.push(r)}),n}function fc(e,t){let{html:n,content:r}=t,i;n==null?r&&r.length&&(i=r):i=dc(e,n),i&&(e.children=e.transformInitialContent?e.transformInitialContent(i):i),e.children.length===0&&(e.children=uc())}function pc(e,t){return`w-e-element-${e}-${t}`}function mc(e){return`w-e-text-${e}`}let hc=[];function gc(e){hc.push(e)}let _c=[];function vc(e){_c.push(e)}function yc(e,t,n,r={}){return _c.reduce((e,i)=>i(e,t,n,r),e)}let bc={};function xc(e){let{type:t,elemToHtml:n}=e,r=t||``;bc[r]=n}var Sc=d(c(((e,t)=>{var n=9007199254740991,r=`[object Arguments]`,i=`[object Function]`,a=`[object GeneratorFunction]`,o=`[object Map]`,s=`[object Object]`,c=`[object Promise]`,l=`[object Set]`,u=`[object String]`,d=`[object WeakMap]`,f=`[object DataView]`,p=/[\\^$.*+?()[\]{}|]/g,m=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,g=`\\ud800-\\udfff`,_=`\\u0300-\\u036f\\ufe20-\\ufe23`,v=`\\u20d0-\\u20f0`,y=`\\ufe0e\\ufe0f`,b=`[`+g+`]`,x=`[`+_+v+`]`,S=`\\ud83c[\\udffb-\\udfff]`,C=`(?:`+x+`|`+S+`)`,w=`[^`+g+`]`,T=`(?:\\ud83c[\\udde6-\\uddff]){2}`,E=`[\\ud800-\\udbff][\\udc00-\\udfff]`,D=`\\u200d`,O=C+`?`,k=`[`+y+`]?`,A=`(?:`+D+`(?:`+[w,T,E].join(`|`)+`)`+k+O+`)*`,j=k+O+A,ee=`(?:`+[w+x+`?`,x,T,E,b].join(`|`)+`)`,M=RegExp(S+`(?=`+S+`)|`+ee+j,`g`),N=RegExp(`[`+D+g+_+v+y+`]`),te=typeof global==`object`&&global&&global.Object===Object&&global,P=typeof self==`object`&&self&&self.Object===Object&&self,ne=te||P||Function(`return this`)();function re(e,t){for(var n=-1,r=e?e.length:0,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function ie(e){return e.split(``)}function ae(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function oe(e,t){return re(t,function(t){return e[t]})}function se(e,t){return e==null?void 0:e[t]}function ce(e){return N.test(e)}function le(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch(e){}return t}function ue(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function de(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function fe(e,t){return function(n){return e(t(n))}}function pe(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function me(e){return ce(e)?he(e):ie(e)}function he(e){return e.match(M)||[]}var ge=Function.prototype,_e=Object.prototype,ve=ne[`__core-js_shared__`],ye=function(){var e=/[^.]+$/.exec(ve&&ve.keys&&ve.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),be=ge.toString,xe=_e.hasOwnProperty,Se=_e.toString,Ce=RegExp(`^`+be.call(xe).replace(p,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),we=ne.Symbol,Te=we?we.iterator:void 0,Ee=_e.propertyIsEnumerable,De=fe(Object.keys,Object),Oe=Ue(ne,`DataView`),ke=Ue(ne,`Map`),Ae=Ue(ne,`Promise`),je=Ue(ne,`Set`),Me=Ue(ne,`WeakMap`),Ne=F(Oe),Pe=F(ke),Fe=F(Ae),Ie=F(je),Le=F(Me);function Re(e,t){var n=Ye(e)||Je(e)?ae(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||xe.call(e,a))&&!(i&&(a==`length`||Ge(a,r)))&&n.push(a);return n}function ze(e){return Se.call(e)}function Be(e){return!et(e)||Ke(e)?!1:(Qe(e)||le(e)?Ce:m).test(F(e))}function Ve(e){if(!qe(e))return De(e);var t=[];for(var n in Object(e))xe.call(e,n)&&n!=`constructor`&&t.push(n);return t}function He(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function Ue(e,t){var n=se(e,t);return Be(n)?n:void 0}var We=ze;(Oe&&We(new Oe(new ArrayBuffer(1)))!=f||ke&&We(new ke)!=o||Ae&&We(Ae.resolve())!=c||je&&We(new je)!=l||Me&&We(new Me)!=d)&&(We=function(e){var t=Se.call(e),n=t==s?e.constructor:void 0,r=n?F(n):void 0;if(r)switch(r){case Ne:return f;case Pe:return o;case Fe:return c;case Ie:return l;case Le:return d}return t});function Ge(e,t){return t=t==null?n:t,!!t&&(typeof e==`number`||h.test(e))&&e>-1&&e%1==0&&e<t}function Ke(e){return!!ye&&ye in e}function qe(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||_e)}function F(e){if(e!=null){try{return be.call(e)}catch(e){}try{return e+``}catch(e){}}return``}function Je(e){return Ze(e)&&xe.call(e,`callee`)&&(!Ee.call(e,`callee`)||Se.call(e)==r)}var Ye=Array.isArray;function Xe(e){return e!=null&&$e(e.length)&&!Qe(e)}function Ze(e){return tt(e)&&Xe(e)}function Qe(e){var t=et(e)?Se.call(e):``;return t==i||t==a}function $e(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}function et(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function tt(e){return!!e&&typeof e==`object`}function nt(e){return typeof e==`string`||!Ye(e)&&tt(e)&&Se.call(e)==u}function rt(e){if(!e)return[];if(Xe(e))return nt(e)?me(e):He(e);if(Te&&e[Te])return ue(e[Te]());var t=We(e);return(t==o?de:t==l?pe:at)(e)}function it(e){return Xe(e)?Re(e):Ve(e)}function at(e){return e?oe(e,it(e)):[]}t.exports=rt}))(),1);let Cc=0;var wc=class{constructor(){this.id=`${Cc}`,Cc+=1}};globalThis.navigator!==void 0&&globalThis.window!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&globalThis.window.MSStream;let Tc=typeof navigator<`u`&&/Mac OS X/.test(navigator.userAgent),Ec=typeof navigator<`u`&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);typeof navigator<`u`&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent);let Dc=typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Oc=typeof navigator<`u`&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),kc=typeof navigator<`u`&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),Ac=typeof navigator<`u`&&/Chrome/i.test(navigator.userAgent);typeof navigator<`u`&&/.*QQBrowser/.test(navigator.userAgent);let jc=!kc&&!Oc&&typeof globalThis<`u`&&globalThis.InputEvent&&typeof globalThis.InputEvent.prototype.getTargetRanges==`function`,Mc=(e,t)=>!!(e.compareDocumentPosition(t)&ms.DOCUMENT_POSITION_PRECEDING),Nc=(e,t)=>!!(e.compareDocumentPosition(t)&ms.DOCUMENT_POSITION_FOLLOWING),J={getWindow(e){let t=uo.get(e);if(!t)throw Error(`Unable to find a host window element for this editor`);return t},findKey(e,t){let n=lo.get(t);return n||(n=new wc,lo.set(t,n)),n},setNewKey(e){let t=new wc;lo.set(e,t)},findPath(e,t){let n=[],r=t;for(;;){let e=io.get(r);if(e==null){if(V.isEditor(r))return n;break}let t=ro.get(r);if(t==null)break;n.unshift(t),r=e}throw Error(`Unable to find the path for Slate node: ${JSON.stringify(t)}`)},findDocumentOrShadowRoot(e){if(e.isDestroyed)return window.document;let t=J.toDOMNode(e,e),n=t.getRootNode();return(gs(n)||_s(n))&&Reflect.get(n,`getSelection`)!=null?n:t.ownerDocument},getParentNode(e,t){return io.get(t)||null},getParentsNodes(e,t){let n=[],r=t;for(;r!==e&&r!=null;){let t=J.getParentNode(e,r);if(t==null)break;n.push(t),r=t}return n},getTopNode(e,t){let n=[J.findPath(e,t)[0]];return z.get(e,n)},toDOMNode(e,t){let n;if(V.isEditor(t))n=ao.get(e);else{let r=J.findKey(e,t);n=so.get(r)}if(!n)throw Error(`Cannot resolve a DOM node from Slate node: ${JSON.stringify(t)}`);return n},hasDOMNodeBySlateNode(e,t){if(V.isEditor(t))return!!ao.get(e);let n=J.findKey(e,t);return!!so.get(n)},canResolveDOMRange(e,t){try{let[n]=V.node(e,t.anchor.path),[r]=L.isCollapsed(t)?[n]:V.node(e,t.focus.path);return J.hasDOMNodeBySlateNode(e,n)&&J.hasDOMNodeBySlateNode(e,r)}catch(e){return!1}},hasDOMNode(e,t,n={}){let{editable:r=!1}=n,i=J.toDOMNode(e,e),a;try{a=Ts(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes(`Permission denied to access property "nodeType"`))throw e}return a?a.closest(`[data-slate-editor]`)===i&&(!r||a.isContentEditable||a.closest(`[contenteditable="false"]`)===i||!!a.getAttribute(`data-slate-zero-width`))||!!a.getAttribute(`data-slate-string`):!1},toDOMRange(e,t){let{anchor:n,focus:r}=t,i=L.isBackward(t),a=J.toDOMPoint(e,n),o=L.isCollapsed(t)?a:J.toDOMPoint(e,r),s=J.getWindow(e).document.createRange(),[c,l]=i?o:a,[u,d]=i?a:o,f=!!(Ts(c)?c:c.parentElement).getAttribute(`data-slate-zero-width`),p=!!(Ts(u)?u:u.parentElement).getAttribute(`data-slate-zero-width`);return s.setStart(c,f?1:l),s.setEnd(u,p?1:d),s},toDOMPoint(e,t){let[n]=V.node(e,t.path),r=J.toDOMNode(e,n),i;V.void(e,{at:t})&&(t={path:t.path,offset:0});let a=Array.from(r.querySelectorAll(`[data-slate-string], [data-slate-zero-width]`)),o=0;for(let e of a){let n=e.childNodes[0];if(n==null||n.textContent==null)continue;let{length:r}=n.textContent,a=e.getAttribute(`data-slate-length`),s=o+(a==null?r:parseInt(a,10));if(t.offset<=s){i=[n,Math.min(r,Math.max(0,t.offset-o))];break}o=s}if(!i)throw Error(`Cannot resolve a DOM point from Slate point: ${JSON.stringify(t)}`);return i},toSlateNode(e,t){let n=Ts(t)?t:t.parentElement;n&&!n.hasAttribute(`data-slate-node`)&&(n=n.closest(`[data-slate-node]`));let r=n?oo.get(n):null;if(!r)throw Error(`Cannot resolve a Slate node from DOM node: ${n}`);return r},findEventRange(e,t){`nativeEvent`in t&&(t=t.nativeEvent);let{clientX:n,clientY:r,target:i}=t;if(n==null||r==null)throw Error(`Cannot resolve a Slate range from a DOM event: ${t}`);let a=J.toSlateNode(e,t.target),o=J.findPath(e,a);if(R.isElement(a)&&V.isVoid(e,a)){let t=i.getBoundingClientRect(),s=e.isInline(a)?n-t.left<t.left+t.width-n:r-t.top<t.top+t.height-r,c=V.point(e,o,{edge:s?`start`:`end`}),l=s?V.before(e,c):V.after(e,c);if(l)return V.range(e,l)}let s,{document:c}=this.getWindow(e);if(c.caretRangeFromPoint)s=c.caretRangeFromPoint(n,r);else{let e=c.caretPositionFromPoint(n,r);e&&(s=c.createRange(),s.setStart(e.offsetNode,e.offset),s.setEnd(e.offsetNode,e.offset))}if(!s)throw Error(`Cannot resolve a Slate range from a DOM event: ${t}`);return J.toSlateRange(e,s,{exactMatch:!1,suppressThrow:!1})},toSlateRange(e,t,n){let{exactMatch:r,suppressThrow:i}=n,a=Es(t)?t.anchorNode:t.startContainer,o,s,c,l,u;if(a&&(Es(t)?(o=t.anchorNode,s=t.anchorOffset,c=t.focusNode,l=t.focusOffset,u=Ac&&As()?t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset:t.isCollapsed):(o=t.startContainer,s=t.startOffset,c=t.endContainer,l=t.endOffset,u=t.collapsed)),o==null||c==null||s==null||l==null){if(i)return null;throw Error(`Cannot resolve a Slate range from DOM range: ${t}`)}let d=J.toSlatePoint(e,[o,s],{exactMatch:r,suppressThrow:i});if(!d)return null;let f=u?d:J.toSlatePoint(e,[c,l],{exactMatch:r,suppressThrow:i,searchDirection:Mc(o,c)||o===c&&l<s?`forward`:`backward`});if(!f)return null;let p={anchor:d,focus:f};return L.isExpanded(p)&&L.isForward(p)&&Ts(c)&&V.void(e,{at:p.focus,mode:`highest`})&&(p=V.unhangRange(e,p,{voids:!0})),p},toSlatePoint(e,t,n){let{exactMatch:r,suppressThrow:i}=n,[a,o]=r?t:ks(t),s=a.parentNode,c=n.searchDirection,l=null,u=0;if(s){var d;let t=J.toDOMNode(e,e),n=s.closest(`[data-slate-void="true"]`),r=n&&t.contains(n)?n:null,i=s.closest(`[contenteditable="false"]`),f=i&&t.contains(i)?i:null,p=s.closest(`[data-slate-leaf]`),m=null,h=J.getWindow(e);if(p&&h.document.createRange){l=p.closest(`[data-slate-node="text"]`);let e=h.document.createRange();e.setStart(l,0),e.setEnd(a,o);let t=e.cloneContents();[...(0,Sc.default)(t.querySelectorAll(`[data-slate-zero-width]`)),...(0,Sc.default)(t.querySelectorAll(`[contenteditable=false]`))].forEach(e=>{e.parentNode.removeChild(e)}),u=t.textContent.length,m=l}else if(r)p=Array.from(r.querySelectorAll(`[data-slate-leaf]`)).find(t=>J.hasDOMNode(e,t))||null,p?(l=p.closest(`[data-slate-node="text"]`),m=p,u=m.textContent.length,m.querySelectorAll(`[data-slate-zero-width]`).forEach(e=>{u-=e.textContent.length})):u=1;else if(f){let t=!!f.closest(`[data-w-e-reserve]`);!c&&t&&(c=`forward`);let n=c,r=t=>t?Array.from(t.querySelectorAll(`[data-slate-leaf]`)).filter(t=>J.hasDOMNode(e,t)):[],i=f.closest(`[data-slate-node="element"]`);if(c===`backward`||!c){let e=[...r(i==null?void 0:i.previousElementSibling),...r(i)];for(let t=e.length-1;t>=0;--t){let n=e[t];if(Mc(f,n)){p=n,c=`backward`;break}}}if(!p&&(c===`forward`||!c||t)){let e=[...r(i),...r(i==null?void 0:i.nextElementSibling)];for(let r of e)if(Nc(f,r)){p=r,n=c===`backward`&&t?`backward`:`forward`;break}}p&&(l=p.closest(`[data-slate-node="text"]`),m=p,n===`forward`?u=0:(u=m.textContent.length,m.querySelectorAll(`[data-slate-zero-width]`).forEach(e=>{u-=e.textContent.length})))}m&&u===m.textContent.length&&(s.hasAttribute(`data-slate-zero-width`)||Ec&&(d=m.textContent)!=null&&d.endsWith(`
23
+ `))&&--u}if(!l){if(i)return null;throw Error(`Cannot resolve a Slate point from DOM point: ${t}`)}let f;try{let t=J.toSlateNode(e,l);f=J.findPath(e,t)}catch(e){if(i)return null;throw e}return{path:f,offset:u}},hasRange(e,t){let{anchor:n,focus:r}=t;return V.hasPath(e,n.path)&&V.hasPath(e,r.path)},getNodeType(e){return R.isElement(e)?e.type:``},checkNodeType(e,t){return this.getNodeType(e)===t},getNodesStr(e){return e.map(e=>z.string(e)).join(``)},getSelectedVoidNode(e){let{selection:t}=e;if(!t)return null;let n=V.void(e,{at:t});if(!n)return null;let[r]=n;return R.isElement(r)?r:null},getSelectedElems(e){let t=[],n=J.getSelectedVoidNode(e);n&&t.push(n);let r=V.nodes(e,{universal:!0});for(let e of r){let[r]=e;R.isElement(r)&&r!==n&&t.push(r)}return t},getSelectedNodeByType(e,t){let n=J.getSelectedVoidNode(e);if(n&&this.checkNodeType(n,t))return n;let[r]=V.nodes(e,{match:e=>this.checkNodeType(e,t),universal:!0});return r==null?null:r[0]},getSelectedTextNode(e){let[t]=V.nodes(e,{match:e=>W.isText(e),universal:!0});return t==null?null:t[0]},isNodeSelected(e,t){if(J.getSelectedVoidNode(e)===t)return!0;let[n]=V.nodes(e,{match:e=>e===t,universal:!0});if(n==null)return!1;let[r]=n;return r===t},isSelectionAtLineEnd(e,t){let{selection:n}=e;return n?V.isEnd(e,n.anchor,t)||V.isEnd(e,n.focus,t):!1},getTextarea(e){let t=Ha.get(e);if(t==null)throw Error(`Cannot find textarea instance by editor`);return t},getToolbar(e){return Ga.get(e)||null},getHoverbar(e){return qa.get(e)||null},normalizeContent(e){e.children.forEach((t,n)=>{e.normalizeNode([t,[n]])})},getLeftLengthOfMaxLength(e){let{maxLength:t,onMaxLength:n}=e.getConfig();if(typeof t!=`number`||t<=0)return 1/0;let r=t-e.getText().replace(/\r|\n|(\r\n)|(\n\r)/g,``).length;return r<=0&&n&&n(e),r},cleanExposedTexNodeInSelectionBlock(e){let{$textArea:t}=J.getTextarea(e),n=t==null?void 0:t[0].childNodes;if(n)for(let e of Array.from(n))if(Ds(e))e.remove();else break;let r=V.nodes(e,{match:t=>!!(R.isElement(t)&&!e.isInline(t)),universal:!0});for(let t of r)if(t!=null){let n=t[0];if(!J.hasDOMNodeBySlateNode(e,n))continue;Is(J.toDOMNode(e,n),(e,t)=>{let n=q(t);n.attr(`data-slate-string`)||n.attr(`data-slate-zero-width`)||n.attr(`data-w-e-reserve`)||t.removeChild(e)})}},isLastNode(e,t){let n=e.children||[];return n[n.length-1]===t},genEmptyParagraph(){return{type:`paragraph`,children:[{text:``}]}},isSelectedVoidNode(e){return J.getSelectedVoidNode(e)!=null},isSelectedEmptyParagraph(e){let{selection:t}=e;if(t==null||L.isExpanded(t))return!1;let n=[t.focus.path[0]];if(!V.hasPath(e,n))return!1;let[r]=V.node(e,n);if(!R.isElement(r)||r.type!==`paragraph`)return!1;let{children:i}=r;if(i.length!==1)return!1;let{text:a}=i[0];if(a===``)return!0},isEmptyPath(e,t){let n=V.node(e,t);if(n==null)return!1;let[r]=n,{children:i}=r;if(i.length===1){let{text:e}=i[0];if(e===``)return!0}return!1}};function Pc(e,t,n){let r=n.isInline(e)?`span`:`div`;return`<${r}>${t}</${r}>`}function Fc(e){return bc[e]||Pc}let Ic=/^[A-Za-z_:-][A-Za-z0-9_:.-]*$/;function Lc(e){return!e||!Ic.test(e)?`data-w-e-id`:e}function Rc(e,t,n){if(!e)return e;let r=e.match(/^<([A-Za-z][A-Za-z0-9-]*)([^>]*)>/);if(!r)return e;let[i,a,o=``]=r;if(RegExp(`\\s${t}=`).test(o))return e;let s=/\/\s*$/.test(o),c=o.replace(/\s*\/\s*$/,``);return`<${a}${c.trim()?` ${c.trim()}`:``} ${t}="${n}"${s?` /`:``}>`+e.slice(i.length)}function zc(e,t,n,r){if(!r.includeId)return e;let i=Lc(r.idKey),a=J.findKey(n,t);return Rc(e,i,pc(J.getNodeType(t),a.id))}function Bc(e,t,n={}){let{type:r=``,children:i=[]}=e,a=V.isVoid(t,e),o=``;a||(o=i.map(e=>Gc(e,t,n)).join(``));let s=Fc(r)(e,o,t),c=``;if(c=typeof s==`string`?s:s.html||``,a||hc.forEach(n=>c=n(e,c,t)),c=zc(c,e,t,n),typeof s==`string`)return c;let{prefix:l=``,suffix:u=``}=s;return l&&(c=l+c),u&&(c+=u),c}var Vc=Bc;function Hc(e,t,n={}){let{text:r}=e;if(r==null)throw Error(`Current node is not slate Text ${JSON.stringify(e)}`);let i=r;i=Vt(i);let a=J.getParentsNodes(t,e).some(e=>J.getNodeType(e)===`pre`);if(a||(i=i.replace(/\n\r|\r\n|\r|\n/g,`<br>`)),a&&(i=i.replace(/&nbsp;/g,` `)),i===``){let t=J.getParentNode(null,e);if(t&&t.children.length===0)i=`<br>`;else return i}return hc.forEach(n=>i=n(e,i,t)),i}var Uc=Hc;function Wc(e,t,n={}){return R.isElement(e)?Vc(e,t,n):Uc(e,t,n)}var Gc=Wc;let Kc=(e,t)=>{let n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},qc=(e,t,n)=>{let r=J.toDOMRange(e,t).getBoundingClientRect(),i=J.toDOMRange(e,n).getBoundingClientRect();return Kc(r,i)&&Kc(i,r)},Jc=(e,t)=>{let n=V.range(e,L.end(t)),r=Array.from(V.positions(e,{at:t})),i=0,a=r.length,o=Math.floor(a/2);if(qc(e,V.range(e,r[i]),n))return V.range(e,r[i],n);if(r.length<2)return V.range(e,r[r.length-1],n);for(;o!==r.length&&o!==i;)qc(e,V.range(e,r[o]),n)?a=o:i=o,o=Math.floor((i+a)/2);return V.range(e,r[a],n)};O();let Yc=(e,t)=>{let n=[];for(let[r,i]of V.levels(e,{at:t})){let t=J.findKey(e,r);n.push([i,t])}return n};function Xc(e,t){if(W.isText(t)){e.insertNode(t);return}if(R.isElement(t))if(e.isInline(t))e.insertNode(t),t.type===`link`&&e.insertFragment([{text:``}]);else{let{selection:n}=e;if(!n)return;let r=[n.focus.path[0]];if(J.isSelectedEmptyParagraph(e)){G.removeNodes(e,{at:r}),G.insertNodes(e,t,{at:r}),G.select(e,V.end(e,r));return}let i=I.next(r);G.insertNodes(e,t,{at:i}),G.select(e,V.end(e,i))}}function Zc(e){let{selection:t}=e;if(t==null||L.isCollapsed(t))return!1;let[n,r]=L.edges(t),[i,a]=V.edges(e,[]);return U.equals(n,i)&&U.equals(r,a)}function Qc(e){let t=e.children[0];if(e.children.length!==1||!R.isElement(t)||t.type===`paragraph`&&z.string(t)===``||z.string(t)!==``)return;let n=[{type:`paragraph`,children:[{text:``}]}];V.withoutNormalizing(e,()=>{G.removeNodes(e,{at:[0]}),G.insertNodes(e,n,{at:[0]})})}function $c(e){let t=[{type:`paragraph`,children:[{text:``}]}];V.withoutNormalizing(e,()=>{for(let t=e.children.length-1;t>=0;--t)G.removeNodes(e,{at:[t]});G.insertNodes(e,t,{at:[0]})})}let el=e=>{let t=e,{onChange:n,insertText:r,apply:i,deleteBackward:a,deleteFragment:o}=t;return t.insertText=e=>{let{readOnly:n}=t.getConfig();n||r(e)},t.apply=e=>{let n=[];switch(e.type){case`insert_text`:case`remove_text`:case`set_node`:case`split_node`:n.push(...Yc(t,e.path));break;case`insert_node`:case`remove_node`:n.push(...Yc(t,I.parent(e.path)));break;case`merge_node`:{let r=I.previous(e.path);n.push(...Yc(t,r));break}case`move_node`:{let r=I.common(I.parent(e.path),I.parent(e.newPath));n.push(...Yc(t,r));break}case`set_selection`:var r;if(!((r=e.newProperties)==null||(r=r.focus)==null)&&r.path){var a,o;n.push(...Yc(t,(a=e.newProperties)==null||(a=a.focus)==null?void 0:a.path)),n.push(...Yc(t,(o=e.properties)==null||(o=o.focus)==null?void 0:o.path))}break;default:}i(e);for(let[e,r]of n){let[n]=V.node(t,e);lo.set(n,r),`type`in n&&(to.has(n)&&to.delete(n),no.has(n)&&no.delete(n))}},t.deleteBackward=n=>{if(n!==`line`)return a(n);if(e.selection&&L.isCollapsed(e.selection)){let n=V.above(e,{match:t=>R.isElement(t)&&V.isBlock(e,t),at:e.selection});if(n){let[,r]=n,i=Jc(t,V.range(e,r,e.selection.anchor));L.isCollapsed(i)||G.delete(e,{at:i})}}},t.deleteFragment=e=>{let n=Zc(t);o(e),n&&($c(t),t.children.length>0&&G.select(t,V.start(t,[])))},t.onChange=()=>{let{selection:e}=t;e!=null&&po.set(t,e),t.emit(za.CHANGE),n()},t.handleTab=()=>{t.insertText(` `)},t.getHtml=()=>{let{children:e=[]}=t,{skipCacheTypes:n=[`list-item`]}=t.getConfig();return yc(e.map(e=>{let r=J.getNodeType(e);if(n.includes(r))return Gc(e,t);let i=no.get(e);if(i)return i.toString();let a=Gc(e,t);return no.set(e,a),a}),e,t).join(``)},t.getHtmlWithId=(e=`data-w-e-id`)=>{let{children:n=[]}=t;return yc(n.map(n=>Gc(n,t,{includeId:!0,idKey:e})),n,t,{includeId:!0,idKey:e}).join(``)},t.getText=()=>{let{children:e=[]}=t;return e.map(e=>z.string(e)).join(`
24
+ `)},t.getSelectionText=()=>{let{selection:n}=t;return n==null?``:V.string(e,n)},t.getElemsByType=(e,n=!1)=>{let r=[],i=V.nodes(t,{at:[],universal:!0});for(let a of i){let[i]=a;if(R.isElement(i)&&(n?i.type.indexOf(e)>=0:i.type===e)){let e=J.findKey(t,i),n=pc(i.type,e.id);r.push(D(D({},i),{},{id:n}))}}return r},t.getElemsByTypePrefix=e=>t.getElemsByType(e,!0),t.isEmpty=()=>{let{children:e=[]}=t;if(e.length>1)return!1;let n=e[0];if(n==null)return!0;if(!R.isElement(n)||n.type!==`paragraph`)return!1;let{children:r=[]}=n;if(r.length>1)return!1;let i=r[0];return i==null||W.isText(i)&&i.text===``},t.clear=()=>{let e=[{type:`paragraph`,children:[{text:``}]}];for(let e=t.children.length-1;e>=0;--e)G.removeNodes(t,{at:[e]});if(t.children.length===0){G.insertNodes(t,e);return}Qc(t)},t.getParentNode=e=>J.getParentNode(t,e),t.dangerouslyInsertHtml=(e=``,n=!1)=>{if(!e)return;let r=document.createElement(`div`);r.innerHTML=e;let i=Array.from(r.childNodes);if(i=i.filter(e=>{let{nodeName:t}=e;return Ds(e)?!0:Ts(e)?!yo.has(t.toLowerCase()):!1}),i.length===0)return;let{selection:a}=t;if(a==null)return;let o=null;if(J.isSelectedEmptyParagraph(t)&&!n){let{focus:e}=a;o=[e.path[0]]}r.setAttribute(`hidden`,`true`),document.body.appendChild(r);let s=0;i.forEach((e,n)=>{let{nodeName:r,textContent:a=``}=e;if(Ds(e)){if(!a||!a.trim())return;t.insertNode({text:a});return}if(r===`BR`){t.insertText(`
25
+ `);return}let o=e,c=!1;if(Bs.includes(r.toLowerCase()))c=!0;else for(let e in Gs)if(o.matches(e)){c=!0;break}if(c){let e=oc(q(o),t),n=Array.isArray(e)?e:[e];if(n.forEach(e=>Xc(t,e)),s+=n.length,J.isSelectedVoidNode(t)&&t.move(1),n.some(e=>R.isElement(e)?t.isInline(e)?!0:e.children.some(e=>R.isElement(e)&&t.isInline(e)):!1)&&t.selection){let e=V.nodes(t,{at:t.selection,match:e=>R.isElement(e)&&t.isInline(e),universal:!0}).next().value;if(e){let[,n]=e,r=I.next(n);V.hasPath(t,r)?G.select(t,{anchor:{path:r,offset:0},focus:{path:r,offset:0}}):t.move(1)}}return}let l=window.getComputedStyle(o).display;if(!J.isSelectedEmptyParagraph(t)&&l.indexOf(`inline`)<0){if(n>=1){let e=i[n-1];bs(e)&&t.insertBreak()}t.insertBreak()}t.dangerouslyInsertHtml(o.innerHTML,!0)}),s&&o&&J.isEmptyPath(t,o)&&G.removeNodes(t,{at:o}),r.remove()},t.setHtml=(e=``)=>{let n=t.isDisabled(),r=t.isFocused(),i=JSON.stringify(t.selection);t.enable(),po.delete(t),t.focus(),t.clear();let a=dc(t,e==null?``:e);if(G.insertFragment(t,a),r||(t.deselect(),t.blur()),n&&(t.deselect(),t.disable()),t.isFocused())try{let e=JSON.parse(i);L.isRange(e)&&J.hasRange(t,e)?t.select(e):t.select(V.start(t,[]))}catch(e){t.select(V.start(t,[]))}},t},tl=1,nl=e=>{let t=e;return t.id=`wangEditor-${tl}`,tl+=1,t.isDestroyed=!1,t.isFullScreen=!1,t.focus=e=>{if(J.toDOMNode(t,t).focus({preventScroll:!0}),fo.set(t,!0),e){let e=V.end(t,[]);G.select(t,e)}else{let e=po.get(t);e?G.select(t,e):G.select(t,V.start(t,[]))}},t.isFocused=()=>!!fo.get(t),t.blur=()=>{J.toDOMNode(t,t).blur(),G.deselect(t),fo.set(t,!1)},t.updateView=()=>{J.getTextarea(t).changeViewState();let e=J.getToolbar(t);e&&e.changeToolbarState();let n=J.getHoverbar(t);n&&n.changeHoverbarState()},t.destroy=()=>{if(t.isDestroyed)return;let e=J.getTextarea(t);e.destroy(),Ha.delete(t),Ua.delete(e);let n=J.getToolbar(t);n&&(n.destroy(),Ga.delete(t),Wa.delete(n));let r=J.getHoverbar(t);r&&(r.destroy(),qa.delete(t),Ka.delete(r)),t.isDestroyed=!0,t.emit(za.DESTROYED)},t.scrollToElem=e=>{let{scroll:n}=t.getConfig();if(!n){let e=`编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能`;e+=`
26
+ You has disabled editor scroll, please do this yourself`,console.warn(e);return}let r=q(`#${e}`);if(r.length===0)return;let i=r[0];if(!J.hasDOMNode(t,i)){let t=`Element (found by id is '${e}') is not in editor DOM`;t+=`\n 通过 id '${e}' 找到的 element 不在 editor DOM 之内`,console.error(t,i);return}let{$textAreaContainer:a,$scroll:o}=J.getTextarea(t),{top:s}=r.offset(),{top:c}=a.offset();o[0].scrollBy({top:s-c,behavior:`smooth`})},t.showProgressBar=e=>{e<1||J.getTextarea(t).changeProgress(e)},t.hidePanelOrModal=()=>{let e=Ya.get(t);e!=null&&e.forEach(e=>e.hide())},t.enable=()=>{let e=t.getConfig();e.readOnly=!1,t.updateView()},t.disable=()=>{let e=t.getConfig();e.readOnly=!0,t.updateView()},t.isDisabled=()=>t.getConfig().readOnly,t.toDOMNode=e=>J.toDOMNode(t,e),t.fullScreen=()=>{if(t.isFullScreen)return;let e=null,n=J.getToolbar(t);n&&(e=n.$box);let r=J.getTextarea(t).$box.parent();if(e&&e.parent()[0]!==r[0]){let e=`Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent`;throw e+=`
27
+ 不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致`,Error(e)}r.addClass(`w-e-full-screen-container`);let i=r.css(`z-index`);r.attr(`data-z-index`,i.toString()),t.isFullScreen=!0,t.emit(za.FULLSCREEN)},t.unFullScreen=()=>{if(!t.isFullScreen)return;let e=J.getTextarea(t).$box.parent();setTimeout(()=>{e.removeClass(`w-e-full-screen-container`),t.isFullScreen=!1,t.emit(za.UNFULLSCREEN)},200)},t.getEditableContainer=()=>J.getTextarea(t).$textAreaContainer[0],t};var rl=c(((e,t)=>{var n=void 0;t.exports=function(e){return e!==n&&e!==null}})),il=c(((e,t)=>{var n=rl(),r={object:!0,function:!0,undefined:!0};t.exports=function(e){return n(e)?hasOwnProperty.call(r,typeof e):!1}})),al=c(((e,t)=>{var n=il();t.exports=function(e){if(!n(e))return!1;try{return e.constructor?e.constructor.prototype===e:!1}catch(e){return!1}}})),ol=c(((e,t)=>{var n=al();t.exports=function(e){if(typeof e!=`function`||!hasOwnProperty.call(e,`length`))return!1;try{if(typeof e.length!=`number`||typeof e.call!=`function`||typeof e.apply!=`function`)return!1}catch(e){return!1}return!n(e)}})),sl=c(((e,t)=>{var n=ol(),r=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(e){return!(!n(e)||r.test(i.call(e)))}})),cl=c(((e,t)=>{t.exports=function(){var e=Object.assign,t;return typeof e==`function`?(t={foo:`raz`},e(t,{bar:`dwa`},{trzy:`trzy`}),t.foo+t.bar+t.trzy===`razdwatrzy`):!1}})),ll=c(((e,t)=>{t.exports=function(){try{return!0}catch(e){return!1}}})),ul=c(((e,t)=>{t.exports=function(){}})),dl=c(((e,t)=>{var n=ul()();t.exports=function(e){return e!==n&&e!==null}})),fl=c(((e,t)=>{var n=dl(),r=Object.keys;t.exports=function(e){return r(n(e)?Object(e):e)}})),pl=c(((e,t)=>{t.exports=ll()()?Object.keys:fl()})),ml=c(((e,t)=>{var n=dl();t.exports=function(e){if(!n(e))throw TypeError(`Cannot use null or undefined`);return e}})),hl=c(((e,t)=>{var n=pl(),r=ml(),i=Math.max;t.exports=function(e,t){var a,o,s=i(arguments.length,2),c;for(e=Object(r(e)),c=function(n){try{e[n]=t[n]}catch(e){a||(a=e)}},o=1;o<s;++o)t=arguments[o],n(t).forEach(c);if(a!==void 0)throw a;return e}})),gl=c(((e,t)=>{t.exports=cl()()?Object.assign:hl()})),_l=c(((e,t)=>{var n=dl(),r=Array.prototype.forEach,i=Object.create,a=function(e,t){for(var n in e)t[n]=e[n]};t.exports=function(e){var t=i(null);return r.call(arguments,function(e){n(e)&&a(Object(e),t)}),t}})),vl=c(((e,t)=>{var n=`razdwatrzy`;t.exports=function(){return typeof n.contains==`function`?n.contains(`dwa`)===!0&&n.contains(`foo`)===!1:!1}})),yl=c(((e,t)=>{var n=String.prototype.indexOf;t.exports=function(e){return n.call(this,e,arguments[1])>-1}})),bl=c(((e,t)=>{t.exports=vl()()?String.prototype.contains:yl()})),xl=c(((e,t)=>{var n=rl(),r=sl(),i=gl(),a=_l(),o=bl(),s=t.exports=function(e,t){var r,s,c,l,u;return arguments.length<2||typeof e!=`string`?(l=t,t=e,e=null):l=arguments[2],n(e)?(r=o.call(e,`c`),s=o.call(e,`e`),c=o.call(e,`w`)):(r=c=!0,s=!1),u={value:t,configurable:r,enumerable:s,writable:c},l?i(a(l),u):u};s.gs=function(e,t,s){var c,l,u,d;return typeof e==`string`?u=arguments[3]:(u=s,s=t,t=e,e=null),n(t)?r(t)?n(s)?r(s)||(u=s,s=void 0):s=void 0:(u=t,t=s=void 0):t=void 0,n(e)?(c=o.call(e,`c`),l=o.call(e,`e`)):(c=!0,l=!1),d={get:t,set:s,configurable:c,enumerable:l},u?i(a(u),d):d}})),Sl=c(((e,t)=>{t.exports=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function`);return e}})),Cl=d(c(((e,t)=>{var n=xl(),r=Sl(),i=Function.prototype.apply,a=Function.prototype.call,o=Object.create,s=Object.defineProperty,c=Object.defineProperties,l=Object.prototype.hasOwnProperty,u={configurable:!0,enumerable:!1,writable:!0},d=function(e,t){var n;return r(t),l.call(this,`__ee__`)?n=this.__ee__:(n=u.value=o(null),s(this,`__ee__`,u),u.value=null),n[e]?typeof n[e]==`object`?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},f=function(e,t){var n,a;return r(t),a=this,d.call(this,e,n=function(){p.call(a,e,n),i.call(t,this,arguments)}),n.__eeOnceListener__=t,this},p=function(e,t){var n,i,a,o;if(r(t),!l.call(this,`__ee__`)||(n=this.__ee__,!n[e]))return this;if(i=n[e],typeof i==`object`)for(o=0;a=i[o];++o)(a===t||a.__eeOnceListener__===t)&&(i.length===2?n[e]=i[o?0:1]:i.splice(o,1));else (i===t||i.__eeOnceListener__===t)&&delete n[e];return this},m=function(e){var t,n,r,o,s;if(l.call(this,`__ee__`)&&(o=this.__ee__[e],o))if(typeof o==`object`){for(n=arguments.length,s=Array(n-1),t=1;t<n;++t)s[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)i.call(r,this,s)}else switch(arguments.length){case 1:a.call(o,this);break;case 2:a.call(o,this,arguments[1]);break;case 3:a.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,s=Array(n-1),t=1;t<n;++t)s[t-1]=arguments[t];i.call(o,this,s)}},h={on:d,once:f,off:p,emit:m},g={on:n(d),once:n(f),off:n(p),emit:n(m)},_=c({},g);t.exports=e=function(e){return e==null?o(_):c(Object(e),g)},e.methods=h}))(),1);function wl(e){let t=mo.get(e);return t==null&&(t=(0,Cl.default)(),mo.set(e,t)),t}let Tl=new WeakMap;function El(e,t){let n=Tl.get(e);n==null&&(n=new Set,Tl.set(e,n)),n.add(t)}function Dl(e){return Tl.get(e)||new Set}function Ol(e){Tl.set(e,new Set)}let kl=e=>{let t=e;return t.on=(e,n)=>{let r=wl(t);if(r.on(e,n),e===`destroyed`&&El(t,n),e!==`destroyed`){let i=()=>r.off(e,n);r.on(`destroyed`,i),El(t,i)}},t.once=(e,n)=>{wl(t).once(e,n)},t.off=(e,n)=>{wl(t).off(e,n)},t.emit=(e,...n)=>{let r=wl(t);r.emit(e,...n),e===`destroyed`&&(Dl(t).forEach(e=>r.off(`destroyed`,e)),Ol(t))},t};function Al(e){return e.replace(/\n\r|\r\n|\r/g,`
28
+ `).split(`
29
+ `).map(e=>({type:`paragraph`,children:[{text:e}]}))}let jl=e=>{let t=e;return t.setFragmentData=e=>{let{selection:n}=t;if(!n)return;let[r,i]=L.edges(n),a=V.void(t,{at:r.path}),o=V.void(t,{at:i.path});if(L.isCollapsed(n)&&!a)return;let s=J.toDOMRange(t,n),c=s.cloneContents(),l=c.childNodes[0];if(c.childNodes.forEach(e=>{e.textContent&&e.textContent.trim()!==``&&(l=e)}),o){let[e]=o,n=s.cloneRange(),r=J.toDOMNode(t,e);n.setEndAfter(r),c=n.cloneContents()}if(a&&(l=c.querySelector(`[data-slate-spacer]`)),Array.from(c.querySelectorAll(`[data-slate-zero-width]`)).forEach(e=>{e.textContent=e.getAttribute(`data-slate-zero-width`)===`n`?`
30
+ `:``}),Ds(l)){let e=l.ownerDocument.createElement(`span`);e.style.whiteSpace=`pre`,e.appendChild(l),c.appendChild(e),l=e}let u=t.getFragment(),d=JSON.stringify(u),f=window.btoa(encodeURIComponent(d));l.setAttribute(`data-slate-fragment`,f),e.setData(`application/x-slate-fragment`,f);let p=c.ownerDocument.createElement(`div`);return p.appendChild(c),p.setAttribute(`hidden`,`true`),c.ownerDocument.body.appendChild(p),e.setData(`text/html`,p.innerHTML),e.setData(`text/plain`,Ps(p)),c.ownerDocument.body.removeChild(p),e},t.insertData=e=>{let n=e.getData(`application/x-slate-fragment`);if(n){let e=decodeURIComponent(window.atob(n)),r=JSON.parse(e);t.insertFragment(r);return}let r=e.getData(`text/plain`),i=e.getData(`text/html`);if(i){let{sanitizeHtml:e}=t.getConfig();t.dangerouslyInsertHtml(e?e(i):i);return}if(r){if(!/[\r\n]/.test(r)){t.insertText(r);return}let e=Al(r);t.insertFragment(e)}},t};var Ml={isHistory(e){return En(e)&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(e.redos.length===0||Tn.isOperationList(e.redos[0].operations))&&(e.undos.length===0||Tn.isOperationList(e.undos[0].operations))}},Nl=new WeakMap,Pl=new WeakMap,Fl=new WeakMap,Il={isHistoryEditor(e){return Ml.isHistory(e.history)&&V.isEditor(e)},isMerging(e){return Pl.get(e)},isSplittingOnce(e){return Fl.get(e)},setSplittingOnce(e,t){Fl.set(e,t)},isSaving(e){return Nl.get(e)},redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=Il.isMerging(e);Pl.set(e,!0),t(),Pl.set(e,n)},withNewBatch(e,t){var n=Il.isMerging(e);Pl.set(e,!0),Fl.set(e,!0),t(),Pl.set(e,n),Fl.delete(e)},withoutMerging(e,t){var n=Il.isMerging(e);Pl.set(e,!1),t(),Pl.set(e,n)},withoutSaving(e,t){var n=Il.isSaving(e);Nl.set(e,!1);try{t()}finally{Nl.set(e,n)}}},Ll=e=>{var t=e,{apply:n}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:n}=e;if(n.length>0){var r=n[n.length-1];r.selectionBefore&&G.setSelection(t,r.selectionBefore),Il.withoutSaving(t,()=>{V.withoutNormalizing(t,()=>{for(var e of r.operations)t.apply(e)})}),e.redos.pop(),t.writeHistory(`undos`,r)}},t.undo=()=>{var{history:e}=t,{undos:n}=e;if(n.length>0){var r=n[n.length-1];Il.withoutSaving(t,()=>{V.withoutNormalizing(t,()=>{for(var e of r.operations.map(Tn.inverse).reverse())t.apply(e);r.selectionBefore&&G.setSelection(t,r.selectionBefore)})}),t.writeHistory(`redos`,r),e.undos.pop()}},t.apply=e=>{var{operations:r,history:i}=t,{undos:a}=i,o=a[a.length-1],s=o&&o.operations[o.operations.length-1],c=Il.isSaving(t),l=Il.isMerging(t);if(c==null&&(c=zl(e)),c){if(l==null&&(l=o==null?!1:r.includes(s)?!0:Rl(e,s)),Il.isSplittingOnce(t)&&(l=!1,Il.setSplittingOnce(t,void 0)),o&&l)o.operations.push(e);else{var u={operations:[e],selectionBefore:t.selection};t.writeHistory(`undos`,u)}for(;a.length>100;)a.shift();i.redos=[]}n(e)},t.writeHistory=(e,n)=>{t.history[e].push(n)},t},Rl=(e,t)=>!!(t&&e.type===`insert_text`&&t.type===`insert_text`&&e.offset===t.offset+t.text.length&&I.equals(e.path,t.path)||t&&e.type===`remove_text`&&t.type===`remove_text`&&e.offset+e.text.length===t.offset&&I.equals(e.path,t.path)),zl=(e,t)=>e.type!==`set_selection`;let Bl=e=>{let t=Ll(e);return t.clearHistory=()=>{t.history.undos=[],t.history.redos=[]},t};function Vl(e){return e.replace(/\n\r|\r\n|\r|\n/g,``).length}function Hl(e,t){if(t<=0)return``;let n=t,r=``;for(let t of e){if(/\r|\n/.test(t)){r+=t;continue}if(n<=0)break;r+=t,--n}return r}function Ul(e,t){if(t<=0)return``;let n=document.createElement(`div`);n.innerHTML=e;let r=e=>{e.forEach(e=>e.remove())},i=e=>{let n=Array.from(e.childNodes);for(let e=0;e<n.length;e+=1){let a=n[e];if(Ds(a)){let i=a.textContent||``,o=Vl(i);if(o<=t){t-=o;continue}return a.textContent=Hl(i,t),t=0,r(n.slice(e+1)),!1}if(Ts(a)){if(yo.has(a.nodeName.toLowerCase())){a.remove();continue}if(!i(a))return r(n.slice(e+1)),!1;continue}a.remove()}return t>0};return i(n),n.innerHTML}let Wl=e=>{let t=e,{insertText:n,insertNode:r,insertFragment:i,dangerouslyInsertHtml:a}=t;return t.insertText=e=>{let{maxLength:r}=t.getConfig();if(!r){n(e);return}let i=J.getLeftLengthOfMaxLength(t);if(!(i<=0)){if(i<e.length){n(e.slice(0,i));return}n(e)}},t.insertNode=e=>{let{maxLength:n}=t.getConfig();if(!n){r(e);return}let i=J.getLeftLengthOfMaxLength(t);i<=0||i<z.string(e).length||r(e)},t.insertFragment=e=>{let{maxLength:n}=t.getConfig();if(!n){i(e);return}if(e.length>0){let n=e[0];if(J.getLeftLengthOfMaxLength(t)<z.string(n).length)return;i([n]);for(let n=1;n<e.length;n+=1)t.insertNode(e[n])}},t.dangerouslyInsertHtml=(e=``,n=!1)=>{if(!e)return;let{maxLength:r}=t.getConfig();if(!r){a(e,n);return}let i=J.getLeftLengthOfMaxLength(t);if(i<=0)return;let o=Ul(e,i);o&&a(o,n)},t};function Gl(e){return e<0?0:e}function Kl(e){let t=J.getTextarea(e).$textAreaContainer,n=t.width(),r=t.height(),{top:i,left:a}=t.offset();return{top:i,left:a,width:n,height:r}}function ql(e){let t={top:`0`,left:`0`},{selection:n}=e;if(n==null)return t;let r=Kl(e);if(r==null)return t;let{top:i,left:a,width:o,height:s}=r,c=J.toDOMRange(e,n).getClientRects(),l=c?c[0]:null;if(l==null)return t;let{top:u,left:d}=l,f={},p=u-i,m=d-a;if(m>o/2?f.right=`${Gl(o-m)+5}px`:f.left=`${Gl(m)+5}px`,p>s/2)f.bottom=`${Gl(s-p)+5}px`;else{let e=c[c.length-1],t=e.top-i+e.height;t<0&&(t=0),f.top=`${t+5}px`}return f}function Jl(e,t,n=`modal`){let r={top:`0`,left:`0`},{selection:i}=e;if(i==null)return r;let a=R.isElement(t)&&e.isVoid(t),o=R.isElement(t)&&e.isInline(t),s=co.get(t);if(s==null)return r;let{top:c,left:l,height:u,width:d}=s.getBoundingClientRect();if(a){let e=Fs(s);if(e!=null){let{top:t,height:n}=e.getBoundingClientRect();c=t,u=n}}let f=Kl(e);if(f==null)return r;let{top:p,left:m,width:h,height:g}=f,_={},v=c-p,y=l-m;if(n===`bar`)return _.left=`${Gl(y)}px`,v>40?_.bottom=`${Gl(g-v)+5}px`:_.top=`${v+u+5}px`,_;if(n===`modal`){if(a?o?y>(h-d)/2?_.right=`${Gl(h-y)+5}px`:_.left=`${Gl(y+d)+5}px`:_.left=`20px`:_.left=`${Gl(y)}px`,a){let e=v;e<0&&(e=0),_.top=`${e}px`}else if(v>(g-u)/2)_.bottom=`${Gl(g-v)+5}px`;else{let e=v+u;e<0&&(e=0),_.top=`${e+5}px`}return _}throw Error(`type '${n}' is invalid`)}function Yl(e,t){zt(()=>{let n=Kl(e);if(n==null)return;let{top:r,left:i,width:a,height:o}=n,{top:s,left:c}=t.offset(),l=t.width(),u=t.height(),d=s-r,f=c-i,p=t.attr(`style`);if(p.indexOf(`top`)>=0){let e=d+u-o;if(e>0){let n=t.css(`top`),r=parseInt(n.toString(),10)-e;r<0&&(r=0),t.css(`top`,`${r}px`)}}if(p.indexOf(`bottom`)>=0&&s<0){let e=t.css(`bottom`),n=parseInt(e.toString(),10)-Math.abs(s);t.css(`bottom`,`${n}px`)}if(p.indexOf(`left`)>=0){let e=f+l-a;if(e>0){let n=t.css(`left`),r=parseInt(n.toString(),10)-e;r<0&&(r=0),t.css(`left`,`${r}px`)}}if(p.indexOf(`right`)>=0&&f<0){let e=t.css(`right`),n=parseInt(e.toString(),10)-Math.abs(f);t.css(`right`,`${n}px`)}})}let Xl=e=>{let t=e,{select:n,deselect:r,move:i}=t;return t.select=e=>{n(e)},t.deselect=()=>{let{selection:e}=t,n=J.findDocumentOrShadowRoot(t).getSelection();n&&n.rangeCount>0&&J.hasDOMNode(t,n.anchorNode)&&J.hasDOMNode(t,n.focusNode)&&n.removeAllRanges(),e&&r()},t.move=(e,t=!1)=>{if(typeof e!=`number`){i(e);return}e&&(e<0||i({distance:e,unit:`character`,reverse:t}))},t.moveReverse=e=>{t.move(e,!0)},t.restoreSelection=()=>{let e=po.get(t);e!=null&&(t.focus(),n(e))},t.getSelectionPosition=()=>ql(t),t.getNodePosition=e=>Jl(t,e),t.isSelectedAll=()=>{let{selection:e}=t;if(e==null)return!1;let[n,r]=L.edges(e),[i,a]=V.edges(t,[]);return!!(U.equals(n,i)&&U.equals(r,a))},t.selectAll=()=>{n({anchor:V.start(t,[]),focus:V.end(t,[])})},t};var Zl=d(c(((e,t)=>{var n=`Expected a function`,r=NaN,i=`[object Symbol]`,a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt,u=typeof global==`object`&&global&&global.Object===Object&&global,d=typeof self==`object`&&self&&self.Object===Object&&self,f=u||d||Function(`return this`)(),p=Object.prototype.toString,m=Math.max,h=Math.min,g=function(){return f.Date.now()};function _(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(n);t=x(t)||0,v(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?m(x(r.maxWait)||0,t):o,p=`trailing`in r?!!r.trailing:p);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function y(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?h(i,o-r):i}function S(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(S(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,p&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(g())}function D(){var e=g(),n=S(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return y(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return D.cancel=T,D.flush=E,D}function v(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function y(e){return!!e&&typeof e==`object`}function b(e){return typeof e==`symbol`||y(e)&&p.call(e)==i}function x(e){if(typeof e==`number`)return e;if(b(e))return r;if(v(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=v(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(a,``);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?r:+e}t.exports=_}))(),1);O();let Y=e=>typeof e==`string`,Ql=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},$l=e=>e==null?``:``+e,eu=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},tu=/###/g,nu=e=>e&&e.indexOf(`###`)>-1?e.replace(tu,`.`):e,ru=e=>!e||Y(e),iu=(e,t,n)=>{let r=Y(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(ru(e))return{};let t=nu(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return ru(e)?{}:{obj:e,k:nu(r[i])}},au=(e,t,n)=>{let{obj:r,k:i}=iu(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=iu(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=iu(e,o,Object),s&&s.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},ou=(e,t,n,r)=>{let{obj:i,k:a}=iu(e,t,Object);i[a]=i[a]||[],i[a].push(n)},su=(e,t)=>{let{obj:n,k:r}=iu(e,t);if(n)return n[r]},cu=(e,t,n)=>{let r=su(e,n);return r===void 0?su(t,n):r},lu=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?Y(e[r])||e[r]instanceof String||Y(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):lu(e[r],t[r],n):e[r]=t[r]);return e},uu=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`);var du={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`};let fu=e=>Y(e)?e.replace(/[&<>"'\/]/g,e=>du[e]):e;var pu=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}};let mu=[` `,`,`,`?`,`!`,`;`],hu=new pu(20),gu=(e,t,n)=>{t=t||``,n=n||``;let r=mu.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=hu.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},_u=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`.`;if(!e)return;if(e[t])return e[t];let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},vu=e=>e&&e.replace(`_`,`-`),yu={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};var bu=new class e{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||`i18next:`,this.logger=e||yu,this.options=t,this.debug=t.debug}log(){var e=[...arguments];return this.forward(e,`log`,``,!0)}warn(){var e=[...arguments];return this.forward(e,`warn`,``,!0)}error(){var e=[...arguments];return this.forward(e,`error`,``)}deprecate(){var e=[...arguments];return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(Y(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,D(D({},{prefix:`${this.prefix}:${t}:`}),this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},xu=class{constructor(){this.observers={}}on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){var t=[...arguments].slice(1);this.observers[e]&&Array.from(this.observers[e].entries()).forEach(e=>{let[n,r]=e;for(let e=0;e<r;e++)n(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(n=>{let[r,i]=n;for(let n=0;n<i;n++)r.apply(r,[e,...t])})}},Su=class extends xu{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:[`translation`],defaultNS:`translation`};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):Y(n)&&i?o.push(...n.split(i)):o.push(n)));let s=su(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!Y(n)?s:_u(this.data&&this.data[e]&&this.data[e][t],n,i)}addResource(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),au(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(let r in n)(Y(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=su(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?lu(s,n,i):s=D(D({},s),n),au(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI===`v1`?D(D({},{}),this.getResource(e,t)):this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},Cu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,i))}),t}};let wu={};var Tu=class e extends xu{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),eu([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=bu.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;let n=this.resolve(e,t);return n&&n.res!==void 0}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!gu(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Y(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:Y(i)?[i]:i}}translate(t,n,r){if(typeof n!=`object`&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n==`object`&&(n=D({},n)),n||(n={}),t==null)return``;Array.isArray(t)||(t=[String(t)]);let i=n.returnDetails===void 0?this.options.returnDetails:n.returnDetails,a=n.keySeparator===void 0?this.options.keySeparator:n.keySeparator,{key:o,namespaces:s}=this.extractFromKey(t[t.length-1],n),c=s[s.length-1],l=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&l.toLowerCase()===`cimode`){if(u){let e=n.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${e}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${e}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}let d=this.resolve(t,n),f=d&&d.res,p=d&&d.usedKey||o,m=d&&d.exactUsedKey||o,h=Object.prototype.toString.apply(f),g=[`[object Number]`,`[object Function]`,`[object RegExp]`],_=n.joinArrays===void 0?this.options.joinArrays:n.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=!Y(f)&&typeof f!=`boolean`&&typeof f!=`number`;if(v&&f&&y&&g.indexOf(h)<0&&!(Y(_)&&Array.isArray(f))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,f,D(D({},n),{},{ns:s})):`key '${o} (${this.language})' returned an object instead of string.`;return i?(d.res=e,d.usedParams=this.getUsedParamsDetails(n),d):e}if(a){let e=Array.isArray(f),t=e?[]:{},r=e?m:p;for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e)){let i=`${r}${a}${e}`;t[e]=this.translate(i,D(D({},n),{joinArrays:!1,ns:s})),t[e]===i&&(t[e]=f[e])}f=t}}else if(v&&Y(_)&&Array.isArray(f))f=f.join(_),f&&(f=this.extendTranslation(f,t,n,r));else{let i=!1,s=!1,u=n.count!==void 0&&!Y(n.count),p=e.hasDefaultValue(n),m=u?this.pluralResolver.getSuffix(l,n.count,n):``,h=n.ordinal&&u?this.pluralResolver.getSuffix(l,n.count,{ordinal:!1}):``,g=u&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),_=g&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${m}`]||n[`defaultValue${h}`]||n.defaultValue;!this.isValidLookup(f)&&p&&(i=!0,f=_),this.isValidLookup(f)||(s=!0,f=o);let v=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:f,y=p&&_!==f&&this.options.updateMissing;if(s||i||y){if(this.logger.log(y?`updateKey`:`missingKey`,l,c,o,y?_:f),a){let e=this.resolve(o,D(D({},n),{},{keySeparator:!1}));e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let i=p&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,c,t,i,y,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,c,t,i,y,n),this.emit(`missingKey`,e,c,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);g&&n[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],o+t,n[`defaultValue${t}`]||_)})}):r(e,o,_))}f=this.extendTranslation(f,t,n,d,r),s&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${o}`),(s||i)&&this.options.parseMissingKeyHandler&&(f=this.options.compatibilityAPI===`v1`?this.options.parseMissingKeyHandler(f):this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,i?f:void 0))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(e,t,n,r,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,D(D({},this.options.interpolation.defaultVariables),n),n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(D(D({},n),{interpolation:D(D({},this.options.interpolation),n.interpolation)}));let o=Y(e)&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),s;if(o){let t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let c=n.replace&&!Y(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=D(D({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language||r.usedLng,n),o){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;s<r&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!==`v1`&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){var e=[...arguments];return i&&i[0]===e[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):a.translate(...e,t)},n)),n.interpolation&&this.interpolator.reset()}let o=n.postProcess||this.options.postProcess,s=Y(o)?[o]:o;return e!=null&&s&&s.length&&n.applyPostProcessor!==!1&&(e=Cu.handle(s,e,t,this.options&&this.options.postProcessPassResolved?D({i18nResolved:D(D({},r),{},{usedParams:this.getUsedParamsDetails(n)})},n):n,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,r,i,a,o;return Y(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!Y(t.count),d=u&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),f=t.context!==void 0&&(Y(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!wu[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(wu[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(o.push(c+e),t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator}${t.context}`;o.push(r),u&&(o.push(r+e),t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!Y(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r=D(D({},this.options.interpolation.defaultVariables),r)),!n){r=D({},r);for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}};let Eu=e=>e.charAt(0).toUpperCase()+e.slice(1);var Du=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=bu.create(`languageUtils`)}getScriptPartFromCode(e){if(e=vu(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=vu(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Y(e)&&e.indexOf(`-`)>-1){if(typeof Intl<`u`&&Intl.getCanonicalLocales!==void 0)try{let t=Intl.getCanonicalLocales(e)[0];if(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)return t}catch(e){}let t=[`hans`,`hant`,`latn`,`cyrl`,`cans`,`mong`,`arab`],n=e.split(`-`);return this.options.lowerCaseLng?n=n.map(e=>e.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Eu(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!==`sgn`&&n[2].length===2&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Eu(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Eu(n[2].toLowerCase()))),n.join(`-`)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(e.indexOf(`-`)<0&&n.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&n.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===n||e.indexOf(n)===0&&n.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),Y(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Y(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):Y(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}};let Ou=[{lngs:[`ach`,`ak`,`am`,`arn`,`br`,`fil`,`gun`,`ln`,`mfe`,`mg`,`mi`,`oc`,`pt`,`pt-BR`,`tg`,`tl`,`ti`,`tr`,`uz`,`wa`],nr:[1,2],fc:1},{lngs:`af.an.ast.az.bg.bn.ca.da.de.dev.el.en.eo.es.et.eu.fi.fo.fur.fy.gl.gu.ha.hi.hu.hy.ia.it.kk.kn.ku.lb.mai.ml.mn.mr.nah.nap.nb.ne.nl.nn.no.nso.pa.pap.pms.ps.pt-PT.rm.sco.se.si.so.son.sq.sv.sw.ta.te.tk.ur.yo`.split(`.`),nr:[1,2],fc:2},{lngs:[`ay`,`bo`,`cgg`,`fa`,`ht`,`id`,`ja`,`jbo`,`ka`,`km`,`ko`,`ky`,`lo`,`ms`,`sah`,`su`,`th`,`tt`,`ug`,`vi`,`wo`,`zh`],nr:[1],fc:3},{lngs:[`be`,`bs`,`cnr`,`dz`,`hr`,`ru`,`sr`,`uk`],nr:[1,2,5],fc:4},{lngs:[`ar`],nr:[0,1,2,3,11,100],fc:5},{lngs:[`cs`,`sk`],nr:[1,2,5],fc:6},{lngs:[`csb`,`pl`],nr:[1,2,5],fc:7},{lngs:[`cy`],nr:[1,2,3,8],fc:8},{lngs:[`fr`],nr:[1,2],fc:9},{lngs:[`ga`],nr:[1,2,3,7,11],fc:10},{lngs:[`gd`],nr:[1,2,3,20],fc:11},{lngs:[`is`],nr:[1,2],fc:12},{lngs:[`jv`],nr:[0,1],fc:13},{lngs:[`kw`],nr:[1,2,3,4],fc:14},{lngs:[`lt`],nr:[1,2,10],fc:15},{lngs:[`lv`],nr:[1,2,0],fc:16},{lngs:[`mk`],nr:[1,2],fc:17},{lngs:[`mnk`],nr:[0,1,2],fc:18},{lngs:[`mt`],nr:[1,2,11,20],fc:19},{lngs:[`or`],nr:[2,1],fc:2},{lngs:[`ro`],nr:[1,2,20],fc:20},{lngs:[`sl`],nr:[5,1,2,3],fc:21},{lngs:[`he`,`iw`],nr:[1,2,20,21],fc:22}],ku={1:e=>Number(e>1),2:e=>Number(e!=1),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(e==1?0:e>=2&&e<=4?1:2),7:e=>Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(e==1?0:e==2?1:e!=8&&e!=11?2:3),9:e=>Number(e>=2),10:e=>Number(e==1?0:e==2?1:e<7?2:e<11?3:4),11:e=>Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(e!==0),14:e=>Number(e==1?0:e==2?1:e==3?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:e===0?2:1),17:e=>Number(e==1||e%10==1&&e%100!=11?0:1),18:e=>Number(e==0?0:e==1?1:2),19:e=>Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(e==1?0:e==0||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)},Au=[`v1`,`v2`,`v3`],ju=[`v4`],Mu={zero:0,one:1,two:2,few:3,many:4,other:5},Nu=()=>{let e={};return Ou.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:ku[t.fc]}})}),e};var Pu=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=bu.create(`pluralResolver`),(!this.options.compatibilityJSON||ju.includes(this.options.compatibilityJSON))&&(typeof Intl>`u`||!Intl.PluralRules)&&(this.options.compatibilityJSON=`v3`,this.logger.error(`Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.`)),this.rules=Nu(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){let n=vu(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch(n){if(!e.match(/-|_/))return;let r=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(r,t)}return this.pluralRulesCache[i]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((e,t)=>Mu[e]-Mu[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):n.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),``)}getSuffixRetroCompatible(e,t){let n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(r===2?r=`plural`:r===1&&(r=``));let i=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return this.options.compatibilityJSON===`v1`?r===1?``:typeof r==`number`?`_plural_${r.toString()}`:i():this.options.compatibilityJSON===`v2`||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!Au.includes(this.options.compatibilityJSON)}};let Fu=function(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`.`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=cu(e,t,n);return!a&&i&&Y(n)&&(a=_u(e,n,r),a===void 0&&(a=_u(t,n,r))),a},Iu=e=>e.replace(/\$/g,`$$$$`);var Lu=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=bu.create(`interpolator`),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?fu:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?uu(i):a||`{{`,this.suffix=o?uu(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?uu(d):f||uu(`$t(`),this.nestingSuffix=p?uu(p):m||uu(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=Fu(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,D(D(D({},r),t),{},{interpolationkey:e})):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(Fu(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,D(D(D({},r),t),{},{interpolationkey:a}))};this.resetRegExp();let l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Iu(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Iu(this.escape(e)):Iu(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=Y(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !Y(a)&&!this.useRawValueToEscape&&(a=$l(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${n}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);(o&&o.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a=D(D({},t),a))}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a=D({},n),a=a.replace&&!Y(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(r[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(r[1])){let e=r[1].split(this.formatSeparator).map(e=>e.trim());r[1]=e.shift(),s=e,c=!0}if(i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!Y(i))return i;Y(i)||(i=$l(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=``),c&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,D(D({},n),{},{interpolationkey:r[1].trim()})),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}};let Ru=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||(n.currency=i.trim()):t===`relativetime`&&i.indexOf(`:`)<0?n.range||(n.range=i.trim()):i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},zu=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a=D(D({},a),{},{[i.interpolationkey]:void 0}));let o=r+JSON.stringify(a),s=t[o];return s||(s=e(vu(r),i),t[o]=s),s(n)}};var Bu=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=bu.create(`formatter`),this.options=e,this.formats={number:zu((e,t)=>{let n=new Intl.NumberFormat(e,D({},t));return e=>n.format(e)}),currency:zu((e,t)=>{let n=new Intl.NumberFormat(e,D(D({},t),{},{style:`currency`}));return e=>n.format(e)}),datetime:zu((e,t)=>{let n=new Intl.DateTimeFormat(e,D({},t));return e=>n.format(e)}),relativetime:zu((e,t)=>{let n=new Intl.RelativeTimeFormat(e,D({},t));return e=>n.format(e,t.range||`day`)}),list:zu((e,t)=>{let n=new Intl.ListFormat(e,D({},t));return e=>n.format(e)})},this.init(e)}init(e){this.formatSeparator=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation.formatSeparator||`,`}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=zu(t)}format(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Ru(t);if(this.formats[i]){let t=e;try{let o=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,D(D(D({},a),r),o))}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}};let Vu=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};var Hu=class extends xu{constructor(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=bu.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{ou(n.loaded,[i],a),Vu(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();Y(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Y(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend&&this.backend.create){let s=D(D({},a),{},{isUpdate:i}),c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}};let Uu=()=>({debug:!1,initImmediate:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),Y(e[1])&&(t.defaultValue=e[1]),Y(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0}}),Wu=e=>(Y(e.ns)&&(e.ns=[e.ns]),Y(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Y(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),e),Gu=()=>{},Ku=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})};var qu=class e extends xu{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Wu(e),this.services={},this.logger=bu,this.modules={external:[]},Ku(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t==`function`&&(n=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(Y(t.ns)?t.defaultNS=t.ns:t.ns.indexOf(`translation`)<0&&(t.defaultNS=t.ns[0]));let r=Uu();this.options=D(D(D({},r),this.options),Wu(t)),this.options.compatibilityAPI!==`v1`&&(this.options.interpolation=D(D({},r.interpolation),this.options.interpolation)),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);let i=e=>e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?bu.init(i(this.modules.logger),this.options):bu.init(null,this.options);let t;this.modules.formatter?t=this.modules.formatter:typeof Intl<`u`&&(t=Bu);let n=new Du(this.options);this.store=new Su(this.options.resources,this.options);let a=this.services;a.logger=bu,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new Pu(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(a.formatter=i(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new Lu(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new Hu(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on(`*`,function(t){var n=[...arguments].slice(1);e.emit(t,...n)}),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new Tu(this.services,this.options),this.translator.on(`*`,function(t){var n=[...arguments].slice(1);e.emit(t,...n)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Gu),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let a=Ql(),o=()=>{let e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),a.resolve(t),n(e,t)};if(this.languages&&this.options.compatibilityAPI!==`v1`&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?o():setTimeout(o,0),a}loadResources(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gu,n=Y(e)?e:this.language;if(typeof e==`function`&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return t();let e=[],r=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};n?r(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>r(e)),this.options.preload&&this.options.preload.forEach(e=>r(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),t(e)})}else t(null)}reloadResources(e,t,n){let r=Ql();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Gu),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&Cu.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;let r=Ql();this.emit(`languageChanging`,e);let i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(e,a)=>{a?(i(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,r.resolve(function(){return n.t(...arguments)}),t&&t(e,function(){return n.t(...arguments)})},o=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=Y(t)?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,e=>{a(e,n)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),r}getFixedT(e,t,n){var r=this;let i=function(e,t){let a;if(typeof t!=`object`){var o=[...arguments].slice(2);a=r.options.overloadTranslationOptionHandler([e,t].concat(o))}else a=D({},t);a.lng=a.lng||i.lng,a.lngs=a.lngs||i.lngs,a.ns=a.ns||i.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||i.keyPrefix);let s=r.options.keySeparator||`.`,c;return c=a.keyPrefix&&Array.isArray(e)?e.map(e=>`${a.keyPrefix}${s}${e}`):a.keyPrefix?`${a.keyPrefix}${s}${e}`:e,r.t(c,a)};return Y(e)?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=Ql();return this.options.ns?(Y(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=Ql();Y(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return`rtl`;let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services&&this.services.languageUtils||new Du(Uu());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(){return new e(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gu,r=t.forkResourceStore;r&&delete t.forkResourceStore;let i=D(D(D({},this.options),t),{isClone:!0}),a=new e(i);return(t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services=D({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Su(this.store.data,i),a.services.resourceStore=a.store),a.translator=new Tu(a.services,i),a.translator.on(`*`,function(e){var t=[...arguments].slice(1);a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}};let Ju=qu.createInstance();Ju.createInstance=qu.createInstance,Ju.createInstance,Ju.dir,Ju.init,Ju.loadResources,Ju.reloadResources,Ju.use,Ju.changeLanguage,Ju.getFixedT,Ju.t,Ju.exists,Ju.setDefaultNamespace,Ju.hasLoadedNamespace,Ju.loadNamespaces,Ju.loadLanguages;let Yu=`translation`;Ju.init({lng:`zh-CN`,resources:{}});function Xu(e,t){Ju.addResourceBundle(e,Yu,t,!0,!0)}function Zu(e){Ju.changeLanguage(e)}function Qu(e){return Ju.getResourceBundle(e,Yu)}function $u(e){return Ju.on(`languageChanged`,e),()=>Ju.off(`languageChanged`,e)}let X=Ju.t.bind(Ju);function ed(e){if(!e.removeAttr)return;e.removeAttr(`width`),e.removeAttr(`height`),e.removeAttr(`fill`),e.removeAttr(`class`),e.removeAttr(`t`),e.removeAttr(`p-id`);let t=e.children();t.length&&ed(t)}function td(){return q(`<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>`)}function nd(){return q(`<div class="w-e-bar-divider"></div>`)}var rd=class{constructor(e){this.isShow=!1,this.showTime=0,this.record(e)}record(e){let t=Ya.get(e);t==null&&(t=new Set,Ya.set(e,t)),t.add(this),Xa.set(this,e)}renderContent(e){let{$elem:t}=this;t.empty(),t.append(e);let n=this.genSelfElem();n&&t.append(n)}appendTo(e){let{$elem:t}=this;e.append(t)}show(){if(this.isShow)return;this.showTime=Date.now();let{$elem:e}=this;e.show(),this.isShow=!0;let t=Xa.get(this);t&&t.emit(za.MODALORPANELSHOW,this)}hide(){if(!this.isShow||Date.now()-this.showTime<200)return;let{$elem:e}=this;e.hide(),this.isShow=!1;let t=Xa.get(this);t&&t.emit(za.MODALORPANELHIDE)}},id=class extends rd{constructor(...e){super(...e),this.type=`dropPanel`,this.$elem=q(`<div class="w-e-drop-panel"></div>`)}genSelfElem(){return null}};function ad(e,t,n,r=``,i=!1){if(t){if(r){let e=Tc?`cmd`:`ctrl`;r=r.replace(`mod`,e)}if(i)r&&(e.attr(`data-tooltip`,r),e.addClass(`w-e-menu-tooltip-v5`),e.addClass(`tooltip-right`));else{let t=r?`${n}\n${r}`:n;e.attr(`data-tooltip`,t),e.addClass(`w-e-menu-tooltip-v5`)}}}var od=class{constructor(e,t,n=!1){this.$elem=q(`<div class="w-e-bar-item"></div>`),this.$button=q(`<button type="button"></button>`),this.disabled=!1,this.menu=t;let{tag:r,width:i}=t;if(r!==`button`)throw Error(`Invalid tag '${r}', expected 'button'`);let{title:a,hotkey:o=``,iconSvg:s=``}=t,{$button:c}=this;if(s){let e=q(s);ed(e),c.append(e)}else c.text(a);ad(c,s,a,o,n),n&&s&&c.append(q(`<span class="title">${a}</span>`)),i&&c.css(`width`,`${i}px`),c.attr(`data-menu-key`,e),this.$elem.append(c),zt(()=>this.init())}init(){this.setActive(),this.setDisabled(),this.$button.on(`click`,e=>{e.preventDefault(),bd(this).hidePanelOrModal(),!this.disabled&&(this.exec(),this.onButtonClick())})}exec(){let e=bd(this),t=this.menu,n=t.getValue(e);t.exec(e,n),this.changeMenuState()}setActive(){let e=bd(this),{$button:t}=this,n=this.menu.isActive(e),r=`active`;n?t.addClass(r):t.removeClass(r)}setDisabled(){let e=bd(this),{$button:t}=this,n=this.menu.isDisabled(e);(e.selection==null||e.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);let r=`disabled`;n?t.addClass(r):t.removeClass(r),this.disabled=n}setIcon(){let e=bd(this),{$button:t}=this;if(!this.menu.getIcon)return;let n=this.menu.getIcon(e);if(n){t.find(`svg`).remove();let e=q(n);ed(e),t.append(e)}}setTooltip(){let e=bd(this),{$button:t}=this;if(!this.menu.getTitle)return;let n=this.menu.getTitle(e),r=this.menu.iconSvg;n&&r&&ad(t,r,n)}changeMenuState(){this.setActive(),this.setDisabled(),this.setIcon(),this.setTooltip()}},sd=class extends od{constructor(e,t,n=!1){if(super(e,t,n),this.dropPanel=null,this.menu=t,t.showDropPanel){let e=td();this.$button.append(e)}}onButtonClick(){this.menu.showDropPanel&&this.handleDropPanel()}handleDropPanel(){let e=this.menu;if(e.getPanelContentElem==null)return;let t=bd(this);if(this.dropPanel==null){let n=new id(t),r=e.getPanelContentElem(t);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{let n=this.dropPanel;if(n.isShow)n.hide();else{let r=e.getPanelContentElem(t);n.renderContent(r),n.show()}}let n=this.dropPanel;if(n.isShow){let e=this.$elem,{left:t}=e.offset(),r=e.parents(`.w-e-bar`),{left:i}=r.offset(),a=r.width()/2;t-i>=a?n.$elem.css({left:`none`,right:`0`}):n.$elem.css({left:`0`,right:`none`})}}},cd=class{constructor(e){this.$elem=q(`<div class="w-e-bar-item w-e-bar-item-group"></div>`),this.$container=q(`<div class="w-e-bar-item-menus-container"></div>`),this.$button=q(`<button type="button"></button>`);let{key:t,iconSvg:n,title:r}=e,{$elem:i,$button:a}=this;if(n){let e=q(n);ed(e),a.append(e)}else a.text(r);a.attr(`data-menu-key`,t);let o=td();a.append(o),i.append(a);let{$container:s}=this;i.append(s);let c=this.createObserver();this.observe(c)}appendBarItem(e){let{$elem:t}=e;this.$container.append(t)}observe(e){let{$container:t}=this;e.observe(t[0],{childList:!0,subtree:!0,attributes:!0})}createObserver(){let{$container:e,$button:t}=this,n=new MutationObserver(()=>{let r=e.find(`button`),i=r.length;if(i===0)return;let a=0;r.each(e=>{q(e).hasClass(`disabled`)&&(a+=1)}),n.disconnect(),a===i?t.addClass(`disabled`):t.removeClass(`disabled`),this.observe(n)});return n}},ld=class extends rd{constructor(e,t=0){super(e),this.type=`modal`,this.$elem=q(`<div class="w-e-modal"></div>`),this.width=0,t&&(this.width=t);let{$elem:n}=this;n.on(`click`,e=>e.stopPropagation()),n.on(`keyup`,t=>{t.code===`Escape`&&(this.hide(),e.restoreSelection())})}genSelfElem(){let e=q(`<span class="btn-close"><svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg></span>`),t=Xa.get(this);return e.on(`click`,()=>{this.hide(),t==null||t.restoreSelection()}),e}setStyle(e){let{width:t,$elem:n}=this;n.attr(`style`,``),t&&n.css(`width`,`${t}px`),n.css(e)}};function ud(e,t,n){let r=q(`<label class="babel-container"></label>`);r.append(`<span>${e}</span>`);let i=q(`<input type="text" id="${t}" placeholder="${n||``}">`);return r.append(i),[r[0],i[0]]}function dd(e,t,n){let r=q(`<label class="babel-container"></label>`);r.append(`<span>${e}</span>`);let i=q(`<textarea type="text" id="${t}" placeholder="${n||``}"></textarea>`);return r.append(i),[r[0],i[0]]}function fd(e,t){let n=q(`<div class="button-container"></div>`),r=q(`<button type="button" id="${e}">${t}</button>`);return n.append(r),[n[0],r[0]]}var pd=class extends od{constructor(e,t,n=!1){super(e,t,n),this.$body=q(`body`),this.modal=null,this.menu=t}onButtonClick(){this.menu.showModal&&this.handleModal()}getPosition(){let e=bd(this),t=this.menu.getModalPositionNode(e);return R.isElement(t)?Jl(e,t,`modal`):ql(e)}handleModal(){let e=bd(this),t=this.menu;if(this.modal==null){let n=new ld(e,t.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{let e=this.modal;e.isShow?e.hide():this.renderAndShowModal(e,!1)}}renderAndShowModal(e,t=!1){let n=bd(this),r=this.menu;if(r.getModalContentElem==null)return;let i=J.getTextarea(n),a=J.getToolbar(n),{modalAppendToBody:o}=(a==null?void 0:a.getConfig())||{},s=r.getModalContentElem(n);if(e.renderContent(s),o)e.setStyle({left:`0`,right:`0`});else{let t=this.getPosition();e.setStyle(t)}t&&(o?e.appendTo(this.$body):e.appendTo(i.$textAreaContainer)),e.show(),o||Yl(n,e.$elem),setTimeout(()=>{n.blur()})}};function md(){return q(`<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>`)}var hd=class extends rd{constructor(e,t){super(e),this.type=`selectList`,this.$elem=q(`<div class="w-e-select-list"></div>`),t&&this.$elem.css(`width`,`${t}px`),this.$elem.on(`click`,e=>{e.stopPropagation()})}renderList(e){let t=this.$elem;t.empty();let n=q(`<ul></ul>`);e.forEach(e=>{let{value:t,text:r,selected:i,styleForRenderMenuList:a}=e,o=q(`<li data-value="${t}"></li>`);if(a&&o.css(a),i){let e=md();o.append(e),o.addClass(`selected`)}o.append(q(`<span data-value="${t}">${r}</span>`)),o.attr(`title`,r),n.append(o)}),t.append(n)}genSelfElem(){return null}};function gd(e,t){let n=e.length,r=``;for(let i=0;i<n;i+=1){let n=e[i];if(n.value===t){r=n.text;break}}return r}var _d=class{constructor(e,t,n=!1){this.$elem=q(`<div class="w-e-bar-item"></div>`),this.$button=q(`<button type="button" class="select-button"></button>`),this.disabled=!1,this.selectList=null;let{tag:r,title:i,width:a,iconSvg:o=``,hotkey:s=``}=t;if(r!==`select`)throw Error(`Invalid tag '${r}', expected 'select'`);let c=this.$button;a&&c.css(`width`,`${a}px`),c.attr(`data-menu-key`,e),ad(c,o,i,s,n),this.$elem.append(c),this.menu=t,zt(()=>this.init())}init(){this.setSelectedValue(),this.$button.on(`click`,e=>{e.preventDefault(),bd(this).hidePanelOrModal(),this.trigger()})}trigger(){let e=bd(this);if(e.isDisabled()||this.disabled)return;let t=this.menu;if(this.selectList==null){this.selectList=new hd(e,t.selectPanelWidth);let n=this.selectList,r=t.getOptions(e);n.renderList(r),n.appendTo(this.$elem),n.show(),n.$elem.on(`click`,`li`,e=>{let{target:t}=e;if(t==null)return;e.preventDefault();let n=q(t).attr(`data-value`);this.onChange(n)})}else{let n=this.selectList;if(n.isShow)n.hide();else{let r=t.getOptions(e);n.renderList(r),n.show()}}}onChange(e){let t=bd(this),n=this.menu;n.exec!=null&&n.exec(t,e)}setSelectedValue(){let e=bd(this),t=this.menu,n=t.getValue(e),r=gd(t.getOptions(e),n.toString()),i=this.$button,a=td();i.empty(),i.text(r),i.append(a)}setDisabled(){let e=bd(this),t=this.menu.isDisabled(e),n=this.$button;(e.selection==null||e.isDisabled())&&(t=!0);let r=`disabled`;t?n.addClass(r):n.removeClass(r),this.disabled=t}changeMenuState(){this.setSelectedValue(),this.setDisabled()}},vd=class extends od{constructor(e,t,n=!1){super(e,t,n)}onButtonClick(){}};let yd=new WeakMap;function bd(e){let t=Ja.get(e);if(t==null)throw Error(`Can not get editor instance`);return t}function xd(e,t,n=!1){let r=yd.get(t);if(r)return r;let{tag:i}=t;if(i===`button`){let{showDropPanel:i,showModal:a}=t;r=i?new sd(e,t,n):a?new pd(e,t,n):new vd(e,t,n)}if(i===`select`&&(r=new _d(e,t,n)),r==null)throw Error(`Invalid tag in menu ${JSON.stringify(t)}`);return yd.set(t,r),r}function Sd(e){return new cd(e)}function Cd(e,t){let{selection:n}=e;return n==null||L.isCollapsed(n)||J.getSelectedElems(e).some(t=>{if(e.isVoid(t))return!0;let{type:n}=t;return!![`pre`,`code`,`table`].includes(n)})?!1:!!W.isText(t)}var wd=class{constructor(){this.$elem=q(`<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>`),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=()=>{},this.changeHoverbarState=(0,Zl.default)(()=>{let{isShow:e}=this,{node:t=null,menuKeys:n=[]}=this.getSelectedNodeAndMenuKeys()||{},r=this.getEditorInstance();if(t!=null&&this.changeItemsState(),t&&R.isElement(t)&&e){let e=this.isSamePath(t,this.prevSelectedNode);if(!V.isBlock(r,t)&&e)return}this.hideAndClean(),t!=null&&(this.registerItems(n),this.setPosition(t),this.show()),this.prevSelectedNode=t},200),zt(()=>{let e=this.getEditorInstance(),t=this.$elem;t.on(`mousedown`,e=>e.preventDefault(),{passive:!1}),J.getTextarea(e).$textAreaContainer.append(t),e.on(za.CHANGE,this.changeHoverbarState);let n=this.hideAndClean.bind(this);e.on(za.SCROLL,n),e.on(za.FULLSCREEN,n),e.on(za.UNFULLSCREEN,n)}),this.lngListen=$u(()=>{this.menus={},this.hideAndClean(),this.getEditorInstance().deselect()})}getMenus(){return this.menus}hideAndClean(){let e=this.$elem;e.removeClass(`w-e-bar-show`).addClass(`w-e-bar-hidden`),this.hoverbarItems=[],e.empty(),this.isShow=!1}checkPositionBottom(){let e=this.$elem,t=!1,n=typeof window<`u`?window.innerHeight:null;if(n&&n>=360){let{bottom:r}=e[0].getBoundingClientRect();n-r<360&&(t=!0)}t?e.addClass(`w-e-bar-bottom`):e.removeClass(`w-e-bar-bottom`)}show(){this.$elem.removeClass(`w-e-bar-hidden`).addClass(`w-e-bar-show`),this.isShow=!0,this.checkPositionBottom()}changeItemsState(){zt(()=>{this.hoverbarItems.forEach(e=>{e.changeMenuState()})})}registerItems(e){let t=this.$elem;e.forEach(e=>{if(e===`|`){let e=nd();t.append(e);return}this.registerSingleItem(e)})}registerSingleItem(e){let t=this.getEditorInstance(),{menus:n}=this,r=n[e];if(r==null){let t=Ba[e];if(t==null)throw Error(`Not found menu item factory by key '${e}'`);if(typeof t!=`function`)throw Error(`Menu item factory (key='${e}') is not a function`);r=t(),n[e]=r}let i=t.getMenuConfig(e);i&&i.iconSvg!==void 0&&(r.iconSvg=i.iconSvg);let a=xd(e,r);this.hoverbarItems.push(a),Ja.set(a,t),this.$elem.append(a.$elem)}setPosition(e){let t=this.getEditorInstance(),n=this.$elem;if(n.attr(`style`,``),R.isElement(e)){let r=Jl(t,e,`bar`);n.css(r),Yl(t,n);return}if(W.isText(e)){let e=ql(t);n.css(e),Yl(t,n);return}throw Error(`hoverbar.setPosition error, current selected node is not elem nor text`)}getSelectedNodeAndMenuKeys(){let e=this.getEditorInstance();if(e.selection==null)return null;let t=this.getHoverbarKeysConf(),n=null,r=[];for(let i in t){let{match:a,menuKeys:o=[]}=t[i],s=a||((e,t)=>J.checkNodeType(t,i)),c=a?null:J.getSelectedNodeByType(e,i),[l]=c?[[c]]:V.nodes(e,{match:t=>s(e,t),universal:!0});if(l!=null){n=l[0],r=o;break}}return n==null||r.length===0?null:{node:n,menuKeys:r}}getEditorInstance(){let e=Ka.get(this);if(e==null)throw Error(`Can not get editor instance`);return e}getHoverbarKeysConf(){let{hoverbarKeys:e={}}=this.getEditorInstance().getConfig(),t=e.text;return t&&t.match==null&&(t.match=Cd),e}isSamePath(e,t){if(e==null||t==null)return!1;let n=J.findPath(null,e),r=J.findPath(null,t);return I.equals(n,r)}destroy(){var e;this.changeHoverbarState.cancel(),this.$elem.remove(),(e=this.lngListen)==null||e.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null}},Td=d(ae(),1);function Ed(e,t){return Cs(t)&&J.hasDOMNode(e,t,{editable:!0})}function Dd(e,t){return Cs(t)&&J.hasDOMNode(e,t)}function Od(e,t){let{readOnly:n}=e.getConfig();if(n)return!1;let r=Dd(e,t)&&J.toSlateNode(e,t);return!!r&&R.isElement(r)&&V.isVoid(e,r)}function kd(e,t){if(Ed(e,t))return!0;if(!Dd(e,t))return!1;let n=null;return Ts(t)?n=t:Ds(t)&&(n=t.parentElement),n!=null&&n.closest(`[data-w-e-reserve]`)?!0:Od(e,t)}function Ad(e,t,n){var r;let i=e,{readOnly:a}=n.getConfig();if(!jc||a||!Ed(n,i.target))return;(r=t.flushDOMSelectionChange)==null||r.call(t);let{selection:o}=n,{inputType:s}=i,c=i.dataTransfer||i.data||void 0;if(!(s===`insertCompositionText`||s===`deleteCompositionText`)){if(i.preventDefault(),!s.startsWith(`delete`)||s.startsWith(`deleteBy`)){let[e]=i.getTargetRanges();if(e){let t=null;try{t=J.toSlateRange(n,e,{exactMatch:!1,suppressThrow:!0})}catch(e){t=null}t&&(!o||!L.equals(o,t))&&(G.select(n,t),o=t)}}if(o&&L.isExpanded(o)){let e=J.getSelectedElems(n),t=e[0].type===`table`,r=e[e.length-1].type!==`table-cell`;if(t&&r)return;if(s.startsWith(`delete`)){let e=s.endsWith(`Backward`)?`backward`:`forward`;V.deleteFragment(n,{direction:e});return}}if(o==null&&s.startsWith(`insert`)){let e=J.findDocumentOrShadowRoot(n).getSelection();if(e){let t=J.toSlateRange(n,e,{exactMatch:!1,suppressThrow:!0});t&&(G.select(n,t),o=t)}if(o==null){try{var l;(l=n.restoreSelection)==null||l.call(n)}catch(e){}o=n.selection}if(o==null){let e=V.end(n,[]),t={anchor:e,focus:e};G.select(n,t),o=t}}switch(s){case`deleteByComposition`:case`deleteByCut`:case`deleteByDrag`:V.deleteFragment(n);break;case`deleteContent`:case`deleteContentForward`:V.deleteForward(n);break;case`deleteContentBackward`:V.deleteBackward(n);break;case`deleteEntireSoftLine`:V.deleteBackward(n,{unit:`line`}),V.deleteForward(n,{unit:`line`});break;case`deleteHardLineBackward`:V.deleteBackward(n,{unit:`block`});break;case`deleteSoftLineBackward`:V.deleteBackward(n,{unit:`line`});break;case`deleteHardLineForward`:V.deleteForward(n,{unit:`block`});break;case`deleteSoftLineForward`:V.deleteForward(n,{unit:`line`});break;case`deleteWordBackward`:V.deleteBackward(n,{unit:`word`});break;case`deleteWordForward`:V.deleteForward(n,{unit:`word`});break;case`insertLineBreak`:V.insertText(n,`
31
+ `);break;case`insertParagraph`:V.insertBreak(n);break;case`insertFromDrop`:case`insertFromComposition`:case`insertFromPaste`:case`insertFromYank`:case`insertReplacementText`:case`insertText`:if(s===`insertFromComposition`&&(t.isComposing=!1,go.set(n,!0)),s===`insertFromPaste`&&!ho.get(n))break;vs(c)?n.insertData(c):typeof c==`string`&&V.insertText(n,c);break;default:}}}var jd=Ad;function Md(e,t,n){let r=e,{isUpdatingSelection:i,latestElement:a}=t,{readOnly:o}=n.getConfig();if(o||i||!Ed(n,r.target))return;let s=J.findDocumentOrShadowRoot(n);if(a===s.activeElement)return;let{relatedTarget:c}=r;if(c!==J.toDOMNode(n,n)&&!(Ts(c)&&c.hasAttribute(`data-slate-spacer`))){if(c!=null&&Cs(c)&&J.hasDOMNode(n,c)){let e=J.toSlateNode(n,c);if(R.isElement(e)&&!n.isVoid(e))return}if(Dc){let e=s.getSelection();e==null||e.removeAllRanges()}fo.delete(n)}}var Nd=Md;function Pd(e,t,n){let{readOnly:r}=n.getConfig();if(r||!Dd(n,e.target)||!Cs(e.target))return;let i=J.toSlateNode(n,e.target),a=J.findPath(n,i);if(V.hasPath(n,a)&&z.get(n,a)===i){let e=V.start(n,a),t=V.end(n,a),r=V.void(n,{at:e}),i=V.void(n,{at:t});if(r&&i&&I.equals(r[1],i[1])){let t=V.range(n,e);G.select(n,t)}}}var Fd=Pd;function Id(e,t){let{placeholder:n}=t.getConfig();if(!n)return;let r=t.isEmpty();if(r&&!e.showPlaceholder&&!e.isComposing){if(e.$placeholder==null){let t=q(`<div class="w-e-text-placeholder">${n}</div>`);e.$textAreaContainer.append(t),e.$placeholder=t}e.$placeholder.show(),e.showPlaceholder=!0;return}if(!r&&e.showPlaceholder){var i;(i=e.$placeholder)==null||i.hide(),e.showPlaceholder=!1}}function Ld(e,t){let{placeholder:n}=t.getConfig();if(n&&t.isEmpty()&&e.showPlaceholder){var r;(r=e.$placeholder)==null||r.hide(),e.showPlaceholder=!1}}let Rd=e=>typeof e==`object`&&!!e&&e.nodeType===1,zd=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,Bd=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return zd(n.overflowY,t)||zd(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},Vd=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,Hd=e=>{let t=e.parentElement;return t==null?e.getRootNode().host||null:t},Ud=(e,t)=>{var n,r,i,a;if(typeof document>`u`)return[];let{scrollMode:o,block:s,inline:c,boundary:l,skipOverflowHiddenElements:u}=t,d=typeof l==`function`?l:e=>e!==l;if(!Rd(e))throw TypeError(`Invalid target`);let f=document.scrollingElement||document.documentElement,p=[],m=e;for(;Rd(m)&&d(m);){if(m=Hd(m),m===f){p.push(m);break}m!=null&&m===document.body&&Bd(m)&&!Bd(document.documentElement)||m!=null&&Bd(m,u)&&p.push(m)}let h=(r=(n=window.visualViewport)==null?void 0:n.width)==null?innerWidth:r,g=(a=(i=window.visualViewport)==null?void 0:i.height)==null?innerHeight:a,{scrollX:_,scrollY:v}=window,{height:y,width:b,top:x,right:S,bottom:C,left:w}=e.getBoundingClientRect(),{top:T,right:E,bottom:D,left:O}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),k=s===`start`||s===`nearest`?x-T:s===`end`?C+D:x+y/2-T+D,A=c===`center`?w+b/2-O+E:c===`end`?S+E:w-O,j=[];for(let e=0;e<p.length;e++){let t=p[e],{height:n,width:r,top:i,right:a,bottom:l,left:u}=t.getBoundingClientRect();if(o===`if-needed`&&x>=0&&w>=0&&C<=g&&S<=h&&(t===f&&!Bd(t)||x>=i&&C<=l&&w>=u&&S<=a))return j;let d=getComputedStyle(t),m=parseInt(d.borderLeftWidth,10),T=parseInt(d.borderTopWidth,10),E=parseInt(d.borderRightWidth,10),D=parseInt(d.borderBottomWidth,10),O=0,ee=0,M=`offsetWidth`in t?t.offsetWidth-t.clientWidth-m-E:0,N=`offsetHeight`in t?t.offsetHeight-t.clientHeight-T-D:0,te=`offsetWidth`in t?t.offsetWidth===0?0:r/t.offsetWidth:0,P=`offsetHeight`in t?t.offsetHeight===0?0:n/t.offsetHeight:0;if(f===t)O=s===`start`?k:s===`end`?k-g:s===`nearest`?Vd(v,v+g,g,T,D,v+k,v+k+y,y):k-g/2,ee=c===`start`?A:c===`center`?A-h/2:c===`end`?A-h:Vd(_,_+h,h,m,E,_+A,_+A+b,b),O=Math.max(0,O+v),ee=Math.max(0,ee+_);else{O=s===`start`?k-i-T:s===`end`?k-l+D+N:s===`nearest`?Vd(i,l,n,T,D+N,k,k+y,y):k-(i+n/2)+N/2,ee=c===`start`?A-u-m:c===`center`?A-(u+r/2)+M/2:c===`end`?A-a+E+M:Vd(u,a,r,m,E+M,A,A+b,b);let{scrollLeft:e,scrollTop:o}=t;O=P===0?0:Math.max(0,Math.min(o+O/P,t.scrollHeight-n/P+N)),ee=te===0?0:Math.max(0,Math.min(e+ee/te,t.scrollWidth-r/te+M)),k+=o-O,A+=e-ee}j.push({el:t,top:O,left:ee})}return j},Wd=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function Gd(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(t))return t.behavior(Ud(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of Ud(e,Wd(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}function Kd(e){e.selection!=null&&(e.selection=null,e.onChange())}function qd(e,t,n=!1){let{selection:r}=t,i=t.getConfig(),a=J.findDocumentOrShadowRoot(t).getSelection();if(!a||e.isComposing&&!n||!t.isFocused())return;let o=a.type!==`None`;if(!r&&!o)return;let s=ao.get(t),c=!1;if(s.contains(a.anchorNode)&&s.contains(a.focusNode)&&(c=!0),o&&c&&r){let e=J.toSlateRange(t,a,{exactMatch:!0,suppressThrow:!0});if(e&&L.equals(e,r)){let e=!0;if(L.isCollapsed(r)){let{anchorNode:t,anchorOffset:n}=a;if(t===s){let t=s.childNodes,r;r=t[n],r&&r.matches(`table`)&&(e=!1),r=t[n-1],r&&r.matches(`table`)&&(e=!1)}}if(e)return}}if(r&&!J.hasRange(t,r)){t.selection=J.toSlateRange(t,a,{exactMatch:!1,suppressThrow:!0});return}e.isUpdatingSelection=!0;let l=null;try{l=r&&J.toDOMRange(t,r)}catch(e){l=null}if(l){L.isBackward(r)?a.setBaseAndExtent(l.endContainer,l.endOffset,l.startContainer,l.startOffset):a.setBaseAndExtent(l.startContainer,l.startOffset,l.endContainer,l.endOffset);let e=l.startContainer.parentElement;if(!e.closest(`[data-slate-spacer]`)&&l.getBoundingClientRect){let t=l.getBoundingClientRect.bind(l)();t.top===0&&t.right===0&&t.bottom===0&&t.left===0&&t.height===0&&t.width===0||(e.getBoundingClientRect=l.getBoundingClientRect.bind(l));let n=document.body;if(Gd(e,{scrollMode:`if-needed`,boundary:i.scroll&&s.parentElement||n,block:`end`,behavior:`auto`}),i.scroll){let e=s.parentElement;if(e){let t=()=>{let t=l.getBoundingClientRect(),n=e.getBoundingClientRect(),r=t.bottom-n.bottom,i=n.top-t.top;r>0?e.scrollTop+=r+1:i>0&&(e.scrollTop-=i+1)};t(),requestAnimationFrame(t)}}delete e.getBoundingClientRect}}else a.removeAllRanges();setTimeout(()=>{l&&Ec&&s.focus(),e.isUpdatingSelection=!1})}function Jd(e,t){let{isComposing:n,isUpdatingSelection:r,isDraggingInternally:i}=e,a=t.getConfig();if(r||i)return;let o=J.findDocumentOrShadowRoot(t),{activeElement:s}=o,c=J.toDOMNode(t,t),l=o.getSelection();if(s===c)e.latestElement=s,fo.set(t,!0);else{fo.delete(t),Kd(t);return}if(!l)return Kd(t);let{anchorNode:u,focusNode:d}=l,f=kd(t,u),p=Dd(t,d);if(!n)if(f&&p){let e=J.toSlateRange(t,l,{exactMatch:!1,suppressThrow:!0});e&&G.select(t,e)}else a.readOnly&&Kd(t)}let Yd=new WeakMap,Xd=new WeakMap;function Zd(e){let t;try{t=J.findDocumentOrShadowRoot(e)}catch(e){return null}let n=t.getSelection();if(!n||n.rangeCount<=0)return null;try{return n.getRangeAt(0).startContainer}catch(e){return null}}function Qd(e,t){if(L.isCollapsed(t)){let{anchor:n,focus:r}=t;if([2,3].includes(n.path.length)&&[2,3].includes(r.path.length)&&(n.offset===0||r.offset===0)){let t=V.node(e,n.path),i=n.offset===0?n.path:r.path,a=[i[0],i[1]-1];if(i[1]===0)return!1;let o=V.node(e,a);if(W.isText(o[0])&&W.isText(t[0]))return!0}}}function $d(e){let{selection:t}=e;if(t)return t;try{let n=J.findDocumentOrShadowRoot(e).getSelection();if(n){let r=J.toSlateRange(e,n,{exactMatch:!1,suppressThrow:!0});r&&(G.select(e,r),t=r)}}catch(e){}if(!t){try{var n;(n=e.restoreSelection)==null||n.call(e)}catch(e){}t=e.selection}if(!t){let n=V.end(e,[]),r={anchor:n,focus:n};G.select(e,r),t=r}return t}function ef(e,t,n){if(!Ed(n,e.target))return;_o.delete(n),t.isComposing=!0;let{selection:r}=n;if(r&&L.isCollapsed(r)){let e=Zd(n);if(e){let t=e.textContent||``;Yd.set(n,t),Xd.set(n,e)}}r&&L.isExpanded(r)&&(V.deleteFragment(n),t.changeViewState(),Promise.resolve().then(()=>{qd(t,n,!0)})),Ld(t,n)}function tf(e,t,n){Ed(n,e.target)&&(t.isComposing=!0)}function nf(e,t,n){let r=e;if(!Ed(n,r.target))return;t.isComposing=!1;let i=go.get(n)===!0;i&&go.delete(n),_o.delete(n);let a=$d(n);if(a==null)return;(Ac||Ec)&&J.cleanExposedTexNodeInSelectionBlock(n);let o=L.isBackward(a)?a.focus:a.anchor,[s]=V.node(n,[o.path[0]]);for(let e=0;e<o.path.length;e+=1){let[t]=V.node(n,o.path.slice(0,e+1));if(R.isElement(t)&&((Dc||Ec)&&t.type===`link`||t.type===`code`)){J.setNewKey(s);break}}let{data:c}=r;if(!c||i)return;let{maxLength:l}=n.getConfig();if(l){let e=J.getLeftLengthOfMaxLength(n);if(e<c.length){let r=Zd(n);r&&r.nodeType===Node.TEXT_NODE&&(r.textContent=Yd.get(n)||``),e>0&&V.insertText(n,c.slice(0,e)),t.changeViewState()}else V.insertText(n,c)}else{let e=J.findDocumentOrShadowRoot(n).getSelection();if(e&&Qd(n,a)){let t=J.toSlateRange(n,e,{exactMatch:!1,suppressThrow:!1});t&&(n.selection=t)}V.insertText(n,c)}Dc||setTimeout(()=>{let{selection:e}=n;if(e==null)return;let t=Xd.get(n);if(t==null||t.nodeType!==Node.TEXT_NODE)return;let r=Zd(n);r!=null&&r.nodeType===Node.TEXT_NODE&&r!==t&&(t.textContent=Yd.get(n)||``)})}function rf(e,t,n){let r=e;if(!Ed(n,r.target))return;let{readOnly:i}=n.getConfig();i||r.preventDefault();let a=r.clipboardData;if(a==null)return;n.setFragmentData(a);let{customCopy:o}=n.getConfig();o&&o(n,r)}var af=rf;function of(e,t,n){let r=e,{selection:i}=n,{readOnly:a}=n.getConfig();if(a||(r.preventDefault(),!Ed(n,r.target)))return;let o=r.clipboardData;if(o!=null&&(n.setFragmentData(o),i))if(L.isExpanded(i))V.deleteFragment(n);else{let e=z.parent(n,i.anchor.path);R.isElement(e)&&V.isVoid(n,e)&&G.delete(n)}}var sf=of;function cf(e,t,n){let r=e;if(!Dd(n,r.target))return;let{readOnly:i}=n.getConfig();if(i)return;let a=J.toSlateNode(n,r.target),o=J.findPath(n,a);if(R.isElement(a)&&V.isVoid(n,a)||V.void(n,{at:o,voids:!0})){let e=V.range(n,o);G.select(n,e)}let s=r.dataTransfer;s!=null&&(J.getSelectedNodeByType(n,`table`)||(t.isDraggingInternally=!0,n.setFragmentData(s)))}function lf(e,t,n){if(!Dd(n,e.target))return;let r=J.toSlateNode(n,e.target);R.isElement(r)&&V.isVoid(n,r)&&e.preventDefault()}function uf(e,t,n){let r=e,{readOnly:i}=n.getConfig();i||t.isDraggingInternally&&Dd(n,r.target)&&(t.isDraggingInternally=!1)}function df(e,t,n){let r=e,i=r.dataTransfer,{readOnly:a}=n.getConfig();if(a||!Dd(n,r.target)||i==null||jc&&Dc&&i.files.length>0)return;r.preventDefault();let o=n.selection,s=J.findEventRange(n,r);G.select(n,s),t.isDraggingInternally&&(o&&G.delete(n,{at:o}),t.isDraggingInternally=!1),n.insertData(i),n.isFocused()||n.focus()}var ff=df;function pf(e,t,n){let r=J.toDOMNode(n,n);if(t.latestElement=J.findDocumentOrShadowRoot(n).activeElement,Ec&&e.target!==r){r.focus();return}fo.set(n,!0)}var mf=pf,hf=c((e=>{Object.defineProperty(e,`__esModule`,{value:!0});for(var t=typeof window<`u`&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),n={alt:`altKey`,control:`ctrlKey`,meta:`metaKey`,shift:`shiftKey`},r={add:`+`,break:`pause`,cmd:`meta`,command:`meta`,ctl:`control`,ctrl:`control`,del:`delete`,down:`arrowdown`,esc:`escape`,ins:`insert`,left:`arrowleft`,mod:t?`meta`:`control`,opt:`alt`,option:`alt`,return:`enter`,right:`arrowright`,space:` `,spacebar:` `,up:`arrowup`,win:`meta`,windows:`meta`},i={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},a=1;a<20;a++)i[`f`+a]=111+a;function o(e,t,n){t&&!(`byKey`in t)&&(n=t,t=null),Array.isArray(e)||(e=[e]);var r=e.map(function(e){return c(e,t)}),i=function(e){return r.some(function(t){return l(t,e)})};return n==null?i:i(n)}function s(e,t){return o(e,{byKey:!0},t)}function c(e,t){var a=t&&t.byKey,o={};e=e.replace(`++`,`+add`);var s=e.split(`+`),c=s.length;for(var l in n)o[n[l]]=!1;var f=!0,p=!1,m=void 0;try{for(var h=s[Symbol.iterator](),g;!(f=(g=h.next()).done);f=!0){var _=g.value,v=_.endsWith(`?`)&&_.length>1;v&&(_=_.slice(0,-1));var y=d(_),b=n[y];if(_.length>1&&!b&&!r[_]&&!i[y])throw TypeError(`Unknown modifier: "`+_+`"`);(c===1||!b)&&(a?o.key=y:o.which=u(_)),b&&(o[b]=v?null:!0)}}catch(e){p=!0,m=e}finally{try{!f&&h.return&&h.return()}finally{if(p)throw m}}return o}function l(e,t){for(var n in e){var r=e[n],i=void 0;if(r!=null&&(i=n===`key`&&t.key!=null?t.key.toLowerCase():n===`which`?r===91&&t.which===93?91:t.which:t[n],!(i==null&&r===!1)&&i!==r))return!1}return!0}function u(e){return e=d(e),i[e]||e.toUpperCase().charCodeAt(0)}function d(e){return e=e.toLowerCase(),e=r[e]||e,e}e.isHotkey=o,e.isKeyHotkey=s}))();let gf={bold:`mod+b`,compose:[`down`,`left`,`right`,`up`,`backspace`,`enter`],moveBackward:`left`,moveForward:`right`,moveWordBackward:`ctrl+left`,moveWordForward:`ctrl+right`,deleteBackward:`shift?+backspace`,deleteForward:`shift?+delete`,extendBackward:`shift+left`,extendForward:`shift+right`,italic:`mod+i`,splitBlock:`shift?+enter`,undo:`mod+z`,tab:`tab`,selectAll:`mod+a`},_f={moveLineBackward:`opt+up`,moveLineForward:`opt+down`,moveWordBackward:`opt+left`,moveWordForward:`opt+right`,deleteBackward:[`ctrl+backspace`,`ctrl+h`],deleteForward:[`ctrl+delete`,`ctrl+d`],deleteLineBackward:`cmd+shift?+backspace`,deleteLineForward:[`cmd+shift?+delete`,`ctrl+k`],deleteWordBackward:`opt+shift?+backspace`,deleteWordForward:`opt+shift?+delete`,extendLineBackward:`opt+shift+up`,extendLineForward:`opt+shift+down`,redo:`cmd+shift+z`,transposeCharacter:`ctrl+t`},vf={deleteWordBackward:`ctrl+shift?+backspace`,deleteWordForward:`ctrl+shift?+delete`,redo:[`ctrl+y`,`ctrl+shift+z`]},yf=e=>{let t=gf[e],n=_f[e],r=vf[e],i=t&&(0,hf.isKeyHotkey)(t),a=n&&(0,hf.isKeyHotkey)(n),o=r&&(0,hf.isKeyHotkey)(r);return e=>!!(i&&i(e)||Tc&&a&&a(e)||!Tc&&o&&o(e))};var bf={isBold:yf(`bold`),isCompose:yf(`compose`),isMoveBackward:yf(`moveBackward`),isMoveForward:yf(`moveForward`),isDeleteBackward:yf(`deleteBackward`),isDeleteForward:yf(`deleteForward`),isDeleteLineBackward:yf(`deleteLineBackward`),isDeleteLineForward:yf(`deleteLineForward`),isDeleteWordBackward:yf(`deleteWordBackward`),isDeleteWordForward:yf(`deleteWordForward`),isExtendBackward:yf(`extendBackward`),isExtendForward:yf(`extendForward`),isExtendLineBackward:yf(`extendLineBackward`),isExtendLineForward:yf(`extendLineForward`),isItalic:yf(`italic`),isMoveLineBackward:yf(`moveLineBackward`),isMoveLineForward:yf(`moveLineForward`),isMoveWordBackward:yf(`moveWordBackward`),isMoveWordForward:yf(`moveWordForward`),isRedo:yf(`redo`),isSplitBlock:yf(`splitBlock`),isTransposeCharacter:yf(`transposeCharacter`),isUndo:yf(`undo`),isTab:yf(`tab`),isSelectAll:yf(`selectAll`)};O();function xf(e){e.preventDefault()}function Sf(e,t){let n=Ga.get(e),r=n&&n.getMenus(),i=qa.get(e),a=i&&i.getMenus(),o=D(D({},r),a);for(let n of Object.keys(o)){let r=o[n],{hotkey:i}=r;if(i&&(0,hf.isHotkey)(i,t)&&!r.isDisabled(e)){let t=r.getValue(e);r.exec(e,t)}}}function Cf(e,t,n){let r=e,{selection:i}=n,{readOnly:a}=n.getConfig();if(!a&&!t.isComposing&&Ed(n,r.target)){if(Sf(n,r),bf.isTab(r)){xf(r),n.handleTab();return}if(bf.isRedo(r)){xf(r),typeof n.redo==`function`&&n.redo();return}if(bf.isUndo(r)){xf(r),typeof n.undo==`function`&&n.undo();return}if(bf.isMoveLineBackward(r)){xf(r),G.move(n,{unit:`line`,reverse:!0});return}if(bf.isMoveLineForward(r)){xf(r),G.move(n,{unit:`line`});return}if(bf.isExtendLineBackward(r)){xf(r),G.move(n,{unit:`line`,edge:`focus`,reverse:!0});return}if(bf.isExtendLineForward(r)){xf(r),G.move(n,{unit:`line`,edge:`focus`});return}if(bf.isMoveBackward(r)){xf(r),i&&L.isCollapsed(i)?G.move(n,{reverse:!0}):G.collapse(n,{edge:`start`});return}if(bf.isMoveForward(r)){xf(r),i&&L.isCollapsed(i)?G.move(n):G.collapse(n,{edge:`end`});return}if(bf.isMoveWordBackward(r)){xf(r),i&&L.isExpanded(i)&&G.collapse(n,{edge:`focus`}),G.move(n,{unit:`word`,reverse:!0});return}if(bf.isMoveWordForward(r)){xf(r),i&&L.isExpanded(i)&&G.collapse(n,{edge:`focus`}),G.move(n,{unit:`word`});return}if(bf.isSelectAll(r)){xf(r),n.selectAll();return}if(jc){if((Ac||Dc)&&i&&(bf.isDeleteBackward(r)||bf.isDeleteForward(r))&&L.isCollapsed(i)){let e=z.parent(n,i.anchor.path);R.isElement(e)&&V.isVoid(n,e)&&V.isInline(n,e)&&(r.preventDefault(),G.delete(n,{unit:`block`}))}}else{if(bf.isBold(r)||bf.isItalic(r)||bf.isTransposeCharacter(r)){xf(r);return}if(bf.isSplitBlock(r)){xf(r),r.shiftKey?V.insertText(n,`
32
+ `):V.insertBreak(n);return}if(bf.isDeleteBackward(r)){xf(r),i&&L.isExpanded(i)?V.deleteFragment(n,{direction:`backward`}):V.deleteBackward(n);return}if(bf.isDeleteForward(r)){xf(r),i&&L.isExpanded(i)?V.deleteFragment(n,{direction:`forward`}):V.deleteForward(n);return}if(bf.isDeleteLineBackward(r)){xf(r),i&&L.isExpanded(i)?V.deleteFragment(n,{direction:`backward`}):V.deleteBackward(n,{unit:`line`});return}if(bf.isDeleteLineForward(r)){xf(r),i&&L.isExpanded(i)?V.deleteFragment(n,{direction:`forward`}):V.deleteForward(n,{unit:`line`});return}if(bf.isDeleteWordBackward(r)){xf(r),i&&L.isExpanded(i)?V.deleteFragment(n,{direction:`backward`}):V.deleteBackward(n,{unit:`word`});return}bf.isDeleteWordForward(r)&&(xf(r),i&&L.isExpanded(i)?V.deleteFragment(n,{direction:`forward`}):V.deleteForward(n,{unit:`word`}))}}}var wf=Cf;function Tf(e,t,n){if(jc)return;let{readOnly:r}=n.getConfig();if(r||!Ed(n,e.target))return;e.preventDefault();let i=e.key;V.insertText(n,i)}var Ef=Tf;function Df(e,t,n){ho.set(n,!0);let r=e,{readOnly:i}=n.getConfig();if(i||!Ed(n,r.target))return;let{customPaste:a}=n.getConfig();if(a&&a(n,r)===!1){ho.set(n,!1),r.preventDefault();return}if(!Dc&&jc&&!Os(r))return;r.preventDefault();let o=r.clipboardData;o!=null&&n.insertData(o)}var Of={beforeinput:jd,blur:Nd,focus:mf,click:Fd,compositionstart:ef,compositionend:nf,compositionupdate:tf,keydown:wf,keypress:Ef,copy:af,cut:sf,paste:Df,dragover:lf,dragstart:cf,dragend:uf,drop:ff};function kf(e,t){return document.createElement(e,t)}function Af(e,t,n){return document.createElementNS(e,t,n)}function jf(){return Kf(document.createDocumentFragment())}function Mf(e){return document.createTextNode(e)}function Nf(e){return document.createComment(e)}function Pf(e,t,n){if(Gf(e)){let t=e;for(;t&&Gf(t);)t=Kf(t).parent;e=t==null?e:t}Gf(t)&&(t=Kf(t,e)),n&&Gf(n)&&(n=Kf(n).firstChildNode),e.insertBefore(t,n)}function Ff(e,t){e.removeChild(t)}function If(e,t){Gf(t)&&(t=Kf(t,e)),e.appendChild(t)}function Lf(e){if(Gf(e)){for(;e&&Gf(e);)e=Kf(e).parent;return e==null?null:e}return e.parentNode}function Rf(e){var t;if(Gf(e)){let n=Kf(e),r=Lf(n);if(r&&n.lastChildNode){let e=Array.from(r.childNodes);return(t=e[e.indexOf(n.lastChildNode)+1])==null?null:t}return null}return e.nextSibling}function zf(e){return e.tagName}function Bf(e,t){e.textContent=t}function Vf(e){return e.textContent}function Hf(e){return e.nodeType===1}function Uf(e){return e.nodeType===3}function Wf(e){return e.nodeType===8}function Gf(e){return e.nodeType===11}function Kf(e,t){let n=e;return n.parent!=null||(n.parent=t==null?null:t),n.firstChildNode!=null||(n.firstChildNode=e.firstChild),n.lastChildNode!=null||(n.lastChildNode=e.lastChild),n}let qf={createElement:kf,createElementNS:Af,createTextNode:Mf,createDocumentFragment:jf,createComment:Nf,insertBefore:Pf,removeChild:Ff,appendChild:If,parentNode:Lf,nextSibling:Rf,tagName:zf,setTextContent:Bf,getTextContent:Vf,isElement:Hf,isText:Uf,isComment:Wf,isDocumentFragment:Gf};function Jf(e,t,n,r,i){return{sel:e,data:t,children:n,text:r,elm:i,key:t===void 0?void 0:t.key}}let Yf=Array.isArray;function Xf(e){return typeof e==`string`||typeof e==`number`||e instanceof String||e instanceof Number}let Zf=Jf(``,{},[],void 0,void 0);function Qf(e,t){var n,r;let i=e.key===t.key,a=((n=e.data)==null?void 0:n.is)===((r=t.data)==null?void 0:r.is),o=e.sel===t.sel,s=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&i&&a&&s}function $f(){throw Error(`The document fragment is not supported on this platform.`)}function ep(e,t){return e.isElement(t)}function tp(e,t){return e.isDocumentFragment(t)}function np(e,t,n){var r;let i={};for(let a=t;a<=n;++a){let t=(r=e[a])==null?void 0:r.key;t!==void 0&&(i[t]=a)}return i}let rp=[`create`,`update`,`remove`,`destroy`,`pre`,`post`];function ip(e,t,n){let r={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t===void 0?qf:t;for(let t of rp)for(let n of e){let e=n[t];e!==void 0&&r[t].push(e)}function a(e){let t=e.id?`#`+e.id:``,n=e.getAttribute(`class`),r=n?`.`+n.split(` `).join(`.`):``;return Jf(i.tagName(e).toLowerCase()+t+r,{},[],void 0,e)}function o(e){return Jf(void 0,{},[],void 0,e)}function s(e,t){return function(){if(--t===0){let t=i.parentNode(e);t!==null&&i.removeChild(t,e)}}}function c(e,t){var a,o,s,l;let u,d=e.data,f=d==null?void 0:d.hook;(a=f==null?void 0:f.init)==null||a.call(f,e);let p=e.children,m=e.sel;if(m===`!`)e.text!=null||(e.text=``),e.elm=i.createComment(e.text);else if(m===``)e.elm=i.createTextNode(e.text);else if(m!==void 0){let n=m.indexOf(`#`),a=m.indexOf(`.`,n),s=n>0?n:m.length,l=a>0?a:m.length,h=n!==-1||a!==-1?m.slice(0,Math.min(s,l)):m,g=d==null?void 0:d.ns,_=g===void 0?i.createElement(h,d):i.createElementNS(g,h,d);for(e.elm=_,s<l&&_.setAttribute(`id`,m.slice(s+1,l)),a>0&&_.setAttribute(`class`,m.slice(l+1).replace(/\./g,` `)),u=0;u<r.create.length;++u)r.create[u](Zf,e);if(Xf(e.text)&&(!Yf(p)||p.length===0)&&i.appendChild(_,i.createTextNode(e.text)),Yf(p))for(u=0;u<p.length;++u){let e=p[u];e!=null&&i.appendChild(_,c(e,t))}f!==void 0&&((o=f.create)==null||o.call(f,Zf,e),f.insert!==void 0&&t.push(e))}else if((s=n==null?void 0:n.experimental)!=null&&s.fragments&&e.children){for(e.elm=((l=i.createDocumentFragment)==null?$f:l)(),u=0;u<r.create.length;++u)r.create[u](Zf,e);for(u=0;u<e.children.length;++u){let n=e.children[u];n!=null&&i.appendChild(e.elm,c(n,t))}}else e.elm=i.createTextNode(e.text);return e.elm}function l(e,t,n,r,a,o){for(;r<=a;++r){let a=n[r];a!=null&&i.insertBefore(e,c(a,o),t)}}function u(e){var t,n;let i=e.data;if(i!==void 0){(n=(t=i==null?void 0:i.hook)==null?void 0:t.destroy)==null||n.call(t,e);for(let t=0;t<r.destroy.length;++t)r.destroy[t](e);if(e.children!==void 0)for(let t=0;t<e.children.length;++t){let n=e.children[t];n!=null&&typeof n!=`string`&&u(n)}}}function d(e,t,n,a){for(var o,c;n<=a;++n){let a,l=t[n];if(l!=null)if(l.sel!==void 0){u(l),a=r.remove.length+1;let e=s(l.elm,a);for(let t=0;t<r.remove.length;++t)r.remove[t](l,e);let t=(c=(o=l==null?void 0:l.data)==null?void 0:o.hook)==null?void 0:c.remove;t===void 0?e():t(l,e)}else l.children?(u(l),d(e,l.children,0,l.children.length-1)):i.removeChild(e,l.elm)}}function f(e,t,n,r){let a=0,o=0,s=t.length-1,u=t[0],f=t[s],m=n.length-1,h=n[0],g=n[m],_,v,y,b;for(;a<=s&&o<=m;)u==null?u=t[++a]:f==null?f=t[--s]:h==null?h=n[++o]:g==null?g=n[--m]:Qf(u,h)?(p(u,h,r),u=t[++a],h=n[++o]):Qf(f,g)?(p(f,g,r),f=t[--s],g=n[--m]):Qf(u,g)?(p(u,g,r),i.insertBefore(e,u.elm,i.nextSibling(f.elm)),u=t[++a],g=n[--m]):Qf(f,h)?(p(f,h,r),i.insertBefore(e,f.elm,u.elm),f=t[--s],h=n[++o]):(_===void 0&&(_=np(t,a,s)),v=_[h.key],v===void 0?(i.insertBefore(e,c(h,r),u.elm),h=n[++o]):_[g.key]===void 0?(i.insertBefore(e,c(g,r),i.nextSibling(f.elm)),g=n[--m]):(y=t[v],y.sel===h.sel?(p(y,h,r),t[v]=void 0,i.insertBefore(e,y.elm,u.elm)):i.insertBefore(e,c(h,r),u.elm),h=n[++o]));o<=m&&(b=n[m+1]==null?null:n[m+1].elm,l(e,b,n,o,m,r)),a<=s&&d(e,t,a,s)}function p(e,t,n){var a,o,s,c,u,p;let m=(a=t.data)==null?void 0:a.hook;(o=m==null?void 0:m.prepatch)==null||o.call(m,e,t);let h=t.elm=e.elm;if(e===t)return;if(t.data!==void 0||t.text!==void 0&&t.text!==e.text){t.data!=null||(t.data={}),e.data!=null||(e.data={});for(let n=0;n<r.update.length;++n)r.update[n](e,t);(u=(c=(s=t.data)==null?void 0:s.hook)==null?void 0:c.update)==null||u.call(c,e,t)}let g=e.children,_=t.children;t.text===void 0?g!==void 0&&_!==void 0?g!==_&&f(h,g,_,n):_===void 0?g===void 0?e.text!==void 0&&i.setTextContent(h,``):d(h,g,0,g.length-1):(e.text!==void 0&&i.setTextContent(h,``),l(h,null,_,0,_.length-1,n)):e.text!==t.text&&(g!==void 0&&d(h,g,0,g.length-1),i.setTextContent(h,t.text)),(p=m==null?void 0:m.postpatch)==null||p.call(m,e,t)}return function(e,t){let n,s,l,u=[];for(n=0;n<r.pre.length;++n)r.pre[n]();for(ep(i,e)?e=a(e):tp(i,e)&&(e=o(e)),Qf(e,t)?p(e,t,u):(s=e.elm,l=i.parentNode(s),c(t,u),l!==null&&(i.insertBefore(l,t.elm,i.nextSibling(s)),d(l,[e],0,0))),n=0;n<u.length;++n)u[n].data.hook.insert(u[n]);for(n=0;n<r.post.length;++n)r.post[n]();return t}}function ap(e,t,n){if(e.ns=`http://www.w3.org/2000/svg`,n!==`foreignObject`&&t!==void 0)for(let e=0;e<t.length;++e){let n=t[e];if(typeof n==`string`)continue;let r=n.data;r!==void 0&&ap(r,n.children,n.sel)}}function op(e,t,n){let r={},i,a,o;if(n===void 0?t!=null&&(Yf(t)?i=t:Xf(t)?a=t.toString():t&&t.sel?i=[t]:r=t):(t!==null&&(r=t),Yf(n)?i=n:Xf(n)?a=n.toString():n&&n.sel&&(i=[n])),i!==void 0)for(o=0;o<i.length;++o)Xf(i[o])&&(i[o]=Jf(void 0,void 0,void 0,i[o],void 0));return e.startsWith(`svg`)&&(e.length===3||e[3]===`.`||e[3]===`#`)&&ap(r,i,e),Jf(e,r,i,a,void 0)}function sp(e,t){let n,r=t.elm,i=e.data.attrs,a=t.data.attrs;if(!(!i&&!a)&&i!==a){for(n in i=i||{},a=a||{},a){let e=a[n];i[n]!==e&&(e===!0?r.setAttribute(n,``):e===!1?r.removeAttribute(n):n.charCodeAt(0)===120?n.charCodeAt(3)===58?r.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,n,e):n.charCodeAt(5)===58?n.charCodeAt(1)===109?r.setAttributeNS(`http://www.w3.org/2000/xmlns/`,n,e):r.setAttributeNS(`http://www.w3.org/1999/xlink`,n,e):r.setAttribute(n,e):r.setAttribute(n,e))}for(n in i)n in a||r.removeAttribute(n)}}let cp={create:sp,update:sp};function lp(e,t){let n,r,i=t.elm,a=e.data.class,o=t.data.class;if(!(!a&&!o)&&a!==o){for(r in a=a||{},o=o||{},a)a[r]&&!Object.prototype.hasOwnProperty.call(o,r)&&i.classList.remove(r);for(r in o)n=o[r],n!==a[r]&&i.classList[n?`add`:`remove`](r)}}let up={create:lp,update:lp},dp=/[A-Z]/g;function fp(e,t){let n=t.elm,r=e.data.dataset,i=t.data.dataset,a;if(!r&&!i||r===i)return;r=r||{},i=i||{};let o=n.dataset;for(a in r)a in i||(o?a in o&&delete o[a]:n.removeAttribute(`data-`+a.replace(dp,`-$&`).toLowerCase()));for(a in i)r[a]!==i[a]&&(o?o[a]=i[a]:n.setAttribute(`data-`+a.replace(dp,`-$&`).toLowerCase(),i[a]))}let pp={create:fp,update:fp};function mp(e,t,n){if(typeof e==`function`)e.call(t,n,t);else if(typeof e==`object`)for(let r=0;r<e.length;r++)mp(e[r],t,n)}function hp(e,t){let n=e.type,r=t.data.on;r&&r[n]&&mp(r[n],t,e)}function gp(){return function e(t){hp(t,e.vnode)}}function _p(e,t){let n=e.data.on,r=e.listener,i=e.elm,a=t&&t.data.on,o=t&&t.elm,s;if(n!==a){if(n&&r)if(a)for(s in n)a[s]||i.removeEventListener(s,r,!1);else for(s in n)i.removeEventListener(s,r,!1);if(a){let r=t.listener=e.listener||gp();if(r.vnode=t,n)for(s in a)n[s]||o.addEventListener(s,r,!1);else for(s in a)o.addEventListener(s,r,!1)}}}let vp={create:_p,update:_p,destroy:_p};function yp(e,t){let n,r,i,a=t.elm,o=e.data.props,s=t.data.props;if(!(!o&&!s)&&o!==s)for(n in o=o||{},s=s||{},s)r=s[n],i=o[n],i!==r&&(n!==`value`||a[n]!==r)&&(a[n]=r)}let bp={create:yp,update:yp},xp=typeof(window==null?void 0:window.requestAnimationFrame)==`function`?window.requestAnimationFrame.bind(window):setTimeout,Sp=e=>{xp(()=>{xp(e)})},Cp=!1;function wp(e,t,n){Sp(()=>{e[t]=n})}function Tp(e,t){let n,r,i=t.elm,a=e.data.style,o=t.data.style;if(!a&&!o||a===o)return;a=a||{},o=o||{};let s=`delayed`in a;for(r in a)r in o||(r[0]===`-`&&r[1]===`-`?i.style.removeProperty(r):i.style[r]=``);for(r in o)if(n=o[r],r===`delayed`&&o.delayed)for(let e in o.delayed)n=o.delayed[e],(!s||n!==a.delayed[e])&&wp(i.style,e,n);else r!==`remove`&&n!==a[r]&&(r[0]===`-`&&r[1]===`-`?i.style.setProperty(r,n):i.style[r]=n)}function Ep(e){let t,n,r=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(n in t)r.style[n]=t[n]}function Dp(e,t){let n=e.data.style;if(!n||!n.remove){t();return}Cp||(e.elm.offsetLeft,Cp=!0);let r,i=e.elm,a=0,o=n.remove,s=0,c=[];for(r in o)c.push(r),i.style[r]=o[r];let l=getComputedStyle(i)[`transition-property`].split(`, `);for(;a<l.length;++a)c.indexOf(l[a])!==-1&&s++;i.addEventListener(`transitionend`,e=>{e.target===i&&--s,s===0&&t()})}function Op(){Cp=!1}let kp={pre:Op,create:Tp,update:Tp,destroy:Ep,remove:Dp};function Ap(e,t){for(let n of e)n!=null&&n!==!1&&n!==``&&(Array.isArray(n)?Ap(n,t):typeof n==`string`||typeof n==`number`||typeof n==`boolean`?t.push(Jf(void 0,void 0,void 0,String(n),void 0)):t.push(n));return t}function Z(e,t,...n){let r=Ap(n,[]);return typeof e==`function`?e(t,r):r.length===1&&!r[0].sel&&r[0].text?op(e,t,r[0].text):op(e,t,r)}let jp=[];function Mp(e){jp.push(e)}let Np={};function Pp(e){let{type:t,renderElem:n}=e,r=t||``;Np[r]=n}function Fp(e,t,n){return Z(n.isInline(e)?`span`:`div`,null,t)}function Ip(e){return Np[e]||Fp}var Lp=Ip;function Rp(e,t,n){let r=t;return jp.forEach(t=>{r=t(e,r,n)}),r}var zp=Rp;function Bp(e,t){let n=J.findKey(t,e),r=t.isInline(e),i=V.isVoid(t,e),a=pc(e.type,n.id),o={id:a,key:n.id,"data-slate-node":`element`,"data-slate-inline":r},{type:s,children:c=[]}=e,l=Lp(s),u;u=i?null:c.map((n,r)=>Xp(n,r,e,t));let d=l(e,u,t);if(i){o[`data-slate-void`]=!0;let n=r?`span`:`div`,[[i]]=z.texts(e),a=Xp(i,0,e,t);d=Z(n,{style:{position:`relative`}},d,Z(n,{"data-slate-spacer":!0,style:{height:`0`,color:`transparent`,outline:`none`,position:`absolute`}},a)),ro.set(i,0),io.set(i,e)}return d.data==null&&(d.data={}),Object.assign(d.data,o),!i&&!r&&(d=zp(e,d,t)),zt(()=>{let r=ao.get(t),i=r==null?void 0:r.querySelector(`#${a}`);i!=null&&(so.set(n,i),co.set(e,i),oo.set(i,e))}),d}var Vp=Bp;function Hp(e,t=!1){return Z(`span`,{"data-slate-string":!0},t?`${e}\n`:e)}function Up(e=0,t=!1){return Z(`span`,{"data-slate-zero-width":t?`n`:`z`,"data-slate-length":e},``,t?Z(`br`,null):null)}function Wp(e,t,n,r,i=!1){let{text:a}=e,o=J.findPath(r,t),s=I.parent(o);if(V.isEditor(n))throw Error(`Text node ${JSON.stringify(t)} parent is Editor`);return r.isVoid(n)?Up(z.string(n).length):a===``&&n.children[n.children.length-1]===t&&!r.isInline(n)&&V.string(r,s)===``?Up(0,!0):a===``?Up():i&&a.slice(-1)===`
33
+ `?Hp(a,!0):Hp(a)}var Gp=Wp;function Kp(e,t,n){let r=t;return jp.forEach(t=>{r=t(e,r,n)}),r}var qp=Kp;function Jp(e,t,n){if(e.text==null)throw Error(`Current node is not slate Text ${JSON.stringify(e)}`);let r=J.findKey(n,e),{decorate:i}=n.getConfig();if(i==null)throw Error(`Can not get config.decorate`);let a=i([e,J.findPath(n,e)]),o=W.decorations(e,a),s=o.map(({leaf:r,position:i})=>{var a;let s=Gp(r,e,t,n,(a=i==null?void 0:i.isLast)==null?o.length===1:a);return s=qp(r,s,n),Z(`span`,{"data-slate-leaf":!0},s)}),c=mc(r.id),l=Z(`span`,{"data-slate-node":`text`,id:c,key:r.id},s);return zt(()=>{let t=ao.get(n),i=t==null?void 0:t.querySelector(`#${c}`);i!=null&&(so.set(r,i),co.set(e,i),oo.set(i,e))}),l}var Yp=Jp;function Xp(e,t,n,r){ro.set(e,t),io.set(e,n);let i;return i=R.isElement(e)?Vp(e,r):Yp(e,n,r),i}var Zp=d(c(((e,t)=>{var n=1/0,r=`[object Symbol]`,i=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,a=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o=`\\ud800-\\udfff`,s=`\\u0300-\\u036f\\ufe20-\\ufe23`,c=`\\u20d0-\\u20f0`,l=`\\u2700-\\u27bf`,u=`a-z\\xdf-\\xf6\\xf8-\\xff`,d=`\\xac\\xb1\\xd7\\xf7`,f=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,p=`\\u2000-\\u206f`,m=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,h=`A-Z\\xc0-\\xd6\\xd8-\\xde`,g=`\\ufe0e\\ufe0f`,_=d+f+p+m,v=`['’]`,y=`[`+o+`]`,b=`[`+_+`]`,x=`[`+s+c+`]`,S=`\\d+`,C=`[`+l+`]`,w=`[`+u+`]`,T=`[^`+o+_+S+l+u+h+`]`,E=`\\ud83c[\\udffb-\\udfff]`,D=`(?:`+x+`|`+E+`)`,O=`[^`+o+`]`,k=`(?:\\ud83c[\\udde6-\\uddff]){2}`,A=`[\\ud800-\\udbff][\\udc00-\\udfff]`,j=`[`+h+`]`,ee=`\\u200d`,M=`(?:`+w+`|`+T+`)`,N=`(?:`+j+`|`+T+`)`,te=`(?:`+v+`(?:d|ll|m|re|s|t|ve))?`,P=`(?:`+v+`(?:D|LL|M|RE|S|T|VE))?`,ne=D+`?`,re=`[`+g+`]?`,ie=`(?:`+ee+`(?:`+[O,k,A].join(`|`)+`)`+re+ne+`)*`,ae=re+ne+ie,oe=`(?:`+[C,k,A].join(`|`)+`)`+ae,se=`(?:`+[O+x+`?`,x,k,A,y].join(`|`)+`)`,ce=RegExp(v,`g`),le=RegExp(x,`g`),ue=RegExp(E+`(?=`+E+`)|`+se+ae,`g`),de=RegExp([j+`?`+w+`+`+te+`(?=`+[b,j,`$`].join(`|`)+`)`,N+`+`+P+`(?=`+[b,j+M,`$`].join(`|`)+`)`,j+`?`+M+`+`+te,j+`+`+P,S,oe].join(`|`),`g`),fe=RegExp(`[`+ee+o+s+c+g+`]`),pe=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,me={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`ss`},he=typeof global==`object`&&global&&global.Object===Object&&global,ge=typeof self==`object`&&self&&self.Object===Object&&self,_e=he||ge||Function(`return this`)();function ve(e,t,n,r){var i=-1,a=e?e.length:0;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function ye(e){return e.split(``)}function be(e){return e.match(i)||[]}function xe(e){return function(t){return e==null?void 0:e[t]}}var Se=xe(me);function Ce(e){return fe.test(e)}function we(e){return pe.test(e)}function Te(e){return Ce(e)?Ee(e):ye(e)}function Ee(e){return e.match(ue)||[]}function De(e){return e.match(de)||[]}var Oe=Object.prototype.toString,ke=_e.Symbol,Ae=ke?ke.prototype:void 0,je=Ae?Ae.toString:void 0;function Me(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function Ne(e){if(typeof e==`string`)return e;if(Re(e))return je?je.call(e):``;var t=e+``;return t==`0`&&1/e==-n?`-0`:t}function Pe(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Me(e,t,n)}function Fe(e){return function(t){t=ze(t);var n=Ce(t)?Te(t):void 0,r=n?n[0]:t.charAt(0),i=n?Pe(n,1).join(``):t.slice(1);return r[e]()+i}}function Ie(e){return function(t){return ve(We(He(t).replace(ce,``)),e,``)}}function Le(e){return!!e&&typeof e==`object`}function Re(e){return typeof e==`symbol`||Le(e)&&Oe.call(e)==r}function ze(e){return e==null?``:Ne(e)}var Be=Ie(function(e,t,n){return t=t.toLowerCase(),e+(n?Ve(t):t)});function Ve(e){return Ue(ze(e).toLowerCase())}function He(e){return e=ze(e),e&&e.replace(a,Se).replace(le,``)}var Ue=Fe(`toUpperCase`);function We(e,t,n){return e=ze(e),t=n?void 0:t,t===void 0?we(e)?De(e):be(e):e.match(t)||[]}t.exports=Be}))(),1);function Qp(){return ip([up,bp,kp,pp,vp,cp])}let $p=[`props`,`attrs`,`style`,`dataset`,`on`,`hook`,`ns`];function em(e,t){e.data==null&&(e.data={});let n=e.data;n.props==null&&(n.props={}),Object.assign(n.props,t)}function tm(e,t){e.data==null&&(e.data={});let n=e.data;n.dataset==null&&(n.dataset={}),Object.assign(n.dataset,t)}function nm(e){let{data:t={},children:n=[]}=e;Object.keys(t).forEach(n=>{let r=t[n];if(n===`key`){e.key=r;return}if(!$p.includes(n)){if(n.startsWith(`data-`)){let i=n.slice(5);i=(0,Zp.default)(i),tm(e,{[i]:r}),delete t[n];return}em(e,{[n]:r}),delete t[n]}}),n.length>0&&n.forEach(e=>{typeof e!=`string`&&nm(e)})}function rm(e){return`w-e-textarea-${e}`}function im(e,t=!1){return op(`div#${e}`,{props:{contentEditable:!t}})}function am(e,t=!1){return q(`<div
34
+ id="${e}"
35
+ data-slate-editor
36
+ data-slate-node="value"
37
+ suppressContentEditableWarning
38
+ role="textarea"
39
+ spellCheck="true"
40
+ autoCorrect="true"
41
+ autoCapitalize="true"
42
+ ></div>`)}function om(e,t){let n=e.$scroll,r=rm(e.id),{readOnly:i,autoFocus:a}=t.getConfig(),o=im(r,i);o.children=(t.children||[]).map((e,n)=>{if(to.has(e)){let t=to.get(e);if(t){let[r,i]=t;if(i)return r!==n&&(ro.set(e,n),to.set(e,[n,i])),i}}let r=Xp(e,n,t,t);nm(r);let{skipCacheTypes:i=[`list-item`]}=t.getConfig();return R.isElement(e)&&i.includes(e.type)||to.set(e,[n,r]),r});let s,c=Qa.get(e);if(c==null&&(c=!0),c){let a=am(r,i);n.append(a),e.$textArea=a,s=a[0],ao.set(t,s),co.set(t,s),oo.set(s,t);let c=Qp();c(s,o),Qa.set(e,!1),$a.set(e,c)}else{let t=eo.get(e),n=$a.get(e);if(t==null||n==null)return;s=t.elm,n(t,o)}if(s==null){let e=n[0];if(s=(e==null?void 0:e.querySelector(`#${r}`))||js(r),s==null)return}let l;if(l=c?a:t.isFocused(),l&&s.focus({preventScroll:!0}),c){let e=Ss(s);e&&uo.set(t,e)}ao.set(t,s),co.set(t,s),oo.set(s,t),eo.set(e,o)}var sm=om;let cm=1;var lm=class{constructor(e){this.selectionChangeRoot=null,this.destroyed=!1,this.id=cm++,this.$textArea=null,this.$progressBar=q(`<div class="w-e-progress-bar"></div>`),this.$maxLengthInfo=q(`<div class="w-e-max-length-info"></div>`),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=(0,Td.default)(e=>{let t=Ts(e==null?void 0:e.target)?e.target:null,n=t==null?void 0:t.tagName;if(n===`INPUT`||n===`TEXTAREA`)return;let r=this.getActiveEditor();r!=null&&Jd(this,r)},100);let t=q(e);if(t.length===0)throw Error(`Cannot find textarea DOM by selector '${e}'`);this.$box=t;let n=q(`<div class="w-e-text-container"></div>`);n.append(this.$progressBar),n.append(this.$maxLengthInfo),t.append(n);let r=q(`<div class="w-e-scroll"></div>`);n.append(r),this.$scroll=r,this.$textAreaContainer=n,zt(()=>{let e=this.getActiveEditor();if(e==null)return;this.bindSelectionChange(e),n.on(`click`,()=>e.hidePanelOrModal()),e.on(za.CHANGE,this.changeViewState.bind(this));let{onChange:r,scroll:i}=e.getConfig();r&&e.on(za.CHANGE,()=>r(e)),i||(t.css(`position`,`relative`),n.addClass(`no-scroll`)),this.onFocusAndOnBlur(),e.on(za.CHANGE,this.changeMaxLengthInfo.bind(this)),this.bindEvent()})}get editorInstance(){let e=Ua.get(this);if(e==null)throw Error(`Can not get editor instance`);return e}getActiveEditor(){if(this.destroyed)return null;let e=Ua.get(this);return e==null||e.isDestroyed?null:e}bindSelectionChange(e,t=5){if(!(this.selectionChangeRoot!=null||e.isDestroyed)){try{let t=J.findDocumentOrShadowRoot(e);t.addEventListener(`selectionchange`,this.onDOMSelectionChange),this.selectionChangeRoot=t}catch(n){if(t>0){setTimeout(()=>this.bindSelectionChange(e,t-1),0);return}window.document.addEventListener(`selectionchange`,this.onDOMSelectionChange),this.selectionChangeRoot=window.document}e.on(za.DESTROYED,()=>{var e;(e=this.selectionChangeRoot)==null||e.removeEventListener(`selectionchange`,this.onDOMSelectionChange),this.selectionChangeRoot=null})}}flushDOMSelectionChange(){this.onDOMSelectionChange.flush()}bindEvent(){let{$textArea:e,$scroll:t}=this,n=this.editorInstance;if(e==null)return;(0,Ft.default)(Of,(t,r)=>{e.on(r,e=>{t(e,this,n)})});let{scroll:r}=n.getConfig();r&&(t.css(`overflow-y`,`auto`),t.on(`scroll`,(0,Td.default)(()=>{n.emit(za.SCROLL)},100)))}onFocusAndOnBlur(){let e=this.getActiveEditor();if(e==null)return;let{onBlur:t,onFocus:n}=e.getConfig();this.latestEditorSelection=e.selection,e.on(za.CHANGE,()=>{this.latestEditorSelection==null&&e.selection!=null?setTimeout(()=>{this.destroyed||e.isDestroyed||n&&n(e)}):this.latestEditorSelection!=null&&e.selection==null&&setTimeout(()=>{this.destroyed||e.isDestroyed||t&&t(e)}),this.latestEditorSelection=e.selection})}changeMaxLengthInfo(){let e=this.getActiveEditor();if(e==null)return;let{maxLength:t}=e.getConfig();if(t){let n=t-J.getLeftLengthOfMaxLength(e);this.$maxLengthInfo[0].innerHTML=`${n}/${t}`}}changeProgress(e){let t=this.$progressBar;t.css(`width`,`${e}%`),e>=100&&setTimeout(()=>{t.hide(),t.css(`width`,`0`),t.show()},1e3)}changeViewState(){let e=this.getActiveEditor();e!=null&&(sm(this,e),Id(this,e),zt(()=>{this.destroyed||e.isDestroyed||qd(this,e)}))}destroy(){var e;this.destroyed=!0,this.onDOMSelectionChange.cancel(),(e=this.selectionChangeRoot)==null||e.removeEventListener(`selectionchange`,this.onDOMSelectionChange),this.selectionChangeRoot=null,this.$textAreaContainer.remove()}};function um(e,t,n,r){if(ro.set(e,t),io.set(e,n),R.isElement(e)){let{children:t=[]}=e;if(t.forEach((t,n)=>um(t,n,e,r)),V.isVoid(r,e)){let[[t]]=z.texts(e);ro.set(t,0),io.set(t,e)}}}var dm=um;function fm(e){let{selector:t=``,config:n={},content:r,html:i,plugins:a=[]}=e,o=(e=>[jl,nl,vo,el,Xl,kl,Wl,Bl].reduce((e,t)=>t(e),e))(Da());if(t&&cc(o,t))throw Error(`Repeated create editor by selector '${t}'`);let s=La(n);Za.set(o,s);let{hoverbarKeys:c={}}=s;if(a.forEach(e=>{o=e(o)}),fc(o,{html:i,content:r}),t){let e=new lm(t);Ha.set(o,e),Ua.set(e,o),e.changeViewState();let n;Object.keys(c).length>0&&(n=new wd,Ka.set(n,o),qa.set(o,n)),o.on(za.CHANGE,()=>{o.hidePanelOrModal()}),o.on(za.SCROLL,()=>{o.hidePanelOrModal()})}else o.children.forEach((e,t)=>dm(e,t,o,o));let{onCreated:l,onDestroyed:u}=s;return l&&o.on(za.CREATED,()=>l(o)),u&&o.on(za.DESTROYED,()=>u(o)),zt(()=>o.emit(za.CREATED)),o}var pm=class{constructor(e,t){this.$toolbar=q(`<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>`),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=()=>{},this.syncToolbarState=()=>{this.toolbarItems.forEach(e=>{e.changeMenuState()})},this.changeToolbarState=(0,Zl.default)(()=>{this.syncToolbarState()},200),this.config=t;let n=q(e);if(n.length===0)throw Error(`Cannot find toolbar DOM by selector '${e}'`);this.$box=n;let r=this.$toolbar;r.on(`mousedown`,e=>e.preventDefault(),{passive:!1}),n.append(r),zt(()=>{this.initToolbar(),this.lngListen=$u(()=>this.initToolbar());let e=this.getEditorInstance();e.on(za.CHANGE,this.changeToolbarState),e.on(za.FULLSCREEN,this.syncToolbarState),e.on(za.UNFULLSCREEN,this.syncToolbarState)})}getMenus(){return this.menus}getConfig(){return this.config}initToolbar(){this.menus={};let e=this.$toolbar;e==null||e.empty(),this.registerItems(),this.changeToolbarState()}registerItems(){let e=``,t=this.$toolbar,{toolbarKeys:n=[],insertKeys:r={index:0,keys:[]},excludeKeys:i=[]}=this.config,a=(0,Oa.default)(n),o=[];o=Array.isArray(r)?r:[r];let s=0;o.forEach(e=>{let t=e.index+s;if(e.replaceFn&&a[t]){let n=e.replaceFn(a[t]);if(!n)throw Error(`This function needs to return the menu configuration: IToolbarMenuKey`);a[t]=n}e.keys.length>0&&(typeof e.keys==`string`&&(e.keys=[e.keys]),e.keys.forEach((e,n)=>{a.splice(t+n,0,e)}),s+=e.keys.length)});let c=a.filter(e=>{let t=typeof e==`string`?e:e.key;return!i.includes(t)}),l=c.length;c.forEach((n,r)=>{if(n===`|`){if(r===0||r+1===l||e===`|`)return;let i=nd();t.append(i),e=n;return}if(typeof n==`string`){this.registerSingleItem(n,this),e=n;return}if(this.isMenuGroup(n)){this.registerGroup(n),e=`group`;return}this.registerSingleMenuByConf(n),e=n.key})}isMenuGroup(e){return typeof e!=`string`&&Array.isArray(e.menuKeys)}registerSingleMenuByConf(e){let{key:t,title:n,iconSvg:r}=e;this.registerSingleItem(t,this,{title:n,iconSvg:r})}registerGroup(e){let t=this.$toolbar,n=Sd(e),{menuKeys:r=[]}=e,{excludeKeys:i=[]}=this.config;r.forEach(e=>{i.includes(e)||this.registerSingleItem(e,n)}),t.append(n.$elem)}registerSingleItem(e,t,n={}){let r=this.getEditorInstance(),i=t instanceof cd,{menus:a}=this,o=a[e];if(o==null){let t=Ba[e];if(t==null)throw Error(`Not found menu item factory by key '${e}'`);if(typeof t!=`function`)throw Error(`Menu item factory (key='${e}') is not a function`);o=t(),a[e]=o}else console.warn(`Duplicated toolbar menu key '${e}'\n重复注册了菜单栏 menu '${e}'`);let s=r.getMenuConfig(e);s&&s.iconSvg!==void 0&&(o.iconSvg=s.iconSvg),n.iconSvg!==void 0&&(o.iconSvg=n.iconSvg),n.title!==void 0&&(o.title=n.title);let c=xd(e,o,i);this.toolbarItems.push(c),Ja.set(c,r),i?t.appendBarItem(c):t.$toolbar.append(c.$elem)}getEditorInstance(){let e=Wa.get(this);if(e==null)throw Error(`Can not get editor instance`);return e}destroy(){var e;this.$toolbar.remove(),(e=this.lngListen)==null||e.call(this),this.menus={},this.toolbarItems=[]}};function mm(e,t){if(e==null)throw Error(`Cannot create toolbar, because editor is null`);let{selector:n,config:r={}}=t;if(lc(e,n))throw Error(`Repeated create toolbar by selector '${n}'`);let i=new pm(n,Ra(r));return Wa.set(i,e),Ga.set(e,i),i}function hm(e){return e&&e.getConfig().textStyleMode===`class`?`class`:`inline`}function gm(e){if(!e)return`preserve-data`;let t=e.getConfig().classStylePolicy;return t===`fallback-inline`?`fallback-inline`:t===`strict`?`strict`:`preserve-data`}function _m(e,t){let n=e==null?void 0:e.getConfig().onClassStyleUnsupported;if(n){n(t);return}console.warn(t.message)}Xu(`en`,{editor:{more:`More`,justify:`Justify`,indent:`Indent`,image:`Image`,video:`Video`}}),Xu(`zh-CN`,{editor:{more:`更多`,justify:`对齐`,indent:`缩进`,image:`图片`,video:`视频`}}),Xu(`en`,{common:{ok:`OK`,delete:`Delete`,enter:`Enter`},blockQuote:{title:`Quote`},codeBlock:{title:`Code block`,copy:`Copy`,copied:`Copied`,copyFailed:`Copy failed`},color:{color:`Font color`,bgColor:`Back color`,default:`Default color`,clear:`Clear back color`},divider:{title:`Divider`},emotion:{title:`Emotion`},fontSize:{title:`Font size`,default:`Default`},fontFamily:{title:`Font family`,default:`Default`},fullScreen:{title:`Full screen`,cancelTitle:`Cancel full screen`},header:{title:`Header`,text:`Text`},image:{netImage:`Net image`,delete:`Delete image`,edit:`Edit image`,editSize:`Edit size`,preview:`Preview image`,viewLink:`View link`,src:`Image src`,desc:`Description`,link:`Image link`,ok:`Ok`,width:`Width`,height:`Height`},indent:{decrease:`Decrease`,increase:`Increase`},justify:{left:`Left`,right:`Right`,center:`Center`,justify:`Justify`},lineHeight:{title:`Line height`,default:`Default`},link:{insert:`Insert link`,text:`Link text`,url:`Link source`,unLink:`Unlink`,edit:`Edit link`,view:`View link`},textStyle:{bold:`Bold`,clear:`Clear styles`,code:`Inline code`,italic:`Italic`,sub:`Sub`,sup:`Sup`,through:`Through`,underline:`Underline`,wavyUnderline:`Wavy underline`,emphasisDot:`Lower dot emphasis`},undo:{undo:`undo`,redo:`Redo`},todo:{todo:`Todo`},formatPainter:{title:`Format Painter`}}),Xu(`zh-CN`,{common:{ok:`确定`,delete:`删除`,enter:`回车`},blockQuote:{title:`引用`},codeBlock:{title:`代码块`,copy:`复制`,copied:`已复制`,copyFailed:`复制失败`},color:{color:`文字颜色`,bgColor:`背景色`,default:`默认颜色`,clear:`清除背景色`},divider:{title:`分割线`},emotion:{title:`表情`},fontSize:{title:`字号`,default:`默认字号`},fontFamily:{title:`字体`,default:`默认字体`},fullScreen:{title:`全屏`,cancelTitle:`取消全屏`},header:{title:`标题`,text:`正文`},image:{netImage:`网络图片`,delete:`删除图片`,edit:`编辑图片`,editSize:`修改尺寸`,preview:`预览图片`,viewLink:`查看链接`,src:`图片地址`,desc:`图片描述`,link:`图片链接`,ok:`确定`,width:`宽度`,height:`高度`},indent:{decrease:`减少缩进`,increase:`增加缩进`},justify:{left:`左对齐`,right:`右对齐`,center:`居中对齐`,justify:`两端对齐`},lineHeight:{title:`行高`,default:`默认行高`},link:{insert:`插入链接`,text:`链接文本`,url:`链接地址`,unLink:`取消链接`,edit:`修改链接`,view:`查看链接`},textStyle:{bold:`粗体`,clear:`清除格式`,code:`行内代码`,italic:`斜体`,sub:`下标`,sup:`上标`,through:`删除线`,underline:`下划线`,wavyUnderline:`波浪下划线`,emphasisDot:`下方着重号`},undo:{undo:`撤销`,redo:`重做`},todo:{todo:`待办`},formatPainter:{title:`格式刷`}});function vm(e,t){return`<blockquote>${t}</blockquote>`}let ym={type:`blockquote`,elemToHtml:vm},bm=`<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>`,xm=`<svg viewBox="0 0 1024 1024"><path d="M924.402464 1023.068211H0.679665V99.345412h461.861399v98.909208H99.596867v725.896389h725.896389V561.206811h98.909208z" p-id="10909"></path><path d="M930.805104 22.977336l69.965436 69.965436-453.492405 453.492404-69.965435-69.901489z" p-id="10910"></path><path d="M1022.464381 304.030081h-98.917201V99.345412H709.230573V0.428211h313.233808z"></path></svg>`,Sm=`<svg viewBox="0 0 1024 1024"><path d="M133.705143 335.433143V133.851429h201.581714a29.622857 29.622857 0 0 0 29.622857-29.549715V68.754286a29.622857 29.622857 0 0 0-29.622857-29.622857H61.732571A22.893714 22.893714 0 0 0 38.765714 62.025143V335.725714c0 16.310857 13.238857 29.622857 29.622857 29.622857h35.547429a29.842286 29.842286 0 0 0 29.696-29.842285zM690.980571 133.851429h201.581715v201.654857c0 16.310857 13.238857 29.549714 29.622857 29.549714h35.547428a29.622857 29.622857 0 0 0 29.549715-29.549714V61.952a22.893714 22.893714 0 0 0-22.820572-22.893714h-273.554285a29.622857 29.622857 0 0 0-29.549715 29.622857v35.547428c0 16.310857 13.238857 29.696 29.622857 29.696zM335.286857 892.781714H133.705143V691.2a29.622857 29.622857 0 0 0-29.622857-29.622857H68.534857a29.622857 29.622857 0 0 0-29.549714 29.622857v273.554286c0 12.653714 10.24 22.893714 22.820571 22.893714h273.554286a29.622857 29.622857 0 0 0 29.696-29.622857v-35.547429a29.769143 29.769143 0 0 0-29.769143-29.696z m557.348572-201.581714v201.581714H690.907429a29.622857 29.622857 0 0 0-29.622858 29.622857v35.547429c0 16.310857 13.238857 29.622857 29.622858 29.622857h273.554285c12.580571 0 22.893714-10.313143 22.893715-22.893714V691.2a29.622857 29.622857 0 0 0-29.622858-29.622857h-35.547428a29.622857 29.622857 0 0 0-29.696 29.622857z"></path></svg>`;var Cm=class{constructor(){this.title=X(`blockQuote.title`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M894.6 907.1H605.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C752.7 180.4 711.3 315.8 711.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z m-472 0H133.4c-32.6 0-59-26.4-59-59V608.2l-4-14.9c0-315.9 125.5-485.1 376.5-507.5v59.8C280.7 180.4 239.3 315.8 239.3 442.4v41.2l31.5 12.3h151.8c32.6 0 59 26.4 59 59v293.2c0 32.5-26.4 59-59 59z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!!J.getSelectedNodeByType(e,`blockquote`)}isDisabled(e){if(e.selection==null)return!0;let[t]=V.nodes(e,{match:e=>{let t=J.getNodeType(e);return t===`paragraph`||t===`blockquote`},universal:!0,mode:`highest`});return!t}exec(e,t){if(this.isDisabled(e))return;let n=this.isActive(e)?`paragraph`:`blockquote`;G.setNodes(e,{type:n},{mode:`highest`})}};let wm={key:`blockquote`,factory(){return new Cm}};var Tm=globalThis.Node;globalThis.Comment,globalThis.Element,globalThis.Text,globalThis.Range,globalThis.Selection,globalThis.StaticRange,Yo&&(K.fn.css=Yo),ts&&(K.fn.append=ts),ns&&(K.fn.prepend=ns),Po&&(K.fn.addClass=Po),Fo&&(K.fn.removeClass=Fo),Io&&(K.fn.hasClass=Io),Ho&&(K.fn.on=Ho),Uo&&(K.fn.off=Uo),fs&&(K.fn.focus=fs),Lo&&(K.fn.attr=Lo),Ro&&(K.fn.removeAttr=Ro),qo&&(K.fn.hide=qo),Jo&&(K.fn.show=Jo),is&&(K.fn.parents=is),Bo&&(K.fn.dataset=Bo),Vo&&(K.fn.val=Vo),$o&&(K.fn.text=$o),Qo&&(K.fn.html=Qo),os&&(K.fn.children=os),ss&&(K.fn.remove=ss),as&&(K.fn.find=as),Wo&&(K.fn.width=Wo),Go&&(K.fn.height=Go),Zo&&(K.fn.filter=Zo),cs&&(K.fn.empty=cs);var Q=K;function Em(e){return K(`<div>${e}</div>`).children().filter(e=>e.tagName!==`BR`).length===0}function Dm(e){return e.length===0?``:e[0].outerHTML}function Om(e){if(e.length===0)return``;let t=e[0];return t.nodeType===Tm.ELEMENT_NODE?t.tagName.toLowerCase():``}function km(e,t){let n=``,r=(e.attr(`style`)||``).split(`;`),i=r.length;for(let e=0;e<i;e+=1){let i=r[e];if(i){let e=i.split(`:`);e[0].trim()===t&&(n=e[1].trim())}}return n}function Am(e,t){return!!(W.isText(e)||t.isInline(e))}function jm(e){let t=e[e.length-1];W.isText(t)&&t.text.endsWith(`
43
+ `)||e.push({text:`
44
+ `})}function Mm(e,t,n){for(let r=t+1;r<e.length;r+=1){let t=e[r];if(R.isElement(t)&&!n.isInline(t))return!0}return!1}function Nm(e,t){let n=e.children.filter(e=>Am(e,t));if(n.length>0)return n;let r=z.string(e);return r?[{text:r}]:[]}function Pm(e,t,n){let r=Q(e),i=[];return t.forEach((e,r)=>{if(Am(e,n)){i.push(e);return}R.isElement(e)&&(i.push(...Nm(e,n)),Mm(t,r,n)&&jm(i))}),t=i,t.length===0&&(t=[{text:r.text().replace(/\s+/gm,` `)}]),{type:`blockquote`,children:t}}let Fm={selector:`blockquote:not([data-w-e-type])`,parseElemHtml:Pm};function Im(e){e.deleteBackward(`character`),G.insertNodes(e,{type:`paragraph`,children:[{text:``}]},{mode:`highest`})}function Lm(e){let{insertBreak:t,insertText:n}=e,r=e;return r.insertBreak=()=>{let{selection:i}=r;if(i==null)return t();let[a]=V.nodes(e,{match:e=>J.checkNodeType(e,`blockquote`),universal:!0});if(!a)return t();let o=a[0];if(!J.getParentNode(e,o)){Im(r);return}let s=J.findPath(e,o),c=V.end(e,s);if(U.equals(c,i.focus)){let t=V.last(e,c.path),n=z.string(t[0]);if(n&&n.slice(-1)===`
45
+ `){Im(r);return}}n(`
46
+ `)},r}var Rm=Lm;function zm(e,t,n){return Z(`blockquote`,null,t)}var Bm={renderElems:[{type:`blockquote`,renderElem:zm}],elemsToHtml:[ym],parseElemsHtml:[Fm],menus:[wm],editorPlugin:Rm};function Vm(e,t){return`<code>${t}</code>`}let Hm={type:`code`,elemToHtml:Vm};function Um(e,t){return`<pre>${t}</pre>`}let Wm={type:`pre`,elemToHtml:Um};var Gm=class{constructor(){this.title=X(`codeBlock.title`),this.iconSvg=`<svg viewBox="0 0 1280 1024"><path d="M832 736l96 96 320-320L928 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224zM701.312 150.528l69.472 18.944-192 704.032-69.472-18.944 192-704.032z"></path></svg>`,this.tag=`button`}getSelectCodeElem(e){let t=J.getSelectedNodeByType(e,`code`);if(t==null)return null;let n=J.getParentNode(e,t);return n==null||J.getNodeType(n)!==`pre`?null:t}getSelectedTableCellBlock(e){if(J.getSelectedNodeByType(e,`table-cell`)==null)return null;let t=V.above(e,{match:e=>R.isElement(e)?e.type===`paragraph`||e.type===`pre`:!1});return t==null?null:t}getValue(e){let t=this.getSelectCodeElem(e);if(t==null){let{codeLangs:t=[]}=e.getMenuConfig(`codeSelectLang`),n=t.find(e=>e.selected);return(n==null?void 0:n.value)||``}return t.language||``}isActive(e){return!!this.getSelectCodeElem(e)}isDisabled(e){let{selection:t}=e;if(t==null)return!0;let n=J.getSelectedElems(e);return n.some(t=>e.isVoid(t))?!0:!n.some(e=>{let t=J.getNodeType(e);return t===`pre`||t===`paragraph`})}exec(e,t){this.isActive(e)?this.changeToPlainText(e):this.changeToCodeBlock(e,t.toString())}changeToPlainText(e){let t=this.getSelectCodeElem(e);if(t==null)return;let n=z.string(t),r=this.getSelectedTableCellBlock(e);if(r){let[,t]=r,i=n.split(`
47
+ `).map(e=>({type:`paragraph`,children:[{text:e}]}));G.removeNodes(e,{at:t}),G.insertNodes(e,i,{at:t});return}G.removeNodes(e,{mode:`highest`});let i=n.split(`
48
+ `).map(e=>({type:`paragraph`,children:[{text:e}]}));G.insertNodes(e,i,{mode:`highest`})}changeToCodeBlock(e,t){let n=this.getSelectedTableCellBlock(e);if(n){let[r,i]=n,a={type:`pre`,children:[{type:`code`,language:t,children:[{text:z.string(r)}]}]};G.removeNodes(e,{at:i}),G.insertNodes(e,a,{at:i});return}let r=[],i=V.nodes(e,{match:t=>e.children.includes(t),universal:!0});for(let e of i){let[t]=e;t&&r.push(z.string(t))}G.removeNodes(e,{mode:`highest`});let a={type:`pre`,children:[{type:`code`,language:t,children:[{text:r.join(`
49
+ `)}]}]};G.insertNodes(e,a,{mode:`highest`})}};let Km={key:`codeBlock`,config:{showCopyButton:!1},factory(){return new Gm}};function qm(e,t,n){return{type:`code`,language:``,children:[{text:Q(e)[0].textContent||``}]}}let Jm={selector:`pre:not([data-w-e-type])>code`,parseElemHtml:qm};function Ym(e,t,n){let r=Q(e);return t=t.filter(e=>J.getNodeType(e)===`code`),t.length===0&&(t=[{type:`code`,language:``,children:[{text:r[0].textContent||``}]}]),{type:`pre`,children:t.filter(e=>J.getNodeType(e)===`code`)}}let Xm={selector:`pre:not([data-w-e-type])`,parseElemHtml:Ym};function Zm(e,t){let n=t.selection;if(n==null)return``;let r=z.string(e),i=n.anchor.offset,a=r.slice(0,i).split(`
50
+ `),o=a.length;return o===0?``:a[o-1]}function Qm(e){let{insertBreak:t,normalizeNode:n,insertData:r,handleTab:i}=e,a=e;return a.insertBreak=()=>{let e=J.getSelectedNodeByType(a,`code`);if(e==null){t();return}let n=Zm(e,a);if(n){let e=n.match(/^\s+/);if(e!=null&&e[0]!=null){let t=e[0];a.insertText(`\n${t}`);return}}a.insertText(`
51
+ `)},e.handleTab=()=>{let{selection:t}=e;if(!t)return;let n=J.getSelectedNodeByType(e,`code`);if(!n||L.isCollapsed(t)){i();return}let[r,a]=[t.anchor,t.focus].sort((e,t)=>e.offset-t.offset),o=n.children[0].text,s=o.split(`
52
+ `),c=o.slice(0,r.offset).split(`
53
+ `).length-1,l=o.slice(0,a.offset).split(`
54
+ `).length-1,u=s.map((e,t)=>t>=c&&t<=l?` ${e}`:e).join(`
55
+ `),d={anchor:{path:r.path,offset:r.offset+2},focus:{path:a.path,offset:a.offset+2}};G.insertText(e,u,{at:{anchor:{path:r.path,offset:0},focus:{path:a.path,offset:o.length}}}),G.select(e,d)},a.normalizeNode=([e,t])=>{let r=J.getNodeType(e);return r===`code`&&t.length<=1&&G.setNodes(a,{type:`paragraph`},{at:t}),r===`pre`&&(J.isLastNode(a,e)&&G.insertNodes(a,J.genEmptyParagraph(),{at:[t[0]+1]}),J.getNodeType(e.children[0])!==`code`&&(G.unwrapNodes(a),G.setNodes(a,{type:`paragraph`},{mode:`highest`}))),n([e,t])},a.insertData=e=>{if(J.getSelectedNodeByType(a,`code`)==null){r(e);return}let t=e.getData(`text/plain`);V.insertText(a,t)},a}var $m=Qm;function eh(e){let t=Q(e);if(Om(t)!==`code`)return e;let n=t.find(`xmp`);if(n.length===0)return e;let r=n.text();return n.remove(),t.text(r),t[0]}let th={selector:`pre>code`,preParseHtml:eh};j();function nh(e){let{children:t=[]}=e;return t.map(e=>(e.children||[]).map(e=>e.text||``).join(``)).join(`
56
+ `)}function rh(e){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,`readonly`),t.style.position=`fixed`,t.style.top=`-9999px`,t.style.left=`-9999px`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,t.value.length);let n=document.execCommand(`copy`);return document.body.removeChild(t),n}function ih(e){return ah.apply(this,arguments)}function ah(){return ah=A(function*(e){if(e===``)return!0;try{var t;if(typeof navigator<`u`&&(t=navigator.clipboard)!=null&&t.writeText)return yield navigator.clipboard.writeText(e),!0}catch(e){}try{return rh(e)}catch(e){return!1}}),ah.apply(this,arguments)}function oh(e,t,n){let r=Number(e.dataset.copyResetTimer||0);r&&window.clearTimeout(r),e.textContent=t;let i=window.setTimeout(()=>{e.textContent=n,delete e.dataset.copyResetTimer},1200);e.dataset.copyResetTimer=`${i}`}function sh(e,t,n){let{showCopyButton:r=!1}=n.getMenuConfig(`codeBlock`)||{};if(!r)return Z(`pre`,null,t);let i=nh(e),a=X(`codeBlock.copy`),o=X(`codeBlock.copied`),s=X(`codeBlock.copyFailed`);return Z(`pre`,{className:`w-e-code-block`},Z(`button`,{className:`w-e-code-block-copy-button`,contentEditable:!1,on:{mousedown:e=>{e.preventDefault(),e.stopPropagation()},click:function(){var e=A(function*(e){e.preventDefault(),e.stopPropagation();let t=e.currentTarget||e.target;t!=null&&oh(t,(yield ih(i))?o:s,a)});return function(t){return e.apply(this,arguments)}}()}},a),t)}function ch(e,t,n){return Z(`code`,null,t)}var lh={menus:[Km],editorPlugin:$m,renderElems:[{type:`pre`,renderElem:sh},{type:`code`,renderElem:ch}],elemsToHtml:[Hm,Wm],preParseHtml:[th],parseElemsHtml:[Jm,Xm]},uh=class{constructor(){this.tag=`button`,this.showDropPanel=!0,this.$content=null}exec(e,t){}getValue(e){let t=this.mark,n=V.marks(e);return n&&n[t]?n[t]:``}isActive(e){return!!this.getValue(e)}isDisabled(e){if(e.selection==null)return!0;let[t]=V.nodes(e,{match:t=>!!(J.getNodeType(t)===`pre`||R.isElement(t)&&V.isVoid(e,t)),universal:!0});return!!t}getPanelContentElem(e){let t=this.mark;if(this.$content==null){let n=Q(`<ul class="w-e-panel-content-color"></ul>`);n.on(`click`,`li`,n=>{let{target:r}=n;if(r==null)return;n.preventDefault();let{selection:i}=e;if(i==null)return;let a=Q(r).attr(`data-value`);a===`0`?V.removeMark(e,t):V.addMark(e,t,a)}),this.$content=n}let n=this.$content;if(n==null)return document.createElement(`ul`);n.empty();let r=this.getValue(e),{colors:i=[]}=e.getMenuConfig(t);i.forEach(e=>{let t=Q(`<div class="color-block" data-value="${e}"></div>`);t.css(`background-color`,e);let i=Q(`<li data-value="${e}"></li>`);r===e&&i.addClass(`active`),i.append(t),n.append(i)});let a=``;t===`color`&&(a=X(`color.default`)),t===`bgColor`&&(a=X(`color.clear`));let o=Q(`
57
+ <li data-value="0" class="clear">
58
+ <svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>
59
+ ${a}
60
+ </li>
61
+ `);return n.prepend(o),n[0]}},dh=class extends uh{constructor(...e){super(...e),this.title=X(`color.bgColor`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M510.030769 315.076923l84.676923 196.923077h-177.230769l76.8-196.923077h15.753846zM945.230769 157.538462v708.923076c0 43.323077-35.446154 78.769231-78.769231 78.769231H157.538462c-43.323077 0-78.769231-35.446154-78.769231-78.769231V157.538462c0-43.323077 35.446154-78.769231 78.769231-78.769231h708.923076c43.323077 0 78.769231 35.446154 78.769231 78.769231z m-108.307692 643.938461L600.615385 216.615385c-5.907692-11.815385-15.753846-19.692308-29.538462-19.692308h-139.815385c-11.815385 0-23.630769 7.876923-27.56923 19.692308l-216.615385 584.861538c-3.938462 11.815385 3.938462 25.6 17.723077 25.6h80.738462c11.815385 0 23.630769-9.846154 27.56923-21.661538l63.015385-175.261539h263.876923l68.923077 175.261539c3.938462 11.815385 15.753846 21.661538 27.569231 21.661538h80.738461c13.784615 0 23.630769-13.784615 19.692308-25.6z"></path></svg>`,this.mark=`bgColor`}},fh=class extends uh{constructor(...e){super(...e),this.title=X(`color.color`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M64 864h896v96H64zM360.58 576h302.85l81.53 224h102.16L579.24 64H444.77L176.89 800h102.16l81.53-224zM512 159.96L628.49 480H395.52L512 159.96z"></path></svg>`,this.mark=`color`}};let ph=`rgb(0, 0, 0).rgb(38, 38, 38).rgb(89, 89, 89).rgb(140, 140, 140).rgb(191, 191, 191).rgb(217, 217, 217).rgb(233, 233, 233).rgb(245, 245, 245).rgb(250, 250, 250).rgb(255, 255, 255).rgb(225, 60, 57).rgb(231, 95, 51).rgb(235, 144, 58).rgb(245, 219, 77).rgb(114, 192, 64).rgb(89, 191, 192).rgb(66, 144, 247).rgb(54, 88, 226).rgb(106, 57, 201).rgb(216, 68, 147).rgb(251, 233, 230).rgb(252, 237, 225).rgb(252, 239, 212).rgb(252, 251, 207).rgb(231, 246, 213).rgb(218, 244, 240).rgb(217, 237, 250).rgb(224, 232, 250).rgb(237, 225, 248).rgb(246, 226, 234).rgb(255, 163, 158).rgb(255, 187, 150).rgb(255, 213, 145).rgb(255, 251, 143).rgb(183, 235, 143).rgb(135, 232, 222).rgb(145, 213, 255).rgb(173, 198, 255).rgb(211, 173, 247).rgb(255, 173, 210).rgb(255, 77, 79).rgb(255, 122, 69).rgb(255, 169, 64).rgb(255, 236, 61).rgb(115, 209, 61).rgb(54, 207, 201).rgb(64, 169, 255).rgb(89, 126, 247).rgb(146, 84, 222).rgb(247, 89, 171).rgb(207, 19, 34).rgb(212, 56, 13).rgb(212, 107, 8).rgb(212, 177, 6).rgb(56, 158, 13).rgb(8, 151, 156).rgb(9, 109, 217).rgb(29, 57, 196).rgb(83, 29, 171).rgb(196, 29, 127).rgb(130, 0, 20).rgb(135, 20, 0).rgb(135, 56, 0).rgb(97, 71, 0).rgb(19, 82, 0).rgb(0, 71, 79).rgb(0, 58, 140).rgb(6, 17, 120).rgb(34, 7, 94).rgb(120, 6, 80)`.split(`.`);function mh(){return ph}function hh(){return ph}let gh={key:`color`,factory(){return new fh},config:{colors:mh()}},_h={key:`bgColor`,factory(){return new dh},config:{colors:hh()}};function vh(){return[`12px`,{name:`13px`,value:`13px`},`14px`,`15px`,`16px`,`19px`,{name:`22px`,value:`22px`},`24px`,`29px`,`32px`,`40px`,`48px`]}function yh(){return[`黑体`,{name:`仿宋`,value:`仿宋`},`楷体`,`标楷体`,`华文仿宋`,`华文楷体`,{name:`宋体`,value:`宋体`},`微软雅黑`,`Arial`,`Tahoma`,`Verdana`,`Times New Roman`,`Courier New`]}function bh(){return[`1`,`1.15`,`1.5`,`2`,`2.5`,`3`]}function xh(e,t){e.data==null&&(e.data={});let n=e.data;n.style==null&&(n.style={}),Object.assign(n.style,t)}function Sh(e,t){e.data==null&&(e.data={});let n=e.data;n.props==null&&(n.props={});let r=String(n.props.className||``).trim(),i=r?r.split(/\s+/):[];i.includes(t)||i.push(t),n.props.className=i.join(` `)}function Ch(e,t){e.data==null&&(e.data={});let n=e.data;n.dataset==null&&(n.dataset={}),Object.assign(n.dataset,t)}let wh={color:`w-e-color`,bgColor:`w-e-bg-color`,fontSize:`w-e-font-size`,fontFamily:`w-e-font-family`,textAlign:`w-e-text-align`,lineHeight:`w-e-line-height`,indent:`w-e-indent`},Th={color:`data-w-e-color`,bgColor:`data-w-e-bg-color`,fontSize:`data-w-e-font-size`,fontFamily:`data-w-e-font-family`,textAlign:`data-w-e-text-align`,lineHeight:`data-w-e-line-height`,indent:`data-w-e-indent`},Eh={color:`wEColor`,bgColor:`wEBgColor`,fontSize:`wEFontSize`,fontFamily:`wEFontFamily`,textAlign:`wETextAlign`,lineHeight:`wELineHeight`,indent:`wEIndent`},Dh=new Set;function Oh(e,t){let n=(t||``).trim();return n?e===`fontFamily`?n.replace(/"/g,``).replace(/\s+/g,` `).toLowerCase():n.replace(/\s+/g,``).toLowerCase():``}function kh(e){let t=7;for(let n of e)t=(t*31+(n.codePointAt(0)||0))%2147483647;return t.toString(36)}function Ah(e,t){let n=kh(`${e}:${Oh(e,t)}`);return`${wh[e]}-${n}`}function jh(){return vh().map(e=>typeof e==`string`?e:e.value)}function Mh(){return yh().map(e=>typeof e==`string`?e:e.value)}function Nh(e){let t=new Set([`2em`]);return e.forEach(e=>{let n=`${e||``}`.trim().match(/^(-?\d+(\.\d+)?)([a-z%]+)$/i);if(!n)return;let r=parseFloat(n[1]),i=n[3];!Number.isFinite(r)||r<=0||!i||t.add(`${r*2}${i}`)}),Array.from(t)}function Ph(){let e=jh();return{color:mh(),bgColor:mh(),fontSize:e,fontFamily:Mh(),textAlign:[`left`,`center`,`right`,`justify`],lineHeight:bh(),indent:Nh(e)}}function Fh(e,t){var n;let r=e==null||(n=e.getConfig().styleClassTokens)==null?void 0:n[t];return Array.isArray(r)?r:[]}function Ih(e,t){let n=Ph()[t],r=Fh(e,t),i=[...n,...r],a=new Set;return i.forEach(e=>{let t=`${e||``}`.trim();t&&a.add(t)}),Array.from(a)}function Lh(e,t,n){let r=Oh(t,n);if(!r)return!1;let i=Ih(e,t);for(let e=0;e<i.length;e+=1)if(Oh(t,i[e])===r)return!0;return!1}function Rh(e,t,n,r){if(Lh(e,t,n))return`class`;let i=gm(e),a=`preserve-data`;i===`fallback-inline`&&(a=`inline`),i===`strict`&&(a=`throw`);let o=`[wangeditor] Unsupported class style token "${t}=${n}" in ${r}. policy=${i}`,s=`${t}|${n}|${r}|${a}`;if(Dh.has(s)||(Dh.add(s),_m(e,{type:t,value:n,scene:r,fallback:a,message:o})),a===`throw`)throw Error(o);return a===`inline`?`inline`:`preserve-data`}function zh(e){return hm(e)}function Bh(e,t,n,r,i,a){let o=`${n||``}`.trim();if(!o)return;e.attr(Th[t],o);let s=Rh(r,t,o,i||`toHtml`);if(s===`class`){e.addClass(Ah(t,o));return}s===`inline`&&a&&a()}function Vh(e,t,n,r,i,a){let o=`${n||``}`.trim();if(!o)return;Ch(e,{[Eh[t]]:o});let s=Rh(r,t,o,i||`render`);if(s===`class`){Sh(e,Ah(t,o));return}s===`inline`&&a&&xh(e,a)}function Hh(e,t){let n=Ih(e,t),r={};return n.forEach(e=>{r[Ah(t,e)]=e}),r}function Uh(e,t,n){let r=e.attr(Th[t])||``;if(r)return r;let i=(e.attr(`class`)||``).trim().split(/\s+/).filter(Boolean),a=`${wh[t]}-`,o=Hh(n,t);for(let e=0;e<i.length;e+=1){let t=i[e];if(!t.startsWith(a))continue;let n=o[t];if(n)return n}return``}function Wh(e,t,n){let r=Q(e);if(!W.isText(t))return t;let i=t,a=km(r,`color`);a||(a=Uh(r,`color`,n)),a&&(i.color=a);let o=km(r,`background-color`);return o||(o=km(r,`background`)),o||(o=Uh(r,`bgColor`,n)),o&&(i.bgColor=o),i}function Gh(e){let t=Q(e);if(Om(t)!==`font`)return e;let n=t.attr(`color`)||``;return n&&(t.removeAttr(`color`),t.css(`color`,n)),t[0]}let Kh={selector:`font`,preParseHtml:Gh};function qh(e,t,n){let{color:r,bgColor:i}=e,a=t;return zh(n)===`class`?(r&&Vh(a,`color`,r,n,`render`,{color:r}),i&&Vh(a,`bgColor`,i,n,`render`,{backgroundColor:i})):(r&&xh(a,{color:r}),i&&xh(a,{backgroundColor:i})),a}function Jh(e,t,n){if(!W.isText(e))return t;let{color:r,bgColor:i}=e;if(!r&&!i)return t;let a;return Em(t)?a=Q(`<span>${t}</span>`):(a=Q(t),Om(a)!==`span`&&(a=Q(`<span>${t}</span>`))),zh(n)===`class`?(r&&Bh(a,`color`,r,n,`toHtml`,()=>{a.css(`color`,r)}),i&&Bh(a,`bgColor`,i,n,`toHtml`,()=>{a.css(`background-color`,i)})):(r&&a.css(`color`,r),i&&a.css(`background-color`,i)),Dm(a)}var Yh={renderStyle:qh,styleToHtml:Jh,preParseHtml:[Kh],parseStyleHtml:Wh,menus:[gh,_h]},Xh=class{constructor(){this.title=X(`common.enter`),this.iconSvg=`<svg viewBox="0 0 1255 1024"><path d="M1095.111111 731.477333h-625.777778V1024L0 658.318222 469.333333 292.408889v292.636444h625.777778V0h156.444445v731.477333z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){let{selection:t}=e;return!!(t==null||L.isExpanded(t))}exec(e,t){let{selection:n}=e;if(n==null)return;let{anchor:r}=n,{path:i}=r,a={type:`paragraph`,children:[{text:``}]},o=[i[0]];G.insertNodes(e,a,{at:o}),e.select(V.start(e,o))}},Zh={menus:[{key:`enter`,factory(){return new Xh}}]};function Qh(e,t){return`<hr/>`}let $h={type:`divider`,elemToHtml:Qh};var eg=class{constructor(){this.title=X(`divider.title`),this.iconSvg=`<svg viewBox="0 0 1092 1024"><path d="M0 51.2m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M819.2 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M409.6 460.8m51.2 0l170.666667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-170.666667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path><path d="M0 870.4m51.2 0l989.866667 0q51.2 0 51.2 51.2l0 0q0 51.2-51.2 51.2l-989.866667 0q-51.2 0-51.2-51.2l0 0q0-51.2 51.2-51.2Z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){let{selection:t}=e;return!!(t==null||J.getSelectedElems(e).some(t=>{if(e.isVoid(t))return!0;let n=J.getNodeType(t);return n===`table`||n===`pre`}))}exec(e,t){J.isSelectedEmptyParagraph(e)&&G.removeNodes(e,{mode:`highest`}),G.insertNodes(e,{type:`divider`,children:[{text:``}]},{mode:`highest`})}};let tg={key:`divider`,factory(){return new eg}};function ng(e,t,n){return{type:`divider`,children:[{text:``}]}}let rg={selector:`hr:not([data-w-e-type])`,parseElemHtml:ng};function ig(e){let{isVoid:t,normalizeNode:n}=e,r=e;return r.isVoid=e=>{let{type:n}=e;return n===`divider`?!0:t(e)},r.normalizeNode=([e,t])=>{if(J.getNodeType(e)!==`divider`)return n([e,t]);J.isLastNode(r,e)&&G.insertNodes(r,J.genEmptyParagraph(),{at:[t[0]+1]})},r}var ag=ig;function og(e,t,n){return op(`div`,{props:{contentEditable:!1,className:`w-e-textarea-divider`},dataset:{selected:J.isNodeSelected(n,e)?`true`:``},style:{},on:{mousedown:e=>e.preventDefault()}},[op(`hr`)])}var sg={renderElems:[{type:`divider`,renderElem:og}],elemsToHtml:[$h],parseElemsHtml:[rg],menus:[tg],editorPlugin:ag};function cg(){return`😀 😃 😄 😁 😆 😅 😂 🤣 😊 😇 🙂 🙃 😉 😌 😍 😘 😗 😙 😚 😋 😛 😝 😜 🤓 😎 😏 😒 😞 😔 😟 😕 🙁 😣 😖 😫 😩 😢 😭 😤 😠 😡 😳 😱 😨 🤗 🤔 😶 😑 😬 🙄 😯 😴 😷 🤑 😈 🤡 💩 👻 💀 👀 👣 👐 🙌 👏 🤝 👍 👎 👊 ✊ 🤛 🤜 🤞 ✌️ 🤘 👌 👈 👉 👆 👇 ☝️ ✋ 🤚 🖐 🖖 👋 🤙 💪 🖕 ✍️ 🙏`.split(` `)}var lg=class{constructor(){this.title=X(`emotion.title`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M512 1024C230.4 1024 0 793.6 0 512S230.4 0 512 0s512 230.4 512 512-230.4 512-512 512z m0-102.4c226.742857 0 409.6-182.857143 409.6-409.6S738.742857 102.4 512 102.4 102.4 285.257143 102.4 512s182.857143 409.6 409.6 409.6z m-204.8-358.4h409.6c0 113.371429-91.428571 204.8-204.8 204.8s-204.8-91.428571-204.8-204.8z m0-102.4c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8 76.8 32.914286 76.8 76.8-32.914286 76.8-76.8 76.8z m409.6 0c-43.885714 0-76.8-32.914286-76.8-76.8s32.914286-76.8 76.8-76.8c43.885714 0 76.8 32.914286 76.8 76.8s-32.914286 76.8-76.8 76.8z"></path></svg>`,this.tag=`button`,this.showDropPanel=!0,this.$content=null}exec(e,t){}getValue(e){return``}isActive(e){return!1}isDisabled(e){if(e.selection==null)return!0;let[t]=V.nodes(e,{match:t=>!!(J.getNodeType(t)===`pre`||R.isElement(t)&&V.isVoid(e,t)),universal:!0});return!!t}getPanelContentElem(e){if(this.$content==null){let t=Q(`<ul class="w-e-panel-content-emotion"></ul>`);t.on(`click`,`li`,t=>{let{target:n}=t;if(n==null)return;t.preventDefault();let r=Q(n).text();e.insertText(r)}),this.$content=t}let t=this.$content;if(t==null)return document.createElement(`ul`);t.empty();let{emotions:n=[]}=e.getMenuConfig(`emotion`);return n.forEach(e=>{let n=Q(`<li>${e}</li>`);t.append(n)}),t[0]}},ug={menus:[{key:`emotion`,factory(){return new lg},config:{emotions:cg()}}]},dg=class{constructor(){this.tag=`select`,this.width=80}isActive(e){return!1}getValue(e){let t=this.mark,n=V.marks(e);return n&&n[t]?n[t]:``}isDisabled(e){if(e.selection==null)return!0;let[t]=V.nodes(e,{match:t=>!!(J.getNodeType(t)===`pre`||R.isElement(t)&&V.isVoid(e,t)),universal:!0});return!!t}exec(e,t){let n=this.mark;t?e.addMark(n,t):e.removeMark(n)}},fg=class extends dg{constructor(...e){super(...e),this.title=X(`fontFamily.title`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M956.788364 152.110545h-24.110546l23.924364 9.029819 0.186182 121.018181h-65.070546l-86.574545-130.048H566.551273v650.14691l130.048 64.977454v65.163636h-390.050909v-65.163636l129.954909-64.977454V152.110545H198.283636L111.429818 282.065455H46.545455V69.259636C46.545455 33.792 82.664727 22.062545 98.955636 22.062545h812.683637c23.738182 0 45.056 15.173818 45.056 41.053091V169.425455v-17.221819z"></path></svg>`,this.mark=`fontFamily`,this.selectPanelWidth=150}getOptions(e){let t=[],{fontFamilyList:n=[]}=e.getMenuConfig(this.mark);t.push({text:X(`fontFamily.default`),value:``}),n.forEach(e=>{if(typeof e==`string`)t.push({text:e,value:e,styleForRenderMenuList:{"font-family":e}});else if(typeof e==`object`){let{name:n,value:r}=e;t.push({text:n,value:r,styleForRenderMenuList:{"font-family":r}})}});let r=this.getValue(e),i=!1;return t.forEach(e=>{e.value===r?(i=!0,e.selected=!0):e.selected=void 0}),!i&&typeof r==`string`&&t.push({text:r,value:r,selected:!0}),t}},pg=class extends dg{constructor(...e){super(...e),this.title=X(`fontSize.title`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M64 512h384v128h-128V1024h-128V640h-128z m896-256H708.2496v768h-136.4992V256H320V128h640z"></path></svg>`,this.mark=`fontSize`}getOptions(e){let t=[],{fontSizeList:n=[]}=e.getMenuConfig(this.mark);t.push({text:X(`fontSize.default`),value:``}),n.forEach(e=>{if(typeof e==`string`)t.push({text:e,value:e});else if(typeof e==`object`){let{name:n,value:r}=e;t.push({text:n,value:r})}});let r=this.getValue(e),i=!1;return t.forEach(e=>{e.value===r?(i=!0,e.selected=!0):e.selected=void 0}),!i&&typeof r==`string`&&t.push({text:r,value:r,selected:!0}),t}};let mg={key:`fontSize`,factory(){return new pg},config:{fontSizeList:vh()}},hg={key:`fontFamily`,factory(){return new fg},config:{fontFamilyList:yh()}};function gg(e,t,n){let r=Q(e);if(!W.isText(t))return t;let i=t,a=km(r,`font-size`);a||(a=Uh(r,`fontSize`,n)),a&&(i.fontSize=a);let o=km(r,`font-family`),s=Uh(r,`fontFamily`,n),c=(o||s).replace(/"/g,``);return c&&(i.fontFamily=c),i}let _g={1:`12px`,2:`14px`,3:`16px`,4:`19px`,5:`24px`,6:`32px`,7:`48px`};function vg(e){let t=Q(e);if(Om(t)!==`font`)return e;let n=t.attr(`size`)||``;n&&(t.removeAttr(`size`),t.css(`font-size`,_g[n]));let r=t.attr(`face`)||``;return r&&(t.removeAttr(`face`),t.css(`font-family`,r)),t[0]}let yg={selector:`font`,preParseHtml:vg};function bg(e,t,n){let{fontSize:r,fontFamily:i}=e,a=t;return zh(n)===`class`?(r&&Vh(a,`fontSize`,r,n,`render`,{fontSize:r}),i&&Vh(a,`fontFamily`,i,n,`render`,{fontFamily:i})):(r&&xh(a,{fontSize:r}),i&&xh(a,{fontFamily:i})),a}function xg(e,t,n){if(!W.isText(e))return t;let{fontSize:r,fontFamily:i}=e;if(!r&&!i)return t;let a;return Em(t)?a=Q(`<span>${t}</span>`):(a=Q(t),Om(a)!==`span`&&(a=Q(`<span>${t}</span>`))),zh(n)===`class`?(r&&Bh(a,`fontSize`,r,n,`toHtml`,()=>{a.css(`font-size`,r)}),i&&Bh(a,`fontFamily`,i,n,`toHtml`,()=>{a.css(`font-family`,i)})):(r&&a.css(`font-size`,r),i&&a.css(`font-family`,i)),Dm(a)}var Sg={renderStyle:bg,styleToHtml:xg,preParseHtml:[yg],parseStyleHtml:gg,menus:[mg,hg]};function Cg(e){let t=V.marks(e);t&&Object.keys(t).forEach(t=>{e.removeMark(t)})}var wg=class e{constructor(){this.title=X(`formatPainter.title`),this.iconSvg=`<svg viewBox="0 0 24 24"><path d="M8 19.997v-5h2v5h9v-7H5v7zm-4-9h16v-3h-6v-4h-4v4H4zm-1 10v-8H2v-6a1 1 0 0 1 1-1h5v-3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v3h5a1 1 0 0 1 1 1v6h-1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1"/></svg>`,this.tag=`button`}getValue(e){return``}isActive(t){return e.attrs.isSelect}isDisabled(e){return!1}isSourceBlockType(e){return e===`blockquote`||e===`header1`||e===`header2`||e===`header3`||e===`header4`||e===`header5`||e===`header6`||e===`list-item`||e===`todo`}isTargetBlockType(e){return e===`paragraph`||this.isSourceBlockType(e)}getTopLevelSelectedBlocks(e,t){return Array.from(V.nodes(e,{at:e.selection||void 0,match:e=>R.isElement(e)})).filter(([e,n])=>n.length===1&&t(e.type)).map(([,e])=>e)}normalizeListOrderType(e){if(e===`a`||e===`A`||e===`i`||e===`I`)return e;if(e===`1`)return`1`}getSelectedBlockStyle(e){let[t]=this.getTopLevelSelectedBlocks(e,e=>this.isSourceBlockType(e));if(!t)return null;let[n]=V.node(e,t);return!R.isElement(n)||!this.isSourceBlockType(n.type)?null:n.type===`blockquote`||n.type===`header1`||n.type===`header2`||n.type===`header3`||n.type===`header4`||n.type===`header5`||n.type===`header6`||n.type===`todo`?{type:n.type}:n.type===`list-item`?{type:`list-item`,ordered:`ordered`in n?!!n.ordered:!1,orderType:`orderType`in n?this.normalizeListOrderType(n.orderType):void 0}:null}unsetListAttrs(e,t){G.unsetNodes(e,`ordered`,{at:t}),G.unsetNodes(e,`level`,{at:t}),G.unsetNodes(e,`start`,{at:t}),G.unsetNodes(e,`orderType`,{at:t})}applyBlockStyle(e,t){let n=this.getTopLevelSelectedBlocks(e,e=>this.isTargetBlockType(e));if(n.length!==0){if(t.type===`list-item`){n.forEach(n=>{G.setNodes(e,{type:`list-item`,ordered:t.ordered,orderType:t.orderType,level:0},{at:n}),G.unsetNodes(e,`checked`,{at:n}),G.unsetNodes(e,`start`,{at:n})});return}if(t.type===`todo`){n.forEach(t=>{G.setNodes(e,{type:`todo`,checked:!1},{at:t}),this.unsetListAttrs(e,t)});return}n.forEach(n=>{G.setNodes(e,{type:t.type},{at:n}),this.unsetListAttrs(e,n),G.unsetNodes(e,`checked`,{at:n})})}}setFormatHtml(t){if(t.getSelectionText().length){if(e.attrs.formatStyle){Cg(t);for(let[n,r]of Object.entries(e.attrs.formatStyle))t.addMark(n,r)}e.attrs.formatBlockStyle&&this.applyBlockStyle(t,e.attrs.formatBlockStyle),e.attrs.formatStyle=null,e.attrs.formatBlockStyle=null,e.attrs.isSelect=!1}}exec(t){e.attrs.isSelect?(e.attrs.isSelect=!1,e.attrs.formatStyle=null,e.attrs.formatBlockStyle=null):t.getSelectionText().length&&(e.attrs.formatStyle=V.marks(t),e.attrs.formatBlockStyle=this.getSelectedBlockStyle(t),e.attrs.isSelect=!0),t.blur(),t.focus()}};wg.attrs={isSelect:!1,formatStyle:null,formatBlockStyle:null};var Tg=wg;let Eg={key:`formatPainter`,factory(){return new Tg}};function Dg(e){let t=new Tg,{onChange:n}=e,r=e,i=()=>{t.setFormatHtml(r),document.removeEventListener(`mouseup`,i)};return r.onChange=()=>{n(),Tg.attrs.isSelect&&(document.removeEventListener(`mouseup`,i),document.addEventListener(`mouseup`,i))},r}var Og={menus:[Eg],editorPlugin:Dg},kg=class{constructor(){this.title=X(`fullScreen.title`),this.iconSvg=Sm,this.tag=`button`,this.alwaysEnable=!0}getValue(e){return``}isActive(e){return e.isFullScreen}isDisabled(e){return!1}getIcon(e){return e.isFullScreen?`<svg t="1723361745825" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8705" width="200" height="200"><path d="M703.926857 362.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V128a42.642286 42.642286 0 1 1 85.357715 0v149.357714h149.357714c21.211429 0 38.765714 15.433143 42.057143 35.693715l0.585143 6.948571a42.642286 42.642286 0 0 1-42.642286 42.642286H703.926857zM703.926857 938.642286a42.642286 42.642286 0 0 1-42.642286-42.642286V704c0-23.552 19.090286-42.642286 42.642286-42.642286h192.073143a42.642286 42.642286 0 1 1 0 85.284572l-149.357714 0.073143v149.284571c0 21.211429-15.506286 38.765714-35.84 42.130286l-6.875429 0.512zM319.853714 938.642286a42.642286 42.642286 0 0 1-42.642285-42.642286v-149.284571H127.853714a42.642286 42.642286 0 0 1-42.130285-35.84l-0.585143-6.875429c0-23.552 19.163429-42.642286 42.715428-42.642286h192c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286zM127.853714 362.642286a42.642286 42.642286 0 1 1 0-85.284572H277.211429V128c0-21.211429 15.433143-38.765714 35.766857-42.130286l6.875428-0.512c23.552 0 42.715429 19.017143 42.715429 42.642286v192a42.642286 42.642286 0 0 1-42.715429 42.642286H127.853714z" fill="#333333" p-id="8706"></path></svg>`:Sm}getTitle(e){return e.isFullScreen?X(`fullScreen.cancelTitle`):X(`fullScreen.title`)}exec(e,t){e.isFullScreen?e.unFullScreen():e.fullScreen()}},Ag={menus:[{key:`fullScreen`,factory(){return new kg}}]};function jg(e){function t(t,n){return`<h${e}>${n}</h${e}>`}return t}let Mg={type:`header1`,elemToHtml:jg(1)},Ng={type:`header2`,elemToHtml:jg(2)},Pg={type:`header3`,elemToHtml:jg(3)},Fg={type:`header4`,elemToHtml:jg(4)},Ig={type:`header5`,elemToHtml:jg(5)},Lg={type:`header6`,elemToHtml:jg(6)};function Rg(e){return/^header[1-6]$/.test(e)}function zg(e){let[t]=V.nodes(e,{match:e=>{let t=J.getNodeType(e),n=e.headingType;return t.startsWith(`header`)||/^header[1-6]$/.test(n)},universal:!0});if(t==null)return`paragraph`;let[n]=t;return n.headingType||J.getNodeType(n)}function Bg(e){if(e.selection==null)return!0;let[t]=V.nodes(e,{match:e=>{let t=J.getNodeType(e);return!!(t===`paragraph`||t.startsWith(`header`)||t===`list-item`&&e.ordered===!0)},universal:!0,mode:`highest`});return!t}function Vg(e,t){if(!t)return;let n=Array.from(V.nodes(e,{match:e=>{let t=J.getNodeType(e);return t===`paragraph`||t.startsWith(`header`)||t===`list-item`},mode:`highest`}));V.withoutNormalizing(e,()=>{n.forEach(([n,r])=>{if(J.getNodeType(n)!==`list-item`){G.setNodes(e,{type:t},{at:r});return}let i=n,a=Rg(t)?t:void 0,o=a?Number.parseInt(a.slice(6),10)-1:i.level;G.setNodes(e,{headingType:a,listMode:a&&i.ordered?`outline`:void 0,level:o},{at:r})})})}var Hg=class{constructor(){this.tag=`button`}getValue(e){return zg(e)}isActive(e){return this.getValue(e)===this.type}isDisabled(e){return Bg(e)}exec(e,t){let{type:n}=this,r;r=t===n?`paragraph`:n,Vg(e,r)}},Ug=class extends Hg{constructor(...e){super(...e),this.title=`H1`,this.type=`header1`}},Wg=class extends Hg{constructor(...e){super(...e),this.title=`H2`,this.type=`header2`}},Gg=class extends Hg{constructor(...e){super(...e),this.title=`H3`,this.type=`header3`}},Kg=class extends Hg{constructor(...e){super(...e),this.title=`H4`,this.type=`header4`}},qg=class extends Hg{constructor(...e){super(...e),this.title=`H5`,this.type=`header5`}},Jg=class extends Hg{constructor(...e){super(...e),this.title=`H6`,this.type=`header6`}},Yg=class{constructor(){this.title=X(`header.title`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M960 960c-51.2 0-102.4-3.2-153.6-3.2-51.2 0-99.2 3.2-150.4 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 57.6-28.8 86.4-48 19.2-12.8 19.2-60.8 19.2-80v-224-19.2c-9.6-3.2-19.2-3.2-28.8-3.2H320c-9.6 0-19.2 0-28.8 3.2V780.8c0 22.4 0 80 22.4 92.8 28.8 19.2 96-6.4 96 44.8 0 16-9.6 41.6-28.8 41.6-54.4 0-105.6-3.2-160-3.2-48 0-96 3.2-147.2 3.2-19.2 0-28.8-22.4-28.8-38.4 0-51.2 51.2-28.8 80-48 19.2-12.8 19.2-60.8 19.2-83.2V294.4c0-28.8 3.2-115.2-22.4-131.2-25.6-16-86.4 9.6-86.4-41.6 0-16 6.4-41.6 28.8-41.6 51.2 0 105.6 3.2 156.8 3.2 48 0 96-3.2 144-3.2 19.2 0 28.8 22.4 28.8 41.6 0 48-57.6 25.6-83.2 41.6-19.2 12.8-19.2 73.6-19.2 92.8v201.6c6.4 3.2 16 3.2 22.4 3.2h400c6.4 0 12.8 0 22.4-3.2V256c0-22.4 0-80-19.2-92.8-28.8-16-86.4 6.4-86.4-41.6 0-16 9.6-41.6 28.8-41.6 51.2 0 99.2 3.2 150.4 3.2 48 0 99.2-3.2 147.2-3.2 19.2 0 28.8 22.4 28.8 41.6 0 51.2-57.6 25.6-86.4 41.6-19.2 12.8-19.2 70.4-19.2 92.8v537.6c0 19.2 0 67.2 19.2 80 28.8 19.2 89.6-6.4 89.6 44.8 0 19.2-6.4 41.6-28.8 41.6z"></path></svg>`,this.tag=`select`,this.width=60}getOptions(e){let t=[{value:`header1`,text:`H1`,styleForRenderMenuList:{"font-size":`32px`,"font-weight":`bold`}},{value:`header2`,text:`H2`,styleForRenderMenuList:{"font-size":`24px`,"font-weight":`bold`}},{value:`header3`,text:`H3`,styleForRenderMenuList:{"font-size":`18px`,"font-weight":`bold`}},{value:`header4`,text:`H4`,styleForRenderMenuList:{"font-size":`16px`,"font-weight":`bold`}},{value:`header5`,text:`H5`,styleForRenderMenuList:{"font-size":`13px`,"font-weight":`bold`}},{value:`header6`,text:`H6`,styleForRenderMenuList:{"font-size":`11px`,"font-weight":`bold`}},{value:`paragraph`,text:X(`header.text`)}],n=this.getValue(e).toString();return t.forEach(e=>{e.value===n?e.selected=!0:e.selected=void 0}),t}isActive(e){return!1}getValue(e){return zg(e)}isDisabled(e){return Bg(e)}exec(e,t){Vg(e,t.toString())}};let Xg={key:`headerSelect`,factory(){return new Yg}},Zg={key:`header1`,factory(){return new Ug}},Qg={key:`header2`,factory(){return new Wg}},$g={key:`header3`,factory(){return new Gg}},e_={key:`header4`,factory(){return new Kg}},t_={key:`header5`,factory(){return new qg}},n_={key:`header6`,factory(){return new Jg}};function r_(e){function t(t,n,r){let i=Q(t);return n=n.filter(e=>!!(W.isText(e)||r.isInline(e))),n.length===0&&(n=[{text:i.text().replace(/\s+/gm,` `)}]),{type:`header${e}`,children:n}}return t}let i_={selector:`h1:not([data-w-e-type])`,parseElemHtml:r_(1)},a_={selector:`h2:not([data-w-e-type])`,parseElemHtml:r_(2)},o_={selector:`h3:not([data-w-e-type])`,parseElemHtml:r_(3)},s_={selector:`h4:not([data-w-e-type])`,parseElemHtml:r_(4)},c_={selector:`h5:not([data-w-e-type])`,parseElemHtml:r_(5)},l_={selector:`h6:not([data-w-e-type])`,parseElemHtml:r_(6)};function u_(e){let{insertBreak:t}=e,n=e;return n.insertBreak=()=>{let[r]=V.nodes(n,{match:e=>J.getNodeType(e).startsWith(`header`),universal:!0});if(!r){t();return}J.isSelectionAtLineEnd(e,r[1])?G.insertNodes(n,{type:`paragraph`,children:[{text:``}]},{mode:`highest`}):t()},n}var d_=u_;function f_(e){function t(t,n,r){return Z(`h${e}`,null,n)}return t}var p_={renderElems:[{type:`header1`,renderElem:f_(1)},{type:`header2`,renderElem:f_(2)},{type:`header3`,renderElem:f_(3)},{type:`header4`,renderElem:f_(4)},{type:`header5`,renderElem:f_(5)},{type:`header6`,renderElem:f_(6)}],elemsToHtml:[Mg,Ng,Pg,Fg,Ig,Lg],parseElemsHtml:[i_,a_,o_,s_,c_,l_],menus:[Xg,Zg,Qg,$g,e_,t_,n_],editorPlugin:d_};function m_(e,t,n){let{src:r,alt:i=``,href:a=``,width:o=``,height:s=``,style:c={}}=e,{width:l=``,height:u=``}=c,d=hm(n),f=``;if(d===`class`)f=`<img src="${r}" alt="${i}" data-href="${a}" width="${o||l}" height="${s||u}"${l?` data-w-e-style-width="${l}"`:``}${u?` data-w-e-style-height="${u}"`:``}/>`;else{let e=``;l&&(e+=`width: ${l};`),u&&(e+=`height: ${u};`),f=`<img src="${r}" alt="${i}" data-href="${a}" width="${o}" height="${s}" style="${e}"/>`}return a?`<a href="${a}" target="_blank">${f}</a>`:f}let h_={type:`image`,elemToHtml:m_};function g_(){return{onInsertedImage(e){},onUpdatedImage(e){},checkImage(e,t,n){return!0},parseImageSrc(e){return e}}}var __=class{constructor(){this.title=X(`image.delete`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){return e.selection==null||J.getSelectedNodeByType(e,`image`)==null}exec(e,t){this.isDisabled(e)||G.removeNodes(e,{match:e=>J.checkNodeType(e,`image`)})}};function v_(e=`r`){return`${e}-${Rt()}`}function y_(e){return e.replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}j(),O();function b_(e){let{selection:t}=e;if(t==null||!L.isCollapsed(t))return!0;let[n]=V.nodes(e,{match:t=>{let n=J.getNodeType(t);return!!(n===`code`||n===`pre`||n===`link`||n.startsWith(`header`)||n===`blockquote`||R.isElement(t)&&V.isVoid(e,t))},universal:!0});return!!n}function x_(e,t,n){return S_.apply(this,arguments)}function S_(){return S_=A(function*(e,t,n,r=``,i=``){let{checkImage:a}=t.getMenuConfig(e);if(a){let e=yield a(n,r,i);if(typeof e==`string`)return t.alert(e,`error`),!1;if(e==null)return!1}return!0}),S_.apply(this,arguments)}function C_(e,t,n){return w_.apply(this,arguments)}function w_(){return w_=A(function*(e,t,n){let{parseImageSrc:r}=t.getMenuConfig(e);return r?yield r(n):n}),w_.apply(this,arguments)}function T_(e,t){return E_.apply(this,arguments)}function E_(){return E_=A(function*(e,t,n=``,r=``){var i;if(!(yield x_(`insertImage`,e,t,n,r)))return;let a={type:`image`,src:y_(yield C_(`insertImage`,e,t)),href:r,alt:n,style:{},children:[{text:``}]};e.selection===null&&e.restoreSelection();let o=((i=e.getMarks)==null?void 0:i.call(e))||{},s={};if(Object.keys(o).forEach(e=>{let t=o[e];t!=null&&t!==!1&&(s[e]=t)}),J.getSelectedNodeByType(e,`image`)&&e.move(1),b_(e))return;G.insertNodes(e,a),Object.keys(s).forEach(t=>{V.addMark(e,t,s[t])});let{onInsertedImage:c}=e.getMenuConfig(`insertImage`);c&&c(a)}),E_.apply(this,arguments)}function D_(e,t){return O_.apply(this,arguments)}function O_(){return O_=A(function*(e,t,n=``,r=``,i={}){if(!(yield x_(`editImage`,e,t,n,r)))return;let a=yield C_(`editImage`,e,t),o=J.getSelectedNodeByType(e,`image`);if(o==null)return;let{style:s={}}=o,c={src:a,alt:n,href:r,style:D(D({},s),i)};G.setNodes(e,c,{match:e=>J.checkNodeType(e,`image`)});let l=J.getSelectedNodeByType(e,`image`),{onUpdatedImage:u}=e.getMenuConfig(`editImage`);u&&u(l)}),O_.apply(this,arguments)}function k_(){return v_(`w-e-edit-image`)}var A_=class{constructor(){this.title=X(`image.edit`),this.iconSvg=bm,this.tag=`button`,this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=k_(),this.altInputId=k_(),this.hrefInputId=k_(),this.buttonId=k_()}getValue(e){return``}getImageNode(e){return J.getSelectedNodeByType(e,`image`)}isActive(e){return!1}exec(e,t){}isDisabled(e){let{selection:t}=e;return t==null||!L.isCollapsed(t)||J.getSelectedNodeByType(e,`image`)==null}getModalPositionNode(e){return this.getImageNode(e)}getModalContentElem(e){let{srcInputId:t,altInputId:n,hrefInputId:r,buttonId:i}=this,a=this.getImageNode(e);if(a==null)throw Error(`Not found selected image node`);let[o,s]=ud(X(`image.src`),t),c=Q(s),[l,u]=ud(X(`image.desc`),n),d=Q(u),[f,p]=ud(X(`image.link`),r),m=Q(p),[h]=fd(i,X(`common.ok`));if(this.$content==null){let a=Q(`<div></div>`);a.on(`click`,`#${i}`,i=>{i.preventDefault();let o=a.find(`#${t}`).val(),s=a.find(`#${n}`).val(),c=a.find(`#${r}`).val();this.updateImage(e,o,s,c),e.hidePanelOrModal()}),this.$content=a}let g=this.$content;g.empty(),g.append(o),g.append(l),g.append(f),g.append(h);let{src:_,alt:v=``,href:y=``}=a;return c.val(_),d.val(v),m.val(y),setTimeout(()=>{c.focus()}),g[0]}updateImage(e,t,n=``,r=``,i={}){t&&(e.restoreSelection(),!this.isDisabled(e)&&D_(e,t,n,r,i))}};O();let j_=/^\d+(\.\d+)?px$/,M_=/^\d+(\.\d+)?%$/,N_=/^\d+(\.\d+)?$/,P_=[`30%`,`50%`,`100%`];function F_(e,t){var n;let r=P_.indexOf(t);return((n=e.getConfig().imageResize)==null||(n=n.resizeOptions)==null?void 0:n[r])||{label:t,value:t}}function I_(e,t){return`${Number(e)}${t}`}function L_(e,t,n=`modal`){let r=e.trim();return r===``||r===`auto`?``:t===`px`?N_.test(r)?I_(r,`px`):j_.test(r)?r:n===`preset`&&M_.test(r)?I_(r.slice(0,-1),`px`):null:t===`%`?N_.test(r)?I_(r,`%`):M_.test(r)?r:null:M_.test(r)||j_.test(r)?r:N_.test(r)?I_(r,`px`):`auto`}function R_(e,t,n,r){let{resizeUnit:i,checkImageSize:a}=e.getConfig().imageResize||{},o=L_(t,i,r),s=L_(n,i,r);if(o==null||s==null)return e.alert(i===`px`?`图片宽高只能使用 px 单位`:`图片宽高只能使用 % 单位`,`error`),null;let c=a==null?void 0:a({width:o,height:s,rawWidth:t,rawHeight:n,source:r});return typeof c==`string`?(e.alert(c,`error`),null):a&&c!==!0?null:{width:o,height:s}}function z_(e,t,n,r,i){let a=R_(e,n,r,i);if(a==null)return!1;let{style:o={}}=t,s;try{s=J.findPath(e,t)}catch(e){s=void 0}let c={style:D(D({},o),a)};return s==null?e.selection==null?!1:(G.setNodes(e,c,{at:e.selection,match:e=>J.checkNodeType(e,`image`)}),!0):(G.setNodes(e,c,{at:s}),!0)}function B_(){return v_(`w-e-insert-image`)}var V_=class{constructor(){this.title=X(`image.editSize`),this.tag=`button`,this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=B_(),this.heightInputId=B_(),this.buttonId=B_()}getSelectedImageNode(e){return J.getSelectedNodeByType(e,`image`)}getValue(e){return``}isActive(e){return!1}exec(e,t){}isDisabled(e){return e.selection==null||this.getSelectedImageNode(e)==null}getModalPositionNode(e){return this.getSelectedImageNode(e)}getModalContentElem(e){let{widthInputId:t,heightInputId:n,buttonId:r}=this,[i,a]=ud(X(`image.width`),t,`auto`),o=Q(a),[s,c]=ud(X(`image.height`),n,`auto`),l=Q(c),[u]=fd(r,X(`image.ok`)),d=this.getSelectedImageNode(e);if(this.$content==null){let i=Q(`<div></div>`);i.on(`click`,`#${r}`,r=>{r.preventDefault();let a=i.find(`#${t}`).val().trim(),o=i.find(`#${n}`).val().trim();e.restoreSelection(),z_(e,d,a,o,`modal`)&&e.hidePanelOrModal()}),this.$content=i}let f=this.$content;if(f.empty(),f.append(i),f.append(s),f.append(u),d==null)return f[0];let{style:p={}}=d,{width:m=`auto`,height:h=`auto`}=p;return o.val(m),l.val(h),setTimeout(()=>{o.focus()}),f[0]}};function H_(){return v_(`w-e-insert-image`)}var U_=class{constructor(){this.title=X(`image.netImage`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>`,this.tag=`button`,this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=H_(),this.altInputId=H_(),this.hrefInputId=H_(),this.buttonId=H_()}getValue(e){return``}isActive(e){return!1}exec(e,t){}isDisabled(e){return b_(e)}getModalPositionNode(e){return null}getModalContentElem(e){let{srcInputId:t,altInputId:n,hrefInputId:r,buttonId:i}=this,[a,o]=ud(X(`image.src`),t),s=Q(o),[c,l]=ud(X(`image.desc`),n),u=Q(l),[d,f]=ud(X(`image.link`),r),p=Q(f),[m]=fd(i,X(`common.ok`));if(this.$content==null){let a=Q(`<div></div>`);a.on(`click`,`#${i}`,i=>{i.preventDefault();let o=a.find(`#${t}`).val().trim(),s=a.find(`#${n}`).val().trim(),c=a.find(`#${r}`).val().trim();this.insertImage(e,o,s,c),e.hidePanelOrModal()}),this.$content=a}let h=this.$content;return h.empty(),h.append(a),h.append(c),h.append(d),h.append(m),s.val(``),u.val(``),p.val(``),setTimeout(()=>{s.focus()}),h[0]}insertImage(e,t,n=``,r=``){t&&(e.restoreSelection(),!this.isDisabled(e)&&T_(e,t,n,r))}},W_=class{constructor(){this.title=X(`image.preview`),this.iconSvg=xm,this.tag=`button`}getValue(e){let t=J.getSelectedNodeByType(e,`image`);return t&&t.src||``}isActive(e){return!1}isDisabled(e){return e.selection==null?!0:!this.getValue(e)}exec(e,t){if(!this.isDisabled(e)){if(!t||typeof t!=`string`)throw Error(`Preview image failed, image.src is '${t}'`);window.open(t,`_blank`)}}},G_=class{constructor(){this.title=X(`image.viewLink`),this.iconSvg=xm,this.tag=`button`}getValue(e){let t=J.getSelectedNodeByType(e,`image`);return t&&t.href||``}isActive(e){return!1}isDisabled(e){return e.selection==null?!0:!this.getValue(e)}exec(e,t){if(!this.isDisabled(e)){if(!t||typeof t!=`string`)throw Error(`View image link failed, image.href is '${t}'`);window.open(t,`_blank`)}}},K_=class{constructor(){this.tag=`button`}getTitle(e){return F_(e,this.value).label}getValue(e){return``}isActive(e){return!1}getSelectedNode(e){return J.getSelectedNodeByType(e,`image`)}isDisabled(e){return e.selection==null||this.getSelectedNode(e)==null}exec(e,t){if(this.isDisabled(e))return;let n=this.getSelectedNode(e);if(n==null||!z_(e,n,F_(e,this.value).value,``,`preset`))return;let r=J.getHoverbar(e);r&&r.hideAndClean()}},q_=class extends K_{constructor(...e){super(...e),this.title=`30%`,this.value=`30%`}},J_=class extends K_{constructor(...e){super(...e),this.title=`50%`,this.value=`50%`}},Y_=class extends K_{constructor(...e){super(...e),this.title=`100%`,this.value=`100%`}};let X_=g_(),Z_={key:`insertImage`,factory(){return new U_},config:X_},Q_={key:`deleteImage`,factory(){return new __}},$_={key:`editImage`,factory(){return new A_},config:X_},ev={key:`viewImageLink`,factory(){return new G_}},tv={key:`previewImage`,factory(){return new W_}},nv={key:`imageWidth30`,factory(){return new q_}},rv={key:`imageWidth50`,factory(){return new J_}},iv={key:`imageWidth100`,factory(){return new Y_}},av={key:`editorImageSizeMenu`,factory(){return new V_}};function ov(e,t,n){let r=Q(e),i=r.attr(`data-href`)||``,a=r.attr(`width`)||``,o=r.attr(`height`)||``,s=km(r,`width`)||r.attr(`data-w-e-style-width`)||a,c=km(r,`height`)||r.attr(`data-w-e-style-height`)||o;return i=decodeURIComponent(i),{type:`image`,src:r.attr(`src`)||``,alt:r.attr(`alt`)||``,href:i,style:{width:s,height:c},width:a,height:o,children:[{text:``}]}}let sv={selector:`img:not([data-w-e-type])`,parseElemHtml:ov};function cv(e){let{isInline:t,isVoid:n}=e,r=e;return r.isInline=e=>{let{type:n}=e;return n===`image`?!0:t(e)},r.isVoid=e=>{let{type:t}=e;return t===`image`?!0:n(e)},r}var lv=cv;O();function uv(e,t){let{id:n}=J.findKey(e,t);return`w-e-image-container-${n}`}function dv(e,t,n,r){let{width:i,height:a}=r,o={};return i&&(o.width=i),a&&(o.height=a),Z(`div`,{id:uv(e,t),style:o,className:`w-e-image-container`},n)}function fv(e,t,n,r){let i=Q(`body`),a=uv(e,t),{width:o,height:s}=r,c=0,l=0,u=0,d=0,f=!1,p=null;function m(){let e=Q(`#${a}`);if(e.length===0)throw Error(`Cannot find image container elem`);return e}let h=(0,Td.default)(e=>{e.preventDefault();let{clientX:t}=e,n=f?c-t:t-c,r=l+n,i=r/l*u;r>d-6||p!=null&&(r<=15||i<=15||(p.css(`width`,`${r}px`),p.css(`height`,`${i}px`)))},100);function g(n){if(i.off(`mousemove`,h),p==null)return;let r=p.width().toFixed(2),a=p.height().toFixed(2),o={style:D(D({},t.style),{},{width:`${r}px`,height:`${a}px`})};G.setNodes(e,o,{at:J.findPath(e,t)}),i.off(`mouseup`,g)}function _(t,n){p=m(),c=t,d=n;let r=p.find(`img`);if(r.length===0)throw Error(`Cannot find image elem`);l=r.width(),u=r.height(),i.on(`mousemove`,h),i.on(`mouseup`,g);let a=J.getHoverbar(e);a&&a.hideAndClean()}let v={};return o&&(v.width=o),s&&(v.height=s),v.boxShadow=`0 0 0 1px #B4D5FF`,Z(`div`,{id:a,style:v,className:`w-e-image-container w-e-selected-image-container`,on:{mousedown:n=>{let r=Q(n.target);if(!r.hasClass(`w-e-image-dragger`))return;n.preventDefault(),(r.hasClass(`left-top`)||r.hasClass(`left-bottom`))&&(f=!0);let i=J.getParentNode(e,t);if(i==null)return;let a=J.toDOMNode(e,i),o=a.getBoundingClientRect?a.getBoundingClientRect():{width:0},s=window.getComputedStyle(a),c=parseFloat(s.paddingLeft),l=parseFloat(s.paddingRight),u=parseFloat(s.borderLeftWidth),d=parseFloat(s.borderRightWidth);_(n.clientX,o.width-c-l-u-d)}}},n,Z(`div`,{className:`w-e-image-dragger left-top`}),Z(`div`,{className:`w-e-image-dragger right-top`}),Z(`div`,{className:`w-e-image-dragger left-bottom`}),Z(`div`,{className:`w-e-image-dragger right-bottom`}))}function pv(e,t,n){let{src:r,alt:i=``,href:a=``,style:o={}}=e,{width:s=``,height:c=``}=o,l=J.isNodeSelected(n,e),u={maxWidth:`100%`};s&&(u.width=`100%`),c&&(u.height=`100%`);let d=Z(`img`,{style:u,src:r,alt:i,"data-href":a}),f=a?Z(`a`,{href:a,target:`_blank`},d):d,p=n.isDisabled();return l&&!p?fv(n,e,f,{width:s,height:c}):dv(n,e,f,{width:s,height:c})}var mv={renderElems:[{type:`image`,renderElem:pv}],elemsToHtml:[h_],parseElemsHtml:[sv],menus:[Z_,Q_,$_,tv,ev,nv,rv,iv,av],editorPlugin:lv};function hv(e){if(!R.isElement(e))return!1;let t=e.type;return!!(t===`paragraph`||typeof t==`string`&&t.startsWith(`header`))}var gv=class{constructor(){this.tag=`button`}getValue(e){let[t]=V.nodes(e,{match:e=>!!e.indent,universal:!0});if(t==null)return``;let[n]=t;return n.indent||``}isActive(e){return!1}getMatchNode(e){let[t]=V.nodes(e,{match:hv,universal:!0,mode:`highest`});return t==null?null:t[0]}},_v=class extends gv{constructor(...e){super(...e),this.title=X(`indent.decrease`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m256-512v384l-256-192z"></path></svg>`}isDisabled(e){let t=this.getMatchNode(e);if(t==null)return!0;let{indent:n}=t;return!n}exec(e,t){G.setNodes(e,{indent:null},{match:hv,mode:`highest`})}},vv=class extends gv{constructor(...e){super(...e),this.title=X(`indent.increase`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>`,this.DEFAULT_INDENT_VALUE=`2em`}isDisabled(e){let t=this.getMatchNode(e);if(t==null)return!0;let{indent:n}=t;return!!n}getIndentValue(e){let t=this.getMatchNode(e);if(!t)return this.DEFAULT_INDENT_VALUE;let n=t.children.filter(W.isText)[0];if(!n||!n.fontSize)return this.DEFAULT_INDENT_VALUE;let r=n.fontSize,i=parseInt(n.fontSize,10),a=r.replace(`${i}`,``);return`${i*2}${a}`}exec(e,t){let n=this.getIndentValue(e);G.setNodes(e,{indent:n},{match:hv,mode:`highest`})}};let yv={key:`indent`,factory(){return new vv}},bv={key:`delIndent`,factory(){return new _v}};function xv(e,t,n){let r=Q(e);if(!R.isElement(t)||!hv(t))return t;let i=t,a=km(r,`text-indent`)||Uh(r,`indent`,n);return a&&parseInt(a,10)>0&&(i.indent=a),i}function Sv(e){let t=Q(e),n=km(t,`padding-left`);return/^[1-9]\d*em$/.test(n)&&t.css(`text-indent`,`2em`),/^[1-9]\d*px$/.test(n)&&parseInt(n,10)%32==0&&t.css(`text-indent`,`2em`),t[0]}let Cv={selector:`p,h1,h2,h3,h4,h5`,preParseHtml:Sv};function wv(e,t,n){if(!R.isElement(e)||!hv(e))return t;let{indent:r}=e,i=t;return r&&(zh(n)===`class`?Vh(i,`indent`,r,n,`render`,{textIndent:r}):xh(i,{textIndent:r})),i}function Tv(e,t,n){if(!R.isElement(e)||!hv(e))return t;let{indent:r}=e;if(!r)return t;let i=Q(t);return zh(n)===`class`?Bh(i,`indent`,r,n,`toHtml`,()=>{i.css(`text-indent`,r)}):i.css(`text-indent`,r),Dm(i)}var Ev={renderStyle:wv,styleToHtml:Tv,preParseHtml:[Cv],parseStyleHtml:xv,menus:[yv,bv]},Dv=class{constructor(){this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){return!!(e.selection==null||J.getSelectedElems(e).some(t=>{let{type:n}=t;return!!(V.isVoid(e,t)&&V.isBlock(e,t)||[`pre`,`code`].includes(n))}))}},Ov=class extends Dv{constructor(...e){super(...e),this.title=X(`justify.center`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`}exec(e,t){G.setNodes(e,{textAlign:`center`},{match:t=>R.isElement(t)&&!e.isInline(t)})}},kv=class extends Dv{constructor(...e){super(...e),this.title=X(`justify.justify`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>`}exec(e,t){G.setNodes(e,{textAlign:`justify`},{match:t=>R.isElement(t)&&!e.isInline(t)})}},Av=class extends Dv{constructor(...e){super(...e),this.title=X(`justify.left`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`}exec(e,t){G.setNodes(e,{textAlign:`left`},{match:t=>R.isElement(t)&&!e.isInline(t)})}},jv=class extends Dv{constructor(...e){super(...e),this.title=X(`justify.right`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`}exec(e,t){G.setNodes(e,{textAlign:`right`},{match:t=>R.isElement(t)&&!e.isInline(t)})}};let Mv={key:`justifyLeft`,factory(){return new Av}},Nv={key:`justifyRight`,factory(){return new jv}},Pv={key:`justifyCenter`,factory(){return new Ov}},Fv={key:`justifyJustify`,factory(){return new kv}};function Iv(e,t,n){let r=Q(e);if(!R.isElement(t))return t;let i=t,a=km(r,`text-align`)||Uh(r,`textAlign`,n);return a&&(i.textAlign=a),i}function Lv(e,t,n){if(!R.isElement(e))return t;let{textAlign:r}=e,i=t;return r&&(zh(n)===`class`?Vh(i,`textAlign`,r,n,`render`,{textAlign:r}):xh(i,{textAlign:r})),i}function Rv(e,t,n){if(!R.isElement(e))return t;let{textAlign:r}=e;if(!r)return t;let i=Q(t);return zh(n)===`class`?Bh(i,`textAlign`,r,n,`toHtml`,()=>{i.css(`text-align`,r)}):i.css(`text-align`,r),Dm(i)}var zv={renderStyle:Lv,styleToHtml:Rv,parseStyleHtml:Iv,menus:[Mv,Nv,Pv,Fv]},Bv=class{constructor(){this.title=X(`lineHeight.title`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M964 788a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526zM198.93 144.306c6.668-5.798 16.774-5.094 22.573 1.574l122.26 140.582a16 16 0 0 1 3.927 10.5c0 8.836-7.164 16-16 16h-61.8a8 8 0 0 0-8 8v390.077h69.819a16 16 0 0 1 10.502 3.928c6.666 5.8 7.37 15.906 1.57 22.573L221.476 878.123a16 16 0 0 1-1.57 1.57c-6.668 5.8-16.774 5.097-22.574-1.57L75.051 737.538a16 16 0 0 1-3.928-10.5c0-8.837 7.163-16 16-16h69.822V312.96H87.127a16 16 0 0 1-10.502-3.928c-6.666-5.8-7.37-15.906-1.57-22.573l122.303-140.582a16 16 0 0 1 1.572-1.572zM964 465a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z m0-323a8 8 0 0 1 8 8v98a8 8 0 0 1-8 8H438a8 8 0 0 1-8-8v-98a8 8 0 0 1 8-8h526z"></path></svg>`,this.tag=`select`,this.width=80}getOptions(e){let t=[],{lineHeightList:n=[]}=e.getMenuConfig(`lineHeight`);t.push({text:X(`lineHeight.default`),value:``}),n.forEach(e=>{t.push({text:e,value:e})});let r=this.getValue(e);return t.forEach(e=>{e.value===r?e.selected=!0:e.selected=void 0}),t}getMatchNode(e){let[t]=V.nodes(e,{match:e=>{let t=J.getNodeType(e);return!!(t.startsWith(`header`)||[`paragraph`,`blockquote`,`list-item`].includes(t))},universal:!0,mode:`highest`});return t==null?null:t[0]}isActive(e){return!1}getValue(e){let t=this.getMatchNode(e);return t==null||!R.isElement(t)?``:t.lineHeight||``}isDisabled(e){return e.selection==null||this.getMatchNode(e)==null}exec(e,t){G.setNodes(e,{lineHeight:t.toString()},{mode:`highest`})}};let Vv={key:`lineHeight`,factory(){return new Bv},config:{lineHeightList:bh()}};function Hv(e,t,n){let r=Q(e);if(!R.isElement(t))return t;let i=t,{lineHeightList:a=[]}=n.getMenuConfig(`lineHeight`),o=km(r,`line-height`)||Uh(r,`lineHeight`,n);return o&&a.includes(o)&&(i.lineHeight=o),i}function Uv(e,t,n){if(!R.isElement(e))return t;let{lineHeight:r}=e,i=t;return r&&(zh(n)===`class`?Vh(i,`lineHeight`,r,n,`render`,{lineHeight:r}):xh(i,{lineHeight:r})),i}function Wv(e,t,n){if(!R.isElement(e))return t;let{lineHeight:r}=e;if(!r)return t;let i=Q(t);return zh(n)===`class`?Bh(i,`lineHeight`,r,n,`toHtml`,()=>{i.css(`line-height`,r)}):i.css(`line-height`,r),Dm(i)}var Gv={renderStyle:Uv,styleToHtml:Wv,parseStyleHtml:Hv,menus:[Vv]};function Kv(e,t){let{url:n,target:r=`_blank`}=e;return`<a href="${n}" target="${r}">${t}</a>`}let qv={type:`link`,elemToHtml:Kv};function Jv(){return{checkLink(e,t){return!0},parseLinkUrl(e){return e}}}let Yv=/[\t\n\f\r]+/g,Xv=/ /g;function Zv(e){let t=e.replace(Yv,``).trim();return t.indexOf(` `)<0?t:t.replace(Xv,`%20`)}j(),O();function Qv(e,t,n,r){return $v.apply(this,arguments)}function $v(){return $v=A(function*(e,t,n,r){let i=Zv(r),{checkLink:a}=t.getMenuConfig(e);if(a){let e=yield a(n,i);if(typeof e==`string`)return t.alert(e,`error`),!1;if(e==null)return!1}return!0}),$v.apply(this,arguments)}function ey(e,t,n){return ty.apply(this,arguments)}function ty(){return ty=A(function*(e,t,n){let r=Zv(n),{parseLinkUrl:i}=t.getMenuConfig(e);return i?Zv(yield i(r)):r}),ty.apply(this,arguments)}function ny(e){return!!(e.selection==null||J.getSelectedElems(e).some(t=>{let{type:n}=t;return!!(e.isVoid(t)||[`pre`,`code`,`link`].includes(n))}))}function ry(e,t){return{type:`link`,url:y_(e),children:t?[{text:t}]:[]}}function iy(e,t,n){return ay.apply(this,arguments)}function ay(){return ay=A(function*(e,t,n){if(t||(t=n),e.restoreSelection(),ny(e)||!(yield Qv(`insertLink`,e,t,n)))return;let r=yield ey(`insertLink`,e,n);if(!r)return;let{selection:i}=e;if(i!=null)if(L.isCollapsed(i)){let n=J.getLeftLengthOfMaxLength(e);if(n<=0)return;e.insertText(` `),n<t.length+1&&(t=t.slice(0,n-1));let i=ry(r,t);G.insertNodes(e,i),e.insertFragment([{text:` `}])}else{let n=V.string(e,i);if(n!==t){let i=J.getLeftLengthOfMaxLength(e);if(i<=0)return;i<n.length-t.length&&(t=t.slice(0,i)),e.deleteFragment();let a=ry(r,t);G.insertNodes(e,a)}else{let t=ry(r);G.wrapNodes(e,t,{split:!0}),G.collapse(e,{edge:`end`})}}}),ay.apply(this,arguments)}function oy(e,t,n){return sy.apply(this,arguments)}function sy(){return sy=A(function*(e,t,n){if(!(yield Qv(`editLink`,e,t,n)))return;let r=yield ey(`editLink`,e,n);if(!r)return;let i=J.getSelectedNodeByType(e,`link`);if(i==null)return;let a=J.findPath(e,i),o=y_(r);if(!t||t===z.string(i)){G.setNodes(e,{url:o},{at:a});return}let s=D(D({},i),{},{url:o,children:[{text:t}]});V.withoutNormalizing(e,()=>{G.removeNodes(e,{at:a}),G.insertNodes(e,s,{at:a})})}),sy.apply(this,arguments)}function cy(){return v_(`w-e-update-link`)}var ly=class{constructor(){this.title=X(`link.edit`),this.iconSvg=bm,this.tag=`button`,this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=cy(),this.urlInputId=cy(),this.buttonId=cy()}getSelectedLinkElem(e){let t=J.getSelectedNodeByType(e,`link`);return t==null?null:t}getValue(e){let t=this.getSelectedLinkElem(e);return t&&t.url||``}isActive(e){return!1}exec(e,t){}isDisabled(e){return e.selection==null||this.getSelectedLinkElem(e)==null}getModalPositionNode(e){return J.getSelectedNodeByType(e,`link`)}getModalContentElem(e){let{textInputId:t,urlInputId:n,buttonId:r}=this,[i,a]=ud(X(`link.text`),t),o=Q(a),[s,c]=ud(X(`link.url`),n),l=Q(c),[u]=fd(r,X(`common.ok`));if(this.$content==null){let i=Q(`<div></div>`);i.on(`click`,`#${r}`,r=>{r.preventDefault(),e.restoreSelection(),oy(e,i.find(`#${t}`).val(),i.find(`#${n}`).val()),e.hidePanelOrModal()}),this.$content=i}let d=this.$content;d.empty(),d.append(i),d.append(s),d.append(u);let f=this.getSelectedLinkElem(e),p=f?z.string(f):``,m=this.getValue(e);return o.val(p),l.val(m),setTimeout(()=>{o.focus()}),d[0]}};function uy(){return v_(`w-e-insert-link`)}var dy=class{constructor(){this.title=X(`link.insert`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M440.224 635.776a51.84 51.84 0 0 1-36.768-15.232c-95.136-95.136-95.136-249.92 0-345.056l192-192C641.536 37.408 702.816 12.032 768 12.032s126.432 25.376 172.544 71.456c95.136 95.136 95.136 249.92 0 345.056l-87.776 87.776a51.968 51.968 0 1 1-73.536-73.536l87.776-87.776a140.16 140.16 0 0 0 0-197.984c-26.432-26.432-61.6-40.992-99.008-40.992s-72.544 14.56-99.008 40.992l-192 192a140.16 140.16 0 0 0 0 197.984 51.968 51.968 0 0 1-36.768 88.768z"></path><path d="M256 1012a242.4 242.4 0 0 1-172.544-71.456c-95.136-95.136-95.136-249.92 0-345.056l87.776-87.776a51.968 51.968 0 1 1 73.536 73.536l-87.776 87.776a140.16 140.16 0 0 0 0 197.984c26.432 26.432 61.6 40.992 99.008 40.992s72.544-14.56 99.008-40.992l192-192a140.16 140.16 0 0 0 0-197.984 51.968 51.968 0 1 1 73.536-73.536c95.136 95.136 95.136 249.92 0 345.056l-192 192A242.4 242.4 0 0 1 256 1012z"></path></svg>`,this.tag=`button`,this.showModal=!0,this.modalWidth=300,this.$content=null,this.textInputId=uy(),this.urlInputId=uy(),this.buttonId=uy()}getValue(e){return``}isActive(e){return!1}exec(e,t){}isDisabled(e){return ny(e)}getModalPositionNode(e){return null}getModalContentElem(e){let{selection:t}=e,{textInputId:n,urlInputId:r,buttonId:i}=this,[a,o]=ud(X(`link.text`),n),s=Q(o),[c,l]=ud(X(`link.url`),r),u=Q(l),[d]=fd(i,X(`common.ok`));if(this.$content==null){let t=Q(`<div></div>`);t.on(`click`,`#${i}`,i=>{i.preventDefault(),iy(e,t.find(`#${n}`).val(),t.find(`#${r}`).val()),e.hidePanelOrModal()}),this.$content=t}let f=this.$content;if(f.empty(),f.append(a),f.append(c),f.append(d),t==null||L.isCollapsed(t))s.val(``);else{let n=V.string(e,t);s.val(n)}return u.val(``),setTimeout(()=>{s.focus()}),f[0]}},fy=class{constructor(){this.title=X(`link.unLink`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M608.16328 811.815036c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.347563 89.347564c-118.525421 118.523421-311.38448 118.531421-429.919901 0-118.527421-118.529421-118.527421-311.39048 0-429.917901l89.349564-89.349563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.195613 79.195613c9.371954 9.371954 9.371954 24.56788 0 33.941834l-89.349563 89.347564c-56.143726 56.145726-56.143726 147.49928 0 203.645005 56.143726 56.143726 147.49928 56.145726 203.647005 0l89.347564-89.347563c9.371954-9.371954 24.56788-9.371954 33.941834 0l79.193613 79.195613z m-113.135447-520.429459c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.347564-89.347564c56.143726-56.149726 147.49928-56.145726 203.647006 0 56.143726 56.145726 56.143726 147.49928 0 203.645006l-89.349564 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.195613 79.195613c9.371954 9.371954 24.56788 9.371954 33.941834 0l89.349564-89.349563c118.529421-118.529421 118.529421-311.38848 0-429.917901-118.531421-118.527421-311.38848-118.527421-429.919901 0l-89.347563 89.347564c-9.371954 9.371954-9.371954 24.56788 0 33.941834l79.193613 79.195613z m469.653707 718.556492l45.253779-45.253779c18.745908-18.745908 18.745908-49.13776 0-67.881669L127.195629 14.062931c-18.745908-18.745908-49.13776-18.745908-67.881669 0L14.058181 59.31871c-18.745908 18.745908-18.745908 49.13776 0 67.881669l882.74169 882.74169c18.745908 18.743908 49.13776 18.743908 67.881669 0z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){return e.selection==null||J.getSelectedNodeByType(e,`link`)==null}exec(e,t){this.isDisabled(e)||G.unwrapNodes(e,{match:e=>J.checkNodeType(e,`link`)})}},py=class{constructor(){this.title=X(`link.view`),this.iconSvg=xm,this.tag=`button`}getSelectedLinkElem(e){let t=J.getSelectedNodeByType(e,`link`);return t==null?null:t}getValue(e){let t=this.getSelectedLinkElem(e);return t&&t.url||``}isActive(e){return!1}isDisabled(e){return e.selection==null||this.getSelectedLinkElem(e)==null}exec(e,t){if(!this.isDisabled(e)){if(!t||typeof t!=`string`)throw Error(`View link failed, link url is '${t}'`);window.open(t,`_blank`)}}};let my=Jv(),hy={key:`insertLink`,factory(){return new dy},config:my},gy={key:`editLink`,factory(){return new ly},config:my},_y={key:`unLink`,factory(){return new fy}},vy={key:`viewLink`,factory(){return new py}};O();function yy(e,t,n){let r=Q(e);t=t.filter(e=>!!(W.isText(e)||n.isInline(e))),t.length===0&&(t=[{text:r.text().replace(/\s+/gm,` `)}]);let i=t[0],a=R.isElement(i)&&i.type===`image`&&i.href||``,o=r.find(`img`).attr(`data-href`)||``;return t.length===1&&R.isElement(i)&&i.type===`image`&&(a||o)?D(D({},i),{},{href:Zv(r.attr(`href`)||``)}):{type:`link`,url:Zv(r.attr(`href`)||``),target:r.attr(`target`)||``,children:t}}let by={selector:`a:not([data-w-e-type])`,parseElemHtml:yy};var xy=d(c(((e,t)=>{t.exports=a;var n=/^(?:\w+:)?\/\/(\S+)$/,r=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,i=/^[^\s\.]+\.\S{2,}$/;function a(e){if(typeof e!=`string`)return!1;var t=e.match(n);if(!t)return!1;var a=t[1];return a?!!(r.test(a)||i.test(a)):!1}}))(),1);function Sy(e){let{isInline:t,insertData:n,normalizeNode:r}=e,i=e;return i.isInline=e=>{let{type:n}=e;return n===`link`?!0:t(e)},i.insertData=e=>{let t=e.getData(`text/plain`);if(!(0,xy.default)(t)){n(e);return}if(/<img[^>]+>/.test(e.getData(`text/html`))){n(e);return}if(ny(i))return;let{selection:r}=i;r!=null&&iy(i,V.string(i,r),t)},i.normalizeNode=([e,t])=>J.getNodeType(e)===`link`&&z.string(e)===``?G.removeNodes(i,{at:t}):r([e,t]),i}var Cy=Sy;function wy(e,t,n){let{url:r,target:i=`_blank`}=e;return Z(`a`,{href:r,target:i},t)}var Ty={renderElems:[{type:`link`,renderElem:wy}],elemsToHtml:[qv],parseElemsHtml:[by],menus:[hy,gy,_y,vy],editorPlugin:Cy};function Ey(e,t){return t===``?`<p><br></p>`:`<p>${t}</p>`}let Dy={type:`paragraph`,elemToHtml:Ey};function Oy(e,t,n){let r=Q(e);return t=t.filter(e=>!!(W.isText(e)||n.isInline(e))),t.length===0&&(t=[{text:r.text().replace(/\s+/gm,` `)}]),{type:`paragraph`,children:t}}let ky={selector:`p:not([data-w-e-type])`,parseElemHtml:Oy};function Ay(e){let[t]=V.nodes(e,{match:t=>e.children[0]===t,mode:`highest`});if(t==null)return!1;let n=t[0];if(!R.isElement(n)||n.type===`paragraph`||z.string(n)!==``)return!1;let{children:r=[]}=n;return W.isText(r[0])?(G.setNodes(e,{type:`paragraph`}),!0):!1}function jy(e){let{deleteBackward:t,deleteForward:n}=e,r=e;return r.deleteBackward=e=>{Ay(r)||t(e)},r.deleteForward=e=>{Ay(r)||n(e)},r}var My=jy;function Ny(e,t,n){return Z(`p`,null,t)}var Py={renderElems:[{type:`paragraph`,renderElem:Ny}],elemsToHtml:[Dy],parseElemsHtml:[ky],editorPlugin:My};function Fy(e,t){if(e.selection==null)return!0;let[n]=V.nodes(e,{match:t=>!!(J.getNodeType(t)===`pre`||R.isElement(t)&&V.isVoid(e,t)),universal:!0});return!!n}function Iy(e,t){Object.keys(t).forEach(t=>{t!==`text`&&V.removeMark(e,t)})}var Ly=class{constructor(){this.marksNeedToRemove=[],this.tag=`button`}getValue(e){let t=this.mark,n=V.marks(e);if(n)return n[t];let[r]=V.nodes(e,{match:e=>e[t]===!0});return!!r}isActive(e){return!!this.getValue(e)}isDisabled(e){return Fy(e,this.mark)}exec(e,t){let{mark:n,marksNeedToRemove:r}=this;t?e.removeMark(n):(e.addMark(n,!0),r&&r.forEach(t=>e.removeMark(t)))}},Ry=class extends Ly{constructor(...e){super(...e),this.mark=`bold`,this.title=X(`textStyle.bold`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M707.872 484.64A254.88 254.88 0 0 0 768 320c0-141.152-114.848-256-256-256H192v896h384c141.152 0 256-114.848 256-256a256.096 256.096 0 0 0-124.128-219.36zM384 192h101.504c55.968 0 101.504 57.408 101.504 128s-45.536 128-101.504 128H384V192z m159.008 640H384v-256h159.008c58.464 0 106.016 57.408 106.016 128s-47.552 128-106.016 128z"></path></svg>`,this.hotkey=`mod+b`}},zy=class{constructor(){this.title=X(`textStyle.clear`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M969.382408 288.738615l-319.401123-270.852152a67.074236 67.074236 0 0 0-96.459139 5.74922l-505.931379 574.922021a68.35184 68.35184 0 0 0-17.886463 47.910169 74.101061 74.101061 0 0 0 24.274486 47.910168l156.50655 132.232065h373.060512L975.131628 383.281347a67.074236 67.074236 0 0 0-5.74922-96.459139z m-440.134747 433.746725H264.144729l-90.071117-78.572676c-5.74922-5.74922-12.137243-12.137243-12.137243-17.886463a36.411728 36.411728 0 0 1 5.749221-24.274485l210.804741-240.828447 265.102932 228.691204z m-439.495945 180.781036h843.218964a60.047411 60.047411 0 1 1 0 120.733624H89.751716a60.047411 60.047411 0 1 1 0-120.733624z m0 0"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){return Fy(e)}exec(e,t){let n=V.nodes(e,{match:e=>W.isText(e),universal:!0});for(let t of n){let n=t[0];Iy(e,n)}}},By=class extends Ly{constructor(...e){super(...e),this.mark=`code`,this.title=X(`textStyle.code`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M576 736l96 96 320-320L672 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224z"></path></svg>`,this.hotkey=`mod+e`}},Vy=class extends Ly{constructor(...e){super(...e),this.mark=`emphasisDot`,this.title=X(`textStyle.emphasisDot`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M256 128h128v512H256zM448 128h128v512H448zM640 128h128v512H640z"></path><path d="M320 832m-64 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0zM512 832m-64 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0zM704 832m-64 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0z"></path></svg>`,this.hotkey=``}},Hy=class extends Ly{constructor(...e){super(...e),this.mark=`italic`,this.title=X(`textStyle.italic`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M896 64v64h-128L448 896h128v64H128v-64h128L576 128h-128V64z"></path></svg>`,this.hotkey=`mod+i`}},Uy=class extends Ly{constructor(...e){super(...e),this.mark=`sub`,this.marksNeedToRemove=[`sup`],this.title=X(`textStyle.sub`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M768 910.016v50.016h128v64h-192v-146.016l128-60V768h-128v-64h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>`,this.hotkey=``}},Wy=class extends Ly{constructor(...e){super(...e),this.mark=`sup`,this.marksNeedToRemove=[`sub`],this.title=X(`textStyle.sup`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M768 206.016v50.016h128v64h-192V174.016l128-60V64h-128V0h192v146.016zM676 256h-136L352 444 164 256H28l256 256-256 256h136L352 580 540 768h136l-256-256z"></path></svg>`,this.hotkey=``}},Gy=class extends Ly{constructor(...e){super(...e),this.mark=`through`,this.title=X(`textStyle.through`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M1024 512v64h-234.496c27.52 38.496 42.496 82.688 42.496 128 0 70.88-36.672 139.04-100.576 186.976C672.064 935.488 594.144 960 512 960s-160.064-24.512-219.424-69.024C228.64 843.04 192 774.88 192 704h128c0 69.376 87.936 128 192 128s192-58.624 192-128-87.936-128-192-128H0v-64h299.52a385.984 385.984 0 0 1-6.944-5.024C228.64 459.04 192 390.88 192 320s36.672-139.04 100.576-186.976C351.936 88.512 429.856 64 512 64s160.064 24.512 219.424 69.024C795.328 180.96 832 249.12 832 320h-128c0-69.376-87.936-128-192-128s-192 58.624-192 128 87.936 128 192 128c78.976 0 154.048 22.688 212.48 64H1024z"></path></svg>`,this.hotkey=`mod+shift+x`}},Ky=class extends Ly{constructor(...e){super(...e),this.mark=`underline`,this.title=X(`textStyle.underline`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M704 64l128 0 0 416c0 159.072-143.264 288-320 288s-320-128.928-320-288l0-416 128 0 0 416c0 40.16 18.24 78.688 51.36 108.512 36.896 33.216 86.848 51.488 140.64 51.488s103.744-18.304 140.64-51.488c33.12-29.792 51.36-68.352 51.36-108.512l0-416zM192 832l640 0 0 128-640 0z"></path></svg>`,this.hotkey=`mod+u`}},qy=class extends Ly{constructor(...e){super(...e),this.mark=`wavyUnderline`,this.title=X(`textStyle.wavyUnderline`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M64 704c64-96 128-96 192 0s128 96 192 0 128-96 192 0 128 96 192 0 128-96 192 0v128c-64 96-128 96-192 0s-128-96-192 0-128 96-192 0-128-96-192 0-128 96-192 0V704z"></path></svg>`,this.hotkey=``}};let Jy={key:`bold`,factory(){return new Ry}},Yy={key:`code`,factory(){return new By}},Xy={key:`italic`,factory(){return new Hy}},Zy={key:`through`,factory(){return new Gy}},Qy={key:`underline`,factory(){return new Ky}},$y={key:`wavyUnderline`,factory(){return new qy}},eb={key:`emphasisDot`,factory(){return new Vy}},tb={key:`sup`,factory(){return new Wy}},nb={key:`sub`,factory(){return new Uy}},rb={key:`clearStyle`,factory(){return new zy}};O();let ib=`0.15em`,ab=`0.3em`,ob=`0.8em`,sb=`w-e-text-style-underline-offset`,cb=`w-e-text-style-wavy-underline`,lb=`w-e-text-style-wavy-underline-with-emphasis`,ub=`w-e-text-style-emphasis-dot`,db=`w-e-text-style-emphasis-dot-with-wavy`,fb={textDecorationLine:`underline`,textDecorationStyle:`wavy`,textUnderlineOffset:ab},pb=`text-decoration-line: underline; text-decoration-style: wavy; text-underline-offset: ${ab};`,mb=D(D({},fb),{},{textUnderlineOffset:ob}),hb=`text-decoration-line: underline; text-decoration-style: wavy; text-underline-offset: ${ob};`,gb={textEmphasisStyle:`filled dot`,textEmphasisPosition:`under left`},_b=D(D({},gb),{},{lineHeight:`2`});function vb(e,t){return e.length===0?!1:e[0].matches(t)}function yb(e){let t=km(e,`font-weight`);if(!t)return!1;if(t===`bold`||t===`bolder`)return!0;let n=Number(t);return!Number.isNaN(n)&&n>=600}function bb(e){return(e.attr(`style`)||``).split(`;`).reduce((e,t)=>{let n=t.indexOf(`:`);if(n===-1)return e;let r=t.slice(0,n).trim().toLowerCase(),i=t.slice(n+1).trim().toLowerCase();return r&&i&&e.push([r,i]),e},[])}function xb(e,t){return(e.attr(`class`)||``).split(/\s+/).includes(t)}function Sb(e){let t=vb(e,`u`),n=xb(e,cb),r=t?`underline`:``,i=`solid`,a=!1,o=!1;bb(e).forEach(([e,t])=>{if(e===`text-decoration`){let e=t.split(/\s+/);r=e.includes(`none`)?`none`:e.filter(e=>[`underline`,`overline`,`line-through`].includes(e)).join(` `),i=e.find(e=>[`solid`,`double`,`dotted`,`dashed`,`wavy`].includes(e))||`solid`,a=!0,o=!0}e===`text-decoration-line`&&(r=t,a=!0),e===`text-decoration-style`&&(i=t,o=!0)});let s=r.split(/\s+/).includes(`underline`),c=t?!0:void 0,l=n?!0:void 0;return a?s?i===`wavy`?l=!0:(c=!0,l=!1):(c=!1,l=!1):o&&(i===`wavy`?(c=t?!1:c,l=!0):l=!1),{line:r,underline:c,wavyUnderline:l}}function Cb(e,t){return Sb(e).line.split(/\s+/).includes(t.toLowerCase())}function wb(e){let t=``,n=``,r=!1,i=!1;bb(e).forEach(([e,a])=>{e===`text-emphasis`&&(t=a,r=!0),e===`text-emphasis-style`&&(t=a,r=!0),e===`text-emphasis-position`&&(n=a,i=!0)});let a=t.split(/\s+/).filter(Boolean),o=n.split(/\s+/).includes(`under`),s=a.includes(`dot`)&&!a.includes(`open`);return r&&!s||i&&!o?!1:r&&i&&s&&o?!0:r&&!i?!!xb(e,ub):xb(e,ub)?!0:void 0}function Tb(e,t,n){let r=Q(e);if(!W.isText(t))return t;let i=t;km(r,`font-weight`)?i.bold=yb(r):vb(r,`b,strong`)&&(i.bold=!0),(vb(r,`i,em`)||[`italic`,`oblique`].includes(km(r,`font-style`)))&&(i.italic=!0);let a=Sb(r);a.underline!==void 0&&(i.underline=a.underline),a.wavyUnderline!==void 0&&(i.wavyUnderline=a.wavyUnderline);let o=wb(r);return o!==void 0&&(i.emphasisDot=o),(vb(r,`s,strike`)||Cb(r,`line-through`))&&(i.through=!0),(vb(r,`sub`)||km(r,`vertical-align`)===`sub`)&&(i.sub=!0),(vb(r,`sup`)||km(r,`vertical-align`)===`super`)&&(i.sup=!0),vb(r,`code`)&&(i.code=!0),i}function Eb(e,t,n){let{bold:r,italic:i,underline:a,wavyUnderline:o,emphasisDot:s,code:c,through:l,sub:u,sup:d}=e,f=t,p=zh(n);return r&&(f=Z(`strong`,null,f)),c&&(f=Z(`code`,null,f)),i&&(f=Z(`em`,null,f)),a&&(o||s?(f=Z(`u`,null,f),p===`class`?Sh(f,sb):xh(f,{textUnderlineOffset:ib})):f=Z(`u`,null,f)),o&&(f=Z(`span`,null,f),p===`class`?(Sh(f,cb),s&&Sh(f,lb)):xh(f,s?mb:fb)),s&&(f=Z(`span`,null,f),p===`class`?(Sh(f,ub),o&&Sh(f,db)):xh(f,o?_b:gb)),l&&(f=Z(`s`,null,f)),u&&(f=Z(`sub`,null,f)),d&&(f=Z(`sup`,null,f)),f}function Db(e,t,n){let r=t,{bold:i,italic:a,underline:o,wavyUnderline:s,emphasisDot:c,code:l,through:u,sub:d,sup:f}=e,p=zh(n);return i&&(r=`<strong>${r}</strong>`),l&&(r=`<code>${r}</code>`),a&&(r=`<em>${r}</em>`),o&&(r=s||c?`<u${p===`class`?` class="${sb}"`:` style="text-underline-offset: ${ib};"`}>${r}</u>`:`<u>${r}</u>`),s&&(r=`<span${p===`class`?` class="${cb}${c?` ${lb}`:``}"`:` style="${c?hb:pb}"`}>${r}</span>`),c&&(r=`<span${p===`class`?` class="${ub}${s?` ${db}`:``}"`:` style="${s?`text-emphasis-style: filled dot; text-emphasis-position: under left; line-height: 2;`:`text-emphasis-style: filled dot; text-emphasis-position: under left;`}"`}>${r}</span>`),u&&(r=`<s>${r}</s>`),d&&(r=`<sub>${r}</sub>`),f&&(r=`<sup>${r}</sup>`),r}function Ob(e,t,n){if(!W.isText(e))return t;if(Em(t))return Db(e,t,n);let r=Q(t),i=r.html();return i=Db(e,i,n),r.html(i),Dm(r)}var kb={renderStyle:Eb,menus:[Jy,Qy,Xy,$y,eb,Zy,Yy,nb,tb,rb],styleToHtml:Ob,parseStyleHtml:Tb};function Ab(e,t){let{checked:n}=e;return`<div data-w-e-type="todo"><input type="checkbox" disabled ${n?`checked`:``}>${t}</div>`}let jb={type:`todo`,elemToHtml:Ab};var Mb=class{constructor(){this.title=X(`todo.todo`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M278.755556 403.911111l-79.644445 79.644445L455.111111 739.555556l568.888889-568.888889-79.644444-79.644445L455.111111 580.266667l-176.355555-176.355556zM910.222222 910.222222H113.777778V113.777778h568.888889V0H113.777778C51.2 0 0 51.2 0 113.777778v796.444444c0 62.577778 51.2 113.777778 113.777778 113.777778h796.444444c62.577778 0 113.777778-51.2 113.777778-113.777778V455.111111h-113.777778v455.111111z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!!J.getSelectedNodeByType(e,`todo`)}isDisabled(e){return!!(e.selection==null||J.getSelectedElems(e).some(t=>{if(V.isVoid(e,t)&&V.isBlock(e,t))return!0;let{type:n}=t;return!![`pre`,`table`,`list-item`].includes(n)}))}exec(e,t){let n=this.isActive(e);G.setNodes(e,{type:n?`paragraph`:`todo`})}};let Nb={key:`todo`,factory(){return new Mb}};function Pb(e,t,n){let r=Q(e);t=t.filter(e=>!!(W.isText(e)||n.isInline(e))),t.length===0&&(t=[{text:r.text().replace(/\s+/gm,` `)}]);let i=!1;return r.find(`input[type="checkbox"]`).attr(`checked`)!=null&&(i=!0),{type:`todo`,checked:i,children:t}}let Fb={selector:`div[data-w-e-type="todo"]`,parseElemHtml:Pb};function Ib(e){let{deleteBackward:t}=e,n=e;return n.deleteBackward=n=>{let{selection:r}=e;if(r&&L.isCollapsed(r)){let t=J.getSelectedNodeByType(e,`todo`);if(t&&z.string(t).length===0){G.setNodes(e,{type:`paragraph`},{mode:`highest`});return}}t(n)},n}var Lb=Ib;function Rb(e){let t=Q(e).find(`li`),n=Q(`<div data-w-e-type="todo"></div>`),r=t.find(`input[type]`);return n.append(r),t.children()[0].remove(),n[0].innerHTML+=t[0].innerHTML,n[0]}let zb={selector:`ul.w-e-todo`,preParseHtml:Rb};function Bb(e,t,n){let r=!1;n.isDisabled()&&(r=!0);let{checked:i}=e;return Z(`div`,{style:{margin:`5px 0`}},Z(`span`,{contentEditable:!1,style:{marginRight:`0.5em`}},Z(`input`,{type:`checkbox`,checked:i,disabled:r,on:{change:t=>{let r=J.findPath(n,e),i={checked:t.target.checked};G.setNodes(n,i,{at:r})}}})),Z(`span`,null,t))}var Vb={renderElems:[{type:`todo`,renderElem:Bb}],elemsToHtml:[jb],preParseHtml:[zb],parseElemsHtml:[Fb],menus:[Nb],editorPlugin:Lb},Hb=class{constructor(){this.title=X(`undo.redo`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M0.00032 576a510.72 510.72 0 0 0 173.344 384l84.672-96A383.136 383.136 0 0 1 128.00032 576C128.00032 363.936 299.93632 192 512.00032 192c106.048 0 202.048 42.976 271.52 112.48L640.00032 448h384V64l-149.984 149.984A510.272 510.272 0 0 0 512.00032 64C229.21632 64 0.00032 293.216 0.00032 576z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){return e.selection==null}exec(e,t){typeof e.redo==`function`&&e.redo()}},Ub=class{constructor(){this.title=X(`undo.undo`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M512 64A510.272 510.272 0 0 0 149.984 213.984L0.032 64v384h384L240.512 304.48A382.784 382.784 0 0 1 512.032 192c212.064 0 384 171.936 384 384 0 114.688-50.304 217.632-130.016 288l84.672 96a510.72 510.72 0 0 0 173.344-384c0-282.784-229.216-512-512-512z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){return e.selection==null}exec(e,t){typeof e.undo==`function`&&e.undo()}},Wb=[kb,Yh,Sg,Ev,zv,Gv,mv,sg,ug,Ty,lh,Bm,p_,Py,Vb,Og,{menus:[{key:`redo`,factory(){return new Hb}},{key:`undo`,factory(){return new Ub}}]},Ag,Zh];Xu(`en`,{highLightModule:{selectLang:`Language`}}),Xu(`zh-CN`,{highLightModule:{selectLang:`选择语言`}});var Gb=d(c(((e,t)=>{
13
62
  /**
14
- * Prism: Lightweight, robust, elegant syntax highlighting
15
- *
16
- * @license MIT <https://opensource.org/licenses/MIT>
17
- * @author Lea Verou <https://lea.verou.me>
18
- * @namespace
19
- * @public
20
- */e.exports&&(e.exports=t),void 0!==g&&(g.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(e,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:t.languages[n]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:o},t.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(e,n){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:t.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(void 0!==t&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},n="data-src-status",r="loading",o="loaded",i="pre[data-src]:not(["+n+'="'+o+'"]):not(['+n+'="'+r+'"])';t.hooks.add("before-highlightall",function(e){e.selector+=", "+i}),t.hooks.add("before-sanity-check",function(a){var s=a.element;if(s.matches(i)){a.code="",s.setAttribute(n,r);var u=s.appendChild(document.createElement("CODE"));u.textContent="Loading…";var l=s.getAttribute("data-src"),c=a.language;if("none"===c){var d=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[d]||d}t.util.setLanguage(u,c),t.util.setLanguage(s,c);var f=t.plugins.autoloader;f&&f.loadLanguages(c),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("✖ Error "+r.status+" while fetching file: "+r.statusText):n("✖ Error: File does not exist or is empty"))},r.send(null)}(l,function(e){s.setAttribute(n,o);var r=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],o=t[3];return r?o?[n,Number(o)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(r){var i=e.split(/\r\n?|\n/g),a=r[0],l=null==r[1]?i.length:r[1];a<0&&(a+=i.length),a=Math.max(0,Math.min(a-1,i.length)),l<0&&(l+=i.length),l=Math.max(0,Math.min(l,i.length)),e=i.slice(a,l).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(a+1))}u.textContent=e,t.highlightElement(u)},function(e){s.setAttribute(n,"failed"),u.textContent=e})}}),t.plugins.fileHighlight={highlight:function(e){for(var n,r=(e||document).querySelectorAll(i),o=0;n=r[o++];)t.highlightElement(n)}};var a=!1;t.fileHighlight=function(){a||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),a=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}(oh)),oh.exports),ah=v(ih);!function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,o=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function i(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return o}),RegExp(e,t)}o=i(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var a=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(a).join(""):""},s=function(t){for(var n=[],r=0;r<t.length;r++){var o=t[r],i=!1;if("string"!=typeof o&&("tag"===o.type&&o.content[0]&&"tag"===o.content[0].type?"</"===o.content[0].content[0].content?n.length>0&&n[n.length-1].tagName===a(o.content[0].content[1])&&n.pop():"/>"===o.content[o.content.length-1].content||n.push({tagName:a(o.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===o.type&&"{"===o.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?n[n.length-1].openedBraces--:i=!0),(i||"string"==typeof o)&&n.length>0&&0===n[n.length-1].openedBraces){var u=a(o);r<t.length-1&&("string"==typeof t[r+1]||"plain-text"===t[r+1].type)&&(u+=a(t[r+1]),t.splice(r+1,1)),r>0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(u=a(t[r-1])+u,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",u,null,u)}o.content&&"string"!=typeof o.content&&s(o.content)}};e.hooks.add("after-tokenize",function(e){"jsx"!==e.language&&"tsx"!==e.language||s(e.tokens)})}(Prism);var sh;sh||(sh=1,function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)),Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"];var uh;uh||(uh=1,function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,o=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:o,punctuation:i};var a={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},s=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:a}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:a}}];e.languages.insertBefore("php","variable",{string:s,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:s,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:o,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}),e.hooks.add("after-tokenize",function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")})}(Prism)),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean;var lh;lh||(lh=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python);var ch;ch||(ch=1,function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism));var dh;dh||(dh=1,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism));var fh;fh||(fh=1,function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+t[+n]+")"})}function n(e,n,r){return RegExp(t(e,n),"")}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,function(){return"(?:"+e+")"});return e.replace(/<<self>>/g,"[^\\s\\S]")}var o="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",i="class enum interface record struct",a="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",s="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function u(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var l=u(i),c=RegExp(u(o+" "+i+" "+a+" "+s)),d=u(i+" "+a+" "+s),f=u(o+" "+i+" "+s),p=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),h=r(/\((?:[^()]|<<self>>)*\)/.source,2),g=/@?\b[A-Za-z_]\w*\b/.source,v=t(/<<0>>(?:\s*<<1>>)?/.source,[g,p]),m=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,v]),y=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[m,y]),E=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[p,h,y]),w=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[E]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,m,y]),D={keyword:c,punctuation:/[<>()?,.:[\]]/},A=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,S=/"(?:\\.|[^\\"\r\n])*"/.source,x=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;e.languages.csharp=e.languages.extend("clike",{string:[{pattern:n(/(^|[^$\\])<<0>>/.source,[x]),lookbehind:!0,greedy:!0},{pattern:n(/(^|[^@$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[m]),lookbehind:!0,inside:D},{pattern:n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[g,C]),lookbehind:!0,inside:D},{pattern:n(/(\busing\s+)<<0>>(?=\s*=)/.source,[g]),lookbehind:!0},{pattern:n(/(\b<<0>>\s+)<<1>>/.source,[l,v]),lookbehind:!0,inside:D},{pattern:n(/(\bcatch\s*\(\s*)<<0>>/.source,[m]),lookbehind:!0,inside:D},{pattern:n(/(\bwhere\s+)<<0>>/.source,[g]),lookbehind:!0},{pattern:n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:D},{pattern:n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,f,g]),inside:D}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:n(/([(,]\s*)<<0>>(?=\s*:)/.source,[g]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:n(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[g]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[h]),lookbehind:!0,alias:"class-name",inside:D},"return-type":{pattern:n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,m]),inside:D,alias:"class-name"},"constructor-invocation":{pattern:n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:D,alias:"class-name"},"generic-method":{pattern:n(/<<0>>\s*<<1>>(?=\s*\()/.source,[g,p]),inside:{function:n(/^<<0>>/.source,[g]),generic:{pattern:RegExp(p),alias:"class-name",inside:D}}},"type-list":{pattern:n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[l,v,g,C,c.source,h,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:n(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[v,h]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:c,"class-name":{pattern:RegExp(C),greedy:!0,inside:D},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var T=S+"|"+A,N=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[T]),O=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[N]),2),B=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,k=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[m,O]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:n(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[B,k]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(/^<<0>>(?=\s*:)/.source,[B]),alias:"keyword"},"attribute-arguments":{pattern:n(/\(<<0>>*\)/.source,[O]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var F=/:[^}\r\n]+/.source,I=r(t(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[N]),2),P=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[I,F]),R=r(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[T]),2),_=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[R,F]);function L(t,r){return{interpolation:{pattern:n(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[r,F]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:n(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[P]),lookbehind:!0,greedy:!0,inside:L(P,I)},{pattern:n(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[_]),lookbehind:!0,greedy:!0,inside:L(_,R)}],char:{pattern:RegExp(A),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism)),Prism.languages["visual-basic"]={comment:{pattern:/(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,inside:{keyword:/^REM/i}},directive:{pattern:/#(?:Const|Else|ElseIf|End|ExternalChecksum|ExternalSource|If|Region)(?:\b_[ \t]*(?:\r\n?|\n)|.)+/i,alias:"property",greedy:!0},string:{pattern:/\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,greedy:!0},date:{pattern:/#[ \t]*(?:\d+([/-])\d+\1\d+(?:[ \t]+(?:\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?))?|\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?)[ \t]*#/i,alias:"number"},number:/(?:(?:\b\d+(?:\.\d+)?|\.\d+)(?:E[+-]?\d+)?|&[HO][\dA-F]+)(?:[FRD]|U?[ILS])?/i,boolean:/\b(?:False|Nothing|True)\b/i,keyword:/\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Currency|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|Type|TypeOf|U(?:Integer|Long|Short)|Until|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Xor)\b/i,operator:/[+\-*/\\^<=>&#@$%!]|\b_(?=[ \t]*[\r\n])/,punctuation:/[{}().,:?]/},Prism.languages.vb=Prism.languages["visual-basic"],Prism.languages.vba=Prism.languages["visual-basic"],Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};var ph;ph||(ph=1,function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism)),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift}),function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],i=r.variable[1].inside,a=0;a<o.length;a++)i[o[a]]=e.languages.bash[o[a]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash}(Prism),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(t){["url","bold","italic","strike","code-snippet"].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add("after-tokenize",function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var o=t[n];if("code"===o.type){var i=o.content[1],a=o.content[3];if(i&&a&&"code-language"===i.type&&"code-block"===a.type&&"string"==typeof i.content){var s=i.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),u="language-"+(s=(/[a-z][\w-]*/i.exec(s)||[""])[0].toLowerCase());a.alias?"string"==typeof a.alias?a.alias=[a.alias,u]:a.alias.push(u):a.alias=[u]}}else e(o.content)}}(e.tokens)}),e.hooks.add("wrap",function(t){if("code-block"===t.type){for(var n="",r=0,o=t.classes.length;r<o;r++){var i=t.classes[r],l=/language-(.+)/.exec(i);if(l){n=l[1];break}}var c=e.languages[n];if(c)t.content=e.highlight(function(e){var t=e.replace(a,"");return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),u(n);var r=s[t];return r||e}),t}(t.content),c,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}});var a=RegExp(e.languages.markup.tag.pattern.source,"gi"),s={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/},function(e){var t={pattern:/((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}};e.languages.groovy=e.languages.extend("clike",{string:{pattern:/'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,greedy:!0},keyword:/\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),e.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment",greedy:!0},"interpolation-string":{pattern:/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}}}),e.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:and|cleanup|expect|given|setup|then|when|where):/}),e.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),t.inside.expression.inside=e.languages.groovy}(Prism),Prism.languages.abap={comment:/^\*.*/m,string:/(`|')(?:\\.|(?!\1)[^\\\r\n])*\1/,"string-template":{pattern:/([|}])(?:\\.|[^\\|{\r\n])*(?=[|{])/,lookbehind:!0,alias:"string"},"eol-comment":{pattern:/(^|\s)".*/m,lookbehind:!0,alias:"comment"},keyword:{pattern:/(\s|\.|^)(?:\*-INPUT|\?TO|ABAP-SOURCE|ABBREVIATED|ABS|ABSTRACT|ACCEPT|ACCEPTING|ACCESSPOLICY|ACCORDING|ACOS|ACTIVATION|ACTUAL|ADD|ADD-CORRESPONDING|ADJACENT|AFTER|ALIAS|ALIASES|ALIGN|ALL|ALLOCATE|ALPHA|ANALYSIS|ANALYZER|AND|ANY|APPEND|APPENDAGE|APPENDING|APPLICATION|ARCHIVE|AREA|ARITHMETIC|AS|ASCENDING|ASIN|ASPECT|ASSERT|ASSIGN|ASSIGNED|ASSIGNING|ASSOCIATION|ASYNCHRONOUS|AT|ATAN|ATTRIBUTES|AUTHORITY|AUTHORITY-CHECK|AVG|BACK|BACKGROUND|BACKUP|BACKWARD|BADI|BASE|BEFORE|BEGIN|BETWEEN|BIG|BINARY|BINDING|BIT|BIT-AND|BIT-NOT|BIT-OR|BIT-XOR|BLACK|BLANK|BLANKS|BLOB|BLOCK|BLOCKS|BLUE|BOUND|BOUNDARIES|BOUNDS|BOXED|BREAK-POINT|BT|BUFFER|BY|BYPASSING|BYTE|BYTE-CA|BYTE-CN|BYTE-CO|BYTE-CS|BYTE-NA|BYTE-NS|BYTE-ORDER|C|CA|CALL|CALLING|CASE|CAST|CASTING|CATCH|CEIL|CENTER|CENTERED|CHAIN|CHAIN-INPUT|CHAIN-REQUEST|CHANGE|CHANGING|CHANNELS|CHAR-TO-HEX|CHARACTER|CHARLEN|CHECK|CHECKBOX|CIRCULAR|CI_|CLASS|CLASS-CODING|CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|CLEANUP|CLEAR|CLIENT|CLOB|CLOCK|CLOSE|CN|CNT|CO|COALESCE|CODE|CODING|COLLECT|COLOR|COLUMN|COLUMNS|COL_BACKGROUND|COL_GROUP|COL_HEADING|COL_KEY|COL_NEGATIVE|COL_NORMAL|COL_POSITIVE|COL_TOTAL|COMMENT|COMMENTS|COMMIT|COMMON|COMMUNICATION|COMPARING|COMPONENT|COMPONENTS|COMPRESSION|COMPUTE|CONCAT|CONCATENATE|COND|CONDENSE|CONDITION|CONNECT|CONNECTION|CONSTANTS|CONTEXT|CONTEXTS|CONTINUE|CONTROL|CONTROLS|CONV|CONVERSION|CONVERT|COPIES|COPY|CORRESPONDING|COS|COSH|COUNT|COUNTRY|COVER|CP|CPI|CREATE|CREATING|CRITICAL|CS|CURRENCY|CURRENCY_CONVERSION|CURRENT|CURSOR|CURSOR-SELECTION|CUSTOMER|CUSTOMER-FUNCTION|DANGEROUS|DATA|DATABASE|DATAINFO|DATASET|DATE|DAYLIGHT|DBMAXLEN|DD\/MM\/YY|DD\/MM\/YYYY|DDMMYY|DEALLOCATE|DECIMALS|DECIMAL_SHIFT|DECLARATIONS|DEEP|DEFAULT|DEFERRED|DEFINE|DEFINING|DEFINITION|DELETE|DELETING|DEMAND|DEPARTMENT|DESCENDING|DESCRIBE|DESTINATION|DETAIL|DIALOG|DIRECTORY|DISCONNECT|DISPLAY|DISPLAY-MODE|DISTANCE|DISTINCT|DIV|DIVIDE|DIVIDE-CORRESPONDING|DIVISION|DO|DUMMY|DUPLICATE|DUPLICATES|DURATION|DURING|DYNAMIC|DYNPRO|E|EACH|EDIT|EDITOR-CALL|ELSE|ELSEIF|EMPTY|ENABLED|ENABLING|ENCODING|END|END-ENHANCEMENT-SECTION|END-LINES|END-OF-DEFINITION|END-OF-FILE|END-OF-PAGE|END-OF-SELECTION|ENDAT|ENDCASE|ENDCATCH|ENDCHAIN|ENDCLASS|ENDDO|ENDENHANCEMENT|ENDEXEC|ENDFOR|ENDFORM|ENDFUNCTION|ENDIAN|ENDIF|ENDING|ENDINTERFACE|ENDLOOP|ENDMETHOD|ENDMODULE|ENDON|ENDPROVIDE|ENDSELECT|ENDTRY|ENDWHILE|ENGINEERING|ENHANCEMENT|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|ENHANCEMENTS|ENTRIES|ENTRY|ENVIRONMENT|EQ|EQUAL|EQUIV|ERRORMESSAGE|ERRORS|ESCAPE|ESCAPING|EVENT|EVENTS|EXACT|EXCEPT|EXCEPTION|EXCEPTION-TABLE|EXCEPTIONS|EXCLUDE|EXCLUDING|EXEC|EXECUTE|EXISTS|EXIT|EXIT-COMMAND|EXP|EXPAND|EXPANDING|EXPIRATION|EXPLICIT|EXPONENT|EXPORT|EXPORTING|EXTEND|EXTENDED|EXTENSION|EXTRACT|FAIL|FETCH|FIELD|FIELD-GROUPS|FIELD-SYMBOL|FIELD-SYMBOLS|FIELDS|FILE|FILTER|FILTER-TABLE|FILTERS|FINAL|FIND|FIRST|FIRST-LINE|FIXED-POINT|FKEQ|FKGE|FLOOR|FLUSH|FONT|FOR|FORM|FORMAT|FORWARD|FOUND|FRAC|FRAME|FRAMES|FREE|FRIENDS|FROM|FUNCTION|FUNCTION-POOL|FUNCTIONALITY|FURTHER|GAPS|GE|GENERATE|GET|GIVING|GKEQ|GKGE|GLOBAL|GRANT|GREATER|GREEN|GROUP|GROUPS|GT|HANDLE|HANDLER|HARMLESS|HASHED|HAVING|HDB|HEAD-LINES|HEADER|HEADERS|HEADING|HELP-ID|HELP-REQUEST|HIDE|HIGH|HINT|HOLD|HOTSPOT|I|ICON|ID|IDENTIFICATION|IDENTIFIER|IDS|IF|IGNORE|IGNORING|IMMEDIATELY|IMPLEMENTATION|IMPLEMENTATIONS|IMPLEMENTED|IMPLICIT|IMPORT|IMPORTING|IN|INACTIVE|INCL|INCLUDE|INCLUDES|INCLUDING|INCREMENT|INDEX|INDEX-LINE|INFOTYPES|INHERITING|INIT|INITIAL|INITIALIZATION|INNER|INOUT|INPUT|INSERT|INSTANCES|INTENSIFIED|INTERFACE|INTERFACE-POOL|INTERFACES|INTERNAL|INTERVALS|INTO|INVERSE|INVERTED-DATE|IS|ISO|ITERATOR|ITNO|JOB|JOIN|KEEP|KEEPING|KERNEL|KEY|KEYS|KEYWORDS|KIND|LANGUAGE|LAST|LATE|LAYOUT|LE|LEADING|LEAVE|LEFT|LEFT-JUSTIFIED|LEFTPLUS|LEFTSPACE|LEGACY|LENGTH|LESS|LET|LEVEL|LEVELS|LIKE|LINE|LINE-COUNT|LINE-SELECTION|LINE-SIZE|LINEFEED|LINES|LIST|LIST-PROCESSING|LISTBOX|LITTLE|LLANG|LOAD|LOAD-OF-PROGRAM|LOB|LOCAL|LOCALE|LOCATOR|LOG|LOG-POINT|LOG10|LOGFILE|LOGICAL|LONG|LOOP|LOW|LOWER|LPAD|LPI|LT|M|MAIL|MAIN|MAJOR-ID|MAPPING|MARGIN|MARK|MASK|MATCH|MATCHCODE|MAX|MAXIMUM|MEDIUM|MEMBERS|MEMORY|MESH|MESSAGE|MESSAGE-ID|MESSAGES|MESSAGING|METHOD|METHODS|MIN|MINIMUM|MINOR-ID|MM\/DD\/YY|MM\/DD\/YYYY|MMDDYY|MOD|MODE|MODIF|MODIFIER|MODIFY|MODULE|MOVE|MOVE-CORRESPONDING|MULTIPLY|MULTIPLY-CORRESPONDING|NA|NAME|NAMETAB|NATIVE|NB|NE|NESTED|NESTING|NEW|NEW-LINE|NEW-PAGE|NEW-SECTION|NEXT|NO|NO-DISPLAY|NO-EXTENSION|NO-GAP|NO-GAPS|NO-GROUPING|NO-HEADING|NO-SCROLLING|NO-SIGN|NO-TITLE|NO-TOPOFPAGE|NO-ZERO|NODE|NODES|NON-UNICODE|NON-UNIQUE|NOT|NP|NS|NULL|NUMBER|NUMOFCHAR|O|OBJECT|OBJECTS|OBLIGATORY|OCCURRENCE|OCCURRENCES|OCCURS|OF|OFF|OFFSET|OLE|ON|ONLY|OPEN|OPTION|OPTIONAL|OPTIONS|OR|ORDER|OTHER|OTHERS|OUT|OUTER|OUTPUT|OUTPUT-LENGTH|OVERFLOW|OVERLAY|PACK|PACKAGE|PAD|PADDING|PAGE|PAGES|PARAMETER|PARAMETER-TABLE|PARAMETERS|PART|PARTIALLY|PATTERN|PERCENTAGE|PERFORM|PERFORMING|PERSON|PF|PF-STATUS|PINK|PLACES|POOL|POSITION|POS_HIGH|POS_LOW|PRAGMAS|PRECOMPILED|PREFERRED|PRESERVING|PRIMARY|PRINT|PRINT-CONTROL|PRIORITY|PRIVATE|PROCEDURE|PROCESS|PROGRAM|PROPERTY|PROTECTED|PROVIDE|PUBLIC|PUSHBUTTON|PUT|QUEUE-ONLY|QUICKINFO|RADIOBUTTON|RAISE|RAISING|RANGE|RANGES|RAW|READ|READ-ONLY|READER|RECEIVE|RECEIVED|RECEIVER|RECEIVING|RED|REDEFINITION|REDUCE|REDUCED|REF|REFERENCE|REFRESH|REGEX|REJECT|REMOTE|RENAMING|REPLACE|REPLACEMENT|REPLACING|REPORT|REQUEST|REQUESTED|RESERVE|RESET|RESOLUTION|RESPECTING|RESPONSIBLE|RESULT|RESULTS|RESUMABLE|RESUME|RETRY|RETURN|RETURNCODE|RETURNING|RIGHT|RIGHT-JUSTIFIED|RIGHTPLUS|RIGHTSPACE|RISK|RMC_COMMUNICATION_FAILURE|RMC_INVALID_STATUS|RMC_SYSTEM_FAILURE|ROLE|ROLLBACK|ROUND|ROWS|RTTI|RUN|SAP|SAP-SPOOL|SAVING|SCALE_PRESERVING|SCALE_PRESERVING_SCIENTIFIC|SCAN|SCIENTIFIC|SCIENTIFIC_WITH_LEADING_ZERO|SCREEN|SCROLL|SCROLL-BOUNDARY|SCROLLING|SEARCH|SECONDARY|SECONDS|SECTION|SELECT|SELECT-OPTIONS|SELECTION|SELECTION-SCREEN|SELECTION-SET|SELECTION-SETS|SELECTION-TABLE|SELECTIONS|SELECTOR|SEND|SEPARATE|SEPARATED|SET|SHARED|SHIFT|SHORT|SHORTDUMP-ID|SIGN|SIGN_AS_POSTFIX|SIMPLE|SIN|SINGLE|SINH|SIZE|SKIP|SKIPPING|SMART|SOME|SORT|SORTABLE|SORTED|SOURCE|SPACE|SPECIFIED|SPLIT|SPOOL|SPOTS|SQL|SQLSCRIPT|SQRT|STABLE|STAMP|STANDARD|START-OF-SELECTION|STARTING|STATE|STATEMENT|STATEMENTS|STATIC|STATICS|STATUSINFO|STEP-LOOP|STOP|STRLEN|STRUCTURE|STRUCTURES|STYLE|SUBKEY|SUBMATCHES|SUBMIT|SUBROUTINE|SUBSCREEN|SUBSTRING|SUBTRACT|SUBTRACT-CORRESPONDING|SUFFIX|SUM|SUMMARY|SUMMING|SUPPLIED|SUPPLY|SUPPRESS|SWITCH|SWITCHSTATES|SYMBOL|SYNCPOINTS|SYNTAX|SYNTAX-CHECK|SYNTAX-TRACE|SYSTEM-CALL|SYSTEM-EXCEPTIONS|SYSTEM-EXIT|TAB|TABBED|TABLE|TABLES|TABLEVIEW|TABSTRIP|TAN|TANH|TARGET|TASK|TASKS|TEST|TESTING|TEXT|TEXTPOOL|THEN|THROW|TIME|TIMES|TIMESTAMP|TIMEZONE|TITLE|TITLE-LINES|TITLEBAR|TO|TOKENIZATION|TOKENS|TOP-LINES|TOP-OF-PAGE|TRACE-FILE|TRACE-TABLE|TRAILING|TRANSACTION|TRANSFER|TRANSFORMATION|TRANSLATE|TRANSPORTING|TRMAC|TRUNC|TRUNCATE|TRUNCATION|TRY|TYPE|TYPE-POOL|TYPE-POOLS|TYPES|ULINE|UNASSIGN|UNDER|UNICODE|UNION|UNIQUE|UNIT|UNIT_CONVERSION|UNIX|UNPACK|UNTIL|UNWIND|UP|UPDATE|UPPER|USER|USER-COMMAND|USING|UTF-8|VALID|VALUE|VALUE-REQUEST|VALUES|VARY|VARYING|VERIFICATION-MESSAGE|VERSION|VIA|VIEW|VISIBLE|WAIT|WARNING|WHEN|WHENEVER|WHERE|WHILE|WIDTH|WINDOW|WINDOWS|WITH|WITH-HEADING|WITH-TITLE|WITHOUT|WORD|WORK|WRITE|WRITER|X|XML|XOR|XSD|XSTRLEN|YELLOW|YES|YYMMDD|Z|ZERO|ZONE)(?![\w-])/i,lookbehind:!0},number:/\b\d+\b/,operator:{pattern:/(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/,lookbehind:!0},"string-operator":{pattern:/(\s)&&?(?=\s)/,lookbehind:!0,alias:"keyword"},"token-operator":[{pattern:/(\w)(?:->?|=>|[~|{}])(?=\w)/,lookbehind:!0,alias:"punctuation"},{pattern:/[|{}]/,alias:"punctuation"}],punctuation:/[,.:()]/};var hh=["comment","prolog","doctype","cdata","punctuation","namespace","property","tag","boolean","number","constant","symbol","deleted","selector","attr-name","string","builtin","inserted","operator","entity","url","string","atrule","attr-value","keyword","function","class-name","regex","important","variable","bold","italic","entity","char"];function gh(e){return"string"==typeof e?e.length:"string"==typeof e.content?e.content.length:e.content.reduce(function(e,t){return e+gh(t)},0)}var vh=function(e){var t,n,r,o=f(e,2),i=o[0],a=o[1],s=[],u=function(e){if(!Pn.Text.isText(e))return null;var t=Ei.getParentNode(null,e);if(t&&"code"===Ei.getNodeType(t)){var n=Ei.getParentNode(null,t);if(n&&"pre"===Ei.getNodeType(n))return t}return null}(i);if(null==u)return s;var l=u.language,c=void 0===l?"":l;if(!c)return s;var p=function(e,t){if(!t)return[];var n=ah.languages[t];return n?ah.tokenize(e.text,n):[]}(i,c),h=0;try{for(var g=d(p),v=g.next();!v.done;v=g.next()){var m=v.value,y=h+gh(m);"string"!=typeof m&&s.push(((r={})[m.type]=!0,r.anchor={path:a,offset:h},r.focus={path:a,offset:y},r)),h=y}}catch(e){t={error:e}}finally{try{v&&!v.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}return s};var mh={type:"code",elemToHtml:function(e,t){var n=e.language,r=void 0===n?"":n,o=r?'class="language-'.concat(r,'"'):"";return"<code ".concat(o,">").concat(t,"</code>")}};var yh=function(){function e(){this.title=Ks("highLightModule.selectLang"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M64 64v896h896V64H64z m487.6 698.8c0 87.2-51.2 127-125.8 127-67.4 0-106.4-34.8-126.4-77l68.6-41.4c13.2 23.4 25.2 43.2 54.2 43.2 27.6 0 45.2-10.8 45.2-53V475.4h84.2v287.4z m199.2 127c-78.2 0-128.8-37.2-153.4-86l68.6-39.6c18 29.4 41.6 51.2 83 51.2 34.8 0 57.2-17.4 57.2-41.6 0-28.8-22.8-39-61.4-56l-21-9c-60.8-25.8-101-58.4-101-127 0-63.2 48.2-111.2 123.2-111.2 53.6 0 92 18.6 119.6 67.4L800 580c-14.4-25.8-30-36-54.2-36-24.6 0-40.2 15.6-40.2 36 0 25.2 15.6 35.4 51.8 51.2l21 9c71.6 30.6 111.8 62 111.8 132.4 0 75.6-59.6 117.2-139.4 117.2z"></path></svg>',this.tag="select",this.width=95,this.selectPanelWidth=115,this.defaultCodeLang=""}return e.prototype.getOptions=function(e){var t=this,n=[],r=e.getMenuConfig("codeSelectLang").codeLangs,o=void 0===r?[]:r;n.push({text:"plain text",value:""}),o.forEach(function(e){var r=e.text,o=e.value;e.selected&&(t.defaultCodeLang=o),n.push({text:r,value:o})});var i=this.getValue(e);return n.forEach(function(e){e.value===i?e.selected=!0:e.selected=void 0}),n},e.prototype.isActive=function(e){return!1},e.prototype.getValue=function(e){var t=this.getSelectCodeElem(e);if(null==t)return this.defaultCodeLang;if(!Pn.Element.isElement(t))return this.defaultCodeLang;var n=t.language.toString(),r=e.getMenuConfig("codeSelectLang").codeLangs;return(void 0===r?[]:r).some(function(e){return e.value===n})?n:this.defaultCodeLang},e.prototype.isDisabled=function(e){return null==e.selection||!this.getSelectCodeElem(e)},e.prototype.exec=function(e,t){if(null!=this.getSelectCodeElem(e)){var n={language:t.toString()};Pn.Transforms.setNodes(e,n,{match:function(e){return Ei.checkNodeType(e,"code")}})}},e.prototype.getSelectCodeElem=function(e){var t=Ei.getSelectedNodeByType(e,"code");if(null==t)return null;var n=Ei.getParentNode(e,t);return Pn.Element.isElement(n)?"pre"!==n.type?null:t:null},e}(),bh={key:"codeSelectLang",factory:function(){return new yh},config:{codeLangs:[{text:"CSS",value:"css"},{text:"HTML",value:"html"},{text:"XML",value:"xml"},{text:"Javascript",value:"javascript"},{text:"Typescript",value:"typescript"},{text:"JSX",value:"jsx"},{text:"Go",value:"go"},{text:"PHP",value:"php"},{text:"C",value:"c"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C++",value:"cpp"},{text:"C#",value:"csharp"},{text:"Visual Basic",value:"visual-basic"},{text:"SQL",value:"sql"},{text:"Ruby",value:"ruby"},{text:"Swift",value:"swift"},{text:"Bash",value:"bash"},{text:"Lua",value:"lua"},{text:"Groovy",value:"groovy"},{text:"Markdown",value:"markdown"},{text:"ABAP",value:"abap"}]}};Wr&&(zr.fn.attr=Wr);var Eh={renderStyle:function(e,t){var n=e,r=t,o="";return hh.forEach(function(e){n[e]&&(o=e)}),o&&function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={}),Object.assign(n.props,{className:t})}(r,o="token ".concat(o)),r},parseStyleHtml:function(e,t,n){var r=zr(e);if(!Pn.Element.isElement(t))return t;if("code"!==Ei.getNodeType(t))return t;var o=t,i=r.attr("class")||"";return 0===i.indexOf("language-")?o.language=i.split("-")[1]||"":o.language=i.toLowerCase(),o},menus:[bh],elemsToHtml:[mh]};Gs("en",{listModule:{unOrderedList:"Unordered list",orderedList:"Ordered list",lowerAlphaList:"Ordered list (a,b,c)",numberingActions:"Heading numbering actions",continueNumbering:"Continue heading numbering",restartNumbering:"Restart numbering"}}),Gs("zh-CN",{listModule:{unOrderedList:"无序列表",orderedList:"有序列表",lowerAlphaList:"有序列表(a,b,c)",numberingActions:"标题编号操作",continueNumbering:"继续标题编号",restartNumbering:"重新开始编号"}});var wh=new WeakMap;function Ch(e){var t,n=e.children||[],r=n.length;if(0===r)return"";for(var o=0;o<r&&!t;o+=1){var i=n[o];Pn.Text.isText(i)&&(t=i)}return null==t?"":t.color||""}function Dh(e){return Ei.checkNodeType(e,"list-item")}function Ah(e){return"string"==typeof e&&/^header[1-6]$/.test(e)}function Sh(e){return Dh(e)&&Ah(e.headingType)?e.headingType:null}function xh(e){return Dh(e)&&e.level>0?Math.floor(e.level):0}function Th(e){return Dh(e)&&!0===e.ordered&&"outline"===e.listMode&&Ah(e.headingType)}function Nh(e){var t=Sh(e),n=null==t?null:/^header([1-6])$/.exec(t);return null!=n?Number.parseInt(n[1],10):xh(e)+1}function Oh(e){var t=e.ordered,n=void 0!==t&&t,r=e.start;return!n||"number"!=typeof r||Number.isNaN(r)?1:r}function Bh(e){var t=e.orderType;return"a"===t||"A"===t||"i"===t||"I"===t?t:"1"}function kh(e,t){return e.ordered===t.ordered&&(!e.ordered||Bh(e)===Bh(t)&&Oh(e)===Oh(t))}function Fh(e,t){var n,r,o=Array.from({length:6},function(){return 0});try{for(var i=d(e.children),a=i.next();!a.done;a=i.next()){var s=a.value;if(Th(s)){for(var u=Nh(s),l=u-1,c=0;c<l;c+=1)0===o[c]&&(o[c]=1);"number"==typeof s.listRestart&&s.listRestart>0?o[l]=Math.floor(s.listRestart):0===o[l]?o[l]=1:o[l]+=1;for(var f=l+1;f<o.length;f+=1)o[f]=0;if(s===t){var p=o.slice(0,u).join(".");return 1===u?"".concat(p,"."):p}}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return""}var Ih=new Set;function Ph(e){return(e||"").trim().replace(/\s+/g,"").toLowerCase()}var Rh=new Set(["rgb(0, 0, 0)","rgb(38, 38, 38)","rgb(89, 89, 89)","rgb(140, 140, 140)","rgb(191, 191, 191)","rgb(217, 217, 217)","rgb(233, 233, 233)","rgb(245, 245, 245)","rgb(250, 250, 250)","rgb(255, 255, 255)","rgb(225, 60, 57)","rgb(231, 95, 51)","rgb(235, 144, 58)","rgb(245, 219, 77)","rgb(114, 192, 64)","rgb(89, 191, 192)","rgb(66, 144, 247)","rgb(54, 88, 226)","rgb(106, 57, 201)","rgb(216, 68, 147)","rgb(251, 233, 230)","rgb(252, 237, 225)","rgb(252, 239, 212)","rgb(252, 251, 207)","rgb(231, 246, 213)","rgb(218, 244, 240)","rgb(217, 237, 250)","rgb(224, 232, 250)","rgb(237, 225, 248)","rgb(246, 226, 234)","rgb(255, 163, 158)","rgb(255, 187, 150)","rgb(255, 213, 145)","rgb(255, 251, 143)","rgb(183, 235, 143)","rgb(135, 232, 222)","rgb(145, 213, 255)","rgb(173, 198, 255)","rgb(211, 173, 247)","rgb(255, 173, 210)","rgb(255, 77, 79)","rgb(255, 122, 69)","rgb(255, 169, 64)","rgb(255, 236, 61)","rgb(115, 209, 61)","rgb(54, 207, 201)","rgb(64, 169, 255)","rgb(89, 126, 247)","rgb(146, 84, 222)","rgb(247, 89, 171)","rgb(207, 19, 34)","rgb(212, 56, 13)","rgb(212, 107, 8)","rgb(212, 177, 6)","rgb(56, 158, 13)","rgb(8, 151, 156)","rgb(9, 109, 217)","rgb(29, 57, 196)","rgb(83, 29, 171)","rgb(196, 29, 127)","rgb(130, 0, 20)","rgb(135, 20, 0)","rgb(135, 56, 0)","rgb(97, 71, 0)","rgb(19, 82, 0)","rgb(0, 71, 79)","rgb(0, 58, 140)","rgb(6, 17, 120)","rgb(34, 7, 94)","rgb(120, 6, 80)"].map(function(e){return Ph(e)}));function _h(e){var t=Ph(e);return"w-e-list-color-".concat(function(e){var t,n,r=7;try{for(var o=d(e),i=o.next();!i.done;i=o.next())r=(31*r+(i.value.codePointAt(0)||0))%2147483647}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.toString(36)}("color:".concat(t)))}function Lh(e,t){var n=Ph(t);return!!n&&(!!Rh.has(n)||!!function(e,t){for(var n,r=(null===(n=null==e?void 0:e.getConfig().styleClassTokens)||void 0===n?void 0:n.color)||[],o=Ph(t),i=0;i<r.length;i+=1)if(Ph(r[i])===o)return!0;return!1}(e,t))}function Mh(e,t){if(Lh(e,t))return"class";var n=Vl(e),r="preserve-data";"fallback-inline"===n&&(r="inline"),"strict"===n&&(r="throw");var o="[wangeditor] Unsupported list color class token color=".concat(t,". policy=").concat(n),i="".concat(t,"|").concat(r);if(Ih.has(i)||(Ih.add(i),Wl(e,{type:"color",value:t,scene:"toHtml",fallback:r,message:o})),"throw"===r)throw new Error(o);return"inline"===r?"inline":"preserve-data"}var jh=[],Hh=null,zh=null;function $h(e){return e.ordered?"ol":"ul"}function Uh(e,t,n){if("prev"===n&&0===t)return null;if("next"===n&&t===e.length-1)return null;var r=e["prev"===n?t-1:t+1];return!Ei.checkNodeType(r,"list-item")||Th(r)?null:r}var Vh={type:"list-item",elemToHtml:function(e,t,n){var r="",o="",i=e,a=Sh(i),s=null==a?null:a.replace("header","h");if(Th(i)&&null!=s)return{html:"<".concat(s,">").concat(t,"</").concat(s,">"),prefix:"",suffix:""};null!=s&&(t="<".concat(s,">").concat(t,"</").concat(s,">"));var u=i.level,l=void 0===u?0:u,c=function(e){return e.ordered?"ol":"ul"}(i),d=function(e){var t=e.ordered;if(void 0===t||!t)return"<ul>";var n=[],r=Bh(e),o=Oh(e);return"1"!==r&&n.push('type="'.concat(r,'"')),1!==o&&n.push('start="'.concat(o,'"')),null!=Sh(e)&&n.push('data-w-e-list-mode="standard"'),0===n.length?"<ol>":"<ol ".concat(n.join(" "),">")}(i),f=wh.get(e),p=f&&Array.isArray(f.children)?f:null,h=n&&Array.isArray(n.children)?n:null,g=function(t,n){if(void 0===n&&(n=!1),!t)return null;try{var r=Ei.findPath(t,e),o=1===r.length?t:Pn.Node.get(t,Pn.Path.parent(r)),i=Array.isArray(o.children)?o.children:[],a=r[r.length-1];return i[a]===e?{siblings:i,index:a}:null}catch(r){return n?(zh||(zh=function(e){var t=new WeakMap,n=function(e){e.forEach(function(r,o){Pn.Element.isElement(r)&&(t.set(r,{siblings:e,index:o}),n(r.children))})};return n(e.children),t}(t)),zh.get(e)||null):null}},v=h||p,m=g(h),y=g(p);m?v=h:y&&(v=p);var b=n||f;if(null==v)return{html:"<li>".concat(t,"</li>"),prefix:"",suffix:""};Hh!==v&&(jh.length=0,Hh=v,zh=null);var E=g(v,!0);if(!E)return{html:"<li>".concat(t,"</li>"),prefix:"",suffix:""};var w=E.siblings,C=E.index,D=Uh(w,C,"prev"),A=Uh(w,C,"next"),S=!!A&&(A.level||0)>l;if(D){var x=D.level||0;if(l>x)for(B=0;B<l-x;B+=1)r+=d,jh.push(c);else if(l===x){if(!kh(D,i)){var T=jh.pop()||$h(D);r+="</".concat(T,">").concat(d),jh.push(c)}}else{for(var N=x-l;N>0;){T=jh.pop()||$h(D);r+="</".concat(T,"></li>"),N-=1}var O=function(e,t,n){for(var r=t-1;r>=0;r-=1){var o=e[r];if(Ei.checkNodeType(o,"list-item")&&!Th(o)&&(o.level||0)===n)return o}return null}(w,C,l);if(O&&!kh(O,i)){T=jh.pop()||$h(O);r+="</".concat(T,">").concat(d),jh.push(c)}}}else{jh.length=0;for(var B=0;B<l+1;B+=1)r+=d,jh.push(c)}var k=Ch(e),F=Ul(b),I="",P="",R="";if(k)if("class"===F){R=' data-w-e-color="'.concat(k,'"');var _=Mh(b,k);"class"===_?P=' class="'.concat(_h(k),'"'):"inline"===_&&(I=' style="color:'.concat(k,'"'))}else I=' style="color:'.concat(k,'"');var L="<li".concat(P).concat(R).concat(I,">").concat(t).concat(S?"":"</li>");if(!A){for(;jh.length>0;){var M=jh.pop();if(!M)break;o+="</".concat(M,">"),jh.length>0&&(o+="</li>")}Hh=null,zh=null}return{html:L,prefix:r,suffix:o}}};function Wh(e,t){var n=function(e,t){var n=Fh(e,t).split(".").filter(Boolean).pop(),r=Number.parseInt(n||"",10);return Number.isFinite(r)&&r>0?r:1}(t,e.node),r=1===n?"":' start="'.concat(n,'"');return"<ol".concat(r,' data-w-e-list-mode="outline">')}function Gh(e,t){var n=function(e,t){var n=Ch(e);if(!n)return[];if("class"!==Ul(t))return['style="color:'.concat(n,'"')];var r=['data-w-e-color="'.concat(n,'"')],o=Mh(t,n);return"class"===o?r.unshift('class="'.concat(_h(n),'"')):"inline"===o&&r.push('style="color:'.concat(n,'"')),r}(e,t);return n.push('data-w-e-list-indent="'.concat(Nh(e)-1,'"')),"number"==typeof e.listRestart&&n.push('data-w-e-list-restart="'.concat(e.listRestart,'"')),n.push('data-w-e-outline-number="'.concat(Fh(t,e),'"')),"<li ".concat(n.join(" "),">")}function qh(e,t){var n=e.items.map(function(e){var n=e.children.map(function(e){return qh(e,t)}).join("");return"".concat(Gh(e.node,t)).concat(e.html).concat(n,"</li>")}).join("");return"".concat(Wh(e,t)).concat(n,"</ol>")}var Kh='<svg viewBox="0 0 1024 1024"><path d="M384 832h640v128H384z m0-384h640v128H384z m0-384h640v128H384zM192 0v256H128V64H64V0zM128 526.016v50.016h128v64H64v-146.016l128-60V384H64v-64h192v146.016zM256 704v320H64v-64h128v-64H64v-64h128v-64H64v-64z"></path></svg>';function Yh(e){return null==e.selection?[]:Array.from(Pn.Editor.nodes(e,{at:e.selection,match:function(t){return Pn.Element.isElement(t)&&Pn.Editor.isBlock(e,t)},mode:"lowest"})).filter(function(e){var t=f(e,1)[0];return!["table","table-row","table-cell"].includes(t.type)})}function Xh(e){return Number.parseInt(e.slice(6),10)-1}var Zh=function(){function e(){this.type="list-item",this.tag="button"}return e.prototype.isTargetListNode=function(e){return!(!Dh(e)||Boolean(e.ordered)!==this.ordered)&&(!this.ordered||Bh(e)===(this.orderType||"1"))},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){var t=this,n=Yh(e);return n.length>0&&n.every(function(e){var n=f(e,1)[0];return t.isTargetListNode(n)})},e.prototype.isDisabled=function(e){var t=Yh(e);return 0===t.length||t.some(function(t){var n=f(t,1)[0];return!function(e,t){return!Pn.Editor.isVoid(e,t)&&!["pre","code","table","table-row","table-cell"].includes(t.type)}(e,n)})},e.prototype.exec=function(e,t){var n=this,r=this.isActive(e),o=Yh(e);0!==o.length&&Pn.Editor.withoutNormalizing(e,function(){o.forEach(function(t){var o=f(t,2),i=o[0],a=o[1];if(r){var s=Sh(i);Pn.Transforms.setNodes(e,{type:s||"paragraph",ordered:void 0,level:void 0,start:void 0,orderType:void 0,headingType:void 0,listMode:void 0,listRestart:void 0},{at:a})}else{var u=function(e){return Dh(e)?Sh(e):Ah(e.type)?e.type:null}(i),l=n.ordered&&null==n.orderType&&null!=u;Pn.Transforms.setNodes(e,{type:"list-item",ordered:n.ordered,level:l?Xh(u):xh(i),start:void 0,orderType:n.ordered?n.orderType:void 0,headingType:l?u:void 0,listMode:l?"outline":void 0,listRestart:void 0},{at:a})}})})},e}(),Jh=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.ordered=!1,t.title=Ks("listModule.unOrderedList"),t.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M384 64h640v128H384V64z m0 384h640v128H384v-128z m0 384h640v128H384v-128zM0 128a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z"></path></svg>',t}return s(t,e),t}(Zh),Qh=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.ordered=!0,t.orderType="a",t.title=Ks("listModule.lowerAlphaList"),t.iconSvg=Kh,t}return s(t,e),t}(Zh),eg=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.ordered=!0,t.title=Ks("listModule.orderedList"),t.iconSvg=Kh,t}return s(t,e),t}(Zh),tg={key:"bulletedList",factory:function(){return new Jh}},ng={key:"numberedList",factory:function(){return new eg}},rg={key:"numberedListLowerAlpha",factory:function(){return new Qh}},og=globalThis.Node;function ig(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==og.ELEMENT_NODE?"":t.tagName.toLowerCase()}function ag(e){return"ol"===ig(e.parent())}function sg(e){var t=e.parent();if("ol"===ig(t)){var n=(t.attr("start")||"").trim(),r=Number.parseInt(n,10);return Number.isNaN(r)?void 0:r}}function ug(e){var t=function(e){var t=(e.attr("data-w-e-list-restart")||"").trim();if(/^\d+$/.test(t)){var n=Number.parseInt(t,10);return n>0?n:void 0}}(e);return void 0!==t?t:null==e.attr("data-w-e-outline-number")&&function(e){for(var t,n=null===(t=e[0])||void 0===t?void 0:t.previousElementSibling;null!=n;){if("li"===n.tagName.toLowerCase())return!1;n=n.previousElementSibling}return!0}(e)?sg(e):void 0}function lg(e){return Pn.Text.isText(e)&&""===e.text.trim()}function cg(e,t,n){t.forEach(function(t){lg(t)||(Pn.Text.isText(t)||n.isInline(t)?e.push(t):Pn.Element.isElement(t)&&cg(e,t.children,n))})}lo&&(zr.fn.append=lo),Wr&&(zr.fn.attr=Wr),fo&&(zr.fn.parent=fo);var dg={selector:"li:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=zr(e),o=function(e){var t=(e.attr("data-w-e-list-indent")||"").trim();if(/^\d+$/.test(t))return Number.parseInt(t,10);for(var n=0,r=e.parent();r.length>0;){var o=ig(r);"ul"!==o&&"ol"!==o||(n+=1),r=r.parent()}return Math.max(0,n-1)}(r),i=[],a=[];t.forEach(function(e){lg(e)||(Dh(e)&&e.level>o?a.push(e):i.push(e))});var s=function(e){var t,n;try{for(var r=d(e),o=r.next();!o.done;o=r.next()){var i=o.value;if(Pn.Element.isElement(i)&&Ah(i.type))return i}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return null}(i),l=null!=s&&Ah(s.type)?s.type:void 0,c=function(e,t){var n=e.parent().attr("data-w-e-list-mode");return"outline"===n||"standard"===n?n:ag(e)&&t.some(function(e){return Pn.Element.isElement(e)&&Ah(e.type)})?"outline":"standard"}(r,i),h=[];cg(h,i,n),0===h.length&&h.push(a.length>0?{text:""}:{text:r.text().replace(/\s+/gm," ")});var g=ag(r),v=sg(r),m=function(e){var t=e.parent();if("ol"===ig(t)){var n=(t.attr("type")||"").trim();return"1"===n||"a"===n||"A"===n||"i"===n||"I"===n?n:void 0}}(r),y=g&&"outline"===c&&void 0!==l,b=y?ug(r):void 0,E=u(u(u(u(u(u({type:"list-item",ordered:g,level:y?Number.parseInt(l.slice(6),10)-1:o},void 0===v||y?{}:{start:v}),void 0!==m?{orderType:m}:{}),void 0!==l?{headingType:l}:{}),y?{listMode:"outline"}:{}),void 0!==b?{listRestart:b}:{}),{children:h});return 0===a.length?E:p([E],f(a),!1)}};var fg={selector:"ul:not([data-w-e-type]),ol:not([data-w-e-type])",parseElemHtml:function(e,t,n){return t.flat(1/0)}};function pg(e){var t=f(Pn.Editor.nodes(e,{at:e.selection||void 0,match:Dh,universal:!0}),1)[0];return null==t?null:t}function hg(e,t,n,r){Pn.Transforms.setNodes(e,{type:r||Sh(n)||"paragraph",ordered:void 0,level:void 0,start:void 0,orderType:void 0,headingType:void 0,listMode:void 0,listRestart:void 0},{at:t})}var gg=new WeakMap;function vg(e,t,n){var r=e.children.indexOf(t);r<0||Pn.Transforms.setNodes(e,{listRestart:n},{at:[r]})}function mg(e){var t=gg.get(e);null!=t&&(t.dispose(),gg.delete(e))}function yg(e,t,n){var r=e.createElement("button");return r.type="button",r.className="w-e-list-outline-action",r.textContent=t,r.addEventListener("mousedown",function(e){return e.preventDefault()}),r.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),n()}),r}function bg(e,t,n){if(!e.isDisabled()){mg(e);var r=n.ownerDocument,o=r.createElement("div");o.className="w-e-list-outline-actions",o.setAttribute("role","menu"),o.addEventListener("mousedown",function(e){return e.preventDefault()}),o.append(yg(r,Ks("listModule.continueNumbering"),function(){!function(e,t){vg(e,t)}(e,t),mg(e)}),yg(r,Ks("listModule.restartNumbering"),function(){!function(e,t){vg(e,t,1)}(e,t),mg(e)}));var i=Ei.getTextarea(e),a=i.$textAreaContainer[0],s=i.$scroll[0],u=n.getBoundingClientRect(),l=a.getBoundingClientRect();o.style.top="".concat(u.bottom-l.top+s.scrollTop+4,"px"),o.style.left="".concat(u.left-l.left+s.scrollLeft,"px"),a.append(o);var c=function(t){var r=t.target;r instanceof Node&&(o.contains(r)||n.contains(r)||mg(e))},d=function(){return mg(e)},f=function(){return mg(e)};r.addEventListener("mousedown",c,!0),e.on(Gn,d),e.on(Wn,f),gg.set(e,{elem:o,dispose:function(){r.removeEventListener("mousedown",c,!0),e.off(Gn,d),e.off(Wn,f),o.remove()}})}}function Eg(e,t){if(void 0===t&&(t=!1),e<=0)return String(e);for(var n=e,r="";n>0;){var o=(t?65:97)+(n-1)%26;r=String.fromCharCode(o)+r,n=Math.floor((n-1)/26)}return r}function wg(e,t){var n,r;if(void 0===t&&(t=!1),e<=0||e>=4e3)return String(e);var o=e,i="";try{for(var a=d([[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]]),s=a.next();!s.done;s=a.next())for(var u=f(s.value,2),l=u[0],c=u[1];o>=l;)i+=c,o-=l}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return t?i:i.toLowerCase()}var Cg={type:"list-item",renderElem:function(e,t,n){wh.set(e,n);var r=e,o=Th(r),i=xh(r),a={margin:"5px 0 5px ".concat(20*i,"px"),display:"flex",alignItems:"baseline"},s=Ch(r),u="";u=o?Fh(n,r):r.ordered?function(e,t){switch(t){case"a":return"".concat(Eg(e),".");case"A":return"".concat(Eg(e,!0),".");case"i":return"".concat(wg(e),".");case"I":return"".concat(wg(e,!0),".");default:return"".concat(e,".")}}(function(e,t){if(!t.ordered)return 1;var n=xh(t),r=Oh(t),o=Ei.findPath(e,t),i=o.length>1?Pn.Node.get(e,o.slice(0,-1)):e,a=Array.isArray(i.children)?i.children:[],s=o[o.length-1];if(s<=0)return r;for(var u=s-1;u>=0;u-=1){var l=a[u];if(!Dh(l))break;var c=xh(l);if(c<n)break;if(c===n){if(!kh(l,t)||Th(l))break;r+=1}}return r}(n,r),Bh(r)):function(e){switch(void 0===e&&(e=0),e){case 0:return"•";case 1:return"◦";default:return"▪"}}(i);var l={marginRight:"0.5em",color:s},c=o?wl("button",{type:"button",className:"w-e-list-marker",contentEditable:!1,"data-w-e-reserve":!0,"aria-label":Ks("listModule.numberingActions"),title:Ks("listModule.numberingActions"),style:l,on:{mousedown:function(e){return e.preventDefault()},click:function(e){e.preventDefault(),e.stopPropagation(),e.currentTarget instanceof HTMLElement&&bg(n,r,e.currentTarget)}}},u):wl("span",{className:"w-e-list-marker",contentEditable:!1,style:l,"data-w-e-reserve":!0},u),d=Sh(r);return wl("div",{className:"w-e-list-item",style:a},c,wl(null==d?"span":d.replace("header","h"),{style:{flex:"1",minWidth:"0",wordBreak:"break-word"}},t))}},Dg={renderElems:[Cg],editorPlugin:function(e){var t=e.deleteBackward,n=e.handleTab,r=e.normalizeNode,o=e.insertBreak,i=e;return i.insertBreak=function(){var e=pg(i);if(null==e)return o();var t=f(e,2),n=t[0],r=t[1];if(""!==Pn.Node.string(n))return o();hg(i,r,n,"paragraph")},i.deleteBackward=function(n){var r=i.selection;if(null==r||Pn.Range.isExpanded(r))t(n);else{var o=pg(i);if(null!=o&&0===r.focus.offset){var a=f(o,2),s=a[0],u=a[1];if(Th(s))hg(i,u,s);else{var l=xh(s);if(l<=0)hg(i,u,s);else{var c=function(e,t,n){for(var r=void 0!==n?n:t.level||0,o=Ei.findPath(e,t);;){if(0===o.length||0===o[o.length-1])return null;o=Pn.Path.previous(o);var i=Pn.Editor.node(e,o);if(null==i||!Dh(i[0]))return null;if(xh(i[0])===r)return i[0]}}(e,s,l-1);null!=c?Pn.Transforms.setNodes(i,{level:l-1,ordered:c.ordered,start:c.ordered?c.start:void 0,orderType:c.ordered?c.orderType:void 0},{at:u}):Pn.Transforms.setNodes(i,{level:l-1},{at:u})}}}else t(n)}},i.handleTab=function(){var e=i.selection;if(null!=e)if(Pn.Range.isCollapsed(e)){var t=pg(i);if(null==t||Th(t[0])||0!==e.focus.offset)return void n();var r=f(t,2),o=r[0],a=r[1];Pn.Transforms.setNodes(i,{level:xh(o)+1},{at:a})}else{var s=function(e){return Array.from(Pn.Editor.nodes(e,{at:e.selection||void 0,match:function(t){return Pn.Element.isElement(t)&&Pn.Editor.isBlock(e,t)},mode:"lowest"})).filter(function(e){var t=f(e,1)[0];return!["table","table-row","table-cell"].includes(t.type)})}(i),u=s.filter(function(e){var t=f(e,1)[0];return Dh(t)&&!Th(t)});u.length!==s.length||u.length<=1?n():u.forEach(function(e){var t=f(e,2),n=t[0],r=t[1];Pn.Transforms.setNodes(i,{level:xh(n)+1},{at:r})})}else n()},i.normalizeNode=function(e){var t=f(e,2),n=t[0],o=t[1],a=Ei.getNodeType(n);return"bulleted-list"!==a&&"numbered-list"!==a||Pn.Transforms.unwrapNodes(i,{at:o}),r([n,o])},i},menus:[tg,ng,rg],htmlTransform:function(e,t,n){var r=[],o=null,i=function(){null!=o&&0!==o.roots.length&&(r.push(o.roots.map(function(e){return qh(e,n)}).join("")),o=null)};return t.forEach(function(t,n){var a=e[n]||"";if(Th(t))return null==o&&(o={roots:[],levels:[]}),void function(e,t,n,r){var o,i=Math.max(0,Nh(n)-1);i>t.length&&(i=t.length),t.length=i+1;var a,s=i>0?null===(o=t[i-1])||void 0===o?void 0:o.lastItem:null,u=t[i],l="number"==typeof n.listRestart;null==u||!kh(u.container.node,n)||l?(a={node:n,items:[]},null!=s?s.children.push(a):e.push(a)):a=u.container;var c={node:n,html:r,children:[]};a.items.push(c),t[i]={container:a,lastItem:c}}(o.roots,o.levels,t,a);i(),r.push(a)}),i(),r},elemsToHtml:[Vh],parseElemsHtml:[fg,dg]};Gs("en",{tableModule:{modal:{border:"Border",borderColor:"Border color",borderStyle:"Border style",borderWidth:"Border width",borderWidthDefault:"Default 1",bgColor:"Back color",align:"Text Align",verticalAlign:"Vertical Align",width:"Width mode",widthAuto:"Auto",widthFull:"Full",mixed:"Mixed",ok:"OK"},color:{default:"Default color",clear:"Clear back color"},borderStyle:{none:"None",solid:"Solid",dotted:"Dotted",dashed:"Dashed",double:"Double",groove:"Groove",ridge:"Ridge",inset:"Inset",outset:"Outset"},verticalAlign:{top:"Top",middle:"Middle",bottom:"Bottom"},deleteCol:"Delete column",deleteRow:"Delete row",deleteTable:"Delete table",widthAuto:"Fit width",insertCol:"Insert column",insertRow:"Insert row",insertTable:"Insert table",header:"Header",mergeCell:"merge cell",splitCell:"split cell",tableProperty:"Table property",cellProperty:"Cell property"}}),Gs("zh-CN",{tableModule:{modal:{border:"边框",borderColor:"边框颜色",borderStyle:"边框样式",borderWidth:"边框粗细",borderWidthDefault:"默认 1",bgColor:"背景色",align:"对齐方式",verticalAlign:"垂直对齐",width:"宽度模式",widthAuto:"自适应",widthFull:"撑满",mixed:"混合",ok:"确定"},color:{default:"默认颜色",clear:"清除背景色"},borderStyle:{none:"无样式",solid:"实线",dotted:"点状虚线",dashed:"虚线",double:"双线",groove:"凹槽边框",ridge:"菱形边框",inset:"凹边框",outset:"凸边框"},verticalAlign:{top:"上",middle:"中",bottom:"下"},deleteCol:"删除列",deleteRow:"删除行",deleteTable:"删除表格",widthAuto:"适应宽度",insertCol:"插入列",insertRow:"插入行",insertTable:"插入表格",header:"表头",mergeCell:"合并单元格",splitCell:"拆分单元格",tableProperty:"表格属性",cellProperty:"单元格属性"}});var Ag=/^-?(?:\d+|\d*\.\d+)(?:px|em|rem|%|vh|vw|vmin|vmax|pt|pc|cm|mm|in|ch|ex|lh|rlh)$/i;var Sg={type:"table",elemToHtml:function(e,t,n){var r=e,o=r.columnWidths,i=r.caption,a=r.height,s=void 0===a?"auto":a,u=null==o?void 0:o.map(function(e){return"<col width=".concat(e,"></col>")}).join(""),l=i?"<caption>".concat(i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</caption>"):"",c=u?'<colgroup contentEditable="false">'.concat(u,"</colgroup>"):"",d=function(e,t){var n=e.width,r=void 0===n?"auto":n,o=e.columnWidths,i=void 0===o?[]:o;if(r&&"auto"!==r)return r;var a=function(e){if(!e||"function"!=typeof e.getMenuConfig)return"explicit";var t=e.getMenuConfig("insertTable");return"explicit"===(null==t?void 0:t.widthExportMode)?"explicit":"adaptive"}(t);if("adaptive"===a)return"auto";var s=i.reduce(function(e,t){return Number.isFinite(t)?t<=0?e:e+t:e},0);return s>0?"".concat(s,"px"):"auto"}(r,n),f=Ul(n),p=function(e){void 0===e&&(e="auto");var t="".concat(e||"").trim();if(!t||"auto"===t)return"auto";var n=Number(t);return Number.isFinite(n)?"".concat(n,"px"):Ag.test(t)?t:"auto"}(s);if("class"===f){var h=d?' width="'.concat(d,'"'):"",g="auto"!==p?' height="'.concat(p,'"'):"",v=' data-w-e-table-height="'.concat(p,'"');return'<table class="w-e-table-layout-fixed"'.concat(h).concat(g).concat(v,">").concat(l).concat(c,"<tbody>").concat(t,"</tbody></table>")}return'<table style="width: '.concat(d,";table-layout: fixed;height:").concat(p,'">').concat(l).concat(c,"<tbody>").concat(t,"</tbody></table>")}},xg={type:"table-row",elemToHtml:function(e,t,n){var r=e.height;if("class"===Ul(n))return r?'<tr height="'.concat(r,'" data-w-e-row-height="').concat(r,'px">').concat(t,"</tr>"):"<tr>".concat(t,"</tr>");var o=r?' style="height: '.concat(r,'px"'):"";return"<tr".concat(o,">").concat(t,"</tr>")}},Tg={type:"table-cell",elemToHtml:function(e,t){var n=e,r=n.colSpan,o=void 0===r?1:r,i=n.rowSpan,a=void 0===i?1:i,s=n.isHeader,u=void 0!==s&&s,l=n.width,c=void 0===l?"auto":l,d=n.hidden;if(void 0!==d&&d)return"";var f=u?"th":"td";return"<".concat(f,' colSpan="').concat(o,'" rowSpan="').concat(a,'" width="').concat(c,'">').concat(t,"</").concat(f,">")}},Ng='<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>',Og={blocks:{td:"table-cell",th:"table-cell",content:"paragraph",tr:"table-row",table:"table",tbody:"table-body"}};function Bg(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Og,o=t.map(function(e){var t;return null===(t=null==r?void 0:r.blocks)||void 0===t?void 0:t[e]});return function(e){return function(e){return!Pn.Editor.isEditor(e)&&Pn.Element.isElement(e)&&"type"in e}(e)&&o.includes(e.type)}}function kg(e,t){for(var n=f(t,2),r=n[0],o=n[1],i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var s=f(Pn.Node.common(e,r,o),2),u=s[0],l=s[1];return!!Bg.apply(void 0,p([e],f(i),!1))(u,l)||!!Pn.Editor.above(e,{match:Bg.apply(void 0,p([e],f(i),!1)),at:l})}function Fg(e,t){var n,r;void 0===t&&(t={});var o=[];try{for(var i=d(function(e,t){var n,r,o,i,a,s,u,l,h,g,v,m,y,b,E,w,C,D;return void 0===t&&(t={}),c(this,function(c){switch(c.label){case 0:if(n=f(Pn.Editor.nodes(e,{match:Bg(e,"table"),at:t.at}),1),!(r=n[0]))return[2,[]];o=f(r,2),i=o[1],c.label=1;case 1:c.trys.push([1,6,7,8]),a=d(Pn.Editor.nodes(e,{match:Bg(e,"table"),at:i})),s=a.next(),c.label=2;case 2:if(s.done)return[3,5];u=f(s.value,2),l=u[1],h=[];try{for(C=void 0,g=d(Pn.Editor.nodes(e,{match:Bg(e,"tr"),at:l})),v=g.next();!v.done;v=g.next())m=f(v.value,2),y=m[1],h.push(p([],f(Pn.Editor.nodes(e,{match:Bg(e,"th","td"),at:y})),!1))}catch(e){C={error:e}}finally{try{v&&!v.done&&(D=g.return)&&D.call(g)}finally{if(C)throw C.error}}return[4,h];case 3:c.sent(),c.label=4;case 4:return s=a.next(),[3,2];case 5:return[3,8];case 6:return b=c.sent(),E={error:b},[3,8];case 7:try{s&&!s.done&&(w=a.return)&&w.call(a)}finally{if(E)throw E.error}return[7];case 8:return[2]}})}(e,{at:t.at})),a=i.next();!a.done;a=i.next()){for(var s=a.value,u=[],l=0,h=0;h<s.length;h+=1)s[h]&&(l=Math.max(l,s[h].length));for(h=0;h<s.length;h+=1)if(u[h]||(u[h]=[]),s[h])for(var g=0;g<s[h].length;g+=1)if(s[h][g]&&s[h][g][0]){for(var v=f(s[h][g],1)[0],m=v.rowSpan,y=void 0===m?1:m,b=v.colSpan,E=void 0===b?1:b,w=g;u[h]&&u[h][w];)w+=1;for(var C=0;C<E;C+=1)for(var D=0;D<y;D+=1){var A=h+D,S=w+C;u[A]||(u[A]=[]),u[A][S]||(u[A][S]=[s[h][g],{rtl:C+1,ltr:E-C,ttb:D+1,btt:y-D}])}}o.push.apply(o,p([],f(u),!1))}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}var Ig=function(){function e(e,t){this.x=e,this.y=t}return e.valueOf=function(e,t){return new this(e,t)},e.equals=function(e,t){return e.x===t.x&&e.y===t.y},e}();function Pg(e){return e.length?e[0].tagName.toLowerCase():""}function Rg(e,t){for(var n="",r=(e.attr("style")||"").split(";"),o=r.length,i=0;i<o;i+=1){var a=r[i];if(a){var s=a.split(":");s[0].trim()===t&&(n=s[1].trim())}}return n}function _g(e){return 0===e.length?"":e[0].outerHTML}lo&&zr.fn&&(zr.fn.append=lo),Xr&&zr.fn&&(zr.fn.on=Xr),wo&&zr.fn&&(zr.fn.focus=wo),Wr&&zr.fn&&(zr.fn.attr=Wr),Yr&&zr.fn&&(zr.fn.val=Yr),ao&&zr.fn&&(zr.fn.html=ao),Kr&&zr.fn&&(zr.fn.dataset=Kr),$r&&zr.fn&&(zr.fn.addClass=$r),Ur&&zr.fn&&(zr.fn.removeClass=Ur),go&&zr.fn&&(zr.fn.children=go),oo&&zr.fn&&(zr.fn.each=oo),ho&&zr.fn&&(zr.fn.find=ho),qr&&zr.fn&&(zr.fn.data=qr),to&&zr.fn&&(zr.fn.hide=to),no&&zr.fn&&(zr.fn.show=no);var Lg=new WeakMap,Mg=new WeakMap;function jg(e,t,n){void 0===t&&(t={}),void 0===n&&(n=[]);var r=document.createElement(e);return Object.entries(t).forEach(function(e){var t=f(e,2),n=t[0],o=t[1];null!=o&&!1!==o&&(!0!==o?r.setAttribute(n,o):r.setAttribute(n,""))}),n.forEach(function(e){r.append("string"==typeof e?document.createTextNode(e):e)}),r}function Hg(e){return e instanceof KeyboardEvent?e:null}function zg(e){return"Enter"===e.key||" "===e.key}var $g=function(){function e(){this.title=Ks("tableModule.tableProperty"),this.iconSvg='<svg viewBox="0 0 20 20"><path d="M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z"/></svg>',this.tag="button",this.showModal=!0,this.modalWidth=340,this.menu="table",this.propertyFields=["borderStyle","borderColor","borderWidth","backgroundColor"],this.borderStyle=[{value:"none",label:Ks("tableModule.borderStyle.none")},{value:"solid",label:Ks("tableModule.borderStyle.solid")},{value:"dotted",label:Ks("tableModule.borderStyle.dotted")},{value:"dashed",label:Ks("tableModule.borderStyle.dashed")},{value:"double",label:Ks("tableModule.borderStyle.double")},{value:"groove",label:Ks("tableModule.borderStyle.groove")},{value:"ridge",label:Ks("tableModule.borderStyle.ridge")},{value:"inset",label:Ks("tableModule.borderStyle.inset")},{value:"outset",label:Ks("tableModule.borderStyle.outset")}],this.textAlignOptions=[{value:"left",label:Ks("justify.left"),svg:'<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>'},{value:"center",label:Ks("justify.center"),svg:'<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>'},{value:"right",label:Ks("justify.right"),svg:'<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>'},{value:"justify",label:Ks("justify.justify"),svg:'<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>'}],this.verticalAlignOptions=[{value:"top",label:Ks("tableModule.verticalAlign.top")},{value:"middle",label:Ks("tableModule.verticalAlign.middle")},{value:"bottom",label:Ks("tableModule.verticalAlign.bottom")}]}return e.prototype.renderRow=function(e,t,n){void 0===n&&(n="div");var r=jg(n,{class:"babel-container w-e-table-property-row"}),o=jg("span",{class:"w-e-table-property-label"},[e]);return r.append(o,t),r},e.prototype.createFieldControl=function(e,t,n){return{field:e,root:t,input:n,setValue:function(e,t){void 0===t&&(t=!1),n.value=e||"",n.setAttribute("data-mixed",t?"true":"false")},getValue:function(){return n.value},setMixed:function(e){n.setAttribute("data-mixed",e?"true":"false")}}},e.prototype.renderSelect=function(e,t,n){var r=jg("input",{name:e,type:"hidden"}),o=jg("span",{class:"w-e-table-property-select-value"}),i=jg("button",{type:"button",class:"w-e-table-property-select-trigger","aria-label":t,"aria-haspopup":"listbox","aria-expanded":"false"},[o]),a=jg("span",{class:"w-e-table-property-select-panel",role:"listbox"});n.forEach(function(t){a.append(jg("button",{type:"button",class:"w-e-table-property-select-option","data-select-option-field":e,"data-value":t.value,role:"option"},[t.label]))});var s=jg("span",{class:"w-e-table-property-select","data-select-field":e},[i,a]),u=jg("span",{class:"babel-container-select w-e-table-property-controls"},[r,s]),l=this.renderRow(t,u),c=this.createFieldControl(e,l,r);return c.setValue=function(t,i){void 0===i&&(i=!1);var u="borderStyle"!==e||t?t:"none",l=n.find(function(e){return e.value===u}),c=i?Ks("tableModule.modal.mixed"):(null==l?void 0:l.label)||"";r.value=u||"",r.setAttribute("data-mixed",i?"true":"false"),s.setAttribute("data-mixed",i?"true":"false"),o.textContent=c,Array.from(a.querySelectorAll(".w-e-table-property-select-option")).forEach(function(e){var t=!i&&e.dataset.value===u;e.classList.toggle("active",t),e.setAttribute("aria-selected",t?"true":"false")})},c.setMixed=function(e){r.setAttribute("data-mixed",e?"true":"false"),s.setAttribute("data-mixed",e?"true":"false"),e&&(o.textContent=Ks("tableModule.modal.mixed"))},c},e.prototype.renderNumber=function(e,t){var n=jg("input",{name:e,type:"number",min:"0",placeholder:Ks("tableModule.modal.borderWidthDefault"),"aria-label":t}),r=jg("span",{class:"w-e-table-property-number"},[n,jg("span",{class:"w-e-table-property-unit"},["px"])]),o=jg("span",{class:"babel-container-number w-e-table-property-controls"},[r]);return this.createFieldControl(e,this.renderRow(t,o,"label"),n)},e.prototype.renderColor=function(e,t,n,r){var o=jg("span",{class:"color-group-block"}),i=jg("span",{class:"color-group-label"},[r]),a=jg("input",{name:e,type:"hidden"}),s=jg("span",{class:"color-group color-group-wide","data-mark":t,title:n,role:"button",tabindex:"0"},[o,i,a]),u=jg("span",{class:"babel-container-color w-e-table-property-controls"},[s]),l=this.renderRow(n,u),c=this.createFieldControl(e,l,a);return c.setValue=function(e,t){void 0===t&&(t=!1),a.value=e||"",a.setAttribute("data-mixed",t?"true":"false"),s.setAttribute("data-mixed",t?"true":"false"),e?(o.style.backgroundColor=e,o.innerHTML="",i.textContent=e,s.classList.remove("is-empty")):(o.style.backgroundColor="",o.innerHTML=Ng,i.textContent=r,s.classList.add("is-empty")),s.setAttribute("data-empty",e?"false":"true")},c.setMixed=function(e){a.setAttribute("data-mixed",e?"true":"false"),s.setAttribute("data-mixed",e?"true":"false")},c},e.prototype.renderSegment=function(e,t,n,r){void 0===r&&(r=!1);var o=jg("input",{name:e,type:"hidden"}),i=jg("span",{class:"w-e-table-property-segment".concat(r?" w-e-table-property-segment-fill":"")});n.forEach(function(t){var n=jg("button",{type:"button",class:"w-e-table-property-segment-button".concat(t.svg?" w-e-table-property-align-button":""),"data-field":e,"data-value":t.value,title:t.label,"aria-label":t.label});t.svg?n.innerHTML=t.svg:n.textContent=t.label,i.append(n)});var a=jg("span",{class:"babel-container-align w-e-table-property-controls"},[o,i]),s=this.renderRow(t,a),u=this.createFieldControl(e,s,o);return u.setValue=function(e,t){void 0===t&&(t=!1),o.value=e||"",o.setAttribute("data-mixed",t?"true":"false"),Array.from(i.querySelectorAll("[data-field]")).forEach(function(n){var r=!t&&n.dataset.value===e;n.classList.toggle("active",r),n.setAttribute("aria-pressed",r?"true":"false")})},u},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==this.getModalContentNode(e)},e.prototype.exec=function(e,t){},e.prototype.getModalContentNode=function(e){return f(Pn.Editor.nodes(e,{match:Bg(e,"table")}),1)[0]},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t,n=this,r=this.getModalContentNode(e);if(!r)return null;var o=f(r,2),i=o[0],a=o[1],s=this.propertyFields,u=function(e){return s.includes(e)},l="cell"===this.menu,c=[this.renderSelect("borderStyle",Ks("tableModule.modal.borderStyle"),this.borderStyle),this.renderColor("borderColor","color",Ks("tableModule.modal.borderColor"),Ks("tableModule.color.default")),this.renderNumber("borderWidth",Ks("tableModule.modal.borderWidth")),this.renderColor("backgroundColor","bgColor",Ks("tableModule.modal.bgColor"),Ks("tableModule.color.clear"))],d=jg("div",{class:"w-e-table-property-modal"},c.map(function(e){return e.root}));if(u("textAlign")){var p=this.renderSegment("textAlign",Ks("tableModule.modal.align"),this.textAlignOptions);c.push(p),d.append(p.root)}if(u("verticalAlign")){p=this.renderSegment("verticalAlign",Ks("tableModule.modal.verticalAlign"),this.verticalAlignOptions);c.push(p),d.append(p.root)}d.append(jg("div",{class:"button-container"},[jg("button",{type:"button"},[Ks("tableModule.modal.ok")])]));var h=zr(d),g=new Map;c.forEach(function(e){g.set(e.field,e)});var v=new Set,m=function(){h.find(".w-e-table-property-select-panel").hide(),h.find(".w-e-table-property-select-trigger").attr("aria-expanded","false")};h.on("mousedown",function(e){var t=e.target;t instanceof Element&&(t.closest(".w-e-table-property-select")||m())});var y=function(e){null!=e&&s.includes(e)&&v.add(e)},b=function(e,t,n){var r;void 0===n&&(n=!1),null===(r=g.get(e))||void 0===r||r.setValue(t,n)},E=function(e){var t;return(null===(t=g.get(e))||void 0===t?void 0:t.getValue())||""};g.forEach(function(t,n){var r=function(t){if(!l)return i[t]||"";var n,r=Lg.get(e);if(!(null==r?void 0:r.length))return i[t]||"";var o=!1,a=!1;return r.forEach(function(e){e.forEach(function(e){var r=f(e[0],1)[0][t]||"";if(!o)return n=r,void(o=!0);n!==r&&(a=!0)})}),a?void 0:n}(n),o=function(e,t){return"borderStyle"!==e||t?t:"none"}(n,r);if(null!=r)b(n,o);else{if(b(n,"",!0),"hidden"===t.input.type){var a=t.input.closest(".color-group");a&&zr(a).attr("data-mixed","true")}"hidden"!==t.input.type&&(t.input.placeholder=Ks("tableModule.modal.mixed"))}}),null===(t=g.get("borderWidth"))||void 0===t||t.input.addEventListener("change",function(e){var t=e.currentTarget;y(t.name),t.setAttribute("data-mixed","false")}),h.find(".w-e-table-property-select-trigger").on("click",function(e){e.preventDefault(),e.stopPropagation();var t=e.currentTarget;if(null!=t){var n=zr(t),r=n.parents(".w-e-table-property-select").find(".w-e-table-property-select-panel"),o="true"===n.attr("aria-expanded");h.find(".color-group .w-e-drop-panel").hide(),m(),o||(r.show(),n.attr("aria-expanded","true"))}}),h.find(".w-e-table-property-select-trigger").on("keydown",function(e){var t=Hg(e),n=e.currentTarget;if(null!=t&&n instanceof HTMLElement)return zg(t)?(t.preventDefault(),void n.click()):void("Escape"===t.key&&(t.preventDefault(),m()))}),h.find(".w-e-table-property-select-option").on("click",function(e){e.preventDefault(),e.stopPropagation();var t=e.currentTarget;if(null!=t){var n=zr(t),r=n.attr("data-select-option-field"),o=n.attr("data-value")||"";b(r,o),y(r),m()}}),h.find(".w-e-table-property-select-option").on("keydown",function(e){var t=Hg(e),n=e.currentTarget;if(null!=t&&n instanceof HTMLElement)return zg(t)?(t.preventDefault(),void n.click()):void("Escape"===t.key&&(t.preventDefault(),m()))}),h.find("[data-field]").on("click",function(e){var t=e.currentTarget;if(null!=t){var n=zr(t),r=n.attr("data-value")||"",o=n.attr("data-field");b(o,r),y(o)}});return h.find(".color-group").each(function(t){var r=zr(t),o=function(){m(),h.find(".color-group .w-e-drop-panel").hide();var o=r.data("panel"),i=r.data("mark"),a="color"===i?"borderColor":"backgroundColor";o?(n.updateColorPanelActive(o,E(a)),o.show()):(o=n.getPanelContentElem(e,{mark:i,selectedColor:E(a),callback:function(e){var n,r;b(a,e||""),zr(t).attr("data-mixed","false"),y(a),"borderColor"===a&&e&&(n=E("borderStyle"),r=E("borderWidth"),n&&"none"!==n||(b("borderStyle","solid"),y("borderStyle")),r&&"0"!==r||(b("borderWidth","1"),y("borderWidth"))),o.hide()}}),r.append(o),r.data("panel",o))};r.on("click",function(){o()}),r.on("keydown",function(e){var t=Hg(e);null!=t&&zg(t)&&(t.preventDefault(),o())})}),h.find(".button-container button").on("click",function(){var t=Array.from(g).reduce(function(e,t){var n=f(t,2),r=n[0],o=n[1];return v.has(r)?(e[r]=o.getValue(),e):e},{});if(0!==Object.keys(t).length){var r=Lg.get(e);"cell"===n.menu&&(null==r?void 0:r.length)?r.forEach(function(n){n.forEach(function(n){Pn.Transforms.setNodes(e,t,{at:n[0][1]})})}):Pn.Transforms.setNodes(e,t,{at:a}),setTimeout(function(){e.focus()})}else e.focus()}),h[0]},e.prototype.getPanelContentElem=function(e,t){var n=t.mark,r=t.selectedColor,o=t.callback,i=zr(jg("ul",{class:"w-e-panel-content-color"}));i.on("click","li",function(e){var t=e.target;if(t){e.preventDefault(),e.stopPropagation();var n=zr(t).attr("data-value");o(n)}});var a=e.getMenuConfig(n).colors;(void 0===a?[]:a).forEach(function(e){var t=zr(jg("div",{class:"color-block","data-value":e}));t.css("background-color",e);var n=zr(jg("li",{"data-value":e}));r===e&&n.addClass("active"),n.append(t),i.append(n)});var s="";"color"===n&&(s=Ks("tableModule.color.default")),"bgColor"===n&&(s=Ks("tableModule.color.clear"));var u=jg("li",{"data-value":"",class:"clear"});u.innerHTML=Ng,u.append(document.createTextNode(s));var l=zr(u);i.prepend(l);var c=zr(jg("div",{class:"w-e-drop-panel"}));return c.append(i),c},e.prototype.updateColorPanelActive=function(e,t){e.find("li").each(function(e){var n=zr(e);n.attr("data-value")===t?n.addClass("active"):n.removeClass("active")})},e}(),Ug=function(e){function t(){var t=e.apply(this,p([],f(arguments),!1))||this;return t.title=Ks("tableModule.cellProperty"),t.iconSvg='<svg viewBox="0 0 20 20"><path d="m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z"/></svg>',t.tag="button",t.showModal=!0,t.modalWidth=360,t.menu="cell",t.propertyFields=["borderStyle","borderColor","borderWidth","backgroundColor","textAlign","verticalAlign"],t}return s(t,e),t.prototype.getModalContentNode=function(e){return f(Pn.Editor.nodes(e,{match:Bg(e,"td")}),1)[0]},t}($g),Vg=function(){function e(){this.title=Ks("tableModule.deleteCol"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M327.68 510.976L393.216 445.44v-13.1072L327.68 366.7968V510.976z m327.68-78.4384l65.536-65.536V507.904L655.36 442.368v-9.8304z m393.216 484.9664V0H0v917.504h1048.576z m-65.536-131.072h-262.144v-52.4288l-13.1072 13.1072-52.4288-52.4288v91.7504H393.216v-91.7504l-52.4288 52.4288-13.1072-13.1072v52.4288H65.536V65.536H327.68v121.2416l36.0448-36.0448 29.4912 29.4912V62.2592h262.144V180.224l49.152-49.152 16.384 16.384V62.2592h262.144V786.432z m-294.912-108.1344l-160.5632-160.5632-167.1168 167.1168-78.6432-78.6432 167.1168-167.1168L288.3584 278.528l78.6432-78.6432 160.5632 160.5632 163.84-163.84 78.6432 78.6432-163.84 163.84 160.5632 160.5632-78.6432 78.6432z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Pn.Range.isCollapsed(t)||null==Ei.getSelectedNodeByType(e,"table-cell"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table-cell")},universal:!0}),1),r=f(n[0],2),o=r[0],i=r[1],a=Ei.getParentNode(e,o),s=(null==a?void 0:a.children.length)||0;if(!a||s<=1)Pn.Transforms.removeNodes(e,{mode:"highest"});else if(null!=Ei.getParentNode(e,a)){var u=Fg(e),l=0;e:for(var c=0;c<u.length;c+=1)for(var h=0;h<u[c].length;h+=1){var g=f(u[c][h],1),v=f(g[0],2)[1];if(Pn.Path.equals(i,v)){l=h;break e}}Pn.Editor.withoutNormalizing(e,function(){for(var t,n,r=new Set,o=new Set,i=0;i<u.length;i+=1)if(u[i]&&u[i][l]){var a=f(u[i][l],2),s=f(a[0],2)[1],c=a[1],h=c.rtl,g=c.ltr,v=c.ttb,m=c.btt,y=s.join(",");if(h>1||g>1||v>1||m>1){var b=i-(v-1),E=l-(h-1);if(b<0||b>=u.length||!u[b]||!u[b][E])continue;var w=f(u[b][E],1),C=f(w[0],2),D=C[0],A=C[1],S=A.join(",");if(!o.has(S)){o.add(S);var x=D.rowSpan,T=void 0===x?1:x,N=D.colSpan,O=void 0===N?1:N,B=Math.max(O-1,1);Pn.Transforms.setNodes(e,{rowSpan:T,colSpan:B},{at:A})}}else r.add(y)}var k=Array.from(r);k.sort(function(e,t){var n=e.split(",").map(Number),r=t.split(",").map(Number);return n[n.length-2]!==r[r.length-2]?r[r.length-2]-n[n.length-2]:r[r.length-1]-n[n.length-1]});try{for(var F=d(k),I=F.next();!I.done;I=F.next()){var P=I.value.split(",").map(Number);try{Pn.Editor.hasPath(e,P)&&Pn.Transforms.removeNodes(e,{at:P})}catch(e){console.warn("删除单元格失败:",P,e)}}}catch(e){t={error:e}}finally{try{I&&!I.done&&(n=F.return)&&n.call(F)}finally{if(t)throw t.error}}var R=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table")},universal:!0}),1),_=R[0];if(_){var L=f(_,2),M=L[0],j=L[1],H=M.columnWidths,z=p([],f(void 0===H?[]:H),!1);z.splice(l,1),Pn.Transforms.setNodes(e,{columnWidths:z},{at:j})}})}}},e}();function Wg(e){return void 0===e&&(e={}),u(u({type:"table-cell"},e),{children:[{type:"paragraph",children:[{text:""}]}]})}function Gg(e){return e.map(function(e){return Pn.Text.isText(e)?u({},e):u(u({},e),{children:Gg(e.children)})})}function qg(e){var t=[],n=[],r=function(){0!==n.length&&(t.push({type:"paragraph",children:n}),n=[])};return e.forEach(function(e){Pn.Text.isText(e)?n.push(u({},e)):(r(),t.push(e))}),r(),t.length>0?t:Wg().children}function Kg(e,t){return t.children.every(function(t){return!!Pn.Text.isText(t)||Pn.Element.isElement(t)&&e.isInline(t)&&Kg(e,t)})}function Yg(e,t){return!!Pn.Element.isElement(t)&&("paragraph"===t.type||"list-item"===t.type?Kg(e,t):"pre"===t.type?1===t.children.length&&Pn.Element.isElement(t.children[0])&&"code"===t.children[0].type&&t.children[0].children.every(Pn.Text.isText):"video"===t.type&&(e.isVoid(t)&&t.children.every(Pn.Text.isText)))}function Xg(e){return e.map(function(e){if(Pn.Text.isText(e))return e;if("table-cell"===e.type)return u(u({},e),{children:qg(e.children)});var t=Xg(e.children);return t.every(function(t,n){return t===e.children[n]})?e:u(u({},e),{children:t})})}function Zg(e,t,n){try{var r=Ei.findPath(e,t);Pn.Transforms.setNodes(e,n,{at:r})}catch(e){}}function Jg(e){var t=e.children||[];return 0===t.length?[]:(t[0]||{}).children||[]}function Qg(e){return Jg(e).every(function(e){return!!e.isHeader})}var ev=function(){function e(){this.title=Ks("tableModule.deleteRow"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M907.6736 586.5472L747.1104 425.984l163.84-163.84-78.6432-78.6432-163.84 163.84L507.904 186.7776 429.2608 262.144l163.84 163.84-167.1168 167.1168 78.6432 78.6432 167.1168-167.1168 160.5632 160.5632 75.3664-78.6432zM0 917.504V0h1048.576v917.504H0z m983.04-327.68h-22.9376l-65.536-65.536H983.04V327.68h-91.7504l65.536-65.536h26.2144V65.536H65.536v196.608h317.8496l65.536 65.536H65.536v196.608h380.1088l-65.536 65.536H65.536v196.608H983.04v-196.608z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Pn.Range.isCollapsed(t)||null==Ei.getSelectedNodeByType(e,"table-row"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table-row")},universal:!0}),1),r=f(n[0],2),o=r[0],i=r[1],a=Ei.getParentNode(e,o);if(((null==a?void 0:a.children.length)||0)<=1)Pn.Transforms.removeNodes(e,{mode:"highest"});else{var s=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table-cell")},universal:!0}),1),u=f(s[0],2)[1],l=Fg(e),c=0;e:for(var h=0;h<l.length;h+=1)for(var g=0;g<l[h].length;g+=1){var v=f(l[h][g],1),m=f(v[0],2)[1];if(Pn.Path.equals(u,m)){c=h;break e}}Pn.Editor.withoutNormalizing(e,function(){for(var t,n,r=[],o=0;o<l[c].length;o+=1){var a=f(l[c][o],2),s=f(a[0],1)[0].hidden,u=a[1],h=u.ttb,g=u.btt,v=u.rtl;if(h>1||g>1){var m=c-(h-1);if(m<0||m>=l.length||!l[m]||!l[m][o])continue;var y=f(l[m][o],1),b=f(y[0],2),E=b[0],w=b[1],C=E,D=C.rowSpan,A=void 0===D?1:D,S=C.colSpan,x=void 0===S?1:S;if(s)Pn.Transforms.setNodes(e,{rowSpan:Math.max(A-1,1),colSpan:x},{at:w});else if(1===h&&1===v){if(c+1<l.length&&A>1){var T={type:"table-cell",rowSpan:A-1,colSpan:x,hidden:!1,children:Gg(C.children)};C.isHeader&&(T.isHeader=C.isHeader),C.width&&(T.width=C.width),C.backgroundColor&&(T.backgroundColor=C.backgroundColor),C.borderWidth&&(T.borderWidth=C.borderWidth),C.borderStyle&&(T.borderStyle=C.borderStyle),C.borderColor&&(T.borderColor=C.borderColor),C.textAlign&&(T.textAlign=C.textAlign),C.verticalAlign&&(T.verticalAlign=C.verticalAlign),r.push({cell:T,columnIndex:o})}else Pn.Transforms.setNodes(e,{rowSpan:Math.max(A-1,1),colSpan:x},{at:w})}else Pn.Transforms.setNodes(e,{rowSpan:Math.max(A-1,1),colSpan:x},{at:w})}}if(Pn.Transforms.removeNodes(e,{at:i}),r.length>0){var N=i;try{r.sort(function(e,t){return e.columnIndex-t.columnIndex});try{for(var O=d(r),B=O.next();!B.done;B=O.next()){var k=B.value,F=k.cell,I=k.columnIndex;try{var P=p(p([],f(N),!1),[I],!1);Pn.Transforms.insertNodes(e,F,{at:P})}catch(t){try{var R=f(Pn.Editor.node(e,N),1)[0].children.length,_=p(p([],f(N),!1),[R],!1);Pn.Transforms.insertNodes(e,F,{at:_})}catch(e){console.warn("插入新单元格失败:",e)}}}}catch(e){t={error:e}}finally{try{B&&!B.done&&(n=O.return)&&n.call(O)}finally{if(t)throw t.error}}}catch(e){console.warn("插入新单元格失败:",e)}}})}}},e}(),tv=function(){function e(){this.title=Ks("tableModule.deleteTable"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return null==e.selection||null==Ei.getSelectedNodeByType(e,"table")},e.prototype.exec=function(e,t){this.isDisabled(e)||Pn.Transforms.removeNodes(e,{mode:"highest"})},e}(),nv=function(){function e(){this.title=Ks("tableModule.widthAuto"),this.iconSvg='<svg viewBox="0 0 1228 1024"><path d="M862.514337 563.200461H404.581995v121.753478a13.311987 13.311987 0 0 1-6.655993 11.468789 10.23999 10.23999 0 0 1-12.083188-1.433599l-204.799795-179.199821a13.721586 13.721586 0 0 1 0-20.479979l204.799795-179.302221a10.23999 10.23999 0 0 1 12.185588-1.535998 13.209587 13.209587 0 0 1 6.553593 11.673588v115.097485h457.932342V319.693504a11.571188 11.571188 0 0 1 18.841582-10.239989l204.799795 179.19982a13.721586 13.721586 0 0 1 0 20.47998l-204.799795 179.199821a10.23999 10.23999 0 0 1-12.185588 1.535998 13.311987 13.311987 0 0 1-6.655994-11.571188V563.200461zM136.499064 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785H15.155185A15.155185 15.155185 0 0 1 0 1008.844815V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086294a15.155185 15.155185 0 0 1 15.257585 15.155185zM1228.798771 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785h-106.188693a15.155185 15.155185 0 0 1-15.155185-15.052785V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086293A15.155185 15.155185 0 0 1 1228.798771 15.053809z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){var t=Ei.getSelectedNodeByType(e,"table");return null!=t&&"100%"===t.width},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Pn.Range.isCollapsed(t)||null==Ei.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=Ei.getSelectedNodeByType(e,"table");if(n){var r={width:"100%"===n.width?"auto":"100%"};Pn.Transforms.setNodes(e,r,{mode:"highest"})}}},e}(),rv=function(){function e(){this.title=Ks("tableModule.insertCol"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M327.68 193.3312v186.7776H140.9024v91.7504H327.68v186.7776h88.4736V471.8592h190.0544V380.1088H416.1536V193.3312zM0 917.504V0h1048.576v917.504H0zM655.36 65.536H65.536v720.896H655.36V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 262.144h-262.144v196.608h262.144V327.68z m0 262.144h-262.144v196.608h262.144v-196.608z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;if(null==t)return!0;if(!Pn.Range.isCollapsed(t))return!0;var n=Ei.getSelectedNodeByType(e,"table");if(null==n)return!0;try{var r=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table-cell")},universal:!0}),1),o=r[0];if(!o)return!0;for(var i=f(o,2)[1],a=Fg(e),s=-1,u=0;u<a.length;u+=1){for(var l=0;l<a[u].length;l+=1){var c=f(a[u][l],1),d=f(c[0],2)[1];if(Pn.Path.equals(i,d)){s=l;break}}if(-1!==s)break}if(-1===s)return!0;var p=n.columnWidths,h=(void 0===p?[]:p)[s];if(h&&h<20)return!0}catch(e){return!0}return!1},e.prototype.exec=function(e,t){var n;if(!this.isDisabled(e)){var r=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table-cell")},universal:!0}),1),o=f(r[0],2),i=o[0],a=o[1],s=Ei.getParentNode(e,i);if(null!=s){var u=Ei.getParentNode(e,s);if(null!=u){for(var l=Fg(e),c=-1,d=0;d<l.length;d+=1){for(var h=0;h<l[d].length;h+=1){var g=f(l[d][h],1),v=f(g[0],2)[1];if(Pn.Path.equals(a,v)){c=h;break}}if(-1!==c)break}if(-1!==c){var m=i.colSpan||1,y=(e.getMenuConfig("insertTableCol")||{}).insertPosition,b="after"===(void 0===y?"before":y)?"after":"before",E=(null===(n=l[0])||void 0===n?void 0:n.length)||0,w="after"===b?Math.min(c+m,E):c,C=w<E?w:-1;Pn.Editor.withoutNormalizing(e,function(){for(var t=new Set,n=new Set,r=0;r<l.length;r+=1)if(!(C<0)&&l[r]&&l[r][C]){var o=f(l[r][C],2);f(o[0],1);var i=o[1],a=i.rtl,s=i.ltr,d=i.ttb,h=i.btt;if(a>1||s>1||d>1||h>1){var g=r-(d-1),v=C-(a-1);if(g<0||g>=l.length||!l[g]||!l[g][v])continue;var m=f(l[g][v],1),y=f(m[0],2),E=y[0],D=y[1],A=D.join(",");if(t.has(A))n.add(r);else{t.add(A);var S=E.rowSpan,x=void 0===S?1:S,T=E.colSpan,N=(void 0===T?1:T)+1;E.hidden||Pn.Transforms.setNodes(e,{colSpan:N},{at:D});for(var O=0;O<x;O+=1)n.add(g+O)}}}for(r=0;r<l.length;r+=1)if(!n.has(r)){var B=l[r];if(B&&0!==B.length){var k=Wg();0===r&&Qg(u)&&(k.isHeader=!0);var F=void 0;if(w<B.length){var I=f(B[w],1);F=f(I[0],2)[1]}else{var P=f(B[B.length-1],1),R=f(P[0],2)[1];F=Pn.Path.next(R)}Pn.Transforms.insertNodes(e,k,{at:F})}}var _=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table")},universal:!0}),1),L=_[0];if(L){var M=f(L,2),j=M[0],H=M[1],z=j.columnWidths,$=void 0===z?[]:z,U=p([],f($),!1),V=e.getMenuConfig("insertTable").minWidth,W=void 0===V?60:V,G=$[c]||parseInt(W.toString(),10)||60,q=Math.floor(G/2),K=G-q;"after"===b?(U[c]=K,U.splice(c+1,0,q)):(U.splice(c,0,q),U[c+1]=K),Pn.Transforms.setNodes(e,{columnWidths:U},{at:H})}})}}}}},e}(),ov=function(){function e(){this.title=Ks("tableModule.insertRow"),this.iconSvg='<svg viewBox="0 0 1048 1024"><path d="M707.7888 521.0112h-147.456v-147.456H488.2432v147.456h-147.456v68.8128h147.456v147.456h72.0896v-147.456h147.456zM0 917.504V0h1048.576v917.504H0zM327.68 65.536H65.536v196.608H327.68V65.536z m327.68 0H393.216v196.608h262.144V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 258.8672H65.536v462.0288H983.04V324.4032z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Pn.Range.isCollapsed(t)||null==Ei.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){var n;if(!this.isDisabled(e)){var r=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table-cell")},universal:!0}),1),o=f(r[0],2)[1],i=Fg(e),a=0;e:for(var s=0;s<i.length;s+=1)for(var u=0;u<i[s].length;u+=1){var l=f(i[s][u],1),c=f(l[0],2)[1];if(Pn.Path.equals(o,c)){a=s;break e}}var d=(null===(n=i[a])||void 0===n?void 0:n.length)||0;0!==d&&Pn.Editor.withoutNormalizing(e,function(){for(var t=a+1,n=t>=0&&t<i.length,r=[],s=0;n&&s<i[a].length;s+=1){var u=f(i[a][s],2)[1],l=u.ttb,c=u.btt;if(l>1||c>1){var p=a-(l-1);if(p<0||p>=i.length||!i[p]||!i[p][s])continue;var h=f(i[p][s],1),g=f(h[0],2),v=g[0],m=g[1],y=v.rowSpan||1;r.push(s),v.hidden||Pn.Transforms.setNodes(e,{rowSpan:y+1},{at:m})}}for(var b=(e.getMenuConfig("insertTable")||{}).minRowHeight,E={type:"table-row",children:[],height:parseInt((void 0===b?30:b).toString(),10)||30},w=0;w<d;w+=1)if(!r.includes(w)){var C=Wg();E.children.push(C)}var D=Pn.Path.parent(o),A=Pn.Path.next(D);Pn.Transforms.insertNodes(e,E,{at:A})})}},e}();var iv=function(){function e(){this.title=Ks("tableModule.insertTable"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M0 64v896h1024V64H0z m384 576v-192h256v192h-256z m256 64v192h-256v-192h256z m0-512v192h-256V192h256zM320 192v192H64V192h256z m-256 256h256v192H64v-192z m640 0h256v192h-256v-192z m0-64V192h256v192h-256zM64 704h256v192H64v-192z m640 192v-192h256v192h-256z"></path></svg>',this.tag="button",this.showDropPanel=!0,this.$content=null}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Pn.Range.isCollapsed(t)||!!Ei.getSelectedElems(e).some(function(t){var n=Ei.getNodeType(t);return"pre"===n||("table"===n||("list-item"===n||!!e.isVoid(t)))}))},e.prototype.getPanelContentElem=function(e){var t=this;if(this.$content)return this.$content[0];for(var n=zr('<div class="w-e-panel-content-table"></div>'),r=zr("<span>0 &times; 0</span>"),o=zr("<table></table>"),i=0;i<10;i+=1){for(var a=zr("<tr></tr>"),s=0;s<10;s+=1){var u=zr("<td></td>");u.attr("data-x",s.toString()),u.attr("data-y",i.toString()),a.append(u),u.on("mouseenter",function(e){var t=e.target;if(null!=t){var n=zr(t).dataset(),i=n.x,a=n.y;r[0].innerHTML="".concat(i+1," &times; ").concat(a+1),o.children().each(function(e){zr(e).children().each(function(e){var t=zr(e),n=t.dataset(),r=n.x,o=n.y;r<=i&&o<=a?t.addClass("active"):t.removeClass("active")})})}}),u.on("click",function(n){n.preventDefault();var r=n.target;if(null!=r){var o=zr(r).dataset(),i=o.x,a=o.y;t.insertTable(e,a+1,i+1)}})}o.append(a)}return n.append(o),n.append(r),this.$content=n,n[0]},e.prototype.insertTable=function(e,t,n){var r=parseInt(t,10),o=parseInt(n,10);if(r&&o&&!(r<=0||o<=0)){Ei.isSelectedEmptyParagraph(e)&&Pn.Transforms.removeNodes(e,{mode:"highest"});var i=function(e,t,n){for(var r,o=[],i=e.getMenuConfig("insertTable"),a=i.minWidth,s=void 0===a?60:a,u=i.minRowHeight,l=void 0===u?30:u,c=i.tableFullWidth,d=i.tableHeader,f=Array(n).fill(parseInt(s,10)||60),p=0;p<t;p+=1){for(var h=[],g=0;g<n;g+=1){var v=Wg();0===p&&(v.isHeader=null===(r=null==d?void 0:d.selected)||void 0===r||r),h.push(v)}o.push({type:"table-row",children:h,height:parseInt(l,10)||30})}return{type:"table",width:(null==c?void 0:c.selected)?"100%":"auto",children:o,columnWidths:f}}(e,r,o);Pn.Transforms.insertNodes(e,i,{mode:"highest"})}},e}(),av={isInTable:function(e,t){return void 0===t&&(t={}),!!f(Pn.Editor.nodes(e,{match:Bg(e,"table"),at:t.at}),1)[0]},selection:function(e){var t,n,r,o,i,a,s,u;return c(this,function(l){switch(l.label){case 0:t=Lg.get(e),n=0,l.label=1;case 1:if(!(t&&n<t.length))return[3,4];for(r=[],o=0;o<t[n].length;o+=1)i=f(t[n][o],2),a=i[0],s=i[1],u=s.ltr,1===s.ttb&&r.push(a),o+=u-1;return[4,r];case 2:l.sent(),l.label=3;case 3:return n+=1,[3,1];case 4:return[2]}})},unselect:function(e){Mg.delete(e),Lg.delete(e)},isSelected:function(e,t){var n=Mg.get(e);return!!n&&n.has(t)},hasSelected:function(e){return Lg.has(e)}},sv=function(){function e(){this.title=Ks("tableModule.mergeCell"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M482.2 508.4 331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4c2.4-1.8 2.4-5.4 0-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4c-2.3 1.8-2.3 5.3 0 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"/></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return!this.canMerge(e)},e.prototype.exec=function(e,t){this.isDisabled(e)||(this.merge(e),av.unselect(e))},e.prototype.canMerge=function(e){var t=Lg.get(e);if(!t||!t.length)return!1;var n=f(t[t.length-1][t[t.length-1].length-1],1),r=f(n[0],2)[1],o=f(t[0][0],1);return!!kg(e,[f(o[0],2)[1],r],"table")},e.prototype.merge=function(e){if(this.canMerge(e)){var t=Lg.get(e);if(t&&t.length){var n=f(t[0][0],1),r=f(n[0],2)[1],o=f(Pn.Node.children(e,r,{reverse:!0}),1),i=f(o[0],2)[1];Pn.Editor.withoutNormalizing(e,function(){for(var n,o,a,s,u,l,c=new Map,p=[],h=1/0,g=-1/0,v=1/0,m=-1/0,y=0;y<t.length;y+=1)for(var b=0;b<t[y].length;b+=1){var E=f(t[y][b],2),w=f(E[0],2),C=w[0],D=w[1],A=E[1].ttb,S=D.join(",");if(1===A&&!c.has(S)){c.set(S,{path:D,x:y,y:b,element:C});var x=C.rowSpan,T=void 0===x?1:x,N=C.colSpan,O=y,B=y+T-1,k=b,F=b+(void 0===N?1:N)-1;h=Math.min(h,O),g=Math.max(g,B),v=Math.min(v,k),m=Math.max(m,F)}}var I=g-h+1,P=m-v+1;try{for(var R=d(c),_=R.next();!_.done;_=R.next()){D=f(_.value,2)[1].path;Pn.Path.equals(r,D)||p.push(D)}}catch(e){n={error:e}}finally{try{_&&!_.done&&(o=R.return)&&o.call(R)}finally{if(n)throw n.error}}p.sort(function(e,t){for(var n=0;n<Math.min(e.length,t.length);n+=1)if(e[n]!==t[n])return t[n]-e[n];return t.length-e.length});try{for(var L=d(p),M=L.next();!M.done;M=L.next()){D=M.value;try{if(!Pn.Editor.hasPath(e,D))continue;try{for(var j=(u=void 0,d(Pn.Node.children(e,D,{reverse:!0}))),H=j.next();!H.done;H=j.next()){var z=f(H.value,2)[1];Pn.Transforms.moveNodes(e,{to:Pn.Path.next(i),at:z})}}catch(e){u={error:e}}finally{try{H&&!H.done&&(l=j.return)&&l.call(j)}finally{if(u)throw u.error}}Pn.Transforms.removeNodes(e,{at:D})}catch(e){}}}catch(e){a={error:e}}finally{try{M&&!M.done&&(s=L.return)&&s.call(L)}finally{if(a)throw a.error}}Pn.Transforms.setNodes(e,{rowSpan:I,colSpan:P},{at:r})})}}},e}(),uv=function(){function e(){this.title=Ks("tableModule.splitCell"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M362.667 494.933v53.334l25.6-25.6zm0-241.066L460.8 352V78.933H57.6v98.134h305.067zm0 535.466v57.6H57.6v98.134h403.2V691.2zM661.333 494.933v53.334l-25.6-25.6zm0-241.066L563.2 352V78.933h403.2v98.134H661.333zm0 535.466v57.6H966.4v98.134H563.2V691.2z"/><path d="M753.067 341.333 693.333 281.6 512 460.8 330.667 281.6l-59.734 59.733 181.334 181.334L270.933 704l59.734 59.733L512 582.4l181.333 181.333L753.067 704 571.733 522.667z"/></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){var t=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table-cell")}}),1),n=t[0];if(!n)return!0;var r=f(n,1)[0],o=r.rowSpan,i=void 0===o?1:o,a=r.colSpan;return!(i>1||(void 0===a?1:a)>1)},e.prototype.exec=function(e,t){this.isDisabled(e)||this.split(e)},e.prototype.split=function(e,t){void 0===t&&(t={});var n=f(Pn.Editor.nodes(e,{match:Bg(e,"table","th","td"),at:t.at}),2),r=n[0],o=n[1];if(r&&o){var i=Qg(f(r,1)[0]),a=f(o,2),s=a[0],u=a[1],l=s.rowSpan,c=void 0===l?1:l,d=s.colSpan,h=void 0===d?1:d;1===c&&1===h||Pn.Editor.withoutNormalizing(e,function(){Pn.Transforms.setNodes(e,{rowSpan:1,colSpan:1},{at:u});for(var t=1;t<h;t+=1){var n=Wg();0===u[u.length-2]&&i&&(n.isHeader=!0);var r=u.slice(0,-1),o=u[u.length-1]+t,a=p(p([],f(r),!1),[o],!1);try{Pn.Transforms.insertNodes(e,n,{at:a})}catch(t){try{var s=f(Pn.Editor.node(e,r),1)[0].children.length,l=p(p([],f(r),!1),[s],!1);Pn.Transforms.insertNodes(e,n,{at:l})}catch(e){console.warn("插入同行单元格失败: ".concat(e instanceof Error?e.message:String(e)))}}}for(var d=1;d<c;d+=1){var g=u[u.length-2]+d,v=p(p([],f(u.slice(0,-2)),!1),[g],!1);try{var m=f(Pn.Editor.node(e,v),1)[0];if(!m){console.warn("目标行 ".concat(g," 不存在"));continue}for(t=0;t<h;t+=1){n=Wg(),o=u[u.length-1]+t,a=p(p([],f(v),!1),[o],!1);try{var y=m.children.length;if(o>=y){var b=p(p([],f(v),!1),[y],!1);Pn.Transforms.insertNodes(e,n,{at:b})}else Pn.Transforms.insertNodes(e,n,{at:a})}catch(t){try{var E=m.children.length;l=p(p([],f(v),!1),[E],!1);Pn.Transforms.insertNodes(e,n,{at:l})}catch(e){console.warn("插入单元格到第".concat(d,"行失败: ").concat(e instanceof Error?e.message:String(e)))}}}}catch(e){console.warn("处理第".concat(d,"行时出错: ").concat(e instanceof Error?e.message:String(e)))}}})}},e}(),lv=function(){function e(){this.title=Ks("tableModule.header"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M704 128l-64 0L384 128 320 128 0 128l0 256 0 64 0 192 0 64 0 256 320 0 64 0 256 0 64 0 320 0 0-256 0-64L1024 448 1024 384 1024 128 704 128zM640 640 384 640 384 448l256 0L640 640zM64 448l256 0 0 192L64 640 64 448zM320 896 64 896l0-192 256 0L320 896zM640 896 384 896l0-192 256 0L640 896zM960 896l-256 0 0-192 256 0L960 896zM960 640l-256 0L704 448l256 0L960 640z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){var t=Ei.getSelectedNodeByType(e,"table");return null!=t&&Qg(t)},e.prototype.isActive=function(e){return!!this.getValue(e)},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Pn.Range.isCollapsed(t)||null==Ei.getSelectedNodeByType(e,"table"))},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n=!t,r=Ei.getSelectedNodeByType(e,"table");if(null!=r)Jg(r).forEach(function(t){return Pn.Transforms.setNodes(e,{isHeader:n},{at:Ei.findPath(e,t)})})}},e}(),cv={key:"insertTable",config:{minWidth:60,minRowHeight:30,tableHeader:{selected:!0},tableFullWidth:{selected:!1},widthExportMode:"explicit"},factory:function(){return new iv}},dv={key:"deleteTable",factory:function(){return new tv}},fv={key:"insertTableRow",factory:function(){return new ov}},pv={key:"deleteTableRow",factory:function(){return new ev}},hv={key:"insertTableCol",factory:function(){return new rv}},gv={key:"deleteTableCol",factory:function(){return new Vg}},vv={key:"tableHeader",factory:function(){return new lv}},mv={key:"tableFullWidth",factory:function(){return new nv}},yv={key:"mergeTableCell",factory:function(){return new sv}},bv={key:"splitTableCell",factory:function(){return new uv}},Ev={key:"setTableProperty",factory:function(){return new $g}},wv={key:"setTableCellProperty",factory:function(){return new Ug}};function Cv(e,t){void 0===t&&(t=0);var n=parseInt(e||"",10);return Number.isNaN(n)?t:n}function Dv(e,t,n){void 0===t&&(t=0),void 0===n&&(n=0);var r=(e||"").trim().toLowerCase(),o=parseFloat(r);if(Number.isNaN(o))return t;if(r.endsWith("pt"))return Math.round(4*o/3);if(r.endsWith("%")){var i=n>0?n:600;return Math.round(o/100*i)}return Math.round(o)}var Av={selector:"td:not([data-w-e-type]),th:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r=zr(e),o=r.text().replace(/\s+/gm," ").trim();0===(t=t.filter(function(e){return!!Pn.Text.isText(e)||(!!n.isInline(e)||Yg(n,e))})).length&&(t=[{text:r.text().replace(/\s+/gm," ")}]),t=qg(t);var i=parseInt(r.attr("colSpan")||"1",10),a=parseInt(r.attr("rowSpan")||"1",10),s="none"===Rg(r,"display")&&0===o.length,u=r.attr("width")||"auto";return{type:"table-cell",isHeader:"th"===Pg(r),colSpan:i,rowSpan:a,width:u,children:t,hidden:s}}};var Sv={selector:"tr:not([data-w-e-type])",parseElemHtml:function(e,t,n){for(var r=zr(e),o=[],i=0;i<t.length;i+=1){var a=t[i];if("table-cell"===Ei.getNodeType(a)){var s=a;if(s.hidden)continue;o.push(s)}}return{type:"table-row",height:Cv(Rg(r,"height")||r.attr("data-w-e-row-height")||r.attr("height"))||void 0,children:o}}};var xv,Tv={selector:"table:not([data-w-e-type])",parseElemHtml:function(e,t,n){var r,o,i=zr(e),a=(i.find("caption").text()||"").replace(/\s+/gm," ").trim()||void 0,s="auto",u=Rg(i,"width"),l=i.attr("width")||"",c=i.hasClass("w-e-table-layout-fixed")||!!i.attr("data-w-e-table-height");"100%"===u&&(s="100%"),"100%"===i.attr("width")&&(s="100%"),c&&l&&"auto"!==l&&"100%"!==l&&(s=l);var d={type:"table",width:s,caption:a,height:Cv(Rg(i,"height")||i.attr("data-w-e-table-height")||i.attr("height")),children:t.filter(function(e){return"table-row"===Ei.getNodeType(e)})},f=(null===(r=i.find("tr")[0])||void 0===r?void 0:r.children)||[],p=(null===(o=i.find("colgroup")[0])||void 0===o?void 0:o.children)||null,h=function(e){var t=Rg(e,"width"),n=e.attr("width")||"",r=t||n;return r&&"100%"!==r.trim()?Dv(r,0):0}(i),g=function(e,t){if(!e||0===e.length)return[];var n=[];return Array.from(e).forEach(function(e){var r=parseInt(e.getAttribute("span")||"1",10),o=Dv(e.getAttribute("width")||Rg(zr(e),"width"),90,t);if(!Number.isNaN(o))for(var i=0;i<r;i+=1)n.push(o)}),n}(p,h);if(g.length>0)d.columnWidths=g;else if(f.length>0){var v=[];Array.from(f).forEach(function(e){var t=parseInt(zr(e).attr("colSpan")||"1",10),n=Dv(Rg(zr(e),"width"),90,h);v.push(n);for(var r=1;r<t;r+=1)v.push(90)}),d.columnWidths=v}return d}},Nv=null===(xv=null===window||void 0===window?void 0:window.getComputedStyle(document.documentElement))||void 0===xv?void 0:xv.getPropertyValue("--w-e-textarea-border-color");var Ov="\n";function Bv(e,t){return t.length>0&&t.every(function(t){return!!Pn.Text.isText(t)||Yg(e,t)})}function kv(e){var t=e.selection;if(null==t)return!1;var n=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table-cell")}}),1),r=n[0];if(r){var o=f(r,2)[1],i=Pn.Editor.start(e,o);if(Pn.Point.equals(t.anchor,i))return!0}return!1}function Fv(e,t,n){var r=e.selection;if(null==r||"line"===t)return!1;var o=f(Pn.Editor.nodes(e,{match:function(e){return Ei.checkNodeType(e,"table-cell")}}),1),i=o[0],a=r.anchor;if("backward"===n&&0===r.anchor.offset&&(a=Pn.Editor.before(e,r)),"forward"===n&&Pn.Editor.isEnd(e,r.anchor,r.anchor.path)&&(a=Pn.Editor.after(e,r)),null==a)return!1;var s=Pn.Editor.above(e,{at:a,match:function(e){return Ei.checkNodeType(e,"table-cell")}});if(null==s||null==i||!Pn.Path.equals(s[1],i[1]))return!1;var u=Pn.Editor.node(e,a);if(!Pn.Text.isText(u[0])||u[0].text.length<1)return!1;var l="backward"===n?a.offset-1:a.offset,c="backward"===n?a.offset:a.offset+1;if(l<0)return!1;var d=Pn.Node.string(u[0]);return!(d.slice(l,c)!==Ov)&&(Pn.Transforms.insertText(e,d.slice(0,l)+d.slice(c),{at:{anchor:Pn.Editor.start(e,a.path),focus:Pn.Editor.end(e,a.path)}}),Pn.Transforms.select(e,{anchor:{path:a.path,offset:l},focus:{path:a.path,offset:l}}),!0)}function Iv(e,t){var n=Pn.Editor.nodes(e,{at:t,match:function(e){return"table"===Ei.getNodeType(e)}});return!!p([],f(n),!1).find(function(){return!0})}function Pv(e){var t,n;try{for(var r=d(["paragraph","header1","header2","header3","header4","header5","header6","blockquote","list-item","todo","divider"]),o=r.next();!o.done;o=r.next()){var i=o.value;if(Ei.getSelectedNodeByType(e,i))return!0}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return!1}function Rv(e){if(function(e){var t=(e.attr("width")||"").trim().toLowerCase(),n=e[0].style.width.trim().toLowerCase(),r=e[0].style.tableLayout.trim().toLowerCase();return!(e.hasClass("w-e-table-layout-fixed")||e.attr("data-w-e-table-height")||"auto"!==t&&"auto"!==n||"fixed"!==r)}(e)&&!function(e){for(var t=e.find("colgroup"),n=0;n<t.length;n+=1)for(var r=t[n],o=0;o<r.children.length;o+=1){var i=r.children[o],a=(i.getAttribute("width")||"").trim().toLowerCase(),s=(i.style.width||"").trim().toLowerCase();if(a&&"auto"!==a)return!0;if(s&&"auto"!==s)return!0}return!1}(e)&&!function(e){for(var t=e.find("td, th"),n=0;n<t.length;n+=1){var r=t[n],o=(r.getAttribute("width")||"").trim().toLowerCase(),i=(r.style.width||"").trim().toLowerCase();if(o&&"auto"!==o)return!0;if(i&&"auto"!==i)return!0}return!1}(e)){var t=function(e){if("undefined"==typeof document||!document.body)return[];var t=document.createElement("div");t.style.position="fixed",t.style.top="-10000px",t.style.left="0",t.style.visibility="hidden",t.style.pointerEvents="none";var n=e.cloneNode(!0);t.appendChild(n),document.body.appendChild(t);try{var r=n.querySelector("tr");if(!r)return[];var o=Array.from(r.children).filter(function(e){var t=e.tagName.toLowerCase();return"td"===t||"th"===t});if(0===o.length)return[];for(var i=[],a=0;a<o.length;a+=1){var s=o[a],u=parseInt(s.getAttribute("colspan")||"1",10),l=Number.isFinite(u)&&u>0?u:1,c=s.getBoundingClientRect().width;if(!Number.isFinite(c)||c<=0)return[];for(var d=Math.max(1,Math.round(c/l)),f=0;f<l;f+=1)i.push(d)}return i}finally{t.remove()}}(e[0]);0!==t.length&&function(e,t){if(0!==t.length){var n=e.querySelector("colgroup");n&&n.remove();var r=document.createElement("colgroup");r.setAttribute("contentEditable","false"),t.forEach(function(e){var t=document.createElement("col");t.setAttribute("width","".concat(e)),r.appendChild(t)});var o=e.querySelector("tr");o?e.insertBefore(r,o):e.appendChild(r)}}(e[0],t)}}var _v={selector:"table",preParseHtml:function(e){var t=zr(e);if("table"!==Pg(t))return e;var n=t.find("tbody");if(0===n.length)return e;var r=t.find("tr");t.append(r),n.remove();for(var o=t.find("td, th"),i=0;i<o.length;i+=1){var a=zr(o[i]);a.attr("width","auto");var s=a.html()||"";s=(s=s.replace(/<o:p[^>]*>[\s\S]*?<\/o:p>/gi,"")).replace(/<\/o:p>/gi,""),a.html(s)}return Rv(t),t[0]}};var Lv=new WeakMap;function Mv(e){var t=Lv.get(e);t&&(t.eventWindow.removeEventListener("mouseup",t.stop),t.eventWindow.removeEventListener("blur",t.stop),t.anchorPathRef.unref(),Lv.delete(e))}function jv(e,t){var n=function(e){if(e.target instanceof HTMLElement){var t=e.target.closest('[data-block-type="table-cell"]');if(t)return t}var n=e.target,r=n instanceof Node?n.ownerDocument:null,o=n instanceof Node?n.getRootNode():null;return(o&&"elementsFromPoint"in o?o:r||document).elementsFromPoint(e.clientX,e.clientY).map(function(e){return e.closest('[data-block-type="table-cell"]')}).find(function(e){return null!=e})||null}(t);if(!n)return null;try{var r=Ei.toSlateNode(e,n);return Pn.Element.isElement(r)&&"table-cell"===Ei.getNodeType(r)?Ei.findPath(e,r):null}catch(e){return null}}function Hv(e,t){if(Mv(e),!e.isDisabled()&&0===t.button){var n=jv(e,t);if(n){var r=function(){return Mv(e)},o=function(e){var t=e.target instanceof Node?e.target.ownerDocument:null;return e.view||(null==t?void 0:t.defaultView)||window}(t);Lv.set(e,{anchorPathRef:Pn.Editor.pathRef(e,n),lastTargetPath:n,isCrossCellSelecting:!1,eventWindow:o,stop:r}),o.addEventListener("mouseup",r),o.addEventListener("blur",r)}}}function zv(e,t){var n=Lv.get(e);if(n)if(1&t.buttons){var r=n.anchorPathRef.current;if(r){var o=jv(e,t);if(o&&function(e,t){return!(e.length<3||t.length<3)&&Pn.Path.equals(e.slice(0,-2),t.slice(0,-2))}(r,o)){var i=Pn.Path.equals(r,o);!n.isCrossCellSelecting&&i||(t.preventDefault(),Pn.Path.equals(n.lastTargetPath,o)||(n.isCrossCellSelecting=!0,n.lastTargetPath=o,e.select(function(e,t,n){return Pn.Path.compare(t,n)<=0?{anchor:Pn.Editor.start(e,t),focus:Pn.Editor.end(e,n)}:{anchor:Pn.Editor.end(e,t),focus:Pn.Editor.start(e,n)}}(e,r,o))))}}else Mv(e)}else Mv(e)}function $v(e){var t,n,r=[],o=0;try{for(var i=d(e),a=i.next();!a.done;a=i.next()){o+=a.value,r.push(o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function Uv(e){var t,n,r=[],o=e.reduce(function(e,t){return e+t},0);try{for(var i=d(e),a=i.next();!a.done;a=i.next()){var s=a.value;r.push(s/o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}var Vv=new Map;function Wv(e){var t=Vv.get(e);t&&(t.observer.disconnect(),t.tablePathRef.unref(),Vv.delete(e))}function Gv(e){var t,n;if(xo(e))Wv(e);else try{for(var r=d(Vv.keys()),o=r.next();!o.done;o=r.next()){Wv(o.value)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}}function qv(e,t,n){if(xo(t)){var r=t.querySelector("table");if(r){var o;Gv(t);try{o=Pn.Editor.pathRef(e,Ei.findPath(e,n))}catch(e){return}var i=new ResizeObserver(function(t){var n=f(t,1)[0].contentRect,i=o.current;if(null!==i){try{var a=f(Pn.Editor.node(e,i),1)[0];if(Pn.Editor.isEditor(a)||!Pn.Element.isElement(a)||"table"!==a.type)return}catch(e){return}var s=function(e){return Array.from(e.querySelectorAll("tr")).map(function(e){var t=e.getBoundingClientRect();return Math.max(1,Math.round(100*t.height)/100)})}(r);Pn.Transforms.setNodes(e,{scrollWidth:n.width,height:n.height,rowHeights:s},{at:i})}});i.observe(r),Vv.set(t,{observer:i,tablePathRef:o})}}}var Kv=!1,Yv=!1,Xv=0,Zv=null,Jv=null,Qv=zr(window);Qv.on("mousedown",function(e){var t=e.target;if(t.closest('[data-block-type="table-cell"]'))Kv=!0;else if("DIV"===t.tagName&&t.closest(".column-resizer-item")){if(null===Zv||null===Jv)return;Yv=!0;var n=e.clientX;Xv=n,document.body.style.cursor="col-resize",e.preventDefault()}Qv.on("mousemove",em),Qv.on("mouseup",tm)});var em=vu(function(e){if(Yv&&null!==Zv&&null!==Jv){e.preventDefault();var t=e.clientX,n=t-Xv,r=null,o=null;try{var i=f(Pn.Editor.node(Zv,Jv),2),a=i[0],s=i[1];if(Pn.Editor.isEditor(a)||!Pn.Element.isElement(a)||"table"!==a.type)return;r=a,o=s}catch(e){return}if(null!==r&&null!==o){var u=r.width,l=void 0===u?"auto":u,c=r.columnWidths,d=void 0===c?[]:c,h=r.resizingIndex,g=void 0===h?-1:h,v=r.scrollWidth,m=void 0===v?0:v;if(!(0===d.length||g<0||g>=d.length)){var y,b=d,E=null;try{E=Ei.toDOMNode(Zv,r)}catch(e){E=null}if("100%"===l&&m>0){var w=d.reduce(function(e,t){return e+t},0);w>0&&(b=Uv(d).map(function(e){return e*m}))}var C=null==E?void 0:E.querySelector(".table");if(C)y=function(e,t,n,r,o){var i=p([],f(e),!1);if(t<0||t>=e.length)return i;var a=o.getMenuConfig("insertTable").minWidth,s=parseInt((void 0===a?60:a).toString(),10)||60,u=n-(0===t?0:r[t-1]),l=Math.max(s,u);return i[t]=Math.floor(100*l)/100,i}(b,g,t-C.getBoundingClientRect().left,$v(b),Zv);else y=function(e,t,n,r){var o=p([],f(e),!1),i=r.getMenuConfig("insertTable").minWidth,a=parseInt((void 0===i?60:i).toString(),10)||60,s=o[t],u=Math.max(a,s+n);return o[t]=Math.floor(100*u)/100,o}(b,g,n,Zv);var D={columnWidths:y};"100%"===l&&(D.width="auto"),Pn.Transforms.setNodes(Zv,D,{at:o})}}}},100);function tm(e){Yv&&em.flush(),em.cancel(),Kv=!1,Yv=!1,Zv=null,Jv=null,document.body.style.cursor="",Qv.off("mousemove",em),Qv.off("mouseup",tm)}function nm(e,t,n){"mouseenter"===n.type?Zg(e,t,{isResizing:!0}):Zg(e,t,{isResizing:!1})}function rm(e){var t,n,r=[],o=0;try{for(var i=d(e),a=i.next();!a.done;a=i.next()){o+=a.value,r.push(o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function om(e){var t=e.children,n=e.rowHeights,r=void 0===n?[]:n,o=r.length===t.length&&r.every(function(e){return Number.isFinite(e)&&e>0});return o?r:t.map(function(e){return e.height||30})}var im=!1,am=0,sm=null,um=null,lm=zr(window);var cm=vu(function(e){if(im&&null!==sm&&null!==um){e.preventDefault();var t,n,r=e.clientY,o=r-am;try{var i=f(Pn.Editor.node(sm,um),2),a=i[0],s=i[1];if(Pn.Editor.isEditor(a)||!Pn.Element.isElement(a)||"table"!==a.type)return;t=a,n=s}catch(e){return}var u,l=t.resizingRowIndex,c=void 0===l?-1:l,d=om(t),h=null;try{h=Ei.toDOMNode(sm,t)}catch(e){h=null}var g=null==h?void 0:h.querySelector(".table");if(g)u=function(e,t,n,r,o){var i=p([],f(e),!1);if(t<0||t>=e.length)return i;var a=(o.getMenuConfig("insertTable")||{}).minRowHeight,s=parseInt((void 0===a?30:a).toString(),10)||30,u=n-(0===t?0:r[t-1]),l=Math.max(s,u);return i[t]=Math.floor(100*l)/100,i}(d,c,r-g.getBoundingClientRect().top,rm(d),sm);else u=function(e,t,n,r){var o=p([],f(e),!1),i=(r.getMenuConfig("insertTable")||{}).minRowHeight,a=parseInt((void 0===i?30:i).toString(),10)||30,s=o[t],u=Math.max(a,s+n);return o[t]=Math.floor(100*u)/100,o}(d,c,o,sm);if(c>=0&&c<u.length){var v=p(p([],f(n),!1),[c],!1);try{Pn.Transforms.setNodes(sm,{height:u[c]},{at:v})}catch(e){console.warn("更新行高度失败:",e)}}}},100);function dm(e){im&&cm.flush(),cm.cancel(),im=!1,sm=null,um=null,document.body.style.cursor="",lm.off("mousemove",cm),lm.off("mouseup",dm)}function fm(e,t,n){"mouseenter"===n.type?Zg(e,t,{isResizingRow:!0}):Zg(e,t,{isResizingRow:!1})}lm.on("mousedown",function(e){var t=e.target;if("DIV"===t.tagName&&t.closest(".row-resizer-item")){if(null===sm)return;im=!0;var n=e.clientY;am=n,document.body.style.cursor="row-resize",e.preventDefault()}lm.on("mousemove",cm),lm.on("mouseup",dm)});var pm=.01,hm=100;function gm(e){return Math.round(100*e)/100}function vm(e,t,n){var r=gm(t),o=e.get(r)||[];o.push(n),e.set(r,o)}function mm(e){e.forEach(function(t,n){e.set(n,function(e){var t=p([],f(e),!1).sort(function(e,t){return f(e,1)[0]-f(t,1)[0]});return t.reduce(function(e,t){var n=e[e.length-1];return n&&t[0]<=n[1]+pm?(n[1]=Math.max(n[1],t[1]),e):(e.push(p([],f(t),!1)),e)},[])}(t))})}function ym(e){var t=new Map,n=new Map,r=new Map,o=new Map;e.forEach(function(e){vm(t,e.top,[e.left,e.right]),vm(n,e.right,[e.top,e.bottom]),vm(r,e.bottom,[e.left,e.right]),vm(o,e.left,[e.top,e.bottom])}),mm(t),mm(n),mm(r),mm(o);var i=[],a=function(e,t,n,r){(function(e,t){var n,r,o=f(e,2),i=o[0],a=o[1],s=[],u=i;try{for(var l=d(t),c=l.next();!c.done;c=l.next()){var p=f(c.value,2),h=p[0],g=p[1],v=Math.max(i,h),m=Math.min(a,g);if(!(m<=u+pm)&&(v>u+pm&&s.push([u,v]),(u=Math.max(u,m))>=a-pm))break}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return u<a-pm&&s.push([u,a]),s})(n,r.get(gm(t))||[]).forEach(function(n){var r=f(n,2),o=r[0],a=r[1];i.push({side:e,offset:t,start:o,end:a})})};return e.forEach(function(e){a("top",e.top,[e.left,e.right],r),a("right",e.right,[e.top,e.bottom],o),a("bottom",e.bottom,[e.left,e.right],t),a("left",e.left,[e.top,e.bottom],n)}),function(e){return p([],f(e),!1).sort(function(e,t){return e.side.localeCompare(t.side)||e.offset-t.offset||e.start-t.start}).reduce(function(e,t){var n=e[e.length-1];return n&&n.side===t.side&&gm(n.offset)===gm(t.offset)&&t.start<=n.end+pm?(n.end=Math.max(n.end,t.end),e):(e.push(u({},t)),e)},[])}(i)}function bm(e,t){for(;e.firstChild;)e.removeChild(e.firstChild);t&&e.appendChild(t)}function Em(e){if(xo(e)){var t=function(e){var t=e.parentElement,n=Array.from((null==t?void 0:t.children)||[]).find(function(e){return"TABLE"===e.tagName});return xo(t)&&xo(n)&&"TABLE"===n.tagName?{container:t,table:n}:null}(e);if(t){var n=t.table,r=Array.from(n.querySelectorAll("td.w-e-selected, th.w-e-selected")).filter(function(e){return e.closest("table")===n});if(0!==r.length){var o=function(e){var t=e.ownerDocument.createElement("span");t.style.position="absolute",t.style.display="block",t.style.top="0",t.style.left="0",t.style.width="".concat(hm,"px"),t.style.height="".concat(hm,"px"),t.style.margin="0",t.style.padding="0",t.style.border="0",t.style.boxSizing="border-box",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.transform="none",e.appendChild(t);var n=e.getBoundingClientRect(),r=t.getBoundingClientRect();e.removeChild(t);var o=r.width/hm,i=r.height/hm;return{overlayRect:n,scaleX:Number.isFinite(o)&&o>0?o:1,scaleY:Number.isFinite(i)&&i>0?i:1}}(e),i=o.overlayRect,a=o.scaleX,s=o.scaleY,u=r.map(function(e){return e.getBoundingClientRect()}).filter(function(e){return e.width>0&&e.height>0}).map(function(e){return{top:(e.top-i.top)/s,right:(e.right-i.left)/a,bottom:(e.bottom-i.top)/s,left:(e.left-i.left)/a}}),l=e.ownerDocument.createDocumentFragment();ym(u).forEach(function(t){var n=e.ownerDocument.createElement("span"),r="top"===t.side||"bottom"===t.side,o=r?t.start:t.offset-("right"===t.side?3:0),i=r?t.offset-("bottom"===t.side?3:0):t.start;n.className=["w-e-table-selection-segment","w-e-table-selection-segment-".concat(t.side),r?"w-e-table-selection-segment-horizontal":"w-e-table-selection-segment-vertical"].join(" "),n.setAttribute("data-selection-edge",t.side),n.style.left="".concat(o,"px"),n.style.top="".concat(i,"px"),n.style.width="".concat(r?t.end-t.start:3,"px"),n.style.height="".concat(r?3:t.end-t.start,"px"),l.appendChild(n)}),bm(e,l)}else bm(e)}else bm(e)}}var wm={type:"table",renderElem:function(e,t,n){var r=function(e,t){if(e.isDisabled())return!1;var n=e.selection;if(null==n)return!0;if(Pn.Range.isCollapsed(n))return!0;var r=n.anchor,o=n.focus,i=Ei.findPath(e,t),a=Pn.Editor.start(e,i),s=Pn.Editor.end(e,i),u=Pn.Point.compare(r,s)<=0&&Pn.Point.compare(r,a)>=0,l=Pn.Point.compare(o,s)<=0&&Pn.Point.compare(o,a)>=0;return!!(u&&l&&Pn.Path.equals(r.path.slice(0,3),o.path.slice(0,3)))}(n,e),o=e,i=o.width,a=void 0===i?"auto":i,s=o.caption,u=o.columnWidths,l=void 0===u?[]:u,c=o.rowHeights,d=void 0===c?[]:c,p=o.scrollWidth,h=void 0===p?0:p,g=o.isHoverCellBorder,v=o.resizingIndex,m=o.isResizing,y=o.isHoverRowBorder,b=o.resizingRowIndex,E=o.isResizingRow,w=function(e){var t=e.height,n=e.rowHeights,r=void 0===n?[]:n,o=e.children,i=void 0===o?[]:o;return"number"==typeof t&&Number.isFinite(t)&&t>0?t:r.length===i.length&&r.every(function(e){return"number"==typeof e&&Number.isFinite(e)&&e>0})?r.reduce(function(e,t){return e+t},0):i.reduce(function(e,t){var n=t.height;return e+("number"==typeof n&&Number.isFinite(n)&&n>0?n:30)},0)}(e),C=Ei.isNodeSelected(n,e),D=f(av.selection(n),1)[0],A=Uv(l),S=wl("div",{className:"table-container","data-selected":C,on:{mousedown:function(t){if("DIV"===t.target.tagName&&t.preventDefault(),!n.isDisabled()){t.target.closest('[data-block-type="table-cell"]')&&(av.unselect(n),Hv(n,t));var r=Ei.findPath(n,e),o=Pn.Editor.start(n,r),i=n.selection;if(null!=i)i.anchor.path[0]!==r[0]&&"DIV"===t.target.tagName&&n.select(o);else n.select(o)}},mousemove:function(e){return zv(n,e)}}},wl("table",{width:a,contentEditable:r,className:"table ".concat(D?"table-selection-none":""),style:{width:"100%"===a?a:"".concat(l.reduce(function(e,t){return e+t},0),"px")},on:{mousemove:es(function(t){av.hasSelected(n)||(function(e,t,n,r){if(!e.isDisabled()&&!Kv&&!Yv){var o=t,i=o.width,a=void 0===i?"auto":i,s=o.columnWidths,u=void 0===s?[]:s,l=o.isHoverCellBorder,c=o.resizingIndex,d=n.clientX,f=n.target;if(xo(f)&&d>(g=f.getBoundingClientRect()).x+5&&d<g.x+g.width-5)return void(l&&Zg(e,t,{isHoverCellBorder:!1,resizingIndex:-1}));if(xo(f)){var p=f.closest(".table");if(p)for(var h=n.clientX,g=p.getBoundingClientRect(),v="100%"===a?Uv(u).map(function(e){return e*r}):u,m=$v(v),y=0;y<m.length;y+=1)if(h-g.x>=m[y]-5&&h-g.x<m[y]+5){if(c===y)return;return void Zg(e,t,{isHoverCellBorder:!0,resizingIndex:y})}}!0===l&&Zg(e,t,{isHoverCellBorder:!1,resizingIndex:-1})}}(n,e,t,h),function(e,t,n){if(!e.isDisabled()&&!im){var r=t,o=r.isHoverRowBorder,i=r.resizingRowIndex,a=n.target;if(xo(a)){var s=a.closest(".table");if(s)for(var u=n.clientY,l=s.getBoundingClientRect(),c=rm(om(r)),d=0;d<c.length;d+=1)if(u-l.y>=c[d]-5&&u-l.y<c[d]+5){if(i===d)return;return void Zg(e,t,{isHoverRowBorder:!0,resizingRowIndex:d})}}!0===o&&Zg(e,t,{isHoverRowBorder:!1,resizingRowIndex:-1})}}(n,e,t))},25)}},s?wl("caption",{contentEditable:!1},s):null,wl("colgroup",{contentEditable:!1},l.map(function(e){return wl("col",{width:e})})),wl("tbody",null,t)),wl("div",{className:"column-resizer",contentEditable:!1},l.map(function(t,r){var o=t;return"100%"===a&&(o=A[r]*h),wl("div",{className:"column-resizer-item",style:{minWidth:"".concat(o,"px")}},wl("div",{className:"resizer-line-hotzone ".concat(g&&r===v?"visible ":"").concat(m&&r===v?"highlight":""),style:{height:"".concat(w,"px")},on:{mouseenter:function(t){return nm(n,e,t)},mouseleave:function(t){return nm(n,e,t)},mousedown:function(t){return function(e,t){if(!Yv){Zv=e;try{Jv=Ei.findPath(e,t)}catch(e){Jv=null}}}(n,e)}}},wl("div",{className:"resizer-line"})))})),wl("div",{className:"row-resizer",contentEditable:!1},e.children.map(function(t,r){var o=l.reduce(function(e,t){return e+t},0),i=d[r],a=Number.isFinite(i)&&i>0?i:t.height||30;return wl("div",{className:"row-resizer-item",style:{minHeight:"".concat(a,"px")}},wl("div",{className:"resizer-line-hotzone-horizontal ".concat(y&&r===b?"visible ":"").concat(E&&r===b?"highlight":""),style:{width:"".concat(o,"px")},on:{mouseenter:function(t){return fm(n,e,t)},mouseleave:function(t){return fm(n,e,t)},mousedown:function(t){return function(e,t){if(!im){sm=e;try{um=Ei.findPath(e,t)}catch(e){um=null}}}(n,e)}}},wl("div",{className:"resizer-line-horizontal"})))})),tl("div.w-e-table-selection-overlay",{attrs:{"aria-hidden":"true",contenteditable:"false"},hook:{insert:function(e){return Em(e.elm)},postpatch:function(e,t){return Em(t.elm)}}})),x=tl("div",{hook:{insert:function(t){var r=t.elm;return qv(n,r,e)},destroy:function(e){Gv(e.elm)}}},S);return x}},Cm={type:"table-row",renderElem:function(e,t,n){var r=e.height;return wl("tr",{style:r?{height:"".concat(r,"px")}:{}},t)}},Dm={type:"table-cell",renderElem:function(e,t,n){var r=function(e,t){var n=Ei.getParentNode(e,t);if(null==n)return!1;var r=Ei.getParentNode(e,n);return null!=r&&Jg(r).some(function(e){return e===t})}(n,e),o=e,i=o.colSpan,a=void 0===i?1:i,s=o.rowSpan,u=void 0===s?1:s,l=o.isHeader,c=void 0!==l&&l,d=o.hidden,f=void 0!==d&&d,p=av.isSelected(n,e);return wl(r&&c?"th":"td",{colSpan:a,rowSpan:u,"data-block-type":"table-cell",className:p?"w-e-selected":"",style:{display:f?"none":""}},t)}};function Am(e,t){null==e.data&&(e.data={});var n=e.data;null==n.style&&(n.style={}),Object.assign(n.style,t)}var Sm=new Set(["solid","dotted","dashed","double","groove","ridge","inset","outset"]),xm=new Set;function Tm(e){return"".concat(e||"").trim().toLowerCase().replace(/\s+/g," ")}var Nm={renderStyle:function(e,t){var n,r;if(!Pn.Element.isElement(e))return t;var o=e,i=o.backgroundColor,a=o.borderWidth,s=o.borderStyle,u=o.borderColor,l=o.textAlign,c=o.verticalAlign,d={};if(i&&(d.backgroundColor=i),a){/^\d+(\.\d+)?$/.test(a)?d.borderWidth="".concat(a,"px"):d.borderWidth=a}s&&(d.borderStyle="none"===s?"":s),u&&(d.borderColor=u),l&&(d.textAlign=l),c&&(d.verticalAlign=c);var f=t;return"table"===e.type?Am(null===(r=(null===(n=f.children)||void 0===n?void 0:n[0]).children)||void 0===r?void 0:r[0],d):Am(f,d),f},styleToHtml:function(e,t,n){if("table"!==e.type&&"table-cell"!==e.type)return t;var r=e.backgroundColor,o=e.borderWidth,i=e.borderStyle,a=e.borderColor,s=e.textAlign,u=e.verticalAlign;if(!(r||o||i||a||s||u))return t;var l=zr(t);if("class"===Ul(n)){if(r&&(l.attr("bgcolor",r),l.attr("data-w-e-background-color",r)),o){var c="".concat(o).trim();c&&(l.attr("data-w-e-border-width",c),l.attr("border",c))}if(i){var d=Tm(i),f=function(e,t){var n=Tm(t);if(!n||"none"===n)return"skip";if(Sm.has(n))return"class";var r=Vl(e),o="preserve-data";"fallback-inline"===r&&(o="inline"),"strict"===r&&(o="throw");var i='[wangeditor] Unsupported table border-style token "'.concat(n,'" in class mode. policy=').concat(r),a="".concat(n,"|").concat(o);if(xm.has(a)||(xm.add(a),Wl(e,{type:"table-border-style",value:n,scene:"toHtml",fallback:o,message:i})),"throw"===o)throw new Error(i);return"inline"===o?"inline":"preserve-data"}(n,d);"skip"!==f&&l.attr("data-w-e-border-line",d),"class"===f?l.addClass(function(e){var t=(e||"").trim().toLowerCase();return t&&"none"!==t?"w-e-table-border-style-".concat(t):""}(d)):"inline"===f&&l.css("border-style",d)}return a&&(l.attr("bordercolor",a),l.attr("data-w-e-border-color",a)),s&&(l.attr("align",s),l.attr("data-w-e-text-align",s)),u&&(l.attr("valign",u),l.attr("data-w-e-vertical-align",u)),_g(l)}return r&&l.css("background-color",r),o&&l.css("border-width","".concat(o,"px")),i&&l.css("border-style","none"===i?"":i),a&&l.css("border-color",a),s&&l.css("text-align",s),u&&l.css("vertical-align",u),_g(l)},parseStyleHtml:function(e,t,n){if(!["TABLE","TD","TH"].includes(e.tagName))return t;var r=zr(e),o=t,i=Rg(r,"background-color");i||(i=Rg(r,"background")),i||(i=r.attr("bgcolor")||""),i||(i=r.attr("data-w-e-background-color")||""),i&&(o.backgroundColor=i);for(var a=Rg(r,"border"),s=r.attr("data-w-e-border-width")||"",u=r.attr("data-w-e-border-line")||"",l=r.attr("data-w-e-border-color")||"",c=r.attr("border")||"",d=r.attr("bordercolor")||"",p=(r.attr("class")||"").trim().split(/\s+/).filter(Boolean),h="",g=0;g<p.length;g+=1){var v=p[g];if(v.startsWith("w-e-table-border-style-")){h=v.replace("w-e-table-border-style-","");break}}var m=!!(s||u||l||c||d||h);a||"TD"!==e.tagName||m||(a="1px solid ".concat(Nv));var y,b=f((null==a?void 0:a.split(" "))||[],3),E=b[0],w=b[1],C=b[2];(E=Rg(r,"border-width")||E)||(E=s),E||(E=c),E&&(o.borderWidth=(y=E.trim())&&"string"==typeof y&&y.includes("pt")?y.replace(/(\d+(\.\d+)?)\s*pt/g,function(e,t){var n=(4*parseFloat(t)/3).toFixed(2);return"".concat(n,"px")}):y),(w=Rg(r,"border-style")||w)||(w=u),w||(w=h),w&&(o.borderStyle="none"===w?"":w),(C=Rg(r,"border-color")||C)||(C=d),C||(C=l),C&&(o.borderColor=C);var D=Rg(r,"text-align");(D=Rg(r,"text-align")||D)||(D=r.attr("align")||""),D||(D=r.attr("data-w-e-text-align")||""),D&&(o.textAlign=D);var A=Rg(r,"vertical-align");return A||(A=r.attr("valign")||""),A||(A=r.attr("data-w-e-vertical-align")||""),A&&(o.verticalAlign=A),t},renderElems:[wm,Cm,Dm],elemsToHtml:[Sg,xg,Tg],preParseHtml:[_v],parseElemsHtml:[Av,Sv,Tv],menus:[cv,dv,fv,pv,hv,gv,vv,mv,yv,bv,Ev,wv],editorPlugin:function(e){var t=e.insertBreak,n=e.deleteBackward,r=e.deleteForward,o=e.normalizeNode,i=e.insertData,a=e.handleTab,s=e.selectAll,l=e.deleteFragment,c=e.transformInitialContent,d=e;d.transformInitialContent=function(e){return Xg(c?c(e):e)},d.insertBreak=function(){var e=Pn.Editor.above(d,{match:function(e){return Ei.checkNodeType(e,"table-cell")}});if(null!=e){var n=Pn.Editor.above(d,{match:function(e){return Pn.Element.isElement(e)&&!Ei.checkNodeType(e,"table-cell")}});null==n?d.insertText(Ov):t()}else t()},d.deleteBackward=function(e){if(!function(e){var t=e.selection;if(null==t||!Pn.Point.equals(t.anchor,t.focus))return!1;var n=f(Pn.Editor.nodes(e,{at:t,match:function(e){return Ei.checkNodeType(e,"table-cell")}}),1),r=n[0];if(null==r)return!1;var o=f(r,2),i=o[0],a=o[1],s=Pn.Editor.start(e,a);if(!Pn.Point.equals(t.anchor,s)||!Pn.Element.isElement(i))return!1;var u=f(i.children,2),l=u[0],c=u[1];if(!Pn.Element.isElement(l)||"paragraph"!==l.type||""!==Pn.Node.string(l)||!Pn.Element.isElement(c)||e.isInline(c)||!e.isVoid(c))return!1;var d=a.concat(1);return Pn.Transforms.select(e,Pn.Editor.start(e,d)),Pn.Transforms.removeNodes(e,{at:a.concat(0)}),Pn.Transforms.select(e,Pn.Editor.start(e,a.concat(0))),!0}(d)&&(!kv(d)&&!Fv(d,e,"backward"))){var t=d.selection;if(t){var r=Pn.Editor.before(d,t),o=Pn.Editor.above(d,{at:t,match:function(e){return Ei.checkNodeType(e,"table-cell")}});if(r){var i=Iv(d,r);if(!o&&i&&Pv(d))return}}n(e)}},d.handleTab=function(){if(Ei.getSelectedNodeByType(d,"table")){var t=Pn.Editor.above(e,{match:function(e){return Ei.checkNodeType(e,"table-cell")}}),n=Pn.Editor.above(e,{match:function(e){return Ei.checkNodeType(e,"table")}});if(t&&n){var r=f(t,2)[1],o=f(n,2)[1],i=Array.from(Pn.Editor.nodes(e,{at:o,match:function(e){return Ei.checkNodeType(e,"table-cell")&&!e.hidden}})),s=i.findIndex(function(e){var t=f(e,2)[1];return Pn.Path.equals(t,r)}),u=s>=0?i[s+1]:void 0;if(u)return void Pn.Transforms.select(e,Pn.Editor.start(e,u[1]));var l=Pn.Path.next(o);if(Pn.Node.has(e,l))return void Pn.Transforms.select(e,Pn.Editor.start(e,l))}var c=d.children||[],p=c.length;if(Ei.checkNodeType(c[p-1],"table")){var h=Ei.genEmptyParagraph();Pn.Transforms.insertNodes(d,h,{at:[p]}),d.handleTab()}}else a()},d.deleteForward=function(e){if(!kv(d)&&!Fv(d,e,"forward")){var t=d.selection;if(t){var n=Pn.Editor.after(d,t),o=Pn.Editor.above(d,{at:t,match:function(e){return Ei.checkNodeType(e,"table-cell")}});if(n){var i=Iv(d,n);if(!o&&i&&Pv(d))return}}r(e)}},d.normalizeNode=function(e){var t=f(e,2),n=t[0],r=t[1],i=Ei.getNodeType(n);if("table"!==i)return"table-cell"===i&&Pn.Element.isElement(n)&&0===n.children.length?void Pn.Transforms.insertNodes(d,Ei.genEmptyParagraph(),{at:r.concat(0)}):o([n,r]);if(Ei.isLastNode(d,n)){var a=Ei.genEmptyParagraph();Pn.Transforms.insertNodes(d,a,{at:[r[0]+1]})}},d.insertData=function(e){if(null!=Ei.getSelectedNodeByType(d,"table")){var t=e.getData("application/x-slate-fragment"),n=e.getData("text/html"),r=function(e,t){if(!t)return null;try{var n=decodeURIComponent(window.atob(t)),r=JSON.parse(n);return Bv(e,r)?r:null}catch(e){return null}}(d,t)||function(e,t){if(!t||!/<(p|ol|ul|li|pre|figure)\b/i.test(t))return null;var n=document.createElement("div");if(n.innerHTML=t,n.querySelector("table, img"))return null;var r=Qo(e,t);return Bv(e,r)?r:null}(d,n);if(r)Pn.Transforms.insertFragment(d,r);else{var o=e.getData("text/plain");"\n"===o||/<img[^>]+>/.test(n)?i(e):Pn.Editor.insertText(d,o)}}else i(e)},d.selectAll=function(){var e=d.selection;if(null!=e){var t=Ei.getSelectedNodeByType(d,"table-cell");if(null!=t&&Pn.Element.isElement(t)){var n=e.anchor,r=e.focus;if(Pn.Path.equals(n.path.slice(0,3),r.path.slice(0,3))){var o=Pn.Node.string(t);if(1===t.children.length&&Pn.Element.isElement(t.children[0])&&"paragraph"===t.children[0].type&&0===o.length)s();else{var i=Ei.findPath(d,t),a={anchor:Pn.Editor.start(d,i),focus:Pn.Editor.end(d,i)};d.select(a)}}else s()}else s()}else s()},d.deleteFragment=function(e){var t=Lg.get(d);if(t&&t.length>0){var n=[];t.forEach(function(e){e.forEach(function(e){var t=f(e[0],2)[1];n.some(function(e){return Pn.Path.equals(e,t)})||n.push(t)})});var r=n[0];if(n.forEach(function(t){if(Pn.Node.has(d,t)){var n=Pn.Editor.start(d,t),r=Pn.Editor.end(d,t);Pn.Transforms.select(d,{anchor:n,focus:r}),l(e)}}),av.unselect(d),r&&Pn.Node.has(d,r)){var o=Pn.Editor.start(d,r);Pn.Transforms.select(d,o)}}else l(e)},function(e){var t=e.apply;e.apply=function(n){if(!Pn.Operation.isSelectionOperation(n)||!n.newProperties)return t(n);var r=u(u({},e.selection),n.newProperties);if(!Pn.Range.isRange(r))return av.unselect(e),t(n);var o=function(e){return Pn.Element.isElement(e)&&("table-cell"===e.type||"th"===e.type||"td"===e.type)},i=f(Pn.Editor.nodes(e,{match:o,at:Pn.Range.start(r),mode:"lowest"}),1)[0],a=f(Pn.Editor.nodes(e,{match:o,at:Pn.Range.end(r),mode:"lowest"}),1)[0];if(!i||!a)return av.unselect(e),t(n);var s=f(i,2)[1],l=f(a,2)[1];if(Pn.Path.equals(s,l)||!kg(e,[s,l],"table"))return av.unselect(e),t(n);try{var c=Fg(e,{at:s});if(!c||0===c.length)return av.unselect(e),t(n);for(var d=Ig.valueOf(0,0),p=Ig.valueOf(0,0),h=!1,g=!1,v=0;v<c.length;v+=1)if(c[v])for(var m=0;m<c[v].length;m+=1)if(c[v][m]){var y=f(c[v][m],1),b=f(y[0],2)[1];Pn.Path.equals(s,b)&&(d.x=v,d.y=m,h=!0),Pn.Path.equals(l,b)&&(p.x=v,p.y=m,g=!0)}if(!h||!g)return av.unselect(e),t(n);for(var E=Ig.valueOf(Math.min(d.x,p.x),Math.min(d.y,p.y)),w=Ig.valueOf(Math.max(d.x,p.x),Math.max(d.y,p.y));;){var C=Ig.valueOf(E.x,E.y),D=Ig.valueOf(w.x,w.y);for(v=C.x;v<=D.x&&v<c.length;v+=1)if(c[v])for(m=C.y;m<=D.y&&m<c[v].length;m+=1)if(c[v][m]){var A=f(c[v][m],2)[1];if(A){var S=A.rtl,x=A.ltr,T=A.btt,N=A.ttb;C.x=Math.min(C.x,v-(N-1)),C.y=Math.min(C.y,m-(S-1)),D.x=Math.max(D.x,v+(T-1)),D.y=Math.max(D.y,m+(x-1))}}if(Ig.equals(E,C)&&Ig.equals(w,D))break;E=C,w=D}var O=[],B=new WeakSet;for(v=E.x;v<=w.x&&v<c.length;v+=1)if(c[v]){var k=[];for(m=E.y;m<=w.y&&m<c[v].length;m+=1)if(c[v][m]){var F=f(c[v][m],1),I=f(F[0],1)[0];I&&(B.add(I),k.push(c[v][m]))}k.length>0&&O.push(k)}Lg.set(e,O),Mg.set(e,B)}catch(r){return av.unselect(e),t(n)}t(n)}}(d),d.getTableSelection=function(){return Lg.get(d)||null};var p=d.addMark,h=d.removeMark,g=u({},Pn.Transforms);return d.addMark=function(e,t){var n=Lg.get(d);if(n&&n.length>0){var r=d.selection;n.forEach(function(n){n.forEach(function(n){var r=f(n[0],2)[1],o=Pn.Editor.start(d,r),i=Pn.Editor.end(d,r);Pn.Transforms.select(d,{anchor:o,focus:i}),p(e,t)})}),r&&Pn.Transforms.select(d,r)}else p(e,t)},d.removeMark=function(e){var t=Lg.get(d);if(t&&t.length>0){var n=d.selection;t.forEach(function(t){t.forEach(function(t){var n=f(t[0],2)[1],r=Pn.Editor.start(d,n),o=Pn.Editor.end(d,n);Pn.Transforms.select(d,{anchor:r,focus:o}),h(e)})}),n&&Pn.Transforms.select(d,n)}else h(e)},Pn.Transforms.setNodes=function(e,t,n){if(void 0===n&&(n={}),e===d){var r=Lg.get(d);if(r&&r.length>0)return"hidden"in t||"rowSpan"in t||"colSpan"in t?void g.setNodes(e,t,n):void r.forEach(function(r){r.forEach(function(r){var o=f(r[0],2)[1];g.setNodes(e,t,u(u({},n),{at:o}))})})}g.setNodes(e,t,n)},d}};Gs("en",{uploadImgModule:{uploadImage:"Upload Image",uploadError:"{{fileName}} upload error"}}),Gs("zh-CN",{uploadImgModule:{uploadImage:"上传图片",uploadError:"{{fileName}} 上传出错"}});lo&&(zr.fn.append=lo),Xr&&(zr.fn.on=Xr),vo&&(zr.fn.remove=vo),Yr&&(zr.fn.val=Yr),Eo&&(zr.fn.click=Eo),to&&(zr.fn.hide=to);var Om=new WeakMap;function Bm(e){return e.getMenuConfig("uploadImage")}function km(e,t){return l(this,void 0,void 0,function(){return c(this,function(n){return[2,new Promise(function(n){var r=new FileReader;r.readAsDataURL(t),r.onload=function(){var o=r.result;if(o){var i=o.toString(),a=0===i.indexOf("data:image")?"":i;Ud(e,i,t.name,a),n("ok")}}})]})})}function Fm(e,t){return l(this,void 0,void 0,function(){var n,r;return c(this,function(o){switch(o.label){case 0:return n=function(e){var t=Om.get(e);if(null!=t)return t;var n=Bm(e),r=n.onSuccess,o=n.onProgress,i=n.onFailed,a=n.customInsert,s=n.onError;return t=On(u(u({},n),{onProgress:function(t){e.showProgressBar(t),o&&o(t)},onSuccess:function(t,n){if(a)return a(n,function(t,n,r){return Ud(e,t,n,r)}),void r(t,n);var o=n.errno,s=void 0===o?1:o,u=n.data,l=void 0===u?{}:u;if(0===s){if(Array.isArray(l))l.forEach(function(t){var n=t.url,r=void 0===n?"":n,o=t.alt,i=void 0===o?"":o,a=t.href;Ud(e,r,i,void 0===a?"":a)});else{var c=l.url,d=void 0===c?"":c,f=l.alt,p=void 0===f?"":f,h=l.href;Ud(e,d,p,void 0===h?"":h)}r(t,n)}else i(t,n)},onError:function(e,t,n){s(e,t,n)}}),e),Om.set(e,t),t}(e),r=t.map(function(e){return{name:e.name,type:e.type,size:e.size,data:e}}),n.addFiles(r),[4,n.upload()];case 1:return o.sent(),[2]}})})}function Im(e,t){return l(this,void 0,void 0,function(){var n,r,o,i,a,s,u,l,d,f,p,g,v,m,y;return c(this,function(c){switch(c.label){case 0:if(null==t)return[2];n=Array.prototype.slice.call(t),r=Bm(e),o=r.customUpload,i=r.base64LimitSize,a=[],c.label=1;case 1:c.trys.push([1,10,11,16]),s=!0,u=h(n),c.label=2;case 2:return[4,u.next()];case 3:return l=c.sent(),(g=l.done)?[3,9]:(y=l.value,s=!1,f=(d=y).size,i&&f<=i?[4,km(e,d)]:[3,5]);case 4:return c.sent(),[3,8];case 5:return o?[4,o(d,function(t,n,r){return Ud(e,t,n,r)},e)]:[3,7];case 6:return c.sent(),[3,8];case 7:a.push(d),c.label=8;case 8:return s=!0,[3,2];case 9:return[3,16];case 10:return p=c.sent(),v={error:p},[3,16];case 11:return c.trys.push([11,,14,15]),s||g||!(m=u.return)?[3,13]:[4,m.call(u)];case 12:c.sent(),c.label=13;case 13:return[3,15];case 14:if(v)throw v.error;return[7];case 15:return[7];case 16:return a.length>0?[4,Fm(e,a)]:[3,18];case 17:c.sent(),c.label=18;case 18:return[2]}})})}var Pm=function(){function e(){this.title=Ks("uploadImgModule.uploadImage"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M828.708571 585.045333a48.761905 48.761905 0 0 0-48.737523 48.761905v18.529524l-72.143238-72.167619a135.972571 135.972571 0 0 0-191.585524 0l-34.133334 34.133333-120.880762-120.953905a138.898286 138.898286 0 0 0-191.585523 0l-72.167619 72.167619V292.400762a48.786286 48.786286 0 0 1 48.761904-48.761905h341.23581a48.737524 48.737524 0 0 0 34.474667-83.285333 48.737524 48.737524 0 0 0-34.474667-14.287238H146.236952A146.212571 146.212571 0 0 0 0 292.400762v585.289143A146.358857 146.358857 0 0 0 146.236952 1024h584.996572a146.212571 146.212571 0 0 0 146.236952-146.310095V633.807238a48.786286 48.786286 0 0 0-48.761905-48.761905zM146.261333 926.45181a48.737524 48.737524 0 0 1-48.761904-48.761905v-174.128762l141.409523-141.458286a38.497524 38.497524 0 0 1 53.126096 0l154.526476 154.624 209.627428 209.724953H146.236952z m633.734096-48.761905c-0.073143 9.337905-3.145143 18.383238-8.777143 25.843809l-219.843048-220.94019 34.133333-34.133334a37.546667 37.546667 0 0 1 53.613715 0l140.873143 141.897143V877.714286zM1009.615238 160.231619L863.329524 13.897143a48.737524 48.737524 0 0 0-16.091429-10.24c-11.849143-4.87619-25.161143-4.87619-37.059047 0a48.761905 48.761905 0 0 0-16.067048 10.24l-146.236952 146.334476a49.005714 49.005714 0 0 0 69.217523 69.241905l62.902858-63.390476v272.627809a48.761905 48.761905 0 1 0 97.475047 0V166.083048l62.902857 63.390476a48.737524 48.737524 0 0 0 69.217524 0 48.761905 48.761905 0 0 0 0-69.241905z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.isDisabled=function(e){return Hd(e)},e.prototype.getMenuConfig=function(e){return e.getMenuConfig("uploadImage")},e.prototype.exec=function(e,t){var n=this.getMenuConfig(e),r=n.allowedFileTypes,o=void 0===r?[]:r,i=n.customBrowseAndUpload;if(i)i(function(t,n,r){return Ud(e,t,n,r)});else{var a="";o.length>0&&(a='accept="'.concat(o.join(", "),'"'));var s=zr("body"),u=zr('<input type="file" '.concat(a," multiple/>"));u.hide(),s.append(u),u.click(),u.on("change",function(){var t=u[0].files;Im(e,t)})}},e}();var Rm={menus:[{key:"uploadImage",factory:function(){return new Pm},config:{server:"",fieldName:"wangeditor-uploaded-image",maxFileSize:2097152,maxNumberOfFiles:100,allowedFileTypes:["image/*"],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:1e4,onBeforeUpload:function(e){return e},onProgress:function(e){},onSuccess:function(e,t){},onFailed:function(e,t){console.error("'".concat(e.name,"' upload failed"),t)},onError:function(e,t,n){console.error("'".concat(e.name,"' upload error"),n)},base64LimitSize:0}}],editorPlugin:function(e){var t=e.insertData,n=e;return n.insertData=function(r){if(Hd(n))t(r);else if(r.getData("text/plain"))t(r);else{var o=r.files;if(o.length<=0)t(r);else Array.prototype.slice.call(o).some(function(e){return"image"===f(e.type.split("/"),1)[0]})?Im(e,o):t(r)}},n}};function _m(e){return e.length?e[0].tagName.toLowerCase():""}function Lm(e,t,n,r,o){void 0===t&&(t="auto"),void 0===n&&(n="auto"),void 0===r&&(r={}),void 0===o&&(o=!1);var i=zr(e),a=r.width,s=void 0===a?"":a,u=r.height,l=void 0===u?"":u,c=s?'data-w-e-style-width="'.concat(s,'"'):"",d=l?'data-w-e-style-height="'.concat(l,'"'):"";if(i.attr("width",t),i.attr("height",n),o)c&&i.attr("data-w-e-style-width",s),d&&i.attr("data-w-e-style-height",l),i.removeAttr("style");else{var f="display: block; max-width: 100%;";s&&(f+=" width: ".concat(s,";")),l&&(f+=" height: ".concat(l,";")),i.attr("style",f)}return i[0].outerHTML}Gs("en",{videoModule:{delete:"Delete",uploadVideo:"Upload video",insertVideo:"Insert video",videoSrc:"Video source",videoSrcPlaceHolder:"Video file url, or third-party <iframe>",videoPoster:"Video poster",videoPosterPlaceHolder:"Poster image url",ok:"Ok",editSize:"Edit size",edit:"Edit video",width:"Width",height:"Height",alignLeft:"Align video left",alignCenter:"Center video",alignRight:"Align video right"}}),Gs("zh-CN",{videoModule:{delete:"删除视频",uploadVideo:"上传视频",insertVideo:"插入视频",videoSrc:"视频地址",videoSrcPlaceHolder:"视频文件 url 或第三方 <iframe>",videoPoster:"视频封面",videoPosterPlaceHolder:"封面图片 url",ok:"确定",editSize:"修改尺寸",edit:"编辑视频",width:"宽度",height:"高度",alignLeft:"视频左对齐",alignCenter:"视频居中",alignRight:"视频右对齐"}}),lo&&(zr.fn.append=lo),Xr&&(zr.fn.on=Xr),wo&&(zr.fn.focus=wo),Wr&&(zr.fn.attr=Wr),Yr&&(zr.fn.val=Yr),ao&&(zr.fn.html=ao),fo&&(zr.fn.parent=fo),Vr&&(zr.fn.hasClass=Vr),mo&&(zr.fn.empty=mo);var Mm="center",jm=["left","center","right"];function Hm(e){if("string"!=typeof e)return Mm;var t=e.trim().toLowerCase();return jm.includes(t)?t:Mm}function zm(e){var t=e.align;return Hm(t||e.textAlign)}function $m(e){return"w-e-video-align-".concat(e)}var Um={type:"video",elemToHtml:function(e,t,n){var r=e,o=r.src,i=void 0===o?"":o,a=r.poster,s=void 0===a?"":a,u=r.width,l=void 0===u?"auto":u,c=r.height,d=void 0===c?"auto":c,f=r.style,p=void 0===f?{}:f,h=Ul(n),g=zm(e),v=' data-w-e-align="'.concat(g,'"'),m="class"===h?"".concat(v,' class="w-e-video ').concat($m(g),'"'):"".concat(v,' style="display: flex; justify-content: ').concat(function(e){return"left"===e?"flex-start":"right"===e?"flex-end":"center"}(g),'; margin: 0; max-width: 100%; width: 100%;"'),y='<figure data-w-e-type="video" data-w-e-is-void'.concat(m,">\n");if(0===i.trim().indexOf("<iframe ")){y+=Lm(i,l,d,p,"class"===h)}else{var b=p.width,E=void 0===b?"":b,w=p.height,C=void 0===w?"":w;if("class"===h){var D=E?' data-w-e-style-width="'.concat(E,'"'):"",A=C?' data-w-e-style-height="'.concat(C,'"'):"";y+='<video poster="'.concat(s,'" controls="true" width="').concat(l,'" height="').concat(d,'"').concat(D).concat(A,'><source src="').concat(i,'" type="video/mp4"/></video>')}else{var S="display: block; max-width: 100%;";E&&(S+=" width: ".concat(E,";")),C&&(S+=" height: ".concat(C,";")),y+='<video poster="'.concat(s,'" controls="true" width="').concat(l,'" height="').concat(d,'" style="').concat(S,'"><source src="').concat(i,'" type="video/mp4"/></video>')}}return y+="\n</figure>"}};function Vm(e){return void 0===e&&(e="r"),"".concat(e,"-").concat(Cn())}function Wm(e){var t={};return e.trim().split(";").forEach(function(e){if(e){var n=f(e.split(":"),2),r=n[0],o=n[1];r&&o&&(t[r.trim()]=o.trim())}}),t}function Gm(){return Vm("w-e-insert-video")}var qm=function(){function e(){this.title=Ks("videoModule.editSize"),this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=Gm(),this.heightInputId=Gm(),this.buttonId=Gm()}return e.prototype.getSelectedVideoNode=function(e){return Ei.getSelectedNodeByType(e,"video")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedVideoNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedVideoNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=t.widthInputId,r=t.heightInputId,o=t.buttonId,i=f(iu(Ks("videoModule.width"),n,"auto"),2),a=i[0],s=zr(i[1]),l=f(iu(Ks("videoModule.height"),r,"auto"),2),c=l[0],d=zr(l[1]),p=f(au(o,Ks("videoModule.ok")),1)[0],h=this.getSelectedVideoNode(e);if(null==this.$content){var g=zr("<div></div>");g.on("click","#".concat(o),function(t){t.preventDefault();var o=g.find("#".concat(n)).val().trim(),i=g.find("#".concat(r)).val().trim(),a=function(e){return/^\d+(\.\d+)?%$/.test(e)},s=function(e){return/^\d+(\.\d+)?$/.test(e)},l="auto",c="auto";a(o)?l=o:s(o)&&(l="".concat(parseInt(o,10),"px")),a(i)?c=i:s(i)&&(c="".concat(parseInt(i,10),"px"));var d=h.style,f=void 0===d?{}:d;e.restoreSelection();var p={style:u(u({},f),{width:l,height:c})};Pn.Transforms.setNodes(e,p,{match:function(e){return Ei.checkNodeType(e,"video")}}),e.hidePanelOrModal()}),this.$content=g}var v=this.$content;if(v.empty(),v.append(a),v.append(c),v.append(p),null==h)return v[0];var m=h.style,y=void 0===m?{}:m,b=y.width,E=void 0===b?"":b,w=y.height,C=void 0===w?"":w;return s.val(E),d.val(C),setTimeout(function(){s.focus()}),v[0]},e}();function Km(){return Vm("w-e-edit-video")}var Ym=function(){function e(){this.title=Ks("videoModule.edit"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=Km(),this.posterInputId=Km(),this.buttonId=Km()}return e.prototype.getSelectedVideoNode=function(e){return Ei.getSelectedNodeByType(e,"video")},e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedVideoNode(e)},e.prototype.getModalPositionNode=function(e){return this.getSelectedVideoNode(e)},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.posterInputId,i=n.buttonId,a=f(iu(Ks("videoModule.videoSrc"),r,Ks("videoModule.videoSrcPlaceHolder")),2),s=a[0],u=a[1],d=f(iu(Ks("videoModule.videoPoster"),o,Ks("videoModule.videoPosterPlaceHolder")),2),p=d[0],h=d[1],g=zr(u),v=zr(h),m=f(au(i,Ks("videoModule.ok")),1)[0];if(null==this.$content){var y=zr("<div></div>");y.on("click","#".concat(i),function(n){return l(t,void 0,void 0,function(){var t,i,a,s;return c(this,function(u){return n.preventDefault(),t=y.find("#".concat(r)).val().trim(),i=y.find("#".concat(o)).val().trim(),a=Vm("video-"),s={src:t,poster:i,key:a},e.restoreSelection(),Pn.Transforms.setNodes(e,s,{match:function(e){return Ei.checkNodeType(e,"video")}}),e.hidePanelOrModal(),[2]})})}),this.$content=y}var b=this.$content;b.empty(),b.append(s),b.append(p),b.append(m);var E=this.getSelectedVideoNode(e);if(null==E)return b[0];var w=E.src,C=void 0===w?"":w,D=E.poster,A=void 0===D?"":D;return g.val(C),v.val(A),setTimeout(function(){g.focus()}),b[0]},e}();function Xm(e,t){return l(this,arguments,void 0,function(e,t,n,r,o){var i,a,s,u,l,d,f,p;return void 0===n&&(n=""),void 0===r&&(r=""),void 0===o&&(o=""),c(this,function(c){switch(c.label){case 0:return t?(e.restoreSelection(),i=e.getMenuConfig("insertVideo"),a=i.onInsertedVideo,s=i.checkVideo,u=i.parseVideoSrc,[4,s(t,n)]):[2];case 1:return"string"==typeof(l=c.sent())?(e.alert(l,"error"),[2]):null==l?[2]:[4,u(t)];case 2:return 0!==(d=c.sent()).trim().indexOf("<iframe ")&&(d=function(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}(d)),f={type:"video",src:d,poster:n,align:"center",children:[{text:""}],style:{width:r,height:o}},p=null!=Ei.getSelectedNodeByType(e,"table-cell"),Promise.resolve().then(function(){!p&&Ei.isSelectedEmptyParagraph(e)&&Pn.Transforms.removeNodes(e,{mode:"highest"}),p?Pn.Transforms.insertNodes(e,f):Pn.Transforms.insertNodes(e,f,{mode:"highest"})}),a(f),[2]}})})}function Zm(){return Vm("w-e-insert-video")}var Jm=function(){function e(){this.title=Ks("videoModule.insertVideo"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=320,this.$content=null,this.srcInputId=Zm(),this.posterInputId=Zm(),this.buttonId=Zm()}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Pn.Range.isCollapsed(t)||!!Ei.getSelectedElems(e).some(function(t){return"pre"===Ei.getNodeType(t)||!!e.isVoid(t)}))},e.prototype.getModalPositionNode=function(e){return null},e.prototype.getModalContentElem=function(e){var t=this,n=this,r=n.srcInputId,o=n.posterInputId,i=n.buttonId,a=f(iu(Ks("videoModule.videoSrc"),r,Ks("videoModule.videoSrcPlaceHolder")),2),s=a[0],u=a[1],d=f(iu(Ks("videoModule.videoPoster"),o,Ks("videoModule.videoPosterPlaceHolder")),2),p=d[0],h=d[1],g=zr(u),v=zr(h),m=f(au(i,Ks("videoModule.ok")),1)[0];if(null==this.$content){var y=zr("<div></div>");y.on("click","#".concat(i),function(n){return l(t,void 0,void 0,function(){var t,i;return c(this,function(a){switch(a.label){case 0:return n.preventDefault(),t=y.find("#".concat(r)).val().trim(),i=y.find("#".concat(o)).val().trim(),[4,Xm(e,t,i)];case 1:return a.sent(),e.hidePanelOrModal(),[2]}})})}),this.$content=y}var b=this.$content;return b.empty(),b.append(s),b.append(p),b.append(m),g.val(""),v.val(""),setTimeout(function(){g.focus()}),b[0]},e}();function Qm(e){return e.getMenuConfig("uploadVideo")}var ey=new WeakMap;function ty(e,t){return l(this,void 0,void 0,function(){var n,r;return c(this,function(o){switch(o.label){case 0:return n=function(e){var t=ey.get(e);if(null!=t)return t;var n=Qm(e),r=n.onSuccess,o=n.onProgress,i=n.onFailed,a=n.customInsert,s=n.onError;return t=On(u(u({},n),{onProgress:function(t){e.showProgressBar(t),o&&o(t)},onSuccess:function(t,n){if(a)return a(n,function(t,n){return Xm(e,t,n)}),void r(t,n);var o=n.errno,s=void 0===o?1:o,u=n.data,l=void 0===u?{}:u;if(0===s){var c=l.url,d=void 0===c?"":c,f=l.poster;Xm(e,d,void 0===f?"":f),r(t,n)}else i(t,n)},onError:function(e,t,n){s(e,t,n)}}),e),ey.set(e,t),t}(e),r=t.map(function(e){return{name:e.name,type:e.type,size:e.size,data:e}}),n.addFiles(r),[4,n.upload()];case 1:return o.sent(),[2]}})})}var ny=function(){function e(){this.title=Ks("videoModule.uploadVideo"),this.iconSvg='<svg viewBox="0 0 1056 1024"><path d="M805.902261 521.819882a251.441452 251.441452 0 0 0-251.011972 246.600033 251.051015 251.051015 0 1 0 502.023944 8.823877 253.237463 253.237463 0 0 0-251.011972-255.42391z m59.463561 240.001647v129.898403h-116.701631v-129.898403h-44.041298l101.279368-103.504859 101.279368 103.504859z" p-id="6802"></path><path d="M788.254507 0.000781H99.094092A98.663439 98.663439 0 0 0 0.001171 99.093701v590.067495a98.663439 98.663439 0 0 0 99.092921 99.092921h411.7549a266.434235 266.434235 0 0 1-2.186448-41.815807 275.843767 275.843767 0 0 1 275.180024-270.729042 270.650955 270.650955 0 0 1 103.504859 19.834201V99.093701A101.51363 101.51363 0 0 0 788.254507 0.000781zM295.054441 640.747004V147.507894l394.146189 246.600033z"></path></svg>',this.tag="button"}return e.prototype.getValue=function(e){return""},e.prototype.isActive=function(e){return!1},e.prototype.exec=function(e,t){var n=this.getMenuConfig(e),r=n.allowedFileTypes,o=void 0===r?[]:r,i=n.customBrowseAndUpload;if(i)i(function(t,n){return Xm(e,t,n)});else{var a="";o.length>0&&(a='accept="'.concat(o.join(", "),'"'));var s=zr("body"),u=zr('<input type="file" '.concat(a," multiple/>"));u.hide(),s.append(u),u.click(),u.on("change",function(){var t=u[0].files;!function(e,t){l(this,void 0,void 0,function(){var n,r,o,i,a,s,u,l,d,f,p,g;return c(this,function(c){switch(c.label){case 0:if(null==t)return[2];n=Array.prototype.slice.call(t),r=[],o=Qm(e).customUpload,c.label=1;case 1:c.trys.push([1,8,9,14]),i=!0,a=h(n),c.label=2;case 2:return[4,a.next()];case 3:return s=c.sent(),(d=s.done)?[3,7]:(g=s.value,i=!1,u=g,o?[4,o(u,function(t,n){return Xm(e,t,n)},e)]:[3,5]);case 4:return c.sent(),[3,6];case 5:r.push(u),c.label=6;case 6:return i=!0,[3,2];case 7:return[3,14];case 8:return l=c.sent(),f={error:l},[3,14];case 9:return c.trys.push([9,,12,13]),i||d||!(p=a.return)?[3,11]:[4,p.call(a)];case 10:c.sent(),c.label=11;case 11:return[3,13];case 12:if(f)throw f.error;return[7];case 13:return[7];case 14:return r.length>0?[4,ty(e,r)]:[3,16];case 15:c.sent(),c.label=16;case 16:return[2]}})})}(e,t)})}},e.prototype.isDisabled=function(e){var t=e.selection;return null==t||(!Pn.Range.isCollapsed(t)||!!Ei.getSelectedElems(e).some(function(t){return"pre"===Ei.getNodeType(t)||!!e.isVoid(t)}))},e.prototype.getMenuConfig=function(e){return e.getMenuConfig("uploadVideo")},e}(),ry=function(){function e(e,t,n){this.align=e,this.iconSvg=n,this.tag="button",this.title=Ks(t)}return e.prototype.getSelectedVideo=function(e){return Ei.getSelectedNodeByType(e,"video")},e.prototype.getValue=function(e){var t=this.getSelectedVideo(e);return!!t&&zm(t)},e.prototype.isActive=function(e){return this.getValue(e)===this.align},e.prototype.isDisabled=function(e){return null==e.selection||null==this.getSelectedVideo(e)},e.prototype.exec=function(e,t){if(!this.isDisabled(e)){var n={align:this.align};Pn.Transforms.setNodes(e,n,{match:function(e){return Ei.checkNodeType(e,"video")}})}},e}();function oy(e,t,n,r,o,i){return void 0===t&&(t=""),void 0===n&&(n="auto"),void 0===r&&(r="auto"),void 0===o&&(o={}),void 0===i&&(i="center"),{type:"video",src:e,poster:t,width:n,height:r,style:o,children:[{text:""}],align:i}}function iy(e){var t=(e.attr("data-w-e-align")||"").trim();if(t)return Hm(t);var n=Wm(e.attr("style")||""),r=n["justify-content"];if("flex-start"===r)return"left";if("flex-end"===r)return"right";if("center"===r)return"center";var o=function(e){for(var t=(e.attr("class")||"").trim().split(/\s+/).filter(Boolean),n=0;n<t.length;n+=1){var r=t[n];if(r.startsWith("w-e-video-align-"))return r.replace("w-e-video-align-","")}return""}(e);if(o)return Hm(o);var i=n["text-align"],a=(e.attr("data-w-e-text-align")||"").trim();return Hm(i||a)}function ay(e){var t=Wm(e),n={};return t.width&&(n.width=t.width),t.height&&(n.height=t.height),n}var sy={selector:'figure[data-w-e-type="video"],div[data-w-e-type="video"]',parseElemHtml:function(e,t,n){var r=zr(e),o="",i="",a="auto",s="auto",u={},l=r.find("iframe");if(l.length>0){a=l.attr("width")||"auto",s=l.attr("height")||"auto",u=ay(l.attr("style")||"");var c=l.attr("data-w-e-style-width")||"",d=l.attr("data-w-e-style-height")||"";return!u.width&&c&&(u.width=c),!u.height&&d&&(u.height=d),oy(o=l[0].outerHTML,i,a,s,u,iy(r))}var f=r.find("video");(o=f.attr("src")||"")||f.length>0&&(o=f.find("source").attr("src")||""),a=f.attr("width")||"auto",s=f.attr("height")||"auto",i=f.attr("poster")||"",u=ay(f.attr("style")||"");var p=f.attr("data-w-e-style-width")||"",h=f.attr("data-w-e-style-height")||"";return!u.width&&p&&(u.width=p),!u.height&&h&&(u.height=h),oy(o,i,a,s,u,iy(r))}};var uy={selector:"iframe,video,p",preParseHtml:function(e){var t=zr(e),n=t;if("p"===_m(t)){var r=t.children();if(1===r.length){var o=r[0],i=o.tagName.toLowerCase();["iframe","video"].includes(i)&&(n=zr(o))}}var a=_m(n);if("iframe"!==a&&"video"!==a)return n[0];if("video"===n.parent().attr("data-w-e-type"))return n[0];var s=zr('<figure data-w-e-type="video" data-w-e-is-void data-w-e-align="center" class="w-e-video w-e-video-align-center"></figure>');return s.append(n),s[0]}};var ly={type:"video",renderElem:function(e,t,n){var r,o=e,i=o.src,a=void 0===i?"":i,s=o.poster,u=void 0===s?"":s,l=o.key,c=void 0===l?"":l,d=o.width,f=void 0===d?"auto":d,p=o.height,h=void 0===p?"auto":p,g=o.style,v=void 0===g?{}:g,m=zm(e),y=["w-e-video","w-e-textarea-video-container",$m(m)].join(" "),b=Ei.isNodeSelected(n,e);if(0===a.trim().indexOf("<iframe ")){r=wl("figure",{className:y,"data-selected":b?"true":"","data-w-e-align":m,innerHTML:Lm(a,f,h,v)})}else{var E=wl("video",{key:c,poster:u,controls:!0,style:v},wl("source",{src:a,type:"video/mp4"}),"Sorry, your browser doesn't support embedded videos.\n 抱歉,浏览器不支持 video 视频");"auto"!==f&&(E.data.width=f),"auto"!==h&&(E.data.height=h),r=wl("figure",{className:y,"data-selected":b?"true":"","data-w-e-align":m},E)}var w=tl("div",{props:{contentEditable:!1},on:{mousedown:function(e){return e.preventDefault()}}},r);return w}},cy={renderElems:[ly],elemsToHtml:[Um],preParseHtml:[uy],parseElemsHtml:[sy],menus:[{key:"insertVideo",factory:function(){return new Jm},config:{onInsertedVideo:function(e){},checkVideo:function(e,t){return!0},parseVideoSrc:function(e){return e}}},{key:"uploadVideo",factory:function(){return new ny},config:{server:"",fieldName:"wangeditor-uploaded-video",maxFileSize:10485760,maxNumberOfFiles:5,allowedFileTypes:["video/*"],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:3e4,onBeforeUpload:function(e){return e},onProgress:function(e){},onSuccess:function(e,t){},onFailed:function(e,t){console.error("'".concat(e.name,"' upload failed"),t)},onError:function(e,t,n){console.error("'".concat(e.name," upload error"),t,n)}}},{key:"editVideoSize",factory:function(){return new qm}},{key:"editVideoSrc",factory:function(){return new Ym}},{key:"videoAlignLeft",factory:function(){return new ry("left","videoModule.alignLeft",'<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>')}},{key:"videoAlignCenter",factory:function(){return new ry("center","videoModule.alignCenter",'<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>')}},{key:"videoAlignRight",factory:function(){return new ry("right","videoModule.alignRight",'<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>')}}],editorPlugin:function(e){var t=e.isVoid,n=e.normalizeNode,r=e;return r.isVoid=function(e){return"video"===e.type||t(e)},r.normalizeNode=function(e){var t=f(e,2),o=t[0],i=t[1];"video"===Ei.getNodeType(o)&&(Ei.isLastNode(r,o)&&Pn.Transforms.insertNodes(r,Ei.genEmptyParagraph(),{at:[i[0]+1]}));return n([o,i])},r}},dy=function(){function e(){throw new Error("不能实例化\nCan not construct a instance")}return e.setEditorConfig=function(e){void 0===e&&(e={}),this.editorConfig=u(u({},this.editorConfig),e)},e.setSimpleEditorConfig=function(e){void 0===e&&(e={}),this.simpleEditorConfig=u(u({},this.simpleEditorConfig),e)},e.setToolbarConfig=function(e){void 0===e&&(e={}),this.toolbarConfig=u(u({},this.toolbarConfig),e)},e.setSimpleToolbarConfig=function(e){void 0===e&&(e={}),this.simpleToolbarConfig=u(u({},this.simpleToolbarConfig),e)},e.registerPlugin=function(e){this.plugins.push(e)},e.registerMenu=function(e,t){Qn(e,t)},e.registerRenderElem=function(e){var t,n,r;n=(t=e).type,r=t.renderElem,Sl[n||""]=r},e.registerRenderStyle=function(e){!function(e){Cl.push(e)}(e)},e.registerElemToHtml=function(e){!function(e){var t=e.type,n=e.elemToHtml;ai[t||""]=n}(e)},e.registerStyleToHtml=function(e){!function(e){ti.push(e)}(e)},e.registerHtmlTransform=function(e){!function(e){ni.push(e)}(e)},e.registerPreParseHtml=function(e){var t;t=e,Ho.push(t)},e.registerParseElemHtml=function(e){!function(e){var t=e.selector,n=e.parseElemHtml;$o[t]=n}(e)},e.registerParseStyleHtml=function(e){!function(e){zo.push(e)}(e)},e.registerModule=function(e){fy(e)},e.editorConfig={},e.simpleEditorConfig={},e.toolbarConfig={},e.simpleToolbarConfig={},e.plugins=[],e}();function fy(e){var t=e.menus,n=e.renderElems,r=e.renderStyle,o=e.elemsToHtml,i=e.styleToHtml,a=e.htmlTransform,s=e.preParseHtml,u=e.parseElemsHtml,l=e.parseStyleHtml,c=e.editorPlugin;t&&t.forEach(function(e){return dy.registerMenu(e)}),n&&n.forEach(function(e){return dy.registerRenderElem(e)}),r&&dy.registerRenderStyle(r),o&&o.forEach(function(e){return dy.registerElemToHtml(e)}),i&&dy.registerStyleToHtml(i),a&&dy.registerHtmlTransform(a),s&&s.forEach(function(e){return dy.registerPreParseHtml(e)}),u&&u.forEach(function(e){return dy.registerParseElemHtml(e)}),l&&dy.registerParseStyleHtml(l),c&&dy.registerPlugin(c)}nh.forEach(function(e){return fy(e)}),fy(Dg),fy(Nm),fy(cy),fy(Rm),fy(Eh);var py={link:{menuKeys:["editLink","unLink","viewLink"]},image:{menuKeys:["imageWidth30","imageWidth50","imageWidth100","editorImageSizeMenu","editImage","previewImage","viewImageLink","deleteImage"]},pre:{menuKeys:["enter","codeBlock","codeSelectLang"]},table:{menuKeys:["enter","tableHeader","tableFullWidth","insertTableRow","deleteTableRow","insertTableCol","deleteTableCol","deleteTable","mergeTableCell","splitTableCell","setTableProperty","setTableCellProperty"]},divider:{menuKeys:["enter"]},video:{menuKeys:["enter","videoAlignLeft","videoAlignCenter","videoAlignRight","editVideoSize","editVideoSrc"]}};var hy='<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>';var gy={hoverbarKeys:u(u({},py),{text:{menuKeys:["formatPainter","headerSelect","insertLink","bulletedList","|","bold","through","color","bgColor","clearStyle"]}})};dy.setEditorConfig(u(u({},gy),{decorate:vh}));var vy={hoverbarKeys:py};dy.setSimpleEditorConfig(u(u({},vy),{decorate:vh}));var my={toolbarKeys:["headerSelect","blockquote","|","bold","underline","italic",{key:"group-more-style",title:Ks("editor.more"),iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M204.8 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M505.6 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M806.4 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path></svg>',menuKeys:["through","wavyUnderline","emphasisDot","code","sup","sub","clearStyle"]},"color","bgColor","|","fontSize","fontFamily","lineHeight","|","bulletedList","numberedList","todo",{key:"group-justify",title:Ks("editor.justify"),iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>',menuKeys:["justifyLeft","justifyRight","justifyCenter","justifyJustify"]},{key:"group-indent",title:Ks("editor.indent"),iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>',menuKeys:["indent","delIndent"]},"|","emotion","insertLink",{key:"group-image",title:Ks("editor.image"),iconSvg:hy,menuKeys:["insertImage","uploadImage"]},{key:"group-video",title:Ks("editor.video"),iconSvg:'<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>',menuKeys:["insertVideo","uploadVideo"]},"insertTable","codeBlock","divider","|","undo","redo","|","formatPainter","fullScreen"]};dy.setToolbarConfig(my);var yy={toolbarKeys:["blockquote","header1","header2","header3","|","bold","underline","italic","through","color","bgColor","clearStyle","|","bulletedList","numberedList","todo","justifyLeft","justifyRight","justifyCenter","|","insertLink",{key:"group-image",title:Ks("editor.image"),iconSvg:hy,menuKeys:["insertImage","uploadImage"]},"insertVideo","insertTable","codeBlock","|","undo","redo","|","fullScreen"]};dy.setSimpleToolbarConfig(yy);e.Boot=dy,e.DomEditor=Ei,e.SlateEditor=Pn.Editor,e.SlateElement=Pn.Element,e.SlateNode=Pn.Node,e.SlatePath=Pn.Path,e.SlatePoint=Pn.Point,e.SlateRange=Pn.Range,e.SlateText=Pn.Text,e.SlateTransforms=Pn.Transforms,e.Toolbar=zl,e.createEditor=function(e){void 0===e&&(e={});var t=e.selector,n=void 0===t?"":t,r=e.content,o=void 0===r?[]:r,i=e.html,a=e.config,s=void 0===a?{}:a,l=e.mode,c="simple"===(void 0===l?"default":l)?dy.simpleEditorConfig:dy.editorConfig,d=u(u({},c.hoverbarKeys||{}),s.hoverbarKeys||{});return Hl({selector:n,config:u(u(u({},c),s),{hoverbarKeys:d}),content:o,html:i,plugins:dy.plugins})},e.createToolbar=function(e){var t=e.selector,n=e.editor,r=e.config,o=void 0===r?{}:r,i=e.mode,a=void 0===i?"default":i;if(!t)throw new Error("Cannot find 'selector' when create toolbar");var s="simple"===a?dy.simpleToolbarConfig:dy.toolbarConfig;return $l(n,{selector:t,config:u(u({},s),o)})},e.createUploader=On,e.default={},e.genModalButtonElems=au,e.genModalInputElems=iu,e.genModalTextareaElems=function(e,t,n){var r=zr('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=zr('<textarea type="text" id="'.concat(t,'" placeholder="').concat(n||"",'"></textarea>'));return r.append(o),[r[0],o[0]]},e.getClassStylePolicy=Vl,e.getTextStyleMode=Ul,e.i18nAddResources=Gs,e.i18nChangeLanguage=function(e){Vs.changeLanguage(e)},e.i18nGetResources=function(e){return Vs.getResourceBundle(e,Ws)},e.reportUnsupportedClassStyle=Wl,e.t=Ks,Object.defineProperty(e,"__esModule",{value:!0})});
21
- //# sourceMappingURL=index.js.map
63
+ * Prism: Lightweight, robust, elegant syntax highlighting
64
+ *
65
+ * @license MIT <https://opensource.org/licenses/MIT>
66
+ * @author Lea Verou <https://lea.verou.me>
67
+ * @namespace
68
+ * @public
69
+ */
70
+ var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++n}),e.__id},clone:function e(t,n){n=n||{};var r,a;switch(i.util.type(t)){case`Object`:if(a=i.util.objId(t),n[a])return n[a];for(var o in r={},n[a]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case`Array`:return a=i.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return`none`},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,`gi`),``),e.classList.add(`language-`+n)},currentScript:function(){if(typeof document>`u`)return null;if(document.currentScript&&document.currentScript.tagName===`SCRIPT`)return document.currentScript;try{throw Error()}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName(`script`);for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||i.languages;var a=r[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=r[e];return r[e]=o,i.languages.DFS(i.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,r,a){a=a||{};var o=i.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var c=t[s],l=i.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:`code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code`};i.hooks.run(`before-highlightall`,r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),i.hooks.run(`before-all-elements-highlight`,r);for(var a=0,o;o=r.elements[a++];)i.highlightElement(o,t===!0,r.callback)},highlightElement:function(t,n,r){var a=i.util.getLanguage(t),o=i.languages[a];i.util.setLanguage(t,a);var s=t.parentElement;s&&s.nodeName.toLowerCase()===`pre`&&i.util.setLanguage(s,a);var c={element:t,language:a,grammar:o,code:t.textContent};function l(e){c.highlightedCode=e,i.hooks.run(`before-insert`,c),c.element.innerHTML=c.highlightedCode,i.hooks.run(`after-highlight`,c),i.hooks.run(`complete`,c),r&&r.call(c.element)}if(i.hooks.run(`before-sanity-check`,c),s=c.element.parentElement,s&&s.nodeName.toLowerCase()===`pre`&&!s.hasAttribute(`tabindex`)&&s.setAttribute(`tabindex`,`0`),!c.code){i.hooks.run(`complete`,c),r&&r.call(c.element);return}if(i.hooks.run(`before-highlight`,c),!c.grammar){l(i.util.encode(c.code));return}if(n&&e.Worker){var u=new Worker(i.filename);u.onmessage=function(e){l(e.data)},u.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else l(i.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(i.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=i.tokenize(r.code,r.grammar),i.hooks.run(`after-tokenize`,r),a.stringify(i.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new c;return l(i,i.head,e),s(e,i,t,i.head,0),d(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:a};e.Prism=i;function a(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}a.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var r=``;return t.forEach(function(t){r+=e(t,n)}),r}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),i.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`&quot;`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function o(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function s(e,t,n,r,c,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=r.next,C=c;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof a)){var T=1,E;if(v){if(E=o(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,k=C;for(k+=S.value.length;D>=k;)S=S.next,k+=S.value.length;if(k-=S.value.length,C=k,S.value instanceof a)continue;for(var A=S;A!==t.tail&&(k<O||typeof A.value==`string`);A=A.next)T++,k+=A.value.length;T--,w=e.slice(C,k),E.index-=C}else if(E=o(x,0,w,_),!E)continue;var D=E.index,j=E[0],ee=w.slice(0,D),M=w.slice(D+j.length),N=C+w.length;d&&N>d.reach&&(d.reach=N);var te=S.prev;ee&&(te=l(t,te,ee),C+=ee.length),u(t,te,T);var P=new a(f,g?i.tokenize(j,g):j,y,j);if(S=l(t,te,P),M&&l(t,S,M),T>1){var ne={cause:f+`,`+m,reach:N};s(e,t,n,S.prev,C,ne),d&&ne.reach>d.reach&&(d.reach=ne.reach)}}}}}}function c(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function l(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function u(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function d(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}if(!e.document)return e.addEventListener&&(i.disableWorkerMessageHandler||e.addEventListener(`message`,function(t){var n=JSON.parse(t.data),r=n.language,a=n.code,o=n.immediateClose;e.postMessage(i.highlight(a,i.languages[r],r)),o&&e.close()},!1)),i;var f=i.util.currentScript();f&&(i.filename=f.src,f.hasAttribute(`data-manual`)&&(i.manual=!0));function p(){i.manual||i.highlightAll()}if(!i.manual){var m=document.readyState;m===`loading`||m===`interactive`&&f&&f.defer?document.addEventListener(`DOMContentLoaded`,p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return i}(typeof window<`u`?window:typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope?self:{});t!==void 0&&t.exports&&(t.exports=n),typeof global<`u`&&(global.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside[`attr-value`].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside[`internal-subset`].inside=n.languages.markup,n.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(n.languages.markup.tag,`addInlined`,{value:function(e,t){var r={};r[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+t]={pattern:/[\s\S]+/,inside:n.languages[t]};var a={};a[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:i},n.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(n.languages.markup.tag,`addAttribute`,{value:function(e,t){n.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:n.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend(`markup`,{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend(`clike`,{"class-name":[n.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),n.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),n.languages.markup&&(n.languages.markup.tag.addInlined(`script`,`javascript`),n.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),n.languages.js=n.languages.javascript,(function(){if(n===void 0||typeof document>`u`)return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=`Loading…`,t=function(e,t){return`✖ Error `+e+` while fetching file: `+t},r=`✖ Error: File does not exist or is empty`,i={js:`javascript`,py:`python`,rb:`ruby`,ps1:`powershell`,psm1:`powershell`,sh:`bash`,bat:`batch`,h:`c`,tex:`latex`},a=`data-src-status`,o=`loading`,s=`loaded`,c=`failed`,l=`pre[data-src]:not([`+a+`="`+s+`"]):not([`+a+`="`+o+`"])`;function u(e,n,i){var a=new XMLHttpRequest;a.open(`GET`,e,!0),a.onreadystatechange=function(){a.readyState==4&&(a.status<400&&a.responseText?n(a.responseText):a.status>=400?i(t(a.status,a.statusText)):i(r))},a.send(null)}function d(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||``);if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}n.hooks.add(`before-highlightall`,function(e){e.selector+=`, `+l}),n.hooks.add(`before-sanity-check`,function(t){var r=t.element;if(r.matches(l)){t.code=``,r.setAttribute(a,o);var f=r.appendChild(document.createElement(`CODE`));f.textContent=e;var p=r.getAttribute(`data-src`),m=t.language;if(m===`none`){var h=(/\.(\w+)$/.exec(p)||[,`none`])[1];m=i[h]||h}n.util.setLanguage(f,m),n.util.setLanguage(r,m);var g=n.plugins.autoloader;g&&g.loadLanguages(m),u(p,function(e){r.setAttribute(a,s);var t=d(r.getAttribute(`data-range`));if(t){var i=e.split(/\r\n?|\n/g),o=t[0],c=t[1]==null?i.length:t[1];o<0&&(o+=i.length),o=Math.max(0,Math.min(o-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(o,c).join(`
71
+ `),r.hasAttribute(`data-start`)||r.setAttribute(`data-start`,String(o+1))}f.textContent=e,n.highlightElement(f)},function(e){r.setAttribute(a,c),f.textContent=e})}}),n.plugins.fileHighlight={highlight:function(e){for(var t=(e||document).querySelectorAll(l),r=0,i;i=t[r++];)n.highlightElement(i)}};var f=!1;n.fileHighlight=function(){f||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),f=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()}))(),1);(function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;if(typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content===`/>`||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&n.length>0&&n[n.length-1].openedBraces===0){var c=o(i);r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(c+=o(t[r+1]),t.splice(r+1,1)),r>0&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(c=o(t[r-1])+c,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,c,null,c)}i.content&&typeof i.content!=`string`&&s(i.content)}};e.hooks.add(`after-tokenize`,function(e){e.language!==`jsx`&&e.language!==`tsx`||s(e.tokens)})})(Prism),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism),Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside[`attr-value`].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside[`internal-subset`].inside=Prism.languages.markup,Prism.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(Prism.languages.markup.tag,`addInlined`,{value:function(e,t){var n={};n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r[`language-`+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore(`markup`,`cdata`,i)}}),Object.defineProperty(Prism.languages.markup.tag,`addAttribute`,{value:function(e,t){Prism.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend(`markup`,{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,Prism.languages.go=Prism.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go[`class-name`],(function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:`boolean`},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:`important`},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:`class-name`},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:`function`},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:`type-casting`,greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:`type-hint`,greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:`return-type`,greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:`type-declaration`,greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:`type-declaration`,greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:`static-context`,greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:`class-name-fully-qualified`,greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:`class-name-fully-qualified`,greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:`class-name-fully-qualified`,greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:`type-declaration`,greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:[`class-name-fully-qualified`,`type-declaration`],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:`static-context`,greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:[`class-name-fully-qualified`,`static-context`],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:`type-hint`,greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:[`class-name-fully-qualified`,`type-hint`],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:`return-type`,greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:[`class-name-fully-qualified`,`return-type`],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},s=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:`nowdoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:`symbol`,inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:`symbol`,inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:`backtick-quoted-string`,greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:`single-quoted-string`,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:`double-quoted-string`,greedy:!0,inside:{interpolation:o}}];e.languages.insertBefore(`php`,`variable`,{string:s,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:s,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:`class-name`,greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:[`class-name`,`class-name-fully-qualified`],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:`punctuation`}}}}),e.hooks.add(`before-tokenize`,function(t){/<\?/.test(t.code)&&e.languages[`markup-templating`].buildPlaceholders(t,`php`,/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}),e.hooks.add(`after-tokenize`,function(t){e.languages[`markup-templating`].tokenizePlaceholders(t,`php`)})})(Prism),Prism.languages.c=Prism.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python[`string-interpolation`].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(Prism),(function(e){function t(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return`(?:`+t[+n]+`)`})}function n(e,n,r){return RegExp(t(e,n),r||``)}function r(e,t){for(var n=0;n<t;n++)e=e.replace(/<<self>>/g,function(){return`(?:`+e+`)`});return e.replace(/<<self>>/g,`[^\\s\\S]`)}var i={type:`bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void`,typeDeclaration:`class enum interface record struct`,contextual:`add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)`,other:`abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield`};function a(e){return`\\b(?:`+e.trim().replace(/ /g,`|`)+`)\\b`}var o=a(i.typeDeclaration),s=RegExp(a(i.type+` `+i.typeDeclaration+` `+i.contextual+` `+i.other)),c=a(i.typeDeclaration+` `+i.contextual+` `+i.other),l=a(i.type+` `+i.typeDeclaration+` `+i.other),u=r(`<(?:[^<>;=+\\-*/%&|^]|<<self>>)*>`,2),d=r(`\\((?:[^()]|<<self>>)*\\)`,2),f=`@?\\b[A-Za-z_]\\w*\\b`,p=t(`<<0>>(?:\\s*<<1>>)?`,[f,u]),m=t(`(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*`,[c,p]),h=`\\[\\s*(?:,\\s*)*\\]`,g=t(`<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?`,[m,h]),_=t(`(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?`,[t(`\\(<<0>>+(?:,<<0>>+)+\\)`,[t(`[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>`,[u,d,h])]),m,h]),v={keyword:s,punctuation:/[<>()?,.:[\]]/},y=`'(?:[^\\r\\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'`,b=`"(?:\\\\.|[^\\\\"\\r\\n])*"`,x=`@"(?:""|\\\\[\\s\\S]|[^\\\\"])*"(?!")`;e.languages.csharp=e.languages.extend(`clike`,{string:[{pattern:n(`(^|[^$\\\\])<<0>>`,[x]),lookbehind:!0,greedy:!0},{pattern:n(`(^|[^@$\\\\])<<0>>`,[b]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:n(`(\\busing\\s+static\\s+)<<0>>(?=\\s*;)`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)`,[f,_]),lookbehind:!0,inside:v},{pattern:n(`(\\busing\\s+)<<0>>(?=\\s*=)`,[f]),lookbehind:!0},{pattern:n(`(\\b<<0>>\\s+)<<1>>`,[o,p]),lookbehind:!0,inside:v},{pattern:n(`(\\bcatch\\s*\\(\\s*)<<0>>`,[m]),lookbehind:!0,inside:v},{pattern:n(`(\\bwhere\\s+)<<0>>`,[f]),lookbehind:!0},{pattern:n(`(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>`,[g]),lookbehind:!0,inside:v},{pattern:n(`\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))`,[_,l,f]),inside:v}],keyword:s,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore(`csharp`,`number`,{range:{pattern:/\.\./,alias:`operator`}}),e.languages.insertBefore(`csharp`,`punctuation`,{"named-parameter":{pattern:n(`([(,]\\s*)<<0>>(?=\\s*:)`,[f]),lookbehind:!0,alias:`punctuation`}}),e.languages.insertBefore(`csharp`,`class-name`,{namespace:{pattern:n(`(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])`,[f]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:n(`(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))`,[d]),lookbehind:!0,alias:`class-name`,inside:v},"return-type":{pattern:n(`<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))`,[_,m]),inside:v,alias:`class-name`},"constructor-invocation":{pattern:n(`(\\bnew\\s+)<<0>>(?=\\s*[[({])`,[_]),lookbehind:!0,inside:v,alias:`class-name`},"generic-method":{pattern:n(`<<0>>\\s*<<1>>(?=\\s*\\()`,[f,u]),inside:{function:n(`^<<0>>`,[f]),generic:{pattern:RegExp(u),alias:`class-name`,inside:v}}},"type-list":{pattern:n(`\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))`,[o,p,f,_,s.source,d,`\\bnew\\s*\\(\\s*\\)`]),lookbehind:!0,inside:{"record-arguments":{pattern:n(`(^(?!new\\s*\\()<<0>>\\s*)<<1>>`,[p,d]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:s,"class-name":{pattern:RegExp(_),greedy:!0,inside:v},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:`property`,inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:`keyword`}}}});var S=b+`|`+y,C=t(`\\/(?![*/])|\\/\\/[^\\r\\n]*[\\r\\n]|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>`,[S]),w=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),T=`\\b(?:assembly|event|field|method|module|param|property|return|type)\\b`,E=t(`<<0>>(?:\\s*\\(<<1>>*\\))?`,[m,w]);e.languages.insertBefore(`csharp`,`class-name`,{attribute:{pattern:n(`((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])`,[T,E]),lookbehind:!0,greedy:!0,inside:{target:{pattern:n(`^<<0>>(?=\\s*:)`,[T]),alias:`keyword`},"attribute-arguments":{pattern:n(`\\(<<0>>*\\)`,[w]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var D=`:[^}\\r\\n]+`,O=r(t(`[^"'/()]|<<0>>|\\(<<self>>*\\)`,[C]),2),k=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[O,D]),A=r(t(`[^"'/()]|\\/(?!\\*)|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|<<0>>|\\(<<self>>*\\)`,[S]),2),j=t(`\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}`,[A,D]);function ee(t,r){return{interpolation:{pattern:n(`((?:^|[^{])(?:\\{\\{)*)<<0>>`,[t]),lookbehind:!0,inside:{"format-string":{pattern:n(`(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)`,[r,D]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:`language-csharp`,inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore(`csharp`,`string`,{"interpolation-string":[{pattern:n(`(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[\\s\\S]|\\{\\{|<<0>>|[^\\\\{"])*"`,[k]),lookbehind:!0,greedy:!0,inside:ee(k,O)},{pattern:n(`(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"`,[j]),lookbehind:!0,greedy:!0,inside:ee(j,A)}],char:{pattern:RegExp(y),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp})(Prism),Prism.languages[`visual-basic`]={comment:{pattern:/(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,inside:{keyword:/^REM/i}},directive:{pattern:/#(?:Const|Else|ElseIf|End|ExternalChecksum|ExternalSource|If|Region)(?:\b_[ \t]*(?:\r\n?|\n)|.)+/i,alias:`property`,greedy:!0},string:{pattern:/\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,greedy:!0},date:{pattern:/#[ \t]*(?:\d+([/-])\d+\1\d+(?:[ \t]+(?:\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?))?|\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?)[ \t]*#/i,alias:`number`},number:/(?:(?:\b\d+(?:\.\d+)?|\.\d+)(?:E[+-]?\d+)?|&[HO][\dA-F]+)(?:[FRD]|U?[ILS])?/i,boolean:/\b(?:False|Nothing|True)\b/i,keyword:/\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Currency|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|Type|TypeOf|U(?:Integer|Long|Short)|Until|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Xor)\b/i,operator:/[+\-*/\\^<=>&#@$%!]|\b_(?=[ \t]*[\r\n])/,punctuation:/[{}().,:?]/},Prism.languages.vb=Prism.languages[`visual-basic`],Prism.languages.vba=Prism.languages[`visual-basic`],Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){e.languages.ruby=e.languages.extend(`clike`,{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore(`ruby`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:`punctuation`}}};delete e.languages.ruby.function;var n=`(?:`+[`([^a-zA-Z0-9\\s{(\\[<=])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1`,`\\((?:[^()\\\\]|\\\\[\\s\\S]|\\((?:[^()\\\\]|\\\\[\\s\\S])*\\))*\\)`,`\\{(?:[^{}\\\\]|\\\\[\\s\\S]|\\{(?:[^{}\\\\]|\\\\[\\s\\S])*\\})*\\}`,`\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S]|\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S])*\\])*\\]`,`<(?:[^<>\\\\]|\\\\[\\s\\S]|<(?:[^<>\\\\]|\\\\[\\s\\S])*>)*>`].join(`|`)+`)`,r=`(?:"(?:\\\\.|[^"\\\\\\r\\n])*"|(?:\\b[a-zA-Z_]\\w*|[^\\s\\0-\\x7F]+)[?!]?|\\$.)`;e.languages.insertBefore(`ruby`,`keyword`,{"regex-literal":[{pattern:RegExp(`%r`+n+`[egimnosux]{0,6}`),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(`(^|[^:]):`+r),lookbehind:!0,greedy:!0},{pattern:RegExp(`([\\r\\n{(,][ \\t]*)`+r+`(?=:(?!:))`),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore(`ruby`,`string`,{"string-literal":[{pattern:RegExp(`%[qQiIwWs]?`+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(`%x`+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}}]}),delete e.languages.ruby.string,e.languages.insertBefore(`ruby`,`number`,{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby})(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift}),(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(Prism),(function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(l(t.content),s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var c=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=c,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}});var o=RegExp(e.languages.markup.tag.pattern.source,`gi`),s={amp:`&`,lt:`<`,gt:`>`,quot:`"`},c=String.fromCodePoint||String.fromCharCode;function l(e){var t=e.replace(o,``);return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){return t=t.toLowerCase(),t[0]===`#`?c(t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1))):s[t]||e}),t}e.languages.md=e.languages.markdown})(Prism),Prism.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/},(function(e){var t={pattern:/((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:`punctuation`},expression:{pattern:/[\s\S]+/,inside:null}}};e.languages.groovy=e.languages.extend(`clike`,{string:{pattern:/'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,greedy:!0},keyword:/\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),e.languages.insertBefore(`groovy`,`string`,{shebang:{pattern:/#!.+/,alias:`comment`,greedy:!0},"interpolation-string":{pattern:/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}}}),e.languages.insertBefore(`groovy`,`punctuation`,{"spock-block":/\b(?:and|cleanup|expect|given|setup|then|when|where):/}),e.languages.insertBefore(`groovy`,`function`,{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:`punctuation`}}),t.inside.expression.inside=e.languages.groovy})(Prism),Prism.languages.abap={comment:/^\*.*/m,string:/(`|')(?:\\.|(?!\1)[^\\\r\n])*\1/,"string-template":{pattern:/([|}])(?:\\.|[^\\|{\r\n])*(?=[|{])/,lookbehind:!0,alias:`string`},"eol-comment":{pattern:/(^|\s)".*/m,lookbehind:!0,alias:`comment`},keyword:{pattern:/(\s|\.|^)(?:\*-INPUT|\?TO|ABAP-SOURCE|ABBREVIATED|ABS|ABSTRACT|ACCEPT|ACCEPTING|ACCESSPOLICY|ACCORDING|ACOS|ACTIVATION|ACTUAL|ADD|ADD-CORRESPONDING|ADJACENT|AFTER|ALIAS|ALIASES|ALIGN|ALL|ALLOCATE|ALPHA|ANALYSIS|ANALYZER|AND|ANY|APPEND|APPENDAGE|APPENDING|APPLICATION|ARCHIVE|AREA|ARITHMETIC|AS|ASCENDING|ASIN|ASPECT|ASSERT|ASSIGN|ASSIGNED|ASSIGNING|ASSOCIATION|ASYNCHRONOUS|AT|ATAN|ATTRIBUTES|AUTHORITY|AUTHORITY-CHECK|AVG|BACK|BACKGROUND|BACKUP|BACKWARD|BADI|BASE|BEFORE|BEGIN|BETWEEN|BIG|BINARY|BINDING|BIT|BIT-AND|BIT-NOT|BIT-OR|BIT-XOR|BLACK|BLANK|BLANKS|BLOB|BLOCK|BLOCKS|BLUE|BOUND|BOUNDARIES|BOUNDS|BOXED|BREAK-POINT|BT|BUFFER|BY|BYPASSING|BYTE|BYTE-CA|BYTE-CN|BYTE-CO|BYTE-CS|BYTE-NA|BYTE-NS|BYTE-ORDER|C|CA|CALL|CALLING|CASE|CAST|CASTING|CATCH|CEIL|CENTER|CENTERED|CHAIN|CHAIN-INPUT|CHAIN-REQUEST|CHANGE|CHANGING|CHANNELS|CHAR-TO-HEX|CHARACTER|CHARLEN|CHECK|CHECKBOX|CIRCULAR|CI_|CLASS|CLASS-CODING|CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|CLEANUP|CLEAR|CLIENT|CLOB|CLOCK|CLOSE|CN|CNT|CO|COALESCE|CODE|CODING|COLLECT|COLOR|COLUMN|COLUMNS|COL_BACKGROUND|COL_GROUP|COL_HEADING|COL_KEY|COL_NEGATIVE|COL_NORMAL|COL_POSITIVE|COL_TOTAL|COMMENT|COMMENTS|COMMIT|COMMON|COMMUNICATION|COMPARING|COMPONENT|COMPONENTS|COMPRESSION|COMPUTE|CONCAT|CONCATENATE|COND|CONDENSE|CONDITION|CONNECT|CONNECTION|CONSTANTS|CONTEXT|CONTEXTS|CONTINUE|CONTROL|CONTROLS|CONV|CONVERSION|CONVERT|COPIES|COPY|CORRESPONDING|COS|COSH|COUNT|COUNTRY|COVER|CP|CPI|CREATE|CREATING|CRITICAL|CS|CURRENCY|CURRENCY_CONVERSION|CURRENT|CURSOR|CURSOR-SELECTION|CUSTOMER|CUSTOMER-FUNCTION|DANGEROUS|DATA|DATABASE|DATAINFO|DATASET|DATE|DAYLIGHT|DBMAXLEN|DD\/MM\/YY|DD\/MM\/YYYY|DDMMYY|DEALLOCATE|DECIMALS|DECIMAL_SHIFT|DECLARATIONS|DEEP|DEFAULT|DEFERRED|DEFINE|DEFINING|DEFINITION|DELETE|DELETING|DEMAND|DEPARTMENT|DESCENDING|DESCRIBE|DESTINATION|DETAIL|DIALOG|DIRECTORY|DISCONNECT|DISPLAY|DISPLAY-MODE|DISTANCE|DISTINCT|DIV|DIVIDE|DIVIDE-CORRESPONDING|DIVISION|DO|DUMMY|DUPLICATE|DUPLICATES|DURATION|DURING|DYNAMIC|DYNPRO|E|EACH|EDIT|EDITOR-CALL|ELSE|ELSEIF|EMPTY|ENABLED|ENABLING|ENCODING|END|END-ENHANCEMENT-SECTION|END-LINES|END-OF-DEFINITION|END-OF-FILE|END-OF-PAGE|END-OF-SELECTION|ENDAT|ENDCASE|ENDCATCH|ENDCHAIN|ENDCLASS|ENDDO|ENDENHANCEMENT|ENDEXEC|ENDFOR|ENDFORM|ENDFUNCTION|ENDIAN|ENDIF|ENDING|ENDINTERFACE|ENDLOOP|ENDMETHOD|ENDMODULE|ENDON|ENDPROVIDE|ENDSELECT|ENDTRY|ENDWHILE|ENGINEERING|ENHANCEMENT|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|ENHANCEMENTS|ENTRIES|ENTRY|ENVIRONMENT|EQ|EQUAL|EQUIV|ERRORMESSAGE|ERRORS|ESCAPE|ESCAPING|EVENT|EVENTS|EXACT|EXCEPT|EXCEPTION|EXCEPTION-TABLE|EXCEPTIONS|EXCLUDE|EXCLUDING|EXEC|EXECUTE|EXISTS|EXIT|EXIT-COMMAND|EXP|EXPAND|EXPANDING|EXPIRATION|EXPLICIT|EXPONENT|EXPORT|EXPORTING|EXTEND|EXTENDED|EXTENSION|EXTRACT|FAIL|FETCH|FIELD|FIELD-GROUPS|FIELD-SYMBOL|FIELD-SYMBOLS|FIELDS|FILE|FILTER|FILTER-TABLE|FILTERS|FINAL|FIND|FIRST|FIRST-LINE|FIXED-POINT|FKEQ|FKGE|FLOOR|FLUSH|FONT|FOR|FORM|FORMAT|FORWARD|FOUND|FRAC|FRAME|FRAMES|FREE|FRIENDS|FROM|FUNCTION|FUNCTION-POOL|FUNCTIONALITY|FURTHER|GAPS|GE|GENERATE|GET|GIVING|GKEQ|GKGE|GLOBAL|GRANT|GREATER|GREEN|GROUP|GROUPS|GT|HANDLE|HANDLER|HARMLESS|HASHED|HAVING|HDB|HEAD-LINES|HEADER|HEADERS|HEADING|HELP-ID|HELP-REQUEST|HIDE|HIGH|HINT|HOLD|HOTSPOT|I|ICON|ID|IDENTIFICATION|IDENTIFIER|IDS|IF|IGNORE|IGNORING|IMMEDIATELY|IMPLEMENTATION|IMPLEMENTATIONS|IMPLEMENTED|IMPLICIT|IMPORT|IMPORTING|IN|INACTIVE|INCL|INCLUDE|INCLUDES|INCLUDING|INCREMENT|INDEX|INDEX-LINE|INFOTYPES|INHERITING|INIT|INITIAL|INITIALIZATION|INNER|INOUT|INPUT|INSERT|INSTANCES|INTENSIFIED|INTERFACE|INTERFACE-POOL|INTERFACES|INTERNAL|INTERVALS|INTO|INVERSE|INVERTED-DATE|IS|ISO|ITERATOR|ITNO|JOB|JOIN|KEEP|KEEPING|KERNEL|KEY|KEYS|KEYWORDS|KIND|LANGUAGE|LAST|LATE|LAYOUT|LE|LEADING|LEAVE|LEFT|LEFT-JUSTIFIED|LEFTPLUS|LEFTSPACE|LEGACY|LENGTH|LESS|LET|LEVEL|LEVELS|LIKE|LINE|LINE-COUNT|LINE-SELECTION|LINE-SIZE|LINEFEED|LINES|LIST|LIST-PROCESSING|LISTBOX|LITTLE|LLANG|LOAD|LOAD-OF-PROGRAM|LOB|LOCAL|LOCALE|LOCATOR|LOG|LOG-POINT|LOG10|LOGFILE|LOGICAL|LONG|LOOP|LOW|LOWER|LPAD|LPI|LT|M|MAIL|MAIN|MAJOR-ID|MAPPING|MARGIN|MARK|MASK|MATCH|MATCHCODE|MAX|MAXIMUM|MEDIUM|MEMBERS|MEMORY|MESH|MESSAGE|MESSAGE-ID|MESSAGES|MESSAGING|METHOD|METHODS|MIN|MINIMUM|MINOR-ID|MM\/DD\/YY|MM\/DD\/YYYY|MMDDYY|MOD|MODE|MODIF|MODIFIER|MODIFY|MODULE|MOVE|MOVE-CORRESPONDING|MULTIPLY|MULTIPLY-CORRESPONDING|NA|NAME|NAMETAB|NATIVE|NB|NE|NESTED|NESTING|NEW|NEW-LINE|NEW-PAGE|NEW-SECTION|NEXT|NO|NO-DISPLAY|NO-EXTENSION|NO-GAP|NO-GAPS|NO-GROUPING|NO-HEADING|NO-SCROLLING|NO-SIGN|NO-TITLE|NO-TOPOFPAGE|NO-ZERO|NODE|NODES|NON-UNICODE|NON-UNIQUE|NOT|NP|NS|NULL|NUMBER|NUMOFCHAR|O|OBJECT|OBJECTS|OBLIGATORY|OCCURRENCE|OCCURRENCES|OCCURS|OF|OFF|OFFSET|OLE|ON|ONLY|OPEN|OPTION|OPTIONAL|OPTIONS|OR|ORDER|OTHER|OTHERS|OUT|OUTER|OUTPUT|OUTPUT-LENGTH|OVERFLOW|OVERLAY|PACK|PACKAGE|PAD|PADDING|PAGE|PAGES|PARAMETER|PARAMETER-TABLE|PARAMETERS|PART|PARTIALLY|PATTERN|PERCENTAGE|PERFORM|PERFORMING|PERSON|PF|PF-STATUS|PINK|PLACES|POOL|POSITION|POS_HIGH|POS_LOW|PRAGMAS|PRECOMPILED|PREFERRED|PRESERVING|PRIMARY|PRINT|PRINT-CONTROL|PRIORITY|PRIVATE|PROCEDURE|PROCESS|PROGRAM|PROPERTY|PROTECTED|PROVIDE|PUBLIC|PUSHBUTTON|PUT|QUEUE-ONLY|QUICKINFO|RADIOBUTTON|RAISE|RAISING|RANGE|RANGES|RAW|READ|READ-ONLY|READER|RECEIVE|RECEIVED|RECEIVER|RECEIVING|RED|REDEFINITION|REDUCE|REDUCED|REF|REFERENCE|REFRESH|REGEX|REJECT|REMOTE|RENAMING|REPLACE|REPLACEMENT|REPLACING|REPORT|REQUEST|REQUESTED|RESERVE|RESET|RESOLUTION|RESPECTING|RESPONSIBLE|RESULT|RESULTS|RESUMABLE|RESUME|RETRY|RETURN|RETURNCODE|RETURNING|RIGHT|RIGHT-JUSTIFIED|RIGHTPLUS|RIGHTSPACE|RISK|RMC_COMMUNICATION_FAILURE|RMC_INVALID_STATUS|RMC_SYSTEM_FAILURE|ROLE|ROLLBACK|ROUND|ROWS|RTTI|RUN|SAP|SAP-SPOOL|SAVING|SCALE_PRESERVING|SCALE_PRESERVING_SCIENTIFIC|SCAN|SCIENTIFIC|SCIENTIFIC_WITH_LEADING_ZERO|SCREEN|SCROLL|SCROLL-BOUNDARY|SCROLLING|SEARCH|SECONDARY|SECONDS|SECTION|SELECT|SELECT-OPTIONS|SELECTION|SELECTION-SCREEN|SELECTION-SET|SELECTION-SETS|SELECTION-TABLE|SELECTIONS|SELECTOR|SEND|SEPARATE|SEPARATED|SET|SHARED|SHIFT|SHORT|SHORTDUMP-ID|SIGN|SIGN_AS_POSTFIX|SIMPLE|SIN|SINGLE|SINH|SIZE|SKIP|SKIPPING|SMART|SOME|SORT|SORTABLE|SORTED|SOURCE|SPACE|SPECIFIED|SPLIT|SPOOL|SPOTS|SQL|SQLSCRIPT|SQRT|STABLE|STAMP|STANDARD|START-OF-SELECTION|STARTING|STATE|STATEMENT|STATEMENTS|STATIC|STATICS|STATUSINFO|STEP-LOOP|STOP|STRLEN|STRUCTURE|STRUCTURES|STYLE|SUBKEY|SUBMATCHES|SUBMIT|SUBROUTINE|SUBSCREEN|SUBSTRING|SUBTRACT|SUBTRACT-CORRESPONDING|SUFFIX|SUM|SUMMARY|SUMMING|SUPPLIED|SUPPLY|SUPPRESS|SWITCH|SWITCHSTATES|SYMBOL|SYNCPOINTS|SYNTAX|SYNTAX-CHECK|SYNTAX-TRACE|SYSTEM-CALL|SYSTEM-EXCEPTIONS|SYSTEM-EXIT|TAB|TABBED|TABLE|TABLES|TABLEVIEW|TABSTRIP|TAN|TANH|TARGET|TASK|TASKS|TEST|TESTING|TEXT|TEXTPOOL|THEN|THROW|TIME|TIMES|TIMESTAMP|TIMEZONE|TITLE|TITLE-LINES|TITLEBAR|TO|TOKENIZATION|TOKENS|TOP-LINES|TOP-OF-PAGE|TRACE-FILE|TRACE-TABLE|TRAILING|TRANSACTION|TRANSFER|TRANSFORMATION|TRANSLATE|TRANSPORTING|TRMAC|TRUNC|TRUNCATE|TRUNCATION|TRY|TYPE|TYPE-POOL|TYPE-POOLS|TYPES|ULINE|UNASSIGN|UNDER|UNICODE|UNION|UNIQUE|UNIT|UNIT_CONVERSION|UNIX|UNPACK|UNTIL|UNWIND|UP|UPDATE|UPPER|USER|USER-COMMAND|USING|UTF-8|VALID|VALUE|VALUE-REQUEST|VALUES|VARY|VARYING|VERIFICATION-MESSAGE|VERSION|VIA|VIEW|VISIBLE|WAIT|WARNING|WHEN|WHENEVER|WHERE|WHILE|WIDTH|WINDOW|WINDOWS|WITH|WITH-HEADING|WITH-TITLE|WITHOUT|WORD|WORK|WRITE|WRITER|X|XML|XOR|XSD|XSTRLEN|YELLOW|YES|YYMMDD|Z|ZERO|ZONE)(?![\w-])/i,lookbehind:!0},number:/\b\d+\b/,operator:{pattern:/(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/,lookbehind:!0},"string-operator":{pattern:/(\s)&&?(?=\s)/,lookbehind:!0,alias:`keyword`},"token-operator":[{pattern:/(\w)(?:->?|=>|[~|{}])(?=\w)/,lookbehind:!0,alias:`punctuation`},{pattern:/[|{}]/,alias:`punctuation`}],punctuation:/[,.:()]/};let Kb=`comment.prolog.doctype.cdata.punctuation.namespace.property.tag.boolean.number.constant.symbol.deleted.selector.attr-name.string.builtin.inserted.operator.entity.url.string.atrule.attr-value.keyword.function.class-name.regex.important.variable.bold.italic.entity.char`.split(`.`);function qb(e){return typeof e==`string`?e.length:typeof e.content==`string`?e.content.length:e.content.reduce((e,t)=>e+qb(t),0)}function Jb(e,t){if(!t)return[];let n=Gb.default.languages[t];return n?Gb.default.tokenize(e.text,n):[]}function Yb(e){if(!W.isText(e))return null;let t=J.getParentNode(null,e);if(t&&J.getNodeType(t)===`code`){let e=J.getParentNode(null,t);if(e&&J.getNodeType(e)===`pre`)return t}return null}var Xb=e=>{let[t,n]=e,r=[],i=Yb(t);if(i==null)return r;let{language:a=``}=i;if(!a)return r;let o=Jb(t,a),s=0;for(let e of o){let t=qb(e),i=s+t;typeof e!=`string`&&r.push({[e.type]:!0,anchor:{path:n,offset:s},focus:{path:n,offset:i}}),s=i}return r};function Zb(e,t){let{language:n=``}=e;return`<code ${n?`class="language-${n}"`:``}>${t}</code>`}let Qb={type:`code`,elemToHtml:Zb};function $b(){return[{text:`CSS`,value:`css`},{text:`HTML`,value:`html`},{text:`XML`,value:`xml`},{text:`Javascript`,value:`javascript`},{text:`Typescript`,value:`typescript`},{text:`JSX`,value:`jsx`},{text:`Go`,value:`go`},{text:`PHP`,value:`php`},{text:`C`,value:`c`},{text:`Python`,value:`python`},{text:`Java`,value:`java`},{text:`C++`,value:`cpp`},{text:`C#`,value:`csharp`},{text:`Visual Basic`,value:`visual-basic`},{text:`SQL`,value:`sql`},{text:`Ruby`,value:`ruby`},{text:`Swift`,value:`swift`},{text:`Bash`,value:`bash`},{text:`Lua`,value:`lua`},{text:`Groovy`,value:`groovy`},{text:`Markdown`,value:`markdown`},{text:`ABAP`,value:`abap`}]}var ex=class{constructor(){this.title=X(`highLightModule.selectLang`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M64 64v896h896V64H64z m487.6 698.8c0 87.2-51.2 127-125.8 127-67.4 0-106.4-34.8-126.4-77l68.6-41.4c13.2 23.4 25.2 43.2 54.2 43.2 27.6 0 45.2-10.8 45.2-53V475.4h84.2v287.4z m199.2 127c-78.2 0-128.8-37.2-153.4-86l68.6-39.6c18 29.4 41.6 51.2 83 51.2 34.8 0 57.2-17.4 57.2-41.6 0-28.8-22.8-39-61.4-56l-21-9c-60.8-25.8-101-58.4-101-127 0-63.2 48.2-111.2 123.2-111.2 53.6 0 92 18.6 119.6 67.4L800 580c-14.4-25.8-30-36-54.2-36-24.6 0-40.2 15.6-40.2 36 0 25.2 15.6 35.4 51.8 51.2l21 9c71.6 30.6 111.8 62 111.8 132.4 0 75.6-59.6 117.2-139.4 117.2z"></path></svg>`,this.tag=`select`,this.width=95,this.selectPanelWidth=115,this.defaultCodeLang=``}getOptions(e){let t=[],{codeLangs:n=[]}=e.getMenuConfig(`codeSelectLang`);t.push({text:`plain text`,value:``}),n.forEach(e=>{let{text:n,value:r,selected:i}=e;i&&(this.defaultCodeLang=r),t.push({text:n,value:r})});let r=this.getValue(e);return t.forEach(e=>{e.value===r?e.selected=!0:e.selected=void 0}),t}isActive(e){return!1}getValue(e){let t=this.getSelectCodeElem(e);if(t==null||!R.isElement(t))return this.defaultCodeLang;let n=t.language.toString(),{codeLangs:r=[]}=e.getMenuConfig(`codeSelectLang`);return r.some(e=>e.value===n)?n:this.defaultCodeLang}isDisabled(e){return e.selection==null?!0:!this.getSelectCodeElem(e)}exec(e,t){if(this.getSelectCodeElem(e)==null)return;let n={language:t.toString()};G.setNodes(e,n,{match:e=>J.checkNodeType(e,`code`)})}getSelectCodeElem(e){let t=J.getSelectedNodeByType(e,`code`);if(t==null)return null;let n=J.getParentNode(e,t);return!R.isElement(n)||n.type!==`pre`?null:t}};let tx={key:`codeSelectLang`,factory(){return new ex},config:{codeLangs:$b()}};globalThis.Node,globalThis.Comment,globalThis.Element,globalThis.Text,globalThis.Range,globalThis.Selection,globalThis.StaticRange,Lo&&(K.fn.attr=Lo);var nx=K;function rx(e,t,n){let r=nx(e);if(!R.isElement(t)||J.getNodeType(t)!==`code`)return t;let i=t,a=r.attr(`class`)||``;return a.indexOf(`language-`)===0?i.language=a.split(`-`)[1]||``:i.language=a.toLowerCase(),i}function ix(e,t){e.data==null&&(e.data={});let n=e.data;n.props==null&&(n.props={}),Object.assign(n.props,{className:t})}function ax(e,t){let n=e,r=t,i=``;return Kb.forEach(e=>{n[e]&&(i=e)}),i&&(i=`token ${i}`,ix(r,i)),r}var ox={renderStyle:ax,parseStyleHtml:rx,menus:[tx],elemsToHtml:[Qb]};Xu(`en`,{listModule:{unOrderedList:`Unordered list`,orderedList:`Ordered list`,lowerAlphaList:`Ordered list (a,b,c)`,numberingActions:`Heading numbering actions`,continueNumbering:`Continue heading numbering`,restartNumbering:`Restart numbering`}}),Xu(`zh-CN`,{listModule:{unOrderedList:`无序列表`,orderedList:`有序列表`,lowerAlphaList:`有序列表(a,b,c)`,numberingActions:`标题编号操作`,continueNumbering:`继续标题编号`,restartNumbering:`重新开始编号`}});let sx=new WeakMap;function cx(e){let t=e.children||[],n=t.length;if(n===0)return``;let r;for(let e=0;e<n&&!r;e+=1){let n=t[e];W.isText(n)&&(r=n)}return r==null?``:r.color||``}function lx(e){return J.checkNodeType(e,`list-item`)}function ux(e){return typeof e==`string`&&/^header[1-6]$/.test(e)}function dx(e){return!lx(e)||!ux(e.headingType)?null:e.headingType}function fx(e){return lx(e)&&e.level>0?Math.floor(e.level):0}function px(e){return lx(e)&&e.ordered===!0&&e.listMode===`outline`&&ux(e.headingType)}function mx(e){let t=dx(e),n=t==null?null:/^header([1-6])$/.exec(t);return n==null?fx(e)+1:Number.parseInt(n[1],10)}function hx(e){let{ordered:t=!1,start:n}=e;return!t||typeof n!=`number`||Number.isNaN(n)?1:n}function gx(e){let{orderType:t}=e;return t===`a`||t===`A`||t===`i`||t===`I`?t:`1`}function _x(e,t){return e.ordered===t.ordered?e.ordered?gx(e)===gx(t)&&hx(e)===hx(t):!0:!1}function vx(e,t){if(!t.ordered)return 1;let n=fx(t),r=hx(t),i=J.findPath(e,t),a=i.length>1?z.get(e,i.slice(0,-1)):e,o=Array.isArray(a.children)?a.children:[],s=i[i.length-1];if(s<=0)return r;for(let e=s-1;e>=0;--e){let i=o[e];if(!lx(i))break;let a=fx(i);if(a<n)break;if(a===n){if(!_x(i,t)||px(i))break;r+=1}}return r}function yx(e,t){let n=Array.from({length:6},()=>0);for(let r of e.children){if(!px(r))continue;let e=mx(r),i=e-1;for(let e=0;e<i;e+=1)n[e]===0&&(n[e]=1);typeof r.listRestart==`number`&&r.listRestart>0?n[i]=Math.floor(r.listRestart):n[i]===0?n[i]=1:n[i]+=1;for(let e=i+1;e<n.length;e+=1)n[e]=0;if(r===t){let t=n.slice(0,e).join(`.`);return e===1?`${t}.`:t}}return``}function bx(e,t,n){let r=n===void 0?t.level||0:n,i=J.findPath(e,t);for(;;){if(i.length===0||i[i.length-1]===0)return null;i=I.previous(i);let t=V.node(e,i);if(t==null||!lx(t[0]))return null;if(fx(t[0])===r)return t[0]}}let xx=`rgb(0, 0, 0).rgb(38, 38, 38).rgb(89, 89, 89).rgb(140, 140, 140).rgb(191, 191, 191).rgb(217, 217, 217).rgb(233, 233, 233).rgb(245, 245, 245).rgb(250, 250, 250).rgb(255, 255, 255).rgb(225, 60, 57).rgb(231, 95, 51).rgb(235, 144, 58).rgb(245, 219, 77).rgb(114, 192, 64).rgb(89, 191, 192).rgb(66, 144, 247).rgb(54, 88, 226).rgb(106, 57, 201).rgb(216, 68, 147).rgb(251, 233, 230).rgb(252, 237, 225).rgb(252, 239, 212).rgb(252, 251, 207).rgb(231, 246, 213).rgb(218, 244, 240).rgb(217, 237, 250).rgb(224, 232, 250).rgb(237, 225, 248).rgb(246, 226, 234).rgb(255, 163, 158).rgb(255, 187, 150).rgb(255, 213, 145).rgb(255, 251, 143).rgb(183, 235, 143).rgb(135, 232, 222).rgb(145, 213, 255).rgb(173, 198, 255).rgb(211, 173, 247).rgb(255, 173, 210).rgb(255, 77, 79).rgb(255, 122, 69).rgb(255, 169, 64).rgb(255, 236, 61).rgb(115, 209, 61).rgb(54, 207, 201).rgb(64, 169, 255).rgb(89, 126, 247).rgb(146, 84, 222).rgb(247, 89, 171).rgb(207, 19, 34).rgb(212, 56, 13).rgb(212, 107, 8).rgb(212, 177, 6).rgb(56, 158, 13).rgb(8, 151, 156).rgb(9, 109, 217).rgb(29, 57, 196).rgb(83, 29, 171).rgb(196, 29, 127).rgb(130, 0, 20).rgb(135, 20, 0).rgb(135, 56, 0).rgb(97, 71, 0).rgb(19, 82, 0).rgb(0, 71, 79).rgb(0, 58, 140).rgb(6, 17, 120).rgb(34, 7, 94).rgb(120, 6, 80)`.split(`.`),Sx=new Set;function Cx(e){return(e||``).trim().replace(/\s+/g,``).toLowerCase()}let wx=new Set(xx.map(e=>Cx(e)));function Tx(e){let t=7;for(let n of e)t=(t*31+(n.codePointAt(0)||0))%2147483647;return t.toString(36)}function Ex(e){return`w-e-list-color-${Tx(`color:${Cx(e)}`)}`}function Dx(e,t){var n;let r=(e==null||(n=e.getConfig().styleClassTokens)==null?void 0:n.color)||[],i=Cx(t);for(let e=0;e<r.length;e+=1)if(Cx(r[e])===i)return!0;return!1}function Ox(e,t){let n=Cx(t);return n?!!(wx.has(n)||Dx(e,t)):!1}function kx(e,t){if(Ox(e,t))return`class`;let n=gm(e),r=`preserve-data`;n===`fallback-inline`&&(r=`inline`),n===`strict`&&(r=`throw`);let i=`[wangeditor] Unsupported list color class token color=${t}. policy=${n}`,a=`${t}|${r}`;if(Sx.has(a)||(Sx.add(a),_m(e,{type:`color`,value:t,scene:`toHtml`,fallback:r,message:i})),r===`throw`)throw Error(i);return r===`inline`?`inline`:`preserve-data`}let Ax=[],jx=null,Mx=null;function Nx(e){let t=new WeakMap,n=e=>{e.forEach((r,i)=>{R.isElement(r)&&(t.set(r,{siblings:e,index:i}),n(r.children))})};return n(e.children),t}function Px(e){return e.ordered?`ol`:`ul`}function Fx(e){return e.ordered?`ol`:`ul`}function Ix(e){let{ordered:t=!1}=e;if(!t)return`<ul>`;let n=[],r=gx(e),i=hx(e);return r!==`1`&&n.push(`type="${r}"`),i!==1&&n.push(`start="${i}"`),dx(e)!=null&&n.push(`data-w-e-list-mode="standard"`),n.length===0?`<ol>`:`<ol ${n.join(` `)}>`}function Lx(e,t,n){if(n===`prev`&&t===0||n===`next`&&t===e.length-1)return null;let r=e[n===`prev`?t-1:t+1];return!J.checkNodeType(r,`list-item`)||px(r)?null:r}function Rx(e,t,n){for(let r=t-1;r>=0;--r){let t=e[r];if(!(!J.checkNodeType(t,`list-item`)||px(t))&&(t.level||0)===n)return t}return null}function zx(e,t,n){let r=``,i=``,a=e,o=dx(a),s=o==null?null:o.replace(`header`,`h`);if(px(a)&&s!=null)return{html:`<${s}>${t}</${s}>`,prefix:``,suffix:``};s!=null&&(t=`<${s}>${t}</${s}>`);let{level:c=0}=a,l=Px(a),u=Ix(a),d=sx.get(e),f=d&&Array.isArray(d.children)?d:null,p=n&&Array.isArray(n.children)?n:null,m=(t,n=!1)=>{if(!t)return null;try{let n=J.findPath(t,e),r=n.length===1?t:z.get(t,I.parent(n)),i=Array.isArray(r.children)?r.children:[],a=n[n.length-1];return i[a]===e?{siblings:i,index:a}:null}catch(r){return n?(Mx||(Mx=Nx(t)),Mx.get(e)||null):null}},h=p||f,g=m(p),_=m(f);g?h=p:_&&(h=f);let v=n||d;if(h==null)return{html:`<li>${t}</li>`,prefix:``,suffix:``};jx!==h&&(Ax.length=0,jx=h,Mx=null);let y=m(h,!0);if(!y)return{html:`<li>${t}</li>`,prefix:``,suffix:``};let{siblings:b,index:x}=y,S=Lx(b,x,`prev`),C=Lx(b,x,`next`),w=!!C&&(C.level||0)>c;if(S){let e=S.level||0;if(c>e)for(let t=0;t<c-e;t+=1)r+=u,Ax.push(l);else if(c===e){if(!_x(S,a)){let e=Ax.pop()||Fx(S);r+=`</${e}>${u}`,Ax.push(l)}}else{let t=e-c;for(;t>0;){let e=Ax.pop()||Fx(S);r+=`</${e}></li>`,--t}let n=Rx(b,x,c);if(n&&!_x(n,a)){let e=Ax.pop()||Fx(n);r+=`</${e}>${u}`,Ax.push(l)}}}else{Ax.length=0;for(let e=0;e<c+1;e+=1)r+=u,Ax.push(l)}let T=cx(e),E=hm(v),D=``,O=``,k=``;if(T)if(E===`class`){k=` data-w-e-color="${T}"`;let e=kx(v,T);e===`class`?O=` class="${Ex(T)}"`:e===`inline`&&(D=` style="color:${T}"`)}else D=` style="color:${T}"`;let A=`<li${O}${k}${D}>${t}${w?``:`</li>`}`;if(!C){for(;Ax.length>0;){let e=Ax.pop();if(!e)break;i+=`</${e}>`,Ax.length>0&&(i+=`</li>`)}jx=null,Mx=null}return{html:A,prefix:r,suffix:i}}var Bx={type:`list-item`,elemToHtml:zx};function Vx(e,t){let n=yx(e,t).split(`.`).filter(Boolean).pop(),r=Number.parseInt(n||``,10);return Number.isFinite(r)&&r>0?r:1}function Hx(e,t){let n=Vx(t,e.node);return`<ol${n===1?``:` start="${n}"`} data-w-e-list-mode="outline">`}function Ux(e,t){let n=cx(e);if(!n)return[];if(hm(t)!==`class`)return[`style="color:${n}"`];let r=[`data-w-e-color="${n}"`],i=kx(t,n);return i===`class`?r.unshift(`class="${Ex(n)}"`):i===`inline`&&r.push(`style="color:${n}"`),r}function Wx(e,t){let n=Ux(e,t);return n.push(`data-w-e-list-indent="${mx(e)-1}"`),typeof e.listRestart==`number`&&n.push(`data-w-e-list-restart="${e.listRestart}"`),n.push(`data-w-e-outline-number="${yx(t,e)}"`),`<li ${n.join(` `)}>`}function Gx(e,t){let n=e.items.map(e=>{let n=e.children.map(e=>Gx(e,t)).join(``);return`${Wx(e.node,t)}${e.html}${n}</li>`}).join(``);return`${Hx(e,t)}${n}</ol>`}function Kx(e,t,n,r){var i;let a=Math.max(0,mx(n)-1);a>t.length&&(a=t.length),t.length=a+1;let o=a>0?(i=t[a-1])==null?void 0:i.lastItem:null,s=t[a],c=typeof n.listRestart==`number`,l=s==null||!_x(s.container.node,n)||c,u;l?(u={node:n,items:[]},o==null?e.push(u):o.children.push(u)):u=s.container;let d={node:n,html:r,children:[]};return u.items.push(d),t[a]={container:u,lastItem:d},d}let qx=(e,t,n)=>{let r=[],i=null,a=()=>{i==null||i.roots.length===0||(r.push(i.roots.map(e=>Gx(e,n)).join(``)),i=null)};return t.forEach((t,n)=>{let o=e[n]||``;if(px(t)){i==null&&(i={roots:[],levels:[]}),Kx(i.roots,i.levels,t,o);return}a(),r.push(o)}),a(),r},Jx=`<svg viewBox="0 0 1024 1024"><path d="M384 832h640v128H384z m0-384h640v128H384z m0-384h640v128H384zM192 0v256H128V64H64V0zM128 526.016v50.016h128v64H64v-146.016l128-60V384H64v-64h192v146.016zM256 704v320H64v-64h128v-64H64v-64h128v-64H64v-64z"></path></svg>`;function Yx(e){return e.selection==null?[]:Array.from(V.nodes(e,{at:e.selection,match:t=>R.isElement(t)&&V.isBlock(e,t),mode:`lowest`})).filter(([e])=>![`table`,`table-row`,`table-cell`].includes(e.type))}function Xx(e,t){return V.isVoid(e,t)?!1:![`pre`,`code`,`table`,`table-row`,`table-cell`].includes(t.type)}function Zx(e){return Number.parseInt(e.slice(6),10)-1}function Qx(e){return lx(e)?dx(e):ux(e.type)?e.type:null}var $x=class{constructor(){this.type=`list-item`,this.tag=`button`}isTargetListNode(e){return!lx(e)||!!e.ordered!==this.ordered?!1:this.ordered?gx(e)===(this.orderType||`1`):!0}getValue(e){return``}isActive(e){let t=Yx(e);return t.length>0&&t.every(([e])=>this.isTargetListNode(e))}isDisabled(e){let t=Yx(e);return t.length===0||t.some(([t])=>!Xx(e,t))}exec(e,t){let n=this.isActive(e),r=Yx(e);r.length!==0&&V.withoutNormalizing(e,()=>{r.forEach(([t,r])=>{if(n){let n=dx(t);G.setNodes(e,{type:n||`paragraph`,ordered:void 0,level:void 0,start:void 0,orderType:void 0,headingType:void 0,listMode:void 0,listRestart:void 0},{at:r});return}let i=Qx(t),a=this.ordered&&this.orderType==null&&i!=null;G.setNodes(e,{type:`list-item`,ordered:this.ordered,level:a?Zx(i):fx(t),start:void 0,orderType:this.ordered?this.orderType:void 0,headingType:a?i:void 0,listMode:a?`outline`:void 0,listRestart:void 0},{at:r})})})}},eS=class extends $x{constructor(...e){super(...e),this.ordered=!1,this.title=X(`listModule.unOrderedList`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M384 64h640v128H384V64z m0 384h640v128H384v-128z m0 384h640v128H384v-128zM0 128a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z"></path></svg>`}},tS=class extends $x{constructor(...e){super(...e),this.ordered=!0,this.orderType=`a`,this.title=X(`listModule.lowerAlphaList`),this.iconSvg=Jx}},nS=class extends $x{constructor(...e){super(...e),this.ordered=!0,this.title=X(`listModule.orderedList`),this.iconSvg=Jx}};let rS={key:`bulletedList`,factory(){return new eS}},iS={key:`numberedList`,factory(){return new nS}},aS={key:`numberedListLowerAlpha`,factory(){return new tS}};var oS=globalThis.Node;globalThis.Comment,globalThis.Element,globalThis.Text,globalThis.Range,globalThis.Selection,globalThis.StaticRange,ts&&(K.fn.append=ts),Lo&&(K.fn.attr=Lo),rs&&(K.fn.parent=rs);var sS=K;function cS(e){if(e.length===0)return``;let t=e[0];return t.nodeType===oS.ELEMENT_NODE?t.tagName.toLowerCase():``}O();function lS(e){return cS(e.parent())===`ol`}function uS(e){let t=e.parent();if(cS(t)!==`ol`)return;let n=(t.attr(`start`)||``).trim(),r=Number.parseInt(n,10);return Number.isNaN(r)?void 0:r}function dS(e){let t=e.parent();if(cS(t)!==`ol`)return;let n=(t.attr(`type`)||``).trim();if(n===`1`||n===`a`||n===`A`||n===`i`||n===`I`)return n}function fS(e){let t=(e.attr(`data-w-e-list-indent`)||``).trim();if(/^\d+$/.test(t))return Number.parseInt(t,10);let n=0,r=e.parent();for(;r.length>0;){let e=cS(r);(e===`ul`||e===`ol`)&&(n+=1),r=r.parent()}return Math.max(0,n-1)}function pS(e,t){let n=e.parent().attr(`data-w-e-list-mode`);return n===`outline`||n===`standard`?n:lS(e)&&t.some(e=>R.isElement(e)&&ux(e.type))?`outline`:`standard`}function mS(e){let t=(e.attr(`data-w-e-list-restart`)||``).trim();if(!/^\d+$/.test(t))return;let n=Number.parseInt(t,10);return n>0?n:void 0}function hS(e){var t;let n=(t=e[0])==null?void 0:t.previousElementSibling;for(;n!=null;){if(n.tagName.toLowerCase()===`li`)return!1;n=n.previousElementSibling}return!0}function gS(e){let t=mS(e);if(t!==void 0)return t;if(!(e.attr(`data-w-e-outline-number`)!=null||!hS(e)))return uS(e)}function _S(e){return W.isText(e)&&e.text.trim()===``}function vS(e,t,n){t.forEach(t=>{if(!_S(t)){if(W.isText(t)||n.isInline(t)){e.push(t);return}R.isElement(t)&&vS(e,t.children,n)}})}function yS(e){for(let t of e)if(R.isElement(t)&&ux(t.type))return t;return null}function bS(e,t,n){let r=sS(e),i=fS(r),a=[],o=[];t.forEach(e=>{if(!_S(e)){if(lx(e)&&e.level>i){o.push(e);return}a.push(e)}});let s=yS(a),c=s!=null&&ux(s.type)?s.type:void 0,l=pS(r,a),u=[];vS(u,a,n),u.length===0&&u.push(o.length>0?{text:``}:{text:r.text().replace(/\s+/gm,` `)});let d=lS(r),f=uS(r),p=dS(r),m=d&&l===`outline`&&c!==void 0,h=m?gS(r):void 0,g=D(D(D(D(D(D({type:`list-item`,ordered:d,level:m?Number.parseInt(c.slice(6),10)-1:i},f!==void 0&&!m?{start:f}:{}),p===void 0?{}:{orderType:p}),c===void 0?{}:{headingType:c}),m?{listMode:`outline`}:{}),h===void 0?{}:{listRestart:h}),{},{children:u});return o.length===0?g:[g,...o]}let xS={selector:`li:not([data-w-e-type])`,parseElemHtml:bS};function SS(e,t,n){return t.flat(1/0)}let CS={selector:`ul:not([data-w-e-type]),ol:not([data-w-e-type])`,parseElemHtml:SS};function wS(e){return Array.from(V.nodes(e,{at:e.selection||void 0,match:t=>R.isElement(t)&&V.isBlock(e,t),mode:`lowest`})).filter(([e])=>![`table`,`table-row`,`table-cell`].includes(e.type))}function TS(e){let[t]=V.nodes(e,{at:e.selection||void 0,match:lx,universal:!0});return t==null?null:t}function ES(e,t,n,r){G.setNodes(e,{type:r||dx(n)||`paragraph`,ordered:void 0,level:void 0,start:void 0,orderType:void 0,headingType:void 0,listMode:void 0,listRestart:void 0},{at:t})}function DS(e){let{deleteBackward:t,handleTab:n,normalizeNode:r,insertBreak:i}=e,a=e;return a.insertBreak=()=>{let e=TS(a);if(e==null)return i();let[t,n]=e;if(z.string(t)===``){ES(a,n,t,`paragraph`);return}return i()},a.deleteBackward=n=>{let{selection:r}=a;if(r==null||L.isExpanded(r)){t(n);return}let i=TS(a);if(i==null||r.focus.offset!==0){t(n);return}let[o,s]=i;if(px(o)){ES(a,s,o);return}let c=fx(o);if(c<=0){ES(a,s,o);return}let l=bx(e,o,c-1);l==null?G.setNodes(a,{level:c-1},{at:s}):G.setNodes(a,{level:c-1,ordered:l.ordered,start:l.ordered?l.start:void 0,orderType:l.ordered?l.orderType:void 0},{at:s})},a.handleTab=()=>{let{selection:e}=a;if(e==null){n();return}if(L.isCollapsed(e)){let t=TS(a);if(t==null||px(t[0])||e.focus.offset!==0){n();return}let[r,i]=t;G.setNodes(a,{level:fx(r)+1},{at:i});return}let t=wS(a),r=t.filter(([e])=>lx(e)&&!px(e));if(r.length!==t.length||r.length<=1){n();return}r.forEach(([e,t])=>{G.setNodes(a,{level:fx(e)+1},{at:t})})},a.normalizeNode=([e,t])=>{let n=J.getNodeType(e);return(n===`bulleted-list`||n===`numbered-list`)&&G.unwrapNodes(a,{at:t}),r([e,t])},a}var OS=DS;let kS=new WeakMap;function AS(e,t,n){let r=e.children.indexOf(t);r<0||G.setNodes(e,{listRestart:n},{at:[r]})}function jS(e,t){AS(e,t)}function MS(e,t){AS(e,t,1)}function NS(e){let t=kS.get(e);t!=null&&(t.dispose(),kS.delete(e))}function PS(e,t,n){let r=e.createElement(`button`);return r.type=`button`,r.className=`w-e-list-outline-action`,r.textContent=t,r.addEventListener(`mousedown`,e=>e.preventDefault()),r.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),n()}),r}function FS(e,t,n){if(e.isDisabled())return;NS(e);let r=n.ownerDocument,i=r.createElement(`div`);i.className=`w-e-list-outline-actions`,i.setAttribute(`role`,`menu`),i.addEventListener(`mousedown`,e=>e.preventDefault()),i.append(PS(r,X(`listModule.continueNumbering`),()=>{jS(e,t),NS(e)}),PS(r,X(`listModule.restartNumbering`),()=>{MS(e,t),NS(e)}));let a=J.getTextarea(e),o=a.$textAreaContainer[0],s=a.$scroll[0],c=n.getBoundingClientRect(),l=o.getBoundingClientRect();i.style.top=`${c.bottom-l.top+s.scrollTop+4}px`,i.style.left=`${c.left-l.left+s.scrollLeft}px`,o.append(i);let u=t=>{let r=t.target;r instanceof Node&&(i.contains(r)||n.contains(r)||NS(e))},d=()=>NS(e),f=()=>NS(e);r.addEventListener(`mousedown`,u,!0),e.on(za.CHANGE,d),e.on(za.DESTROYED,f),kS.set(e,{elem:i,dispose:()=>{r.removeEventListener(`mousedown`,u,!0),e.off(za.CHANGE,d),e.off(za.DESTROYED,f),i.remove()}})}function IS(e=0){switch(e){case 0:return`•`;case 1:return`◦`;default:return`▪`}}function LS(e,t=!1){if(e<=0)return String(e);let n=e,r=``;for(;n>0;){let e=(n-1)%26,i=(t?65:97)+e;r=String.fromCharCode(i)+r,n=Math.floor((n-1)/26)}return r}function RS(e,t=!1){if(e<=0||e>=4e3)return String(e);let n=[[1e3,`M`],[900,`CM`],[500,`D`],[400,`CD`],[100,`C`],[90,`XC`],[50,`L`],[40,`XL`],[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],r=e,i=``;for(let[e,t]of n)for(;r>=e;)i+=t,r-=e;return t?i:i.toLowerCase()}function zS(e,t){switch(t){case`a`:return`${LS(e)}.`;case`A`:return`${LS(e,!0)}.`;case`i`:return`${RS(e)}.`;case`I`:return`${RS(e,!0)}.`;default:return`${e}.`}}function BS(e,t,n){sx.set(e,n);let r=e,i=px(r),a=fx(r),o={margin:`5px 0 5px ${a*20}px`,display:`flex`,alignItems:`baseline`},s=cx(r),c=``;c=i?yx(n,r):r.ordered?zS(vx(n,r),gx(r)):IS(a);let l={marginRight:`0.5em`,color:s},u=i?Z(`button`,{type:`button`,className:`w-e-list-marker`,contentEditable:!1,"data-w-e-reserve":!0,"aria-label":X(`listModule.numberingActions`),title:X(`listModule.numberingActions`),style:l,on:{mousedown:e=>e.preventDefault(),click:e=>{e.preventDefault(),e.stopPropagation(),e.currentTarget instanceof HTMLElement&&FS(n,r,e.currentTarget)}}},c):Z(`span`,{className:`w-e-list-marker`,contentEditable:!1,style:l,"data-w-e-reserve":!0},c),d=dx(r),f=d==null?`span`:d.replace(`header`,`h`);return Z(`div`,{className:`w-e-list-item`,style:o},u,Z(f,{style:{flex:`1`,minWidth:`0`,wordBreak:`break-word`}},t))}var VS={renderElems:[{type:`list-item`,renderElem:BS}],editorPlugin:OS,menus:[rS,iS,aS],htmlTransform:qx,elemsToHtml:[Bx],parseElemsHtml:[CS,xS]};Xu(`en`,{tableModule:{modal:{border:`Border`,borderColor:`Border color`,borderStyle:`Border style`,borderWidth:`Border width`,borderWidthDefault:`Default 1`,bgColor:`Back color`,align:`Text Align`,verticalAlign:`Vertical Align`,width:`Width mode`,widthAuto:`Auto`,widthFull:`Full`,mixed:`Mixed`,ok:`OK`},color:{default:`Default color`,clear:`Clear back color`},borderStyle:{none:`None`,solid:`Solid`,dotted:`Dotted`,dashed:`Dashed`,double:`Double`,groove:`Groove`,ridge:`Ridge`,inset:`Inset`,outset:`Outset`},verticalAlign:{top:`Top`,middle:`Middle`,bottom:`Bottom`},deleteCol:`Delete column`,deleteRow:`Delete row`,deleteTable:`Delete table`,widthAuto:`Fit width`,insertCol:`Insert column`,insertRow:`Insert row`,insertTable:`Insert table`,header:`Header`,mergeCell:`merge cell`,splitCell:`split cell`,tableProperty:`Table property`,cellProperty:`Cell property`}}),Xu(`zh-CN`,{tableModule:{modal:{border:`边框`,borderColor:`边框颜色`,borderStyle:`边框样式`,borderWidth:`边框粗细`,borderWidthDefault:`默认 1`,bgColor:`背景色`,align:`对齐方式`,verticalAlign:`垂直对齐`,width:`宽度模式`,widthAuto:`自适应`,widthFull:`撑满`,mixed:`混合`,ok:`确定`},color:{default:`默认颜色`,clear:`清除背景色`},borderStyle:{none:`无样式`,solid:`实线`,dotted:`点状虚线`,dashed:`虚线`,double:`双线`,groove:`凹槽边框`,ridge:`菱形边框`,inset:`凹边框`,outset:`凸边框`},verticalAlign:{top:`上`,middle:`中`,bottom:`下`},deleteCol:`删除列`,deleteRow:`删除行`,deleteTable:`删除表格`,widthAuto:`适应宽度`,insertCol:`插入列`,insertRow:`插入行`,insertTable:`插入表格`,header:`表头`,mergeCell:`合并单元格`,splitCell:`拆分单元格`,tableProperty:`表格属性`,cellProperty:`单元格属性`}});let HS=/^-?(?:\d+|\d*\.\d+)(?:px|em|rem|%|vh|vw|vmin|vmax|pt|pc|cm|mm|in|ch|ex|lh|rlh)$/i;function US(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function WS(e){if(!e||typeof e.getMenuConfig!=`function`)return`explicit`;let t=e.getMenuConfig(`insertTable`);return(t==null?void 0:t.widthExportMode)===`explicit`?`explicit`:`adaptive`}function GS(e,t){let{width:n=`auto`,columnWidths:r=[]}=e;if(n&&n!==`auto`)return n;if(WS(t)===`adaptive`)return`auto`;let i=r.reduce((e,t)=>!Number.isFinite(t)||t<=0?e:e+t,0);return i>0?`${i}px`:`auto`}function KS(e=`auto`){let t=`${e||``}`.trim();if(!t||t===`auto`)return`auto`;let n=Number(t);return Number.isFinite(n)?`${n}px`:HS.test(t)?t:`auto`}function qS(e,t,n){let r=e,{columnWidths:i,caption:a,height:o=`auto`}=r,s=i==null?void 0:i.map(e=>`<col width=${e}></col>`).join(``),c=a?`<caption>${US(a)}</caption>`:``,l=s?`<colgroup contentEditable="false">${s}</colgroup>`:``,u=GS(r,n),d=hm(n),f=KS(o);return d===`class`?`<table class="w-e-table-layout-fixed"${u?` width="${u}"`:``}${f===`auto`?``:` height="${f}"`}${` data-w-e-table-height="${f}"`}>${c}${l}<tbody>${t}</tbody></table>`:`<table style="width: ${u};table-layout: fixed;height:${f}">${c}${l}<tbody>${t}</tbody></table>`}function JS(e,t,n){let{height:r}=e;return hm(n)===`class`?r?`<tr height="${r}" data-w-e-row-height="${r}px">${t}</tr>`:`<tr>${t}</tr>`:`<tr${r?` style="height: ${r}px"`:``}>${t}</tr>`}function YS(e,t){let{colSpan:n=1,rowSpan:r=1,isHeader:i=!1,width:a=`auto`,hidden:o=!1}=e;if(o)return``;let s=i?`th`:`td`;return`<${s} colSpan="${n}" rowSpan="${r}" width="${a}">${t}</${s}>`}let XS={type:`table`,elemToHtml:qS},ZS={type:`table-row`,elemToHtml:JS},QS={type:`table-cell`,elemToHtml:YS},$S=`<svg viewBox="0 0 1024 1024"><path d="M236.8 128L896 787.2V128H236.8z m614.4 704L192 172.8V832h659.2zM192 64h704c38.4 0 64 25.6 64 64v704c0 38.4-25.6 64-64 64H192c-38.4 0-64-25.6-64-64V128c0-38.4 25.6-64 64-64z"></path></svg>`,eC={blocks:{td:`table-cell`,th:`table-cell`,content:`paragraph`,tr:`table-row`,table:`table`,tbody:`table-body`}};function tC(e){return!V.isEditor(e)&&R.isElement(e)&&`type`in e}function nC(e,...t){let n=eC,r=t.map(e=>{var t;return n==null||(t=n.blocks)==null?void 0:t[e]});return e=>tC(e)&&r.includes(e.type)}function rC(e,[t,n],...r){let[i,a]=z.common(e,t,n);return nC(e,...r)(i,a)?!0:!!V.above(e,{match:nC(e,...r),at:a})}function*iC(e,t={}){let[n]=V.nodes(e,{match:nC(e,`table`),at:t.at});if(!n)return[];let[,r]=n;for(let[,t]of V.nodes(e,{match:nC(e,`table`),at:r})){let n=[];for(let[,r]of V.nodes(e,{match:nC(e,`tr`),at:t}))n.push([...V.nodes(e,{match:nC(e,`th`,`td`),at:r})]);yield n}}function aC(e,t={}){let n=[];for(let r of iC(e,{at:t.at})){let e=[],t=0;for(let e=0;e<r.length;e+=1)r[e]&&(t=Math.max(t,r[e].length));for(let t=0;t<r.length;t+=1)if(e[t]||(e[t]=[]),r[t])for(let n=0;n<r[t].length;n+=1){if(!r[t][n]||!r[t][n][0])continue;let[{rowSpan:i=1,colSpan:a=1}]=r[t][n],o=n;for(;e[t]&&e[t][o];)o+=1;for(let s=0;s<a;s+=1)for(let c=0;c<i;c+=1){let l=t+c,u=o+s;e[l]||(e[l]=[]),!e[l][u]&&(e[l][u]=[r[t][n],{rtl:s+1,ltr:a-s,ttb:c+1,btt:i-c}])}}n.push(...e)}return n}var oC=class{constructor(e,t){this.x=e,this.y=t}static valueOf(e,t){return new this(e,t)}static equals(e,t){return e.x===t.x&&e.y===t.y}};globalThis.Node,globalThis.Comment,globalThis.Element,globalThis.Text,globalThis.Range,globalThis.Selection,globalThis.StaticRange,ts&&K.fn&&(K.fn.append=ts),Ho&&K.fn&&(K.fn.on=Ho),fs&&K.fn&&(K.fn.focus=fs),Lo&&K.fn&&(K.fn.attr=Lo),Vo&&K.fn&&(K.fn.val=Vo),Qo&&K.fn&&(K.fn.html=Qo),Bo&&K.fn&&(K.fn.dataset=Bo),Po&&K.fn&&(K.fn.addClass=Po),Fo&&K.fn&&(K.fn.removeClass=Fo),os&&K.fn&&(K.fn.children=os),Xo&&K.fn&&(K.fn.each=Xo),as&&K.fn&&(K.fn.find=as),zo&&K.fn&&(K.fn.data=zo),qo&&K.fn&&(K.fn.hide=qo),Jo&&K.fn&&(K.fn.show=Jo);var $=K;function sC(e){return e.length?e[0].tagName.toLowerCase():``}function cC(e,t){let n=``,r=(e.attr(`style`)||``).split(`;`),i=r.length;for(let e=0;e<i;e+=1){let i=r[e];if(i){let e=i.split(`:`);e[0].trim()===t&&(n=e[1].trim())}}return n}function lC(e){return e.length===0?``:e[0].outerHTML}let uC=new WeakMap,dC=new WeakMap;function fC(e,t={},n=[]){let r=document.createElement(e);return Object.entries(t).forEach(([e,t])=>{if(!(t==null||t===!1)){if(t===!0){r.setAttribute(e,``);return}r.setAttribute(e,t)}}),n.forEach(e=>{r.append(typeof e==`string`?document.createTextNode(e):e)}),r}function pC(e){return e instanceof KeyboardEvent?e:null}function mC(e){return e.key===`Enter`||e.key===` `}var hC=class{constructor(){this.title=X(`tableModule.tableProperty`),this.iconSvg=`<svg viewBox="0 0 20 20"><path d="M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z"/></svg>`,this.tag=`button`,this.showModal=!0,this.modalWidth=340,this.menu=`table`,this.propertyFields=[`borderStyle`,`borderColor`,`borderWidth`,`backgroundColor`],this.borderStyle=[{value:`none`,label:X(`tableModule.borderStyle.none`)},{value:`solid`,label:X(`tableModule.borderStyle.solid`)},{value:`dotted`,label:X(`tableModule.borderStyle.dotted`)},{value:`dashed`,label:X(`tableModule.borderStyle.dashed`)},{value:`double`,label:X(`tableModule.borderStyle.double`)},{value:`groove`,label:X(`tableModule.borderStyle.groove`)},{value:`ridge`,label:X(`tableModule.borderStyle.ridge`)},{value:`inset`,label:X(`tableModule.borderStyle.inset`)},{value:`outset`,label:X(`tableModule.borderStyle.outset`)}],this.textAlignOptions=[{value:`left`,label:X(`justify.left`),svg:`<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`},{value:`center`,label:X(`justify.center`),svg:`<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`},{value:`right`,label:X(`justify.right`),svg:`<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`},{value:`justify`,label:X(`justify.justify`),svg:`<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z m0 192h1024v128H0z"></path></svg>`}],this.verticalAlignOptions=[{value:`top`,label:X(`tableModule.verticalAlign.top`)},{value:`middle`,label:X(`tableModule.verticalAlign.middle`)},{value:`bottom`,label:X(`tableModule.verticalAlign.bottom`)}]}renderRow(e,t,n=`div`){let r=fC(n,{class:`babel-container w-e-table-property-row`}),i=fC(`span`,{class:`w-e-table-property-label`},[e]);return r.append(i,t),r}createFieldControl(e,t,n){return{field:e,root:t,input:n,setValue:(e,t=!1)=>{n.value=e||``,n.setAttribute(`data-mixed`,t?`true`:`false`)},getValue:()=>n.value,setMixed:e=>{n.setAttribute(`data-mixed`,e?`true`:`false`)}}}renderSelect(e,t,n){let r=fC(`input`,{name:e,type:`hidden`}),i=fC(`span`,{class:`w-e-table-property-select-value`}),a=fC(`button`,{type:`button`,class:`w-e-table-property-select-trigger`,"aria-label":t,"aria-haspopup":`listbox`,"aria-expanded":`false`},[i]),o=fC(`span`,{class:`w-e-table-property-select-panel`,role:`listbox`});n.forEach(t=>{o.append(fC(`button`,{type:`button`,class:`w-e-table-property-select-option`,"data-select-option-field":e,"data-value":t.value,role:`option`},[t.label]))});let s=fC(`span`,{class:`w-e-table-property-select`,"data-select-field":e},[a,o]),c=fC(`span`,{class:`babel-container-select w-e-table-property-controls`},[r,s]),l=this.renderRow(t,c),u=this.createFieldControl(e,l,r);return u.setValue=(t,a=!1)=>{let c=e===`borderStyle`&&!t?`none`:t,l=n.find(e=>e.value===c),u=a?X(`tableModule.modal.mixed`):(l==null?void 0:l.label)||``;r.value=c||``,r.setAttribute(`data-mixed`,a?`true`:`false`),s.setAttribute(`data-mixed`,a?`true`:`false`),i.textContent=u,Array.from(o.querySelectorAll(`.w-e-table-property-select-option`)).forEach(e=>{let t=!a&&e.dataset.value===c;e.classList.toggle(`active`,t),e.setAttribute(`aria-selected`,t?`true`:`false`)})},u.setMixed=e=>{r.setAttribute(`data-mixed`,e?`true`:`false`),s.setAttribute(`data-mixed`,e?`true`:`false`),e&&(i.textContent=X(`tableModule.modal.mixed`))},u}renderNumber(e,t){let n=fC(`input`,{name:e,type:`number`,min:`0`,placeholder:X(`tableModule.modal.borderWidthDefault`),"aria-label":t}),r=fC(`span`,{class:`babel-container-number w-e-table-property-controls`},[fC(`span`,{class:`w-e-table-property-number`},[n,fC(`span`,{class:`w-e-table-property-unit`},[`px`])])]);return this.createFieldControl(e,this.renderRow(t,r,`label`),n)}renderColor(e,t,n,r){let i=fC(`span`,{class:`color-group-block`}),a=fC(`span`,{class:`color-group-label`},[r]),o=fC(`input`,{name:e,type:`hidden`}),s=fC(`span`,{class:`color-group color-group-wide`,"data-mark":t,title:n,role:`button`,tabindex:`0`},[i,a,o]),c=fC(`span`,{class:`babel-container-color w-e-table-property-controls`},[s]),l=this.renderRow(n,c),u=this.createFieldControl(e,l,o);return u.setValue=(e,t=!1)=>{o.value=e||``,o.setAttribute(`data-mixed`,t?`true`:`false`),s.setAttribute(`data-mixed`,t?`true`:`false`),e?(i.style.backgroundColor=e,i.innerHTML=``,a.textContent=e,s.classList.remove(`is-empty`)):(i.style.backgroundColor=``,i.innerHTML=$S,a.textContent=r,s.classList.add(`is-empty`)),s.setAttribute(`data-empty`,e?`false`:`true`)},u.setMixed=e=>{o.setAttribute(`data-mixed`,e?`true`:`false`),s.setAttribute(`data-mixed`,e?`true`:`false`)},u}renderSegment(e,t,n,r=!1){let i=fC(`input`,{name:e,type:`hidden`}),a=fC(`span`,{class:`w-e-table-property-segment${r?` w-e-table-property-segment-fill`:``}`});n.forEach(t=>{let n=fC(`button`,{type:`button`,class:`w-e-table-property-segment-button${t.svg?` w-e-table-property-align-button`:``}`,"data-field":e,"data-value":t.value,title:t.label,"aria-label":t.label});t.svg?n.innerHTML=t.svg:n.textContent=t.label,a.append(n)});let o=fC(`span`,{class:`babel-container-align w-e-table-property-controls`},[i,a]),s=this.renderRow(t,o),c=this.createFieldControl(e,s,i);return c.setValue=(e,t=!1)=>{i.value=e||``,i.setAttribute(`data-mixed`,t?`true`:`false`),Array.from(a.querySelectorAll(`[data-field]`)).forEach(n=>{let r=!t&&n.dataset.value===e;n.classList.toggle(`active`,r),n.setAttribute(`aria-pressed`,r?`true`:`false`)})},c}getValue(e){return``}isActive(e){return!1}isDisabled(e){return this.getModalContentNode(e)==null}exec(e,t){}getModalContentNode(e){let[t]=V.nodes(e,{match:nC(e,`table`)});return t}getModalPositionNode(e){return null}getModalContentElem(e){var t;let n=this.getModalContentNode(e);if(!n)return null;let[r,i]=n,a=this.propertyFields,o=e=>a.includes(e),s=this.menu===`cell`,c=[this.renderSelect(`borderStyle`,X(`tableModule.modal.borderStyle`),this.borderStyle),this.renderColor(`borderColor`,`color`,X(`tableModule.modal.borderColor`),X(`tableModule.color.default`)),this.renderNumber(`borderWidth`,X(`tableModule.modal.borderWidth`)),this.renderColor(`backgroundColor`,`bgColor`,X(`tableModule.modal.bgColor`),X(`tableModule.color.clear`))],l=fC(`div`,{class:`w-e-table-property-modal`},c.map(e=>e.root));if(o(`textAlign`)){let e=this.renderSegment(`textAlign`,X(`tableModule.modal.align`),this.textAlignOptions);c.push(e),l.append(e.root)}if(o(`verticalAlign`)){let e=this.renderSegment(`verticalAlign`,X(`tableModule.modal.verticalAlign`),this.verticalAlignOptions);c.push(e),l.append(e.root)}l.append(fC(`div`,{class:`button-container`},[fC(`button`,{type:`button`},[X(`tableModule.modal.ok`)])]));let u=$(l),d=new Map;c.forEach(e=>{d.set(e.field,e)});let f=new Set,p=()=>{u.find(`.w-e-table-property-select-panel`).hide(),u.find(`.w-e-table-property-select-trigger`).attr(`aria-expanded`,`false`)};u.on(`mousedown`,e=>{let t=e.target;t instanceof Element&&(t.closest(`.w-e-table-property-select`)||p())});let m=e=>{e!=null&&a.includes(e)&&f.add(e)},h=(e,t,n=!1)=>{var r;(r=d.get(e))==null||r.setValue(t,n)},g=e=>{var t;return((t=d.get(e))==null?void 0:t.getValue())||``},_=t=>{if(!s)return r[t]||``;let n=uC.get(e);if(!(n!=null&&n.length))return r[t]||``;let i,a=!1,o=!1;return n.forEach(e=>{e.forEach(e=>{let[n]=e[0],r=n[t]||``;if(!a){i=r,a=!0;return}i!==r&&(o=!0)})}),o?void 0:i},v=(e,t)=>e===`borderStyle`&&!t?`none`:t;d.forEach((e,t)=>{let n=_(t),r=v(t,n);if(n==null){if(h(t,``,!0),e.input.type===`hidden`){let t=e.input.closest(`.color-group`);t&&$(t).attr(`data-mixed`,`true`)}e.input.type!==`hidden`&&(e.input.placeholder=X(`tableModule.modal.mixed`));return}h(t,r)}),(t=d.get(`borderWidth`))==null||t.input.addEventListener(`change`,e=>{let t=e.currentTarget;m(t.name),t.setAttribute(`data-mixed`,`false`)}),u.find(`.w-e-table-property-select-trigger`).on(`click`,e=>{e.preventDefault(),e.stopPropagation();let t=e.currentTarget;if(t==null)return;let n=$(t),r=n.parents(`.w-e-table-property-select`).find(`.w-e-table-property-select-panel`),i=n.attr(`aria-expanded`)===`true`;u.find(`.color-group .w-e-drop-panel`).hide(),p(),i||(r.show(),n.attr(`aria-expanded`,`true`))}),u.find(`.w-e-table-property-select-trigger`).on(`keydown`,e=>{let t=pC(e),n=e.currentTarget;if(!(t==null||!(n instanceof HTMLElement))){if(mC(t)){t.preventDefault(),n.click();return}t.key===`Escape`&&(t.preventDefault(),p())}}),u.find(`.w-e-table-property-select-option`).on(`click`,e=>{e.preventDefault(),e.stopPropagation();let t=e.currentTarget;if(t==null)return;let n=$(t),r=n.attr(`data-select-option-field`);h(r,n.attr(`data-value`)||``),m(r),p()}),u.find(`.w-e-table-property-select-option`).on(`keydown`,e=>{let t=pC(e),n=e.currentTarget;if(!(t==null||!(n instanceof HTMLElement))){if(mC(t)){t.preventDefault(),n.click();return}t.key===`Escape`&&(t.preventDefault(),p())}}),u.find(`[data-field]`).on(`click`,e=>{let t=e.currentTarget;if(t==null)return;let n=$(t),r=n.attr(`data-value`)||``,i=n.attr(`data-field`);h(i,r),m(i)});let y=()=>{let e=g(`borderStyle`),t=g(`borderWidth`);(!e||e===`none`)&&(h(`borderStyle`,`solid`),m(`borderStyle`)),(!t||t===`0`)&&(h(`borderWidth`,`1`),m(`borderWidth`))};return u.find(`.color-group`).each(t=>{let n=$(t),r=()=>{p(),u.find(`.color-group .w-e-drop-panel`).hide();let r=n.data(`panel`),i=n.data(`mark`),a=i===`color`?`borderColor`:`backgroundColor`;r?(this.updateColorPanelActive(r,g(a)),r.show()):(r=this.getPanelContentElem(e,{mark:i,selectedColor:g(a),callback:e=>{h(a,e||``),$(t).attr(`data-mixed`,`false`),m(a),a===`borderColor`&&e&&y(),r.hide()}}),n.append(r),n.data(`panel`,r))};n.on(`click`,()=>{r()}),n.on(`keydown`,e=>{let t=pC(e);t==null||!mC(t)||(t.preventDefault(),r())})}),u.find(`.button-container button`).on(`click`,()=>{let t=Array.from(d).reduce((e,[t,n])=>(f.has(t)&&(e[t]=n.getValue()),e),{});if(Object.keys(t).length===0){e.focus();return}let n=uC.get(e);this.menu===`cell`&&n!=null&&n.length?n.forEach(n=>{n.forEach(n=>{G.setNodes(e,t,{at:n[0][1]})})}):G.setNodes(e,t,{at:i}),setTimeout(()=>{e.focus()})}),u[0]}getPanelContentElem(e,{mark:t,selectedColor:n,callback:r}){let i=$(fC(`ul`,{class:`w-e-panel-content-color`}));i.on(`click`,`li`,e=>{let{target:t}=e;t&&(e.preventDefault(),e.stopPropagation(),r($(t).attr(`data-value`)))});let{colors:a=[]}=e.getMenuConfig(t);a.forEach(e=>{let t=$(fC(`div`,{class:`color-block`,"data-value":e}));t.css(`background-color`,e);let r=$(fC(`li`,{"data-value":e}));n===e&&r.addClass(`active`),r.append(t),i.append(r)});let o=``;t===`color`&&(o=X(`tableModule.color.default`)),t===`bgColor`&&(o=X(`tableModule.color.clear`));let s=fC(`li`,{"data-value":``,class:`clear`});s.innerHTML=$S,s.append(document.createTextNode(o));let c=$(s);i.prepend(c);let l=$(fC(`div`,{class:`w-e-drop-panel`}));return l.append(i),l}updateColorPanelActive(e,t){e.find(`li`).each(e=>{let n=$(e);n.attr(`data-value`)===t?n.addClass(`active`):n.removeClass(`active`)})}},gC=class extends hC{constructor(...e){super(...e),this.title=X(`tableModule.cellProperty`),this.iconSvg=`<svg viewBox="0 0 20 20"><path d="m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z"/></svg>`,this.tag=`button`,this.showModal=!0,this.modalWidth=360,this.menu=`cell`,this.propertyFields=[`borderStyle`,`borderColor`,`borderWidth`,`backgroundColor`,`textAlign`,`verticalAlign`]}getModalContentNode(e){let[t]=V.nodes(e,{match:nC(e,`td`)});return t}},_C=class{constructor(){this.title=X(`tableModule.deleteCol`),this.iconSvg=`<svg viewBox="0 0 1048 1024"><path d="M327.68 510.976L393.216 445.44v-13.1072L327.68 366.7968V510.976z m327.68-78.4384l65.536-65.536V507.904L655.36 442.368v-9.8304z m393.216 484.9664V0H0v917.504h1048.576z m-65.536-131.072h-262.144v-52.4288l-13.1072 13.1072-52.4288-52.4288v91.7504H393.216v-91.7504l-52.4288 52.4288-13.1072-13.1072v52.4288H65.536V65.536H327.68v121.2416l36.0448-36.0448 29.4912 29.4912V62.2592h262.144V180.224l49.152-49.152 16.384 16.384V62.2592h262.144V786.432z m-294.912-108.1344l-160.5632-160.5632-167.1168 167.1168-78.6432-78.6432 167.1168-167.1168L288.3584 278.528l78.6432-78.6432 160.5632 160.5632 163.84-163.84 78.6432 78.6432-163.84 163.84 160.5632 160.5632-78.6432 78.6432z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){let{selection:t}=e;return t==null||!L.isCollapsed(t)||J.getSelectedNodeByType(e,`table-cell`)==null}exec(e,t){if(this.isDisabled(e))return;let[n]=V.nodes(e,{match:e=>J.checkNodeType(e,`table-cell`),universal:!0}),[r,i]=n,a=J.getParentNode(e,r),o=(a==null?void 0:a.children.length)||0;if(!a||o<=1){G.removeNodes(e,{mode:`highest`});return}if(J.getParentNode(e,a)==null)return;let s=aC(e),c=0;out:for(let e=0;e<s.length;e+=1)for(let t=0;t<s[e].length;t+=1){let[[,n]]=s[e][t];if(I.equals(i,n)){c=t;break out}}V.withoutNormalizing(e,()=>{let t=new Set,n=new Set;for(let r=0;r<s.length;r+=1){if(!s[r]||!s[r][c])continue;let[[,i],{rtl:a,ltr:o,ttb:l,btt:u}]=s[r][c],d=i.join(`,`);if(a>1||o>1||l>1||u>1){let t=r-(l-1),i=c-(a-1);if(t<0||t>=s.length||!s[t]||!s[t][i])continue;let[[o,u]]=s[t][i],d=u.join(`,`);if(!n.has(d)){n.add(d);let{rowSpan:t=1,colSpan:r=1}=o,i=Math.max(r-1,1);G.setNodes(e,{rowSpan:t,colSpan:i},{at:u})}}else t.add(d)}let r=Array.from(t);r.sort((e,t)=>{let n=e.split(`,`).map(Number),r=t.split(`,`).map(Number);return n[n.length-2]===r[r.length-2]?r[r.length-1]-n[n.length-1]:r[r.length-2]-n[n.length-2]});for(let t of r){let n=t.split(`,`).map(Number);try{V.hasPath(e,n)&&G.removeNodes(e,{at:n})}catch(e){console.warn(`删除单元格失败:`,n,e)}}let[i]=V.nodes(e,{match:e=>J.checkNodeType(e,`table`),universal:!0});if(i){let[t,n]=i,{columnWidths:r=[]}=t,a=[...r];a.splice(c,1),G.setNodes(e,{columnWidths:a},{at:n})}})}};O();function vC(e={}){return D(D({type:`table-cell`},e),{},{children:[{type:`paragraph`,children:[{text:``}]}]})}function yC(e){return e.map(e=>W.isText(e)?D({},e):D(D({},e),{},{children:yC(e.children)}))}function bC(e){let t=[],n=[],r=()=>{n.length!==0&&(t.push({type:`paragraph`,children:n}),n=[])};return e.forEach(e=>{if(W.isText(e)){n.push(D({},e));return}r(),t.push(e)}),r(),t.length>0?t:vC().children}function xC(e,t){return t.children.every(t=>W.isText(t)?!0:R.isElement(t)&&e.isInline(t)&&xC(e,t))}function SC(e,t){return R.isElement(t)?t.type===`paragraph`||t.type===`list-item`?xC(e,t):t.type===`pre`?t.children.length===1&&R.isElement(t.children[0])&&t.children[0].type===`code`&&t.children[0].children.every(W.isText):t.type===`video`?e.isVoid(t)&&t.children.every(W.isText):!1:!1}function CC(e){return e.map(e=>{if(W.isText(e))return e;if(e.type===`table-cell`)return D(D({},e),{},{children:bC(e.children)});let t=CC(e.children);return t.every((t,n)=>t===e.children[n])?e:D(D({},e),{},{children:t})})}function wC(e,t,n){try{let r=J.findPath(e,t);G.setNodes(e,n,{at:r})}catch(e){}}function TC(e){let t=e.children||[];return t.length===0?[]:(t[0]||{}).children||[]}function EC(e){return TC(e).every(e=>!!e.isHeader)}function DC(e,t){let n=J.getParentNode(e,t);if(n==null)return!1;let r=J.getParentNode(e,n);return r==null?!1:TC(r).some(e=>e===t)}var OC=class{constructor(){this.title=X(`tableModule.deleteRow`),this.iconSvg=`<svg viewBox="0 0 1048 1024"><path d="M907.6736 586.5472L747.1104 425.984l163.84-163.84-78.6432-78.6432-163.84 163.84L507.904 186.7776 429.2608 262.144l163.84 163.84-167.1168 167.1168 78.6432 78.6432 167.1168-167.1168 160.5632 160.5632 75.3664-78.6432zM0 917.504V0h1048.576v917.504H0z m983.04-327.68h-22.9376l-65.536-65.536H983.04V327.68h-91.7504l65.536-65.536h26.2144V65.536H65.536v196.608h317.8496l65.536 65.536H65.536v196.608h380.1088l-65.536 65.536H65.536v196.608H983.04v-196.608z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){let{selection:t}=e;return t==null||!L.isCollapsed(t)||J.getSelectedNodeByType(e,`table-row`)==null}exec(e,t){if(this.isDisabled(e))return;let[n]=V.nodes(e,{match:e=>J.checkNodeType(e,`table-row`),universal:!0}),[r,i]=n,a=J.getParentNode(e,r);if(((a==null?void 0:a.children.length)||0)<=1){G.removeNodes(e,{mode:`highest`});return}let[o]=V.nodes(e,{match:e=>J.checkNodeType(e,`table-cell`),universal:!0}),[,s]=o,c=aC(e),l=0;outer:for(let e=0;e<c.length;e+=1)for(let t=0;t<c[e].length;t+=1){let[[,n]]=c[e][t];if(I.equals(s,n)){l=e;break outer}}V.withoutNormalizing(e,()=>{let t=[];for(let n=0;n<c[l].length;n+=1){let[[{hidden:r}],{ttb:i,btt:a,rtl:o}]=c[l][n];if(i>1||a>1){let a=l-(i-1);if(a<0||a>=c.length||!c[a]||!c[a][n])continue;let[[s,u]]=c[a][n],d=s,{rowSpan:f=1,colSpan:p=1}=d;if(r)G.setNodes(e,{rowSpan:Math.max(f-1,1),colSpan:p},{at:u});else if(i===1&&o===1)if(l+1<c.length&&f>1){let e={type:`table-cell`,rowSpan:f-1,colSpan:p,hidden:!1,children:yC(d.children)};d.isHeader&&(e.isHeader=d.isHeader),d.width&&(e.width=d.width),d.backgroundColor&&(e.backgroundColor=d.backgroundColor),d.borderWidth&&(e.borderWidth=d.borderWidth),d.borderStyle&&(e.borderStyle=d.borderStyle),d.borderColor&&(e.borderColor=d.borderColor),d.textAlign&&(e.textAlign=d.textAlign),d.verticalAlign&&(e.verticalAlign=d.verticalAlign),t.push({cell:e,columnIndex:n})}else G.setNodes(e,{rowSpan:Math.max(f-1,1),colSpan:p},{at:u});else G.setNodes(e,{rowSpan:Math.max(f-1,1),colSpan:p},{at:u})}}if(G.removeNodes(e,{at:i}),t.length>0){let n=i;try{t.sort((e,t)=>e.columnIndex-t.columnIndex);for(let{cell:r,columnIndex:i}of t)try{let t=[...n,i];G.insertNodes(e,r,{at:t})}catch(t){try{let[t]=V.node(e,n),i=t.children.length,a=[...n,i];G.insertNodes(e,r,{at:a})}catch(e){console.warn(`插入新单元格失败:`,e)}}}catch(e){console.warn(`插入新单元格失败:`,e)}}})}},kC=class{constructor(){this.title=X(`tableModule.deleteTable`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z" p-id="9577"></path><path d="M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){return e.selection==null||J.getSelectedNodeByType(e,`table`)==null}exec(e,t){this.isDisabled(e)||G.removeNodes(e,{mode:`highest`})}},AC=class{constructor(){this.title=X(`tableModule.widthAuto`),this.iconSvg=`<svg viewBox="0 0 1228 1024"><path d="M862.514337 563.200461H404.581995v121.753478a13.311987 13.311987 0 0 1-6.655993 11.468789 10.23999 10.23999 0 0 1-12.083188-1.433599l-204.799795-179.199821a13.721586 13.721586 0 0 1 0-20.479979l204.799795-179.302221a10.23999 10.23999 0 0 1 12.185588-1.535998 13.209587 13.209587 0 0 1 6.553593 11.673588v115.097485h457.932342V319.693504a11.571188 11.571188 0 0 1 18.841582-10.239989l204.799795 179.19982a13.721586 13.721586 0 0 1 0 20.47998l-204.799795 179.199821a10.23999 10.23999 0 0 1-12.185588 1.535998 13.311987 13.311987 0 0 1-6.655994-11.571188V563.200461zM136.499064 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785H15.155185A15.155185 15.155185 0 0 1 0 1008.844815V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086294a15.155185 15.155185 0 0 1 15.257585 15.155185zM1228.798771 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785h-106.188693a15.155185 15.155185 0 0 1-15.155185-15.052785V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086293A15.155185 15.155185 0 0 1 1228.798771 15.053809z"></path></svg>`,this.tag=`button`}getValue(e){let t=J.getSelectedNodeByType(e,`table`);return t==null?!1:t.width===`100%`}isActive(e){return!!this.getValue(e)}isDisabled(e){let{selection:t}=e;return t==null||!L.isCollapsed(t)||J.getSelectedNodeByType(e,`table`)==null}exec(e,t){if(this.isDisabled(e))return;let n=J.getSelectedNodeByType(e,`table`);if(!n)return;let r={width:n.width===`100%`?`auto`:`100%`};G.setNodes(e,r,{mode:`highest`})}},jC=class{constructor(){this.title=X(`tableModule.insertCol`),this.iconSvg=`<svg viewBox="0 0 1048 1024"><path d="M327.68 193.3312v186.7776H140.9024v91.7504H327.68v186.7776h88.4736V471.8592h190.0544V380.1088H416.1536V193.3312zM0 917.504V0h1048.576v917.504H0zM655.36 65.536H65.536v720.896H655.36V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 262.144h-262.144v196.608h262.144V327.68z m0 262.144h-262.144v196.608h262.144v-196.608z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){let{selection:t}=e;if(t==null||!L.isCollapsed(t))return!0;let n=J.getSelectedNodeByType(e,`table`);if(n==null)return!0;try{let[t]=V.nodes(e,{match:e=>J.checkNodeType(e,`table-cell`),universal:!0});if(!t)return!0;let[,r]=t,i=aC(e),a=-1;for(let e=0;e<i.length;e+=1){for(let t=0;t<i[e].length;t+=1){let[[,n]]=i[e][t];if(I.equals(r,n)){a=t;break}}if(a!==-1)break}if(a===-1)return!0;let{columnWidths:o=[]}=n,s=o[a];if(s&&s<20)return!0}catch(e){return!0}return!1}exec(e,t){var n;if(this.isDisabled(e))return;let[r]=V.nodes(e,{match:e=>J.checkNodeType(e,`table-cell`),universal:!0}),[i,a]=r,o=J.getParentNode(e,i);if(o==null)return;let s=J.getParentNode(e,o);if(s==null)return;let c=aC(e),l=-1;for(let e=0;e<c.length;e+=1){for(let t=0;t<c[e].length;t+=1){let[[,n]]=c[e][t];if(I.equals(a,n)){l=t;break}}if(l!==-1)break}if(l===-1)return;let u=i.colSpan||1,{insertPosition:d=`before`}=e.getMenuConfig(`insertTableCol`)||{},f=d===`after`?`after`:`before`,p=((n=c[0])==null?void 0:n.length)||0,m=f===`after`?Math.min(l+u,p):l,h=m<p?m:-1;V.withoutNormalizing(e,()=>{let t=new Set,n=new Set;for(let r=0;r<c.length;r+=1){if(h<0||!c[r]||!c[r][h])continue;let[[,],{rtl:i,ltr:a,ttb:o,btt:s}]=c[r][h];if(i>1||a>1||o>1||s>1){let a=r-(o-1),s=h-(i-1);if(a<0||a>=c.length||!c[a]||!c[a][s])continue;let[[l,u]]=c[a][s],d=u.join(`,`);if(t.has(d))n.add(r);else{t.add(d);let{rowSpan:r=1,colSpan:i=1}=l,o=i+1;l.hidden||G.setNodes(e,{colSpan:o},{at:u});for(let e=0;e<r;e+=1)n.add(a+e)}}}for(let t=0;t<c.length;t+=1){if(n.has(t))continue;let r=c[t];if(!r||r.length===0)continue;let i=vC();t===0&&EC(s)&&(i.isHeader=!0);let a;if(m<r.length){let[[,e]]=r[m];a=e}else{let[[,e]]=r[r.length-1];a=I.next(e)}G.insertNodes(e,i,{at:a})}let[r]=V.nodes(e,{match:e=>J.checkNodeType(e,`table`),universal:!0});if(r){let[t,n]=r,{columnWidths:i=[]}=t,a=[...i],{minWidth:o=60}=e.getMenuConfig(`insertTable`),s=i[l]||parseInt(o.toString(),10)||60,c=Math.floor(s/2),u=s-c;f===`after`?(a[l]=u,a.splice(l+1,0,c)):(a.splice(l,0,c),a[l+1]=u),G.setNodes(e,{columnWidths:a},{at:n})}})}},MC=class{constructor(){this.title=X(`tableModule.insertRow`),this.iconSvg=`<svg viewBox="0 0 1048 1024"><path d="M707.7888 521.0112h-147.456v-147.456H488.2432v147.456h-147.456v68.8128h147.456v147.456h72.0896v-147.456h147.456zM0 917.504V0h1048.576v917.504H0zM327.68 65.536H65.536v196.608H327.68V65.536z m327.68 0H393.216v196.608h262.144V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 258.8672H65.536v462.0288H983.04V324.4032z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){let{selection:t}=e;return t==null||!L.isCollapsed(t)||J.getSelectedNodeByType(e,`table`)==null}exec(e,t){var n;if(this.isDisabled(e))return;let[r]=V.nodes(e,{match:e=>J.checkNodeType(e,`table-cell`),universal:!0}),[,i]=r,a=aC(e),o=0;outer:for(let e=0;e<a.length;e+=1)for(let t=0;t<a[e].length;t+=1){let[[,n]]=a[e][t];if(I.equals(i,n)){o=e;break outer}}let s=((n=a[o])==null?void 0:n.length)||0;s!==0&&V.withoutNormalizing(e,()=>{let t=o+1,n=t>=0&&t<a.length,r=[];for(let t=0;n&&t<a[o].length;t+=1){let[,{ttb:n,btt:i}]=a[o][t];if(n>1||i>1){let i=o-(n-1);if(i<0||i>=a.length||!a[i]||!a[i][t])continue;let[[s,c]]=a[i][t],l=s.rowSpan||1;r.push(t),s.hidden||G.setNodes(e,{rowSpan:l+1},{at:c})}}let{minRowHeight:c=30}=e.getMenuConfig(`insertTable`)||{},l={type:`table-row`,children:[],height:parseInt(c.toString(),10)||30};for(let e=0;e<s;e+=1){if(r.includes(e))continue;let t=vC();l.children.push(t)}let u=I.parent(i),d=I.next(u);G.insertNodes(e,l,{at:d})})}};function NC(e,t,n){let r=[],{minWidth:i=60,minRowHeight:a=30,tableFullWidth:o,tableHeader:s}=e.getMenuConfig(`insertTable`),c=Array(n).fill(parseInt(i,10)||60);for(let e=0;e<t;e+=1){let t=[];for(let r=0;r<n;r+=1){let n=vC();if(e===0){var l;n.isHeader=(l=s==null?void 0:s.selected)==null?!0:l}t.push(n)}r.push({type:`table-row`,children:t,height:parseInt(a,10)||30})}return{type:`table`,width:o!=null&&o.selected?`100%`:`auto`,children:r,columnWidths:c}}var PC=class{constructor(){this.title=X(`tableModule.insertTable`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M0 64v896h1024V64H0z m384 576v-192h256v192h-256z m256 64v192h-256v-192h256z m0-512v192h-256V192h256zM320 192v192H64V192h256z m-256 256h256v192H64v-192z m640 0h256v192h-256v-192z m0-64V192h256v192h-256zM64 704h256v192H64v-192z m640 192v-192h256v192h-256z"></path></svg>`,this.tag=`button`,this.showDropPanel=!0,this.$content=null}getValue(e){return``}isActive(e){return!1}exec(e,t){}isDisabled(e){let{selection:t}=e;return!!(t==null||!L.isCollapsed(t)||J.getSelectedElems(e).some(t=>{let n=J.getNodeType(t);return!!(n===`pre`||n===`table`||n===`list-item`||e.isVoid(t))}))}getPanelContentElem(e){if(this.$content)return this.$content[0];let t=$(`<div class="w-e-panel-content-table"></div>`),n=$(`<span>0 &times; 0</span>`),r=$(`<table></table>`);for(let t=0;t<10;t+=1){let i=$(`<tr></tr>`);for(let a=0;a<10;a+=1){let o=$(`<td></td>`);o.attr(`data-x`,a.toString()),o.attr(`data-y`,t.toString()),i.append(o),o.on(`mouseenter`,e=>{let{target:t}=e;if(t==null)return;let{x:i,y:a}=$(t).dataset();n[0].innerHTML=`${i+1} &times; ${a+1}`,r.children().each(e=>{$(e).children().each(e=>{let t=$(e),{x:n,y:r}=t.dataset();n<=i&&r<=a?t.addClass(`active`):t.removeClass(`active`)})})}),o.on(`click`,t=>{t.preventDefault();let{target:n}=t;if(n==null)return;let{x:r,y:i}=$(n).dataset();this.insertTable(e,i+1,r+1)})}r.append(i)}return t.append(r),t.append(n),this.$content=t,t[0]}insertTable(e,t,n){let r=parseInt(t,10),i=parseInt(n,10);if(!r||!i||r<=0||i<=0)return;J.isSelectedEmptyParagraph(e)&&G.removeNodes(e,{mode:`highest`});let a=NC(e,r,i);G.insertNodes(e,a,{mode:`highest`})}};let FC={isInTable(e,t={}){let[n]=V.nodes(e,{match:nC(e,`table`),at:t.at});return!!n},*selection(e){let t=uC.get(e);for(let e=0;t&&e<t.length;e+=1){let n=[];for(let r=0;r<t[e].length;r+=1){let[i,{ltr:a,ttb:o}]=t[e][r];o===1&&n.push(i),r+=a-1}yield n}},unselect(e){dC.delete(e),uC.delete(e)},isSelected(e,t){let n=dC.get(e);return n?n.has(t):!1},hasSelected(e){return uC.has(e)}};var IC=class{constructor(){this.title=X(`tableModule.mergeCell`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M482.2 508.4 331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4c2.4-1.8 2.4-5.4 0-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4c-2.3 1.8-2.3 5.3 0 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"/></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){return!this.canMerge(e)}exec(e,t){this.isDisabled(e)||(this.merge(e),FC.unselect(e))}canMerge(e){let t=uC.get(e);if(!t||!t.length)return!1;let[[,n]]=t[t.length-1][t[t.length-1].length-1],[[,r]]=t[0][0];return!!rC(e,[r,n],`table`)}merge(e){if(!this.canMerge(e))return;let t=uC.get(e);if(!t||!t.length)return;let[[,n]]=t[0][0],[[,r]]=z.children(e,n,{reverse:!0});V.withoutNormalizing(e,()=>{let i=new Map,a=[],o=1/0,s=-1/0,c=1/0,l=-1/0;for(let e=0;e<t.length;e+=1)for(let n=0;n<t[e].length;n+=1){let[[r,a],{ttb:u}]=t[e][n],d=a.join(`,`);if(u===1&&!i.has(d)){i.set(d,{path:a,x:e,y:n,element:r});let{rowSpan:t=1,colSpan:u=1}=r,f=e,p=e+t-1,m=n,h=n+u-1;o=Math.min(o,f),s=Math.max(s,p),c=Math.min(c,m),l=Math.max(l,h)}}let u=s-o+1,d=l-c+1;for(let[,{path:e}]of i)I.equals(n,e)||a.push(e);a.sort((e,t)=>{for(let n=0;n<Math.min(e.length,t.length);n+=1)if(e[n]!==t[n])return t[n]-e[n];return t.length-e.length});for(let t of a)try{if(!V.hasPath(e,t))continue;for(let[,n]of z.children(e,t,{reverse:!0}))G.moveNodes(e,{to:I.next(r),at:n});G.removeNodes(e,{at:t})}catch(e){}G.setNodes(e,{rowSpan:u,colSpan:d},{at:n})})}},LC=class{constructor(){this.title=X(`tableModule.splitCell`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M362.667 494.933v53.334l25.6-25.6zm0-241.066L460.8 352V78.933H57.6v98.134h305.067zm0 535.466v57.6H57.6v98.134h403.2V691.2zM661.333 494.933v53.334l-25.6-25.6zm0-241.066L563.2 352V78.933h403.2v98.134H661.333zm0 535.466v57.6H966.4v98.134H563.2V691.2z"/><path d="M753.067 341.333 693.333 281.6 512 460.8 330.667 281.6l-59.734 59.733 181.334 181.334L270.933 704l59.734 59.733L512 582.4l181.333 181.333L753.067 704 571.733 522.667z"/></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){let[t]=V.nodes(e,{match:e=>J.checkNodeType(e,`table-cell`)});if(!t)return!0;let[{rowSpan:n=1,colSpan:r=1}]=t;return!(n>1||r>1)}exec(e,t){this.isDisabled(e)||this.split(e)}split(e,t={}){let[n,r]=V.nodes(e,{match:nC(e,`table`,`th`,`td`),at:t.at});if(!n||!r)return;let[i]=n,a=EC(i),[o,s]=r,{rowSpan:c=1,colSpan:l=1}=o;c===1&&l===1||V.withoutNormalizing(e,()=>{G.setNodes(e,{rowSpan:1,colSpan:1},{at:s});for(let t=1;t<l;t+=1){let n=vC();s[s.length-2]===0&&a&&(n.isHeader=!0);let r=s.slice(0,-1),i=s[s.length-1]+t,o=[...r,i];try{G.insertNodes(e,n,{at:o})}catch(t){try{let[t]=V.node(e,r),i=t.children.length,a=[...r,i];G.insertNodes(e,n,{at:a})}catch(e){console.warn(`插入同行单元格失败: ${e instanceof Error?e.message:String(e)}`)}}}for(let t=1;t<c;t+=1){let n=s[s.length-2]+t,r=[...s.slice(0,-2),n];try{let[i]=V.node(e,r);if(!i){console.warn(`目标行 ${n} 不存在`);continue}for(let n=0;n<l;n+=1){let a=vC(),o=s[s.length-1]+n,c=[...r,o];try{let t=i.children.length;if(o>=t){let n=[...r,t];G.insertNodes(e,a,{at:n})}else G.insertNodes(e,a,{at:c})}catch(n){try{let t=i.children.length,n=[...r,t];G.insertNodes(e,a,{at:n})}catch(e){console.warn(`插入单元格到第${t}行失败: ${e instanceof Error?e.message:String(e)}`)}}}}catch(e){console.warn(`处理第${t}行时出错: ${e instanceof Error?e.message:String(e)}`)}}})}},RC=class{constructor(){this.title=X(`tableModule.header`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M704 128l-64 0L384 128 320 128 0 128l0 256 0 64 0 192 0 64 0 256 320 0 64 0 256 0 64 0 320 0 0-256 0-64L1024 448 1024 384 1024 128 704 128zM640 640 384 640 384 448l256 0L640 640zM64 448l256 0 0 192L64 640 64 448zM320 896 64 896l0-192 256 0L320 896zM640 896 384 896l0-192 256 0L640 896zM960 896l-256 0 0-192 256 0L960 896zM960 640l-256 0L704 448l256 0L960 640z"></path></svg>`,this.tag=`button`}getValue(e){let t=J.getSelectedNodeByType(e,`table`);return t==null?!1:EC(t)}isActive(e){return!!this.getValue(e)}isDisabled(e){let{selection:t}=e;return t==null||!L.isCollapsed(t)||J.getSelectedNodeByType(e,`table`)==null}exec(e,t){if(this.isDisabled(e))return;let n=!t,r=J.getSelectedNodeByType(e,`table`);r!=null&&TC(r).forEach(t=>G.setNodes(e,{isHeader:n},{at:J.findPath(e,t)}))}};let zC={key:`insertTable`,config:{minWidth:60,minRowHeight:30,tableHeader:{selected:!0},tableFullWidth:{selected:!1},widthExportMode:`explicit`},factory(){return new PC}},BC={key:`deleteTable`,factory(){return new kC}},VC={key:`insertTableRow`,factory(){return new MC}},HC={key:`deleteTableRow`,factory(){return new OC}},UC={key:`insertTableCol`,factory(){return new jC}},WC={key:`deleteTableCol`,factory(){return new _C}},GC={key:`tableHeader`,factory(){return new RC}},KC={key:`tableFullWidth`,factory(){return new AC}},qC={key:`mergeTableCell`,factory(){return new IC}},JC={key:`splitTableCell`,factory(){return new LC}},YC={key:`setTableProperty`,factory(){return new hC}},XC={key:`setTableCellProperty`,factory(){return new gC}};function ZC(e,t=0){let n=parseInt(e||``,10);return Number.isNaN(n)?t:n}function QC(e,t=0,n=0){let r=(e||``).trim().toLowerCase(),i=parseFloat(r);if(Number.isNaN(i))return t;if(r.endsWith(`pt`))return Math.round(i*4/3);if(r.endsWith(`%`)){let e=n>0?n:600;return Math.round(i/100*e)}return Math.round(i)}function $C(e,t){if(!e||e.length===0)return[];let n=[];return Array.from(e).forEach(e=>{let r=parseInt(e.getAttribute(`span`)||`1`,10),i=QC(e.getAttribute(`width`)||cC($(e),`width`),90,t);if(!Number.isNaN(i))for(let e=0;e<r;e+=1)n.push(i)}),n}function ew(e){let t=cC(e,`width`),n=e.attr(`width`)||``,r=t||n;return!r||r.trim()===`100%`?0:QC(r,0)}function tw(e,t,n){let r=$(e),i=r.text().replace(/\s+/gm,` `).trim();t=t.filter(e=>W.isText(e)||n.isInline(e)?!0:SC(n,e)),t.length===0&&(t=[{text:r.text().replace(/\s+/gm,` `)}]),t=bC(t);let a=parseInt(r.attr(`colSpan`)||`1`,10),o=parseInt(r.attr(`rowSpan`)||`1`,10),s=cC(r,`display`)===`none`&&i.length===0,c=r.attr(`width`)||`auto`;return{type:`table-cell`,isHeader:sC(r)===`th`,colSpan:a,rowSpan:o,width:c,children:t,hidden:s}}let nw={selector:`td:not([data-w-e-type]),th:not([data-w-e-type])`,parseElemHtml:tw};function rw(e,t,n){let r=$(e),i=[];for(let e=0;e<t.length;e+=1){let n=t[e];if(J.getNodeType(n)===`table-cell`){let e=n;if(e.hidden)continue;i.push(e)}}return{type:`table-row`,height:ZC(cC(r,`height`)||r.attr(`data-w-e-row-height`)||r.attr(`height`))||void 0,children:i}}let iw={selector:`tr:not([data-w-e-type])`,parseElemHtml:rw};function aw(e,t,n){var r,i;let a=$(e),o=(a.find(`caption`).text()||``).replace(/\s+/gm,` `).trim()||void 0,s=`auto`,c=cC(a,`width`),l=a.attr(`width`)||``,u=a.hasClass(`w-e-table-layout-fixed`)||!!a.attr(`data-w-e-table-height`);c===`100%`&&(s=`100%`),a.attr(`width`)===`100%`&&(s=`100%`),u&&l&&l!==`auto`&&l!==`100%`&&(s=l);let d=ZC(cC(a,`height`)||a.attr(`data-w-e-table-height`)||a.attr(`height`)),f={type:`table`,width:s,caption:o,height:d,children:t.filter(e=>J.getNodeType(e)===`table-row`)},p=((r=a.find(`tr`)[0])==null?void 0:r.children)||[],m=((i=a.find(`colgroup`)[0])==null?void 0:i.children)||null,h=ew(a),g=$C(m,h);if(g.length>0)f.columnWidths=g;else if(p.length>0){let e=[];Array.from(p).forEach(t=>{let n=parseInt($(t).attr(`colSpan`)||`1`,10),r=QC(cC($(t),`width`),90,h);e.push(r);for(let t=1;t<n;t+=1)e.push(90)}),f.columnWidths=e}return f}let ow={selector:`table:not([data-w-e-type])`,parseElemHtml:aw};var sw;let cw=(sw=window)==null||(sw=sw.getComputedStyle(document.documentElement))==null?void 0:sw.getPropertyValue(`--w-e-textarea-border-color`);function lw(e){return!e||typeof e!=`string`||!e.includes(`pt`)?e:e.replace(/(\d+(\.\d+)?)\s*pt/g,(e,t)=>`${(parseFloat(t)*4/3).toFixed(2)}px`)}function uw(e,t,n){if(![`TABLE`,`TD`,`TH`].includes(e.tagName))return t;let r=$(e),i=t,a=cC(r,`background-color`);a||(a=cC(r,`background`)),a||(a=r.attr(`bgcolor`)||``),a||(a=r.attr(`data-w-e-background-color`)||``),a&&(i.backgroundColor=a);let o=cC(r,`border`),s=r.attr(`data-w-e-border-width`)||``,c=r.attr(`data-w-e-border-line`)||``,l=r.attr(`data-w-e-border-color`)||``,u=r.attr(`border`)||``,d=r.attr(`bordercolor`)||``,f=(r.attr(`class`)||``).trim().split(/\s+/).filter(Boolean),p=``;for(let e=0;e<f.length;e+=1){let t=f[e];if(t.startsWith(`w-e-table-border-style-`)){p=t.replace(`w-e-table-border-style-`,``);break}}let m=!!(s||c||l||u||d||p);!o&&e.tagName===`TD`&&!m&&(o=`1px solid ${cw}`);let[h,g,_]=(o==null?void 0:o.split(` `))||[];h=cC(r,`border-width`)||h,h||(h=s),h||(h=u),h&&(i.borderWidth=lw(h.trim())),g=cC(r,`border-style`)||g,g||(g=c),g||(g=p),g&&(i.borderStyle=g===`none`?``:g),_=cC(r,`border-color`)||_,_||(_=d),_||(_=l),_&&(i.borderColor=_);let v=cC(r,`text-align`);v=cC(r,`text-align`)||v,v||(v=r.attr(`align`)||``),v||(v=r.attr(`data-w-e-text-align`)||``),v&&(i.textAlign=v);let y=cC(r,`vertical-align`);return y||(y=r.attr(`valign`)||``),y||(y=r.attr(`data-w-e-vertical-align`)||``),y&&(i.verticalAlign=y),t}O();function dw(e){let{apply:t}=e;return e.apply=n=>{if(!Tn.isSelectionOperation(n)||!n.newProperties)return t(n);let r=D(D({},e.selection),n.newProperties);if(!L.isRange(r))return FC.unselect(e),t(n);let i=e=>R.isElement(e)&&(e.type===`table-cell`||e.type===`th`||e.type===`td`),[a]=V.nodes(e,{match:i,at:L.start(r),mode:`lowest`}),[o]=V.nodes(e,{match:i,at:L.end(r),mode:`lowest`});if(!a||!o)return FC.unselect(e),t(n);let[,s]=a,[,c]=o;if(I.equals(s,c)||!rC(e,[s,c],`table`))return FC.unselect(e),t(n);try{let r=aC(e,{at:s});if(!r||r.length===0)return FC.unselect(e),t(n);let i=oC.valueOf(0,0),a=oC.valueOf(0,0),o=!1,l=!1;for(let e=0;e<r.length;e+=1)if(r[e])for(let t=0;t<r[e].length;t+=1){if(!r[e][t])continue;let[[,n]]=r[e][t];I.equals(s,n)&&(i.x=e,i.y=t,o=!0),I.equals(c,n)&&(a.x=e,a.y=t,l=!0)}if(!o||!l)return FC.unselect(e),t(n);let u=oC.valueOf(Math.min(i.x,a.x),Math.min(i.y,a.y)),d=oC.valueOf(Math.max(i.x,a.x),Math.max(i.y,a.y));for(;;){let e=oC.valueOf(u.x,u.y),t=oC.valueOf(d.x,d.y);for(let n=e.x;n<=t.x&&n<r.length;n+=1)if(r[n])for(let i=e.y;i<=t.y&&i<r[n].length;i+=1){if(!r[n][i])continue;let[,a]=r[n][i];if(!a)continue;let{rtl:o,ltr:s,btt:c,ttb:l}=a;e.x=Math.min(e.x,n-(l-1)),e.y=Math.min(e.y,i-(o-1)),t.x=Math.max(t.x,n+(c-1)),t.y=Math.max(t.y,i+(s-1))}if(oC.equals(u,e)&&oC.equals(d,t))break;u=e,d=t}let f=[],p=new WeakSet;for(let e=u.x;e<=d.x&&e<r.length;e+=1){if(!r[e])continue;let t=[];for(let n=u.y;n<=d.y&&n<r[e].length;n+=1){if(!r[e][n])continue;let[[i]]=r[e][n];i&&(p.add(i),t.push(r[e][n]))}t.length>0&&f.push(t)}uC.set(e,f),dC.set(e,p)}catch(r){return FC.unselect(e),t(n)}t(n)},e}O();function fw(e,t){return t.length>0&&t.every(t=>W.isText(t)?!0:SC(e,t))}function pw(e,t){if(!t||!/<(p|ol|ul|li|pre|figure)\b/i.test(t))return null;let n=document.createElement(`div`);if(n.innerHTML=t,n.querySelector(`table, img`))return null;let r=dc(e,t);return fw(e,r)?r:null}function mw(e,t){if(!t)return null;try{let n=decodeURIComponent(window.atob(t)),r=JSON.parse(n);return fw(e,r)?r:null}catch(e){return null}}function hw(e){let{selection:t}=e;if(t==null||!U.equals(t.anchor,t.focus))return!1;let[n]=V.nodes(e,{at:t,match:e=>J.checkNodeType(e,`table-cell`)});if(n==null)return!1;let[r,i]=n,a=V.start(e,i);if(!U.equals(t.anchor,a)||!R.isElement(r))return!1;let[o,s]=r.children;if(!R.isElement(o)||o.type!==`paragraph`||z.string(o)!==``||!R.isElement(s)||e.isInline(s)||!e.isVoid(s))return!1;let c=i.concat(1);return G.select(e,V.start(e,c)),G.removeNodes(e,{at:i.concat(0)}),G.select(e,V.start(e,i.concat(0))),!0}function gw(e){let{selection:t}=e;if(t==null)return!1;let[n]=V.nodes(e,{match:e=>J.checkNodeType(e,`table-cell`)});if(n){let[,r]=n,i=V.start(e,r);if(U.equals(t.anchor,i))return!0}return!1}function _w(e,t,n){let{selection:r}=e;if(r==null||t===`line`)return!1;let[i]=V.nodes(e,{match:e=>J.checkNodeType(e,`table-cell`)}),a=r.anchor;if(n===`backward`&&r.anchor.offset===0&&(a=V.before(e,r)),n===`forward`&&V.isEnd(e,r.anchor,r.anchor.path)&&(a=V.after(e,r)),a==null)return!1;let o=V.above(e,{at:a,match:e=>J.checkNodeType(e,`table-cell`)});if(o==null||i==null||!I.equals(o[1],i[1]))return!1;let s=V.node(e,a);if(!W.isText(s[0])||s[0].text.length<1)return!1;let c=n===`backward`?a.offset-1:a.offset,l=n===`backward`?a.offset:a.offset+1;if(c<0)return!1;let u=z.string(s[0]);return u.slice(c,l)===`
72
+ `?(G.insertText(e,u.slice(0,c)+u.slice(l),{at:{anchor:V.start(e,a.path),focus:V.end(e,a.path)}}),G.select(e,{anchor:{path:a.path,offset:c},focus:{path:a.path,offset:c}}),!0):!1}function vw(e,t){return!![...V.nodes(e,{at:t,match:e=>J.getNodeType(e)===`table`})].find(()=>!0)}function yw(e){for(let t of[`paragraph`,`header1`,`header2`,`header3`,`header4`,`header5`,`header6`,`blockquote`,`list-item`,`todo`,`divider`])if(J.getSelectedNodeByType(e,t))return!0;return!1}function bw(e){let{insertBreak:t,deleteBackward:n,deleteForward:r,normalizeNode:i,insertData:a,handleTab:o,selectAll:s,deleteFragment:c,transformInitialContent:l}=e,u=e;u.transformInitialContent=e=>CC(l?l(e):e),u.insertBreak=()=>{if(V.above(u,{match:e=>J.checkNodeType(e,`table-cell`)})==null){t();return}if(V.above(u,{match:e=>R.isElement(e)&&!J.checkNodeType(e,`table-cell`)})!=null){t();return}u.insertText(`
73
+ `)},u.deleteBackward=e=>{if(hw(u)||gw(u)||_w(u,e,`backward`))return;let{selection:t}=u;if(t){let e=V.before(u,t),n=V.above(u,{at:t,match:e=>J.checkNodeType(e,`table-cell`)});if(e){let t=vw(u,e);if(!n&&t&&yw(u))return}}n(e)},u.handleTab=()=>{if(J.getSelectedNodeByType(u,`table`)){let t=V.above(e,{match:e=>J.checkNodeType(e,`table-cell`)}),n=V.above(e,{match:e=>J.checkNodeType(e,`table`)});if(t&&n){let[,r]=t,[,i]=n,a=Array.from(V.nodes(e,{at:i,match:e=>J.checkNodeType(e,`table-cell`)&&!e.hidden})),o=a.findIndex(([,e])=>I.equals(e,r)),s=o>=0?a[o+1]:void 0;if(s){G.select(e,V.start(e,s[1]));return}let c=I.next(i);if(z.has(e,c)){G.select(e,V.start(e,c));return}}{let e=u.children||[],t=e.length;if(J.checkNodeType(e[t-1],`table`)){let e=J.genEmptyParagraph();G.insertNodes(u,e,{at:[t]}),u.handleTab()}}return}o()},u.deleteForward=e=>{if(gw(u)||_w(u,e,`forward`))return;let{selection:t}=u;if(t){let e=V.after(u,t),n=V.above(u,{at:t,match:e=>J.checkNodeType(e,`table-cell`)});if(e){let t=vw(u,e);if(!n&&t&&yw(u))return}}r(e)},u.normalizeNode=([e,t])=>{let n=J.getNodeType(e);if(n!==`table`){if(n===`table-cell`&&R.isElement(e)&&e.children.length===0){G.insertNodes(u,J.genEmptyParagraph(),{at:t.concat(0)});return}return i([e,t])}if(J.isLastNode(u,e)){let e=J.genEmptyParagraph();G.insertNodes(u,e,{at:[t[0]+1]})}},u.insertData=e=>{if(J.getSelectedNodeByType(u,`table`)==null){a(e);return}let t=e.getData(`application/x-slate-fragment`),n=e.getData(`text/html`),r=mw(u,t)||pw(u,n);if(r){G.insertFragment(u,r);return}let i=e.getData(`text/plain`);if(i===`
74
+ `||/<img[^>]+>/.test(n)){a(e);return}V.insertText(u,i)},u.selectAll=()=>{let e=u.selection;if(e==null){s();return}let t=J.getSelectedNodeByType(u,`table-cell`);if(t==null||!R.isElement(t)){s();return}let{anchor:n,focus:r}=e;if(!I.equals(n.path.slice(0,3),r.path.slice(0,3))){s();return}let i=z.string(t);if(t.children.length===1&&R.isElement(t.children[0])&&t.children[0].type===`paragraph`&&i.length===0){s();return}let a=J.findPath(u,t),o={anchor:V.start(u,a),focus:V.end(u,a)};u.select(o)},u.deleteFragment=e=>{let t=uC.get(u);if(t&&t.length>0){let n=[];t.forEach(e=>{e.forEach(e=>{let[,t]=e[0];n.some(e=>I.equals(e,t))||n.push(t)})});let r=n[0];if(n.forEach(t=>{if(!z.has(u,t))return;let n=V.start(u,t),r=V.end(u,t);G.select(u,{anchor:n,focus:r}),c(e)}),FC.unselect(u),r&&z.has(u,r)){let e=V.start(u,r);G.select(u,e)}return}c(e)},dw(u),u.getTableSelection=()=>uC.get(u)||null;let{addMark:d,removeMark:f}=u,p=D({},G);return u.addMark=(e,t)=>{let n=uC.get(u);if(n&&n.length>0){let r=u.selection;n.forEach(n=>{n.forEach(n=>{let[,r]=n[0],i=V.start(u,r),a=V.end(u,r);G.select(u,{anchor:i,focus:a}),d(e,t)})}),r&&G.select(u,r)}else d(e,t)},u.removeMark=e=>{let t=uC.get(u);if(t&&t.length>0){let n=u.selection;t.forEach(t=>{t.forEach(t=>{let[,n]=t[0],r=V.start(u,n),i=V.end(u,n);G.select(u,{anchor:r,focus:i}),f(e)})}),n&&G.select(u,n)}else f(e)},G.setNodes=(e,t,n={})=>{if(e===u){let r=uC.get(u);if(r&&r.length>0){if(`hidden`in t||`rowSpan`in t||`colSpan`in t){p.setNodes(e,t,n);return}r.forEach(r=>{r.forEach(r=>{let[,i]=r[0];p.setNodes(e,t,D(D({},n),{},{at:i}))})});return}}p.setNodes(e,t,n)},u}var xw=bw;function Sw(e){let t=e.find(`colgroup`);for(let e=0;e<t.length;e+=1){let n=t[e];for(let e=0;e<n.children.length;e+=1){let t=n.children[e],r=(t.getAttribute(`width`)||``).trim().toLowerCase(),i=(t.style.width||``).trim().toLowerCase();if(r&&r!==`auto`||i&&i!==`auto`)return!0}}return!1}function Cw(e){let t=e.find(`td, th`);for(let e=0;e<t.length;e+=1){let n=t[e],r=(n.getAttribute(`width`)||``).trim().toLowerCase(),i=(n.style.width||``).trim().toLowerCase();if(r&&r!==`auto`||i&&i!==`auto`)return!0}return!1}function ww(e){let t=(e.attr(`width`)||``).trim().toLowerCase(),n=e[0].style.width.trim().toLowerCase(),r=e[0].style.tableLayout.trim().toLowerCase();return!(e.hasClass(`w-e-table-layout-fixed`)||e.attr(`data-w-e-table-height`)||!(t===`auto`||n===`auto`)||r!==`fixed`)}function Tw(e){if(typeof document>`u`||!document.body)return[];let t=document.createElement(`div`);t.style.position=`fixed`,t.style.top=`-10000px`,t.style.left=`0`,t.style.visibility=`hidden`,t.style.pointerEvents=`none`;let n=e.cloneNode(!0);t.appendChild(n),document.body.appendChild(t);try{let e=n.querySelector(`tr`);if(!e)return[];let t=Array.from(e.children).filter(e=>{let t=e.tagName.toLowerCase();return t===`td`||t===`th`});if(t.length===0)return[];let r=[];for(let e=0;e<t.length;e+=1){let n=t[e],i=parseInt(n.getAttribute(`colspan`)||`1`,10),a=Number.isFinite(i)&&i>0?i:1,o=n.getBoundingClientRect().width;if(!Number.isFinite(o)||o<=0)return[];let s=Math.max(1,Math.round(o/a));for(let e=0;e<a;e+=1)r.push(s)}return r}finally{t.remove()}}function Ew(e,t){if(t.length===0)return;let n=e.querySelector(`colgroup`);n&&n.remove();let r=document.createElement(`colgroup`);r.setAttribute(`contentEditable`,`false`),t.forEach(e=>{let t=document.createElement(`col`);t.setAttribute(`width`,`${e}`),r.appendChild(t)});let i=e.querySelector(`tr`);i?e.insertBefore(r,i):e.appendChild(r)}function Dw(e){if(!ww(e)||Sw(e)||Cw(e))return;let t=Tw(e[0]);t.length!==0&&Ew(e[0],t)}function Ow(e){let t=$(e);if(sC(t)!==`table`)return e;let n=t.find(`tbody`);if(n.length===0)return e;let r=t.find(`tr`);t.append(r),n.remove();let i=t.find(`td, th`);for(let e=0;e<i.length;e+=1){let t=i[e],n=$(t);n.attr(`width`,`auto`);let r=n.html()||``;r=r.replace(/<o:p[^>]*>[\s\S]*?<\/o:p>/gi,``),r=r.replace(/<\/o:p>/gi,``),n.html(r)}return Dw(t),t[0]}let kw={selector:`table`,preParseHtml:Ow};function Aw(e,t,n){let r=DC(n,e),{colSpan:i=1,rowSpan:a=1,isHeader:o=!1,hidden:s=!1}=e,c=FC.isSelected(n,e);return Z(r&&o?`th`:`td`,{colSpan:i,rowSpan:a,"data-block-type":`table-cell`,className:c?`w-e-selected`:``,style:{display:s?`none`:``}},t)}var jw=Aw;function Mw(e,t,n){let{height:r}=e;return Z(`tr`,{style:r?{height:`${r}px`}:{}},t)}var Nw=Mw;let Pw=new WeakMap;function Fw(e){let t=Pw.get(e);t&&(t.eventWindow.removeEventListener(`mouseup`,t.stop),t.eventWindow.removeEventListener(`blur`,t.stop),t.anchorPathRef.unref(),Pw.delete(e))}function Iw(e){if(e.target instanceof HTMLElement){let t=e.target.closest(`[data-block-type="table-cell"]`);if(t)return t}let t=e.target,n=t instanceof Node?t.ownerDocument:null,r=t instanceof Node?t.getRootNode():null;return(r&&`elementsFromPoint`in r?r:n||document).elementsFromPoint(e.clientX,e.clientY).map(e=>e.closest(`[data-block-type="table-cell"]`)).find(e=>e!=null)||null}function Lw(e){let t=e.target instanceof Node?e.target.ownerDocument:null;return e.view||(t==null?void 0:t.defaultView)||window}function Rw(e,t){let n=Iw(t);if(!n)return null;try{let t=J.toSlateNode(e,n);return!R.isElement(t)||J.getNodeType(t)!==`table-cell`?null:J.findPath(e,t)}catch(e){return null}}function zw(e,t){return e.length<3||t.length<3?!1:I.equals(e.slice(0,-2),t.slice(0,-2))}function Bw(e,t,n){return I.compare(t,n)<=0?{anchor:V.start(e,t),focus:V.end(e,n)}:{anchor:V.end(e,t),focus:V.start(e,n)}}function Vw(e,t){if(Fw(e),e.isDisabled()||t.button!==0)return;let n=Rw(e,t);if(!n)return;let r=()=>Fw(e),i=Lw(t);Pw.set(e,{anchorPathRef:V.pathRef(e,n),lastTargetPath:n,isCrossCellSelecting:!1,eventWindow:i,stop:r}),i.addEventListener(`mouseup`,r),i.addEventListener(`blur`,r)}function Hw(e,t){let n=Pw.get(e);if(!n)return;if(!(t.buttons&1)){Fw(e);return}let r=n.anchorPathRef.current;if(!r){Fw(e);return}let i=Rw(e,t);if(!i||!zw(r,i))return;let a=I.equals(r,i);!n.isCrossCellSelecting&&a||(t.preventDefault(),!I.equals(n.lastTargetPath,i)&&(n.isCrossCellSelecting=!0,n.lastTargetPath=i,e.select(Bw(e,r,i))))}function Uw(e){let t=[],n=0;for(let r of e)n+=r,t.push(n);return t}function Ww(e){let t=[],n=e.reduce((e,t)=>e+t,0);for(let r of e)t.push(r/n);return t}let Gw=new Map;function Kw(e){return Array.from(e.querySelectorAll(`tr`)).map(e=>{let t=e.getBoundingClientRect();return Math.max(1,Math.round(t.height*100)/100)})}function qw(e){let t=Gw.get(e);t&&(t.observer.disconnect(),t.tablePathRef.unref(),Gw.delete(e))}function Jw(e){if(xs(e)){qw(e);return}for(let e of Gw.keys())qw(e)}function Yw(e,t,n){if(xs(t)){let r=t.querySelector(`table`);if(r){Jw(t);let i;try{i=V.pathRef(e,J.findPath(e,n))}catch(e){return}let a=new ResizeObserver(([{contentRect:t}])=>{let n=i.current;if(n===null)return;try{let[t]=V.node(e,n);if(V.isEditor(t)||!R.isElement(t)||t.type!==`table`)return}catch(e){return}let a=Kw(r);G.setNodes(e,{scrollWidth:t.width,height:t.height,rowHeights:a},{at:n})});a.observe(r),Gw.set(t,{observer:a,tablePathRef:i})}}}let Xw=!1,Zw=!1,Qw=0,$w=null,eT=null,tT=$(window);function nT(e){let t=e.target;if(t.closest(`[data-block-type="table-cell"]`))Xw=!0;else if(t.tagName===`DIV`&&t.closest(`.column-resizer-item`)){if($w===null||eT===null)return;Zw=!0;let{clientX:t}=e;Qw=t,document.body.style.cursor=`col-resize`,e.preventDefault()}tT.on(`mousemove`,aT),tT.on(`mouseup`,oT)}tT.on(`mousedown`,nT);function rT(e,t,n,r){let i=[...e],{minWidth:a=60}=r.getMenuConfig(`insertTable`),o=parseInt(a.toString(),10)||60,s=i[t],c=Math.max(o,s+n);return i[t]=Math.floor(c*100)/100,i}function iT(e,t,n,r,i){let a=[...e];if(t<0||t>=e.length)return a;let{minWidth:o=60}=i.getMenuConfig(`insertTable`),s=parseInt(o.toString(),10)||60,c=n-(t===0?0:r[t-1]),l=Math.max(s,c);return a[t]=Math.floor(l*100)/100,a}let aT=(0,Td.default)(e=>{if(!Zw||$w===null||eT===null)return;e.preventDefault();let{clientX:t}=e,n=t-Qw,r=null,i=null;try{let[e,t]=V.node($w,eT);if(V.isEditor(e)||!R.isElement(e)||e.type!==`table`)return;r=e,i=t}catch(e){return}if(r===null||i===null)return;let{width:a=`auto`,columnWidths:o=[],resizingIndex:s=-1,scrollWidth:c=0}=r;if(o.length===0||s<0||s>=o.length)return;let l,u=o,d=null;try{d=J.toDOMNode($w,r)}catch(e){d=null}a===`100%`&&c>0&&o.reduce((e,t)=>e+t,0)>0&&(u=Ww(o).map(e=>e*c));let f=d==null?void 0:d.querySelector(`.table`);if(f){let e=t-f.getBoundingClientRect().left,n=Uw(u);l=iT(u,s,e,n,$w)}else l=rT(u,s,n,$w);let p={columnWidths:l};a===`100%`&&(p.width=`auto`),G.setNodes($w,p,{at:i})},100);function oT(e){Zw&&aT.flush(),aT.cancel(),Xw=!1,Zw=!1,$w=null,eT=null,document.body.style.cursor=``,tT.off(`mousemove`,aT),tT.off(`mouseup`,oT)}function sT(e,t,n,r){if(e.isDisabled()||Xw||Zw)return;let{width:i=`auto`,columnWidths:a=[],isHoverCellBorder:o,resizingIndex:s}=t,{clientX:c,target:l}=n;if(xs(l)){let n=l.getBoundingClientRect();if(c>n.x+5&&c<n.x+n.width-5){o&&wC(e,t,{isHoverCellBorder:!1,resizingIndex:-1});return}}if(xs(l)){let o=l.closest(`.table`);if(o){let{clientX:c}=n,l=o.getBoundingClientRect(),u=Uw(i===`100%`?Ww(a).map(e=>e*r):a);for(let n=0;n<u.length;n+=1)if(c-l.x>=u[n]-5&&c-l.x<u[n]+5){if(s===n)return;wC(e,t,{isHoverCellBorder:!0,resizingIndex:n});return}}}o===!0&&wC(e,t,{isHoverCellBorder:!1,resizingIndex:-1})}function cT(e,t,n){n.type===`mouseenter`?wC(e,t,{isResizing:!0}):wC(e,t,{isResizing:!1})}function lT(e,t){if(!Zw){$w=e;try{eT=J.findPath(e,t)}catch(e){eT=null}}}function uT(e){let t=[],n=0;for(let r of e)n+=r,t.push(n);return t}function dT(e){let{children:t,rowHeights:n=[]}=e;return n.length===t.length&&n.every(e=>Number.isFinite(e)&&e>0)?n:t.map(e=>e.height||30)}let fT=!1,pT=0,mT=null,hT=null,gT=$(window);function _T(e,t,n,r){let i=[...e],{minRowHeight:a=30}=r.getMenuConfig(`insertTable`)||{},o=parseInt(a.toString(),10)||30,s=i[t],c=Math.max(o,s+n);return i[t]=Math.floor(c*100)/100,i}function vT(e,t,n,r,i){let a=[...e];if(t<0||t>=e.length)return a;let{minRowHeight:o=30}=i.getMenuConfig(`insertTable`)||{},s=parseInt(o.toString(),10)||30,c=n-(t===0?0:r[t-1]),l=Math.max(s,c);return a[t]=Math.floor(l*100)/100,a}function yT(e){if(!fT||mT===null||hT===null)return;e.preventDefault();let{clientY:t}=e,n=t-pT,r,i;try{let[e,t]=V.node(mT,hT);if(V.isEditor(e)||!R.isElement(e)||e.type!==`table`)return;r=e,i=t}catch(e){return}let{resizingRowIndex:a=-1}=r,o=dT(r),s,c=null;try{c=J.toDOMNode(mT,r)}catch(e){c=null}let l=c==null?void 0:c.querySelector(`.table`);if(s=l?vT(o,a,t-l.getBoundingClientRect().top,uT(o),mT):_T(o,a,n,mT),a>=0&&a<s.length){let e=[...i,a];try{G.setNodes(mT,{height:s[a]},{at:e})}catch(e){console.warn(`更新行高度失败:`,e)}}}let bT=(0,Td.default)(yT,100);function xT(e){fT&&bT.flush(),bT.cancel(),fT=!1,mT=null,hT=null,document.body.style.cursor=``,gT.off(`mousemove`,bT),gT.off(`mouseup`,xT)}function ST(e,t,n){if(e.isDisabled()||fT)return;let r=t,{isHoverRowBorder:i,resizingRowIndex:a}=r,{target:o}=n;if(xs(o)){let i=o.closest(`.table`);if(i){let{clientY:o}=n,s=i.getBoundingClientRect(),c=uT(dT(r));for(let n=0;n<c.length;n+=1)if(o-s.y>=c[n]-5&&o-s.y<c[n]+5){if(a===n)return;wC(e,t,{isHoverRowBorder:!0,resizingRowIndex:n});return}}}i===!0&&wC(e,t,{isHoverRowBorder:!1,resizingRowIndex:-1})}function CT(e,t,n){n.type===`mouseenter`?wC(e,t,{isResizingRow:!0}):wC(e,t,{isResizingRow:!1})}function wT(e,t){if(!fT){mT=e;try{hT=J.findPath(e,t)}catch(e){hT=null}}}function TT(e){let t=e.target;if(t.tagName===`DIV`&&t.closest(`.row-resizer-item`)){if(mT===null)return;fT=!0;let{clientY:t}=e;pT=t,document.body.style.cursor=`row-resize`,e.preventDefault()}gT.on(`mousemove`,bT),gT.on(`mouseup`,xT)}gT.on(`mousedown`,TT),O();let ET=.01;function DT(e){return Math.round(e*100)/100}function OT(e,t,n){let r=DT(t),i=e.get(r)||[];i.push(n),e.set(r,i)}function kT(e){return[...e].sort(([e],[t])=>e-t).reduce((e,t)=>{let n=e[e.length-1];return n&&t[0]<=n[1]+ET?(n[1]=Math.max(n[1],t[1]),e):(e.push([...t]),e)},[])}function AT(e){e.forEach((t,n)=>{e.set(n,kT(t))})}function jT(e,t){let[n,r]=e,i=[],a=n;for(let[e,o]of t){let t=Math.max(n,e),s=Math.min(r,o);if(!(s<=a+ET)&&(t>a+ET&&i.push([a,t]),a=Math.max(a,s),a>=r-ET))break}return a<r-ET&&i.push([a,r]),i}function MT(e){return[...e].sort((e,t)=>e.side.localeCompare(t.side)||e.offset-t.offset||e.start-t.start).reduce((e,t)=>{let n=e[e.length-1];return n&&n.side===t.side&&DT(n.offset)===DT(t.offset)&&t.start<=n.end+ET?(n.end=Math.max(n.end,t.end),e):(e.push(D({},t)),e)},[])}function NT(e){let t=new Map,n=new Map,r=new Map,i=new Map;e.forEach(e=>{OT(t,e.top,[e.left,e.right]),OT(n,e.right,[e.top,e.bottom]),OT(r,e.bottom,[e.left,e.right]),OT(i,e.left,[e.top,e.bottom])}),AT(t),AT(n),AT(r),AT(i);let a=[],o=(e,t,n,r)=>{jT(n,r.get(DT(t))||[]).forEach(([n,r])=>{a.push({side:e,offset:t,start:n,end:r})})};return e.forEach(e=>{o(`top`,e.top,[e.left,e.right],r),o(`right`,e.right,[e.top,e.bottom],i),o(`bottom`,e.bottom,[e.left,e.right],t),o(`left`,e.left,[e.top,e.bottom],n)}),MT(a)}function PT(e,t){for(;e.firstChild;)e.removeChild(e.firstChild);t&&e.appendChild(t)}function FT(e){let t=e.parentElement,n=Array.from((t==null?void 0:t.children)||[]).find(e=>e.tagName===`TABLE`);return!xs(t)||!xs(n)||n.tagName!==`TABLE`?null:{container:t,table:n}}function IT(e){let t=e.ownerDocument.createElement(`span`);t.style.position=`absolute`,t.style.display=`block`,t.style.top=`0`,t.style.left=`0`,t.style.width=`100px`,t.style.height=`100px`,t.style.margin=`0`,t.style.padding=`0`,t.style.border=`0`,t.style.boxSizing=`border-box`,t.style.visibility=`hidden`,t.style.pointerEvents=`none`,t.style.transform=`none`,e.appendChild(t);let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();e.removeChild(t);let i=r.width/100,a=r.height/100;return{overlayRect:n,scaleX:Number.isFinite(i)&&i>0?i:1,scaleY:Number.isFinite(a)&&a>0?a:1}}function LT(e){if(!xs(e))return;let t=FT(e);if(!t){PT(e);return}let{table:n}=t,r=Array.from(n.querySelectorAll(`td.w-e-selected, th.w-e-selected`)).filter(e=>e.closest(`table`)===n);if(r.length===0){PT(e);return}let{overlayRect:i,scaleX:a,scaleY:o}=IT(e),s=r.map(e=>e.getBoundingClientRect()).filter(e=>e.width>0&&e.height>0).map(e=>({top:(e.top-i.top)/o,right:(e.right-i.left)/a,bottom:(e.bottom-i.top)/o,left:(e.left-i.left)/a})),c=e.ownerDocument.createDocumentFragment();NT(s).forEach(t=>{let n=e.ownerDocument.createElement(`span`),r=t.side===`top`||t.side===`bottom`,i=r?t.start:t.offset-(t.side===`right`?3:0),a=r?t.offset-(t.side===`bottom`?3:0):t.start;n.className=[`w-e-table-selection-segment`,`w-e-table-selection-segment-${t.side}`,r?`w-e-table-selection-segment-horizontal`:`w-e-table-selection-segment-vertical`].join(` `),n.setAttribute(`data-selection-edge`,t.side),n.style.left=`${i}px`,n.style.top=`${a}px`,n.style.width=`${r?t.end-t.start:3}px`,n.style.height=`${r?3:t.end-t.start}px`,c.appendChild(n)}),PT(e,c)}function RT(){return op(`div.w-e-table-selection-overlay`,{attrs:{"aria-hidden":`true`,contenteditable:`false`},hook:{insert:({elm:e})=>LT(e),postpatch:(e,{elm:t})=>LT(t)}})}function zT(e,t){if(e.isDisabled())return!1;let{selection:n}=e;if(n==null||L.isCollapsed(n))return!0;let{anchor:r,focus:i}=n,a=J.findPath(e,t),o=V.start(e,a),s=V.end(e,a),c=U.compare(r,s)<=0&&U.compare(r,o)>=0,l=U.compare(i,s)<=0&&U.compare(i,o)>=0;return!!(c&&l&&I.equals(r.path.slice(0,3),i.path.slice(0,3)))}function BT(e){let{height:t,rowHeights:n=[],children:r=[]}=e;return typeof t==`number`&&Number.isFinite(t)&&t>0?t:n.length===r.length&&n.every(e=>typeof e==`number`&&Number.isFinite(e)&&e>0)?n.reduce((e,t)=>e+t,0):r.reduce((e,t)=>{let n=t.height;return e+(typeof n==`number`&&Number.isFinite(n)&&n>0?n:30)},0)}function VT(e,t,n){let r=zT(n,e),{width:i=`auto`,caption:a,columnWidths:o=[],rowHeights:s=[],scrollWidth:c=0,isHoverCellBorder:l,resizingIndex:u,isResizing:d,isHoverRowBorder:f,resizingRowIndex:p,isResizingRow:m}=e,h=BT(e),g=J.isNodeSelected(n,e),[_]=FC.selection(n),v=Ww(o);return op(`div`,{hook:{insert:({elm:t})=>Yw(n,t,e),destroy:({elm:e})=>{Jw(e)}}},Z(`div`,{className:`table-container`,"data-selected":g,on:{mousedown:t=>{if(t.target.tagName===`DIV`&&t.preventDefault(),n.isDisabled())return;t.target.closest(`[data-block-type="table-cell"]`)&&(FC.unselect(n),Vw(n,t));let r=J.findPath(n,e),i=V.start(n,r),{selection:a}=n;if(a==null){n.select(i);return}let{path:o}=a.anchor;o[0]!==r[0]&&t.target.tagName===`DIV`&&n.select(i)},mousemove:e=>Hw(n,e)}},Z(`table`,{width:i,contentEditable:r,className:`table ${_?`table-selection-none`:``}`,style:{width:i===`100%`?i:`${o.reduce((e,t)=>e+t,0)}px`},on:{mousemove:(0,Zl.default)(t=>{FC.hasSelected(n)||(sT(n,e,t,c),ST(n,e,t))},25)}},a?Z(`caption`,{contentEditable:!1},a):null,Z(`colgroup`,{contentEditable:!1},o.map(e=>Z(`col`,{width:e}))),Z(`tbody`,null,t)),Z(`div`,{className:`column-resizer`,contentEditable:!1},o.map((t,r)=>{let a=t;return i===`100%`&&(a=v[r]*c),Z(`div`,{className:`column-resizer-item`,style:{minWidth:`${a}px`}},Z(`div`,{className:`resizer-line-hotzone ${l&&r===u?`visible `:``}${d&&r===u?`highlight`:``}`,style:{height:`${h}px`},on:{mouseenter:t=>cT(n,e,t),mouseleave:t=>cT(n,e,t),mousedown:t=>lT(n,e)}},Z(`div`,{className:`resizer-line`})))})),Z(`div`,{className:`row-resizer`,contentEditable:!1},e.children.map((t,r)=>{let i=o.reduce((e,t)=>e+t,0),a=s[r];return Z(`div`,{className:`row-resizer-item`,style:{minHeight:`${Number.isFinite(a)&&a>0?a:t.height||30}px`}},Z(`div`,{className:`resizer-line-hotzone-horizontal ${f&&r===p?`visible `:``}${m&&r===p?`highlight`:``}`,style:{width:`${i}px`},on:{mouseenter:t=>CT(n,e,t),mouseleave:t=>CT(n,e,t),mousedown:t=>wT(n,e)}},Z(`div`,{className:`resizer-line-horizontal`})))})),RT()))}let HT={type:`table`,renderElem:VT},UT={type:`table-row`,renderElem:Nw},WT={type:`table-cell`,renderElem:jw};function GT(e,t){e.data==null&&(e.data={});let n=e.data;n.style==null&&(n.style={}),Object.assign(n.style,t)}function KT(e,t){if(!R.isElement(e))return t;let{backgroundColor:n,borderWidth:r,borderStyle:i,borderColor:a,textAlign:o,verticalAlign:s}=e,c={};n&&(c.backgroundColor=n),r&&(/^\d+(\.\d+)?$/.test(r)?c.borderWidth=`${r}px`:c.borderWidth=r),i&&(c.borderStyle=i===`none`?``:i),a&&(c.borderColor=a),o&&(c.textAlign=o),s&&(c.verticalAlign=s);let l=t;if(e.type===`table`){var u;GT((u=l.children)==null||(u=u[0].children)==null?void 0:u[0],c)}else GT(l,c);return l}let qT=new Set([`solid`,`dotted`,`dashed`,`double`,`groove`,`ridge`,`inset`,`outset`]),JT=new Set;function YT(e){let t=(e||``).trim().toLowerCase();return!t||t===`none`?``:`w-e-table-border-style-${t}`}function XT(e){return`${e||``}`.trim().toLowerCase().replace(/\s+/g,` `)}function ZT(e,t){let n=XT(t);if(!n||n===`none`)return`skip`;if(qT.has(n))return`class`;let r=gm(e),i=`preserve-data`;r===`fallback-inline`&&(i=`inline`),r===`strict`&&(i=`throw`);let a=`[wangeditor] Unsupported table border-style token "${n}" in class mode. policy=${r}`,o=`${n}|${i}`;if(JT.has(o)||(JT.add(o),_m(e,{type:`table-border-style`,value:n,scene:`toHtml`,fallback:i,message:a})),i===`throw`)throw Error(a);return i===`inline`?`inline`:`preserve-data`}function QT(e,t,n){if(e.type!==`table`&&e.type!==`table-cell`)return t;let{backgroundColor:r,borderWidth:i,borderStyle:a,borderColor:o,textAlign:s,verticalAlign:c}=e;if(!(r||i||a||o||s||c))return t;let l=$(t);if(hm(n)===`class`){if(r&&(l.attr(`bgcolor`,r),l.attr(`data-w-e-background-color`,r)),i){let e=`${i}`.trim();e&&(l.attr(`data-w-e-border-width`,e),l.attr(`border`,e))}if(a){let e=XT(a),t=ZT(n,e);t!==`skip`&&l.attr(`data-w-e-border-line`,e),t===`class`?l.addClass(YT(e)):t===`inline`&&l.css(`border-style`,e)}return o&&(l.attr(`bordercolor`,o),l.attr(`data-w-e-border-color`,o)),s&&(l.attr(`align`,s),l.attr(`data-w-e-text-align`,s)),c&&(l.attr(`valign`,c),l.attr(`data-w-e-vertical-align`,c)),lC(l)}return r&&l.css(`background-color`,r),i&&l.css(`border-width`,`${i}px`),a&&l.css(`border-style`,a===`none`?``:a),o&&l.css(`border-color`,o),s&&l.css(`text-align`,s),c&&l.css(`vertical-align`,c),lC(l)}var $T={renderStyle:KT,styleToHtml:QT,parseStyleHtml:uw,renderElems:[HT,UT,WT],elemsToHtml:[XS,ZS,QS],preParseHtml:[kw],parseElemsHtml:[nw,iw,ow],menus:[zC,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC],editorPlugin:xw};Xu(`en`,{uploadImgModule:{uploadImage:`Upload Image`,uploadError:`{{fileName}} upload error`}}),Xu(`zh-CN`,{uploadImgModule:{uploadImage:`上传图片`,uploadError:`{{fileName}} 上传出错`}});function eE(){return{server:``,fieldName:`wangeditor-uploaded-image`,maxFileSize:2*1024*1024,maxNumberOfFiles:100,allowedFileTypes:[`image/*`],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:10*1e3,onBeforeUpload:e=>e,onProgress:e=>{},onSuccess:(e,t)=>{},onFailed:(e,t)=>{console.error(`'${e.name}' upload failed`,t)},onError:(e,t,n)=>{console.error(`'${e.name}' upload error`,n)},base64LimitSize:0}}ts&&(K.fn.append=ts),Ho&&(K.fn.on=Ho),ss&&(K.fn.remove=ss),Vo&&(K.fn.val=Vo),ds&&(K.fn.click=ds),qo&&(K.fn.hide=qo);var tE=K;function nE(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new rE(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function rE(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return rE=function(e){this.s=e,this.n=e.next},rE.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new rE(e)}O(),j();let iE=new WeakMap;function aE(e){return e.getMenuConfig(`uploadImage`)}function oE(e){let t=iE.get(e);if(t!=null)return t;let n=aE(e),{onSuccess:r,onProgress:i,onFailed:a,customInsert:o,onError:s}=n;return t=Zt(D(D({},n),{},{onProgress:t=>{e.showProgressBar(t),i&&i(t)},onSuccess:(t,n)=>{if(o){o(n,(t,n,r)=>T_(e,t,n,r)),r(t,n);return}let{errno:i=1,data:s={}}=n;if(i!==0){a(t,n);return}if(Array.isArray(s))s.forEach(t=>{let{url:n=``,alt:r=``,href:i=``}=t;T_(e,n,r,i)});else{let{url:t=``,alt:n=``,href:r=``}=s;T_(e,t,n,r)}r(t,n)},onError:(e,t,n)=>{s(e,t,n)}}),e),iE.set(e,t),t}function sE(e,t){return cE.apply(this,arguments)}function cE(){return cE=A(function*(e,t){return new Promise(n=>{let r=new FileReader;r.readAsDataURL(t),r.onload=()=>{let{result:i}=r;if(!i)return;let a=i.toString(),o=a.indexOf(`data:image`)===0?``:a;T_(e,a,t.name,o),n(`ok`)}})}),cE.apply(this,arguments)}function lE(e,t){return uE.apply(this,arguments)}function uE(){return uE=A(function*(e,t){let n=oE(e),r=t.map(e=>({name:e.name,type:e.type,size:e.size,data:e}));n.addFiles(r),yield n.upload()}),uE.apply(this,arguments)}function dE(e,t){return fE.apply(this,arguments)}function fE(){return fE=A(function*(e,t){if(t==null)return;let n=Array.prototype.slice.call(t),{customUpload:r,base64LimitSize:i}=aE(e),a=[];var o=!1,s=!1,c;try{for(var l=nE(n),u;o=!(u=yield l.next()).done;o=!1){let t=u.value;{let n=t.size;i&&n<=i?yield sE(e,t):r?yield r(t,(t,n,r)=>T_(e,t,n,r),e):a.push(t)}}}catch(e){s=!0,c=e}finally{try{o&&l.return!=null&&(yield l.return())}finally{if(s)throw c}}a.length>0&&(yield lE(e,a))}),fE.apply(this,arguments)}var pE=class{constructor(){this.title=X(`uploadImgModule.uploadImage`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M828.708571 585.045333a48.761905 48.761905 0 0 0-48.737523 48.761905v18.529524l-72.143238-72.167619a135.972571 135.972571 0 0 0-191.585524 0l-34.133334 34.133333-120.880762-120.953905a138.898286 138.898286 0 0 0-191.585523 0l-72.167619 72.167619V292.400762a48.786286 48.786286 0 0 1 48.761904-48.761905h341.23581a48.737524 48.737524 0 0 0 34.474667-83.285333 48.737524 48.737524 0 0 0-34.474667-14.287238H146.236952A146.212571 146.212571 0 0 0 0 292.400762v585.289143A146.358857 146.358857 0 0 0 146.236952 1024h584.996572a146.212571 146.212571 0 0 0 146.236952-146.310095V633.807238a48.786286 48.786286 0 0 0-48.761905-48.761905zM146.261333 926.45181a48.737524 48.737524 0 0 1-48.761904-48.761905v-174.128762l141.409523-141.458286a38.497524 38.497524 0 0 1 53.126096 0l154.526476 154.624 209.627428 209.724953H146.236952z m633.734096-48.761905c-0.073143 9.337905-3.145143 18.383238-8.777143 25.843809l-219.843048-220.94019 34.133333-34.133334a37.546667 37.546667 0 0 1 53.613715 0l140.873143 141.897143V877.714286zM1009.615238 160.231619L863.329524 13.897143a48.737524 48.737524 0 0 0-16.091429-10.24c-11.849143-4.87619-25.161143-4.87619-37.059047 0a48.761905 48.761905 0 0 0-16.067048 10.24l-146.236952 146.334476a49.005714 49.005714 0 0 0 69.217523 69.241905l62.902858-63.390476v272.627809a48.761905 48.761905 0 1 0 97.475047 0V166.083048l62.902857 63.390476a48.737524 48.737524 0 0 0 69.217524 0 48.761905 48.761905 0 0 0 0-69.241905z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}isDisabled(e){return b_(e)}getMenuConfig(e){return e.getMenuConfig(`uploadImage`)}exec(e,t){let{allowedFileTypes:n=[],customBrowseAndUpload:r}=this.getMenuConfig(e);if(r){r((t,n,r)=>T_(e,t,n,r));return}let i=``;n.length>0&&(i=`accept="${n.join(`, `)}"`);let a=tE(`body`),o=tE(`<input type="file" ${i} multiple/>`);o.hide(),a.append(o),o.click(),o.on(`change`,()=>{let t=o[0].files;dE(e,t)})}};let mE={key:`uploadImage`,factory(){return new pE},config:eE()};function hE(e){let{insertData:t}=e,n=e;return n.insertData=r=>{if(b_(n)){t(r);return}if(r.getData(`text/plain`)){t(r);return}let{files:i}=r;if(i.length<=0){t(r);return}Array.prototype.slice.call(i).some(e=>{let[t]=e.type.split(`/`);return t===`image`})?dE(e,i):t(r)},n}var gE={menus:[mE],editorPlugin:hE};Xu(`en`,{videoModule:{delete:`Delete`,uploadVideo:`Upload video`,insertVideo:`Insert video`,videoSrc:`Video source`,videoSrcPlaceHolder:`Video file url, or third-party <iframe>`,videoPoster:`Video poster`,videoPosterPlaceHolder:`Poster image url`,ok:`Ok`,editSize:`Edit size`,edit:`Edit video`,width:`Width`,height:`Height`,alignLeft:`Align video left`,alignCenter:`Center video`,alignRight:`Align video right`}}),Xu(`zh-CN`,{videoModule:{delete:`删除视频`,uploadVideo:`上传视频`,insertVideo:`插入视频`,videoSrc:`视频地址`,videoSrcPlaceHolder:`视频文件 url 或第三方 <iframe>`,videoPoster:`视频封面`,videoPosterPlaceHolder:`封面图片 url`,ok:`确定`,editSize:`修改尺寸`,edit:`编辑视频`,width:`宽度`,height:`高度`,alignLeft:`视频左对齐`,alignCenter:`视频居中`,alignRight:`视频右对齐`}}),globalThis.Node,globalThis.Comment,globalThis.Element,globalThis.Text,globalThis.Range,globalThis.Selection,globalThis.StaticRange,ts&&(K.fn.append=ts),Ho&&(K.fn.on=Ho),fs&&(K.fn.focus=fs),Lo&&(K.fn.attr=Lo),Vo&&(K.fn.val=Vo),Qo&&(K.fn.html=Qo),rs&&(K.fn.parent=rs),Io&&(K.fn.hasClass=Io),cs&&(K.fn.empty=cs);var _E=K;function vE(e){return e.length?e[0].tagName.toLowerCase():``}function yE(e,t=`auto`,n=`auto`,r={},i=!1){let a=K(e),{width:o=``,height:s=``}=r,c=o?`data-w-e-style-width="${o}"`:``,l=s?`data-w-e-style-height="${s}"`:``;if(a.attr(`width`,t),a.attr(`height`,n),i)c&&a.attr(`data-w-e-style-width`,o),l&&a.attr(`data-w-e-style-height`,s),a.removeAttr(`style`);else{let e=`display: block; max-width: 100%;`;o&&(e+=` width: ${o};`),s&&(e+=` height: ${s};`),a.attr(`style`,e)}return a[0].outerHTML}let bE=`center`,xE=[`left`,`center`,`right`];function SE(e){if(typeof e!=`string`)return bE;let t=e.trim().toLowerCase();return xE.includes(t)?t:bE}function CE(e){let{align:t}=e;if(t)return SE(t);let{textAlign:n}=e;return SE(n)}function wE(e){return`w-e-video-align-${e}`}function TE(e){return e===`left`?`flex-start`:e===`right`?`flex-end`:`center`}function EE(e,t,n){let{src:r=``,poster:i=``,width:a=`auto`,height:o=`auto`,style:s={}}=e,c=hm(n),l=CE(e),u=` data-w-e-align="${l}"`,d=`<figure data-w-e-type="video" data-w-e-is-void${c===`class`?`${u} class="w-e-video ${wE(l)}"`:`${u} style="display: flex; justify-content: ${TE(l)}; margin: 0; max-width: 100%; width: 100%;"`}>\n`;if(r.trim().indexOf(`<iframe `)===0){let e=yE(r,a,o,s,c===`class`);d+=e}else{let{width:e=``,height:t=``}=s;if(c===`class`){let n=e?` data-w-e-style-width="${e}"`:``,s=t?` data-w-e-style-height="${t}"`:``;d+=`<video poster="${i}" controls="true" width="${a}" height="${o}"${n}${s}><source src="${r}" type="video/mp4"/></video>`}else{let n=`display: block; max-width: 100%;`;e&&(n+=` width: ${e};`),t&&(n+=` height: ${t};`),d+=`<video poster="${i}" controls="true" width="${a}" height="${o}" style="${n}"><source src="${r}" type="video/mp4"/></video>`}}return d+=`
75
+ </figure>`,d}let DE={type:`video`,elemToHtml:EE};function OE(){return{server:``,fieldName:`wangeditor-uploaded-video`,maxFileSize:10*1024*1024,maxNumberOfFiles:5,allowedFileTypes:[`video/*`],meta:{},metaWithUrl:!1,withCredentials:!1,timeout:30*1e3,onBeforeUpload:e=>e,onProgress:e=>{},onSuccess:(e,t)=>{},onFailed:(e,t)=>{console.error(`'${e.name}' upload failed`,t)},onError:(e,t,n)=>{console.error(`'${e.name} upload error`,t,n)}}}function kE(){return{onInsertedVideo(e){},checkVideo(e,t){return!0},parseVideoSrc(e){return e}}}function AE(e=`r`){return`${e}-${Rt()}`}function jE(e){return e.replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function ME(e){let t={};return e.trim().split(`;`).forEach(e=>{if(e){let[n,r]=e.split(`:`);n&&r&&(t[n.trim()]=r.trim())}}),t}O();function NE(){return AE(`w-e-insert-video`)}var PE=class{constructor(){this.title=X(`videoModule.editSize`),this.tag=`button`,this.showModal=!0,this.modalWidth=320,this.$content=null,this.widthInputId=NE(),this.heightInputId=NE(),this.buttonId=NE()}getSelectedVideoNode(e){return J.getSelectedNodeByType(e,`video`)}getValue(e){return``}isActive(e){return!1}exec(e,t){}isDisabled(e){return e.selection==null||this.getSelectedVideoNode(e)==null}getModalPositionNode(e){return this.getSelectedVideoNode(e)}getModalContentElem(e){let{widthInputId:t,heightInputId:n,buttonId:r}=this,[i,a]=ud(X(`videoModule.width`),t,`auto`),o=_E(a),[s,c]=ud(X(`videoModule.height`),n,`auto`),l=_E(c),[u]=fd(r,X(`videoModule.ok`)),d=this.getSelectedVideoNode(e);if(this.$content==null){let i=_E(`<div></div>`);i.on(`click`,`#${r}`,r=>{r.preventDefault();let a=i.find(`#${t}`).val().trim(),o=i.find(`#${n}`).val().trim(),s=e=>/^\d+(\.\d+)?%$/.test(e),c=e=>/^\d+(\.\d+)?$/.test(e),l=`auto`,u=`auto`;s(a)?l=a:c(a)&&(l=`${parseInt(a,10)}px`),s(o)?u=o:c(o)&&(u=`${parseInt(o,10)}px`);let{style:f={}}=d;e.restoreSelection();let p={style:D(D({},f),{},{width:l,height:u})};G.setNodes(e,p,{match:e=>J.checkNodeType(e,`video`)}),e.hidePanelOrModal()}),this.$content=i}let f=this.$content;if(f.empty(),f.append(i),f.append(s),f.append(u),d==null)return f[0];let{style:p={}}=d,{width:m=``,height:h=``}=p;return o.val(m),l.val(h),setTimeout(()=>{o.focus()}),f[0]}};j();function FE(){return AE(`w-e-edit-video`)}var IE=class{constructor(){this.title=X(`videoModule.edit`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>`,this.tag=`button`,this.showModal=!0,this.modalWidth=300,this.$content=null,this.srcInputId=FE(),this.posterInputId=FE(),this.buttonId=FE()}getSelectedVideoNode(e){return J.getSelectedNodeByType(e,`video`)}getValue(e){return``}isActive(e){return!1}exec(e,t){}isDisabled(e){return e.selection==null||this.getSelectedVideoNode(e)==null}getModalPositionNode(e){return this.getSelectedVideoNode(e)}getModalContentElem(e){let{srcInputId:t,posterInputId:n,buttonId:r}=this,[i,a]=ud(X(`videoModule.videoSrc`),t,X(`videoModule.videoSrcPlaceHolder`)),[o,s]=ud(X(`videoModule.videoPoster`),n,X(`videoModule.videoPosterPlaceHolder`)),c=_E(a),l=_E(s),[u]=fd(r,X(`videoModule.ok`));if(this.$content==null){let i=_E(`<div></div>`);i.on(`click`,`#${r}`,function(){var r=A(function*(r){r.preventDefault();let a={src:i.find(`#${t}`).val().trim(),poster:i.find(`#${n}`).val().trim(),key:AE(`video-`)};e.restoreSelection(),G.setNodes(e,a,{match:e=>J.checkNodeType(e,`video`)}),e.hidePanelOrModal()});return function(e){return r.apply(this,arguments)}}()),this.$content=i}let d=this.$content;d.empty(),d.append(i),d.append(o),d.append(u);let f=this.getSelectedVideoNode(e);if(f==null)return d[0];let{src:p=``,poster:m=``}=f;return c.val(p),l.val(m),setTimeout(()=>{c.focus()}),d[0]}};j();function LE(e,t){return RE.apply(this,arguments)}function RE(){return RE=A(function*(e,t,n=``,r=``,i=``){if(!t)return;e.restoreSelection();let{onInsertedVideo:a,checkVideo:o,parseVideoSrc:s}=e.getMenuConfig(`insertVideo`),c=yield o(t,n);if(typeof c==`string`){e.alert(c,`error`);return}if(c==null)return;let l=yield s(t);l.trim().indexOf(`<iframe `)!==0&&(l=jE(l));let u={type:`video`,src:l,poster:n,align:`center`,children:[{text:``}],style:{width:r,height:i}},d=J.getSelectedNodeByType(e,`table-cell`)!=null;Promise.resolve().then(()=>{if(!d&&J.isSelectedEmptyParagraph(e)&&G.removeNodes(e,{mode:`highest`}),d){G.insertNodes(e,u);return}G.insertNodes(e,u,{mode:`highest`})}),a(u)}),RE.apply(this,arguments)}j();function zE(){return AE(`w-e-insert-video`)}var BE=class{constructor(){this.title=X(`videoModule.insertVideo`),this.iconSvg=`<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>`,this.tag=`button`,this.showModal=!0,this.modalWidth=320,this.$content=null,this.srcInputId=zE(),this.posterInputId=zE(),this.buttonId=zE()}getValue(e){return``}isActive(e){return!1}exec(e,t){}isDisabled(e){let{selection:t}=e;return!!(t==null||!L.isCollapsed(t)||J.getSelectedElems(e).some(t=>!!(J.getNodeType(t)===`pre`||e.isVoid(t))))}getModalPositionNode(e){return null}getModalContentElem(e){let{srcInputId:t,posterInputId:n,buttonId:r}=this,[i,a]=ud(X(`videoModule.videoSrc`),t,X(`videoModule.videoSrcPlaceHolder`)),[o,s]=ud(X(`videoModule.videoPoster`),n,X(`videoModule.videoPosterPlaceHolder`)),c=_E(a),l=_E(s),[u]=fd(r,X(`videoModule.ok`));if(this.$content==null){let i=_E(`<div></div>`);i.on(`click`,`#${r}`,function(){var r=A(function*(r){r.preventDefault(),yield LE(e,i.find(`#${t}`).val().trim(),i.find(`#${n}`).val().trim()),e.hidePanelOrModal()});return function(e){return r.apply(this,arguments)}}()),this.$content=i}let d=this.$content;return d.empty(),d.append(i),d.append(o),d.append(u),c.val(``),l.val(``),setTimeout(()=>{c.focus()}),d[0]}};O(),j();function VE(e){return e.getMenuConfig(`uploadVideo`)}let HE=new WeakMap;function UE(e){let t=HE.get(e);if(t!=null)return t;let n=VE(e),{onSuccess:r,onProgress:i,onFailed:a,customInsert:o,onError:s}=n;return t=Zt(D(D({},n),{},{onProgress:t=>{e.showProgressBar(t),i&&i(t)},onSuccess:(t,n)=>{if(o){o(n,(t,n)=>LE(e,t,n)),r(t,n);return}let{errno:i=1,data:s={}}=n;if(i!==0){a(t,n);return}let{url:c=``,poster:l=``}=s;LE(e,c,l),r(t,n)},onError:(e,t,n)=>{s(e,t,n)}}),e),HE.set(e,t),t}function WE(e,t){return GE.apply(this,arguments)}function GE(){return GE=A(function*(e,t){let n=UE(e),r=t.map(e=>({name:e.name,type:e.type,size:e.size,data:e}));n.addFiles(r),yield n.upload()}),GE.apply(this,arguments)}function KE(e,t){return qE.apply(this,arguments)}function qE(){return qE=A(function*(e,t){if(t==null)return;let n=Array.prototype.slice.call(t),r=[],{customUpload:i}=VE(e);var a=!1,o=!1,s;try{for(var c=nE(n),l;a=!(l=yield c.next()).done;a=!1){let t=l.value;i?yield i(t,(t,n)=>LE(e,t,n),e):r.push(t)}}catch(e){o=!0,s=e}finally{try{a&&c.return!=null&&(yield c.return())}finally{if(o)throw s}}r.length>0&&(yield WE(e,r))}),qE.apply(this,arguments)}var JE=class{constructor(){this.title=X(`videoModule.uploadVideo`),this.iconSvg=`<svg viewBox="0 0 1056 1024"><path d="M805.902261 521.819882a251.441452 251.441452 0 0 0-251.011972 246.600033 251.051015 251.051015 0 1 0 502.023944 8.823877 253.237463 253.237463 0 0 0-251.011972-255.42391z m59.463561 240.001647v129.898403h-116.701631v-129.898403h-44.041298l101.279368-103.504859 101.279368 103.504859z" p-id="6802"></path><path d="M788.254507 0.000781H99.094092A98.663439 98.663439 0 0 0 0.001171 99.093701v590.067495a98.663439 98.663439 0 0 0 99.092921 99.092921h411.7549a266.434235 266.434235 0 0 1-2.186448-41.815807 275.843767 275.843767 0 0 1 275.180024-270.729042 270.650955 270.650955 0 0 1 103.504859 19.834201V99.093701A101.51363 101.51363 0 0 0 788.254507 0.000781zM295.054441 640.747004V147.507894l394.146189 246.600033z"></path></svg>`,this.tag=`button`}getValue(e){return``}isActive(e){return!1}exec(e,t){let{allowedFileTypes:n=[],customBrowseAndUpload:r}=this.getMenuConfig(e);if(r){r((t,n)=>LE(e,t,n));return}let i=``;n.length>0&&(i=`accept="${n.join(`, `)}"`);let a=_E(`body`),o=_E(`<input type="file" ${i} multiple/>`);o.hide(),a.append(o),o.click(),o.on(`change`,()=>{let t=o[0].files;KE(e,t)})}isDisabled(e){let{selection:t}=e;return!!(t==null||!L.isCollapsed(t)||J.getSelectedElems(e).some(t=>!!(J.getNodeType(t)===`pre`||e.isVoid(t))))}getMenuConfig(e){return e.getMenuConfig(`uploadVideo`)}},YE=class{constructor(e,t,n){this.align=e,this.iconSvg=n,this.tag=`button`,this.title=X(t)}getSelectedVideo(e){return J.getSelectedNodeByType(e,`video`)}getValue(e){let t=this.getSelectedVideo(e);return t?CE(t):!1}isActive(e){return this.getValue(e)===this.align}isDisabled(e){return e.selection==null?!0:this.getSelectedVideo(e)==null}exec(e,t){if(this.isDisabled(e))return;let n={align:this.align};G.setNodes(e,n,{match:e=>J.checkNodeType(e,`video`)})}};let XE={key:`insertVideo`,factory(){return new BE},config:kE()},ZE={key:`uploadVideo`,factory(){return new JE},config:OE()},QE={key:`editVideoSize`,factory(){return new PE}},$E={key:`editVideoSrc`,factory(){return new IE}},eD={key:`videoAlignLeft`,factory(){return new YE(`left`,`videoModule.alignLeft`,`<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`)}},tD={key:`videoAlignCenter`,factory(){return new YE(`center`,`videoModule.alignCenter`,`<svg viewBox="0 0 1024 1024"><path d="M870.4 793.6v102.4H153.6v-102.4h716.8z m102.4-230.4v102.4H51.2v-102.4h921.6z m-102.4-230.4v102.4H153.6v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`)}},nD={key:`videoAlignRight`,factory(){return new YE(`right`,`videoModule.alignRight`,`<svg viewBox="0 0 1024 1024"><path d="M972.8 793.6v102.4H256v-102.4h716.8z m0-230.4v102.4H51.2v-102.4h921.6z m0-230.4v102.4H256v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`)}};function rD(e,t=``,n=`auto`,r=`auto`,i={},a=`center`){return{type:`video`,src:e,poster:t,width:n,height:r,style:i,children:[{text:``}],align:a}}function iD(e){let t=(e.attr(`class`)||``).trim().split(/\s+/).filter(Boolean);for(let e=0;e<t.length;e+=1){let n=t[e];if(n.startsWith(`w-e-video-align-`))return n.replace(`w-e-video-align-`,``)}return``}function aD(e){let t=(e.attr(`data-w-e-align`)||``).trim();if(t)return SE(t);let n=ME(e.attr(`style`)||``),r=n[`justify-content`];if(r===`flex-start`)return`left`;if(r===`flex-end`)return`right`;if(r===`center`)return`center`;let i=iD(e);if(i)return SE(i);let a=n[`text-align`],o=(e.attr(`data-w-e-text-align`)||``).trim();return SE(a||o)}function oD(e){let t=ME(e),n={};return t.width&&(n.width=t.width),t.height&&(n.height=t.height),n}function sD(e,t,n){let r=_E(e),i=``,a=``,o=`auto`,s=`auto`,c={},l=`center`,u=r.find(`iframe`);if(u.length>0){o=u.attr(`width`)||`auto`,s=u.attr(`height`)||`auto`,c=oD(u.attr(`style`)||``);let e=u.attr(`data-w-e-style-width`)||``,t=u.attr(`data-w-e-style-height`)||``;return!c.width&&e&&(c.width=e),!c.height&&t&&(c.height=t),i=u[0].outerHTML,l=aD(r),rD(i,a,o,s,c,l)}let d=r.find(`video`);i=d.attr(`src`)||``,i||d.length>0&&(i=d.find(`source`).attr(`src`)||``),o=d.attr(`width`)||`auto`,s=d.attr(`height`)||`auto`,a=d.attr(`poster`)||``,c=oD(d.attr(`style`)||``);let f=d.attr(`data-w-e-style-width`)||``,p=d.attr(`data-w-e-style-height`)||``;return!c.width&&f&&(c.width=f),!c.height&&p&&(c.height=p),l=aD(r),rD(i,a,o,s,c,l)}let cD={selector:`figure[data-w-e-type="video"],div[data-w-e-type="video"]`,parseElemHtml:sD};function lD(e){let{isVoid:t,normalizeNode:n}=e,r=e;return r.isVoid=e=>{let{type:n}=e;return n===`video`?!0:t(e)},r.normalizeNode=([e,t])=>(J.getNodeType(e)===`video`&&J.isLastNode(r,e)&&G.insertNodes(r,J.genEmptyParagraph(),{at:[t[0]+1]}),n([e,t])),r}var uD=lD;function dD(e){let t=_E(e),n=t;if(vE(t)===`p`){let e=t.children();if(e.length===1){let t=e[0],r=t.tagName.toLowerCase();[`iframe`,`video`].includes(r)&&(n=_E(t))}}let r=vE(n);if(r!==`iframe`&&r!==`video`||n.parent().attr(`data-w-e-type`)===`video`)return n[0];let i=_E(`<figure data-w-e-type="video" data-w-e-is-void data-w-e-align="center" class="w-e-video w-e-video-align-center"></figure>`);return i.append(n),i[0]}let fD={selector:`iframe,video,p`,preParseHtml:dD};function pD(e,t,n){let{src:r=``,poster:i=``,key:a=``,width:o=`auto`,height:s=`auto`,style:c={}}=e,l=CE(e),u=[`w-e-video`,`w-e-textarea-video-container`,wE(l)].join(` `),d=J.isNodeSelected(n,e),f;if(r.trim().indexOf(`<iframe `)===0){let e=yE(r,o,s,c);f=Z(`figure`,{className:u,"data-selected":d?`true`:``,"data-w-e-align":l,innerHTML:e})}else{let e=Z(`video`,{key:a,poster:i,controls:!0,style:c},Z(`source`,{src:r,type:`video/mp4`}),`Sorry, your browser doesn't support embedded videos.
76
+ 抱歉,浏览器不支持 video 视频`);o!==`auto`&&(e.data.width=o),s!==`auto`&&(e.data.height=s),f=Z(`figure`,{className:u,"data-selected":d?`true`:``,"data-w-e-align":l},e)}return op(`div`,{props:{contentEditable:!1},on:{mousedown:e=>e.preventDefault()}},f)}var mD={renderElems:[{type:`video`,renderElem:pD}],elemsToHtml:[DE],preParseHtml:[fD],parseElemsHtml:[cD],menus:[XE,ZE,QE,$E,eD,tD,nD],editorPlugin:uD};O();var hD=class{constructor(){throw Error(`不能实例化
77
+ Can not construct a instance`)}static setEditorConfig(e={}){this.editorConfig=D(D({},this.editorConfig),e)}static setSimpleEditorConfig(e={}){this.simpleEditorConfig=D(D({},this.simpleEditorConfig),e)}static setToolbarConfig(e={}){this.toolbarConfig=D(D({},this.toolbarConfig),e)}static setSimpleToolbarConfig(e={}){this.simpleToolbarConfig=D(D({},this.simpleToolbarConfig),e)}static registerPlugin(e){this.plugins.push(e)}static registerMenu(e,t){Va(e,t)}static registerRenderElem(e){Pp(e)}static registerRenderStyle(e){Mp(e)}static registerElemToHtml(e){xc(e)}static registerStyleToHtml(e){gc(e)}static registerHtmlTransform(e){vc(e)}static registerPreParseHtml(e){Hs(e)}static registerParseElemHtml(e){Ks(e)}static registerParseStyleHtml(e){Ws(e)}static registerModule(e){vD(e)}};hD.editorConfig={},hD.simpleEditorConfig={},hD.toolbarConfig={},hD.simpleToolbarConfig={},hD.plugins=[];var gD=hD;function _D(e){let{menus:t,renderElems:n,renderStyle:r,elemsToHtml:i,styleToHtml:a,htmlTransform:o,preParseHtml:s,parseElemsHtml:c,parseStyleHtml:l,editorPlugin:u}=e;t&&t.forEach(e=>gD.registerMenu(e)),n&&n.forEach(e=>gD.registerRenderElem(e)),r&&gD.registerRenderStyle(r),i&&i.forEach(e=>gD.registerElemToHtml(e)),a&&gD.registerStyleToHtml(a),o&&gD.registerHtmlTransform(o),s&&s.forEach(e=>gD.registerPreParseHtml(e)),c&&c.forEach(e=>gD.registerParseElemHtml(e)),l&&gD.registerParseStyleHtml(l),u&&gD.registerPlugin(u)}var vD=_D;Wb.forEach(e=>vD(e)),vD(VS),vD($T),vD(mD),vD(gE),vD(ox),O();let yD={link:{menuKeys:[`editLink`,`unLink`,`viewLink`]},image:{menuKeys:[`imageWidth30`,`imageWidth50`,`imageWidth100`,`editorImageSizeMenu`,`editImage`,`previewImage`,`viewImageLink`,`deleteImage`]},pre:{menuKeys:[`enter`,`codeBlock`,`codeSelectLang`]},table:{menuKeys:[`enter`,`tableHeader`,`tableFullWidth`,`insertTableRow`,`deleteTableRow`,`insertTableCol`,`deleteTableCol`,`deleteTable`,`mergeTableCell`,`splitTableCell`,`setTableProperty`,`setTableCellProperty`]},divider:{menuKeys:[`enter`]},video:{menuKeys:[`enter`,`videoAlignLeft`,`videoAlignCenter`,`videoAlignRight`,`editVideoSize`,`editVideoSrc`]}};function bD(){return D(D({},yD),{},{text:{menuKeys:[`formatPainter`,`headerSelect`,`insertLink`,`bulletedList`,`|`,`bold`,`through`,`color`,`bgColor`,`clearStyle`]}})}function xD(){return yD}let SD=`<svg viewBox="0 0 1024 1024"><path d="M959.877 128l0.123 0.123v767.775l-0.123 0.122H64.102l-0.122-0.122V128.123l0.122-0.123h895.775zM960 64H64C28.795 64 0 92.795 0 128v768c0 35.205 28.795 64 64 64h896c35.205 0 64-28.795 64-64V128c0-35.205-28.795-64-64-64zM832 288.01c0 53.023-42.988 96.01-96.01 96.01s-96.01-42.987-96.01-96.01S682.967 192 735.99 192 832 234.988 832 288.01zM896 832H128V704l224.01-384 256 320h64l224.01-192z"></path></svg>`;function CD(){return[`headerSelect`,`blockquote`,`|`,`bold`,`underline`,`italic`,{key:`group-more-style`,title:X(`editor.more`),iconSvg:`<svg viewBox="0 0 1024 1024"><path d="M204.8 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M505.6 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path><path d="M806.4 505.6m-76.8 0a76.8 76.8 0 1 0 153.6 0 76.8 76.8 0 1 0-153.6 0Z"></path></svg>`,menuKeys:[`through`,`wavyUnderline`,`emphasisDot`,`code`,`sup`,`sub`,`clearStyle`]},`color`,`bgColor`,`|`,`fontSize`,`fontFamily`,`lineHeight`,`|`,`bulletedList`,`numberedList`,`todo`,{key:`group-justify`,title:X(`editor.justify`),iconSvg:`<svg viewBox="0 0 1024 1024"><path d="M768 793.6v102.4H51.2v-102.4h716.8z m204.8-230.4v102.4H51.2v-102.4h921.6z m-204.8-230.4v102.4H51.2v-102.4h716.8zM972.8 102.4v102.4H51.2V102.4h921.6z"></path></svg>`,menuKeys:[`justifyLeft`,`justifyRight`,`justifyCenter`,`justifyJustify`]},{key:`group-indent`,title:X(`editor.indent`),iconSvg:`<svg viewBox="0 0 1024 1024"><path d="M0 64h1024v128H0z m384 192h640v128H384z m0 192h640v128H384z m0 192h640v128H384zM0 832h1024v128H0z m0-128V320l256 192z"></path></svg>`,menuKeys:[`indent`,`delIndent`]},`|`,`emotion`,`insertLink`,{key:`group-image`,title:X(`editor.image`),iconSvg:SD,menuKeys:[`insertImage`,`uploadImage`]},{key:`group-video`,title:X(`editor.video`),iconSvg:`<svg viewBox="0 0 1024 1024"><path d="M981.184 160.096C837.568 139.456 678.848 128 512 128S186.432 139.456 42.816 160.096C15.296 267.808 0 386.848 0 512s15.264 244.16 42.816 351.904C186.464 884.544 345.152 896 512 896s325.568-11.456 469.184-32.096C1008.704 756.192 1024 637.152 1024 512s-15.264-244.16-42.816-351.904zM384 704V320l320 192-320 192z"></path></svg>`,menuKeys:[`insertVideo`,`uploadVideo`]},`insertTable`,`codeBlock`,`divider`,`|`,`undo`,`redo`,`|`,`formatPainter`,`fullScreen`]}function wD(){return[`blockquote`,`header1`,`header2`,`header3`,`|`,`bold`,`underline`,`italic`,`through`,`color`,`bgColor`,`clearStyle`,`|`,`bulletedList`,`numberedList`,`todo`,`justifyLeft`,`justifyRight`,`justifyCenter`,`|`,`insertLink`,{key:`group-image`,title:X(`editor.image`),iconSvg:SD,menuKeys:[`insertImage`,`uploadImage`]},`insertVideo`,`insertTable`,`codeBlock`,`|`,`undo`,`redo`,`|`,`fullScreen`]}function TD(){return{hoverbarKeys:bD()}}function ED(){return{hoverbarKeys:xD()}}function DD(){return{toolbarKeys:CD()}}function OD(){return{toolbarKeys:wD()}}O();let kD=TD();gD.setEditorConfig(D(D({},kD),{},{decorate:Xb}));let AD=ED();gD.setSimpleEditorConfig(D(D({},AD),{},{decorate:Xb}));let jD=DD();gD.setToolbarConfig(jD);let MD=OD();gD.setSimpleToolbarConfig(MD),O();function ND(e={}){let{selector:t=``,content:n=[],html:r,config:i={},mode:a=`default`}=e,o=a===`simple`?gD.simpleEditorConfig:gD.editorConfig,s=D(D({},o.hoverbarKeys||{}),i.hoverbarKeys||{});return fm({selector:t,config:D(D(D({},o),i),{},{hoverbarKeys:s}),content:n,html:r,plugins:gD.plugins})}function PD(e){let{selector:t,editor:n,config:r={},mode:i=`default`}=e;if(!t)throw Error(`Cannot find 'selector' when create toolbar`);return mm(n,{selector:t,config:D(D({},i===`simple`?gD.simpleToolbarConfig:gD.toolbarConfig),r)})}e.Boot=gD,e.DomEditor=J,e.SlateEditor=V,e.SlateElement=R,e.SlateNode=z,e.SlatePath=I,e.SlatePoint=U,e.SlateRange=L,e.SlateText=W,e.SlateTransforms=G,e.Toolbar=pm,e.createEditor=ND,e.createToolbar=PD,e.createUploader=Zt,e.default={},e.genModalButtonElems=fd,e.genModalInputElems=ud,e.genModalTextareaElems=dd,e.getClassStylePolicy=gm,e.getTextStyleMode=hm,e.i18nAddResources=Xu,e.i18nChangeLanguage=Zu,e.i18nGetResources=Qu,e.reportUnsupportedClassStyle=_m,e.t=X});
78
+ //# sourceMappingURL=index.js.map