@devalok/shilp-sutra 0.38.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/AGENTS.md +151 -0
  2. package/MIGRATION.md +255 -0
  3. package/README.md +3 -0
  4. package/dist/_chunks/badge-group.js +76 -75
  5. package/dist/_chunks/badge-group.js.map +1 -1
  6. package/dist/_chunks/chart-container.js +50 -0
  7. package/dist/_chunks/chart-container.js.map +1 -0
  8. package/dist/_chunks/chat.js +236 -228
  9. package/dist/_chunks/chat.js.map +1 -1
  10. package/dist/_chunks/colors.js +30 -0
  11. package/dist/_chunks/colors.js.map +1 -0
  12. package/dist/_chunks/document-preview.js +2 -2
  13. package/dist/_chunks/document-preview.js.map +1 -1
  14. package/dist/_chunks/emoji-data.js +45 -0
  15. package/dist/_chunks/emoji-data.js.map +1 -0
  16. package/dist/_chunks/grid-lines.js +72 -0
  17. package/dist/_chunks/grid-lines.js.map +1 -0
  18. package/dist/_chunks/image-preview.js +2 -2
  19. package/dist/_chunks/image-preview.js.map +1 -1
  20. package/dist/_chunks/mention-suggestion.js +35 -263
  21. package/dist/_chunks/mention-suggestion.js.map +1 -1
  22. package/dist/_chunks/normalize-icon.js +18 -0
  23. package/dist/_chunks/normalize-icon.js.map +1 -0
  24. package/dist/_chunks/oauth-button.js +227 -0
  25. package/dist/_chunks/oauth-button.js.map +1 -0
  26. package/dist/_chunks/popover.js +3 -3
  27. package/dist/_chunks/popover.js.map +1 -1
  28. package/dist/_chunks/primitives.js +107 -107
  29. package/dist/_chunks/primitives.js.map +1 -1
  30. package/dist/_chunks/shared.js +5 -5
  31. package/dist/_chunks/shared.js.map +1 -1
  32. package/dist/_chunks/{text.js → success.js} +26 -63
  33. package/dist/_chunks/success.js.map +1 -0
  34. package/dist/_chunks/tiptap.js +1952 -1949
  35. package/dist/_chunks/tiptap.js.map +1 -1
  36. package/dist/_chunks/tooltip.js +58 -0
  37. package/dist/_chunks/tooltip.js.map +1 -0
  38. package/dist/_chunks/tree-view.js +101 -96
  39. package/dist/_chunks/tree-view.js.map +1 -1
  40. package/dist/_chunks/use-calendar.js +5 -5
  41. package/dist/_chunks/use-calendar.js.map +1 -1
  42. package/dist/ai/ai-command-provider.d.ts +3 -2
  43. package/dist/ai/ai-command-provider.d.ts.map +1 -1
  44. package/dist/ai/ai-command-provider.js.map +1 -1
  45. package/dist/ai/block-renderer.js +11 -9
  46. package/dist/ai/block-renderer.js.map +1 -1
  47. package/dist/ai/blocks/error.js +31 -0
  48. package/dist/ai/blocks/error.js.map +1 -0
  49. package/dist/ai/blocks/index.d.ts +0 -2
  50. package/dist/ai/blocks/index.d.ts.map +1 -1
  51. package/dist/ai/blocks/index.js +2 -2
  52. package/dist/ai/blocks/text.js +19 -0
  53. package/dist/ai/blocks/text.js.map +1 -0
  54. package/dist/ai/command-bar.d.ts.map +1 -1
  55. package/dist/ai/command-bar.js +198 -193
  56. package/dist/ai/command-bar.js.map +1 -1
  57. package/dist/ai/conversation.d.ts +2 -1
  58. package/dist/ai/conversation.d.ts.map +1 -1
  59. package/dist/ai/conversation.js +92 -87
  60. package/dist/ai/conversation.js.map +1 -1
  61. package/dist/ai/index.d.ts +0 -4
  62. package/dist/ai/index.d.ts.map +1 -1
  63. package/dist/ai/index.js +45 -46
  64. package/dist/ai/index.js.map +1 -1
  65. package/dist/composed/activity-feed.d.ts +2 -1
  66. package/dist/composed/activity-feed.d.ts.map +1 -1
  67. package/dist/composed/activity-feed.js +5 -5
  68. package/dist/composed/activity-feed.js.map +1 -1
  69. package/dist/composed/avatar-group.js +4 -4
  70. package/dist/composed/avatar-group.js.map +1 -1
  71. package/dist/composed/bulk-action-bar.d.ts +2 -2
  72. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  73. package/dist/composed/bulk-action-bar.js +12 -12
  74. package/dist/composed/bulk-action-bar.js.map +1 -1
  75. package/dist/composed/command-palette.d.ts +2 -1
  76. package/dist/composed/command-palette.d.ts.map +1 -1
  77. package/dist/composed/command-palette.js +106 -101
  78. package/dist/composed/command-palette.js.map +1 -1
  79. package/dist/composed/content-card.js +1 -1
  80. package/dist/composed/content-card.js.map +1 -1
  81. package/dist/composed/date-picker/index.js +747 -3
  82. package/dist/composed/date-picker/index.js.map +1 -0
  83. package/dist/composed/emoji-picker.js +4 -4
  84. package/dist/composed/emoji-picker.js.map +1 -1
  85. package/dist/composed/empty-state.d.ts +3 -3
  86. package/dist/composed/empty-state.d.ts.map +1 -1
  87. package/dist/composed/empty-state.js +40 -31
  88. package/dist/composed/empty-state.js.map +1 -1
  89. package/dist/composed/error-boundary.js +3 -3
  90. package/dist/composed/error-boundary.js.map +1 -1
  91. package/dist/composed/extensions/emoji-node.js +81 -0
  92. package/dist/composed/extensions/emoji-node.js.map +1 -0
  93. package/dist/composed/extensions/emoji-suggestion.js +117 -0
  94. package/dist/composed/extensions/emoji-suggestion.js.map +1 -0
  95. package/dist/composed/file-preview.js +498 -2
  96. package/dist/composed/file-preview.js.map +1 -0
  97. package/dist/composed/filter-bar.js +1 -1
  98. package/dist/composed/filter-bar.js.map +1 -1
  99. package/dist/composed/index.d.ts +0 -15
  100. package/dist/composed/index.d.ts.map +1 -1
  101. package/dist/composed/index.js +16 -24
  102. package/dist/composed/inline-edit.js +1 -1
  103. package/dist/composed/inline-edit.js.map +1 -1
  104. package/dist/composed/loading-skeleton.js +9 -9
  105. package/dist/composed/loading-skeleton.js.map +1 -1
  106. package/dist/composed/markdown-viewer.js +3 -3
  107. package/dist/composed/markdown-viewer.js.map +1 -1
  108. package/dist/composed/multi-select-popover.js +1 -1
  109. package/dist/composed/multi-select-popover.js.map +1 -1
  110. package/dist/composed/page-header.js +1 -1
  111. package/dist/composed/page-header.js.map +1 -1
  112. package/dist/composed/page-skeletons.js +15 -15
  113. package/dist/composed/page-skeletons.js.map +1 -1
  114. package/dist/composed/priority-indicator.js +3 -3
  115. package/dist/composed/priority-indicator.js.map +1 -1
  116. package/dist/composed/rich-chat-input.js +2073 -2
  117. package/dist/composed/rich-chat-input.js.map +1 -0
  118. package/dist/composed/rich-text-editor.js +75 -72
  119. package/dist/composed/rich-text-editor.js.map +1 -1
  120. package/dist/composed/schedule-view.js +3 -3
  121. package/dist/composed/schedule-view.js.map +1 -1
  122. package/dist/composed/status-badge.d.ts +3 -2
  123. package/dist/composed/status-badge.d.ts.map +1 -1
  124. package/dist/composed/status-badge.js +58 -53
  125. package/dist/composed/status-badge.js.map +1 -1
  126. package/dist/shell/app-command-palette.d.ts +2 -1
  127. package/dist/shell/app-command-palette.d.ts.map +1 -1
  128. package/dist/shell/app-command-palette.js.map +1 -1
  129. package/dist/shell/bottom-navbar.d.ts +3 -1
  130. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  131. package/dist/shell/bottom-navbar.js +94 -86
  132. package/dist/shell/bottom-navbar.js.map +1 -1
  133. package/dist/shell/command-registry.d.ts +2 -1
  134. package/dist/shell/command-registry.d.ts.map +1 -1
  135. package/dist/shell/command-registry.js.map +1 -1
  136. package/dist/shell/notification-center.js +8 -8
  137. package/dist/shell/notification-center.js.map +1 -1
  138. package/dist/shell/notification-preferences.js +1 -1
  139. package/dist/shell/notification-preferences.js.map +1 -1
  140. package/dist/shell/sidebar.d.ts +7 -4
  141. package/dist/shell/sidebar.d.ts.map +1 -1
  142. package/dist/shell/sidebar.js +148 -134
  143. package/dist/shell/sidebar.js.map +1 -1
  144. package/dist/shell/top-bar.d.ts +4 -3
  145. package/dist/shell/top-bar.d.ts.map +1 -1
  146. package/dist/shell/top-bar.js +116 -108
  147. package/dist/shell/top-bar.js.map +1 -1
  148. package/dist/tokens/semantic.css +82 -9
  149. package/dist/ui/accordion.js +1 -1
  150. package/dist/ui/accordion.js.map +1 -1
  151. package/dist/ui/alert-dialog.js +3 -3
  152. package/dist/ui/alert-dialog.js.map +1 -1
  153. package/dist/ui/alert.js +2 -2
  154. package/dist/ui/alert.js.map +1 -1
  155. package/dist/ui/autocomplete.js +2 -2
  156. package/dist/ui/autocomplete.js.map +1 -1
  157. package/dist/ui/avatar.js +11 -11
  158. package/dist/ui/avatar.js.map +1 -1
  159. package/dist/ui/badge-indicator.js +1 -1
  160. package/dist/ui/badge-indicator.js.map +1 -1
  161. package/dist/ui/badge.d.ts +3 -2
  162. package/dist/ui/badge.d.ts.map +1 -1
  163. package/dist/ui/banner.js +1 -1
  164. package/dist/ui/banner.js.map +1 -1
  165. package/dist/ui/breadcrumb.js +1 -1
  166. package/dist/ui/breadcrumb.js.map +1 -1
  167. package/dist/ui/button.d.ts +5 -4
  168. package/dist/ui/button.d.ts.map +1 -1
  169. package/dist/ui/button.js +66 -65
  170. package/dist/ui/button.js.map +1 -1
  171. package/dist/ui/card.js +5 -5
  172. package/dist/ui/card.js.map +1 -1
  173. package/dist/ui/charts/area-chart.js +177 -0
  174. package/dist/ui/charts/area-chart.js.map +1 -0
  175. package/dist/ui/charts/bar-chart.js +127 -0
  176. package/dist/ui/charts/bar-chart.js.map +1 -0
  177. package/dist/ui/charts/chart-container.js +3 -0
  178. package/dist/ui/charts/gauge-chart.js +72 -0
  179. package/dist/ui/charts/gauge-chart.js.map +1 -0
  180. package/dist/ui/charts/index.js +10 -1035
  181. package/dist/ui/charts/line-chart.js +135 -0
  182. package/dist/ui/charts/line-chart.js.map +1 -0
  183. package/dist/ui/charts/pie-chart.js +111 -0
  184. package/dist/ui/charts/pie-chart.js.map +1 -0
  185. package/dist/ui/charts/radar-chart.js +170 -0
  186. package/dist/ui/charts/radar-chart.js.map +1 -0
  187. package/dist/ui/charts/sparkline.js +119 -0
  188. package/dist/ui/charts/sparkline.js.map +1 -0
  189. package/dist/ui/chat/message.d.ts +3 -3
  190. package/dist/ui/chat/message.d.ts.map +1 -1
  191. package/dist/ui/chat/system-message.d.ts +2 -1
  192. package/dist/ui/chat/system-message.d.ts.map +1 -1
  193. package/dist/ui/checkbox.js +1 -1
  194. package/dist/ui/checkbox.js.map +1 -1
  195. package/dist/ui/code.js +2 -2
  196. package/dist/ui/code.js.map +1 -1
  197. package/dist/ui/color-input.js +10 -10
  198. package/dist/ui/color-input.js.map +1 -1
  199. package/dist/ui/color-swatch.js +3 -3
  200. package/dist/ui/color-swatch.js.map +1 -1
  201. package/dist/ui/combobox.d.ts +2 -1
  202. package/dist/ui/combobox.d.ts.map +1 -1
  203. package/dist/ui/combobox.js +100 -95
  204. package/dist/ui/combobox.js.map +1 -1
  205. package/dist/ui/container.d.ts +6 -1
  206. package/dist/ui/container.d.ts.map +1 -1
  207. package/dist/ui/container.js +2 -1
  208. package/dist/ui/container.js.map +1 -1
  209. package/dist/ui/context-menu.js +6 -6
  210. package/dist/ui/context-menu.js.map +1 -1
  211. package/dist/ui/data-table-body.js +1 -1
  212. package/dist/ui/data-table-body.js.map +1 -1
  213. package/dist/ui/data-table-bulk-actions.js +2 -2
  214. package/dist/ui/data-table-bulk-actions.js.map +1 -1
  215. package/dist/ui/data-table-card.js +2 -2
  216. package/dist/ui/data-table-card.js.map +1 -1
  217. package/dist/ui/data-table-header.js +2 -2
  218. package/dist/ui/data-table-header.js.map +1 -1
  219. package/dist/ui/data-table-pagination.js +3 -3
  220. package/dist/ui/data-table-pagination.js.map +1 -1
  221. package/dist/ui/data-table-toolbar.js +1 -1
  222. package/dist/ui/data-table-toolbar.js.map +1 -1
  223. package/dist/ui/data-table.js +1 -1
  224. package/dist/ui/data-table.js.map +1 -1
  225. package/dist/ui/devalok-grain.d.ts +1 -1
  226. package/dist/ui/devalok-grain.js.map +1 -1
  227. package/dist/ui/dialog.js +2 -2
  228. package/dist/ui/dialog.js.map +1 -1
  229. package/dist/ui/dropdown-menu.js +6 -6
  230. package/dist/ui/dropdown-menu.js.map +1 -1
  231. package/dist/ui/file-upload.js +4 -4
  232. package/dist/ui/file-upload.js.map +1 -1
  233. package/dist/ui/hover-card.js +1 -1
  234. package/dist/ui/hover-card.js.map +1 -1
  235. package/dist/ui/icon-button.d.ts +9 -2
  236. package/dist/ui/icon-button.d.ts.map +1 -1
  237. package/dist/ui/icon-button.js +14 -13
  238. package/dist/ui/icon-button.js.map +1 -1
  239. package/dist/ui/index.d.ts +1 -3
  240. package/dist/ui/index.d.ts.map +1 -1
  241. package/dist/ui/index.js +31 -33
  242. package/dist/ui/index.js.map +1 -1
  243. package/dist/ui/input-otp.js +1 -1
  244. package/dist/ui/input-otp.js.map +1 -1
  245. package/dist/ui/input.js +2 -2
  246. package/dist/ui/input.js.map +1 -1
  247. package/dist/ui/lib/icon-input.d.ts +42 -0
  248. package/dist/ui/lib/icon-input.d.ts.map +1 -0
  249. package/dist/ui/lib/normalize-icon.d.ts +39 -0
  250. package/dist/ui/lib/normalize-icon.d.ts.map +1 -0
  251. package/dist/ui/link.js +1 -1
  252. package/dist/ui/link.js.map +1 -1
  253. package/dist/ui/menubar.js +8 -8
  254. package/dist/ui/menubar.js.map +1 -1
  255. package/dist/ui/navigation-menu.js +3 -3
  256. package/dist/ui/navigation-menu.js.map +1 -1
  257. package/dist/ui/number-input.js +3 -3
  258. package/dist/ui/number-input.js.map +1 -1
  259. package/dist/ui/oauth-button/index.d.ts +3 -0
  260. package/dist/ui/oauth-button/index.d.ts.map +1 -0
  261. package/dist/ui/oauth-button/index.js +3 -0
  262. package/dist/ui/oauth-button/oauth-button.d.ts +208 -0
  263. package/dist/ui/oauth-button/oauth-button.d.ts.map +1 -0
  264. package/dist/ui/pagination.js +1 -1
  265. package/dist/ui/pagination.js.map +1 -1
  266. package/dist/ui/progress.js +2 -2
  267. package/dist/ui/progress.js.map +1 -1
  268. package/dist/ui/radio.js +1 -1
  269. package/dist/ui/radio.js.map +1 -1
  270. package/dist/ui/segmented-control.d.ts +3 -4
  271. package/dist/ui/segmented-control.d.ts.map +1 -1
  272. package/dist/ui/segmented-control.js +53 -45
  273. package/dist/ui/segmented-control.js.map +1 -1
  274. package/dist/ui/select.js +3 -3
  275. package/dist/ui/select.js.map +1 -1
  276. package/dist/ui/sheet.js +2 -2
  277. package/dist/ui/sheet.js.map +1 -1
  278. package/dist/ui/sidebar.js +11 -11
  279. package/dist/ui/sidebar.js.map +1 -1
  280. package/dist/ui/skeleton.js +9 -9
  281. package/dist/ui/skeleton.js.map +1 -1
  282. package/dist/ui/slider.js +2 -2
  283. package/dist/ui/slider.js.map +1 -1
  284. package/dist/ui/split-button.js +7 -7
  285. package/dist/ui/split-button.js.map +1 -1
  286. package/dist/ui/stack.d.ts +6 -1
  287. package/dist/ui/stack.d.ts.map +1 -1
  288. package/dist/ui/stack.js +2 -1
  289. package/dist/ui/stack.js.map +1 -1
  290. package/dist/ui/stat-card.d.ts +2 -3
  291. package/dist/ui/stat-card.d.ts.map +1 -1
  292. package/dist/ui/stat-card.js +118 -116
  293. package/dist/ui/stat-card.js.map +1 -1
  294. package/dist/ui/status-dot.js +2 -2
  295. package/dist/ui/status-dot.js.map +1 -1
  296. package/dist/ui/stepper.d.ts +2 -1
  297. package/dist/ui/stepper.d.ts.map +1 -1
  298. package/dist/ui/stepper.js +74 -69
  299. package/dist/ui/stepper.js.map +1 -1
  300. package/dist/ui/switch.js +2 -2
  301. package/dist/ui/switch.js.map +1 -1
  302. package/dist/ui/tabs.js +3 -3
  303. package/dist/ui/tabs.js.map +1 -1
  304. package/dist/ui/text.d.ts +7 -2
  305. package/dist/ui/text.d.ts.map +1 -1
  306. package/dist/ui/text.js +2 -1
  307. package/dist/ui/text.js.map +1 -1
  308. package/dist/ui/textarea.js +1 -1
  309. package/dist/ui/textarea.js.map +1 -1
  310. package/dist/ui/toast.js +8 -8
  311. package/dist/ui/toast.js.map +1 -1
  312. package/dist/ui/toaster.d.ts +11 -2
  313. package/dist/ui/toaster.d.ts.map +1 -1
  314. package/dist/ui/toaster.js.map +1 -1
  315. package/dist/ui/toggle.js +1 -1
  316. package/dist/ui/toggle.js.map +1 -1
  317. package/dist/ui/tooltip.js +12 -12
  318. package/dist/ui/tooltip.js.map +1 -1
  319. package/dist/ui/tree-view/tree-item.d.ts +3 -2
  320. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  321. package/dist/ui/tree-view/use-tree.d.ts +2 -1
  322. package/dist/ui/tree-view/use-tree.d.ts.map +1 -1
  323. package/docs/components/_header.md +90 -1
  324. package/docs/components/ui/oauth-button.md +86 -0
  325. package/docs/recipes/customize-brand.md +100 -4
  326. package/docs/recipes/index.md +5 -1
  327. package/docs/recipes/install-astro.md +15 -0
  328. package/docs/recipes/install-next-app-router.md +21 -5
  329. package/docs/recipes/install-next-pages.md +2 -0
  330. package/docs/recipes/install-remix.md +15 -0
  331. package/docs/recipes/install-tanstack-start.md +15 -0
  332. package/docs/recipes/install-vite.md +15 -0
  333. package/docs/recipes/troubleshoot.md +22 -0
  334. package/llms-full.txt +177 -2
  335. package/llms-quick.txt +247 -0
  336. package/llms.txt +116 -3
  337. package/package.json +80 -2
  338. package/scripts/welcome.mjs +219 -0
  339. package/skill/README.md +99 -0
  340. package/skill/SKILL.md +163 -0
  341. package/skill/install.sh +59 -0
  342. package/skill/references/components-full.md +7083 -0
  343. package/skill/references/components.md +778 -0
  344. package/skill/references/customize-brand.md +314 -0
  345. package/skill/references/server-components.md +211 -0
  346. package/skill/references/setup-astro.md +195 -0
  347. package/skill/references/setup-next-app-router.md +248 -0
  348. package/skill/references/setup-next-pages.md +127 -0
  349. package/skill/references/setup-remix.md +188 -0
  350. package/skill/references/setup-tanstack-start.md +160 -0
  351. package/skill/references/setup-vite.md +187 -0
  352. package/skill/references/troubleshoot.md +241 -0
  353. package/dist/_chunks/date-picker.js +0 -748
  354. package/dist/_chunks/date-picker.js.map +0 -1
  355. package/dist/_chunks/file-preview.js +0 -499
  356. package/dist/_chunks/file-preview.js.map +0 -1
  357. package/dist/_chunks/rich-chat-input.js +0 -2071
  358. package/dist/_chunks/rich-chat-input.js.map +0 -1
  359. package/dist/_chunks/text.js.map +0 -1
  360. package/dist/ui/charts/index.js.map +0 -1
  361. /package/{LICENSE → skill/LICENSE} +0 -0
@@ -10478,2092 +10478,2095 @@ function uf(e) {
10478
10478
  });
10479
10479
  }
10480
10480
  //#endregion
10481
- //#region ../../node_modules/.pnpm/fast-equals@5.4.0/node_modules/fast-equals/dist/es/index.mjs
10482
- var { getOwnPropertyNames: df, getOwnPropertySymbols: ff } = Object, { hasOwnProperty: pf } = Object.prototype;
10483
- function mf(e, t) {
10484
- return function(n, r, i) {
10485
- return e(n, r, i) && t(n, r, i);
10486
- };
10487
- }
10488
- function hf(e) {
10489
- return function(t, n, r) {
10490
- if (!t || !n || typeof t != "object" || typeof n != "object") return e(t, n, r);
10491
- let { cache: i } = r, a = i.get(t), o = i.get(n);
10492
- if (a && o) return a === n && o === t;
10493
- i.set(t, n), i.set(n, t);
10494
- let s = e(t, n, r);
10495
- return i.delete(t), i.delete(n), s;
10496
- };
10497
- }
10498
- function gf(e) {
10499
- return e?.[Symbol.toStringTag];
10500
- }
10501
- function _f(e) {
10502
- return df(e).concat(ff(e));
10503
- }
10504
- var vf = Object.hasOwn || ((e, t) => pf.call(e, t));
10505
- function yf(e, t) {
10506
- return e === t || !e && !t && e !== e && t !== t;
10507
- }
10508
- var bf = "__v", xf = "__o", Sf = "_owner", { getOwnPropertyDescriptor: Cf, keys: wf } = Object;
10509
- function Tf(e, t) {
10510
- return e.byteLength === t.byteLength && Rf(new Uint8Array(e), new Uint8Array(t));
10511
- }
10512
- function Ef(e, t, n) {
10513
- let r = e.length;
10514
- if (t.length !== r) return !1;
10515
- for (; r-- > 0;) if (!n.equals(e[r], t[r], r, r, e, t, n)) return !1;
10516
- return !0;
10517
- }
10518
- function Df(e, t) {
10519
- return e.byteLength === t.byteLength && Rf(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
10520
- }
10521
- function Of(e, t) {
10522
- return yf(e.getTime(), t.getTime());
10523
- }
10524
- function kf(e, t) {
10525
- return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
10526
- }
10527
- function Af(e, t) {
10528
- return e === t;
10529
- }
10530
- function jf(e, t, n) {
10531
- let r = e.size;
10532
- if (r !== t.size) return !1;
10533
- if (!r) return !0;
10534
- let i = Array(r), a = e.entries(), o, s, c = 0;
10535
- for (; (o = a.next()) && !o.done;) {
10536
- let r = t.entries(), a = !1, l = 0;
10537
- for (; (s = r.next()) && !s.done;) {
10538
- if (i[l]) {
10539
- l++;
10540
- continue;
10541
- }
10542
- let r = o.value, u = s.value;
10543
- if (n.equals(r[0], u[0], c, l, e, t, n) && n.equals(r[1], u[1], r[0], u[0], e, t, n)) {
10544
- a = i[l] = !0;
10545
- break;
10481
+ //#region ../../node_modules/.pnpm/@tiptap+extension-highlight@3.22.5_@tiptap+core@3.22.5_@tiptap+pm@3.22.5_/node_modules/@tiptap/extension-highlight/dist/index.js
10482
+ var df = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, ff = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, pf = _d.create({
10483
+ name: "highlight",
10484
+ addOptions() {
10485
+ return {
10486
+ multicolor: !1,
10487
+ HTMLAttributes: {}
10488
+ };
10489
+ },
10490
+ addAttributes() {
10491
+ return this.options.multicolor ? { color: {
10492
+ default: null,
10493
+ parseHTML: (e) => e.getAttribute("data-color") || e.style.backgroundColor,
10494
+ renderHTML: (e) => e.color ? {
10495
+ "data-color": e.color,
10496
+ style: `background-color: ${e.color}; color: inherit`
10497
+ } : {}
10498
+ } } : {};
10499
+ },
10500
+ parseHTML() {
10501
+ return [{ tag: "mark" }];
10502
+ },
10503
+ renderHTML({ HTMLAttributes: e }) {
10504
+ return [
10505
+ "mark",
10506
+ K(this.options.HTMLAttributes, e),
10507
+ 0
10508
+ ];
10509
+ },
10510
+ renderMarkdown: (e, t) => `==${t.renderChildren(e)}==`,
10511
+ parseMarkdown: (e, t) => t.applyMark("highlight", t.parseInline(e.tokens || [])),
10512
+ markdownTokenizer: {
10513
+ name: "highlight",
10514
+ level: "inline",
10515
+ start: (e) => e.indexOf("=="),
10516
+ tokenize(e, t, n) {
10517
+ let r = /^(==)([^=]+)(==)/.exec(e);
10518
+ if (r) {
10519
+ let e = r[2].trim(), t = n.inlineTokens(e);
10520
+ return {
10521
+ type: "highlight",
10522
+ raw: r[0],
10523
+ text: e,
10524
+ tokens: t
10525
+ };
10546
10526
  }
10547
- l++;
10548
10527
  }
10549
- if (!a) return !1;
10550
- c++;
10528
+ },
10529
+ addCommands() {
10530
+ return {
10531
+ setHighlight: (e) => ({ commands: t }) => t.setMark(this.name, e),
10532
+ toggleHighlight: (e) => ({ commands: t }) => t.toggleMark(this.name, e),
10533
+ unsetHighlight: () => ({ commands: e }) => e.unsetMark(this.name)
10534
+ };
10535
+ },
10536
+ addKeyboardShortcuts() {
10537
+ return { "Mod-Shift-h": () => this.editor.commands.toggleHighlight() };
10538
+ },
10539
+ addInputRules() {
10540
+ return [Vd({
10541
+ find: df,
10542
+ type: this.type
10543
+ })];
10544
+ },
10545
+ addPasteRules() {
10546
+ return [uf({
10547
+ find: ff,
10548
+ type: this.type
10549
+ })];
10551
10550
  }
10552
- return !0;
10553
- }
10554
- var Mf = yf;
10555
- function Nf(e, t, n) {
10556
- let r = wf(e), i = r.length;
10557
- if (wf(t).length !== i) return !1;
10558
- for (; i-- > 0;) if (!Bf(e, t, n, r[i])) return !1;
10559
- return !0;
10560
- }
10561
- function Pf(e, t, n) {
10562
- let r = _f(e), i = r.length;
10563
- if (_f(t).length !== i) return !1;
10564
- let a, o, s;
10565
- for (; i-- > 0;) if (a = r[i], !Bf(e, t, n, a) || (o = Cf(e, a), s = Cf(t, a), (o || s) && (!o || !s || o.configurable !== s.configurable || o.enumerable !== s.enumerable || o.writable !== s.writable))) return !1;
10566
- return !0;
10567
- }
10568
- function Ff(e, t) {
10569
- return yf(e.valueOf(), t.valueOf());
10551
+ }), mf = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, hf = J.create({
10552
+ name: "image",
10553
+ addOptions() {
10554
+ return {
10555
+ inline: !1,
10556
+ allowBase64: !1,
10557
+ HTMLAttributes: {},
10558
+ resize: !1
10559
+ };
10560
+ },
10561
+ inline() {
10562
+ return this.options.inline;
10563
+ },
10564
+ group() {
10565
+ return this.options.inline ? "inline" : "block";
10566
+ },
10567
+ draggable: !0,
10568
+ addAttributes() {
10569
+ return {
10570
+ src: { default: null },
10571
+ alt: { default: null },
10572
+ title: { default: null },
10573
+ width: { default: null },
10574
+ height: { default: null }
10575
+ };
10576
+ },
10577
+ parseHTML() {
10578
+ return [{ tag: this.options.allowBase64 ? "img[src]" : "img[src]:not([src^=\"data:\"])" }];
10579
+ },
10580
+ renderHTML({ HTMLAttributes: e }) {
10581
+ return ["img", K(this.options.HTMLAttributes, e)];
10582
+ },
10583
+ parseMarkdown: (e, t) => t.createNode("image", {
10584
+ src: e.href,
10585
+ title: e.title,
10586
+ alt: e.text
10587
+ }),
10588
+ renderMarkdown: (e) => {
10589
+ let t = e.attrs?.src ?? "", n = e.attrs?.alt ?? "", r = e.attrs?.title ?? "";
10590
+ return r ? `![${n}](${t} "${r}")` : `![${n}](${t})`;
10591
+ },
10592
+ addNodeView() {
10593
+ if (!this.options.resize || !this.options.resize.enabled || typeof document > "u") return null;
10594
+ let { directions: e, minWidth: t, minHeight: n, alwaysPreserveAspectRatio: r } = this.options.resize;
10595
+ return ({ node: i, getPos: a, HTMLAttributes: o, editor: s }) => {
10596
+ let c = document.createElement("img");
10597
+ Object.entries(o).forEach(([e, t]) => {
10598
+ if (t != null) switch (e) {
10599
+ case "width":
10600
+ case "height": break;
10601
+ default:
10602
+ c.setAttribute(e, t);
10603
+ break;
10604
+ }
10605
+ }), c.src = o.src;
10606
+ let l = new Kd({
10607
+ element: c,
10608
+ editor: s,
10609
+ node: i,
10610
+ getPos: a,
10611
+ onResize: (e, t) => {
10612
+ c.style.width = `${e}px`, c.style.height = `${t}px`;
10613
+ },
10614
+ onCommit: (e, t) => {
10615
+ let n = a();
10616
+ n !== void 0 && this.editor.chain().setNodeSelection(n).updateAttributes(this.name, {
10617
+ width: e,
10618
+ height: t
10619
+ }).run();
10620
+ },
10621
+ onUpdate: (e, t, n) => e.type === i.type,
10622
+ options: {
10623
+ directions: e,
10624
+ min: {
10625
+ width: t,
10626
+ height: n
10627
+ },
10628
+ preserveAspectRatio: r === !0
10629
+ }
10630
+ }), u = l.dom;
10631
+ return u.style.visibility = "hidden", u.style.pointerEvents = "none", c.onload = () => {
10632
+ u.style.visibility = "", u.style.pointerEvents = "";
10633
+ }, l;
10634
+ };
10635
+ },
10636
+ addCommands() {
10637
+ return { setImage: (e) => ({ commands: t }) => t.insertContent({
10638
+ type: this.name,
10639
+ attrs: e
10640
+ }) };
10641
+ },
10642
+ addInputRules() {
10643
+ return [Hd({
10644
+ find: mf,
10645
+ type: this.type,
10646
+ getAttributes: (e) => {
10647
+ let [, , t, n, r] = e;
10648
+ return {
10649
+ src: n,
10650
+ alt: t,
10651
+ title: r
10652
+ };
10653
+ }
10654
+ })];
10655
+ }
10656
+ });
10657
+ //#endregion
10658
+ //#region ../../node_modules/.pnpm/@tiptap+suggestion@3.22.5_@tiptap+core@3.22.5_@tiptap+pm@3.22.5__@tiptap+pm@3.22.5/node_modules/@tiptap/suggestion/dist/index.js
10659
+ function gf(e) {
10660
+ let { char: t, allowSpaces: n, allowToIncludeChar: r, allowedPrefixes: i, startOfLine: a, $position: o } = e, s = n && !r, c = Jd(t), l = RegExp(`\\s${c}$`), u = a ? "^" : "", d = r ? "" : c, f = RegExp(s ? `${u}${c}.*?(?=\\s${d}|$)` : `${u}(?:^)?${c}[^\\s${d}]*`, "gm"), p = o.nodeBefore?.isText && o.nodeBefore.text;
10661
+ if (!p) return null;
10662
+ let m = o.pos - p.length, h = Array.from(p.matchAll(f)).pop();
10663
+ if (!h || h.input === void 0 || h.index === void 0) return null;
10664
+ let g = h.input.slice(Math.max(0, h.index - 1), h.index), _ = RegExp(`^[${i?.join("")}\0]?$`).test(g);
10665
+ if (i !== null && !_) return null;
10666
+ let v = m + h.index, y = v + h[0].length;
10667
+ return s && l.test(p.slice(y - 1, y + 1)) && (h[0] += " ", y += 1), v < o.pos && y >= o.pos ? {
10668
+ range: {
10669
+ from: v,
10670
+ to: y
10671
+ },
10672
+ query: h[0].slice(t.length),
10673
+ text: h[0]
10674
+ } : null;
10570
10675
  }
10571
- function If(e, t) {
10572
- return e.source === t.source && e.flags === t.flags;
10676
+ function _f(e) {
10677
+ return e.docChanged ? e.steps.some((e) => {
10678
+ let t = e.slice;
10679
+ if (!t?.content) return !1;
10680
+ let n = t.content.textBetween(0, t.content.size, "\n");
10681
+ return /\s/.test(n);
10682
+ }) : !1;
10573
10683
  }
10574
- function Lf(e, t, n) {
10575
- let r = e.size;
10576
- if (r !== t.size) return !1;
10577
- if (!r) return !0;
10578
- let i = Array(r), a = e.values(), o, s;
10579
- for (; (o = a.next()) && !o.done;) {
10580
- let r = t.values(), a = !1, c = 0;
10581
- for (; (s = r.next()) && !s.done;) {
10582
- if (!i[c] && n.equals(o.value, s.value, o.value, s.value, e, t, n)) {
10583
- a = i[c] = !0;
10584
- break;
10585
- }
10586
- c++;
10684
+ var vf = new P("suggestion");
10685
+ function yf({ pluginKey: e = vf, editor: t, char: n = "@", allowSpaces: r = !1, allowToIncludeChar: i = !1, allowedPrefixes: a = [" "], startOfLine: o = !1, decorationTag: s = "span", decorationClass: c = "suggestion", decorationContent: l = "", decorationEmptyClass: u = "is-empty", command: d = () => null, items: f = () => [], render: p = () => ({}), allow: m = () => !0, findSuggestionMatch: h = gf, shouldShow: g, shouldResetDismissed: _ }) {
10686
+ let v, y = p?.(), b = r && !i, x = () => {
10687
+ let e = t.state.selection.$anchor.pos, { top: n, right: r, bottom: i, left: a } = t.view.coordsAtPos(e);
10688
+ try {
10689
+ return new DOMRect(a, n, r - a, i - n);
10690
+ } catch {
10691
+ return null;
10587
10692
  }
10588
- if (!a) return !1;
10693
+ }, S = (n, r) => r ? () => {
10694
+ let r = e.getState(t.state)?.decorationId;
10695
+ return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect() || null;
10696
+ } : x, ee = ({ match: e, dismissedRange: n, state: r, transaction: i }) => _?.({
10697
+ editor: t,
10698
+ state: r,
10699
+ range: n,
10700
+ match: e,
10701
+ transaction: i,
10702
+ allowSpaces: b
10703
+ }) ? !1 : b ? e.range.from === n.from : e.range.from === n.from && !_f(i);
10704
+ function C(n, r) {
10705
+ var i;
10706
+ try {
10707
+ let r = e.getState(n.state), a = r?.decorationId ? n.dom.querySelector(`[data-decoration-id="${r.decorationId}"]`) : null, o = {
10708
+ editor: t,
10709
+ range: r?.range || {
10710
+ from: 0,
10711
+ to: 0
10712
+ },
10713
+ query: r?.query || null,
10714
+ text: r?.text || null,
10715
+ items: [],
10716
+ command: (e) => d({
10717
+ editor: t,
10718
+ range: r?.range || {
10719
+ from: 0,
10720
+ to: 0
10721
+ },
10722
+ props: e
10723
+ }),
10724
+ decorationNode: a,
10725
+ clientRect: S(n, a)
10726
+ };
10727
+ (i = y?.onExit) == null || i.call(y, o);
10728
+ } catch {}
10729
+ let a = n.state.tr.setMeta(r, { exit: !0 });
10730
+ n.dispatch(a);
10589
10731
  }
10590
- return !0;
10591
- }
10592
- function Rf(e, t) {
10593
- let n = e.byteLength;
10594
- if (t.byteLength !== n || e.byteOffset !== t.byteOffset) return !1;
10595
- for (; n-- > 0;) if (e[n] !== t[n]) return !1;
10596
- return !0;
10597
- }
10598
- function zf(e, t) {
10599
- return e.hostname === t.hostname && e.pathname === t.pathname && e.protocol === t.protocol && e.port === t.port && e.hash === t.hash && e.username === t.username && e.password === t.password;
10600
- }
10601
- function Bf(e, t, n, r) {
10602
- return (r === Sf || r === xf || r === bf) && (e.$$typeof || t.$$typeof) ? !0 : vf(t, r) && n.equals(e[r], t[r], r, r, e, t, n);
10603
- }
10604
- var Vf = "[object ArrayBuffer]", Hf = "[object Arguments]", Uf = "[object Boolean]", Wf = "[object DataView]", Gf = "[object Date]", Kf = "[object Error]", qf = "[object Map]", Jf = "[object Number]", Yf = "[object Object]", Xf = "[object RegExp]", Zf = "[object Set]", Qf = "[object String]", $f = {
10605
- "[object Int8Array]": !0,
10606
- "[object Uint8Array]": !0,
10607
- "[object Uint8ClampedArray]": !0,
10608
- "[object Int16Array]": !0,
10609
- "[object Uint16Array]": !0,
10610
- "[object Int32Array]": !0,
10611
- "[object Uint32Array]": !0,
10612
- "[object Float16Array]": !0,
10613
- "[object Float32Array]": !0,
10614
- "[object Float64Array]": !0,
10615
- "[object BigInt64Array]": !0,
10616
- "[object BigUint64Array]": !0
10617
- }, ep = "[object URL]", tp = Object.prototype.toString;
10618
- function np({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n, areDatesEqual: r, areErrorsEqual: i, areFunctionsEqual: a, areMapsEqual: o, areNumbersEqual: s, areObjectsEqual: c, arePrimitiveWrappersEqual: l, areRegExpsEqual: u, areSetsEqual: d, areTypedArraysEqual: f, areUrlsEqual: p, unknownTagComparators: m }) {
10619
- return function(h, g, _) {
10620
- if (h === g) return !0;
10621
- if (h == null || g == null) return !1;
10622
- let v = typeof h;
10623
- if (v !== typeof g) return !1;
10624
- if (v !== "object") return v === "number" ? s(h, g, _) : v === "function" ? a(h, g, _) : !1;
10625
- let y = h.constructor;
10626
- if (y !== g.constructor) return !1;
10627
- if (y === Object) return c(h, g, _);
10628
- if (Array.isArray(h)) return t(h, g, _);
10629
- if (y === Date) return r(h, g, _);
10630
- if (y === RegExp) return u(h, g, _);
10631
- if (y === Map) return o(h, g, _);
10632
- if (y === Set) return d(h, g, _);
10633
- let b = tp.call(h);
10634
- if (b === Gf) return r(h, g, _);
10635
- if (b === Xf) return u(h, g, _);
10636
- if (b === qf) return o(h, g, _);
10637
- if (b === Zf) return d(h, g, _);
10638
- if (b === Yf) return typeof h.then != "function" && typeof g.then != "function" && c(h, g, _);
10639
- if (b === ep) return p(h, g, _);
10640
- if (b === Kf) return i(h, g, _);
10641
- if (b === Hf) return c(h, g, _);
10642
- if ($f[b]) return f(h, g, _);
10643
- if (b === Vf) return e(h, g, _);
10644
- if (b === Wf) return n(h, g, _);
10645
- if (b === Uf || b === Jf || b === Qf) return l(h, g, _);
10646
- if (m) {
10647
- let e = m[b];
10648
- if (!e) {
10649
- let t = gf(h);
10650
- t && (e = m[t]);
10732
+ let te = new N({
10733
+ key: e,
10734
+ view() {
10735
+ return {
10736
+ update: async (e, n) => {
10737
+ var r, i, a, o, s;
10738
+ let c = this.key?.getState(n), l = this.key?.getState(e.state), u = c.active && l.active && c.range.from !== l.range.from, p = !c.active && l.active, m = c.active && !l.active, h = !p && !m && c.query !== l.query, g = p || u && h, _ = h || u, b = m || u && h;
10739
+ if (!g && !_ && !b) return;
10740
+ let x = b && !g ? c : l, ee = e.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);
10741
+ v = {
10742
+ editor: t,
10743
+ range: x.range,
10744
+ query: x.query,
10745
+ text: x.text,
10746
+ items: [],
10747
+ command: (e) => d({
10748
+ editor: t,
10749
+ range: x.range,
10750
+ props: e
10751
+ }),
10752
+ decorationNode: ee,
10753
+ clientRect: S(e, ee)
10754
+ }, g && ((r = y?.onBeforeStart) == null || r.call(y, v)), _ && ((i = y?.onBeforeUpdate) == null || i.call(y, v)), (_ || g) && (v.items = await f({
10755
+ editor: t,
10756
+ query: x.query
10757
+ })), b && ((a = y?.onExit) == null || a.call(y, v)), _ && ((o = y?.onUpdate) == null || o.call(y, v)), g && ((s = y?.onStart) == null || s.call(y, v));
10758
+ },
10759
+ destroy: () => {
10760
+ var e;
10761
+ v && ((e = y?.onExit) == null || e.call(y, v));
10762
+ }
10763
+ };
10764
+ },
10765
+ state: {
10766
+ init() {
10767
+ return {
10768
+ active: !1,
10769
+ range: {
10770
+ from: 0,
10771
+ to: 0
10772
+ },
10773
+ query: null,
10774
+ text: null,
10775
+ composing: !1,
10776
+ dismissedRange: null
10777
+ };
10778
+ },
10779
+ apply(s, c, l, u) {
10780
+ let { isEditable: d } = t, { composing: f } = t.view, { selection: p } = s, { empty: _, from: v } = p, y = { ...c }, b = s.getMeta(e);
10781
+ if (b && b.exit) return y.active = !1, y.decorationId = null, y.range = {
10782
+ from: 0,
10783
+ to: 0
10784
+ }, y.query = null, y.text = null, y.dismissedRange = c.active ? { ...c.range } : c.dismissedRange, y;
10785
+ if (y.composing = f, s.docChanged && y.dismissedRange !== null && (y.dismissedRange = {
10786
+ from: s.mapping.map(y.dismissedRange.from),
10787
+ to: s.mapping.map(y.dismissedRange.to)
10788
+ }), d && (_ || t.view.composing)) {
10789
+ (v < c.range.from || v > c.range.to) && !f && !c.composing && (y.active = !1);
10790
+ let e = h({
10791
+ char: n,
10792
+ allowSpaces: r,
10793
+ allowToIncludeChar: i,
10794
+ allowedPrefixes: a,
10795
+ startOfLine: o,
10796
+ $position: p.$from
10797
+ }), l = `id_${Math.floor(Math.random() * 4294967295)}`;
10798
+ e && m({
10799
+ editor: t,
10800
+ state: u,
10801
+ range: e.range,
10802
+ isActive: c.active
10803
+ }) && (!g || g({
10804
+ editor: t,
10805
+ range: e.range,
10806
+ query: e.query,
10807
+ text: e.text,
10808
+ transaction: s
10809
+ })) ? (y.dismissedRange !== null && !ee({
10810
+ match: e,
10811
+ dismissedRange: y.dismissedRange,
10812
+ state: u,
10813
+ transaction: s
10814
+ }) && (y.dismissedRange = null), y.dismissedRange === null ? (y.active = !0, y.decorationId = c.decorationId ? c.decorationId : l, y.range = e.range, y.query = e.query, y.text = e.text) : y.active = !1) : (e || (y.dismissedRange = null), y.active = !1);
10815
+ } else y.active = !1;
10816
+ return y.active || (y.decorationId = null, y.range = {
10817
+ from: 0,
10818
+ to: 0
10819
+ }, y.query = null, y.text = null), y;
10820
+ }
10821
+ },
10822
+ props: {
10823
+ handleKeyDown(t, n) {
10824
+ var r;
10825
+ let { active: i, range: a } = te.getState(t.state);
10826
+ if (!i) return !1;
10827
+ if (n.key === "Escape" || n.key === "Esc") {
10828
+ let i = te.getState(t.state);
10829
+ return (r = y?.onKeyDown) == null || r.call(y, {
10830
+ view: t,
10831
+ event: n,
10832
+ range: i.range
10833
+ }), C(t, e), !0;
10834
+ }
10835
+ return (y?.onKeyDown)?.call(y, {
10836
+ view: t,
10837
+ event: n,
10838
+ range: a
10839
+ }) || !1;
10840
+ },
10841
+ decorations(e) {
10842
+ let { active: t, range: n, decorationId: r, query: i } = te.getState(e);
10843
+ if (!t) return null;
10844
+ let a = !i?.length, o = [c];
10845
+ return a && o.push(u), B.create(e.doc, [Es.inline(n.from, n.to, {
10846
+ nodeName: s,
10847
+ class: o.join(" "),
10848
+ "data-decoration-id": r,
10849
+ "data-decoration-content": l
10850
+ })]);
10651
10851
  }
10652
- if (e) return e(h, g, _);
10653
10852
  }
10654
- return !1;
10655
- };
10656
- }
10657
- function rp({ circular: e, createCustomConfig: t, strict: n }) {
10658
- let r = {
10659
- areArrayBuffersEqual: Tf,
10660
- areArraysEqual: n ? Pf : Ef,
10661
- areDataViewsEqual: Df,
10662
- areDatesEqual: Of,
10663
- areErrorsEqual: kf,
10664
- areFunctionsEqual: Af,
10665
- areMapsEqual: n ? mf(jf, Pf) : jf,
10666
- areNumbersEqual: Mf,
10667
- areObjectsEqual: n ? Pf : Nf,
10668
- arePrimitiveWrappersEqual: Ff,
10669
- areRegExpsEqual: If,
10670
- areSetsEqual: n ? mf(Lf, Pf) : Lf,
10671
- areTypedArraysEqual: n ? mf(Rf, Pf) : Rf,
10672
- areUrlsEqual: zf,
10673
- unknownTagComparators: void 0
10674
- };
10675
- if (t && (r = Object.assign({}, r, t(r))), e) {
10676
- let e = hf(r.areArraysEqual), t = hf(r.areMapsEqual), n = hf(r.areObjectsEqual), i = hf(r.areSetsEqual);
10677
- r = Object.assign({}, r, {
10678
- areArraysEqual: e,
10679
- areMapsEqual: t,
10680
- areObjectsEqual: n,
10681
- areSetsEqual: i
10682
- });
10683
- }
10684
- return r;
10685
- }
10686
- function ip(e) {
10687
- return function(t, n, r, i, a, o, s) {
10688
- return e(t, n, s);
10689
- };
10690
- }
10691
- function ap({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
10692
- if (n) return function(a, o) {
10693
- let { cache: s = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: c } = n();
10694
- return t(a, o, {
10695
- cache: s,
10696
- equals: r,
10697
- meta: c,
10698
- strict: i
10699
- });
10700
- };
10701
- if (e) return function(e, n) {
10702
- return t(e, n, {
10703
- cache: /* @__PURE__ */ new WeakMap(),
10704
- equals: r,
10705
- meta: void 0,
10706
- strict: i
10707
- });
10708
- };
10709
- let a = {
10710
- cache: void 0,
10711
- equals: r,
10712
- meta: void 0,
10713
- strict: i
10714
- };
10715
- return function(e, n) {
10716
- return t(e, n, a);
10717
- };
10718
- }
10719
- var op = sp();
10720
- sp({ strict: !0 }), sp({ circular: !0 }), sp({
10721
- circular: !0,
10722
- strict: !0
10723
- }), sp({ createInternalComparator: () => yf }), sp({
10724
- strict: !0,
10725
- createInternalComparator: () => yf
10726
- }), sp({
10727
- circular: !0,
10728
- createInternalComparator: () => yf
10729
- }), sp({
10730
- circular: !0,
10731
- createInternalComparator: () => yf,
10732
- strict: !0
10733
- });
10734
- function sp(e = {}) {
10735
- let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = np(rp(e));
10736
- return ap({
10737
- circular: t,
10738
- comparator: a,
10739
- createState: r,
10740
- equals: n ? n(a) : ip(a),
10741
- strict: i
10742
10853
  });
10854
+ return te;
10743
10855
  }
10856
+ var bf = yf;
10744
10857
  //#endregion
10745
- //#region ../../node_modules/.pnpm/@tiptap+react@3.22.5_@floating-ui+dom@1.7.6_@tiptap+core@3.22.5_@tiptap+pm@3.22.5__@tip_412b5dd72844165b28cdb59267386b00/node_modules/@tiptap/react/dist/index.js
10746
- var cp = (...e) => (t) => {
10747
- e.forEach((e) => {
10748
- typeof e == "function" ? e(t) : e && (e.current = t);
10749
- });
10750
- }, lp = ({ contentComponent: e }) => {
10751
- let t = ae(e.subscribe, e.getSnapshot, e.getServerSnapshot);
10752
- return /* @__PURE__ */ C(ee, { children: Object.values(t) });
10753
- };
10754
- function up() {
10755
- let e = /* @__PURE__ */ new Set(), t = {};
10858
+ //#region ../../node_modules/.pnpm/@tiptap+extension-mention@3.22.5_@tiptap+core@3.22.5_@tiptap+pm@3.22.5__@tiptap+pm@3.22_ae7a1836036be3f01f61ed6915cb0f6e/node_modules/@tiptap/extension-mention/dist/index.js
10859
+ function xf({ editor: e, overrideSuggestionOptions: t, extensionName: n, char: r = "@" }) {
10756
10860
  return {
10757
- subscribe(t) {
10758
- return e.add(t), () => {
10759
- e.delete(t);
10760
- };
10761
- },
10762
- getSnapshot() {
10763
- return t;
10764
- },
10765
- getServerSnapshot() {
10766
- return t;
10861
+ editor: e,
10862
+ char: r,
10863
+ pluginKey: new P(),
10864
+ command: ({ editor: e, range: t, props: i }) => {
10865
+ var a;
10866
+ (e.view.state.selection.$to.nodeAfter?.text)?.startsWith(" ") && (t.to += 1), e.chain().focus().insertContentAt(t, [{
10867
+ type: n,
10868
+ attrs: {
10869
+ ...i,
10870
+ mentionSuggestionChar: r
10871
+ }
10872
+ }, {
10873
+ type: "text",
10874
+ text: " "
10875
+ }]).run(), (a = e.view.dom.ownerDocument.defaultView?.getSelection()) == null || a.collapseToEnd();
10767
10876
  },
10768
- setRenderer(n, r) {
10769
- t = {
10770
- ...t,
10771
- [n]: ne.createPortal(r.reactElement, r.element, n)
10772
- }, e.forEach((e) => e());
10877
+ allow: ({ state: e, range: t }) => {
10878
+ let r = e.doc.resolve(t.from), i = e.schema.nodes[n];
10879
+ return !!r.parent.type.contentMatch.matchType(i);
10773
10880
  },
10774
- removeRenderer(n) {
10775
- let r = { ...t };
10776
- delete r[n], t = r, e.forEach((e) => e());
10777
- }
10881
+ ...t
10778
10882
  };
10779
10883
  }
10780
- var dp = class extends l.Component {
10781
- constructor(e) {
10782
- super(e), this.editorContentRef = l.createRef();
10783
- }
10784
- componentDidMount() {
10785
- this.init();
10786
- }
10787
- componentDidUpdate() {
10788
- this.init();
10789
- }
10790
- init() {
10791
- let e = this.props.editor;
10792
- if (e && !e.isDestroyed && e.view.dom?.parentNode) {
10793
- if (e.contentComponent) return;
10794
- let t = this.editorContentRef.current;
10795
- t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = up(), e.createNodeViews(), e.isEditorContentInitialized = !0, this.forceUpdate();
10796
- }
10797
- }
10798
- componentWillUnmount() {
10799
- let e = this.props.editor;
10800
- if (e) {
10801
- e.isEditorContentInitialized = !1, e.isDestroyed || e.view.setProps({ nodeViews: {} }), e.contentComponent = null;
10802
- try {
10803
- if (!e.view.dom?.parentNode) return;
10804
- let t = document.createElement("div");
10805
- t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t });
10806
- } catch {}
10807
- }
10808
- }
10809
- render() {
10810
- let { editor: e, innerRef: t, ...n } = this.props;
10811
- return /* @__PURE__ */ te(ee, { children: [/* @__PURE__ */ C("div", {
10812
- ref: cp(t, this.editorContentRef),
10813
- ...n
10814
- }), e?.contentComponent && /* @__PURE__ */ C(lp, { contentComponent: e.contentComponent })] });
10815
- }
10816
- }, fp = p((e, t) => {
10817
- let n = l.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
10818
- return l.createElement(dp, {
10819
- key: n,
10820
- innerRef: t,
10821
- ...e
10822
- });
10823
- }), pp = l.memo(fp), mp = typeof window < "u" ? v : _, hp = class {
10824
- constructor(e) {
10825
- this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = {
10826
- editor: e,
10827
- transactionNumber: 0
10828
- }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
10829
- }
10830
- getSnapshot() {
10831
- return this.transactionNumber === this.lastTransactionNumber ? this.lastSnapshot : (this.lastTransactionNumber = this.transactionNumber, this.lastSnapshot = {
10832
- editor: this.editor,
10833
- transactionNumber: this.transactionNumber
10834
- }, this.lastSnapshot);
10835
- }
10836
- getServerSnapshot() {
10837
- return {
10838
- editor: null,
10839
- transactionNumber: 0
10840
- };
10841
- }
10842
- subscribe(e) {
10843
- return this.subscribers.add(e), () => {
10844
- this.subscribers.delete(e);
10845
- };
10846
- }
10847
- watch(e) {
10848
- if (this.editor = e, this.editor) {
10849
- let e = () => {
10850
- this.transactionNumber += 1, this.subscribers.forEach((e) => e());
10851
- }, t = this.editor;
10852
- return t.on("transaction", e), () => {
10853
- t.off("transaction", e);
10854
- };
10855
- }
10856
- }
10857
- };
10858
- function gp(e) {
10859
- let [t] = x(() => new hp(e.editor)), n = oe(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? op);
10860
- return mp(() => t.watch(e.editor), [e.editor, t]), g(n), n;
10884
+ function Sf(e) {
10885
+ return (e.options.suggestions.length ? e.options.suggestions : [e.options.suggestion]).map((t) => xf({
10886
+ editor: e.editor,
10887
+ overrideSuggestionOptions: t,
10888
+ extensionName: e.name,
10889
+ char: t.char
10890
+ }));
10861
10891
  }
10862
- var _p = process.env.NODE_ENV !== "production", vp = typeof window > "u", yp = vp || !!(typeof window < "u" && window.next), bp = class e {
10863
- constructor(e) {
10864
- this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
10865
- }
10866
- setEditor(e) {
10867
- this.editor = e, this.instanceId = Math.random().toString(36).slice(2, 9), this.subscriptions.forEach((e) => e());
10868
- }
10869
- getInitialEditor() {
10870
- if (this.options.current.immediatelyRender === void 0) {
10871
- if (vp || yp) {
10872
- if (_p) throw Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");
10873
- return null;
10874
- }
10875
- return this.createEditor();
10876
- }
10877
- if (this.options.current.immediatelyRender && vp && _p) throw Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");
10878
- return this.options.current.immediatelyRender ? this.createEditor() : null;
10879
- }
10880
- createEditor() {
10881
- return new Bd({
10882
- ...this.options.current,
10883
- onBeforeCreate: (...e) => {
10884
- var t;
10885
- return (t = this.options.current).onBeforeCreate?.call(t, ...e);
10886
- },
10887
- onBlur: (...e) => {
10888
- var t;
10889
- return (t = this.options.current).onBlur?.call(t, ...e);
10890
- },
10891
- onCreate: (...e) => {
10892
- var t;
10893
- return (t = this.options.current).onCreate?.call(t, ...e);
10894
- },
10895
- onDestroy: (...e) => {
10896
- var t;
10897
- return (t = this.options.current).onDestroy?.call(t, ...e);
10898
- },
10899
- onFocus: (...e) => {
10900
- var t;
10901
- return (t = this.options.current).onFocus?.call(t, ...e);
10902
- },
10903
- onSelectionUpdate: (...e) => {
10904
- var t;
10905
- return (t = this.options.current).onSelectionUpdate?.call(t, ...e);
10906
- },
10907
- onTransaction: (...e) => {
10908
- var t;
10909
- return (t = this.options.current).onTransaction?.call(t, ...e);
10910
- },
10911
- onUpdate: (...e) => {
10912
- var t;
10913
- return (t = this.options.current).onUpdate?.call(t, ...e);
10892
+ function Cf(e, t) {
10893
+ let n = Sf(e);
10894
+ return n.find((e) => e.char === t) || (n.length ? n[0] : null);
10895
+ }
10896
+ var wf = J.create({
10897
+ name: "mention",
10898
+ priority: 101,
10899
+ addOptions() {
10900
+ return {
10901
+ HTMLAttributes: {},
10902
+ renderText({ node: e, suggestion: t }) {
10903
+ return `${t?.char ?? "@"}${e.attrs.label ?? e.attrs.id}`;
10914
10904
  },
10915
- onContentError: (...e) => {
10916
- var t;
10917
- return (t = this.options.current).onContentError?.call(t, ...e);
10905
+ deleteTriggerWithBackspace: !1,
10906
+ renderHTML({ options: e, node: t, suggestion: n }) {
10907
+ return [
10908
+ "span",
10909
+ K(this.HTMLAttributes, e.HTMLAttributes),
10910
+ `${n?.char ?? "@"}${t.attrs.label ?? t.attrs.id}`
10911
+ ];
10918
10912
  },
10919
- onDrop: (...e) => {
10920
- var t;
10921
- return (t = this.options.current).onDrop?.call(t, ...e);
10913
+ suggestions: [],
10914
+ suggestion: {}
10915
+ };
10916
+ },
10917
+ group: "inline",
10918
+ inline: !0,
10919
+ selectable: !1,
10920
+ atom: !0,
10921
+ addAttributes() {
10922
+ return {
10923
+ id: {
10924
+ default: null,
10925
+ parseHTML: (e) => e.getAttribute("data-id"),
10926
+ renderHTML: (e) => e.id ? { "data-id": e.id } : {}
10922
10927
  },
10923
- onPaste: (...e) => {
10924
- var t;
10925
- return (t = this.options.current).onPaste?.call(t, ...e);
10928
+ label: {
10929
+ default: null,
10930
+ parseHTML: (e) => e.getAttribute("data-label"),
10931
+ renderHTML: (e) => e.label ? { "data-label": e.label } : {}
10926
10932
  },
10927
- onDelete: (...e) => {
10928
- var t;
10929
- return (t = this.options.current).onDelete?.call(t, ...e);
10933
+ mentionSuggestionChar: {
10934
+ default: "@",
10935
+ parseHTML: (e) => e.getAttribute("data-mention-suggestion-char"),
10936
+ renderHTML: (e) => ({ "data-mention-suggestion-char": e.mentionSuggestionChar })
10930
10937
  }
10931
- });
10932
- }
10933
- getEditor() {
10934
- return this.editor;
10935
- }
10936
- getServerSnapshot() {
10937
- return null;
10938
- }
10939
- subscribe(e) {
10940
- return this.subscriptions.add(e), () => {
10941
- this.subscriptions.delete(e);
10942
10938
  };
10943
- }
10944
- static compareOptions(e, t) {
10945
- return Object.keys(e).every((n) => [
10946
- "onCreate",
10947
- "onBeforeCreate",
10948
- "onDestroy",
10949
- "onUpdate",
10950
- "onTransaction",
10951
- "onFocus",
10952
- "onBlur",
10953
- "onSelectionUpdate",
10954
- "onContentError",
10955
- "onDrop",
10956
- "onPaste"
10957
- ].includes(n) ? !0 : n === "extensions" && e.extensions && t.extensions ? e.extensions.length === t.extensions.length ? e.extensions.every((e, n) => e === t.extensions?.[n]) : !1 : e[n] === t[n]);
10958
- }
10959
- onRender(t) {
10960
- return () => (this.isComponentMounted = !0, clearTimeout(this.scheduledDestructionTimeout), this.editor && !this.editor.isDestroyed && t.length === 0 ? e.compareOptions(this.options.current, this.editor.options) || this.editor.setOptions({
10961
- ...this.options.current,
10962
- editable: this.editor.isEditable
10963
- }) : this.refreshEditorInstance(t), () => {
10964
- this.isComponentMounted = !1, this.scheduleDestroy();
10939
+ },
10940
+ parseHTML() {
10941
+ return [{ tag: `span[data-type="${this.name}"]` }];
10942
+ },
10943
+ renderHTML({ node: e, HTMLAttributes: t }) {
10944
+ let n = Cf(this, e.attrs.mentionSuggestionChar);
10945
+ if (this.options.renderLabel !== void 0) return console.warn("renderLabel is deprecated use renderText and renderHTML instead"), [
10946
+ "span",
10947
+ K({ "data-type": this.name }, this.options.HTMLAttributes, t),
10948
+ this.options.renderLabel({
10949
+ options: this.options,
10950
+ node: e,
10951
+ suggestion: n
10952
+ })
10953
+ ];
10954
+ let r = { ...this.options };
10955
+ r.HTMLAttributes = K({ "data-type": this.name }, this.options.HTMLAttributes, t);
10956
+ let i = this.options.renderHTML({
10957
+ options: r,
10958
+ node: e,
10959
+ suggestion: n
10965
10960
  });
10966
- }
10967
- refreshEditorInstance(e) {
10968
- if (this.editor && !this.editor.isDestroyed) {
10969
- if (this.previousDeps === null) {
10970
- this.previousDeps = e;
10971
- return;
10961
+ return typeof i == "string" ? [
10962
+ "span",
10963
+ K({ "data-type": this.name }, this.options.HTMLAttributes, t),
10964
+ i
10965
+ ] : i;
10966
+ },
10967
+ ...tf({
10968
+ nodeName: "mention",
10969
+ name: "@",
10970
+ selfClosing: !0,
10971
+ allowedAttributes: [
10972
+ "id",
10973
+ "label",
10974
+ {
10975
+ name: "mentionSuggestionChar",
10976
+ skipIfDefault: "@"
10972
10977
  }
10973
- if (this.previousDeps.length === e.length && this.previousDeps.every((t, n) => t === e[n])) return;
10974
- }
10975
- this.editor && !this.editor.isDestroyed && this.editor.destroy(), this.setEditor(this.createEditor()), this.previousDeps = e;
10976
- }
10977
- scheduleDestroy() {
10978
- let e = this.instanceId, t = this.editor;
10979
- this.scheduledDestructionTimeout = setTimeout(() => {
10980
- if (this.isComponentMounted && this.instanceId === e) {
10981
- t && t.setOptions(this.options.current);
10982
- return;
10978
+ ],
10979
+ parseAttributes: (e) => {
10980
+ let t = {}, n = /(\w+)=(?:"([^"]*)"|'([^']*)')/g, r = n.exec(e);
10981
+ for (; r !== null;) {
10982
+ let [, i, a, o] = r;
10983
+ t[i === "char" ? "mentionSuggestionChar" : i] = a ?? o, r = n.exec(e);
10983
10984
  }
10984
- t && !t.isDestroyed && (t.destroy(), this.instanceId === e && this.setEditor(null));
10985
- }, 1);
10985
+ return t;
10986
+ },
10987
+ serializeAttributes: (e) => Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => `${e === "mentionSuggestionChar" ? "char" : e}="${t}"`).join(" ")
10988
+ }),
10989
+ renderText({ node: e }) {
10990
+ let t = {
10991
+ options: this.options,
10992
+ node: e,
10993
+ suggestion: Cf(this, e.attrs.mentionSuggestionChar)
10994
+ };
10995
+ return this.options.renderLabel === void 0 ? this.options.renderText(t) : (console.warn("renderLabel is deprecated use renderText and renderHTML instead"), this.options.renderLabel(t));
10996
+ },
10997
+ addKeyboardShortcuts() {
10998
+ return { Backspace: () => this.editor.commands.command(({ tr: e, state: t }) => {
10999
+ let n = !1, { selection: r } = t, { empty: i, anchor: a } = r;
11000
+ if (!i) return !1;
11001
+ let o = new je(), s = 0;
11002
+ return t.doc.nodesBetween(a - 1, a, (e, t) => {
11003
+ if (e.type.name === this.name) return n = !0, o = e, s = t, !1;
11004
+ }), n && e.insertText(this.options.deleteTriggerWithBackspace ? "" : o.attrs.mentionSuggestionChar, s, s + o.nodeSize), n;
11005
+ }) };
11006
+ },
11007
+ addProseMirrorPlugins() {
11008
+ return Sf(this).map(yf);
10986
11009
  }
10987
- };
10988
- function xp(e = {}, t = []) {
10989
- let n = b(e);
10990
- n.current = e;
10991
- let [r] = x(() => new bp(n)), i = ae(r.subscribe, r.getEditor, r.getServerSnapshot);
10992
- return g(i), _(r.onRender(t)), gp({
10993
- editor: i,
10994
- selector: ({ transactionNumber: t }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && t === 0 ? 0 : t + 1
10995
- }), i;
10996
- }
10997
- var Sp = u({ editor: null });
10998
- Sp.Consumer;
10999
- var Cp = () => h(Sp), wp = u({
11000
- onDragStart: () => {},
11001
- nodeViewContentChildren: void 0,
11002
- nodeViewContentRef: () => {}
11003
- }), Tp = () => h(wp), Ep = l.forwardRef((e, t) => {
11004
- let { onDragStart: n } = Tp();
11005
- return /* @__PURE__ */ C(e.as || "div", {
11006
- ...e,
11007
- ref: t,
11008
- "data-node-view-wrapper": "",
11009
- onDragStart: n,
11010
- style: {
11011
- whiteSpace: "normal",
11012
- ...e.style
11013
- }
11014
- });
11015
11010
  });
11016
- function Dp(e) {
11017
- return !!(typeof e == "function" && e.prototype && e.prototype.isReactComponent);
11018
- }
11019
- function Op(e) {
11020
- return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.forward_ref)" || e.$$typeof.description === "react.forward_ref"));
11021
- }
11022
- function kp(e) {
11023
- return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.memo)" || e.$$typeof.description === "react.memo"));
11024
- }
11025
- function Ap(e) {
11026
- if (Dp(e) || Op(e)) return !0;
11027
- if (kp(e)) {
11028
- let t = e.type;
11029
- if (t) return Dp(t) || Op(t);
11030
- }
11031
- return !1;
11032
- }
11033
- function jp() {
11034
- try {
11035
- if (S) return parseInt(S.split(".")[0], 10) >= 19;
11036
- } catch {}
11037
- return !1;
11011
+ //#endregion
11012
+ //#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
11013
+ function Tf(e = {}) {
11014
+ return new N({ view(t) {
11015
+ return new Ef(t, e);
11016
+ } });
11038
11017
  }
11039
- var Mp = class {
11040
- constructor(e, { editor: t, props: n = {}, as: r = "div", className: i = "" }) {
11041
- this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = n, this.element = document.createElement(r), this.element.classList.add("react-renderer"), i && this.element.classList.add(...i.split(" ")), this.editor.isEditorContentInitialized ? ie(() => {
11042
- this.render();
11043
- }) : queueMicrotask(() => {
11044
- this.destroyed || this.render();
11018
+ var Ef = class {
11019
+ constructor(e, t) {
11020
+ this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
11021
+ "dragover",
11022
+ "dragend",
11023
+ "drop",
11024
+ "dragleave"
11025
+ ].map((t) => {
11026
+ let n = (e) => {
11027
+ this[t](e);
11028
+ };
11029
+ return e.dom.addEventListener(t, n), {
11030
+ name: t,
11031
+ handler: n
11032
+ };
11045
11033
  });
11046
11034
  }
11047
- render() {
11048
- var e;
11049
- if (this.destroyed) return;
11050
- let t = this.component, n = this.props, r = this.editor, i = jp(), a = Ap(t), o = { ...n };
11051
- o.ref && !(i || a) && delete o.ref, !o.ref && (i || a) && (o.ref = (e) => {
11052
- this.ref = e;
11053
- }), this.reactElement = /* @__PURE__ */ C(t, { ...o }), (e = r?.contentComponent) == null || e.setRenderer(this.id, this);
11054
- }
11055
- updateProps(e = {}) {
11056
- this.destroyed || (this.props = {
11057
- ...this.props,
11058
- ...e
11059
- }, this.render());
11060
- }
11061
11035
  destroy() {
11062
- var e;
11063
- this.destroyed = !0, (e = this.editor?.contentComponent) == null || e.removeRenderer(this.id);
11064
- try {
11065
- this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element);
11066
- } catch {}
11036
+ this.handlers.forEach(({ name: e, handler: t }) => this.editorView.dom.removeEventListener(e, t));
11067
11037
  }
11068
- updateAttributes(e) {
11069
- Object.keys(e).forEach((t) => {
11070
- this.element.setAttribute(t, e[t]);
11071
- });
11038
+ update(e, t) {
11039
+ this.cursorPos != null && t.doc != e.state.doc && (this.cursorPos > e.state.doc.content.size ? this.setCursor(null) : this.updateOverlay());
11072
11040
  }
11073
- };
11074
- l.createContext({ markViewContentRef: () => {} });
11075
- var Np = class extends lf {
11076
- constructor(e, t, n) {
11077
- if (super(e, t, n), this.selectionRafId = null, this.positionCheckCallback = null, this.cachedExtensionWithSyncedStorage = null, !this.node.isLeaf) {
11078
- this.options.contentDOMElementTag ? this.contentDOMElement = document.createElement(this.options.contentDOMElementTag) : this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement.dataset.nodeViewContentReact = "", this.contentDOMElement.dataset.nodeViewWrapper = "", this.contentDOMElement.style.whiteSpace = "inherit";
11079
- let e = this.dom.querySelector("[data-node-view-content]");
11080
- if (!e) return;
11081
- e.appendChild(this.contentDOMElement);
11082
- }
11041
+ setCursor(e) {
11042
+ e != this.cursorPos && (this.cursorPos = e, e == null ? (this.element.parentNode.removeChild(this.element), this.element = null) : this.updateOverlay());
11083
11043
  }
11084
- get extensionWithSyncedStorage() {
11085
- if (!this.cachedExtensionWithSyncedStorage) {
11086
- let e = this.editor, t = this.extension;
11087
- this.cachedExtensionWithSyncedStorage = new Proxy(t, { get(n, r, i) {
11088
- return r === "storage" ? e.storage[t.name] ?? {} : Reflect.get(n, r, i);
11089
- } });
11044
+ updateOverlay() {
11045
+ let e = this.editorView.state.doc.resolve(this.cursorPos), t = !e.parent.inlineContent, n, r = this.editorView.dom, i = r.getBoundingClientRect(), a = i.width / r.offsetWidth, o = i.height / r.offsetHeight;
11046
+ if (t) {
11047
+ let t = e.nodeBefore, r = e.nodeAfter;
11048
+ if (t || r) {
11049
+ let e = this.editorView.nodeDOM(this.cursorPos - (t ? t.nodeSize : 0));
11050
+ if (e) {
11051
+ let i = e.getBoundingClientRect(), a = t ? i.bottom : i.top;
11052
+ t && r && (a = (a + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
11053
+ let s = this.width / 2 * o;
11054
+ n = {
11055
+ left: i.left,
11056
+ right: i.right,
11057
+ top: a - s,
11058
+ bottom: a + s
11059
+ };
11060
+ }
11061
+ }
11090
11062
  }
11091
- return this.cachedExtensionWithSyncedStorage;
11092
- }
11093
- mount() {
11094
- let e = {
11095
- editor: this.editor,
11096
- node: this.node,
11097
- decorations: this.decorations,
11098
- innerDecorations: this.innerDecorations,
11099
- view: this.view,
11100
- selected: !1,
11101
- extension: this.extensionWithSyncedStorage,
11102
- HTMLAttributes: this.HTMLAttributes,
11103
- getPos: () => this.getPos(),
11104
- updateAttributes: (e = {}) => this.updateAttributes(e),
11105
- deleteNode: () => this.deleteNode(),
11106
- ref: f()
11107
- };
11108
- if (!this.component.displayName) {
11109
- let e = (e) => e.charAt(0).toUpperCase() + e.substring(1);
11110
- this.component.displayName = e(this.extension.name);
11063
+ if (!n) {
11064
+ let e = this.editorView.coordsAtPos(this.cursorPos), t = this.width / 2 * a;
11065
+ n = {
11066
+ left: e.left - t,
11067
+ right: e.left + t,
11068
+ top: e.top,
11069
+ bottom: e.bottom
11070
+ };
11111
11071
  }
11112
- let t = {
11113
- onDragStart: this.onDragStart.bind(this),
11114
- nodeViewContentRef: (e) => {
11115
- e && this.contentDOMElement && e.firstChild !== this.contentDOMElement && (e.hasAttribute("data-node-view-wrapper") && e.removeAttribute("data-node-view-wrapper"), e.appendChild(this.contentDOMElement));
11116
- }
11117
- }, n = this.component, r = m((e) => /* @__PURE__ */ C(wp.Provider, {
11118
- value: t,
11119
- children: d(n, e)
11120
- }));
11121
- r.displayName = "ReactNodeView";
11122
- let i = this.node.isInline ? "span" : "div";
11123
- this.options.as && (i = this.options.as);
11124
- let { className: a = "" } = this.options;
11125
- this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.renderer = new Mp(r, {
11126
- editor: this.editor,
11127
- props: e,
11128
- as: i,
11129
- className: `node-${this.node.type.name} ${a}`.trim()
11130
- }), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.updateElementAttributes(), this.currentPos = this.getPos(), this.positionCheckCallback = () => {
11131
- let e = this.getPos();
11132
- typeof e != "number" || e === this.currentPos || (this.currentPos = e, this.renderer.updateProps({ getPos: () => this.getPos() }), typeof this.options.attrs == "function" && this.updateElementAttributes());
11133
- }, of(this.editor, this.positionCheckCallback);
11134
- }
11135
- get dom() {
11136
- if (this.renderer.element.firstElementChild && !this.renderer.element.firstElementChild?.hasAttribute("data-node-view-wrapper")) throw Error("Please use the NodeViewWrapper component for your node view.");
11137
- return this.renderer.element;
11072
+ let s = this.editorView.dom.offsetParent;
11073
+ this.element || (this.element = s.appendChild(document.createElement("div")), this.class && (this.element.className = this.class), this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;", this.color && (this.element.style.backgroundColor = this.color)), this.element.classList.toggle("prosemirror-dropcursor-block", t), this.element.classList.toggle("prosemirror-dropcursor-inline", !t);
11074
+ let c, l;
11075
+ if (!s || s == document.body && getComputedStyle(s).position == "static") c = -pageXOffset, l = -pageYOffset;
11076
+ else {
11077
+ let e = s.getBoundingClientRect(), t = e.width / s.offsetWidth, n = e.height / s.offsetHeight;
11078
+ c = e.left - s.scrollLeft * t, l = e.top - s.scrollTop * n;
11079
+ }
11080
+ this.element.style.left = (n.left - c) / a + "px", this.element.style.top = (n.top - l) / o + "px", this.element.style.width = (n.right - n.left) / a + "px", this.element.style.height = (n.bottom - n.top) / o + "px";
11138
11081
  }
11139
- get contentDOM() {
11140
- return this.node.isLeaf ? null : this.contentDOMElement;
11082
+ scheduleRemoval(e) {
11083
+ clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(null), e);
11141
11084
  }
11142
- handleSelectionUpdate() {
11143
- this.selectionRafId &&= (cancelAnimationFrame(this.selectionRafId), null), this.selectionRafId = requestAnimationFrame(() => {
11144
- this.selectionRafId = null;
11145
- let e = this.currentPos;
11146
- if (typeof e == "number") if (Mu({
11147
- selection: this.editor.state.selection,
11148
- pos: e,
11149
- nodeSize: this.node.nodeSize,
11150
- selectedOnTextSelection: this.options.selectedOnTextSelection
11151
- })) {
11152
- if (this.renderer.props.selected) return;
11153
- this.selectNode();
11154
- } else {
11155
- if (!this.renderer.props.selected) return;
11156
- this.deselectNode();
11085
+ dragover(e) {
11086
+ if (!this.editorView.editable) return;
11087
+ let t = this.editorView.posAtCoords({
11088
+ left: e.clientX,
11089
+ top: e.clientY
11090
+ }), n = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside), r = n && n.type.spec.disableDropCursor, i = typeof r == "function" ? r(this.editorView, t, e) : r;
11091
+ if (t && !i) {
11092
+ let e = t.pos;
11093
+ if (this.editorView.dragging && this.editorView.dragging.slice) {
11094
+ let t = yn(this.editorView.state.doc, e, this.editorView.dragging.slice);
11095
+ t != null && (e = t);
11157
11096
  }
11158
- });
11159
- }
11160
- update(e, t, n) {
11161
- let r = (e) => {
11162
- this.renderer.updateProps(e), typeof this.options.attrs == "function" && this.updateElementAttributes();
11163
- };
11164
- if (e.type !== this.node.type) return !1;
11165
- if (typeof this.options.update == "function") {
11166
- let i = this.node, a = this.decorations, o = this.innerDecorations;
11167
- return this.node = e, this.decorations = t, this.innerDecorations = n, this.currentPos = this.getPos(), this.options.update({
11168
- oldNode: i,
11169
- oldDecorations: a,
11170
- newNode: e,
11171
- newDecorations: t,
11172
- oldInnerDecorations: o,
11173
- innerDecorations: n,
11174
- updateProps: () => r({
11175
- node: e,
11176
- decorations: t,
11177
- innerDecorations: n,
11178
- extension: this.extensionWithSyncedStorage
11179
- })
11180
- });
11097
+ this.setCursor(e), this.scheduleRemoval(5e3);
11181
11098
  }
11182
- let i = this.getPos();
11183
- return e === this.node && this.decorations === t && this.innerDecorations === n ? i === this.currentPos ? !0 : (this.currentPos = i, r({
11184
- node: e,
11185
- decorations: t,
11186
- innerDecorations: n,
11187
- extension: this.extensionWithSyncedStorage,
11188
- getPos: () => this.getPos()
11189
- }), !0) : (this.node = e, this.decorations = t, this.innerDecorations = n, this.currentPos = i, r({
11190
- node: e,
11191
- decorations: t,
11192
- innerDecorations: n,
11193
- extension: this.extensionWithSyncedStorage
11194
- }), !0);
11195
11099
  }
11196
- selectNode() {
11197
- this.renderer.updateProps({ selected: !0 }), this.renderer.element.classList.add("ProseMirror-selectednode");
11100
+ dragend() {
11101
+ this.scheduleRemoval(20);
11198
11102
  }
11199
- deselectNode() {
11200
- this.renderer.updateProps({ selected: !1 }), this.renderer.element.classList.remove("ProseMirror-selectednode");
11103
+ drop() {
11104
+ this.scheduleRemoval(20);
11201
11105
  }
11202
- destroy() {
11203
- this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.positionCheckCallback &&= (sf(this.editor, this.positionCheckCallback), null), this.contentDOMElement = null, this.selectionRafId &&= (cancelAnimationFrame(this.selectionRafId), null);
11106
+ dragleave(e) {
11107
+ this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
11204
11108
  }
11205
- updateElementAttributes() {
11206
- if (this.options.attrs) {
11207
- let e = {};
11208
- if (typeof this.options.attrs == "function") {
11209
- let t = this.editor.extensionManager.attributes, n = nu(this.node, t);
11210
- e = this.options.attrs({
11211
- node: this.node,
11212
- HTMLAttributes: n
11213
- });
11214
- } else e = this.options.attrs;
11215
- this.renderer.updateAttributes(e);
11216
- }
11109
+ }, Df = class e extends A {
11110
+ constructor(e) {
11111
+ super(e, e);
11217
11112
  }
11218
- };
11219
- function Pp(e, t) {
11220
- return (n) => n.editor.contentComponent ? new Np(e, n, t) : {};
11221
- }
11222
- var Fp = u({ get editor() {
11223
- throw Error("useTiptap must be used within a <Tiptap> provider");
11224
- } });
11225
- Fp.displayName = "TiptapContext";
11226
- var Ip = () => h(Fp);
11227
- function Lp({ editor: e, instance: t, children: n }) {
11228
- let r = e ?? t;
11229
- if (!r) throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
11230
- let i = y(() => ({ editor: r }), [r]), a = y(() => ({ editor: r }), [r]);
11231
- return /* @__PURE__ */ C(Sp.Provider, {
11232
- value: a,
11233
- children: /* @__PURE__ */ C(Fp.Provider, {
11234
- value: i,
11235
- children: n
11236
- })
11237
- });
11238
- }
11239
- Lp.displayName = "Tiptap";
11240
- function Rp({ ...e }) {
11241
- let { editor: t } = Ip();
11242
- return /* @__PURE__ */ C(pp, {
11243
- editor: t,
11244
- ...e
11245
- });
11246
- }
11247
- Rp.displayName = "Tiptap.Content", Object.assign(Lp, { Content: Rp });
11248
- //#endregion
11249
- //#region ../../node_modules/.pnpm/@tiptap+suggestion@3.22.5_@tiptap+core@3.22.5_@tiptap+pm@3.22.5__@tiptap+pm@3.22.5/node_modules/@tiptap/suggestion/dist/index.js
11250
- function zp(e) {
11251
- let { char: t, allowSpaces: n, allowToIncludeChar: r, allowedPrefixes: i, startOfLine: a, $position: o } = e, s = n && !r, c = Jd(t), l = RegExp(`\\s${c}$`), u = a ? "^" : "", d = r ? "" : c, f = RegExp(s ? `${u}${c}.*?(?=\\s${d}|$)` : `${u}(?:^)?${c}[^\\s${d}]*`, "gm"), p = o.nodeBefore?.isText && o.nodeBefore.text;
11252
- if (!p) return null;
11253
- let m = o.pos - p.length, h = Array.from(p.matchAll(f)).pop();
11254
- if (!h || h.input === void 0 || h.index === void 0) return null;
11255
- let g = h.input.slice(Math.max(0, h.index - 1), h.index), _ = RegExp(`^[${i?.join("")}\0]?$`).test(g);
11256
- if (i !== null && !_) return null;
11257
- let v = m + h.index, y = v + h[0].length;
11258
- return s && l.test(p.slice(y - 1, y + 1)) && (h[0] += " ", y += 1), v < o.pos && y >= o.pos ? {
11259
- range: {
11260
- from: v,
11261
- to: y
11262
- },
11263
- query: h[0].slice(t.length),
11264
- text: h[0]
11265
- } : null;
11266
- }
11267
- function Bp(e) {
11268
- return e.docChanged ? e.steps.some((e) => {
11269
- let t = e.slice;
11270
- if (!t?.content) return !1;
11271
- let n = t.content.textBetween(0, t.content.size, "\n");
11272
- return /\s/.test(n);
11273
- }) : !1;
11274
- }
11275
- var Vp = new P("suggestion");
11276
- function Hp({ pluginKey: e = Vp, editor: t, char: n = "@", allowSpaces: r = !1, allowToIncludeChar: i = !1, allowedPrefixes: a = [" "], startOfLine: o = !1, decorationTag: s = "span", decorationClass: c = "suggestion", decorationContent: l = "", decorationEmptyClass: u = "is-empty", command: d = () => null, items: f = () => [], render: p = () => ({}), allow: m = () => !0, findSuggestionMatch: h = zp, shouldShow: g, shouldResetDismissed: _ }) {
11277
- let v, y = p?.(), b = r && !i, x = () => {
11278
- let e = t.state.selection.$anchor.pos, { top: n, right: r, bottom: i, left: a } = t.view.coordsAtPos(e);
11279
- try {
11280
- return new DOMRect(a, n, r - a, i - n);
11281
- } catch {
11282
- return null;
11283
- }
11284
- }, S = (n, r) => r ? () => {
11285
- let r = e.getState(t.state)?.decorationId;
11286
- return n.dom.querySelector(`[data-decoration-id="${r}"]`)?.getBoundingClientRect() || null;
11287
- } : x, ee = ({ match: e, dismissedRange: n, state: r, transaction: i }) => _?.({
11288
- editor: t,
11289
- state: r,
11290
- range: n,
11291
- match: e,
11292
- transaction: i,
11293
- allowSpaces: b
11294
- }) ? !1 : b ? e.range.from === n.from : e.range.from === n.from && !Bp(i);
11295
- function C(n, r) {
11296
- var i;
11297
- try {
11298
- let r = e.getState(n.state), a = r?.decorationId ? n.dom.querySelector(`[data-decoration-id="${r.decorationId}"]`) : null, o = {
11299
- editor: t,
11300
- range: r?.range || {
11301
- from: 0,
11302
- to: 0
11303
- },
11304
- query: r?.query || null,
11305
- text: r?.text || null,
11306
- items: [],
11307
- command: (e) => d({
11308
- editor: t,
11309
- range: r?.range || {
11310
- from: 0,
11311
- to: 0
11312
- },
11313
- props: e
11314
- }),
11315
- decorationNode: a,
11316
- clientRect: S(n, a)
11317
- };
11318
- (i = y?.onExit) == null || i.call(y, o);
11319
- } catch {}
11320
- let a = n.state.tr.setMeta(r, { exit: !0 });
11321
- n.dispatch(a);
11113
+ map(t, n) {
11114
+ let r = t.resolve(n.map(this.head));
11115
+ return e.valid(r) ? new e(r) : A.near(r);
11322
11116
  }
11323
- let te = new N({
11324
- key: e,
11325
- view() {
11326
- return {
11327
- update: async (e, n) => {
11328
- var r, i, a, o, s;
11329
- let c = this.key?.getState(n), l = this.key?.getState(e.state), u = c.active && l.active && c.range.from !== l.range.from, p = !c.active && l.active, m = c.active && !l.active, h = !p && !m && c.query !== l.query, g = p || u && h, _ = h || u, b = m || u && h;
11330
- if (!g && !_ && !b) return;
11331
- let x = b && !g ? c : l, ee = e.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);
11332
- v = {
11333
- editor: t,
11334
- range: x.range,
11335
- query: x.query,
11336
- text: x.text,
11337
- items: [],
11338
- command: (e) => d({
11339
- editor: t,
11340
- range: x.range,
11341
- props: e
11342
- }),
11343
- decorationNode: ee,
11344
- clientRect: S(e, ee)
11345
- }, g && ((r = y?.onBeforeStart) == null || r.call(y, v)), _ && ((i = y?.onBeforeUpdate) == null || i.call(y, v)), (_ || g) && (v.items = await f({
11346
- editor: t,
11347
- query: x.query
11348
- })), b && ((a = y?.onExit) == null || a.call(y, v)), _ && ((o = y?.onUpdate) == null || o.call(y, v)), g && ((s = y?.onStart) == null || s.call(y, v));
11349
- },
11350
- destroy: () => {
11351
- var e;
11352
- v && ((e = y?.onExit) == null || e.call(y, v));
11353
- }
11354
- };
11355
- },
11356
- state: {
11357
- init() {
11358
- return {
11359
- active: !1,
11360
- range: {
11361
- from: 0,
11362
- to: 0
11363
- },
11364
- query: null,
11365
- text: null,
11366
- composing: !1,
11367
- dismissedRange: null
11368
- };
11369
- },
11370
- apply(s, c, l, u) {
11371
- let { isEditable: d } = t, { composing: f } = t.view, { selection: p } = s, { empty: _, from: v } = p, y = { ...c }, b = s.getMeta(e);
11372
- if (b && b.exit) return y.active = !1, y.decorationId = null, y.range = {
11373
- from: 0,
11374
- to: 0
11375
- }, y.query = null, y.text = null, y.dismissedRange = c.active ? { ...c.range } : c.dismissedRange, y;
11376
- if (y.composing = f, s.docChanged && y.dismissedRange !== null && (y.dismissedRange = {
11377
- from: s.mapping.map(y.dismissedRange.from),
11378
- to: s.mapping.map(y.dismissedRange.to)
11379
- }), d && (_ || t.view.composing)) {
11380
- (v < c.range.from || v > c.range.to) && !f && !c.composing && (y.active = !1);
11381
- let e = h({
11382
- char: n,
11383
- allowSpaces: r,
11384
- allowToIncludeChar: i,
11385
- allowedPrefixes: a,
11386
- startOfLine: o,
11387
- $position: p.$from
11388
- }), l = `id_${Math.floor(Math.random() * 4294967295)}`;
11389
- e && m({
11390
- editor: t,
11391
- state: u,
11392
- range: e.range,
11393
- isActive: c.active
11394
- }) && (!g || g({
11395
- editor: t,
11396
- range: e.range,
11397
- query: e.query,
11398
- text: e.text,
11399
- transaction: s
11400
- })) ? (y.dismissedRange !== null && !ee({
11401
- match: e,
11402
- dismissedRange: y.dismissedRange,
11403
- state: u,
11404
- transaction: s
11405
- }) && (y.dismissedRange = null), y.dismissedRange === null ? (y.active = !0, y.decorationId = c.decorationId ? c.decorationId : l, y.range = e.range, y.query = e.query, y.text = e.text) : y.active = !1) : (e || (y.dismissedRange = null), y.active = !1);
11406
- } else y.active = !1;
11407
- return y.active || (y.decorationId = null, y.range = {
11408
- from: 0,
11409
- to: 0
11410
- }, y.query = null, y.text = null), y;
11117
+ content() {
11118
+ return D.empty;
11119
+ }
11120
+ eq(t) {
11121
+ return t instanceof e && t.head == this.head;
11122
+ }
11123
+ toJSON() {
11124
+ return {
11125
+ type: "gapcursor",
11126
+ pos: this.head
11127
+ };
11128
+ }
11129
+ static fromJSON(t, n) {
11130
+ if (typeof n.pos != "number") throw RangeError("Invalid input for GapCursor.fromJSON");
11131
+ return new e(t.resolve(n.pos));
11132
+ }
11133
+ getBookmark() {
11134
+ return new Of(this.anchor);
11135
+ }
11136
+ static valid(e) {
11137
+ let t = e.parent;
11138
+ if (t.inlineContent || !Af(e) || !jf(e)) return !1;
11139
+ let n = t.type.spec.allowGapCursor;
11140
+ if (n != null) return n;
11141
+ let r = t.contentMatchAt(e.index()).defaultType;
11142
+ return r && r.isTextblock;
11143
+ }
11144
+ static findGapCursorFrom(t, n, r = !1) {
11145
+ search: for (;;) {
11146
+ if (!r && e.valid(t)) return t;
11147
+ let i = t.pos, a = null;
11148
+ for (let r = t.depth;; r--) {
11149
+ let o = t.node(r);
11150
+ if (n > 0 ? t.indexAfter(r) < o.childCount : t.index(r) > 0) {
11151
+ a = o.child(n > 0 ? t.indexAfter(r) : t.index(r) - 1);
11152
+ break;
11153
+ } else if (r == 0) return null;
11154
+ i += n;
11155
+ let s = t.doc.resolve(i);
11156
+ if (e.valid(s)) return s;
11411
11157
  }
11412
- },
11413
- props: {
11414
- handleKeyDown(t, n) {
11415
- var r;
11416
- let { active: i, range: a } = te.getState(t.state);
11417
- if (!i) return !1;
11418
- if (n.key === "Escape" || n.key === "Esc") {
11419
- let i = te.getState(t.state);
11420
- return (r = y?.onKeyDown) == null || r.call(y, {
11421
- view: t,
11422
- event: n,
11423
- range: i.range
11424
- }), C(t, e), !0;
11158
+ for (;;) {
11159
+ let o = n > 0 ? a.firstChild : a.lastChild;
11160
+ if (!o) {
11161
+ if (a.isAtom && !a.isText && !M.isSelectable(a)) {
11162
+ t = t.doc.resolve(i + a.nodeSize * n), r = !1;
11163
+ continue search;
11164
+ }
11165
+ break;
11425
11166
  }
11426
- return (y?.onKeyDown)?.call(y, {
11427
- view: t,
11428
- event: n,
11429
- range: a
11430
- }) || !1;
11431
- },
11432
- decorations(e) {
11433
- let { active: t, range: n, decorationId: r, query: i } = te.getState(e);
11434
- if (!t) return null;
11435
- let a = !i?.length, o = [c];
11436
- return a && o.push(u), B.create(e.doc, [Es.inline(n.from, n.to, {
11437
- nodeName: s,
11438
- class: o.join(" "),
11439
- "data-decoration-id": r,
11440
- "data-decoration-content": l
11441
- })]);
11167
+ a = o, i += n;
11168
+ let s = t.doc.resolve(i);
11169
+ if (e.valid(s)) return s;
11442
11170
  }
11171
+ return null;
11172
+ }
11173
+ }
11174
+ };
11175
+ Df.prototype.visible = !1, Df.findFrom = Df.findGapCursorFrom, A.jsonID("gapcursor", Df);
11176
+ var Of = class e {
11177
+ constructor(e) {
11178
+ this.pos = e;
11179
+ }
11180
+ map(t) {
11181
+ return new e(t.map(this.pos));
11182
+ }
11183
+ resolve(e) {
11184
+ let t = e.resolve(this.pos);
11185
+ return Df.valid(t) ? new Df(t) : A.near(t);
11186
+ }
11187
+ };
11188
+ function kf(e) {
11189
+ return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
11190
+ }
11191
+ function Af(e) {
11192
+ for (let t = e.depth; t >= 0; t--) {
11193
+ let n = e.index(t), r = e.node(t);
11194
+ if (n == 0) {
11195
+ if (r.type.spec.isolating) return !0;
11196
+ continue;
11197
+ }
11198
+ for (let e = r.child(n - 1);; e = e.lastChild) {
11199
+ if (e.childCount == 0 && !e.inlineContent || kf(e.type)) return !0;
11200
+ if (e.inlineContent) return !1;
11201
+ }
11202
+ }
11203
+ return !0;
11204
+ }
11205
+ function jf(e) {
11206
+ for (let t = e.depth; t >= 0; t--) {
11207
+ let n = e.indexAfter(t), r = e.node(t);
11208
+ if (n == r.childCount) {
11209
+ if (r.type.spec.isolating) return !0;
11210
+ continue;
11211
+ }
11212
+ for (let e = r.child(n);; e = e.firstChild) {
11213
+ if (e.childCount == 0 && !e.inlineContent || kf(e.type)) return !0;
11214
+ if (e.inlineContent) return !1;
11215
+ }
11216
+ }
11217
+ return !0;
11218
+ }
11219
+ function Mf() {
11220
+ return new N({ props: {
11221
+ decorations: Lf,
11222
+ createSelectionBetween(e, t, n) {
11223
+ return t.pos == n.pos && Df.valid(n) ? new Df(n) : null;
11224
+ },
11225
+ handleClick: Ff,
11226
+ handleKeyDown: Nf,
11227
+ handleDOMEvents: { beforeinput: If }
11228
+ } });
11229
+ }
11230
+ var Nf = Dc({
11231
+ ArrowLeft: Pf("horiz", -1),
11232
+ ArrowRight: Pf("horiz", 1),
11233
+ ArrowUp: Pf("vert", -1),
11234
+ ArrowDown: Pf("vert", 1)
11235
+ });
11236
+ function Pf(e, t) {
11237
+ let n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
11238
+ return function(e, r, i) {
11239
+ let a = e.selection, o = t > 0 ? a.$to : a.$from, s = a.empty;
11240
+ if (a instanceof j) {
11241
+ if (!i.endOfTextblock(n) || o.depth == 0) return !1;
11242
+ s = !1, o = e.doc.resolve(t > 0 ? o.after() : o.before());
11443
11243
  }
11244
+ let c = Df.findGapCursorFrom(o, t, s);
11245
+ return c ? (r && r(e.tr.setSelection(new Df(c))), !0) : !1;
11246
+ };
11247
+ }
11248
+ function Ff(e, t, n) {
11249
+ if (!e || !e.editable) return !1;
11250
+ let r = e.state.doc.resolve(t);
11251
+ if (!Df.valid(r)) return !1;
11252
+ let i = e.posAtCoords({
11253
+ left: n.clientX,
11254
+ top: n.clientY
11444
11255
  });
11445
- return te;
11256
+ return i && i.inside > -1 && M.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new Df(r))), !0);
11446
11257
  }
11447
- var Up = Hp, Wp = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Gp = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Kp = _d.create({
11448
- name: "highlight",
11449
- addOptions() {
11450
- return {
11451
- multicolor: !1,
11452
- HTMLAttributes: {}
11453
- };
11454
- },
11455
- addAttributes() {
11456
- return this.options.multicolor ? { color: {
11457
- default: null,
11458
- parseHTML: (e) => e.getAttribute("data-color") || e.style.backgroundColor,
11459
- renderHTML: (e) => e.color ? {
11460
- "data-color": e.color,
11461
- style: `background-color: ${e.color}; color: inherit`
11462
- } : {}
11463
- } } : {};
11464
- },
11465
- parseHTML() {
11466
- return [{ tag: "mark" }];
11467
- },
11468
- renderHTML({ HTMLAttributes: e }) {
11469
- return [
11470
- "mark",
11471
- K(this.options.HTMLAttributes, e),
11472
- 0
11473
- ];
11474
- },
11475
- renderMarkdown: (e, t) => `==${t.renderChildren(e)}==`,
11476
- parseMarkdown: (e, t) => t.applyMark("highlight", t.parseInline(e.tokens || [])),
11477
- markdownTokenizer: {
11478
- name: "highlight",
11479
- level: "inline",
11480
- start: (e) => e.indexOf("=="),
11481
- tokenize(e, t, n) {
11482
- let r = /^(==)([^=]+)(==)/.exec(e);
11483
- if (r) {
11484
- let e = r[2].trim(), t = n.inlineTokens(e);
11485
- return {
11486
- type: "highlight",
11487
- raw: r[0],
11488
- text: e,
11489
- tokens: t
11490
- };
11491
- }
11258
+ function If(e, t) {
11259
+ if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof Df)) return !1;
11260
+ let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
11261
+ if (!r) return !1;
11262
+ let i = T.empty;
11263
+ for (let e = r.length - 1; e >= 0; e--) i = T.from(r[e].createAndFill(null, i));
11264
+ let a = e.state.tr.replace(n.pos, n.pos, new D(i, 0, 0));
11265
+ return a.setSelection(j.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
11266
+ }
11267
+ function Lf(e) {
11268
+ if (!(e.selection instanceof Df)) return null;
11269
+ let t = document.createElement("div");
11270
+ return t.className = "ProseMirror-gapcursor", B.create(e.doc, [Es.widget(e.selection.head, t, { key: "gapcursor" })]);
11271
+ }
11272
+ //#endregion
11273
+ //#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
11274
+ var Rf = 200, Y = function() {};
11275
+ Y.prototype.append = function(e) {
11276
+ return e.length ? (e = Y.from(e), !this.length && e || e.length < Rf && this.leafAppend(e) || this.length < Rf && e.leafPrepend(this) || this.appendInner(e)) : this;
11277
+ }, Y.prototype.prepend = function(e) {
11278
+ return e.length ? Y.from(e).append(this) : this;
11279
+ }, Y.prototype.appendInner = function(e) {
11280
+ return new Bf(this, e);
11281
+ }, Y.prototype.slice = function(e, t) {
11282
+ return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? Y.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
11283
+ }, Y.prototype.get = function(e) {
11284
+ if (!(e < 0 || e >= this.length)) return this.getInner(e);
11285
+ }, Y.prototype.forEach = function(e, t, n) {
11286
+ t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
11287
+ }, Y.prototype.map = function(e, t, n) {
11288
+ t === void 0 && (t = 0), n === void 0 && (n = this.length);
11289
+ var r = [];
11290
+ return this.forEach(function(t, n) {
11291
+ return r.push(e(t, n));
11292
+ }, t, n), r;
11293
+ }, Y.from = function(e) {
11294
+ return e instanceof Y ? e : e && e.length ? new zf(e) : Y.empty;
11295
+ };
11296
+ var zf = /* @__PURE__ */ function(e) {
11297
+ function t(t) {
11298
+ e.call(this), this.values = t;
11299
+ }
11300
+ e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
11301
+ var n = {
11302
+ length: { configurable: !0 },
11303
+ depth: { configurable: !0 }
11304
+ };
11305
+ return t.prototype.flatten = function() {
11306
+ return this.values;
11307
+ }, t.prototype.sliceInner = function(e, n) {
11308
+ return e == 0 && n == this.length ? this : new t(this.values.slice(e, n));
11309
+ }, t.prototype.getInner = function(e) {
11310
+ return this.values[e];
11311
+ }, t.prototype.forEachInner = function(e, t, n, r) {
11312
+ for (var i = t; i < n; i++) if (e(this.values[i], r + i) === !1) return !1;
11313
+ }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
11314
+ for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
11315
+ }, t.prototype.leafAppend = function(e) {
11316
+ if (this.length + e.length <= Rf) return new t(this.values.concat(e.flatten()));
11317
+ }, t.prototype.leafPrepend = function(e) {
11318
+ if (this.length + e.length <= Rf) return new t(e.flatten().concat(this.values));
11319
+ }, n.length.get = function() {
11320
+ return this.values.length;
11321
+ }, n.depth.get = function() {
11322
+ return 0;
11323
+ }, Object.defineProperties(t.prototype, n), t;
11324
+ }(Y);
11325
+ Y.empty = new zf([]);
11326
+ var Bf = /* @__PURE__ */ function(e) {
11327
+ function t(t, n) {
11328
+ e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
11329
+ }
11330
+ return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.flatten = function() {
11331
+ return this.left.flatten().concat(this.right.flatten());
11332
+ }, t.prototype.getInner = function(e) {
11333
+ return e < this.left.length ? this.left.get(e) : this.right.get(e - this.left.length);
11334
+ }, t.prototype.forEachInner = function(e, t, n, r) {
11335
+ var i = this.left.length;
11336
+ if (t < i && this.left.forEachInner(e, t, Math.min(n, i), r) === !1 || n > i && this.right.forEachInner(e, Math.max(t - i, 0), Math.min(this.length, n) - i, r + i) === !1) return !1;
11337
+ }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
11338
+ var i = this.left.length;
11339
+ if (t > i && this.right.forEachInvertedInner(e, t - i, Math.max(n, i) - i, r + i) === !1 || n < i && this.left.forEachInvertedInner(e, Math.min(t, i), n, r) === !1) return !1;
11340
+ }, t.prototype.sliceInner = function(e, t) {
11341
+ if (e == 0 && t == this.length) return this;
11342
+ var n = this.left.length;
11343
+ return t <= n ? this.left.slice(e, t) : e >= n ? this.right.slice(e - n, t - n) : this.left.slice(e, n).append(this.right.slice(0, t - n));
11344
+ }, t.prototype.leafAppend = function(e) {
11345
+ var n = this.right.leafAppend(e);
11346
+ if (n) return new t(this.left, n);
11347
+ }, t.prototype.leafPrepend = function(e) {
11348
+ var n = this.left.leafPrepend(e);
11349
+ if (n) return new t(n, this.right);
11350
+ }, t.prototype.appendInner = function(e) {
11351
+ return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
11352
+ }, t;
11353
+ }(Y), Vf = 500, Hf = class e {
11354
+ constructor(e, t) {
11355
+ this.items = e, this.eventCount = t;
11356
+ }
11357
+ popEvent(t, n) {
11358
+ if (this.eventCount == 0) return null;
11359
+ let r = this.items.length;
11360
+ for (;; r--) if (this.items.get(r - 1).selection) {
11361
+ --r;
11362
+ break;
11492
11363
  }
11493
- },
11494
- addCommands() {
11495
- return {
11496
- setHighlight: (e) => ({ commands: t }) => t.setMark(this.name, e),
11497
- toggleHighlight: (e) => ({ commands: t }) => t.toggleMark(this.name, e),
11498
- unsetHighlight: () => ({ commands: e }) => e.unsetMark(this.name)
11364
+ let i, a;
11365
+ n && (i = this.remapping(r, this.items.length), a = i.maps.length);
11366
+ let o = t.tr, s, c, l = [], u = [];
11367
+ return this.items.forEach((t, n) => {
11368
+ if (!t.step) {
11369
+ i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(t);
11370
+ return;
11371
+ }
11372
+ if (i) {
11373
+ u.push(new Wf(t.map));
11374
+ let e = t.step.map(i.slice(a)), n;
11375
+ e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new Wf(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
11376
+ } else o.maybeStep(t.step);
11377
+ if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
11378
+ }, this.items.length, 0), {
11379
+ remaining: c,
11380
+ transform: o,
11381
+ selection: s
11499
11382
  };
11500
- },
11501
- addKeyboardShortcuts() {
11502
- return { "Mod-Shift-h": () => this.editor.commands.toggleHighlight() };
11503
- },
11504
- addInputRules() {
11505
- return [Vd({
11506
- find: Wp,
11507
- type: this.type
11508
- })];
11509
- },
11510
- addPasteRules() {
11511
- return [uf({
11512
- find: Gp,
11513
- type: this.type
11514
- })];
11515
11383
  }
11516
- }), qp = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, Jp = J.create({
11517
- name: "image",
11518
- addOptions() {
11519
- return {
11520
- inline: !1,
11521
- allowBase64: !1,
11522
- HTMLAttributes: {},
11523
- resize: !1
11524
- };
11525
- },
11526
- inline() {
11527
- return this.options.inline;
11528
- },
11529
- group() {
11530
- return this.options.inline ? "inline" : "block";
11531
- },
11532
- draggable: !0,
11533
- addAttributes() {
11534
- return {
11535
- src: { default: null },
11536
- alt: { default: null },
11537
- title: { default: null },
11538
- width: { default: null },
11539
- height: { default: null }
11540
- };
11541
- },
11542
- parseHTML() {
11543
- return [{ tag: this.options.allowBase64 ? "img[src]" : "img[src]:not([src^=\"data:\"])" }];
11544
- },
11545
- renderHTML({ HTMLAttributes: e }) {
11546
- return ["img", K(this.options.HTMLAttributes, e)];
11547
- },
11548
- parseMarkdown: (e, t) => t.createNode("image", {
11549
- src: e.href,
11550
- title: e.title,
11551
- alt: e.text
11552
- }),
11553
- renderMarkdown: (e) => {
11554
- let t = e.attrs?.src ?? "", n = e.attrs?.alt ?? "", r = e.attrs?.title ?? "";
11555
- return r ? `![${n}](${t} "${r}")` : `![${n}](${t})`;
11556
- },
11557
- addNodeView() {
11558
- if (!this.options.resize || !this.options.resize.enabled || typeof document > "u") return null;
11559
- let { directions: e, minWidth: t, minHeight: n, alwaysPreserveAspectRatio: r } = this.options.resize;
11560
- return ({ node: i, getPos: a, HTMLAttributes: o, editor: s }) => {
11561
- let c = document.createElement("img");
11562
- Object.entries(o).forEach(([e, t]) => {
11563
- if (t != null) switch (e) {
11564
- case "width":
11565
- case "height": break;
11566
- default:
11567
- c.setAttribute(e, t);
11568
- break;
11569
- }
11570
- }), c.src = o.src;
11571
- let l = new Kd({
11572
- element: c,
11573
- editor: s,
11574
- node: i,
11575
- getPos: a,
11576
- onResize: (e, t) => {
11577
- c.style.width = `${e}px`, c.style.height = `${t}px`;
11578
- },
11579
- onCommit: (e, t) => {
11580
- let n = a();
11581
- n !== void 0 && this.editor.chain().setNodeSelection(n).updateAttributes(this.name, {
11582
- width: e,
11583
- height: t
11584
- }).run();
11585
- },
11586
- onUpdate: (e, t, n) => e.type === i.type,
11587
- options: {
11588
- directions: e,
11589
- min: {
11590
- width: t,
11591
- height: n
11592
- },
11593
- preserveAspectRatio: r === !0
11594
- }
11595
- }), u = l.dom;
11596
- return u.style.visibility = "hidden", u.style.pointerEvents = "none", c.onload = () => {
11597
- u.style.visibility = "", u.style.pointerEvents = "";
11598
- }, l;
11599
- };
11600
- },
11601
- addCommands() {
11602
- return { setImage: (e) => ({ commands: t }) => t.insertContent({
11603
- type: this.name,
11604
- attrs: e
11605
- }) };
11606
- },
11607
- addInputRules() {
11608
- return [Hd({
11609
- find: qp,
11610
- type: this.type,
11611
- getAttributes: (e) => {
11612
- let [, , t, n, r] = e;
11613
- return {
11614
- src: n,
11615
- alt: t,
11616
- title: r
11617
- };
11618
- }
11619
- })];
11384
+ addTransform(t, n, r, i) {
11385
+ let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
11386
+ for (let e = 0; e < t.steps.length; e++) {
11387
+ let r = t.steps[e].invert(t.docs[e]), l = new Wf(t.mapping.maps[e], r, n), u;
11388
+ (u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
11389
+ }
11390
+ let l = o - r.depth;
11391
+ return l > Kf && (s = Uf(s, l), o -= l), new e(s.append(a), o);
11620
11392
  }
11621
- });
11622
- //#endregion
11623
- //#region ../../node_modules/.pnpm/@tiptap+extension-mention@3.22.5_@tiptap+core@3.22.5_@tiptap+pm@3.22.5__@tiptap+pm@3.22_ae7a1836036be3f01f61ed6915cb0f6e/node_modules/@tiptap/extension-mention/dist/index.js
11624
- function Yp({ editor: e, overrideSuggestionOptions: t, extensionName: n, char: r = "@" }) {
11625
- return {
11626
- editor: e,
11627
- char: r,
11628
- pluginKey: new P(),
11629
- command: ({ editor: e, range: t, props: i }) => {
11630
- var a;
11631
- (e.view.state.selection.$to.nodeAfter?.text)?.startsWith(" ") && (t.to += 1), e.chain().focus().insertContentAt(t, [{
11632
- type: n,
11633
- attrs: {
11634
- ...i,
11635
- mentionSuggestionChar: r
11393
+ remapping(e, t) {
11394
+ let n = new Rt();
11395
+ return this.items.forEach((t, r) => {
11396
+ let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
11397
+ n.appendMap(t.map, i);
11398
+ }, e, t), n;
11399
+ }
11400
+ addMaps(t) {
11401
+ return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new Wf(e))), this.eventCount);
11402
+ }
11403
+ rebased(t, n) {
11404
+ if (!this.eventCount) return this;
11405
+ let r = [], i = Math.max(0, this.items.length - n), a = t.mapping, o = t.steps.length, s = this.eventCount;
11406
+ this.items.forEach((e) => {
11407
+ e.selection && s--;
11408
+ }, i);
11409
+ let c = n;
11410
+ this.items.forEach((e) => {
11411
+ let n = a.getMirror(--c);
11412
+ if (n == null) return;
11413
+ o = Math.min(o, n);
11414
+ let i = a.maps[n];
11415
+ if (e.step) {
11416
+ let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
11417
+ l && s++, r.push(new Wf(i, o, l));
11418
+ } else r.push(new Wf(i));
11419
+ }, i);
11420
+ let l = [];
11421
+ for (let e = n; e < o; e++) l.push(new Wf(a.maps[e]));
11422
+ let u = new e(this.items.slice(0, i).append(l).append(r), s);
11423
+ return u.emptyItemCount() > Vf && (u = u.compress(this.items.length - r.length)), u;
11424
+ }
11425
+ emptyItemCount() {
11426
+ let e = 0;
11427
+ return this.items.forEach((t) => {
11428
+ t.step || e++;
11429
+ }), e;
11430
+ }
11431
+ compress(t = this.items.length) {
11432
+ let n = this.remapping(0, t), r = n.maps.length, i = [], a = 0;
11433
+ return this.items.forEach((e, o) => {
11434
+ if (o >= t) i.push(e), e.selection && a++;
11435
+ else if (e.step) {
11436
+ let t = e.step.map(n.slice(r)), o = t && t.getMap();
11437
+ if (r--, o && n.appendMap(o, r), t) {
11438
+ let s = e.selection && e.selection.map(n.slice(r));
11439
+ s && a++;
11440
+ let c = new Wf(o.invert(), t, s), l, u = i.length - 1;
11441
+ (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
11636
11442
  }
11637
- }, {
11638
- type: "text",
11639
- text: " "
11640
- }]).run(), (a = e.view.dom.ownerDocument.defaultView?.getSelection()) == null || a.collapseToEnd();
11641
- },
11642
- allow: ({ state: e, range: t }) => {
11643
- let r = e.doc.resolve(t.from), i = e.schema.nodes[n];
11644
- return !!r.parent.type.contentMatch.matchType(i);
11645
- },
11646
- ...t
11647
- };
11443
+ } else e.map && r--;
11444
+ }, this.items.length, 0), new e(Y.from(i.reverse()), a);
11445
+ }
11446
+ };
11447
+ Hf.empty = new Hf(Y.empty, 0);
11448
+ function Uf(e, t) {
11449
+ let n;
11450
+ return e.forEach((e, r) => {
11451
+ if (e.selection && t-- == 0) return n = r, !1;
11452
+ }), e.slice(n);
11453
+ }
11454
+ var Wf = class e {
11455
+ constructor(e, t, n, r) {
11456
+ this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
11457
+ }
11458
+ merge(t) {
11459
+ if (this.step && t.step && !t.selection) {
11460
+ let n = t.step.merge(this.step);
11461
+ if (n) return new e(n.getMap().invert(), n, this.selection);
11462
+ }
11463
+ }
11464
+ }, Gf = class {
11465
+ constructor(e, t, n, r, i) {
11466
+ this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
11467
+ }
11468
+ }, Kf = 20;
11469
+ function qf(e, t, n, r) {
11470
+ let i = n.getMeta(tp), a;
11471
+ if (i) return i.historyState;
11472
+ n.getMeta(np) && (e = new Gf(e.done, e.undone, null, 0, -1));
11473
+ let o = n.getMeta("appendedTransaction");
11474
+ if (n.steps.length == 0) return e;
11475
+ if (o && o.getMeta(tp)) return o.getMeta(tp).redo ? new Gf(e.done.addTransform(n, void 0, r, ep(t)), e.undone, Yf(n.mapping.maps), e.prevTime, e.prevComposition) : new Gf(e.done, e.undone.addTransform(n, void 0, r, ep(t)), null, e.prevTime, e.prevComposition);
11476
+ if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
11477
+ let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Jf(n, e.prevRanges)), s = o ? Xf(e.prevRanges, n.mapping) : Yf(n.mapping.maps);
11478
+ return new Gf(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, ep(t)), Hf.empty, s, n.time, i ?? e.prevComposition);
11479
+ } else if (a = n.getMeta("rebased")) return new Gf(e.done.rebased(n, a), e.undone.rebased(n, a), Xf(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
11480
+ else return new Gf(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), Xf(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
11481
+ }
11482
+ function Jf(e, t) {
11483
+ if (!t) return !1;
11484
+ if (!e.docChanged) return !0;
11485
+ let n = !1;
11486
+ return e.mapping.maps[0].forEach((e, r) => {
11487
+ for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
11488
+ }), n;
11489
+ }
11490
+ function Yf(e) {
11491
+ let t = [];
11492
+ for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
11493
+ return t;
11494
+ }
11495
+ function Xf(e, t) {
11496
+ if (!e) return null;
11497
+ let n = [];
11498
+ for (let r = 0; r < e.length; r += 2) {
11499
+ let i = t.map(e[r], 1), a = t.map(e[r + 1], -1);
11500
+ i <= a && n.push(i, a);
11501
+ }
11502
+ return n;
11648
11503
  }
11649
- function Xp(e) {
11650
- return (e.options.suggestions.length ? e.options.suggestions : [e.options.suggestion]).map((t) => Yp({
11651
- editor: e.editor,
11652
- overrideSuggestionOptions: t,
11653
- extensionName: e.name,
11654
- char: t.char
11655
- }));
11504
+ function Zf(e, t, n) {
11505
+ let r = ep(t), i = tp.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
11506
+ if (!a) return null;
11507
+ let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Gf(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
11508
+ return a.transform.setSelection(o).setMeta(tp, {
11509
+ redo: n,
11510
+ historyState: c
11511
+ });
11656
11512
  }
11657
- function Zp(e, t) {
11658
- let n = Xp(e);
11659
- return n.find((e) => e.char === t) || (n.length ? n[0] : null);
11513
+ var Qf = !1, $f = null;
11514
+ function ep(e) {
11515
+ let t = e.plugins;
11516
+ if ($f != t) {
11517
+ Qf = !1, $f = t;
11518
+ for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
11519
+ Qf = !0;
11520
+ break;
11521
+ }
11522
+ }
11523
+ return Qf;
11660
11524
  }
11661
- var Qp = J.create({
11662
- name: "mention",
11663
- priority: 101,
11525
+ var tp = new P("history"), np = new P("closeHistory");
11526
+ function rp(e = {}) {
11527
+ return e = {
11528
+ depth: e.depth || 100,
11529
+ newGroupDelay: e.newGroupDelay || 500
11530
+ }, new N({
11531
+ key: tp,
11532
+ state: {
11533
+ init() {
11534
+ return new Gf(Hf.empty, Hf.empty, null, 0, -1);
11535
+ },
11536
+ apply(t, n, r) {
11537
+ return qf(n, r, t, e);
11538
+ }
11539
+ },
11540
+ config: e,
11541
+ props: { handleDOMEvents: { beforeinput(e, t) {
11542
+ let n = t.inputType, r = n == "historyUndo" ? ap : n == "historyRedo" ? op : null;
11543
+ return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
11544
+ } } }
11545
+ });
11546
+ }
11547
+ function ip(e, t) {
11548
+ return (n, r) => {
11549
+ let i = tp.getState(n);
11550
+ if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
11551
+ if (r) {
11552
+ let a = Zf(i, n, e);
11553
+ a && r(t ? a.scrollIntoView() : a);
11554
+ }
11555
+ return !0;
11556
+ };
11557
+ }
11558
+ var ap = ip(!1, !0), op = ip(!0, !0), sp = q.create({
11559
+ name: "characterCount",
11664
11560
  addOptions() {
11665
11561
  return {
11666
- HTMLAttributes: {},
11667
- renderText({ node: e, suggestion: t }) {
11668
- return `${t?.char ?? "@"}${e.attrs.label ?? e.attrs.id}`;
11669
- },
11670
- deleteTriggerWithBackspace: !1,
11671
- renderHTML({ options: e, node: t, suggestion: n }) {
11672
- return [
11673
- "span",
11674
- K(this.HTMLAttributes, e.HTMLAttributes),
11675
- `${n?.char ?? "@"}${t.attrs.label ?? t.attrs.id}`
11676
- ];
11677
- },
11678
- suggestions: [],
11679
- suggestion: {}
11562
+ limit: null,
11563
+ mode: "textSize",
11564
+ textCounter: (e) => e.length,
11565
+ wordCounter: (e) => e.split(" ").filter((e) => e !== "").length
11680
11566
  };
11681
11567
  },
11682
- group: "inline",
11683
- inline: !0,
11684
- selectable: !1,
11685
- atom: !0,
11686
- addAttributes() {
11568
+ addStorage() {
11687
11569
  return {
11688
- id: {
11689
- default: null,
11690
- parseHTML: (e) => e.getAttribute("data-id"),
11691
- renderHTML: (e) => e.id ? { "data-id": e.id } : {}
11692
- },
11693
- label: {
11694
- default: null,
11695
- parseHTML: (e) => e.getAttribute("data-label"),
11696
- renderHTML: (e) => e.label ? { "data-label": e.label } : {}
11697
- },
11698
- mentionSuggestionChar: {
11699
- default: "@",
11700
- parseHTML: (e) => e.getAttribute("data-mention-suggestion-char"),
11701
- renderHTML: (e) => ({ "data-mention-suggestion-char": e.mentionSuggestionChar })
11702
- }
11570
+ characters: () => 0,
11571
+ words: () => 0
11703
11572
  };
11704
11573
  },
11705
- parseHTML() {
11706
- return [{ tag: `span[data-type="${this.name}"]` }];
11707
- },
11708
- renderHTML({ node: e, HTMLAttributes: t }) {
11709
- let n = Zp(this, e.attrs.mentionSuggestionChar);
11710
- if (this.options.renderLabel !== void 0) return console.warn("renderLabel is deprecated use renderText and renderHTML instead"), [
11711
- "span",
11712
- K({ "data-type": this.name }, this.options.HTMLAttributes, t),
11713
- this.options.renderLabel({
11714
- options: this.options,
11715
- node: e,
11716
- suggestion: n
11717
- })
11718
- ];
11719
- let r = { ...this.options };
11720
- r.HTMLAttributes = K({ "data-type": this.name }, this.options.HTMLAttributes, t);
11721
- let i = this.options.renderHTML({
11722
- options: r,
11723
- node: e,
11724
- suggestion: n
11725
- });
11726
- return typeof i == "string" ? [
11727
- "span",
11728
- K({ "data-type": this.name }, this.options.HTMLAttributes, t),
11729
- i
11730
- ] : i;
11731
- },
11732
- ...tf({
11733
- nodeName: "mention",
11734
- name: "@",
11735
- selfClosing: !0,
11736
- allowedAttributes: [
11737
- "id",
11738
- "label",
11739
- {
11740
- name: "mentionSuggestionChar",
11741
- skipIfDefault: "@"
11742
- }
11743
- ],
11744
- parseAttributes: (e) => {
11745
- let t = {}, n = /(\w+)=(?:"([^"]*)"|'([^']*)')/g, r = n.exec(e);
11746
- for (; r !== null;) {
11747
- let [, i, a, o] = r;
11748
- t[i === "char" ? "mentionSuggestionChar" : i] = a ?? o, r = n.exec(e);
11574
+ onBeforeCreate() {
11575
+ this.storage.characters = (e) => {
11576
+ let t = e?.node || this.editor.state.doc;
11577
+ if ((e?.mode || this.options.mode) === "textSize") {
11578
+ let e = t.textBetween(0, t.content.size, void 0, " ");
11579
+ return this.options.textCounter(e);
11749
11580
  }
11750
- return t;
11751
- },
11752
- serializeAttributes: (e) => Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => `${e === "mentionSuggestionChar" ? "char" : e}="${t}"`).join(" ")
11753
- }),
11754
- renderText({ node: e }) {
11755
- let t = {
11756
- options: this.options,
11757
- node: e,
11758
- suggestion: Zp(this, e.attrs.mentionSuggestionChar)
11581
+ return t.nodeSize;
11582
+ }, this.storage.words = (e) => {
11583
+ let t = e?.node || this.editor.state.doc, n = t.textBetween(0, t.content.size, " ", " ");
11584
+ return this.options.wordCounter(n);
11759
11585
  };
11760
- return this.options.renderLabel === void 0 ? this.options.renderText(t) : (console.warn("renderLabel is deprecated use renderText and renderHTML instead"), this.options.renderLabel(t));
11761
- },
11762
- addKeyboardShortcuts() {
11763
- return { Backspace: () => this.editor.commands.command(({ tr: e, state: t }) => {
11764
- let n = !1, { selection: r } = t, { empty: i, anchor: a } = r;
11765
- if (!i) return !1;
11766
- let o = new je(), s = 0;
11767
- return t.doc.nodesBetween(a - 1, a, (e, t) => {
11768
- if (e.type.name === this.name) return n = !0, o = e, s = t, !1;
11769
- }), n && e.insertText(this.options.deleteTriggerWithBackspace ? "" : o.attrs.mentionSuggestionChar, s, s + o.nodeSize), n;
11770
- }) };
11771
11586
  },
11772
11587
  addProseMirrorPlugins() {
11773
- return Xp(this).map(Hp);
11774
- }
11775
- });
11776
- //#endregion
11777
- //#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
11778
- function $p(e = {}) {
11779
- return new N({ view(t) {
11780
- return new em(t, e);
11781
- } });
11782
- }
11783
- var em = class {
11784
- constructor(e, t) {
11785
- this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
11786
- "dragover",
11787
- "dragend",
11788
- "drop",
11789
- "dragleave"
11790
- ].map((t) => {
11791
- let n = (e) => {
11792
- this[t](e);
11793
- };
11794
- return e.dom.addEventListener(t, n), {
11795
- name: t,
11796
- handler: n
11797
- };
11798
- });
11799
- }
11800
- destroy() {
11801
- this.handlers.forEach(({ name: e, handler: t }) => this.editorView.dom.removeEventListener(e, t));
11802
- }
11803
- update(e, t) {
11804
- this.cursorPos != null && t.doc != e.state.doc && (this.cursorPos > e.state.doc.content.size ? this.setCursor(null) : this.updateOverlay());
11805
- }
11806
- setCursor(e) {
11807
- e != this.cursorPos && (this.cursorPos = e, e == null ? (this.element.parentNode.removeChild(this.element), this.element = null) : this.updateOverlay());
11808
- }
11809
- updateOverlay() {
11810
- let e = this.editorView.state.doc.resolve(this.cursorPos), t = !e.parent.inlineContent, n, r = this.editorView.dom, i = r.getBoundingClientRect(), a = i.width / r.offsetWidth, o = i.height / r.offsetHeight;
11811
- if (t) {
11812
- let t = e.nodeBefore, r = e.nodeAfter;
11813
- if (t || r) {
11814
- let e = this.editorView.nodeDOM(this.cursorPos - (t ? t.nodeSize : 0));
11815
- if (e) {
11816
- let i = e.getBoundingClientRect(), a = t ? i.bottom : i.top;
11817
- t && r && (a = (a + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2);
11818
- let s = this.width / 2 * o;
11819
- n = {
11820
- left: i.left,
11821
- right: i.right,
11822
- top: a - s,
11823
- bottom: a + s
11824
- };
11588
+ let e = !1;
11589
+ return [new N({
11590
+ key: new P("characterCount"),
11591
+ appendTransaction: (t, n, r) => {
11592
+ if (e) return;
11593
+ let i = this.options.limit;
11594
+ if (i == null || i === 0) {
11595
+ e = !0;
11596
+ return;
11825
11597
  }
11598
+ let a = this.storage.characters({ node: r.doc });
11599
+ if (a > i) {
11600
+ let t = a - i;
11601
+ console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);
11602
+ let n = r.tr.deleteRange(0, t);
11603
+ return e = !0, n;
11604
+ }
11605
+ e = !0;
11606
+ },
11607
+ filterTransaction: (e, t) => {
11608
+ let n = this.options.limit;
11609
+ if (!e.docChanged || n === 0 || n == null) return !0;
11610
+ let r = this.storage.characters({ node: t.doc }), i = this.storage.characters({ node: e.doc });
11611
+ if (i <= n || r > n && i > n && i <= r) return !0;
11612
+ if (r > n && i > n && i > r || !e.getMeta("paste")) return !1;
11613
+ let a = e.selection.$head.pos, o = a - (i - n), s = a;
11614
+ return e.deleteRange(o, s), !(this.storage.characters({ node: e.doc }) > n);
11826
11615
  }
11827
- }
11828
- if (!n) {
11829
- let e = this.editorView.coordsAtPos(this.cursorPos), t = this.width / 2 * a;
11830
- n = {
11831
- left: e.left - t,
11832
- right: e.left + t,
11833
- top: e.top,
11834
- bottom: e.bottom
11835
- };
11836
- }
11837
- let s = this.editorView.dom.offsetParent;
11838
- this.element || (this.element = s.appendChild(document.createElement("div")), this.class && (this.element.className = this.class), this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;", this.color && (this.element.style.backgroundColor = this.color)), this.element.classList.toggle("prosemirror-dropcursor-block", t), this.element.classList.toggle("prosemirror-dropcursor-inline", !t);
11839
- let c, l;
11840
- if (!s || s == document.body && getComputedStyle(s).position == "static") c = -pageXOffset, l = -pageYOffset;
11841
- else {
11842
- let e = s.getBoundingClientRect(), t = e.width / s.offsetWidth, n = e.height / s.offsetHeight;
11843
- c = e.left - s.scrollLeft * t, l = e.top - s.scrollTop * n;
11844
- }
11845
- this.element.style.left = (n.left - c) / a + "px", this.element.style.top = (n.top - l) / o + "px", this.element.style.width = (n.right - n.left) / a + "px", this.element.style.height = (n.bottom - n.top) / o + "px";
11846
- }
11847
- scheduleRemoval(e) {
11848
- clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(null), e);
11849
- }
11850
- dragover(e) {
11851
- if (!this.editorView.editable) return;
11852
- let t = this.editorView.posAtCoords({
11853
- left: e.clientX,
11854
- top: e.clientY
11855
- }), n = t && t.inside >= 0 && this.editorView.state.doc.nodeAt(t.inside), r = n && n.type.spec.disableDropCursor, i = typeof r == "function" ? r(this.editorView, t, e) : r;
11856
- if (t && !i) {
11857
- let e = t.pos;
11858
- if (this.editorView.dragging && this.editorView.dragging.slice) {
11859
- let t = yn(this.editorView.state.doc, e, this.editorView.dragging.slice);
11860
- t != null && (e = t);
11861
- }
11862
- this.setCursor(e), this.scheduleRemoval(5e3);
11863
- }
11864
- }
11865
- dragend() {
11866
- this.scheduleRemoval(20);
11867
- }
11868
- drop() {
11869
- this.scheduleRemoval(20);
11870
- }
11871
- dragleave(e) {
11872
- this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
11873
- }
11874
- }, tm = class e extends A {
11875
- constructor(e) {
11876
- super(e, e);
11616
+ })];
11877
11617
  }
11878
- map(t, n) {
11879
- let r = t.resolve(n.map(this.head));
11880
- return e.valid(r) ? new e(r) : A.near(r);
11618
+ }), cp = q.create({
11619
+ name: "dropCursor",
11620
+ addOptions() {
11621
+ return {
11622
+ color: "currentColor",
11623
+ width: 1,
11624
+ class: void 0
11625
+ };
11626
+ },
11627
+ addProseMirrorPlugins() {
11628
+ return [Tf(this.options)];
11881
11629
  }
11882
- content() {
11883
- return D.empty;
11630
+ });
11631
+ q.create({
11632
+ name: "focus",
11633
+ addOptions() {
11634
+ return {
11635
+ className: "has-focus",
11636
+ mode: "all"
11637
+ };
11638
+ },
11639
+ addProseMirrorPlugins() {
11640
+ return [new N({
11641
+ key: new P("focus"),
11642
+ props: { decorations: ({ doc: e, selection: t }) => {
11643
+ let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
11644
+ if (!n || !r) return B.create(e, []);
11645
+ let o = 0;
11646
+ this.options.mode === "deepest" && e.descendants((e, t) => {
11647
+ if (!e.isText) {
11648
+ if (!(i >= t && i <= t + e.nodeSize - 1)) return !1;
11649
+ o += 1;
11650
+ }
11651
+ });
11652
+ let s = 0;
11653
+ return e.descendants((e, t) => {
11654
+ if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
11655
+ if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
11656
+ a.push(Es.node(t, t + e.nodeSize, { class: this.options.className }));
11657
+ }), B.create(e, a);
11658
+ } }
11659
+ })];
11884
11660
  }
11885
- eq(t) {
11886
- return t instanceof e && t.head == this.head;
11661
+ });
11662
+ var lp = q.create({
11663
+ name: "gapCursor",
11664
+ addProseMirrorPlugins() {
11665
+ return [Mf()];
11666
+ },
11667
+ extendNodeSchema(e) {
11668
+ return { allowGapCursor: G(W(e, "allowGapCursor", {
11669
+ name: e.name,
11670
+ options: e.options,
11671
+ storage: e.storage
11672
+ })) ?? null };
11887
11673
  }
11888
- toJSON() {
11674
+ }), up = "placeholder";
11675
+ function dp(e) {
11676
+ return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
11677
+ }
11678
+ var fp = q.create({
11679
+ name: "placeholder",
11680
+ addOptions() {
11889
11681
  return {
11890
- type: "gapcursor",
11891
- pos: this.head
11682
+ emptyEditorClass: "is-editor-empty",
11683
+ emptyNodeClass: "is-empty",
11684
+ dataAttribute: up,
11685
+ placeholder: "Write something …",
11686
+ showOnlyWhenEditable: !0,
11687
+ showOnlyCurrent: !0,
11688
+ includeChildren: !1
11892
11689
  };
11690
+ },
11691
+ addProseMirrorPlugins() {
11692
+ let e = this.options.dataAttribute ? `data-${dp(this.options.dataAttribute)}` : `data-${up}`;
11693
+ return [new N({
11694
+ key: new P("placeholder"),
11695
+ props: { decorations: ({ doc: t, selection: n }) => {
11696
+ let r = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: i } = n, a = [];
11697
+ if (!r) return null;
11698
+ let o = this.editor.isEmpty;
11699
+ return t.descendants((t, n) => {
11700
+ let r = i >= n && i <= n + t.nodeSize, s = !t.isLeaf && Au(t);
11701
+ if (!t.type.isTextblock) return this.options.includeChildren;
11702
+ if ((r || !this.options.showOnlyCurrent) && s) {
11703
+ let i = [this.options.emptyNodeClass];
11704
+ o && i.push(this.options.emptyEditorClass);
11705
+ let s = Es.node(n, n + t.nodeSize, {
11706
+ class: i.join(" "),
11707
+ [e]: typeof this.options.placeholder == "function" ? this.options.placeholder({
11708
+ editor: this.editor,
11709
+ node: t,
11710
+ pos: n,
11711
+ hasAnchor: r
11712
+ }) : this.options.placeholder
11713
+ });
11714
+ a.push(s);
11715
+ }
11716
+ return this.options.includeChildren;
11717
+ }), B.create(t, a);
11718
+ } }
11719
+ })];
11893
11720
  }
11894
- static fromJSON(t, n) {
11895
- if (typeof n.pos != "number") throw RangeError("Invalid input for GapCursor.fromJSON");
11896
- return new e(t.resolve(n.pos));
11721
+ });
11722
+ q.create({
11723
+ name: "selection",
11724
+ addOptions() {
11725
+ return { className: "selection" };
11726
+ },
11727
+ addProseMirrorPlugins() {
11728
+ let { editor: e, options: t } = this;
11729
+ return [new N({
11730
+ key: new P("selection"),
11731
+ props: { decorations(n) {
11732
+ return n.selection.empty || e.isFocused || !e.isEditable || ju(n.selection) || e.view.dragging ? null : B.create(n.doc, [Es.inline(n.selection.from, n.selection.to, { class: t.className })]);
11733
+ } }
11734
+ })];
11897
11735
  }
11898
- getBookmark() {
11899
- return new nm(this.anchor);
11736
+ });
11737
+ function pp({ types: e, node: t }) {
11738
+ return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
11739
+ }
11740
+ var mp = q.create({
11741
+ name: "trailingNode",
11742
+ addOptions() {
11743
+ return {
11744
+ node: void 0,
11745
+ notAfter: []
11746
+ };
11747
+ },
11748
+ addProseMirrorPlugins() {
11749
+ let e = new P(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
11750
+ return [new N({
11751
+ key: e,
11752
+ appendTransaction: (n, r, i) => {
11753
+ let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
11754
+ if (!n.some((e) => e.getMeta("skipTrailingNode")) && c) return o.insert(l, u.create());
11755
+ },
11756
+ state: {
11757
+ init: (e, t) => {
11758
+ let r = t.tr.doc.lastChild;
11759
+ return !pp({
11760
+ node: r,
11761
+ types: n
11762
+ });
11763
+ },
11764
+ apply: (e, t) => {
11765
+ if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
11766
+ let r = e.doc.lastChild;
11767
+ return !pp({
11768
+ node: r,
11769
+ types: n
11770
+ });
11771
+ }
11772
+ }
11773
+ })];
11900
11774
  }
11901
- static valid(e) {
11902
- let t = e.parent;
11903
- if (t.inlineContent || !im(e) || !am(e)) return !1;
11904
- let n = t.type.spec.allowGapCursor;
11905
- if (n != null) return n;
11906
- let r = t.contentMatchAt(e.index()).defaultType;
11907
- return r && r.isTextblock;
11775
+ }), hp = q.create({
11776
+ name: "undoRedo",
11777
+ addOptions() {
11778
+ return {
11779
+ depth: 100,
11780
+ newGroupDelay: 500
11781
+ };
11782
+ },
11783
+ addCommands() {
11784
+ return {
11785
+ undo: () => ({ state: e, dispatch: t }) => ap(e, t),
11786
+ redo: () => ({ state: e, dispatch: t }) => op(e, t)
11787
+ };
11788
+ },
11789
+ addProseMirrorPlugins() {
11790
+ return [rp(this.options)];
11791
+ },
11792
+ addKeyboardShortcuts() {
11793
+ return {
11794
+ "Mod-z": () => this.editor.commands.undo(),
11795
+ "Shift-Mod-z": () => this.editor.commands.redo(),
11796
+ "Mod-y": () => this.editor.commands.redo(),
11797
+ "Mod-я": () => this.editor.commands.undo(),
11798
+ "Shift-Mod-я": () => this.editor.commands.redo()
11799
+ };
11908
11800
  }
11909
- static findGapCursorFrom(t, n, r = !1) {
11910
- search: for (;;) {
11911
- if (!r && e.valid(t)) return t;
11912
- let i = t.pos, a = null;
11913
- for (let r = t.depth;; r--) {
11914
- let o = t.node(r);
11915
- if (n > 0 ? t.indexAfter(r) < o.childCount : t.index(r) > 0) {
11916
- a = o.child(n > 0 ? t.indexAfter(r) : t.index(r) - 1);
11917
- break;
11918
- } else if (r == 0) return null;
11919
- i += n;
11920
- let s = t.doc.resolve(i);
11921
- if (e.valid(s)) return s;
11801
+ }), { getOwnPropertyNames: gp, getOwnPropertySymbols: _p } = Object, { hasOwnProperty: vp } = Object.prototype;
11802
+ function yp(e, t) {
11803
+ return function(n, r, i) {
11804
+ return e(n, r, i) && t(n, r, i);
11805
+ };
11806
+ }
11807
+ function bp(e) {
11808
+ return function(t, n, r) {
11809
+ if (!t || !n || typeof t != "object" || typeof n != "object") return e(t, n, r);
11810
+ let { cache: i } = r, a = i.get(t), o = i.get(n);
11811
+ if (a && o) return a === n && o === t;
11812
+ i.set(t, n), i.set(n, t);
11813
+ let s = e(t, n, r);
11814
+ return i.delete(t), i.delete(n), s;
11815
+ };
11816
+ }
11817
+ function xp(e) {
11818
+ return e?.[Symbol.toStringTag];
11819
+ }
11820
+ function Sp(e) {
11821
+ return gp(e).concat(_p(e));
11822
+ }
11823
+ var Cp = Object.hasOwn || ((e, t) => vp.call(e, t));
11824
+ function wp(e, t) {
11825
+ return e === t || !e && !t && e !== e && t !== t;
11826
+ }
11827
+ var Tp = "__v", Ep = "__o", Dp = "_owner", { getOwnPropertyDescriptor: Op, keys: kp } = Object;
11828
+ function Ap(e, t) {
11829
+ return e.byteLength === t.byteLength && Up(new Uint8Array(e), new Uint8Array(t));
11830
+ }
11831
+ function jp(e, t, n) {
11832
+ let r = e.length;
11833
+ if (t.length !== r) return !1;
11834
+ for (; r-- > 0;) if (!n.equals(e[r], t[r], r, r, e, t, n)) return !1;
11835
+ return !0;
11836
+ }
11837
+ function Mp(e, t) {
11838
+ return e.byteLength === t.byteLength && Up(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
11839
+ }
11840
+ function Np(e, t) {
11841
+ return wp(e.getTime(), t.getTime());
11842
+ }
11843
+ function Pp(e, t) {
11844
+ return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
11845
+ }
11846
+ function Fp(e, t) {
11847
+ return e === t;
11848
+ }
11849
+ function Ip(e, t, n) {
11850
+ let r = e.size;
11851
+ if (r !== t.size) return !1;
11852
+ if (!r) return !0;
11853
+ let i = Array(r), a = e.entries(), o, s, c = 0;
11854
+ for (; (o = a.next()) && !o.done;) {
11855
+ let r = t.entries(), a = !1, l = 0;
11856
+ for (; (s = r.next()) && !s.done;) {
11857
+ if (i[l]) {
11858
+ l++;
11859
+ continue;
11922
11860
  }
11923
- for (;;) {
11924
- let o = n > 0 ? a.firstChild : a.lastChild;
11925
- if (!o) {
11926
- if (a.isAtom && !a.isText && !M.isSelectable(a)) {
11927
- t = t.doc.resolve(i + a.nodeSize * n), r = !1;
11928
- continue search;
11929
- }
11930
- break;
11931
- }
11932
- a = o, i += n;
11933
- let s = t.doc.resolve(i);
11934
- if (e.valid(s)) return s;
11861
+ let r = o.value, u = s.value;
11862
+ if (n.equals(r[0], u[0], c, l, e, t, n) && n.equals(r[1], u[1], r[0], u[0], e, t, n)) {
11863
+ a = i[l] = !0;
11864
+ break;
11935
11865
  }
11936
- return null;
11866
+ l++;
11937
11867
  }
11868
+ if (!a) return !1;
11869
+ c++;
11938
11870
  }
11939
- };
11940
- tm.prototype.visible = !1, tm.findFrom = tm.findGapCursorFrom, A.jsonID("gapcursor", tm);
11941
- var nm = class e {
11942
- constructor(e) {
11943
- this.pos = e;
11944
- }
11945
- map(t) {
11946
- return new e(t.map(this.pos));
11947
- }
11948
- resolve(e) {
11949
- let t = e.resolve(this.pos);
11950
- return tm.valid(t) ? new tm(t) : A.near(t);
11951
- }
11952
- };
11953
- function rm(e) {
11954
- return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
11871
+ return !0;
11955
11872
  }
11956
- function im(e) {
11957
- for (let t = e.depth; t >= 0; t--) {
11958
- let n = e.index(t), r = e.node(t);
11959
- if (n == 0) {
11960
- if (r.type.spec.isolating) return !0;
11961
- continue;
11962
- }
11963
- for (let e = r.child(n - 1);; e = e.lastChild) {
11964
- if (e.childCount == 0 && !e.inlineContent || rm(e.type)) return !0;
11965
- if (e.inlineContent) return !1;
11966
- }
11967
- }
11873
+ var Lp = wp;
11874
+ function Rp(e, t, n) {
11875
+ let r = kp(e), i = r.length;
11876
+ if (kp(t).length !== i) return !1;
11877
+ for (; i-- > 0;) if (!Gp(e, t, n, r[i])) return !1;
11968
11878
  return !0;
11969
11879
  }
11970
- function am(e) {
11971
- for (let t = e.depth; t >= 0; t--) {
11972
- let n = e.indexAfter(t), r = e.node(t);
11973
- if (n == r.childCount) {
11974
- if (r.type.spec.isolating) return !0;
11975
- continue;
11976
- }
11977
- for (let e = r.child(n);; e = e.firstChild) {
11978
- if (e.childCount == 0 && !e.inlineContent || rm(e.type)) return !0;
11979
- if (e.inlineContent) return !1;
11880
+ function zp(e, t, n) {
11881
+ let r = Sp(e), i = r.length;
11882
+ if (Sp(t).length !== i) return !1;
11883
+ let a, o, s;
11884
+ for (; i-- > 0;) if (a = r[i], !Gp(e, t, n, a) || (o = Op(e, a), s = Op(t, a), (o || s) && (!o || !s || o.configurable !== s.configurable || o.enumerable !== s.enumerable || o.writable !== s.writable))) return !1;
11885
+ return !0;
11886
+ }
11887
+ function Bp(e, t) {
11888
+ return wp(e.valueOf(), t.valueOf());
11889
+ }
11890
+ function Vp(e, t) {
11891
+ return e.source === t.source && e.flags === t.flags;
11892
+ }
11893
+ function Hp(e, t, n) {
11894
+ let r = e.size;
11895
+ if (r !== t.size) return !1;
11896
+ if (!r) return !0;
11897
+ let i = Array(r), a = e.values(), o, s;
11898
+ for (; (o = a.next()) && !o.done;) {
11899
+ let r = t.values(), a = !1, c = 0;
11900
+ for (; (s = r.next()) && !s.done;) {
11901
+ if (!i[c] && n.equals(o.value, s.value, o.value, s.value, e, t, n)) {
11902
+ a = i[c] = !0;
11903
+ break;
11904
+ }
11905
+ c++;
11980
11906
  }
11907
+ if (!a) return !1;
11981
11908
  }
11982
11909
  return !0;
11983
11910
  }
11984
- function om() {
11985
- return new N({ props: {
11986
- decorations: dm,
11987
- createSelectionBetween(e, t, n) {
11988
- return t.pos == n.pos && tm.valid(n) ? new tm(n) : null;
11989
- },
11990
- handleClick: lm,
11991
- handleKeyDown: sm,
11992
- handleDOMEvents: { beforeinput: um }
11993
- } });
11911
+ function Up(e, t) {
11912
+ let n = e.byteLength;
11913
+ if (t.byteLength !== n || e.byteOffset !== t.byteOffset) return !1;
11914
+ for (; n-- > 0;) if (e[n] !== t[n]) return !1;
11915
+ return !0;
11994
11916
  }
11995
- var sm = Dc({
11996
- ArrowLeft: cm("horiz", -1),
11997
- ArrowRight: cm("horiz", 1),
11998
- ArrowUp: cm("vert", -1),
11999
- ArrowDown: cm("vert", 1)
12000
- });
12001
- function cm(e, t) {
12002
- let n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
12003
- return function(e, r, i) {
12004
- let a = e.selection, o = t > 0 ? a.$to : a.$from, s = a.empty;
12005
- if (a instanceof j) {
12006
- if (!i.endOfTextblock(n) || o.depth == 0) return !1;
12007
- s = !1, o = e.doc.resolve(t > 0 ? o.after() : o.before());
11917
+ function Wp(e, t) {
11918
+ return e.hostname === t.hostname && e.pathname === t.pathname && e.protocol === t.protocol && e.port === t.port && e.hash === t.hash && e.username === t.username && e.password === t.password;
11919
+ }
11920
+ function Gp(e, t, n, r) {
11921
+ return (r === Dp || r === Ep || r === Tp) && (e.$$typeof || t.$$typeof) ? !0 : Cp(t, r) && n.equals(e[r], t[r], r, r, e, t, n);
11922
+ }
11923
+ var Kp = "[object ArrayBuffer]", qp = "[object Arguments]", Jp = "[object Boolean]", Yp = "[object DataView]", Xp = "[object Date]", Zp = "[object Error]", Qp = "[object Map]", $p = "[object Number]", em = "[object Object]", tm = "[object RegExp]", nm = "[object Set]", rm = "[object String]", im = {
11924
+ "[object Int8Array]": !0,
11925
+ "[object Uint8Array]": !0,
11926
+ "[object Uint8ClampedArray]": !0,
11927
+ "[object Int16Array]": !0,
11928
+ "[object Uint16Array]": !0,
11929
+ "[object Int32Array]": !0,
11930
+ "[object Uint32Array]": !0,
11931
+ "[object Float16Array]": !0,
11932
+ "[object Float32Array]": !0,
11933
+ "[object Float64Array]": !0,
11934
+ "[object BigInt64Array]": !0,
11935
+ "[object BigUint64Array]": !0
11936
+ }, am = "[object URL]", om = Object.prototype.toString;
11937
+ function sm({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n, areDatesEqual: r, areErrorsEqual: i, areFunctionsEqual: a, areMapsEqual: o, areNumbersEqual: s, areObjectsEqual: c, arePrimitiveWrappersEqual: l, areRegExpsEqual: u, areSetsEqual: d, areTypedArraysEqual: f, areUrlsEqual: p, unknownTagComparators: m }) {
11938
+ return function(h, g, _) {
11939
+ if (h === g) return !0;
11940
+ if (h == null || g == null) return !1;
11941
+ let v = typeof h;
11942
+ if (v !== typeof g) return !1;
11943
+ if (v !== "object") return v === "number" ? s(h, g, _) : v === "function" ? a(h, g, _) : !1;
11944
+ let y = h.constructor;
11945
+ if (y !== g.constructor) return !1;
11946
+ if (y === Object) return c(h, g, _);
11947
+ if (Array.isArray(h)) return t(h, g, _);
11948
+ if (y === Date) return r(h, g, _);
11949
+ if (y === RegExp) return u(h, g, _);
11950
+ if (y === Map) return o(h, g, _);
11951
+ if (y === Set) return d(h, g, _);
11952
+ let b = om.call(h);
11953
+ if (b === Xp) return r(h, g, _);
11954
+ if (b === tm) return u(h, g, _);
11955
+ if (b === Qp) return o(h, g, _);
11956
+ if (b === nm) return d(h, g, _);
11957
+ if (b === em) return typeof h.then != "function" && typeof g.then != "function" && c(h, g, _);
11958
+ if (b === am) return p(h, g, _);
11959
+ if (b === Zp) return i(h, g, _);
11960
+ if (b === qp) return c(h, g, _);
11961
+ if (im[b]) return f(h, g, _);
11962
+ if (b === Kp) return e(h, g, _);
11963
+ if (b === Yp) return n(h, g, _);
11964
+ if (b === Jp || b === $p || b === rm) return l(h, g, _);
11965
+ if (m) {
11966
+ let e = m[b];
11967
+ if (!e) {
11968
+ let t = xp(h);
11969
+ t && (e = m[t]);
11970
+ }
11971
+ if (e) return e(h, g, _);
12008
11972
  }
12009
- let c = tm.findGapCursorFrom(o, t, s);
12010
- return c ? (r && r(e.tr.setSelection(new tm(c))), !0) : !1;
11973
+ return !1;
12011
11974
  };
12012
11975
  }
12013
- function lm(e, t, n) {
12014
- if (!e || !e.editable) return !1;
12015
- let r = e.state.doc.resolve(t);
12016
- if (!tm.valid(r)) return !1;
12017
- let i = e.posAtCoords({
12018
- left: n.clientX,
12019
- top: n.clientY
12020
- });
12021
- return i && i.inside > -1 && M.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new tm(r))), !0);
11976
+ function cm({ circular: e, createCustomConfig: t, strict: n }) {
11977
+ let r = {
11978
+ areArrayBuffersEqual: Ap,
11979
+ areArraysEqual: n ? zp : jp,
11980
+ areDataViewsEqual: Mp,
11981
+ areDatesEqual: Np,
11982
+ areErrorsEqual: Pp,
11983
+ areFunctionsEqual: Fp,
11984
+ areMapsEqual: n ? yp(Ip, zp) : Ip,
11985
+ areNumbersEqual: Lp,
11986
+ areObjectsEqual: n ? zp : Rp,
11987
+ arePrimitiveWrappersEqual: Bp,
11988
+ areRegExpsEqual: Vp,
11989
+ areSetsEqual: n ? yp(Hp, zp) : Hp,
11990
+ areTypedArraysEqual: n ? yp(Up, zp) : Up,
11991
+ areUrlsEqual: Wp,
11992
+ unknownTagComparators: void 0
11993
+ };
11994
+ if (t && (r = Object.assign({}, r, t(r))), e) {
11995
+ let e = bp(r.areArraysEqual), t = bp(r.areMapsEqual), n = bp(r.areObjectsEqual), i = bp(r.areSetsEqual);
11996
+ r = Object.assign({}, r, {
11997
+ areArraysEqual: e,
11998
+ areMapsEqual: t,
11999
+ areObjectsEqual: n,
12000
+ areSetsEqual: i
12001
+ });
12002
+ }
12003
+ return r;
12022
12004
  }
12023
- function um(e, t) {
12024
- if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof tm)) return !1;
12025
- let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
12026
- if (!r) return !1;
12027
- let i = T.empty;
12028
- for (let e = r.length - 1; e >= 0; e--) i = T.from(r[e].createAndFill(null, i));
12029
- let a = e.state.tr.replace(n.pos, n.pos, new D(i, 0, 0));
12030
- return a.setSelection(j.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
12005
+ function lm(e) {
12006
+ return function(t, n, r, i, a, o, s) {
12007
+ return e(t, n, s);
12008
+ };
12031
12009
  }
12032
- function dm(e) {
12033
- if (!(e.selection instanceof tm)) return null;
12034
- let t = document.createElement("div");
12035
- return t.className = "ProseMirror-gapcursor", B.create(e.doc, [Es.widget(e.selection.head, t, { key: "gapcursor" })]);
12010
+ function um({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
12011
+ if (n) return function(a, o) {
12012
+ let { cache: s = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: c } = n();
12013
+ return t(a, o, {
12014
+ cache: s,
12015
+ equals: r,
12016
+ meta: c,
12017
+ strict: i
12018
+ });
12019
+ };
12020
+ if (e) return function(e, n) {
12021
+ return t(e, n, {
12022
+ cache: /* @__PURE__ */ new WeakMap(),
12023
+ equals: r,
12024
+ meta: void 0,
12025
+ strict: i
12026
+ });
12027
+ };
12028
+ let a = {
12029
+ cache: void 0,
12030
+ equals: r,
12031
+ meta: void 0,
12032
+ strict: i
12033
+ };
12034
+ return function(e, n) {
12035
+ return t(e, n, a);
12036
+ };
12037
+ }
12038
+ var dm = fm();
12039
+ fm({ strict: !0 }), fm({ circular: !0 }), fm({
12040
+ circular: !0,
12041
+ strict: !0
12042
+ }), fm({ createInternalComparator: () => wp }), fm({
12043
+ strict: !0,
12044
+ createInternalComparator: () => wp
12045
+ }), fm({
12046
+ circular: !0,
12047
+ createInternalComparator: () => wp
12048
+ }), fm({
12049
+ circular: !0,
12050
+ createInternalComparator: () => wp,
12051
+ strict: !0
12052
+ });
12053
+ function fm(e = {}) {
12054
+ let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = sm(cm(e));
12055
+ return um({
12056
+ circular: t,
12057
+ comparator: a,
12058
+ createState: r,
12059
+ equals: n ? n(a) : lm(a),
12060
+ strict: i
12061
+ });
12036
12062
  }
12037
12063
  //#endregion
12038
- //#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
12039
- var fm = 200, Y = function() {};
12040
- Y.prototype.append = function(e) {
12041
- return e.length ? (e = Y.from(e), !this.length && e || e.length < fm && this.leafAppend(e) || this.length < fm && e.leafPrepend(this) || this.appendInner(e)) : this;
12042
- }, Y.prototype.prepend = function(e) {
12043
- return e.length ? Y.from(e).append(this) : this;
12044
- }, Y.prototype.appendInner = function(e) {
12045
- return new mm(this, e);
12046
- }, Y.prototype.slice = function(e, t) {
12047
- return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? Y.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
12048
- }, Y.prototype.get = function(e) {
12049
- if (!(e < 0 || e >= this.length)) return this.getInner(e);
12050
- }, Y.prototype.forEach = function(e, t, n) {
12051
- t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
12052
- }, Y.prototype.map = function(e, t, n) {
12053
- t === void 0 && (t = 0), n === void 0 && (n = this.length);
12054
- var r = [];
12055
- return this.forEach(function(t, n) {
12056
- return r.push(e(t, n));
12057
- }, t, n), r;
12058
- }, Y.from = function(e) {
12059
- return e instanceof Y ? e : e && e.length ? new pm(e) : Y.empty;
12064
+ //#region ../../node_modules/.pnpm/@tiptap+react@3.22.5_@floating-ui+dom@1.7.6_@tiptap+core@3.22.5_@tiptap+pm@3.22.5__@tip_412b5dd72844165b28cdb59267386b00/node_modules/@tiptap/react/dist/index.js
12065
+ var pm = (...e) => (t) => {
12066
+ e.forEach((e) => {
12067
+ typeof e == "function" ? e(t) : e && (e.current = t);
12068
+ });
12069
+ }, mm = ({ contentComponent: e }) => {
12070
+ let t = ae(e.subscribe, e.getSnapshot, e.getServerSnapshot);
12071
+ return /* @__PURE__ */ C(ee, { children: Object.values(t) });
12060
12072
  };
12061
- var pm = /* @__PURE__ */ function(e) {
12062
- function t(t) {
12063
- e.call(this), this.values = t;
12064
- }
12065
- e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t;
12066
- var n = {
12067
- length: { configurable: !0 },
12068
- depth: { configurable: !0 }
12069
- };
12070
- return t.prototype.flatten = function() {
12071
- return this.values;
12072
- }, t.prototype.sliceInner = function(e, n) {
12073
- return e == 0 && n == this.length ? this : new t(this.values.slice(e, n));
12074
- }, t.prototype.getInner = function(e) {
12075
- return this.values[e];
12076
- }, t.prototype.forEachInner = function(e, t, n, r) {
12077
- for (var i = t; i < n; i++) if (e(this.values[i], r + i) === !1) return !1;
12078
- }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
12079
- for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
12080
- }, t.prototype.leafAppend = function(e) {
12081
- if (this.length + e.length <= fm) return new t(this.values.concat(e.flatten()));
12082
- }, t.prototype.leafPrepend = function(e) {
12083
- if (this.length + e.length <= fm) return new t(e.flatten().concat(this.values));
12084
- }, n.length.get = function() {
12085
- return this.values.length;
12086
- }, n.depth.get = function() {
12087
- return 0;
12088
- }, Object.defineProperties(t.prototype, n), t;
12089
- }(Y);
12090
- Y.empty = new pm([]);
12091
- var mm = /* @__PURE__ */ function(e) {
12092
- function t(t, n) {
12093
- e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
12073
+ function hm() {
12074
+ let e = /* @__PURE__ */ new Set(), t = {};
12075
+ return {
12076
+ subscribe(t) {
12077
+ return e.add(t), () => {
12078
+ e.delete(t);
12079
+ };
12080
+ },
12081
+ getSnapshot() {
12082
+ return t;
12083
+ },
12084
+ getServerSnapshot() {
12085
+ return t;
12086
+ },
12087
+ setRenderer(n, r) {
12088
+ t = {
12089
+ ...t,
12090
+ [n]: ne.createPortal(r.reactElement, r.element, n)
12091
+ }, e.forEach((e) => e());
12092
+ },
12093
+ removeRenderer(n) {
12094
+ let r = { ...t };
12095
+ delete r[n], t = r, e.forEach((e) => e());
12096
+ }
12097
+ };
12098
+ }
12099
+ var gm = class extends l.Component {
12100
+ constructor(e) {
12101
+ super(e), this.editorContentRef = l.createRef();
12094
12102
  }
12095
- return e && (t.__proto__ = e), t.prototype = Object.create(e && e.prototype), t.prototype.constructor = t, t.prototype.flatten = function() {
12096
- return this.left.flatten().concat(this.right.flatten());
12097
- }, t.prototype.getInner = function(e) {
12098
- return e < this.left.length ? this.left.get(e) : this.right.get(e - this.left.length);
12099
- }, t.prototype.forEachInner = function(e, t, n, r) {
12100
- var i = this.left.length;
12101
- if (t < i && this.left.forEachInner(e, t, Math.min(n, i), r) === !1 || n > i && this.right.forEachInner(e, Math.max(t - i, 0), Math.min(this.length, n) - i, r + i) === !1) return !1;
12102
- }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
12103
- var i = this.left.length;
12104
- if (t > i && this.right.forEachInvertedInner(e, t - i, Math.max(n, i) - i, r + i) === !1 || n < i && this.left.forEachInvertedInner(e, Math.min(t, i), n, r) === !1) return !1;
12105
- }, t.prototype.sliceInner = function(e, t) {
12106
- if (e == 0 && t == this.length) return this;
12107
- var n = this.left.length;
12108
- return t <= n ? this.left.slice(e, t) : e >= n ? this.right.slice(e - n, t - n) : this.left.slice(e, n).append(this.right.slice(0, t - n));
12109
- }, t.prototype.leafAppend = function(e) {
12110
- var n = this.right.leafAppend(e);
12111
- if (n) return new t(this.left, n);
12112
- }, t.prototype.leafPrepend = function(e) {
12113
- var n = this.left.leafPrepend(e);
12114
- if (n) return new t(n, this.right);
12115
- }, t.prototype.appendInner = function(e) {
12116
- return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
12117
- }, t;
12118
- }(Y), hm = 500, gm = class e {
12119
- constructor(e, t) {
12120
- this.items = e, this.eventCount = t;
12103
+ componentDidMount() {
12104
+ this.init();
12121
12105
  }
12122
- popEvent(t, n) {
12123
- if (this.eventCount == 0) return null;
12124
- let r = this.items.length;
12125
- for (;; r--) if (this.items.get(r - 1).selection) {
12126
- --r;
12127
- break;
12106
+ componentDidUpdate() {
12107
+ this.init();
12108
+ }
12109
+ init() {
12110
+ let e = this.props.editor;
12111
+ if (e && !e.isDestroyed && e.view.dom?.parentNode) {
12112
+ if (e.contentComponent) return;
12113
+ let t = this.editorContentRef.current;
12114
+ t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = hm(), e.createNodeViews(), e.isEditorContentInitialized = !0, this.forceUpdate();
12128
12115
  }
12129
- let i, a;
12130
- n && (i = this.remapping(r, this.items.length), a = i.maps.length);
12131
- let o = t.tr, s, c, l = [], u = [];
12132
- return this.items.forEach((t, n) => {
12133
- if (!t.step) {
12134
- i || (i = this.remapping(r, n + 1), a = i.maps.length), a--, u.push(t);
12135
- return;
12136
- }
12137
- if (i) {
12138
- u.push(new vm(t.map));
12139
- let e = t.step.map(i.slice(a)), n;
12140
- e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new vm(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
12141
- } else o.maybeStep(t.step);
12142
- if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
12143
- }, this.items.length, 0), {
12144
- remaining: c,
12145
- transform: o,
12146
- selection: s
12116
+ }
12117
+ componentWillUnmount() {
12118
+ let e = this.props.editor;
12119
+ if (e) {
12120
+ e.isEditorContentInitialized = !1, e.isDestroyed || e.view.setProps({ nodeViews: {} }), e.contentComponent = null;
12121
+ try {
12122
+ if (!e.view.dom?.parentNode) return;
12123
+ let t = document.createElement("div");
12124
+ t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t });
12125
+ } catch {}
12126
+ }
12127
+ }
12128
+ render() {
12129
+ let { editor: e, innerRef: t, ...n } = this.props;
12130
+ return /* @__PURE__ */ te(ee, { children: [/* @__PURE__ */ C("div", {
12131
+ ref: pm(t, this.editorContentRef),
12132
+ ...n
12133
+ }), e?.contentComponent && /* @__PURE__ */ C(mm, { contentComponent: e.contentComponent })] });
12134
+ }
12135
+ }, _m = p((e, t) => {
12136
+ let n = l.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
12137
+ return l.createElement(gm, {
12138
+ key: n,
12139
+ innerRef: t,
12140
+ ...e
12141
+ });
12142
+ }), vm = l.memo(_m), ym = typeof window < "u" ? v : _, bm = class {
12143
+ constructor(e) {
12144
+ this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = {
12145
+ editor: e,
12146
+ transactionNumber: 0
12147
+ }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
12148
+ }
12149
+ getSnapshot() {
12150
+ return this.transactionNumber === this.lastTransactionNumber ? this.lastSnapshot : (this.lastTransactionNumber = this.transactionNumber, this.lastSnapshot = {
12151
+ editor: this.editor,
12152
+ transactionNumber: this.transactionNumber
12153
+ }, this.lastSnapshot);
12154
+ }
12155
+ getServerSnapshot() {
12156
+ return {
12157
+ editor: null,
12158
+ transactionNumber: 0
12147
12159
  };
12148
12160
  }
12149
- addTransform(t, n, r, i) {
12150
- let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
12151
- for (let e = 0; e < t.steps.length; e++) {
12152
- let r = t.steps[e].invert(t.docs[e]), l = new vm(t.mapping.maps[e], r, n), u;
12153
- (u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
12161
+ subscribe(e) {
12162
+ return this.subscribers.add(e), () => {
12163
+ this.subscribers.delete(e);
12164
+ };
12165
+ }
12166
+ watch(e) {
12167
+ if (this.editor = e, this.editor) {
12168
+ let e = () => {
12169
+ this.transactionNumber += 1, this.subscribers.forEach((e) => e());
12170
+ }, t = this.editor;
12171
+ return t.on("transaction", e), () => {
12172
+ t.off("transaction", e);
12173
+ };
12154
12174
  }
12155
- let l = o - r.depth;
12156
- return l > bm && (s = _m(s, l), o -= l), new e(s.append(a), o);
12157
12175
  }
12158
- remapping(e, t) {
12159
- let n = new Rt();
12160
- return this.items.forEach((t, r) => {
12161
- let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
12162
- n.appendMap(t.map, i);
12163
- }, e, t), n;
12176
+ };
12177
+ function xm(e) {
12178
+ let [t] = x(() => new bm(e.editor)), n = oe(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? dm);
12179
+ return ym(() => t.watch(e.editor), [e.editor, t]), g(n), n;
12180
+ }
12181
+ var Sm = process.env.NODE_ENV !== "production", Cm = typeof window > "u", wm = Cm || !!(typeof window < "u" && window.next), Tm = class e {
12182
+ constructor(e) {
12183
+ this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
12164
12184
  }
12165
- addMaps(t) {
12166
- return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new vm(e))), this.eventCount);
12185
+ setEditor(e) {
12186
+ this.editor = e, this.instanceId = Math.random().toString(36).slice(2, 9), this.subscriptions.forEach((e) => e());
12167
12187
  }
12168
- rebased(t, n) {
12169
- if (!this.eventCount) return this;
12170
- let r = [], i = Math.max(0, this.items.length - n), a = t.mapping, o = t.steps.length, s = this.eventCount;
12171
- this.items.forEach((e) => {
12172
- e.selection && s--;
12173
- }, i);
12174
- let c = n;
12175
- this.items.forEach((e) => {
12176
- let n = a.getMirror(--c);
12177
- if (n == null) return;
12178
- o = Math.min(o, n);
12179
- let i = a.maps[n];
12180
- if (e.step) {
12181
- let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
12182
- l && s++, r.push(new vm(i, o, l));
12183
- } else r.push(new vm(i));
12184
- }, i);
12185
- let l = [];
12186
- for (let e = n; e < o; e++) l.push(new vm(a.maps[e]));
12187
- let u = new e(this.items.slice(0, i).append(l).append(r), s);
12188
- return u.emptyItemCount() > hm && (u = u.compress(this.items.length - r.length)), u;
12188
+ getInitialEditor() {
12189
+ if (this.options.current.immediatelyRender === void 0) {
12190
+ if (Cm || wm) {
12191
+ if (Sm) throw Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");
12192
+ return null;
12193
+ }
12194
+ return this.createEditor();
12195
+ }
12196
+ if (this.options.current.immediatelyRender && Cm && Sm) throw Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");
12197
+ return this.options.current.immediatelyRender ? this.createEditor() : null;
12189
12198
  }
12190
- emptyItemCount() {
12191
- let e = 0;
12192
- return this.items.forEach((t) => {
12193
- t.step || e++;
12194
- }), e;
12199
+ createEditor() {
12200
+ return new Bd({
12201
+ ...this.options.current,
12202
+ onBeforeCreate: (...e) => {
12203
+ var t;
12204
+ return (t = this.options.current).onBeforeCreate?.call(t, ...e);
12205
+ },
12206
+ onBlur: (...e) => {
12207
+ var t;
12208
+ return (t = this.options.current).onBlur?.call(t, ...e);
12209
+ },
12210
+ onCreate: (...e) => {
12211
+ var t;
12212
+ return (t = this.options.current).onCreate?.call(t, ...e);
12213
+ },
12214
+ onDestroy: (...e) => {
12215
+ var t;
12216
+ return (t = this.options.current).onDestroy?.call(t, ...e);
12217
+ },
12218
+ onFocus: (...e) => {
12219
+ var t;
12220
+ return (t = this.options.current).onFocus?.call(t, ...e);
12221
+ },
12222
+ onSelectionUpdate: (...e) => {
12223
+ var t;
12224
+ return (t = this.options.current).onSelectionUpdate?.call(t, ...e);
12225
+ },
12226
+ onTransaction: (...e) => {
12227
+ var t;
12228
+ return (t = this.options.current).onTransaction?.call(t, ...e);
12229
+ },
12230
+ onUpdate: (...e) => {
12231
+ var t;
12232
+ return (t = this.options.current).onUpdate?.call(t, ...e);
12233
+ },
12234
+ onContentError: (...e) => {
12235
+ var t;
12236
+ return (t = this.options.current).onContentError?.call(t, ...e);
12237
+ },
12238
+ onDrop: (...e) => {
12239
+ var t;
12240
+ return (t = this.options.current).onDrop?.call(t, ...e);
12241
+ },
12242
+ onPaste: (...e) => {
12243
+ var t;
12244
+ return (t = this.options.current).onPaste?.call(t, ...e);
12245
+ },
12246
+ onDelete: (...e) => {
12247
+ var t;
12248
+ return (t = this.options.current).onDelete?.call(t, ...e);
12249
+ }
12250
+ });
12195
12251
  }
12196
- compress(t = this.items.length) {
12197
- let n = this.remapping(0, t), r = n.maps.length, i = [], a = 0;
12198
- return this.items.forEach((e, o) => {
12199
- if (o >= t) i.push(e), e.selection && a++;
12200
- else if (e.step) {
12201
- let t = e.step.map(n.slice(r)), o = t && t.getMap();
12202
- if (r--, o && n.appendMap(o, r), t) {
12203
- let s = e.selection && e.selection.map(n.slice(r));
12204
- s && a++;
12205
- let c = new vm(o.invert(), t, s), l, u = i.length - 1;
12206
- (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
12207
- }
12208
- } else e.map && r--;
12209
- }, this.items.length, 0), new e(Y.from(i.reverse()), a);
12252
+ getEditor() {
12253
+ return this.editor;
12254
+ }
12255
+ getServerSnapshot() {
12256
+ return null;
12257
+ }
12258
+ subscribe(e) {
12259
+ return this.subscriptions.add(e), () => {
12260
+ this.subscriptions.delete(e);
12261
+ };
12262
+ }
12263
+ static compareOptions(e, t) {
12264
+ return Object.keys(e).every((n) => [
12265
+ "onCreate",
12266
+ "onBeforeCreate",
12267
+ "onDestroy",
12268
+ "onUpdate",
12269
+ "onTransaction",
12270
+ "onFocus",
12271
+ "onBlur",
12272
+ "onSelectionUpdate",
12273
+ "onContentError",
12274
+ "onDrop",
12275
+ "onPaste"
12276
+ ].includes(n) ? !0 : n === "extensions" && e.extensions && t.extensions ? e.extensions.length === t.extensions.length ? e.extensions.every((e, n) => e === t.extensions?.[n]) : !1 : e[n] === t[n]);
12210
12277
  }
12211
- };
12212
- gm.empty = new gm(Y.empty, 0);
12213
- function _m(e, t) {
12214
- let n;
12215
- return e.forEach((e, r) => {
12216
- if (e.selection && t-- == 0) return n = r, !1;
12217
- }), e.slice(n);
12218
- }
12219
- var vm = class e {
12220
- constructor(e, t, n, r) {
12221
- this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
12278
+ onRender(t) {
12279
+ return () => (this.isComponentMounted = !0, clearTimeout(this.scheduledDestructionTimeout), this.editor && !this.editor.isDestroyed && t.length === 0 ? e.compareOptions(this.options.current, this.editor.options) || this.editor.setOptions({
12280
+ ...this.options.current,
12281
+ editable: this.editor.isEditable
12282
+ }) : this.refreshEditorInstance(t), () => {
12283
+ this.isComponentMounted = !1, this.scheduleDestroy();
12284
+ });
12222
12285
  }
12223
- merge(t) {
12224
- if (this.step && t.step && !t.selection) {
12225
- let n = t.step.merge(this.step);
12226
- if (n) return new e(n.getMap().invert(), n, this.selection);
12286
+ refreshEditorInstance(e) {
12287
+ if (this.editor && !this.editor.isDestroyed) {
12288
+ if (this.previousDeps === null) {
12289
+ this.previousDeps = e;
12290
+ return;
12291
+ }
12292
+ if (this.previousDeps.length === e.length && this.previousDeps.every((t, n) => t === e[n])) return;
12227
12293
  }
12294
+ this.editor && !this.editor.isDestroyed && this.editor.destroy(), this.setEditor(this.createEditor()), this.previousDeps = e;
12228
12295
  }
12229
- }, ym = class {
12230
- constructor(e, t, n, r, i) {
12231
- this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
12296
+ scheduleDestroy() {
12297
+ let e = this.instanceId, t = this.editor;
12298
+ this.scheduledDestructionTimeout = setTimeout(() => {
12299
+ if (this.isComponentMounted && this.instanceId === e) {
12300
+ t && t.setOptions(this.options.current);
12301
+ return;
12302
+ }
12303
+ t && !t.isDestroyed && (t.destroy(), this.instanceId === e && this.setEditor(null));
12304
+ }, 1);
12232
12305
  }
12233
- }, bm = 20;
12234
- function xm(e, t, n, r) {
12235
- let i = n.getMeta(km), a;
12236
- if (i) return i.historyState;
12237
- n.getMeta(Am) && (e = new ym(e.done, e.undone, null, 0, -1));
12238
- let o = n.getMeta("appendedTransaction");
12239
- if (n.steps.length == 0) return e;
12240
- if (o && o.getMeta(km)) return o.getMeta(km).redo ? new ym(e.done.addTransform(n, void 0, r, Om(t)), e.undone, Cm(n.mapping.maps), e.prevTime, e.prevComposition) : new ym(e.done, e.undone.addTransform(n, void 0, r, Om(t)), null, e.prevTime, e.prevComposition);
12241
- if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
12242
- let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !Sm(n, e.prevRanges)), s = o ? wm(e.prevRanges, n.mapping) : Cm(n.mapping.maps);
12243
- return new ym(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Om(t)), gm.empty, s, n.time, i ?? e.prevComposition);
12244
- } else if (a = n.getMeta("rebased")) return new ym(e.done.rebased(n, a), e.undone.rebased(n, a), wm(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
12245
- else return new ym(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), wm(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
12306
+ };
12307
+ function Em(e = {}, t = []) {
12308
+ let n = b(e);
12309
+ n.current = e;
12310
+ let [r] = x(() => new Tm(n)), i = ae(r.subscribe, r.getEditor, r.getServerSnapshot);
12311
+ return g(i), _(r.onRender(t)), xm({
12312
+ editor: i,
12313
+ selector: ({ transactionNumber: t }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && t === 0 ? 0 : t + 1
12314
+ }), i;
12246
12315
  }
12247
- function Sm(e, t) {
12248
- if (!t) return !1;
12249
- if (!e.docChanged) return !0;
12250
- let n = !1;
12251
- return e.mapping.maps[0].forEach((e, r) => {
12252
- for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
12253
- }), n;
12316
+ var Dm = u({ editor: null });
12317
+ Dm.Consumer;
12318
+ var Om = () => h(Dm), km = u({
12319
+ onDragStart: () => {},
12320
+ nodeViewContentChildren: void 0,
12321
+ nodeViewContentRef: () => {}
12322
+ }), Am = () => h(km), jm = l.forwardRef((e, t) => {
12323
+ let { onDragStart: n } = Am();
12324
+ return /* @__PURE__ */ C(e.as || "div", {
12325
+ ...e,
12326
+ ref: t,
12327
+ "data-node-view-wrapper": "",
12328
+ onDragStart: n,
12329
+ style: {
12330
+ whiteSpace: "normal",
12331
+ ...e.style
12332
+ }
12333
+ });
12334
+ });
12335
+ function Mm(e) {
12336
+ return !!(typeof e == "function" && e.prototype && e.prototype.isReactComponent);
12254
12337
  }
12255
- function Cm(e) {
12256
- let t = [];
12257
- for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
12258
- return t;
12338
+ function Nm(e) {
12339
+ return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.forward_ref)" || e.$$typeof.description === "react.forward_ref"));
12259
12340
  }
12260
- function wm(e, t) {
12261
- if (!e) return null;
12262
- let n = [];
12263
- for (let r = 0; r < e.length; r += 2) {
12264
- let i = t.map(e[r], 1), a = t.map(e[r + 1], -1);
12265
- i <= a && n.push(i, a);
12341
+ function Pm(e) {
12342
+ return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.memo)" || e.$$typeof.description === "react.memo"));
12343
+ }
12344
+ function Fm(e) {
12345
+ if (Mm(e) || Nm(e)) return !0;
12346
+ if (Pm(e)) {
12347
+ let t = e.type;
12348
+ if (t) return Mm(t) || Nm(t);
12266
12349
  }
12267
- return n;
12350
+ return !1;
12268
12351
  }
12269
- function Tm(e, t, n) {
12270
- let r = Om(t), i = km.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
12271
- if (!a) return null;
12272
- let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new ym(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
12273
- return a.transform.setSelection(o).setMeta(km, {
12274
- redo: n,
12275
- historyState: c
12276
- });
12352
+ function Im() {
12353
+ try {
12354
+ if (S) return parseInt(S.split(".")[0], 10) >= 19;
12355
+ } catch {}
12356
+ return !1;
12277
12357
  }
12278
- var Em = !1, Dm = null;
12279
- function Om(e) {
12280
- let t = e.plugins;
12281
- if (Dm != t) {
12282
- Em = !1, Dm = t;
12283
- for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
12284
- Em = !0;
12285
- break;
12358
+ var Lm = class {
12359
+ constructor(e, { editor: t, props: n = {}, as: r = "div", className: i = "" }) {
12360
+ this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = n, this.element = document.createElement(r), this.element.classList.add("react-renderer"), i && this.element.classList.add(...i.split(" ")), this.editor.isEditorContentInitialized ? ie(() => {
12361
+ this.render();
12362
+ }) : queueMicrotask(() => {
12363
+ this.destroyed || this.render();
12364
+ });
12365
+ }
12366
+ render() {
12367
+ var e;
12368
+ if (this.destroyed) return;
12369
+ let t = this.component, n = this.props, r = this.editor, i = Im(), a = Fm(t), o = { ...n };
12370
+ o.ref && !(i || a) && delete o.ref, !o.ref && (i || a) && (o.ref = (e) => {
12371
+ this.ref = e;
12372
+ }), this.reactElement = /* @__PURE__ */ C(t, { ...o }), (e = r?.contentComponent) == null || e.setRenderer(this.id, this);
12373
+ }
12374
+ updateProps(e = {}) {
12375
+ this.destroyed || (this.props = {
12376
+ ...this.props,
12377
+ ...e
12378
+ }, this.render());
12379
+ }
12380
+ destroy() {
12381
+ var e;
12382
+ this.destroyed = !0, (e = this.editor?.contentComponent) == null || e.removeRenderer(this.id);
12383
+ try {
12384
+ this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element);
12385
+ } catch {}
12386
+ }
12387
+ updateAttributes(e) {
12388
+ Object.keys(e).forEach((t) => {
12389
+ this.element.setAttribute(t, e[t]);
12390
+ });
12391
+ }
12392
+ };
12393
+ l.createContext({ markViewContentRef: () => {} });
12394
+ var Rm = class extends lf {
12395
+ constructor(e, t, n) {
12396
+ if (super(e, t, n), this.selectionRafId = null, this.positionCheckCallback = null, this.cachedExtensionWithSyncedStorage = null, !this.node.isLeaf) {
12397
+ this.options.contentDOMElementTag ? this.contentDOMElement = document.createElement(this.options.contentDOMElementTag) : this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement.dataset.nodeViewContentReact = "", this.contentDOMElement.dataset.nodeViewWrapper = "", this.contentDOMElement.style.whiteSpace = "inherit";
12398
+ let e = this.dom.querySelector("[data-node-view-content]");
12399
+ if (!e) return;
12400
+ e.appendChild(this.contentDOMElement);
12286
12401
  }
12287
12402
  }
12288
- return Em;
12289
- }
12290
- var km = new P("history"), Am = new P("closeHistory");
12291
- function jm(e = {}) {
12292
- return e = {
12293
- depth: e.depth || 100,
12294
- newGroupDelay: e.newGroupDelay || 500
12295
- }, new N({
12296
- key: km,
12297
- state: {
12298
- init() {
12299
- return new ym(gm.empty, gm.empty, null, 0, -1);
12300
- },
12301
- apply(t, n, r) {
12302
- return xm(n, r, t, e);
12303
- }
12304
- },
12305
- config: e,
12306
- props: { handleDOMEvents: { beforeinput(e, t) {
12307
- let n = t.inputType, r = n == "historyUndo" ? Nm : n == "historyRedo" ? Pm : null;
12308
- return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
12309
- } } }
12310
- });
12311
- }
12312
- function Mm(e, t) {
12313
- return (n, r) => {
12314
- let i = km.getState(n);
12315
- if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
12316
- if (r) {
12317
- let a = Tm(i, n, e);
12318
- a && r(t ? a.scrollIntoView() : a);
12403
+ get extensionWithSyncedStorage() {
12404
+ if (!this.cachedExtensionWithSyncedStorage) {
12405
+ let e = this.editor, t = this.extension;
12406
+ this.cachedExtensionWithSyncedStorage = new Proxy(t, { get(n, r, i) {
12407
+ return r === "storage" ? e.storage[t.name] ?? {} : Reflect.get(n, r, i);
12408
+ } });
12319
12409
  }
12320
- return !0;
12321
- };
12322
- }
12323
- var Nm = Mm(!1, !0), Pm = Mm(!0, !0), Fm = q.create({
12324
- name: "characterCount",
12325
- addOptions() {
12326
- return {
12327
- limit: null,
12328
- mode: "textSize",
12329
- textCounter: (e) => e.length,
12330
- wordCounter: (e) => e.split(" ").filter((e) => e !== "").length
12331
- };
12332
- },
12333
- addStorage() {
12334
- return {
12335
- characters: () => 0,
12336
- words: () => 0
12337
- };
12338
- },
12339
- onBeforeCreate() {
12340
- this.storage.characters = (e) => {
12341
- let t = e?.node || this.editor.state.doc;
12342
- if ((e?.mode || this.options.mode) === "textSize") {
12343
- let e = t.textBetween(0, t.content.size, void 0, " ");
12344
- return this.options.textCounter(e);
12345
- }
12346
- return t.nodeSize;
12347
- }, this.storage.words = (e) => {
12348
- let t = e?.node || this.editor.state.doc, n = t.textBetween(0, t.content.size, " ", " ");
12349
- return this.options.wordCounter(n);
12410
+ return this.cachedExtensionWithSyncedStorage;
12411
+ }
12412
+ mount() {
12413
+ let e = {
12414
+ editor: this.editor,
12415
+ node: this.node,
12416
+ decorations: this.decorations,
12417
+ innerDecorations: this.innerDecorations,
12418
+ view: this.view,
12419
+ selected: !1,
12420
+ extension: this.extensionWithSyncedStorage,
12421
+ HTMLAttributes: this.HTMLAttributes,
12422
+ getPos: () => this.getPos(),
12423
+ updateAttributes: (e = {}) => this.updateAttributes(e),
12424
+ deleteNode: () => this.deleteNode(),
12425
+ ref: f()
12350
12426
  };
12351
- },
12352
- addProseMirrorPlugins() {
12353
- let e = !1;
12354
- return [new N({
12355
- key: new P("characterCount"),
12356
- appendTransaction: (t, n, r) => {
12357
- if (e) return;
12358
- let i = this.options.limit;
12359
- if (i == null || i === 0) {
12360
- e = !0;
12361
- return;
12362
- }
12363
- let a = this.storage.characters({ node: r.doc });
12364
- if (a > i) {
12365
- let t = a - i;
12366
- console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);
12367
- let n = r.tr.deleteRange(0, t);
12368
- return e = !0, n;
12369
- }
12370
- e = !0;
12371
- },
12372
- filterTransaction: (e, t) => {
12373
- let n = this.options.limit;
12374
- if (!e.docChanged || n === 0 || n == null) return !0;
12375
- let r = this.storage.characters({ node: t.doc }), i = this.storage.characters({ node: e.doc });
12376
- if (i <= n || r > n && i > n && i <= r) return !0;
12377
- if (r > n && i > n && i > r || !e.getMeta("paste")) return !1;
12378
- let a = e.selection.$head.pos, o = a - (i - n), s = a;
12379
- return e.deleteRange(o, s), !(this.storage.characters({ node: e.doc }) > n);
12427
+ if (!this.component.displayName) {
12428
+ let e = (e) => e.charAt(0).toUpperCase() + e.substring(1);
12429
+ this.component.displayName = e(this.extension.name);
12430
+ }
12431
+ let t = {
12432
+ onDragStart: this.onDragStart.bind(this),
12433
+ nodeViewContentRef: (e) => {
12434
+ e && this.contentDOMElement && e.firstChild !== this.contentDOMElement && (e.hasAttribute("data-node-view-wrapper") && e.removeAttribute("data-node-view-wrapper"), e.appendChild(this.contentDOMElement));
12380
12435
  }
12381
- })];
12436
+ }, n = this.component, r = m((e) => /* @__PURE__ */ C(km.Provider, {
12437
+ value: t,
12438
+ children: d(n, e)
12439
+ }));
12440
+ r.displayName = "ReactNodeView";
12441
+ let i = this.node.isInline ? "span" : "div";
12442
+ this.options.as && (i = this.options.as);
12443
+ let { className: a = "" } = this.options;
12444
+ this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.renderer = new Lm(r, {
12445
+ editor: this.editor,
12446
+ props: e,
12447
+ as: i,
12448
+ className: `node-${this.node.type.name} ${a}`.trim()
12449
+ }), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.updateElementAttributes(), this.currentPos = this.getPos(), this.positionCheckCallback = () => {
12450
+ let e = this.getPos();
12451
+ typeof e != "number" || e === this.currentPos || (this.currentPos = e, this.renderer.updateProps({ getPos: () => this.getPos() }), typeof this.options.attrs == "function" && this.updateElementAttributes());
12452
+ }, of(this.editor, this.positionCheckCallback);
12382
12453
  }
12383
- }), Im = q.create({
12384
- name: "dropCursor",
12385
- addOptions() {
12386
- return {
12387
- color: "currentColor",
12388
- width: 1,
12389
- class: void 0
12390
- };
12391
- },
12392
- addProseMirrorPlugins() {
12393
- return [$p(this.options)];
12454
+ get dom() {
12455
+ if (this.renderer.element.firstElementChild && !this.renderer.element.firstElementChild?.hasAttribute("data-node-view-wrapper")) throw Error("Please use the NodeViewWrapper component for your node view.");
12456
+ return this.renderer.element;
12394
12457
  }
12395
- });
12396
- q.create({
12397
- name: "focus",
12398
- addOptions() {
12399
- return {
12400
- className: "has-focus",
12401
- mode: "all"
12402
- };
12403
- },
12404
- addProseMirrorPlugins() {
12405
- return [new N({
12406
- key: new P("focus"),
12407
- props: { decorations: ({ doc: e, selection: t }) => {
12408
- let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
12409
- if (!n || !r) return B.create(e, []);
12410
- let o = 0;
12411
- this.options.mode === "deepest" && e.descendants((e, t) => {
12412
- if (!e.isText) {
12413
- if (!(i >= t && i <= t + e.nodeSize - 1)) return !1;
12414
- o += 1;
12415
- }
12416
- });
12417
- let s = 0;
12418
- return e.descendants((e, t) => {
12419
- if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
12420
- if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
12421
- a.push(Es.node(t, t + e.nodeSize, { class: this.options.className }));
12422
- }), B.create(e, a);
12423
- } }
12424
- })];
12458
+ get contentDOM() {
12459
+ return this.node.isLeaf ? null : this.contentDOMElement;
12425
12460
  }
12426
- });
12427
- var Lm = q.create({
12428
- name: "gapCursor",
12429
- addProseMirrorPlugins() {
12430
- return [om()];
12431
- },
12432
- extendNodeSchema(e) {
12433
- return { allowGapCursor: G(W(e, "allowGapCursor", {
12434
- name: e.name,
12435
- options: e.options,
12436
- storage: e.storage
12437
- })) ?? null };
12461
+ handleSelectionUpdate() {
12462
+ this.selectionRafId &&= (cancelAnimationFrame(this.selectionRafId), null), this.selectionRafId = requestAnimationFrame(() => {
12463
+ this.selectionRafId = null;
12464
+ let e = this.currentPos;
12465
+ if (typeof e == "number") if (Mu({
12466
+ selection: this.editor.state.selection,
12467
+ pos: e,
12468
+ nodeSize: this.node.nodeSize,
12469
+ selectedOnTextSelection: this.options.selectedOnTextSelection
12470
+ })) {
12471
+ if (this.renderer.props.selected) return;
12472
+ this.selectNode();
12473
+ } else {
12474
+ if (!this.renderer.props.selected) return;
12475
+ this.deselectNode();
12476
+ }
12477
+ });
12438
12478
  }
12439
- }), Rm = "placeholder";
12440
- function zm(e) {
12441
- return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
12442
- }
12443
- var Bm = q.create({
12444
- name: "placeholder",
12445
- addOptions() {
12446
- return {
12447
- emptyEditorClass: "is-editor-empty",
12448
- emptyNodeClass: "is-empty",
12449
- dataAttribute: Rm,
12450
- placeholder: "Write something …",
12451
- showOnlyWhenEditable: !0,
12452
- showOnlyCurrent: !0,
12453
- includeChildren: !1
12479
+ update(e, t, n) {
12480
+ let r = (e) => {
12481
+ this.renderer.updateProps(e), typeof this.options.attrs == "function" && this.updateElementAttributes();
12454
12482
  };
12455
- },
12456
- addProseMirrorPlugins() {
12457
- let e = this.options.dataAttribute ? `data-${zm(this.options.dataAttribute)}` : `data-${Rm}`;
12458
- return [new N({
12459
- key: new P("placeholder"),
12460
- props: { decorations: ({ doc: t, selection: n }) => {
12461
- let r = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: i } = n, a = [];
12462
- if (!r) return null;
12463
- let o = this.editor.isEmpty;
12464
- return t.descendants((t, n) => {
12465
- let r = i >= n && i <= n + t.nodeSize, s = !t.isLeaf && Au(t);
12466
- if (!t.type.isTextblock) return this.options.includeChildren;
12467
- if ((r || !this.options.showOnlyCurrent) && s) {
12468
- let i = [this.options.emptyNodeClass];
12469
- o && i.push(this.options.emptyEditorClass);
12470
- let s = Es.node(n, n + t.nodeSize, {
12471
- class: i.join(" "),
12472
- [e]: typeof this.options.placeholder == "function" ? this.options.placeholder({
12473
- editor: this.editor,
12474
- node: t,
12475
- pos: n,
12476
- hasAnchor: r
12477
- }) : this.options.placeholder
12478
- });
12479
- a.push(s);
12480
- }
12481
- return this.options.includeChildren;
12482
- }), B.create(t, a);
12483
- } }
12484
- })];
12483
+ if (e.type !== this.node.type) return !1;
12484
+ if (typeof this.options.update == "function") {
12485
+ let i = this.node, a = this.decorations, o = this.innerDecorations;
12486
+ return this.node = e, this.decorations = t, this.innerDecorations = n, this.currentPos = this.getPos(), this.options.update({
12487
+ oldNode: i,
12488
+ oldDecorations: a,
12489
+ newNode: e,
12490
+ newDecorations: t,
12491
+ oldInnerDecorations: o,
12492
+ innerDecorations: n,
12493
+ updateProps: () => r({
12494
+ node: e,
12495
+ decorations: t,
12496
+ innerDecorations: n,
12497
+ extension: this.extensionWithSyncedStorage
12498
+ })
12499
+ });
12500
+ }
12501
+ let i = this.getPos();
12502
+ return e === this.node && this.decorations === t && this.innerDecorations === n ? i === this.currentPos ? !0 : (this.currentPos = i, r({
12503
+ node: e,
12504
+ decorations: t,
12505
+ innerDecorations: n,
12506
+ extension: this.extensionWithSyncedStorage,
12507
+ getPos: () => this.getPos()
12508
+ }), !0) : (this.node = e, this.decorations = t, this.innerDecorations = n, this.currentPos = i, r({
12509
+ node: e,
12510
+ decorations: t,
12511
+ innerDecorations: n,
12512
+ extension: this.extensionWithSyncedStorage
12513
+ }), !0);
12485
12514
  }
12486
- });
12487
- q.create({
12488
- name: "selection",
12489
- addOptions() {
12490
- return { className: "selection" };
12491
- },
12492
- addProseMirrorPlugins() {
12493
- let { editor: e, options: t } = this;
12494
- return [new N({
12495
- key: new P("selection"),
12496
- props: { decorations(n) {
12497
- return n.selection.empty || e.isFocused || !e.isEditable || ju(n.selection) || e.view.dragging ? null : B.create(n.doc, [Es.inline(n.selection.from, n.selection.to, { class: t.className })]);
12498
- } }
12499
- })];
12515
+ selectNode() {
12516
+ this.renderer.updateProps({ selected: !0 }), this.renderer.element.classList.add("ProseMirror-selectednode");
12500
12517
  }
12501
- });
12502
- function Vm({ types: e, node: t }) {
12503
- return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
12504
- }
12505
- var Hm = q.create({
12506
- name: "trailingNode",
12507
- addOptions() {
12508
- return {
12509
- node: void 0,
12510
- notAfter: []
12511
- };
12512
- },
12513
- addProseMirrorPlugins() {
12514
- let e = new P(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
12515
- return [new N({
12516
- key: e,
12517
- appendTransaction: (n, r, i) => {
12518
- let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
12519
- if (!n.some((e) => e.getMeta("skipTrailingNode")) && c) return o.insert(l, u.create());
12520
- },
12521
- state: {
12522
- init: (e, t) => {
12523
- let r = t.tr.doc.lastChild;
12524
- return !Vm({
12525
- node: r,
12526
- types: n
12527
- });
12528
- },
12529
- apply: (e, t) => {
12530
- if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
12531
- let r = e.doc.lastChild;
12532
- return !Vm({
12533
- node: r,
12534
- types: n
12535
- });
12536
- }
12537
- }
12538
- })];
12518
+ deselectNode() {
12519
+ this.renderer.updateProps({ selected: !1 }), this.renderer.element.classList.remove("ProseMirror-selectednode");
12539
12520
  }
12540
- }), Um = q.create({
12541
- name: "undoRedo",
12542
- addOptions() {
12543
- return {
12544
- depth: 100,
12545
- newGroupDelay: 500
12546
- };
12547
- },
12548
- addCommands() {
12549
- return {
12550
- undo: () => ({ state: e, dispatch: t }) => Nm(e, t),
12551
- redo: () => ({ state: e, dispatch: t }) => Pm(e, t)
12552
- };
12553
- },
12554
- addProseMirrorPlugins() {
12555
- return [jm(this.options)];
12556
- },
12557
- addKeyboardShortcuts() {
12558
- return {
12559
- "Mod-z": () => this.editor.commands.undo(),
12560
- "Shift-Mod-z": () => this.editor.commands.redo(),
12561
- "Mod-y": () => this.editor.commands.redo(),
12562
- "Mod-я": () => this.editor.commands.undo(),
12563
- "Shift-Mod-я": () => this.editor.commands.redo()
12564
- };
12521
+ destroy() {
12522
+ this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.positionCheckCallback &&= (sf(this.editor, this.positionCheckCallback), null), this.contentDOMElement = null, this.selectionRafId &&= (cancelAnimationFrame(this.selectionRafId), null);
12523
+ }
12524
+ updateElementAttributes() {
12525
+ if (this.options.attrs) {
12526
+ let e = {};
12527
+ if (typeof this.options.attrs == "function") {
12528
+ let t = this.editor.extensionManager.attributes, n = nu(this.node, t);
12529
+ e = this.options.attrs({
12530
+ node: this.node,
12531
+ HTMLAttributes: n
12532
+ });
12533
+ } else e = this.options.attrs;
12534
+ this.renderer.updateAttributes(e);
12535
+ }
12565
12536
  }
12566
- }), Wm, Gm;
12537
+ };
12538
+ function zm(e, t) {
12539
+ return (n) => n.editor.contentComponent ? new Rm(e, n, t) : {};
12540
+ }
12541
+ var Bm = u({ get editor() {
12542
+ throw Error("useTiptap must be used within a <Tiptap> provider");
12543
+ } });
12544
+ Bm.displayName = "TiptapContext";
12545
+ var Vm = () => h(Bm);
12546
+ function Hm({ editor: e, instance: t, children: n }) {
12547
+ let r = e ?? t;
12548
+ if (!r) throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
12549
+ let i = y(() => ({ editor: r }), [r]), a = y(() => ({ editor: r }), [r]);
12550
+ return /* @__PURE__ */ C(Dm.Provider, {
12551
+ value: a,
12552
+ children: /* @__PURE__ */ C(Bm.Provider, {
12553
+ value: i,
12554
+ children: n
12555
+ })
12556
+ });
12557
+ }
12558
+ Hm.displayName = "Tiptap";
12559
+ function Um({ ...e }) {
12560
+ let { editor: t } = Vm();
12561
+ return /* @__PURE__ */ C(vm, {
12562
+ editor: t,
12563
+ ...e
12564
+ });
12565
+ }
12566
+ Um.displayName = "Tiptap.Content", Object.assign(Hm, { Content: Um });
12567
+ //#endregion
12568
+ //#region ../../node_modules/.pnpm/prosemirror-tables@1.8.5/node_modules/prosemirror-tables/dist/index.js
12569
+ var Wm, Gm;
12567
12570
  if (typeof WeakMap < "u") {
12568
12571
  let e = /* @__PURE__ */ new WeakMap();
12569
12572
  Wm = (t) => e.get(t), Gm = (t, n) => (e.set(t, n), n);
@@ -13560,7 +13563,7 @@ function Kh(e, t) {
13560
13563
  var qh = l.forwardRef(({ pluginKey: e, editor: t, updateDelay: n, resizeDelay: r, appendTo: i, shouldShow: a = null, getReferencedVirtualElement: o, options: s, children: c, ...l }, u) => {
13561
13564
  let d = b(document.createElement("div")), f = b(Sh(e, "bubbleMenu")).current;
13562
13565
  Kh(d.current, l), typeof u == "function" ? u(d.current) : u && (u.current = d.current);
13563
- let { editor: p } = Cp(), m = t || p, h = {
13566
+ let { editor: p } = Om(), m = t || p, h = {
13564
13567
  updateDelay: n,
13565
13568
  resizeDelay: r,
13566
13569
  appendTo: i,
@@ -13617,7 +13620,7 @@ var qh = l.forwardRef(({ pluginKey: e, editor: t, updateDelay: n, resizeDelay: r
13617
13620
  l.forwardRef(({ pluginKey: e, editor: t, updateDelay: n, resizeDelay: r, appendTo: i, shouldShow: a = null, options: o, children: s, ...c }, l) => {
13618
13621
  let u = b(document.createElement("div")), d = b(Sh(e, "floatingMenu")).current;
13619
13622
  Kh(u.current, c), typeof l == "function" ? l(u.current) : l && (l.current = u.current);
13620
- let { editor: f } = Cp(), p = t || f, m = {
13623
+ let { editor: f } = Om(), p = t || f, m = {
13621
13624
  updateDelay: n,
13622
13625
  resizeDelay: r,
13623
13626
  appendTo: i,
@@ -15774,7 +15777,7 @@ var ty = "listItem", ny = "textStyle", ry = /^(\d+)\.\s$/, iy = J.create({
15774
15777
  name: "starterKit",
15775
15778
  addExtensions() {
15776
15779
  let e = [];
15777
- return this.options.bold !== !1 && e.push(tg.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(Xh.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(Fv.configure(this.options.bulletList)), this.options.code !== !1 && e.push(ig.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(cg.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(lg.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(Im.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(Lm.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(ug.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(dg.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(Um.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(fg.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(_g.configure(this.options.italic)), this.options.listItem !== !1 && e.push(Iv.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(qv.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(kv.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(iy.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(dy.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(my.configure(this.options.strike)), this.options.text !== !1 && e.push(hy.configure(this.options.text)), this.options.underline !== !1 && e.push(gy.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(Hm.configure(this.options?.trailingNode)), e;
15780
+ return this.options.bold !== !1 && e.push(tg.configure(this.options.bold)), this.options.blockquote !== !1 && e.push(Xh.configure(this.options.blockquote)), this.options.bulletList !== !1 && e.push(Fv.configure(this.options.bulletList)), this.options.code !== !1 && e.push(ig.configure(this.options.code)), this.options.codeBlock !== !1 && e.push(cg.configure(this.options.codeBlock)), this.options.document !== !1 && e.push(lg.configure(this.options.document)), this.options.dropcursor !== !1 && e.push(cp.configure(this.options.dropcursor)), this.options.gapcursor !== !1 && e.push(lp.configure(this.options.gapcursor)), this.options.hardBreak !== !1 && e.push(ug.configure(this.options.hardBreak)), this.options.heading !== !1 && e.push(dg.configure(this.options.heading)), this.options.undoRedo !== !1 && e.push(hp.configure(this.options.undoRedo)), this.options.horizontalRule !== !1 && e.push(fg.configure(this.options.horizontalRule)), this.options.italic !== !1 && e.push(_g.configure(this.options.italic)), this.options.listItem !== !1 && e.push(Iv.configure(this.options.listItem)), this.options.listKeymap !== !1 && e.push(qv.configure(this.options?.listKeymap)), this.options.link !== !1 && e.push(kv.configure(this.options?.link)), this.options.orderedList !== !1 && e.push(iy.configure(this.options.orderedList)), this.options.paragraph !== !1 && e.push(dy.configure(this.options.paragraph)), this.options.strike !== !1 && e.push(my.configure(this.options.strike)), this.options.text !== !1 && e.push(hy.configure(this.options.text)), this.options.underline !== !1 && e.push(gy.configure(this.options?.underline)), this.options.trailingNode !== !1 && e.push(mp.configure(this.options?.trailingNode)), e;
15778
15781
  }
15779
15782
  }), vy = q.create({
15780
15783
  name: "textAlign",
@@ -15820,4 +15823,4 @@ var ty = "listItem", ny = "textStyle", ry = /^(\d+)\.\s$/, iy = J.create({
15820
15823
  }
15821
15824
  });
15822
15825
  //#endregion
15823
- export { J as _, Fm as a, Jp as c, pp as d, Ep as f, q as g, gp as h, qh as i, Kp as l, xp as m, _y as n, Bm as o, Pp as p, cy as r, Qp as s, vy as t, Up as u, K as v, P as y };
15826
+ export { J as _, vm as a, Em as c, fp as d, wf as f, q as g, pf as h, qh as i, xm as l, hf as m, _y as n, jm as o, bf as p, cy as r, zm as s, vy as t, sp as u, K as v, P as y };