@nldd/design-system 0.30.1 → 0.32.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 (426) hide show
  1. package/custom-elements.json +2319 -110
  2. package/dist/cdn/autoloader.js +139 -139
  3. package/dist/cdn/chunks/{accordion-BcgFdNtq.js → accordion-CLT6C7Ys.js} +4 -4
  4. package/dist/cdn/chunks/{accordion-item-DIoa4wMw.js → accordion-item-DqkLuze7.js} +5 -5
  5. package/dist/cdn/chunks/{activity-indicator-BmpMwyBH.js → activity-indicator-DYgJcdQr.js} +7 -6
  6. package/dist/cdn/chunks/{admonition-DUsuT-qK.js → admonition-307OSenQ.js} +5 -5
  7. package/dist/cdn/chunks/{avatar-BFnVbTB9.js → avatar-DZx4eWGL.js} +7 -7
  8. package/dist/cdn/chunks/{avatar-group-BDgLxUn9.js → avatar-group-D0Z4Yu0y.js} +15 -15
  9. package/dist/cdn/chunks/{badge-CAN4lWcI.js → badge-Ez8ID47C.js} +6 -6
  10. package/dist/cdn/chunks/{banner-BncAmkYl.js → banner-Cu1cwuLr.js} +9 -8
  11. package/dist/cdn/chunks/{bar-split-view-hlmRlFit.js → bar-split-view-7bviCuBj.js} +52 -32
  12. package/dist/cdn/chunks/{blockquote-DUAwVT6v.js → blockquote-PCr0GO6z.js} +7 -7
  13. package/dist/cdn/chunks/{box-CasAZ5pk.js → box-BOZDuPmd.js} +3 -3
  14. package/dist/cdn/chunks/{breadcrumbs-DBHmoFPu.js → breadcrumbs-CVXCsvXU.js} +6 -6
  15. package/dist/cdn/chunks/{button-IRm7Oibq.js → button-3Up7cEWx.js} +14 -10
  16. package/dist/cdn/chunks/{button-bar-CocGraYA.js → button-bar-bK3oi0e-.js} +3 -3
  17. package/dist/cdn/chunks/{button-group-BfNf2BZe.js → button-group-DSBBqKvs.js} +2 -2
  18. package/dist/cdn/chunks/{card-BaomP9oB.js → card-CH0xAbO6.js} +4 -4
  19. package/dist/cdn/chunks/{cell-Dir3g5vA.js → cell-BwW6TV8v.js} +6 -6
  20. package/dist/cdn/chunks/{checkbox-CIXkUW3R.js → checkbox-CYR3ChYP.js} +5 -5
  21. package/dist/cdn/chunks/{checkbox-field-DQ4MlASP.js → checkbox-field-D43DeCUk.js} +8 -8
  22. package/dist/cdn/chunks/{checkbox-group-C8E46V4D.js → checkbox-group-BVr37vFn.js} +3 -3
  23. package/dist/cdn/chunks/{class-map-D0fkDSLP.js → class-map-B9MjP-Ik.js} +1 -1
  24. package/dist/cdn/chunks/{code-editor-C8YqZrN-.js → code-editor-CGx_sn9q.js} +13 -13
  25. package/dist/cdn/chunks/{code-viewer-Ck7wxfDo.js → code-viewer-CyEZJm0a.js} +38 -38
  26. package/dist/cdn/chunks/{codemirror-input-DNrSyYSw.js → codemirror-input-BRShjOew.js} +345 -345
  27. package/dist/cdn/chunks/{collection-DprNdn8V.js → collection-B3wQHswI.js} +8 -8
  28. package/dist/cdn/chunks/{combo-box-B2L79FY5.js → combo-box-UI2A1nHw.js} +11 -9
  29. package/dist/cdn/chunks/{container-Cg4kOUN8.js → container-GzgjWXSY.js} +3 -3
  30. package/dist/cdn/chunks/{custom-element-CDepWGgp.js → custom-element-CF94IDoN.js} +1 -1
  31. package/dist/cdn/chunks/{date-field-Dsw2EkcZ.js → date-field-BoAnSKOD.js} +14 -12
  32. package/dist/cdn/chunks/{date-picker-ugS3-VBq.js → date-picker-Dn80yrfN.js} +11 -11
  33. package/dist/cdn/chunks/{decorate-CuJsiFnl.js → decorate-DNdCDV-Z.js} +1 -1
  34. package/dist/cdn/chunks/{described-by-mixin-Ih_IoqBD.js → described-by-mixin-6MEe_hOH.js} +2 -2
  35. package/dist/cdn/chunks/{description-cell-DiLwKDva.js → description-cell-QR-as1SF.js} +7 -7
  36. package/dist/cdn/chunks/{dev-checks-Bfy3qHxO.js → dev-checks-DlNQtR5p.js} +24 -19
  37. package/dist/cdn/chunks/{directive-helpers-DEvA8txp.js → directive-helpers-9JM8Li8K.js} +1 -1
  38. package/dist/cdn/chunks/{dist-BYPfq6x4.js → dist-B5rtEAPd.js} +35 -35
  39. package/dist/cdn/chunks/{dist-CrMq7oqC.js → dist-BGxQOo33.js} +103 -103
  40. package/dist/cdn/chunks/{dist-BEZuPWxd.js → dist-BKGDiUni.js} +75 -75
  41. package/dist/cdn/chunks/{dist-DsQS8bTi.js → dist-BvZqEQHV.js} +36 -36
  42. package/dist/cdn/chunks/{dist-cg8p9qPS.js → dist-C6dhaR9M.js} +12 -12
  43. package/dist/cdn/chunks/{dist-BFGGXlGI.js → dist-CIp0mUeR.js} +83 -83
  44. package/dist/cdn/chunks/{dist-s2b8iJ30.js → dist-DVm3azdM.js} +66 -66
  45. package/dist/cdn/chunks/{dist-Cr0OiT-0.js → dist-Drahkxmv.js} +1 -1
  46. package/dist/cdn/chunks/{dist-Djmp37M0.js → dist-Dtrv48QJ.js} +47 -47
  47. package/dist/cdn/chunks/{dist-CUXioD4z.js → dist-Duw9BWmb.js} +307 -307
  48. package/dist/cdn/chunks/{dist-DPnEBzju.js → dist-QKanuZ5c.js} +36 -36
  49. package/dist/cdn/chunks/{dist-C8wDJyDH.js → dist-gCusBxjl.js} +66 -66
  50. package/dist/cdn/chunks/{dist-UpdpX10o.js → dist-z3iYo2pQ.js} +80 -80
  51. package/dist/cdn/chunks/{divider-DeLH4QwC.js → divider-Dv0ZKI-0.js} +2 -2
  52. package/dist/cdn/chunks/{document-tab-bar-bOkWFMdJ.js → document-tab-bar-Dzp5ncIl.js} +9 -9
  53. package/dist/cdn/chunks/{dropdown-C1NBctuB.js → dropdown-kVarufY1.js} +5 -5
  54. package/dist/cdn/chunks/{file-field-DFjBl7rn.js → file-field-B0aEvinG.js} +14 -14
  55. package/dist/cdn/chunks/{form-mkjbjprY.js → form-CvuALdyG.js} +1 -1
  56. package/dist/cdn/chunks/{form-actions-DcsN5H-J.js → form-actions-BPehBKcl.js} +2 -2
  57. package/dist/cdn/chunks/{form-associated-mixin-YG9BXK0j.js → form-associated-mixin-BMdwBjn_.js} +29 -3
  58. package/dist/cdn/chunks/{form-field-BWtox2o0.js → form-field-B0pcB33o.js} +8 -8
  59. package/dist/cdn/chunks/{form-section-CLuotkhm.js → form-section-DWlfhgMj.js} +3 -3
  60. package/dist/cdn/chunks/{full-bleed-section-CZfvZFDs.js → full-bleed-section-4orVi9nk.js} +3 -3
  61. package/dist/cdn/chunks/{hero-C_x5gAKl.js → hero-DvG8bQx1.js} +155 -103
  62. package/dist/cdn/chunks/{icon-CeybqndL.js → icon-CoujQk37.js} +3 -3
  63. package/dist/cdn/chunks/{icon-button-BLe-iiU5.js → icon-button-CghwJ1ZM.js} +10 -10
  64. package/dist/cdn/chunks/{icon-cell-DUBctf2q.js → icon-cell-CB8JJxPx.js} +5 -5
  65. package/dist/cdn/chunks/{identity-C4FW2LCv.js → identity-D7knBYp4.js} +7 -7
  66. package/dist/cdn/chunks/{if-defined-DwzUaXrb.js → if-defined-DogpZQqB.js} +1 -1
  67. package/dist/cdn/chunks/{image-7aQSrryL.js → image-Cabp3_Mm.js} +19 -14
  68. package/dist/cdn/chunks/{inline-dialog-B9o9ckxL.js → inline-dialog-BA1HLcgr.js} +8 -8
  69. package/dist/cdn/chunks/{just-in-time-education-C-3THmVJ.js → just-in-time-education-k1iYVZNa.js} +5 -5
  70. package/dist/cdn/chunks/{kanban-BemPSLk8.js → kanban-MhZkM6ah.js} +5 -5
  71. package/dist/cdn/chunks/{kanban-column-CYZjUBUd.js → kanban-column-EHsh2VXL.js} +4 -4
  72. package/dist/cdn/chunks/{keyboard-shortcut-BK35aEeR.js → keyboard-shortcut-ClT66akm.js} +4 -4
  73. package/dist/cdn/chunks/{languages-CT6Im_c5.js → languages-ksBh8Hul.js} +181 -170
  74. package/dist/cdn/chunks/{link-Lbw4Ut52.js → link-B9gG-fEr.js} +6 -6
  75. package/dist/cdn/chunks/{link-group-B1XXP70E.js → link-group-C3Z_3TDw.js} +2 -2
  76. package/dist/cdn/chunks/{list-D2vWEpYC.js → list-BqJ_ucfa.js} +9 -9
  77. package/dist/cdn/chunks/{list-item-Y0wOQqRa.js → list-item-DpQBn1El.js} +74 -73
  78. package/dist/cdn/chunks/{list-item-segment-BamNSRcL.js → list-item-segment-AVJcFdeh.js} +29 -28
  79. package/dist/cdn/chunks/{menu-Cvwt6mA5.js → menu-CYxTNgBa.js} +10 -10
  80. package/dist/cdn/chunks/{menu-bar-D9Etcq_r.js → menu-bar-BcZ1EP6b.js} +13 -8
  81. package/dist/cdn/chunks/{menu-bar-item-BUVqi3o-.js → menu-bar-item-D0UrqKlH.js} +7 -7
  82. package/dist/cdn/chunks/{menu-divider-BqRMxjF3.js → menu-divider-uvK-8rJG.js} +3 -3
  83. package/dist/cdn/chunks/{menu-group-BSnRGQgm.js → menu-group-BIPjBdrU.js} +4 -4
  84. package/dist/cdn/chunks/{menu-item-UQoejlK0.js → menu-item-DcBe9_qD.js} +4 -4
  85. package/dist/cdn/chunks/{menu.template-CewvJO-Y.js → menu.template-BFq905uv.js} +6 -6
  86. package/dist/cdn/chunks/{modal-dialog-C6XUoI95.js → modal-dialog-CXfPMsvc.js} +4 -4
  87. package/dist/cdn/chunks/{multi-line-text-field-4Vn5Nrjo.js → multi-line-text-field-BLibOq1E.js} +8 -6
  88. package/dist/cdn/chunks/{navigation-split-view-BEwcAHWu.js → navigation-split-view-jk6HesTp.js} +5 -5
  89. package/dist/cdn/chunks/{nl.generated-CrkPlg69.js → nl.generated-Bu83qDco.js} +1 -1
  90. package/dist/cdn/chunks/{notification-DxsARz6U.js → notification-Bc53Pa5u.js} +7 -7
  91. package/dist/cdn/chunks/{number-field-wFK_taVU.js → number-field-CYDiJ7CO.js} +40 -16
  92. package/dist/cdn/chunks/{one-half-one-half-section-CyedWMlH.js → one-half-one-half-section-DTTHJknv.js} +3 -3
  93. package/dist/cdn/chunks/{one-third-two-thirds-section-LRJlzoAZ.js → one-third-two-thirds-section-C0YU3ss3.js} +3 -3
  94. package/dist/cdn/chunks/{one-time-code-field-BYQfRePV.js → one-time-code-field-DsfKUJDd.js} +18 -13
  95. package/dist/cdn/chunks/{overflow-menu-BdEHECvL.js → overflow-menu-8GWanho5.js} +1 -1
  96. package/dist/cdn/chunks/{page-DpGgV58g.js → page-BIXY8Czs.js} +5 -5
  97. package/dist/cdn/chunks/{page-footer-DxaWwS8U.js → page-footer-BSPneEMd.js} +5 -5
  98. package/dist/cdn/chunks/{page-section-mixin-DigQhtVE.js → page-section-mixin-HrMHOk9c.js} +3 -3
  99. package/dist/cdn/chunks/{pagination-Ch0EdxDX.js → pagination-DkV6axw8.js} +7 -7
  100. package/dist/cdn/chunks/{password-field-Dm8ah1v8.js → password-field-eZtU3DR2.js} +11 -9
  101. package/dist/cdn/chunks/{popover-Bhr3Nbst.js → popover-BjXDnHDF.js} +5 -5
  102. package/dist/cdn/chunks/press-feedback-BtUqwC_0.js +12 -0
  103. package/dist/cdn/chunks/{progress-bar-BBpNc1Wm.js → progress-bar-D5-CB4NJ.js} +14 -15
  104. package/dist/cdn/chunks/{progress-circle-DfbawfeQ.js → progress-circle-tXH6BMlN.js} +18 -16
  105. package/dist/cdn/chunks/{radio-button-D_KTcIAN.js → radio-button-CsgnS_Qn.js} +4 -4
  106. package/dist/cdn/chunks/{radio-button-field-H_NQqcZp.js → radio-button-field-DbnG-fR8.js} +7 -7
  107. package/dist/cdn/chunks/{radio-button-group-kbaWn4YY.js → radio-button-group-BUujUoVm.js} +3 -3
  108. package/dist/cdn/chunks/{render-marked-DnJwRVpy.js → render-marked-BSbmklIR.js} +1 -1
  109. package/dist/cdn/chunks/{reorder-handle-cell-BI4CugME.js → reorder-handle-cell-Bi_v5VZB.js} +4 -4
  110. package/dist/cdn/chunks/{reorder-handle-mixin-LPcbGhhD.js → reorder-handle-mixin-Cu-u0TY-.js} +2 -2
  111. package/dist/cdn/chunks/{repeat-BBqtniIo.js → repeat-DU632DST.js} +2 -2
  112. package/dist/cdn/chunks/{rich-text-xlU1NiF6.js → rich-text-C4DZxOTU.js} +3 -3
  113. package/dist/cdn/chunks/{row-header-mixin-CyqWb67i.js → row-header-mixin-CMAyjE-7.js} +2 -2
  114. package/dist/cdn/chunks/{scroll-fade-CTn6QJuM.js → scroll-fade-DBQ2mD8Y.js} +2 -2
  115. package/dist/cdn/chunks/{search-field-OpYujGwS.js → search-field-NJcMkh2l.js} +12 -10
  116. package/dist/cdn/chunks/{segmented-control-8NtY_sU6.js → segmented-control-Bx0X7A2X.js} +7 -7
  117. package/dist/cdn/chunks/{shadow-resets-CtbMaZlz.js → shadow-resets-BplgOKPc.js} +2 -2
  118. package/dist/cdn/chunks/{sheet-C_biEFcb.js → sheet-96shetPW.js} +3 -3
  119. package/dist/cdn/chunks/{shell-OXRr3zFb.js → shell-D53z8Daa.js} +3 -3
  120. package/dist/cdn/chunks/{side-by-side-split-view-DVXrHULp.js → side-by-side-split-view-CA3ZYDmC.js} +4 -4
  121. package/dist/cdn/chunks/{sidebar-section-DYa_6OWF.js → sidebar-section-oUXcNchf.js} +8 -8
  122. package/dist/cdn/chunks/{simple-section-CGUSyUAl.js → simple-section-DhSCulaz.js} +3 -3
  123. package/dist/cdn/chunks/{skip-link-Dl2ouKZk.js → skip-link-CNvkL2ng.js} +5 -5
  124. package/dist/cdn/chunks/{slider-Do-LOJNR.js → slider-Ba5O0jF6.js} +12 -11
  125. package/dist/cdn/chunks/{spacer-BgHrBz2X.js → spacer-Bz-xBLrh.js} +2 -2
  126. package/dist/cdn/chunks/{spacer-cell-CiQ8Ufpp.js → spacer-cell-k1AYw_80.js} +4 -4
  127. package/dist/cdn/chunks/{split-button-Sd_-qYSD.js → split-button-DwHGhJ94.js} +7 -7
  128. package/dist/cdn/chunks/{split-view-divider-D1TzV2VR.js → split-view-divider-BTt7hrtq.js} +2 -2
  129. package/dist/cdn/chunks/{stacked-split-view-Ctlqwe0S.js → stacked-split-view-Cq3kBEo7.js} +4 -4
  130. package/dist/cdn/chunks/{static-html-C8oeEnJZ.js → static-html-C1_QY9-9.js} +1 -1
  131. package/dist/cdn/chunks/{status-bar-u2SmYnKZ.js → status-bar-Y3NC9vFo.js} +4 -4
  132. package/dist/cdn/chunks/{step-bar-BA852p33.js → step-bar-DEOX-7NN.js} +7 -7
  133. package/dist/cdn/chunks/{step-cell-DF9xadrF.js → step-cell-Crml9Hpt.js} +5 -5
  134. package/dist/cdn/chunks/{stepper-dRpkKCse.js → stepper-XZGIlIIU.js} +7 -7
  135. package/dist/cdn/chunks/{style-map-eCE91iAi.js → style-map-Bznyirg7.js} +1 -1
  136. package/dist/cdn/chunks/{swatch-picker-Bjv3Yyk1.js → swatch-picker-4fIhPJQc.js} +6 -6
  137. package/dist/cdn/chunks/{switch-DJBzXPfD.js → switch-DPjb_Wtv.js} +6 -6
  138. package/dist/cdn/chunks/{switch-field-uMAxSz6L.js → switch-field-DF96_PUQ.js} +7 -7
  139. package/dist/cdn/chunks/{tab-bar-DLHqLs6Y.js → tab-bar-CtZpacEn.js} +8 -8
  140. package/dist/cdn/chunks/{table-BLvkO5AG.js → table-S76Xq4j8.js} +5 -5
  141. package/dist/cdn/chunks/{tag-DYhl2u2I.js → tag-Bzem1z9I.js} +5 -5
  142. package/dist/cdn/chunks/{term-D79d-lz3.js → term-Bbuv7_kb.js} +12 -12
  143. package/dist/cdn/chunks/{text-kRZ3cyId.js → text-C7mSKF-E.js} +4 -4
  144. package/dist/cdn/chunks/{text-cell-BbVoThab.js → text-cell-CMXSo5Ra.js} +9 -9
  145. package/dist/cdn/chunks/{text-editor-dZhei5Gg.js → text-editor-DgkEF4fV.js} +1307 -903
  146. package/dist/cdn/chunks/{text-editor.i18n-sJKiRQ4i.js → text-editor.i18n-Cl_BYDwS.js} +2 -1
  147. package/dist/cdn/chunks/{text-field-DmKGVJvm.js → text-field-B06CiuOY.js} +8 -6
  148. package/dist/cdn/chunks/{text-wrap-C6QQbSuj.js → text-wrap-EQF-fBi4.js} +2 -2
  149. package/dist/cdn/chunks/{time-field-BXVxhV80.js → time-field-CUvhCoHF.js} +16 -14
  150. package/dist/cdn/chunks/{time-picker-BjJfPmir.js → time-picker-wgfjQpFB.js} +6 -6
  151. package/dist/cdn/chunks/{title-DsOLSMHj.js → title-Uzi0g--W.js} +5 -5
  152. package/dist/cdn/chunks/{title-cell-DXcur6Eb.js → title-cell-Cc9j1I4W.js} +9 -9
  153. package/dist/cdn/chunks/{toggle-button-7fasRpr1.js → toggle-button-DeKfh6eM.js} +9 -9
  154. package/dist/cdn/chunks/{toggle-button-group-B9No_FIj.js → toggle-button-group-DU2SGR3P.js} +2 -2
  155. package/dist/cdn/chunks/{token-BYCl-dDP.js → token-BC3tY59o.js} +5 -5
  156. package/dist/cdn/chunks/{token-field-C9fGsIxB.js → token-field-BO_hUPuR.js} +13 -11
  157. package/dist/cdn/chunks/{toolbar-CBs6yMNd.js → toolbar-BWmrbOds.js} +9 -9
  158. package/dist/cdn/chunks/{toolbar-item-DYVo5I60.js → toolbar-item-jnrwcrih.js} +3 -3
  159. package/dist/cdn/chunks/{toolbar-title-Bu5PbFPP.js → toolbar-title-STB4FCnn.js} +4 -4
  160. package/dist/cdn/chunks/{toolbar.styles-BUS-XIdr.js → toolbar.styles-D7-Iy0U9.js} +3 -11
  161. package/dist/cdn/chunks/{tooltip-yXDfEbZ1.js → tooltip-C1qPjhuT.js} +5 -5
  162. package/dist/cdn/chunks/{top-navigation-bar-DW6xYKY0.js → top-navigation-bar-9Iy3niRW.js} +117 -128
  163. package/dist/cdn/chunks/{top-title-bar-Fk4jzs8I.js → top-title-bar-AiWXxvEn.js} +6 -6
  164. package/dist/cdn/chunks/{two-thirds-one-third-section-B9a1YYXm.js → two-thirds-one-third-section-B4-HS2qN.js} +3 -3
  165. package/dist/cdn/chunks/{validation-list-BAyP6Ccd.js → validation-list-_cQOzDKg.js} +5 -5
  166. package/dist/cdn/chunks/{visibility-mixin-9Nr_J68Z.js → visibility-mixin-yf02zdEy.js} +2 -2
  167. package/dist/cdn/chunks/{visually-hidden-BN6jVrRE.js → visually-hidden-hjpQo7w2.js} +2 -2
  168. package/dist/cdn/chunks/{window-D4rLzdHo.js → window-Br52FScm.js} +4 -4
  169. package/dist/cdn/chunks/{with-translations-RkK-Bq8M.js → with-translations-Z7dHTxzy.js} +3 -3
  170. package/dist/components/actions/button/button.styles.d.ts.map +1 -1
  171. package/dist/components/actions/button/button.styles.js +4 -0
  172. package/dist/components/actions/button/button.styles.js.map +1 -1
  173. package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
  174. package/dist/components/actions/toolbar/toolbar.styles.js +0 -8
  175. package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
  176. package/dist/components/content/avatar/avatar.styles.js +1 -1
  177. package/dist/components/content/blockquote/blockquote.d.ts +2 -2
  178. package/dist/components/content/blockquote/blockquote.js +2 -2
  179. package/dist/components/content/blockquote/blockquote.styles.js +2 -2
  180. package/dist/components/content/icon/icon.d.ts +1 -1
  181. package/dist/components/content/icon/icon.js +1 -1
  182. package/dist/components/content/icon/icon.styles.js +1 -1
  183. package/dist/components/content/identity/identity.d.ts +1 -1
  184. package/dist/components/content/identity/identity.js +1 -1
  185. package/dist/components/content/image/image.d.ts +2 -2
  186. package/dist/components/content/image/image.d.ts.map +1 -1
  187. package/dist/components/content/image/image.js +3 -3
  188. package/dist/components/content/image/image.js.map +1 -1
  189. package/dist/components/content/image/image.styles.d.ts.map +1 -1
  190. package/dist/components/content/image/image.styles.js +5 -2
  191. package/dist/components/content/image/image.styles.js.map +1 -1
  192. package/dist/components/content/image/image.template.d.ts.map +1 -1
  193. package/dist/components/content/image/image.template.js +3 -1
  194. package/dist/components/content/image/image.template.js.map +1 -1
  195. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts +1 -1
  196. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js +1 -1
  197. package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js +1 -1
  198. package/dist/components/content/text/text.d.ts +1 -1
  199. package/dist/components/content/text/text.js +1 -1
  200. package/dist/components/inputs/checkbox/checkbox.d.ts +1 -1
  201. package/dist/components/inputs/checkbox/checkbox.js +1 -1
  202. package/dist/components/inputs/checkbox-field/checkbox-field.d.ts +1 -1
  203. package/dist/components/inputs/checkbox-field/checkbox-field.js +1 -1
  204. package/dist/components/inputs/code-editor/code-editor.styles.js +2 -2
  205. package/dist/components/inputs/combo-box/combo-box.styles.d.ts.map +1 -1
  206. package/dist/components/inputs/combo-box/combo-box.styles.js +2 -0
  207. package/dist/components/inputs/combo-box/combo-box.styles.js.map +1 -1
  208. package/dist/components/inputs/date-field/date-field.d.ts +1 -1
  209. package/dist/components/inputs/date-field/date-field.styles.d.ts.map +1 -1
  210. package/dist/components/inputs/date-field/date-field.styles.js +2 -0
  211. package/dist/components/inputs/date-field/date-field.styles.js.map +1 -1
  212. package/dist/components/inputs/date-picker/date-picker.d.ts +1 -1
  213. package/dist/components/inputs/date-picker/date-picker.js +1 -1
  214. package/dist/components/inputs/file-field/file-field.d.ts +1 -1
  215. package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts +1 -1
  216. package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.d.ts.map +1 -1
  217. package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js +2 -0
  218. package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js.map +1 -1
  219. package/dist/components/inputs/number-field/number-field.d.ts +10 -2
  220. package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
  221. package/dist/components/inputs/number-field/number-field.js +32 -4
  222. package/dist/components/inputs/number-field/number-field.js.map +1 -1
  223. package/dist/components/inputs/number-field/number-field.styles.d.ts.map +1 -1
  224. package/dist/components/inputs/number-field/number-field.styles.js +15 -5
  225. package/dist/components/inputs/number-field/number-field.styles.js.map +1 -1
  226. package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts +10 -3
  227. package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts.map +1 -1
  228. package/dist/components/inputs/one-time-code-field/one-time-code-field.js +16 -6
  229. package/dist/components/inputs/one-time-code-field/one-time-code-field.js.map +1 -1
  230. package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.d.ts.map +1 -1
  231. package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.js +4 -3
  232. package/dist/components/inputs/one-time-code-field/one-time-code-field.styles.js.map +1 -1
  233. package/dist/components/inputs/password-field/password-field.d.ts +1 -1
  234. package/dist/components/inputs/password-field/password-field.styles.d.ts.map +1 -1
  235. package/dist/components/inputs/password-field/password-field.styles.js +2 -0
  236. package/dist/components/inputs/password-field/password-field.styles.js.map +1 -1
  237. package/dist/components/inputs/radio-button/radio-button.d.ts +1 -1
  238. package/dist/components/inputs/radio-button/radio-button.js +1 -1
  239. package/dist/components/inputs/radio-button-field/radio-button-field.d.ts +1 -1
  240. package/dist/components/inputs/radio-button-field/radio-button-field.js +1 -1
  241. package/dist/components/inputs/search-field/search-field.styles.d.ts.map +1 -1
  242. package/dist/components/inputs/search-field/search-field.styles.js +2 -0
  243. package/dist/components/inputs/search-field/search-field.styles.js.map +1 -1
  244. package/dist/components/inputs/slider/slider.styles.d.ts.map +1 -1
  245. package/dist/components/inputs/slider/slider.styles.js +3 -2
  246. package/dist/components/inputs/slider/slider.styles.js.map +1 -1
  247. package/dist/components/inputs/switch/switch.d.ts +1 -1
  248. package/dist/components/inputs/switch/switch.js +1 -1
  249. package/dist/components/inputs/switch/switch.styles.js +1 -1
  250. package/dist/components/inputs/switch-field/switch-field.d.ts +1 -1
  251. package/dist/components/inputs/switch-field/switch-field.js +1 -1
  252. package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.d.ts +2 -1
  253. package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.d.ts.map +1 -1
  254. package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js +9 -7
  255. package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js.map +1 -1
  256. package/dist/components/inputs/text-editor/text-editor.commands.d.ts +1 -0
  257. package/dist/components/inputs/text-editor/text-editor.commands.d.ts.map +1 -1
  258. package/dist/components/inputs/text-editor/text-editor.commands.js +2 -0
  259. package/dist/components/inputs/text-editor/text-editor.commands.js.map +1 -1
  260. package/dist/components/inputs/text-editor/text-editor.d.ts +12 -2
  261. package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
  262. package/dist/components/inputs/text-editor/text-editor.emphasis.d.ts.map +1 -1
  263. package/dist/components/inputs/text-editor/text-editor.emphasis.js +6 -0
  264. package/dist/components/inputs/text-editor/text-editor.emphasis.js.map +1 -1
  265. package/dist/components/inputs/text-editor/text-editor.focus.d.ts +13 -0
  266. package/dist/components/inputs/text-editor/text-editor.focus.d.ts.map +1 -0
  267. package/dist/components/inputs/text-editor/text-editor.focus.js +54 -0
  268. package/dist/components/inputs/text-editor/text-editor.focus.js.map +1 -0
  269. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts +1 -1
  270. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts.map +1 -1
  271. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js +14 -5
  272. package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -1
  273. package/dist/components/inputs/text-editor/text-editor.highlight.d.ts +3 -0
  274. package/dist/components/inputs/text-editor/text-editor.highlight.d.ts.map +1 -0
  275. package/dist/components/inputs/text-editor/text-editor.highlight.js +28 -0
  276. package/dist/components/inputs/text-editor/text-editor.highlight.js.map +1 -0
  277. package/dist/components/inputs/text-editor/text-editor.i18n.d.ts +1 -0
  278. package/dist/components/inputs/text-editor/text-editor.i18n.d.ts.map +1 -1
  279. package/dist/components/inputs/text-editor/text-editor.i18n.js +3 -0
  280. package/dist/components/inputs/text-editor/text-editor.i18n.js.map +1 -1
  281. package/dist/components/inputs/text-editor/text-editor.js +67 -6
  282. package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
  283. package/dist/components/inputs/text-editor/text-editor.link-destination.d.ts +22 -0
  284. package/dist/components/inputs/text-editor/text-editor.link-destination.d.ts.map +1 -0
  285. package/dist/components/inputs/text-editor/text-editor.link-destination.js +134 -0
  286. package/dist/components/inputs/text-editor/text-editor.link-destination.js.map +1 -0
  287. package/dist/components/inputs/text-editor/text-editor.links.d.ts +14 -0
  288. package/dist/components/inputs/text-editor/text-editor.links.d.ts.map +1 -1
  289. package/dist/components/inputs/text-editor/text-editor.links.js +41 -12
  290. package/dist/components/inputs/text-editor/text-editor.links.js.map +1 -1
  291. package/dist/components/inputs/text-editor/text-editor.list-input.d.ts.map +1 -1
  292. package/dist/components/inputs/text-editor/text-editor.list-input.js +35 -1
  293. package/dist/components/inputs/text-editor/text-editor.list-input.js.map +1 -1
  294. package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
  295. package/dist/components/inputs/text-editor/text-editor.markdown.js +18 -2
  296. package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
  297. package/dist/components/inputs/text-editor/text-editor.mention.d.ts.map +1 -1
  298. package/dist/components/inputs/text-editor/text-editor.mention.js +7 -1
  299. package/dist/components/inputs/text-editor/text-editor.mention.js.map +1 -1
  300. package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +6 -2
  301. package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
  302. package/dist/components/inputs/text-editor/text-editor.mentions.js +6 -3
  303. package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
  304. package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
  305. package/dist/components/inputs/text-editor/text-editor.styles.js +116 -12
  306. package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
  307. package/dist/components/inputs/text-editor/text-editor.toolbar.d.ts.map +1 -1
  308. package/dist/components/inputs/text-editor/text-editor.toolbar.js +14 -2
  309. package/dist/components/inputs/text-editor/text-editor.toolbar.js.map +1 -1
  310. package/dist/components/inputs/text-editor/text-editor.variables.d.ts +20 -0
  311. package/dist/components/inputs/text-editor/text-editor.variables.d.ts.map +1 -0
  312. package/dist/components/inputs/text-editor/text-editor.variables.js +148 -0
  313. package/dist/components/inputs/text-editor/text-editor.variables.js.map +1 -0
  314. package/dist/components/inputs/text-field/text-field.d.ts +1 -1
  315. package/dist/components/inputs/text-field/text-field.styles.d.ts.map +1 -1
  316. package/dist/components/inputs/text-field/text-field.styles.js +2 -0
  317. package/dist/components/inputs/text-field/text-field.styles.js.map +1 -1
  318. package/dist/components/inputs/time-field/time-field.d.ts +1 -1
  319. package/dist/components/inputs/time-field/time-field.styles.d.ts.map +1 -1
  320. package/dist/components/inputs/time-field/time-field.styles.js +2 -0
  321. package/dist/components/inputs/time-field/time-field.styles.js.map +1 -1
  322. package/dist/components/inputs/time-picker/time-picker.d.ts +1 -1
  323. package/dist/components/inputs/time-picker/time-picker.js +1 -1
  324. package/dist/components/inputs/token-field/token-field.styles.d.ts.map +1 -1
  325. package/dist/components/inputs/token-field/token-field.styles.js +2 -0
  326. package/dist/components/inputs/token-field/token-field.styles.js.map +1 -1
  327. package/dist/components/layout/page-sections/hero/hero-corner.d.ts +3 -3
  328. package/dist/components/layout/page-sections/hero/hero-corner.d.ts.map +1 -1
  329. package/dist/components/layout/page-sections/hero/hero-corner.js +31 -24
  330. package/dist/components/layout/page-sections/hero/hero-corner.js.map +1 -1
  331. package/dist/components/layout/page-sections/hero/hero-corner.styles.js +9 -9
  332. package/dist/components/layout/page-sections/hero/hero.d.ts +32 -28
  333. package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
  334. package/dist/components/layout/page-sections/hero/hero.js +40 -33
  335. package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
  336. package/dist/components/layout/page-sections/hero/hero.styles.d.ts.map +1 -1
  337. package/dist/components/layout/page-sections/hero/hero.styles.js +61 -23
  338. package/dist/components/layout/page-sections/hero/hero.styles.js.map +1 -1
  339. package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +20 -10
  340. package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
  341. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +80 -32
  342. package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
  343. package/dist/components/layout/split-views/split-view-divider/split-view-divider.d.ts +1 -1
  344. package/dist/components/layout/split-views/split-view-divider/split-view-divider.js +1 -1
  345. package/dist/components/lists-and-tables/list-item/list-item.d.ts +2 -1
  346. package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
  347. package/dist/components/lists-and-tables/list-item/list-item.js +6 -3
  348. package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
  349. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +1 -0
  350. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
  351. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +4 -2
  352. package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
  353. package/dist/components/navigation/menu-bar/menu-bar.d.ts +3 -1
  354. package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
  355. package/dist/components/navigation/menu-bar/menu-bar.js +21 -7
  356. package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
  357. package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
  358. package/dist/components/navigation/menu-bar-item/menu-bar-item.js +4 -0
  359. package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
  360. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +5 -3
  361. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
  362. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +5 -3
  363. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
  364. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.d.ts.map +1 -1
  365. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +10 -21
  366. package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
  367. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.d.ts.map +1 -1
  368. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js +2 -1
  369. package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js.map +1 -1
  370. package/dist/components/status-and-feedback/banner/banner.styles.d.ts.map +1 -1
  371. package/dist/components/status-and-feedback/banner/banner.styles.js +1 -0
  372. package/dist/components/status-and-feedback/banner/banner.styles.js.map +1 -1
  373. package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.d.ts.map +1 -1
  374. package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js +6 -7
  375. package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js.map +1 -1
  376. package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts +4 -0
  377. package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts.map +1 -1
  378. package/dist/components/status-and-feedback/progress-circle/progress-circle.js +16 -8
  379. package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
  380. package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js +6 -6
  381. package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js.map +1 -1
  382. package/dist/components/status-and-feedback/progress-circle/progress-circle.template.d.ts.map +1 -1
  383. package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js +0 -1
  384. package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js.map +1 -1
  385. package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +3 -2
  386. package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
  387. package/dist/components/status-and-feedback/status-bar/status-bar.js +3 -2
  388. package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
  389. package/dist/components/status-and-feedback/step-bar/step-bar.styles.js +1 -1
  390. package/dist/css/rich-text.css +2 -3
  391. package/dist/css/themes/donkergeel.css +5 -6
  392. package/dist/css/themes/geel.css +5 -6
  393. package/dist/css/themes.css +10 -12
  394. package/dist/css/variables.css +24 -15
  395. package/dist/nldd.min.js +1006 -846
  396. package/dist/translations/en-US.d.ts.map +1 -1
  397. package/dist/translations/en-US.js +1 -0
  398. package/dist/translations/en-US.js.map +1 -1
  399. package/dist/translations/fy.d.ts.map +1 -1
  400. package/dist/translations/fy.js +1 -0
  401. package/dist/translations/fy.js.map +1 -1
  402. package/dist/translations/nl.generated.d.ts +1 -0
  403. package/dist/translations/nl.generated.d.ts.map +1 -1
  404. package/dist/translations/pap-AW.d.ts.map +1 -1
  405. package/dist/translations/pap-AW.js +1 -0
  406. package/dist/translations/pap-AW.js.map +1 -1
  407. package/dist/translations/pap-CW.d.ts.map +1 -1
  408. package/dist/translations/pap-CW.js +1 -0
  409. package/dist/translations/pap-CW.js.map +1 -1
  410. package/dist/types/react.d.ts +40 -44
  411. package/dist/types/vue.d.ts +213 -55
  412. package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
  413. package/dist/utilities/dev-rules.generated.js +23 -18
  414. package/dist/utilities/dev-rules.generated.js.map +1 -1
  415. package/dist/utilities/form-associated-mixin.d.ts +10 -0
  416. package/dist/utilities/form-associated-mixin.d.ts.map +1 -1
  417. package/dist/utilities/form-associated-mixin.js +49 -0
  418. package/dist/utilities/form-associated-mixin.js.map +1 -1
  419. package/dist/utilities/press-feedback.d.ts +16 -0
  420. package/dist/utilities/press-feedback.d.ts.map +1 -0
  421. package/dist/utilities/press-feedback.js +27 -0
  422. package/dist/utilities/press-feedback.js.map +1 -0
  423. package/lint/data.generated.json +1 -1
  424. package/lint/fix.js +43 -6
  425. package/lint/rule.schema.json +2 -1
  426. package/package.json +1 -1
@@ -1,49 +1,49 @@
1
- import { $ as e, F as t, H as n, I as r, J as i, L as a, N as o, O as s, P as c, Q as l, R as u, U as d, Y as f, a as p, at as m, ct as h, et as g, j as _, k as v, n as ee, q as te, r as ne, rt as y, st as b, tt as x, ut as S } from "./languages-CT6Im_c5.js";
2
- import { n as re, r as C, s as ie } from "./custom-element-CDepWGgp.js";
3
- import { t as ae } from "./reflect-non-default-DUOcGZKf.js";
4
- import { a as oe, c as se, d as ce, f as le, i as ue, l as de, n as fe, o as pe, r as me, s as he, t as ge, u as _e } from "./codemirror-input-DNrSyYSw.js";
5
- import { a as ve, i as ye, r as be, t as xe } from "./dist-CUXioD4z.js";
6
- import { t as Se } from "./custom-element-BW8Ua4c7.js";
7
- import { t as Ce } from "./query-ChDzi9FQ.js";
8
- import "./icon-CeybqndL.js";
9
- import "./tooltip-yXDfEbZ1.js";
10
- import { a as we, c as Te, i as Ee, n as De } from "./dist-CrMq7oqC.js";
11
- import "./avatar-BFnVbTB9.js";
12
- import { o as Oe, t as w } from "./decorate-CuJsiFnl.js";
13
- import { s as ke, t as Ae } from "./shadow-resets-CtbMaZlz.js";
14
- import { t as je } from "./text-editor.i18n-sJKiRQ4i.js";
15
- import { t as Me } from "./with-translations-RkK-Bq8M.js";
16
- import { r as Ne } from "./element-state-D-J_cHEV.js";
1
+ import { $ as e, A as t, F as n, I as r, J as i, L as a, M as o, P as s, R as c, U as l, W as u, X as d, Y as f, a as p, ct as m, dt as h, et as g, g as _, it as v, k as y, lt as b, n as ee, nt as x, ot as te, r as ne, tt as re, z as ie } from "./languages-ksBh8Hul.js";
2
+ import { n as ae, r as S, s as oe } from "./custom-element-CF94IDoN.js";
3
+ import { t as se } from "./reflect-non-default-DUOcGZKf.js";
4
+ import { a as ce, c as le, d as ue, f as de, i as fe, l as pe, n as me, o as he, r as ge, s as _e, t as ve, u as ye } from "./codemirror-input-BRShjOew.js";
5
+ import { a as be, i as xe, r as Se, t as Ce } from "./dist-Duw9BWmb.js";
6
+ import { t as we } from "./custom-element-BW8Ua4c7.js";
7
+ import { t as Te } from "./query-ChDzi9FQ.js";
8
+ import "./icon-CoujQk37.js";
9
+ import "./tooltip-C1qPjhuT.js";
10
+ import { a as Ee, c as De, i as Oe, n as ke } from "./dist-BGxQOo33.js";
11
+ import "./avatar-DZx4eWGL.js";
12
+ import { o as Ae, t as C } from "./decorate-DNdCDV-Z.js";
13
+ import { s as je, t as Me } from "./shadow-resets-BplgOKPc.js";
14
+ import { t as Ne } from "./text-editor.i18n-Cl_BYDwS.js";
15
+ import { t as Pe } from "./with-translations-Z7dHTxzy.js";
16
+ import { r as Fe } from "./element-state-D-J_cHEV.js";
17
17
  // src/components/inputs/text-editor/text-editor.labels.ts
18
- var Pe = b.define();
18
+ var w = m.define();
19
19
  // src/components/inputs/text-editor/text-editor.syntax.ts
20
20
  function T(e, t, n, r) {
21
- for (let i = s(e).resolveInner(t, n); i; i = i.parent) if (r(i)) return i;
21
+ for (let i = y(e).resolveInner(t, n); i; i = i.parent) if (r(i)) return i;
22
22
  return null;
23
23
  }
24
- var E = /* @__PURE__ */ new Set(["FencedCode", "CodeBlock"]), Fe = /* @__PURE__ */ new Set([...E, "InlineCode"]);
25
- function D(e, t) {
26
- return k(e, t, 1, E) !== null;
24
+ var Ie = /* @__PURE__ */ new Set(["FencedCode", "CodeBlock"]), Le = /* @__PURE__ */ new Set([...Ie, "InlineCode"]);
25
+ function Re(e, t) {
26
+ return D(e, t, 1, Ie) !== null;
27
27
  }
28
- function Ie(e, t) {
29
- return k(e, t, 1, Fe) !== null;
28
+ function ze(e, t) {
29
+ return D(e, t, 1, Le) !== null;
30
30
  }
31
- function Le(e, t, n, r) {
31
+ function Be(e, t, n, r) {
32
32
  for (let i = t; i <= n;) {
33
33
  let t = e.doc.lineAt(i);
34
34
  r(t.from), i = t.to + 1;
35
35
  }
36
36
  }
37
- function O(e, t) {
38
- return s(e) !== s(t);
37
+ function E(e, t) {
38
+ return y(e) !== y(t);
39
39
  }
40
- function Re(e, t) {
41
- return k(e, t, 1, "HorizontalRule") !== null;
40
+ function Ve(e, t) {
41
+ return D(e, t, 1, "HorizontalRule") !== null;
42
42
  }
43
- function k(e, t, n, r) {
43
+ function D(e, t, n, r) {
44
44
  return T(e, t, n, typeof r == "string" ? (e) => e.name === r : (e) => r.has(e.name));
45
45
  }
46
- function ze(e) {
46
+ function He(e) {
47
47
  let t = [];
48
48
  for (let n = e.firstChild; n; n = n.nextSibling) n.name === "LinkMark" && t.push(n);
49
49
  if (t.length < 2) return null;
@@ -54,35 +54,35 @@ function ze(e) {
54
54
  } : null;
55
55
  }
56
56
  // src/components/inputs/text-editor/text-editor.mention.ts
57
- var Be = "user:";
58
- function Ve(e) {
59
- return `[@${e.text.replace(/[[\]\\]/g, (e) => "\\" + e)}](${Be}${encodeURIComponent(e.id).replace(/[()<>]/g, (e) => "%" + e.charCodeAt(0).toString(16).toUpperCase())})`;
57
+ var Ue = "user:";
58
+ function We(e) {
59
+ return `[@${e.text.replace(/[[\]\\]/g, (e) => "\\" + e)}](${Ue}${encodeURIComponent(e.id).replace(/[()<>]/g, (e) => "%" + e.charCodeAt(0).toString(16).toUpperCase())})`;
60
60
  }
61
- function He(e) {
62
- return `${Ve(e)} `;
61
+ function Ge(e) {
62
+ return `${We(e)} `;
63
63
  }
64
- function Ue(e) {
64
+ function Ke(e) {
65
65
  return e.replace(/\\([[\]\\])/g, "$1");
66
66
  }
67
- function We(e) {
67
+ function qe(e) {
68
68
  try {
69
69
  return decodeURIComponent(e);
70
70
  } catch {
71
71
  return e;
72
72
  }
73
73
  }
74
- var Ge = RegExp(`\\[(@[^\\]]*)\\]\\(${Be}[^)]*\\)`, "g");
75
- function Ke(e) {
76
- return e.startsWith(Be);
74
+ var Je = RegExp(`\\[(@[^\\]]*)\\]\\(${Ue}[^)]*\\)`, "g");
75
+ function Ye(e) {
76
+ return e.startsWith(Ue);
77
77
  }
78
- function A(e, t) {
78
+ function O(e, t) {
79
79
  let n = t.getChild("URL");
80
- return n !== null && Ke(e.sliceDoc(n.from, n.to));
80
+ return n !== null && Ye(e.sliceDoc(n.from, n.to));
81
81
  }
82
- function qe(e, t, n) {
82
+ function Xe(e, t, n) {
83
83
  return e.from === e.to || e.from > t || e.to < n ? "none" : e.from === t && e.to === n ? "alone" : "within";
84
84
  }
85
- var Je = class extends t {
85
+ var Ze = class extends r {
86
86
  constructor(e, t, n) {
87
87
  super(), this.label = e, this.id = t, this.selected = n;
88
88
  }
@@ -95,69 +95,71 @@ var Je = class extends t {
95
95
  let t = document.createElement("nldd-icon");
96
96
  t.className = "cm-md-mention-token-icon", t.setAttribute("icon", "at"), t.setAttribute("aria-hidden", "true");
97
97
  let n = document.createElement("span");
98
- return n.className = "cm-md-mention-token-name", n.dataset.label = this.label, e.append(t, n), e;
98
+ n.className = "cm-md-mention-token-name", n.dataset.label = this.label, n.setAttribute("aria-hidden", "true");
99
+ let r = document.createElement("span");
100
+ return r.className = "cm-md-token-spoken", r.textContent = `@${this.label}`, e.append(r, t, n), e;
99
101
  }
100
102
  };
101
- function Ye(e) {
102
- let t = [], n = e.selection.main;
103
- return s(e).iterate({ enter: (r) => {
104
- if (Fe.has(r.name)) return !1;
105
- if (r.name !== "Link") return;
106
- let i = r.node, a = i.getChild("URL");
107
- if (!a || !A(e, i)) return;
108
- let o = ze(i);
109
- if (!o) return;
110
- let s = Ue(e.sliceDoc(o.from, o.to).replace(/^@/, "")), c = We(e.sliceDoc(a.from, a.to).slice(5)), l = qe(n, i.from, i.to);
111
- t.push(v.replace({ widget: new Je(s, c, l) }).range(i.from, i.to));
112
- } }), v.set(t, !0);
113
- }
114
- function Xe(e, t, n) {
103
+ function Qe(e) {
104
+ let n = [], r = e.selection.main;
105
+ return y(e).iterate({ enter: (i) => {
106
+ if (Le.has(i.name)) return !1;
107
+ if (i.name !== "Link") return;
108
+ let a = i.node, o = a.getChild("URL");
109
+ if (!o || !O(e, a)) return;
110
+ let s = He(a);
111
+ if (!s) return;
112
+ let c = Ke(e.sliceDoc(s.from, s.to).replace(/^@/, "")), l = qe(e.sliceDoc(o.from, o.to).slice(5)), u = Xe(r, a.from, a.to);
113
+ n.push(t.replace({ widget: new Ze(c, l, u) }).range(a.from, a.to));
114
+ } }), t.set(n, !0);
115
+ }
116
+ function $e(e, t, n) {
115
117
  let r = !1;
116
118
  return e.between(0, 1e9, (e, i) => {
117
- if (qe(t, e, i) !== qe(n, e, i)) return r = !0, !1;
119
+ if (Xe(t, e, i) !== Xe(n, e, i)) return r = !0, !1;
118
120
  }), r;
119
121
  }
120
- var Ze = h.define({
121
- create: (e) => Ye(e),
122
- update: (e, t) => t.docChanged || O(t.startState, t.state) ? Ye(t.state) : t.startState.selection.eq(t.state.selection) ? e : Xe(e, t.startState.selection.main, t.state.selection.main) ? Ye(t.state) : e,
123
- provide: (e) => _.decorations.from(e)
124
- }), Qe = _.atomicRanges.of((e) => e.state.field(Ze, !1) ?? v.none), $e = [y.highest(Ze), Qe];
125
- function et(e, t, n) {
126
- return T(e, t, n, (t) => t.name === "Link" && A(e, t));
122
+ var et = b.define({
123
+ create: (e) => Qe(e),
124
+ update: (e, t) => t.docChanged || E(t.startState, t.state) ? Qe(t.state) : t.startState.selection.eq(t.state.selection) ? e : $e(e, t.startState.selection.main, t.state.selection.main) ? Qe(t.state) : e,
125
+ provide: (e) => o.decorations.from(e)
126
+ }), tt = o.atomicRanges.of((e) => e.state.field(et, !1) ?? t.none), nt = [v.highest(et), tt];
127
+ function rt(e, t, n) {
128
+ return T(e, t, n, (t) => t.name === "Link" && O(e, t));
127
129
  }
128
- function tt(e, t) {
129
- let n = et(e, t, 1);
130
+ function it(e, t) {
131
+ let n = rt(e, t, 1);
130
132
  return n ? {
131
133
  from: n.from,
132
134
  to: n.to
133
135
  } : null;
134
136
  }
135
- function nt(e, t) {
136
- let n = et(e, t, -1);
137
+ function at(e, t) {
138
+ let n = rt(e, t, -1);
137
139
  return n && n.to === t ? {
138
140
  from: n.from,
139
141
  to: n.to
140
142
  } : null;
141
143
  }
142
- function rt(e, t) {
143
- let n = et(e, t, 1);
144
+ function ot(e, t) {
145
+ let n = rt(e, t, 1);
144
146
  return n && n.from === t ? {
145
147
  from: n.from,
146
148
  to: n.to
147
149
  } : null;
148
150
  }
149
- function it(e, t) {
151
+ function st(e, t) {
150
152
  let n = e.state.selection.main;
151
153
  if (!n.empty) return !1;
152
- let r = t < 0 ? nt(e.state, n.head) : rt(e.state, n.head);
154
+ let r = t < 0 ? at(e.state, n.head) : ot(e.state, n.head);
153
155
  return r ? (e.dispatch({ selection: {
154
156
  anchor: r.from,
155
157
  head: r.to
156
158
  } }), !0) : !1;
157
159
  }
158
160
  // src/components/inputs/text-editor/text-editor.caret.ts
159
- function at(e) {
160
- let t = _.findFromDOM(e);
161
+ function ct(e) {
162
+ let t = o.findFromDOM(e);
161
163
  if (!t) return null;
162
164
  let n = t.posAtDOM(e);
163
165
  if (n <= t.state.doc.lineAt(n).from) return null;
@@ -171,11 +173,43 @@ function at(e) {
171
173
  return null;
172
174
  }
173
175
  }
176
+ // src/components/inputs/text-editor/text-editor.focus.ts
177
+ var k = m.define(), lt = b.define({
178
+ create: () => !1,
179
+ update(e, t) {
180
+ for (let e of t.effects) if (e.is(k)) return e.value;
181
+ return e;
182
+ }
183
+ }), ut = n.fromClass(class {
184
+ constructor(e) {
185
+ this.view = e, this.pending = !1, this.destroyed = !1;
186
+ }
187
+ update(e) {
188
+ this.pending || e.view.hasFocus === ft(e.state) || (this.pending = !0, queueMicrotask(() => {
189
+ this.pending = !1;
190
+ let { view: e } = this;
191
+ !this.destroyed && e.hasFocus !== ft(e.state) && e.dispatch({ effects: k.of(e.hasFocus) });
192
+ }));
193
+ }
194
+ destroy() {
195
+ this.destroyed = !0;
196
+ }
197
+ }), dt = [
198
+ lt,
199
+ o.focusChangeEffect.of((e, t) => k.of(t)),
200
+ ut
201
+ ];
202
+ function ft(e) {
203
+ return e.field(lt, !1) ?? !0;
204
+ }
205
+ function pt(e) {
206
+ return e.effects.some((e) => e.is(k));
207
+ }
174
208
  // src/components/inputs/text-editor/text-editor.tasks.ts
175
- var ot = x.define({ combine: (e) => e[0] ?? {
209
+ var mt = x.define({ combine: (e) => e[0] ?? {
176
210
  open: () => "Taak, open",
177
211
  done: () => "Taak, afgerond"
178
- } }), st = class extends t {
212
+ } }), ht = class extends r {
179
213
  constructor(e, t) {
180
214
  super(), this.checked = e, this.label = t;
181
215
  }
@@ -194,13 +228,13 @@ var ot = x.define({ combine: (e) => e[0] ?? {
194
228
  return !1;
195
229
  }
196
230
  };
197
- function ct(e, t) {
198
- let n = e.facet(ot);
199
- return v.replace({ widget: new st(t, t ? n.done() : n.open()) });
231
+ function gt(e, n) {
232
+ let r = e.facet(mt);
233
+ return t.replace({ widget: new ht(n, n ? r.done() : r.open()) });
200
234
  }
201
- function lt(e) {
235
+ function _t(e) {
202
236
  let t = [];
203
- return s(e).iterate({ enter: (n) => {
237
+ return y(e).iterate({ enter: (n) => {
204
238
  if (n.name === "FencedCode" || n.name === "CodeBlock") return !1;
205
239
  if (n.name === "TaskMarker") return t.push({
206
240
  from: n.from,
@@ -209,8 +243,8 @@ function lt(e) {
209
243
  }), !1;
210
244
  } }), t;
211
245
  }
212
- function ut(e, t, n) {
213
- let r = lt(e).filter((e) => e.from <= n && e.to >= t);
246
+ function vt(e, t, n) {
247
+ let r = _t(e).filter((e) => e.from <= n && e.to >= t);
214
248
  if (r.length === 0) return null;
215
249
  let i = r.some((e) => !e.checked);
216
250
  return r.map((e) => ({
@@ -219,56 +253,57 @@ function ut(e, t, n) {
219
253
  insert: i ? "x" : " "
220
254
  }));
221
255
  }
222
- function dt(e) {
256
+ function yt(e) {
223
257
  let { state: t } = e;
224
258
  if (t.readOnly) return !1;
225
259
  let n = t.selection.ranges.flatMap((e) => {
226
260
  let n = t.doc.lineAt(e.from).from, r = t.doc.lineAt(e.to).to;
227
- return ut(t, n, r) ?? [];
261
+ return vt(t, n, r) ?? [];
228
262
  });
229
263
  return n.length !== 0 && (e.dispatch({
230
264
  changes: n,
231
265
  userEvent: "input.task"
232
266
  }), !0);
233
267
  }
234
- var ft = _.domEventHandlers({ mousedown(e, t) {
268
+ var bt = o.domEventHandlers({ mousedown(e, t) {
235
269
  let n = e.target, r = n?.closest?.(".cm-md-task-box") ?? n?.closest?.(".cm-md-listprefix")?.querySelector(":scope > .cm-md-task-box");
236
270
  if (!r || e.button !== 0) return !1;
237
271
  if (e.preventDefault(), t.state.readOnly) return !0;
238
- let i = t.posAtDOM(r), a = ut(t.state, i, i);
272
+ let i = t.posAtDOM(r), a = vt(t.state, i, i);
239
273
  return a && t.dispatch({
240
274
  changes: a,
241
275
  userEvent: "input.task"
242
276
  }), !0;
243
277
  } });
244
- function pt(e) {
278
+ function xt(e) {
245
279
  return [
246
- ot.of(e),
247
- ft,
248
- y.high(n.of([{
280
+ mt.of(e),
281
+ bt,
282
+ v.high(l.of([{
249
283
  key: "Mod-Enter",
250
- run: dt
284
+ run: yt
251
285
  }]))
252
286
  ];
253
287
  }
254
288
  // src/components/inputs/text-editor/text-editor.hidden-syntax.ts
255
- var mt = {
289
+ var St = {
256
290
  EmphasisMark: ["Emphasis", "StrongEmphasis"],
257
291
  StrikethroughMark: ["Strikethrough"],
292
+ HighlightMark: ["Highlight"],
258
293
  CodeMark: ["InlineCode"]
259
- }, j = v.replace({}), ht = v.mark({ class: "cm-md-bullet" }), gt = /^(\s*)[-*+]\s+\[[ xX]\](\s+)/, _t = 2.5, vt = {};
260
- function yt(e) {
261
- return vt[e] ?? (vt[e] = v.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e} * var(--_text-editor-marker-advance)) !important` } }));
262
- }
263
- var bt = v.mark({ class: "cm-md-ordinal" }), xt = {};
264
- function St(e) {
265
- let t = e.join(",");
266
- return xt[t] ?? (xt[t] = v.line({
294
+ }, A = t.replace({}), Ct = t.mark({ class: "cm-md-bullet" }), wt = /^(\s*)[-*+]\s+\[[ xX]\](\s+)/, Tt = 2.5, Et = {};
295
+ function Dt(e) {
296
+ return Et[e] ?? (Et[e] = t.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e} * var(--_text-editor-marker-advance)) !important` } }));
297
+ }
298
+ var Ot = t.mark({ class: "cm-md-ordinal" }), kt = {};
299
+ function At(e) {
300
+ let n = e.join(",");
301
+ return kt[n] ?? (kt[n] = t.line({
267
302
  class: "cm-md-quote-line",
268
303
  attributes: { style: `background-image:${e.map(() => "var(--_text-editor-quote-rule)").join(",")};background-position:${e.map((e) => `calc(${e} * var(--_text-editor-marker-advance)) 0`).join(",")}` }
269
304
  }));
270
305
  }
271
- var Ct = v.mark({ class: "cm-md-quote-mark-hidden" }), wt = v.mark({ class: "cm-md-quote-gap" }), Tt = v.mark({ class: "cm-md-code-bare" }), Et = class extends t {
306
+ var jt = t.mark({ class: "cm-md-quote-mark-hidden" }), Mt = t.mark({ class: "cm-md-quote-gap" }), Nt = t.mark({ class: "cm-md-code-bare" }), Pt = t.mark({ class: "cm-md-highlight-bare" }), Ft = class extends r {
272
307
  toDOM() {
273
308
  let e = document.createElement("span");
274
309
  return e.className = "cm-md-rule", e.setAttribute("aria-hidden", "true"), e;
@@ -279,31 +314,31 @@ var Ct = v.mark({ class: "cm-md-quote-mark-hidden" }), wt = v.mark({ class: "cm-
279
314
  ignoreEvent() {
280
315
  return !1;
281
316
  }
282
- }, Dt = v.replace({ widget: new Et() });
283
- function Ot(e) {
317
+ }, It = t.replace({ widget: new Ft() });
318
+ function Lt(e) {
284
319
  let t = e;
285
320
  for (let n = e.parent; n; n = n.parent) n.name === "Blockquote" && (t = n);
286
321
  return t;
287
322
  }
288
- var kt = 2, At = {};
289
- function jt(e, t) {
290
- var n;
291
- return At[n = `${e},${t}`] ?? (At[n] = v.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e + t} * var(--_text-editor-marker-advance)) !important` } }));
323
+ var Rt = 2, zt = {};
324
+ function Bt(e, n) {
325
+ var r;
326
+ return zt[r = `${e},${n}`] ?? (zt[r] = t.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1) !important;padding-left:calc(${e + n} * var(--_text-editor-marker-advance)) !important` } }));
292
327
  }
293
- function Mt(e, t) {
328
+ function Vt(e, t) {
294
329
  let n = /* @__PURE__ */ new Map();
295
- return s(e).iterate({
330
+ return y(e).iterate({
296
331
  from: t.from,
297
332
  to: t.to,
298
333
  enter: (t) => {
299
- t.name === "Blockquote" && Le(e, t.from, t.to, (e) => n.set(e, (n.get(e) ?? 0) + 1));
334
+ t.name === "Blockquote" && Be(e, t.from, t.to, (e) => n.set(e, (n.get(e) ?? 0) + 1));
300
335
  }
301
336
  }), n;
302
337
  }
303
- function Nt(e, t) {
338
+ function Ht(e, t) {
304
339
  for (let n = e.doc.lineAt(t.to);; n = e.doc.line(n.number - 1)) if (/[^\s>]/.test(n.text) || n.from <= t.from) return n.from;
305
340
  }
306
- function Pt(e, t) {
341
+ function Ut(e, t) {
307
342
  let n = [];
308
343
  for (let r of t) {
309
344
  let t = /^[ ]*/.exec(e.slice(r + 1))[0].length;
@@ -311,9 +346,9 @@ function Pt(e, t) {
311
346
  }
312
347
  return n;
313
348
  }
314
- function Ft(e, t) {
349
+ function Wt(e, t) {
315
350
  let n = /* @__PURE__ */ new Map();
316
- return s(e).iterate({
351
+ return y(e).iterate({
317
352
  from: t.from,
318
353
  to: t.to,
319
354
  enter: (t) => {
@@ -323,101 +358,107 @@ function Ft(e, t) {
323
358
  }
324
359
  }), n;
325
360
  }
326
- function It(e) {
327
- return !e.readOnly && e.facet(_.editable);
361
+ function Gt(e) {
362
+ return !e.readOnly && e.facet(o.editable) && ft(e);
328
363
  }
329
- function Lt(e, t, n) {
330
- return It(e) && e.selection.ranges.some((e) => e.from <= n && e.to >= t);
364
+ function Kt(e, t, n) {
365
+ return Gt(e) && e.selection.ranges.some((e) => e.from <= n && e.to >= t);
331
366
  }
332
- var Rt = v.replace({ block: !0 }), zt = v.replace({}), Bt = v.mark({ class: "cm-md-code-language" }), Vt = /* @__PURE__ */ new Set([
367
+ var qt = t.replace({ block: !0 }), Jt = t.replace({}), Yt = t.mark({ class: "cm-md-code-language" }), Xt = /* @__PURE__ */ new Set([
333
368
  "Document",
334
369
  "Blockquote",
335
370
  "BulletList",
336
371
  "OrderedList",
337
372
  "ListItem"
338
373
  ]);
339
- function Ht(e) {
340
- let t = [];
341
- return s(e).iterate({ enter: (n) => {
342
- if (n.name !== "FencedCode") return Vt.has(n.name);
343
- if (Lt(e, n.from, n.to)) return !1;
344
- let r = n.node.getChildren("CodeMark").map((t) => e.doc.lineAt(t.from)), i = e.doc.lineAt(n.from).number;
345
- if (e.doc.lineAt(n.to).number - i + 1 <= r.length) return !1;
346
- let a = n.node.getChild("CodeInfo"), o = n.node.getChild("CodeMark");
347
- for (let [e, n] of r.entries()) e === 0 ? (t.push(zt.range(o.from, a ? a.from : o.to)), a && t.push(Bt.range(a.from, a.to))) : t.push(Rt.range(n.from, n.to));
374
+ function Zt(e) {
375
+ let n = [];
376
+ return y(e).iterate({ enter: (t) => {
377
+ if (t.name !== "FencedCode") return Xt.has(t.name);
378
+ if (Kt(e, t.from, t.to)) return !1;
379
+ let r = t.node.getChildren("CodeMark").map((t) => e.doc.lineAt(t.from)), i = e.doc.lineAt(t.from).number;
380
+ if (e.doc.lineAt(t.to).number - i + 1 <= r.length) return !1;
381
+ let a = t.node.getChild("CodeInfo"), o = t.node.getChild("CodeMark");
382
+ for (let [e, t] of r.entries()) e === 0 ? (n.push(Jt.range(o.from, a ? a.from : o.to)), a && n.push(Yt.range(a.from, a.to))) : n.push(qt.range(t.from, t.to));
348
383
  return !1;
349
- } }), v.set(t, !0);
384
+ } }), t.set(n, !0);
350
385
  }
351
- function Ut(e) {
386
+ function Qt(e) {
352
387
  let t = [];
353
- for (let n of e.selection.ranges) s(e).iterate({
388
+ for (let n of e.selection.ranges) y(e).iterate({
354
389
  from: n.from,
355
390
  to: n.to,
356
- enter: (e) => (e.name === "FencedCode" && t.push(e.from), e.name !== "FencedCode" && Vt.has(e.name))
391
+ enter: (e) => (e.name === "FencedCode" && t.push(e.from), e.name !== "FencedCode" && Xt.has(e.name))
357
392
  });
358
393
  return t.join(",");
359
394
  }
360
- var Wt = h.define({
361
- create: Ht,
362
- update: (e, t) => t.docChanged || t.reconfigured || O(t.startState, t.state) || t.selection && Ut(t.startState) !== Ut(t.state) ? Ht(t.state) : e,
363
- provide: (e) => _.decorations.from(e)
395
+ var $t = b.define({
396
+ create: Zt,
397
+ update: (e, t) => t.docChanged || t.reconfigured || pt(t) || E(t.startState, t.state) || t.selection && Qt(t.startState) !== Qt(t.state) ? Zt(t.state) : e,
398
+ provide: (e) => o.decorations.from(e)
364
399
  });
365
- function Gt(e) {
366
- let { state: t } = e, n = (e, n) => Lt(t, e, n), r = [];
367
- for (let { from: i, to: a } of e.visibleRanges) s(t).iterate({
368
- from: i,
400
+ function en(e) {
401
+ let { state: n } = e, r = (e, t) => Kt(n, e, t), i = [];
402
+ for (let { from: t, to: a } of e.visibleRanges) y(n).iterate({
403
+ from: t,
369
404
  to: a,
370
405
  enter: (e) => {
371
- let i = e.node.parent;
372
- if (e.name === "HorizontalRule") return n(e.from, e.to) || r.push(Dt.range(e.from, e.to)), !1;
406
+ let t = e.node.parent;
407
+ if (e.name === "HorizontalRule") return r(e.from, e.to) || i.push(It.range(e.from, e.to)), !1;
373
408
  if (e.name === "Blockquote") {
374
- let i = Ot(e.node);
375
- if (i !== e.node || n(i.from, i.to)) return;
376
- let a = Ft(t, i), o = Mt(t, i), s = Nt(t, i), c = [0];
377
- Le(t, i.from, i.to, (e) => {
409
+ let t = Lt(e.node);
410
+ if (t !== e.node || r(t.from, t.to)) return;
411
+ let a = Wt(n, t), o = Vt(n, t), s = Ht(n, t), c = [0];
412
+ Be(n, t.from, t.to, (e) => {
378
413
  if (e > s) return;
379
- let n = t.doc.lineAt(e), i = a.get(e) ?? [], l = Pt(n.text, i), u = l.reduce((e, [t, n]) => e + n - t, 0);
380
- for (let [t, n] of l) r.push(j.range(e + t, e + n));
381
- let d = i.filter((e) => /[^ \t]/.test(n.text.charAt(e + 1)));
382
- for (let t of d) r.push(wt.range(e + t, e + t + 1));
383
- let f = i.map((e) => e - l.filter(([t]) => t < e).reduce((e, [t, n]) => e + n - t, 0) + d.filter((t) => t < e).length), p = Math.max(1, o.get(e) ?? 0), m = Jn(n.text) - u + d.length, h = (f.length ? f : c).slice(0, p);
384
- for (; h.length < p;) h.push(h.length ? h[h.length - 1] + kt : 0);
385
- let g = f.length ? (p - f.length) * kt : h[h.length - 1] + kt;
386
- g > 0 ? r.push(jt(m, g).range(e)) : (u || d.length) && r.push(yt(m).range(e)), r.push(St(h).range(e)), c = h;
414
+ let t = n.doc.lineAt(e), r = a.get(e) ?? [], l = Ut(t.text, r), u = l.reduce((e, [t, n]) => e + n - t, 0);
415
+ for (let [t, n] of l) i.push(A.range(e + t, e + n));
416
+ let d = r.filter((e) => /[^ \t]/.test(t.text.charAt(e + 1)));
417
+ for (let t of d) i.push(Mt.range(e + t, e + t + 1));
418
+ let f = r.map((e) => e - l.filter(([t]) => t < e).reduce((e, [t, n]) => e + n - t, 0) + d.filter((t) => t < e).length), p = Math.max(1, o.get(e) ?? 0), m = Sr(t.text) - u + d.length, h = (f.length ? f : c).slice(0, p);
419
+ for (; h.length < p;) h.push(h.length ? h[h.length - 1] + Rt : 0);
420
+ let g = f.length ? (p - f.length) * Rt : h[h.length - 1] + Rt;
421
+ g > 0 ? i.push(Bt(m, g).range(e)) : (u || d.length) && i.push(Dt(m).range(e)), i.push(At(h).range(e)), c = h;
387
422
  });
388
- } else if (i) {
423
+ } else if (t) {
389
424
  if (e.name === "QuoteMark") {
390
- let i = Ot(e.node), a = t.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
391
- n(i.from, i.to) || r.push(Ct.range(e.from, a));
392
- } else if (e.name === "ListMark" && /^[-*+]$/.test(t.sliceDoc(e.from, e.to)) && /^[ \t]/.test(t.sliceDoc(e.to, e.to + 1))) {
393
- let i = t.doc.lineAt(e.from);
394
- if (n(i.from, i.to)) return;
395
- let a = gt.exec(i.text), o = a && e.node.parent?.getChild("Task")?.getChild("TaskMarker");
425
+ let t = Lt(e.node), a = n.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
426
+ r(t.from, t.to) || i.push(jt.range(e.from, a));
427
+ } else if (e.name === "ListMark" && /^[-*+]$/.test(n.sliceDoc(e.from, e.to)) && /^[ \t]/.test(n.sliceDoc(e.to, e.to + 1))) {
428
+ let t = n.doc.lineAt(e.from);
429
+ if (r(t.from, t.to)) return;
430
+ let a = wt.exec(t.text), o = a && e.node.parent?.getChild("Task")?.getChild("TaskMarker");
396
431
  if (a && o) {
397
- r.push(yt(a[1].length + _t + a[2].length).range(i.from), j.range(e.from, o.from), ct(t, /x/i.test(t.sliceDoc(o.from, o.to))).range(o.from, o.to));
432
+ i.push(Dt(a[1].length + Tt + a[2].length).range(t.from), A.range(e.from, o.from), gt(n, /x/i.test(n.sliceDoc(o.from, o.to))).range(o.from, o.to));
398
433
  return;
399
434
  }
400
- r.push(ht.range(e.from, e.to));
401
- } else if (e.name === "ListMark" && /^\d+[.)]$/.test(t.sliceDoc(e.from, e.to))) r.push(bt.range(e.from, e.to));
402
- else if (e.name === "HeaderMark" && i.name.startsWith("ATXHeading")) {
403
- let a = t.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
404
- n(i.from, i.to) || r.push(j.range(e.from, a));
435
+ i.push(Ct.range(e.from, e.to));
436
+ } else if (e.name === "ListMark" && /^\d+[.)]$/.test(n.sliceDoc(e.from, e.to))) i.push(Ot.range(e.from, e.to));
437
+ else if (e.name === "HeaderMark" && t.name.startsWith("ATXHeading")) {
438
+ let a = n.sliceDoc(e.to, e.to + 1) === " " ? e.to + 1 : e.to;
439
+ r(t.from, t.to) || i.push(A.range(e.from, a));
405
440
  } else if (e.name === "Link") {
406
- let i = e.node.getChild("URL"), a = e.node.getChildren("LinkMark");
407
- if (!i || a.length < 2 || A(t, e.node)) return;
408
- n(e.from, e.to) || r.push(j.range(a[0].from, a[0].to), j.range(a[1].from, e.to));
409
- } else if (mt[e.name]?.includes(i.name) && !n(i.from, i.to) && (r.push(j.range(e.from, e.to)), e.name === "CodeMark" && e.from === i.from)) {
410
- let t = i.lastChild;
411
- t && t.from > e.to && r.push(Tt.range(e.to, t.from));
441
+ let t = e.node.getChild("URL"), a = e.node.getChildren("LinkMark");
442
+ if (!t || a.length < 2 || O(n, e.node)) return;
443
+ r(e.from, e.to) || i.push(A.range(a[0].from, a[0].to), A.range(a[1].from, e.to));
444
+ } else if (St[e.name]?.includes(t.name) && !r(t.from, t.to)) {
445
+ if (i.push(A.range(e.from, e.to)), e.name === "CodeMark" && e.from === t.from) {
446
+ let n = t.lastChild;
447
+ n && n.from > e.to && i.push(Nt.range(e.to, n.from));
448
+ }
449
+ if (e.name === "HighlightMark" && e.from === t.from) {
450
+ let n = t.lastChild;
451
+ n && n.name === "HighlightMark" && n.from > e.to && i.push(Pt.range(e.to, n.from));
452
+ }
412
453
  }
413
454
  }
414
455
  }
415
456
  });
416
- return v.set(r, !0);
457
+ return t.set(i, !0);
417
458
  }
418
- var Kt = 3, qt = class {
459
+ var tn = 3, nn = class {
419
460
  constructor(e) {
420
- this.view = e, this.layerObserver = new MutationObserver(() => this.mendSelection()), this.observing = !1, this.checked = "", this.mends = 0, this.decorations = Gt(e), queueMicrotask(() => this.observeLayer());
461
+ this.view = e, this.layerObserver = new MutationObserver(() => this.mendSelection()), this.observing = !1, this.checked = "", this.mends = 0, this.decorations = en(e), queueMicrotask(() => this.observeLayer());
421
462
  }
422
463
  observeLayer() {
423
464
  if (this.observing) return;
@@ -429,11 +470,11 @@ var Kt = 3, qt = class {
429
470
  }), this.observing = !0);
430
471
  }
431
472
  update(e) {
432
- this.observeLayer(), (e.docChanged || e.selectionSet || e.viewportChanged || O(e.startState, e.state) || e.transactions.some((e) => e.reconfigured)) && (this.decorations = Gt(e.view));
473
+ this.observeLayer(), (e.docChanged || e.selectionSet || e.viewportChanged || e.transactions.some(pt) || E(e.startState, e.state) || e.transactions.some((e) => e.reconfigured)) && (this.decorations = en(e.view));
433
474
  }
434
475
  mendSelection() {
435
476
  let { view: e } = this, { from: t, to: n, empty: r } = e.state.selection.main, i = `${t}-${n}-${e.state.doc.length}`;
436
- if (i !== this.checked && (this.checked = i, this.mends = 0), r || this.mends >= Kt) return;
477
+ if (i !== this.checked && (this.checked = i, this.mends = 0), r || this.mends >= tn) return;
437
478
  let a = e.dom.querySelector(".cm-selectionLayer"), o = a ? [...a.querySelectorAll(".cm-selectionBackground")] : [];
438
479
  if (o.length < 2) return;
439
480
  let s = e.coordsAtPos(t, 1), c = e.coordsAtPos(n, -1);
@@ -446,11 +487,11 @@ var Kt = 3, qt = class {
446
487
  this.layerObserver.disconnect();
447
488
  }
448
489
  };
449
- function Jt() {
450
- return [y.highest(c.fromClass(qt, { decorations: (e) => e.decorations })), Wt];
490
+ function rn() {
491
+ return [v.highest(n.fromClass(nn, { decorations: (e) => e.decorations })), $t];
451
492
  }
452
493
  // src/components/inputs/text-editor/text-editor.links.ts
453
- var M = x.define({ combine: (e) => e.some(Boolean) }), Yt = class extends t {
494
+ var j = x.define({ combine: (e) => e.some(Boolean) }), an = class extends r {
454
495
  constructor(e, t, n) {
455
496
  super(), this.href = e, this.tooltip = n, this.ariaLabel = t(e);
456
497
  }
@@ -471,7 +512,7 @@ var M = x.define({ combine: (e) => e.some(Boolean) }), Yt = class extends t {
471
512
  return !0;
472
513
  }
473
514
  coordsAt(e, t, n) {
474
- let r = e.getBoundingClientRect(), i = at(e) ?? {
515
+ let r = e.getBoundingClientRect(), i = ct(e) ?? {
475
516
  top: r.top,
476
517
  bottom: r.bottom
477
518
  }, a = getComputedStyle(e), o = n < 0 ? r.left - parseFloat(a.marginLeft) : r.right + parseFloat(a.marginRight);
@@ -483,90 +524,96 @@ var M = x.define({ combine: (e) => e.some(Boolean) }), Yt = class extends t {
483
524
  };
484
525
  }
485
526
  };
486
- function Xt(e) {
527
+ function on(e) {
487
528
  return e.replace(/^\[|\]$/g, "").trim().replace(/\s+/g, " ").toLowerCase();
488
529
  }
489
- function Zt(e) {
530
+ function sn(e) {
490
531
  let t = /* @__PURE__ */ new Map();
491
- return s(e).iterate({ enter: (n) => {
532
+ return y(e).iterate({ enter: (n) => {
492
533
  if (n.name !== "LinkReference") return;
493
534
  let r = null, i = null;
494
- for (let t = n.node.firstChild; t; t = t.nextSibling) t.name === "LinkLabel" ? r = Xt(e.sliceDoc(t.from, t.to)) : t.name === "URL" && (i = e.sliceDoc(t.from, t.to));
535
+ for (let t = n.node.firstChild; t; t = t.nextSibling) t.name === "LinkLabel" ? r = on(e.sliceDoc(t.from, t.to)) : t.name === "URL" && (i = e.sliceDoc(t.from, t.to));
495
536
  r && i && !t.has(r) && t.set(r, i);
496
537
  } }), t;
497
538
  }
498
- function Qt(e) {
539
+ var cn = /^(?:localhost|[^\s/?#:@]+\.[^\s/?#:@]+):\d+(?:[/?#]|$)/i, ln = /^[a-z][a-z0-9+.-]*:/i, un = /^[^\s@/?#:]+@[^\s@/?#:]+(?:\?\S*)?$/;
540
+ function dn(e) {
541
+ let t = e.trim();
542
+ return !t || /^(?:[/#?.]|\{\{)/.test(t) ? e : cn.test(t) ? `https://${t}` : ln.test(t) ? e : un.test(t) ? `mailto:${t}` : !/^www\.[^\s@:/?#]/i.test(t) && !/^[^/?#@:\s]*\.(?:\p{L}{2,}|xn--[a-z0-9-]+)(?:[/?#]|$)/iu.test(t) ? e : `https://${t}`;
543
+ }
544
+ function fn(e) {
499
545
  let t = e.replace(/[\u0000-\u0020\u007f-\u009f]/g, "");
500
546
  return !/^[a-z][a-z0-9+.-]*:/i.test(t) || /^(?:https?|mailto|tel):/i.test(t);
501
547
  }
502
- function $t(e, t, n) {
548
+ function pn(e, t, n) {
503
549
  let r = null;
504
550
  for (let n = t.firstChild; n; n = n.nextSibling) {
505
551
  if (n.name === "URL") {
506
- let t = e.sliceDoc(n.from, n.to);
507
- return t && !Ke(t) && Qt(t) ? t : null;
552
+ let t = dn(e.sliceDoc(n.from, n.to));
553
+ return t && !Ye(t) && fn(t) ? t : null;
508
554
  }
509
- n.name === "LinkLabel" && (r = Xt(e.sliceDoc(n.from, n.to)));
555
+ n.name === "LinkLabel" && (r = on(e.sliceDoc(n.from, n.to)));
510
556
  }
511
557
  if (r) {
512
- let e = n().get(r);
513
- return e && !Ke(e) && Qt(e) ? e : null;
558
+ let e = n().get(r), t = e && dn(e);
559
+ return t && !Ye(t) && fn(t) ? t : null;
514
560
  }
515
561
  return null;
516
562
  }
517
- function en(e) {
563
+ function mn(e) {
518
564
  for (let t = e.parent; t; t = t.parent) if (t.name === "Link" || t.name === "LinkReference" || t.name === "Image") return !0;
519
565
  return !1;
520
566
  }
521
- function tn(e, t) {
567
+ function hn(e, t) {
522
568
  let n = e.sliceDoc(t.from, t.to);
523
- if (!n || Ke(n)) return null;
524
- let r = n;
525
- return /^[a-z][a-z0-9+.-]*:/i.test(n) || (/^www\./i.test(n) ? r = `https://${n}` : /^[^\s@]+@[^\s@]+$/.test(n) && (r = `mailto:${n}`)), Qt(r) ? r : null;
569
+ if (!n || Ye(n)) return null;
570
+ let r = dn(n);
571
+ return fn(r) ? r : null;
526
572
  }
527
- function nn(e, t) {
528
- let n = new m(), r = s(e.state), i = null, a = () => i ?? (i = Zt(e.state)), o = e.state.facet(M), c = (e, r, i = !1) => n.add(e, e, v.widget({
529
- widget: new Yt(r, t, i),
573
+ function gn(e, n) {
574
+ let r = new te(), i = y(e.state), a = null, o = () => a ?? (a = sn(e.state)), s = e.state.facet(j), c = (e, i, a = !1) => r.add(e, e, t.widget({
575
+ widget: new an(i, n, a),
530
576
  side: -1
531
577
  }));
532
- for (let { from: t, to: n } of e.visibleRanges) r.iterate({
578
+ for (let { from: t, to: n } of e.visibleRanges) i.iterate({
533
579
  from: t,
534
580
  to: n,
535
581
  enter: (t) => {
536
582
  if (t.name === "Link") {
537
- let n = $t(e.state, t.node, a);
538
- n && c(t.to, n, o && !Lt(e.state, t.from, t.to));
539
- } else if (t.name === "URL" && !en(t.node)) {
540
- let n = tn(e.state, t.node);
583
+ let n = pn(e.state, t.node, o);
584
+ n && c(t.to, n, s && !Kt(e.state, t.from, t.to));
585
+ } else if (t.name === "URL" && !mn(t.node)) {
586
+ let n = hn(e.state, t.node);
541
587
  n && c(t.to, n);
542
588
  }
543
589
  }
544
590
  });
545
- return n.finish();
591
+ return r.finish();
546
592
  }
547
- function rn(e) {
548
- return c.fromClass(class {
593
+ function _n(e) {
594
+ return n.fromClass(class {
549
595
  constructor(t) {
550
- this.decorations = nn(t, e);
596
+ this.decorations = gn(t, e);
551
597
  }
552
598
  update(t) {
553
- (t.docChanged || t.viewportChanged || O(t.startState, t.state) || t.transactions.some((e) => e.effects.some((e) => e.is(Pe))) || t.startState.facet(M) !== t.state.facet(M) || t.selectionSet && t.state.facet(M)) && (this.decorations = nn(t.view, e));
599
+ (t.docChanged || t.viewportChanged || E(t.startState, t.state) || t.transactions.some((e) => e.effects.some((e) => e.is(w))) || t.startState.facet(j) !== t.state.facet(j) || (t.selectionSet || t.focusChanged) && t.state.facet(j)) && (this.decorations = gn(t.view, e));
554
600
  }
555
601
  }, { decorations: (e) => e.decorations });
556
602
  }
557
- function an(e, t) {
603
+ function vn(e, t) {
558
604
  let n = null;
559
- return T(e, t, -1, (r) => r.to === t ? r.name === "Link" ? $t(e, r, () => n ?? (n = Zt(e))) !== null : r.name === "URL" && !en(r) && tn(e, r) !== null : !1) !== null;
605
+ return T(e, t, -1, (r) => r.to === t ? r.name === "Link" ? pn(e, r, () => n ?? (n = sn(e))) !== null : r.name === "URL" && !mn(r) && hn(e, r) !== null : !1) !== null;
560
606
  }
561
- function on(e, t) {
562
- return T(e, t, -1, (n) => n.name === "URL" && n.to === t && !en(n) && tn(e, n) !== null) !== null;
607
+ function yn(e, t) {
608
+ return T(e, t, -1, (n) => n.name === "URL" && n.to === t && !mn(n) && hn(e, n) !== null) !== null;
563
609
  }
564
610
  // src/components/inputs/text-editor/text-editor.emphasis.ts
565
- var sn = /* @__PURE__ */ new Map([
611
+ var bn = /* @__PURE__ */ new Map([
566
612
  ["StrongEmphasis", "**"],
567
613
  ["Emphasis", "*"],
568
- ["Strikethrough", "~~"]
569
- ]), cn = /* @__PURE__ */ new Set([
614
+ ["Strikethrough", "~~"],
615
+ ["Highlight", "=="]
616
+ ]), xn = /* @__PURE__ */ new Set([
570
617
  "Paragraph",
571
618
  "ATXHeading1",
572
619
  "ATXHeading2",
@@ -577,21 +624,21 @@ var sn = /* @__PURE__ */ new Map([
577
624
  "SetextHeading1",
578
625
  "SetextHeading2",
579
626
  "TableCell"
580
- ]), ln = /^\s*(?:\n\s*(?:(?:[-*+]|\d+[.)]|>|\[[ xX]\])\s*)*)*$/, un = b.define({ map: (e, t) => ({
627
+ ]), Sn = /^\s*(?:\n\s*(?:(?:[-*+]|\d+[.)]|>|\[[ xX]\])\s*)*)*$/, Cn = m.define({ map: (e, t) => ({
581
628
  ...e,
582
629
  from: t.mapPos(e.from, 1),
583
630
  to: t.mapPos(e.to, -1)
584
631
  }) });
585
- function dn(e, t, n) {
586
- return T(e, t, n, (e) => sn.has(e.name));
632
+ function wn(e, t, n) {
633
+ return T(e, t, n, (e) => bn.has(e.name));
587
634
  }
588
- function fn(e, t) {
589
- return k(e, t, 1, cn);
635
+ function Tn(e, t) {
636
+ return D(e, t, 1, xn);
590
637
  }
591
- function pn(e) {
592
- let { from: t, to: n } = e.selection.main, r = dn(e, t, -1), i = r && dn(e, n, 1);
638
+ function En(e) {
639
+ let { from: t, to: n } = e.selection.main, r = wn(e, t, -1), i = r && wn(e, n, 1);
593
640
  if (!r || !i || r.from !== i.from || r.to !== i.to) return null;
594
- let a = sn.get(r.name).length;
641
+ let a = bn.get(r.name).length;
595
642
  return {
596
643
  from: r.from,
597
644
  to: r.to,
@@ -600,49 +647,50 @@ function pn(e) {
600
647
  live: !0
601
648
  };
602
649
  }
603
- function mn(e, t) {
650
+ function Dn(e, t) {
604
651
  let n = t.marker.length, { from: r, to: i } = e.selection.main;
605
652
  if (r < t.from + n || i > t.to - n) return !1;
606
653
  let a = e.sliceDoc(t.from, t.to);
607
654
  if (a.length < 2 * n || !a.startsWith(t.marker) || !a.endsWith(t.marker)) return !1;
608
- let o = fn(e, t.from);
655
+ let o = Tn(e, t.from);
609
656
  if (!o || o.to < t.to) return !1;
610
- let s = dn(e, t.from, 1);
657
+ let s = wn(e, t.from, 1);
611
658
  return !(s && s.name === t.name && s.from === t.from);
612
659
  }
613
- function hn(e, t) {
660
+ function On(e, t) {
614
661
  return {
615
662
  ...e,
616
663
  from: t.changes.mapPos(e.from, 1),
617
664
  to: t.changes.mapPos(e.to, -1)
618
665
  };
619
666
  }
620
- var N = h.define({
621
- create: (e) => pn(e),
667
+ var M = b.define({
668
+ create: (e) => En(e),
622
669
  update(e, t) {
670
+ if (e && !e.live && !t.docChanged && !t.selection) return e;
623
671
  if (e) {
624
- let n = hn({
672
+ let n = On({
625
673
  ...e,
626
674
  live: !1
627
675
  }, t);
628
- if (mn(t.state, n)) return n;
676
+ if (Dn(t.state, n)) return n;
629
677
  }
630
- let n = pn(t.state);
678
+ let n = En(t.state);
631
679
  if (n) return n;
632
- let r = t.effects.find((e) => e.is(un));
680
+ let r = t.effects.find((e) => e.is(Cn));
633
681
  return r ? {
634
682
  ...r.value,
635
683
  live: !1
636
684
  } : null;
637
685
  }
638
686
  });
639
- function gn(e, t) {
687
+ function kn(e, t) {
640
688
  let n = t.marker.length, r = e.sliceDoc(t.from, t.to);
641
689
  if (r.length < 2 * n || !r.startsWith(t.marker) || !r.endsWith(t.marker)) return null;
642
- let i = r.slice(n, r.length - n), a = /^\s*/.exec(i)[0].length, o = fn(e, t.from), s = e.sliceDoc(t.from + n, Math.min(t.to - n, o ? o.to : t.to - n)), c = t.from + n + s.replace(/\s+$/, "").length;
690
+ let i = r.slice(n, r.length - n), a = /^\s*/.exec(i)[0].length, o = Tn(e, t.from), s = e.sliceDoc(t.from + n, Math.min(t.to - n, o ? o.to : t.to - n)), c = t.from + n + s.replace(/\s+$/, "").length;
643
691
  if (c <= t.from + n + a) return null;
644
692
  let l = t.to - n - c;
645
- return !a && !l || !ln.test(e.sliceDoc(c, t.to - n)) ? null : {
693
+ return !a && !l || !Sn.test(e.sliceDoc(c, t.to - n)) ? null : {
646
694
  from: t.from,
647
695
  to: t.to,
648
696
  len: n,
@@ -650,7 +698,7 @@ function gn(e, t) {
650
698
  trail: l
651
699
  };
652
700
  }
653
- function _n(e, t) {
701
+ function An(e, t) {
654
702
  let n = [];
655
703
  return t.lead && n.push({
656
704
  from: t.from,
@@ -666,7 +714,7 @@ function _n(e, t) {
666
714
  insert: e.sliceDoc(t.to - t.len - t.trail, t.to - t.len)
667
715
  }), n;
668
716
  }
669
- function vn(e, t, n) {
717
+ function jn(e, t, n) {
670
718
  let r = t.from + t.len + t.lead, i = t.to - t.len - t.trail;
671
719
  if (t.lead) {
672
720
  if (e > t.from && e < t.from + t.len) return e + t.lead;
@@ -678,35 +726,35 @@ function vn(e, t, n) {
678
726
  }
679
727
  return e;
680
728
  }
681
- function yn(t, n, r) {
682
- let i = gn(t, n);
683
- if (!i) return null;
684
- let a = t.selection;
729
+ function Mn(e, t, n) {
730
+ let r = kn(e, t);
731
+ if (!r) return null;
732
+ let i = e.selection;
685
733
  return {
686
- changes: _n(t, i),
687
- selection: e.create(a.ranges.map((t) => e.range(vn(t.anchor, i, r), vn(t.head, i, r))), a.mainIndex),
734
+ changes: An(e, r),
735
+ selection: g.create(i.ranges.map((e) => g.range(jn(e.anchor, r, n), jn(e.head, r, n))), i.mainIndex),
688
736
  userEvent: "input.emphasis"
689
737
  };
690
738
  }
691
- function bn(e, t) {
692
- let n = gn(e, t);
693
- return n ? _n(e, n) : [];
739
+ function Nn(e, t) {
740
+ let n = kn(e, t);
741
+ return n ? An(e, n) : [];
694
742
  }
695
- function xn(e) {
696
- let t = e.state.field(N, !1);
743
+ function Pn(e) {
744
+ let t = e.state.field(M, !1);
697
745
  if (!t || t.live || e.state.readOnly) return;
698
- let n = yn(e.state, t, !0);
746
+ let n = Mn(e.state, t, !0);
699
747
  n && e.dispatch(n);
700
748
  }
701
- var Sn = [N, c.fromClass(class {
749
+ var Fn = [M, n.fromClass(class {
702
750
  constructor(e) {
703
751
  this.view = e, this.pending = null, this.destroyed = !1;
704
752
  }
705
753
  update(e) {
706
- this.pending && (this.pending = hn(this.pending, e));
707
- let t = e.startState.field(N);
754
+ this.pending && (this.pending = On(this.pending, e));
755
+ let t = e.startState.field(M);
708
756
  if (!t) return;
709
- let n = hn(t, e), r = e.state.field(N);
757
+ let n = On(t, e), r = e.state.field(M);
710
758
  r && r.name === n.name && r.from === n.from && r.to === n.to || (this.pending = n, queueMicrotask(() => this.flush()));
711
759
  }
712
760
  flush() {
@@ -722,20 +770,124 @@ var Sn = [N, c.fromClass(class {
722
770
  });
723
771
  return;
724
772
  }
725
- let t = yn(this.view.state, e, !1);
773
+ let t = Mn(this.view.state, e, !1);
726
774
  t && this.view.dispatch(t);
727
775
  }
728
776
  destroy() {
729
777
  this.destroyed = !0;
730
778
  }
731
- })], Cn = y.high(n.of([{
779
+ })], In = /* @__PURE__ */ new Set(["Link", "LinkReference"]), Ln = 1e3;
780
+ function Rn(e) {
781
+ return e.name === "URL" && !!e.parent && In.has(e.parent.name);
782
+ }
783
+ function zn(e) {
784
+ let { main: t } = e.selection;
785
+ if (!t.empty) return null;
786
+ let n = T(e, t.head, -1, Rn);
787
+ return !n || t.head < n.from || t.head > n.to ? null : {
788
+ from: n.from,
789
+ to: n.to
790
+ };
791
+ }
792
+ function Bn(e, t) {
793
+ return {
794
+ from: t.mapPos(e.from, 1),
795
+ to: t.mapPos(e.to, -1)
796
+ };
797
+ }
798
+ function Vn(e) {
799
+ return e.transactions.some((e) => e.docChanged && [
800
+ "input.type",
801
+ "input.complete",
802
+ "input.paste",
803
+ "input.drop",
804
+ "delete"
805
+ ].some((t) => e.isUserEvent(t)));
806
+ }
807
+ function Hn(e) {
808
+ let t = [], n = 0;
809
+ e.changes.iterChangedRanges((e, t, r, i) => {
810
+ n = Math.max(n, i);
811
+ });
812
+ let r = Un(e.state, n);
813
+ return e.changes.iterChangedRanges((e, n, i, a) => {
814
+ r.iterate({
815
+ from: Math.max(0, i - 1),
816
+ to: a,
817
+ enter: (e) => {
818
+ Rn(e.node) && e.from <= a && e.to >= i && t.push({
819
+ from: e.from,
820
+ to: e.to
821
+ });
822
+ }
823
+ });
824
+ }), t;
825
+ }
826
+ function Un(e, t) {
827
+ return _(e, t, Ln) ?? y(e);
828
+ }
829
+ function Wn(e, t) {
830
+ let { state: n } = e;
831
+ if (n.readOnly || !t.length) return;
832
+ let r = Un(n, n.doc.lineAt(Math.max(...t)).to), i = t.flatMap((e) => {
833
+ let t = r.resolveInner(e, 1);
834
+ for (; t && !(Rn(t) && t.from === e);) t = t.parent;
835
+ if (!t) return [];
836
+ let i = n.sliceDoc(t.from, t.to), a = dn(i);
837
+ return a === i || !a.endsWith(i) ? [] : [{
838
+ from: e,
839
+ insert: a.slice(0, a.length - i.length)
840
+ }];
841
+ });
842
+ i.length && e.dispatch({
843
+ changes: i,
844
+ userEvent: "input.link"
845
+ });
846
+ }
847
+ var Gn = class {
848
+ constructor(e) {
849
+ this.view = e, this.editing = null, this.pending = [], this.destroyed = !1;
850
+ }
851
+ update(e) {
852
+ let t = this.editing && e.docChanged ? Bn(this.editing, e.changes) : this.editing, n = zn(e.state), r = Vn(e) ? Hn(e).map((e) => e.from) : [], i = r.filter((e) => e !== n?.from), a = n && (t?.from === n.from || r.includes(n.from));
853
+ this.editing = a ? n : null, t && t.from !== this.editing?.from && i.push(t.from);
854
+ let o = this.pending.length > 0;
855
+ o && e.docChanged && (this.pending = this.pending.map((t) => e.changes.mapPos(t, 1))), this.pending = [.../* @__PURE__ */ new Set([...this.pending, ...i])], this.pending.length && !o && queueMicrotask(() => {
856
+ let { pending: e } = this;
857
+ this.pending = [], this.destroyed || Wn(this.view, e);
858
+ });
859
+ }
860
+ destroy() {
861
+ this.destroyed = !0;
862
+ }
863
+ }, Kn = n.fromClass(Gn);
864
+ function qn(e) {
865
+ let t = e.plugin(Kn), n = t?.editing;
866
+ t && n && (t.editing = null, Wn(e, [n.from]));
867
+ }
868
+ // src/components/inputs/text-editor/text-editor.highlight.ts
869
+ var Jn = /[\p{S}\p{P}]/u, N = 61, Yn = {
870
+ resolve: "Highlight",
871
+ mark: "HighlightMark"
872
+ }, Xn = {
873
+ defineNodes: ["Highlight", "HighlightMark"],
874
+ parseInline: [{
875
+ name: "Highlight",
876
+ parse(e, t, n) {
877
+ if (t !== N || e.char(n + 1) !== N || e.char(n + 2) === N || e.char(n - 1) === N) return -1;
878
+ let r = e.slice(n - 1, n), i = e.slice(n + 2, n + 3), a = /\s|^$/.test(r), o = /\s|^$/.test(i), s = Jn.test(r), c = Jn.test(i);
879
+ return e.addDelimiter(Yn, n, n + 2, !o && (!c || a || s), !a && (!s || o || c));
880
+ },
881
+ after: "Emphasis"
882
+ }]
883
+ }, Zn = v.high(l.of([{
732
884
  key: "Enter",
733
- run: be({ nonTightLists: !1 })
885
+ run: Se({ nonTightLists: !1 })
734
886
  }, {
735
887
  key: "Backspace",
736
- run: xe
737
- }])), wn = /^( *)([-*+]|\d{1,9}[.)])( +|$)/, Tn = /^( *)([-*+]|\d{1,9}[.)]) ( *)([-*+]|\d{1,9}[.)]) $/, En = /^( +)([-*+]|\d{1,9}[.)]) $/, Dn = /^((?:> ?)*> )> $/, On = (e) => /\d/.test(e);
738
- function P(e, t) {
888
+ run: Ce
889
+ }])), P = /^( *)([-*+]|\d{1,9}[.)])( +|$)/, Qn = /^( *)([-*+]|\d{1,9}[.)]) ( *)([-*+]|\d{1,9}[.)]) $/, $n = /^( +)([-*+]|\d{1,9}[.)]) $/, er = /^((?:> ?)*> )> $/, tr = (e) => /\d/.test(e);
890
+ function F(e, t) {
739
891
  let n = [], r = 1e400, i = 0;
740
892
  for (let a = t - 1; a >= 1 && a > t - 500; a--) {
741
893
  let t = e.doc.line(a).text;
@@ -743,7 +895,7 @@ function P(e, t) {
743
895
  if (++i >= 2) break;
744
896
  continue;
745
897
  }
746
- let o = wn.exec(t);
898
+ let o = P.exec(t);
747
899
  if (!o) {
748
900
  if (/^\S/.test(t) && i > 0) break;
749
901
  i = 0;
@@ -758,30 +910,51 @@ function P(e, t) {
758
910
  }
759
911
  return n;
760
912
  }
761
- function kn(e, t) {
913
+ function nr(e, t) {
762
914
  return e.length === 0 ? 0 : t > e[0].markerCol ? e[0].contentCol : e.find((e) => e.markerCol <= t)?.markerCol ?? 0;
763
915
  }
764
- function An(e, t, n) {
765
- let r = Dn.exec(n);
916
+ function rr(e, t, n) {
917
+ let r = er.exec(n);
766
918
  if (r) return r[1];
767
- let i = Tn.exec(n);
919
+ let i = Qn.exec(n);
768
920
  if (i) {
769
- let [, n, r, a, o] = i, s = P(e, t), c = `${" ".repeat(s.length ? s[0].contentCol : n.length + r.length + 1)}${o} `;
770
- return a === "" ? On(r) === On(o) ? On(o) && parseInt(o, 10) === 1 && parseInt(r, 10) !== 1 ? c : `${n}${r} ` : `${n}${o} ` : c;
921
+ let [, n, r, a, o] = i, s = F(e, t), c = `${" ".repeat(s.length ? s[0].contentCol : n.length + r.length + 1)}${o} `;
922
+ return a === "" ? tr(r) === tr(o) ? tr(o) && parseInt(o, 10) === 1 && parseInt(r, 10) !== 1 ? c : `${n}${r} ` : `${n}${o} ` : c;
771
923
  }
772
- let a = En.exec(n);
924
+ let a = $n.exec(n);
773
925
  if (a) {
774
- let [, n, r] = a, i = kn(P(e, t), n.length);
926
+ let [, n, r] = a, i = nr(F(e, t), n.length);
775
927
  return i === n.length ? null : `${" ".repeat(i)}${r} `;
776
928
  }
777
929
  return null;
778
930
  }
779
- var jn = _.inputHandler.of((e, t, n, r) => {
931
+ function ir(e, t, n, r) {
932
+ let i = P.exec(n);
933
+ if (!i || i[3] === "" || r > i[1].length) return null;
934
+ let a = F(e, t);
935
+ if (a.length === 0) return null;
936
+ let o = i[1].length, s = [...a.map((e) => e.markerCol), a[0].contentCol].filter((e) => e > o);
937
+ return s.length ? Math.min(...s) : o;
938
+ }
939
+ var ar = o.inputHandler.of((e, t, n, r) => {
780
940
  if (r !== " " || t !== n || e.state.readOnly) return !1;
781
941
  let i = e.state.doc.lineAt(t);
782
- if (D(e.state, i.from)) return !1;
783
- let a = i.text.slice(0, t - i.from) + " ", o = An(e.state, i.number, a);
784
- return o === null || o === a ? !1 : (e.dispatch({
942
+ if (Re(e.state, i.from)) return !1;
943
+ let a = ir(e.state, i.number, i.text, t - i.from);
944
+ if (a !== null) {
945
+ let t = P.exec(i.text)[1].length;
946
+ return a > t && e.dispatch({
947
+ changes: {
948
+ from: i.from,
949
+ to: i.from + t,
950
+ insert: " ".repeat(a)
951
+ },
952
+ selection: { anchor: i.from + a },
953
+ userEvent: "input.type"
954
+ }), !0;
955
+ }
956
+ let o = i.text.slice(0, t - i.from) + " ", s = rr(e.state, i.number, o);
957
+ return s === null || s === o ? !1 : (e.dispatch({
785
958
  changes: {
786
959
  from: t,
787
960
  insert: " "
@@ -791,14 +964,14 @@ var jn = _.inputHandler.of((e, t, n, r) => {
791
964
  }), e.dispatch({
792
965
  changes: {
793
966
  from: i.from,
794
- to: i.from + a.length,
795
- insert: o
967
+ to: i.from + o.length,
968
+ insert: s
796
969
  },
797
- selection: { anchor: i.from + o.length },
970
+ selection: { anchor: i.from + s.length },
798
971
  userEvent: "input.complete",
799
- annotations: se.of("before")
972
+ annotations: le.of("before")
800
973
  }), !0);
801
- }), Mn = {
974
+ }), or = {
802
975
  ATXHeading1: "cm-md-h1",
803
976
  ATXHeading2: "cm-md-h2",
804
977
  ATXHeading3: "cm-md-h3",
@@ -808,128 +981,137 @@ var jn = _.inputHandler.of((e, t, n, r) => {
808
981
  StrongEmphasis: "cm-md-strong",
809
982
  Emphasis: "cm-md-emphasis",
810
983
  Strikethrough: "cm-md-strike",
984
+ Highlight: "cm-md-highlight",
811
985
  InlineCode: "cm-md-code",
812
986
  URL: "cm-md-url",
813
987
  Blockquote: "cm-md-quote"
814
- }, Nn = /* @__PURE__ */ new Set([
988
+ }, sr = /* @__PURE__ */ new Set([
815
989
  "HeaderMark",
816
990
  "EmphasisMark",
817
991
  "StrikethroughMark",
992
+ "HighlightMark",
818
993
  "CodeMark",
819
994
  "QuoteMark",
820
995
  "ListMark",
821
996
  "LinkMark"
822
- ]), Pn = v.mark({ class: "cm-md-mark" }), Fn = v.line({ class: "cm-md-quote-row" }), In = {};
823
- function F(e) {
824
- return In[e] ?? (In[e] = v.mark({
997
+ ]), cr = t.mark({ class: "cm-md-mark" }), lr = t.line({ class: "cm-md-quote-row" }), ur = {};
998
+ function I(e) {
999
+ return ur[e] ?? (ur[e] = t.mark({
825
1000
  class: e,
826
1001
  inclusiveEnd: !0
827
1002
  }));
828
1003
  }
829
- var Ln = v.line({ class: "cm-md-codeblock" }), Rn = v.line({ class: "cm-md-codeblock-first" }), zn = v.line({ class: "cm-md-codeblock-last" }), Bn = v.line({ class: "cm-md-codeblock-line-selected" });
830
- function Vn(e, t, n, r) {
1004
+ var dr = t.line({ class: "cm-md-codeblock" }), fr = t.line({ class: "cm-md-codeblock-first" }), pr = t.line({ class: "cm-md-codeblock-last" }), mr = t.line({ class: "cm-md-codeblock-line-selected" });
1005
+ function hr(e, t, n, r) {
831
1006
  if (t.length === 0) return;
832
1007
  let i = e.doc.line(t[0]), a = e.doc.line(t[t.length - 1]), o = !n.empty && n.from <= i.from && n.to >= a.to;
833
1008
  t.forEach((i, a) => {
834
1009
  let s = e.doc.line(i);
835
- if (r.push(Ln.range(s.from)), a === 0 && r.push(Rn.range(s.from)), a === t.length - 1 && r.push(zn.range(s.from)), o) r.push(Bn.range(s.from));
1010
+ if (r.push(dr.range(s.from)), a === 0 && r.push(fr.range(s.from)), a === t.length - 1 && r.push(pr.range(s.from)), o) r.push(mr.range(s.from));
836
1011
  else if (!n.empty) {
837
1012
  let e = Math.max(s.from, n.from), t = Math.min(s.to, n.to);
838
- t > e && r.push(F("cm-md-codeblock-selected").range(e, t));
1013
+ t > e && r.push(I("cm-md-codeblock-selected").range(e, t));
839
1014
  }
840
1015
  });
841
1016
  }
842
- function Hn(e, t, n, r, i) {
1017
+ function gr(e, t, n, r, i) {
843
1018
  let a = e.doc.lineAt(t).number, o = e.doc.lineAt(Math.max(t, n - 1)).number, s = [];
844
1019
  for (let e = a; e <= o; e++) s.push(e);
845
- Vn(e, s, r, i);
1020
+ hr(e, s, r, i);
846
1021
  }
847
- function Un(e, t, n, r) {
1022
+ function _r(e, t, n, r) {
848
1023
  let i = /* @__PURE__ */ new Set();
849
1024
  for (let n = t.firstChild; n; n = n.nextSibling) n.name === "CodeMark" && i.add(e.doc.lineAt(n.from).number);
850
1025
  let a = e.doc.lineAt(t.from).number, o = e.doc.lineAt(Math.max(t.from, t.to - 1)).number, s = [];
851
1026
  for (let e = a; e <= o; e++) i.has(e) || s.push(e);
852
- Vn(e, s, n, r);
1027
+ hr(e, s, n, r);
853
1028
  }
854
- function Wn(e, t, n) {
855
- A(e, t) || n.push(F("cm-md-link").range(t.from, t.to));
1029
+ function vr(e, t, n) {
1030
+ O(e, t) || n.push(I("cm-md-link").range(t.from, t.to));
856
1031
  }
857
- function Gn(e) {
858
- let t = [], n = e.state.selection.main;
859
- for (let { from: r, to: i } of e.visibleRanges) s(e.state).iterate({
860
- from: r,
1032
+ function yr(e) {
1033
+ let n = [], r = e.state.selection.main;
1034
+ for (let { from: t, to: i } of e.visibleRanges) y(e.state).iterate({
1035
+ from: t,
861
1036
  to: i,
862
- enter: (r) => {
863
- if (r.from >= r.to) return;
864
- if (r.name === "Link") {
865
- Wn(e.state, r.node, t);
1037
+ enter: (t) => {
1038
+ if (t.from >= t.to) return;
1039
+ if (t.name === "Link") {
1040
+ vr(e.state, t.node, n);
866
1041
  return;
867
1042
  }
868
- if (r.name === "FencedCode") {
869
- Un(e.state, r.node, n, t);
1043
+ if (t.name === "FencedCode") {
1044
+ _r(e.state, t.node, r, n);
870
1045
  return;
871
1046
  }
872
- if (r.name === "CodeBlock") {
873
- Hn(e.state, r.from, r.to, n, t);
1047
+ if (t.name === "CodeBlock") {
1048
+ gr(e.state, t.from, t.to, r, n);
874
1049
  return;
875
1050
  }
876
- if (r.name === "URL" && !en(r.node)) {
877
- t.push(F("cm-md-autolink").range(r.from, r.to));
1051
+ if (t.name === "URL" && !mn(t.node)) {
1052
+ n.push(I("cm-md-autolink").range(t.from, t.to));
878
1053
  return;
879
1054
  }
880
- r.name === "Blockquote" && r.node.parent?.name !== "Blockquote" && Le(e.state, r.from, r.to, (e) => t.push(Fn.range(e)));
881
- let i = Mn[r.name];
1055
+ t.name === "Blockquote" && t.node.parent?.name !== "Blockquote" && Be(e.state, t.from, t.to, (e) => n.push(lr.range(e)));
1056
+ let i = or[t.name];
882
1057
  if (i) {
883
- if (i === "cm-md-code" && !n.empty && n.from <= r.from && n.to >= r.to) t.push(F("cm-md-code cm-md-code-selected").range(r.from, r.to));
884
- else if (t.push(F(i).range(r.from, r.to)), !n.empty && i === "cm-md-code") {
885
- let e = Math.max(r.from, n.from), i = Math.min(r.to, n.to), a = (e === r.from ? " cm-md-code-selected-start" : "") + (i === r.to ? " cm-md-code-selected-end" : "");
886
- i > e && t.push(F(`cm-md-code-selected${a}`).range(e, i));
1058
+ if (i === "cm-md-code" && !r.empty && r.from <= t.from && r.to >= t.to) n.push(I("cm-md-code cm-md-code-selected").range(t.from, t.to));
1059
+ else {
1060
+ if (n.push(I(i).range(t.from, t.to)), !r.empty && i === "cm-md-highlight") {
1061
+ let e = Math.max(t.from, r.from), i = Math.min(t.to, r.to), a = (e === t.from ? " cm-md-highlight-selected-start" : "") + (i === t.to ? " cm-md-highlight-selected-end" : "");
1062
+ i > e && n.push(I(`cm-md-highlight-selected${a}`).range(e, i));
1063
+ }
1064
+ if (!r.empty && i === "cm-md-code") {
1065
+ let e = Math.max(t.from, r.from), i = Math.min(t.to, r.to), a = (e === t.from ? " cm-md-code-selected-start" : "") + (i === t.to ? " cm-md-code-selected-end" : "");
1066
+ i > e && n.push(I(`cm-md-code-selected${a}`).range(e, i));
1067
+ }
887
1068
  }
888
- } else Nn.has(r.name) && t.push(Pn.range(r.from, r.to));
1069
+ } else sr.has(t.name) && n.push(cr.range(t.from, t.to));
889
1070
  }
890
1071
  });
891
- let r = e.state.field(N, !1);
892
- if (r && !r.live) {
893
- let e = r.marker.length;
894
- t.push(F(Mn[r.name]).range(r.from, r.to)), t.push(Pn.range(r.from, r.from + e), Pn.range(r.to - e, r.to));
1072
+ let i = e.state.field(M, !1);
1073
+ if (i && !i.live) {
1074
+ let e = i.marker.length;
1075
+ n.push(I(or[i.name]).range(i.from, i.to)), n.push(cr.range(i.from, i.from + e), cr.range(i.to - e, i.to));
895
1076
  }
896
- return v.set(t, !0);
1077
+ return t.set(n, !0);
897
1078
  }
898
- var Kn = c.fromClass(class {
1079
+ var br = n.fromClass(class {
899
1080
  constructor(e) {
900
- this.decorations = Gn(e);
1081
+ this.decorations = yr(e);
901
1082
  }
902
1083
  update(e) {
903
- (e.docChanged || e.viewportChanged || e.selectionSet || O(e.startState, e.state)) && (this.decorations = Gn(e.view));
1084
+ (e.docChanged || e.viewportChanged || e.selectionSet || E(e.startState, e.state)) && (this.decorations = yr(e.view));
904
1085
  }
905
- }, { decorations: (e) => e.decorations }), qn = /^((?:[ \t]*(?:[-*+][ \t]+(?:\[[ xX]\][ \t]+)?|\d+[.)][ \t]+|>[ \t]?))+)/;
906
- function Jn(e) {
907
- return qn.exec(e)?.[1].length ?? 0;
1086
+ }, { decorations: (e) => e.decorations }), xr = /^((?:[ \t]*(?:[-*+][ \t]+(?:\[[ xX]\][ \t]+)?|\d+[.)][ \t]+|>[ \t]?))+)/;
1087
+ function Sr(e) {
1088
+ return xr.exec(e)?.[1].length ?? 0;
908
1089
  }
909
- var Yn = v.mark({ class: "cm-md-listprefix" }), Xn = {};
910
- function Zn(e) {
911
- return Xn[e] ?? (Xn[e] = v.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1);padding-left:calc(${e} * var(--_text-editor-marker-advance))` } }));
1090
+ var Cr = t.mark({ class: "cm-md-listprefix" }), wr = {};
1091
+ function Tr(e) {
1092
+ return wr[e] ?? (wr[e] = t.line({ attributes: { style: `text-indent:calc(${e} * var(--_text-editor-marker-advance) * -1);padding-left:calc(${e} * var(--_text-editor-marker-advance))` } }));
912
1093
  }
913
- function Qn(e) {
914
- let t = [], n = 0;
915
- for (let r = e.doc.iterLines(); !r.next().done;) {
916
- let i = r.value, a = qn.exec(i);
917
- if (a && a[1].length && !D(e, n) && !Re(e, n)) {
1094
+ function Er(e) {
1095
+ let n = [], r = 0;
1096
+ for (let t = e.doc.iterLines(); !t.next().done;) {
1097
+ let i = t.value, a = xr.exec(i);
1098
+ if (a && a[1].length && !Re(e, r) && !Ve(e, r)) {
918
1099
  let e = a[1].length;
919
- t.push(Zn(e).range(n)), t.push(Yn.range(n, n + e));
1100
+ n.push(Tr(e).range(r)), n.push(Cr.range(r, r + e));
920
1101
  }
921
- n += i.length + 1;
1102
+ r += i.length + 1;
922
1103
  }
923
- return v.set(t, !0);
1104
+ return t.set(n, !0);
924
1105
  }
925
- var $n = h.define({
926
- create: (e) => Qn(e),
927
- update: (e, t) => t.docChanged || O(t.startState, t.state) ? Qn(t.state) : e,
928
- provide: (e) => _.decorations.from(e)
929
- }), er = [
930
- ye({
1106
+ var Dr = b.define({
1107
+ create: (e) => Er(e),
1108
+ update: (e, t) => t.docChanged || E(t.startState, t.state) ? Er(t.state) : e,
1109
+ provide: (e) => o.decorations.from(e)
1110
+ }), Or = [
1111
+ xe({
931
1112
  extensions: [
932
- ve,
1113
+ be,
1114
+ Xn,
933
1115
  { remove: ["IndentedCode"] },
934
1116
  { parseBlock: [{
935
1117
  name: "IndentedText",
@@ -944,31 +1126,33 @@ var $n = h.define({
944
1126
  codeLanguages: ee,
945
1127
  addKeymap: !1
946
1128
  }),
947
- Cn,
948
- jn,
1129
+ dt,
1130
+ Zn,
1131
+ ar,
1132
+ br,
1133
+ Fn,
949
1134
  Kn,
950
- Sn,
951
- $n,
952
- $e
953
- ], tr = "[\\p{L}\\p{M}\\p{N}_.+-]*", nr = /* @__PURE__ */ new Map();
954
- function rr(e, t) {
1135
+ Dr,
1136
+ nt
1137
+ ], kr = "[\\p{L}\\p{M}\\p{N}_.+-]*", Ar = /* @__PURE__ */ new Map();
1138
+ function jr(e, t) {
955
1139
  if (e.length !== 1 || /[\s\p{L}\p{N}_]/u.test(e)) return null;
956
1140
  let n = `${e}\u0000${t}`;
957
- if (nr.has(n)) return nr.get(n);
1141
+ if (Ar.has(n)) return Ar.get(n);
958
1142
  let r;
959
1143
  try {
960
1144
  let n = [
961
1145
  "*",
962
1146
  "_",
963
1147
  "~"
964
- ].filter((t) => t !== e).join(""), i = e.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&");
965
- r = RegExp(`((?:^|[\\s\\p{Ps}\\p{Pi}"'])[${n}]*)(${i})(${t})$`, "u");
1148
+ ].filter((t) => t !== e).join(""), i = e === "=" ? "" : "|==", a = e.replace(/[\\^$.*+?()[\]{}|/]/g, "\\$&");
1149
+ r = RegExp(`((?:^|[\\s\\p{Ps}\\p{Pi}"'])(?:[${n}]${i})*)(${a})(${t})$`, "u");
966
1150
  } catch {
967
- r = t === "[\\p{L}\\p{M}\\p{N}_.+-]*" ? null : rr(e, tr);
1151
+ r = t === "[\\p{L}\\p{M}\\p{N}_.+-]*" ? null : jr(e, kr);
968
1152
  }
969
- return nr.set(n, r), r;
1153
+ return Ar.set(n, r), r;
970
1154
  }
971
- function ir(e) {
1155
+ function Mr(e) {
972
1156
  return e.some(({ query: e }) => {
973
1157
  if (e === void 0) return !1;
974
1158
  try {
@@ -978,7 +1162,7 @@ function ir(e) {
978
1162
  }
979
1163
  });
980
1164
  }
981
- function ar(e) {
1165
+ function Nr(e) {
982
1166
  let t = /* @__PURE__ */ new Map();
983
1167
  for (let n of e) {
984
1168
  let { trigger: e, query: r } = typeof n == "string" ? {
@@ -987,27 +1171,27 @@ function ar(e) {
987
1171
  } : n;
988
1172
  (!t.has(e) || t.get(e) === void 0 && r !== void 0) && t.set(e, r);
989
1173
  }
990
- return Array.from(t, ([e, t]) => rr(e, t ?? "[\\p{L}\\p{M}\\p{N}_.+-]*")).filter((e) => e !== null);
1174
+ return Array.from(t, ([e, t]) => jr(e, t ?? "[\\p{L}\\p{M}\\p{N}_.+-]*")).filter((e) => e !== null);
991
1175
  }
992
- function or(e, t, n) {
1176
+ function Pr(e, t, n) {
993
1177
  let r = e.doc.lineAt(t), i = e.sliceDoc(r.from, t), a = null;
994
- for (let e of ar(n)) {
1178
+ for (let e of Nr(n)) {
995
1179
  let t = e.exec(i);
996
1180
  t && (!a || t.index + t[1].length > a.index + a[1].length) && (a = t);
997
1181
  }
998
1182
  if (!a) return null;
999
1183
  let o = r.from + a.index + a[1].length;
1000
- return Ie(e, o) ? null : {
1184
+ return ze(e, o) ? null : {
1001
1185
  from: o,
1002
1186
  to: t,
1003
1187
  query: a[3],
1004
1188
  trigger: a[2]
1005
1189
  };
1006
1190
  }
1007
- function sr(e) {
1191
+ function Fr(e) {
1008
1192
  return (t) => `${e}${t.text} `;
1009
1193
  }
1010
- function cr(e) {
1194
+ function Ir(e) {
1011
1195
  let { candidate: t } = e;
1012
1196
  if (t.avatar) {
1013
1197
  let e = document.createElement("nldd-avatar");
@@ -1023,19 +1207,19 @@ function cr(e) {
1023
1207
  }
1024
1208
  return null;
1025
1209
  }
1026
- function lr(e) {
1210
+ function Lr(e) {
1027
1211
  return e.candidate.avatar ? "cm-nldd-row-avatar" : "";
1028
1212
  }
1029
- var I = b.define();
1030
- function ur(e, t, n) {
1213
+ var L = m.define();
1214
+ function Rr(e, t, n) {
1031
1215
  return async (r) => {
1032
- let i = e(), a = or(r.state, r.pos, i);
1216
+ let i = e(), a = Pr(r.state, r.pos, i);
1033
1217
  if (!a) return null;
1034
1218
  let o = i.filter((e) => e.trigger === a.trigger), s = await Promise.all(o.map((e) => e.source(a.query))), c = [];
1035
1219
  s.forEach((e, n) => {
1036
- let r = o[n], i = r.insert ?? sr(a.trigger);
1220
+ let r = o[n], i = r.insert ?? Fr(a.trigger);
1037
1221
  for (let n of e ?? []) c.push({
1038
- label: `${a.trigger}${n.text}`,
1222
+ label: `${r.showTrigger === !1 ? "" : a.trigger}${n.text}`,
1039
1223
  detail: n.supportingText,
1040
1224
  candidate: n,
1041
1225
  apply: (e, o, s, c) => {
@@ -1058,13 +1242,13 @@ function ur(e, t, n) {
1058
1242
  }
1059
1243
  });
1060
1244
  });
1061
- let l = c.length ? null : dr(o, a.query, n), u = r.view;
1245
+ let l = c.length ? null : zr(o, a.query, n), u = r.view;
1062
1246
  if (u && !r.aborted && u.state.doc === r.state.doc) {
1063
- let e = u.state.field(L, !1), t = l === null ? null : {
1247
+ let e = u.state.field(R, !1), t = l === null ? null : {
1064
1248
  from: a.from,
1065
1249
  text: l
1066
1250
  };
1067
- (e?.text !== t?.text || e?.from !== t?.from) && u.dispatch({ effects: I.of(t) });
1251
+ (e?.text !== t?.text || e?.from !== t?.from) && u.dispatch({ effects: L.of(t) });
1068
1252
  }
1069
1253
  return c.length ? {
1070
1254
  from: a.from,
@@ -1073,17 +1257,17 @@ function ur(e, t, n) {
1073
1257
  } : null;
1074
1258
  };
1075
1259
  }
1076
- function dr(e, t, n) {
1260
+ function zr(e, t, n) {
1077
1261
  for (let n of e) {
1078
1262
  let e = n.emptyText?.(t);
1079
1263
  if (e !== void 0) return e || null;
1080
1264
  }
1081
1265
  return n(t);
1082
1266
  }
1083
- var L = h.define({
1267
+ var R = b.define({
1084
1268
  create: () => null,
1085
1269
  update(e, t) {
1086
- for (let e of t.effects) if (e.is(I)) return e.value;
1270
+ for (let e of t.effects) if (e.is(L)) return e.value;
1087
1271
  if (!e) return null;
1088
1272
  if (t.docChanged && (e = {
1089
1273
  ...e,
@@ -1094,7 +1278,7 @@ var L = h.define({
1094
1278
  }
1095
1279
  return e;
1096
1280
  },
1097
- provide: (e) => te.from(e, (e) => e && {
1281
+ provide: (e) => i.from(e, (e) => e && {
1098
1282
  pos: e.from,
1099
1283
  above: !1,
1100
1284
  create: () => {
@@ -1102,34 +1286,34 @@ var L = h.define({
1102
1286
  return t.className = "cm-nldd-typeahead-empty", t.textContent = e.text, { dom: t };
1103
1287
  }
1104
1288
  })
1105
- }), fr = [
1106
- y.high(n.of([{
1289
+ }), Br = [
1290
+ v.high(l.of([{
1107
1291
  key: "Escape",
1108
- run: (e) => e.state.field(L, !1) ? (e.dispatch({ effects: I.of(null) }), !0) : !1
1292
+ run: (e) => e.state.field(R, !1) ? (e.dispatch({ effects: L.of(null) }), !0) : !1
1109
1293
  }])),
1110
- _.focusChangeEffect.of((e, t) => !t && e.field(L, !1) ? I.of(null) : null),
1111
- _.updateListener.of((e) => {
1112
- Ee(e.state) === "active" && e.state.field(L, !1) && queueMicrotask(() => e.view.dispatch({ effects: I.of(null) }));
1294
+ o.focusChangeEffect.of((e, t) => !t && e.field(R, !1) ? L.of(null) : null),
1295
+ o.updateListener.of((e) => {
1296
+ Oe(e.state) === "active" && e.state.field(R, !1) && queueMicrotask(() => e.view.dispatch({ effects: L.of(null) }));
1113
1297
  })
1114
1298
  ];
1115
- function pr(e) {
1116
- return c.fromClass(class {
1299
+ function Vr(e) {
1300
+ return n.fromClass(class {
1117
1301
  constructor(e) {
1118
1302
  this.status = document.createElement("div"), this.status.className = "cm-nldd-typeahead-status", this.status.setAttribute("role", "status"), e.dom.append(this.status);
1119
1303
  }
1120
1304
  update(t) {
1121
- let n = Ee(t.state);
1305
+ let n = Oe(t.state);
1122
1306
  if (n === "pending") return;
1123
- let r = t.state.field(L, !1), i = "";
1124
- r ? i = r.text : n === "active" && (i = e(we(t.state).length)), this.status.textContent !== i && (this.status.textContent = i);
1307
+ let r = t.state.field(R, !1), i = "";
1308
+ r ? i = r.text : n === "active" && (i = e(Ee(t.state).length)), this.status.textContent !== i && (this.status.textContent = i);
1125
1309
  }
1126
1310
  destroy() {
1127
1311
  this.status.remove();
1128
1312
  }
1129
1313
  });
1130
1314
  }
1131
- var R = 16;
1132
- function mr() {
1315
+ var Hr = 16;
1316
+ function Ur() {
1133
1317
  let e = document.createElement("div");
1134
1318
  e.setAttribute("popover", "manual"), e.className = "cm-nldd-popups";
1135
1319
  let t = () => {
@@ -1137,7 +1321,7 @@ function mr() {
1137
1321
  if (t !== e.matches(":popover-open")) try {
1138
1322
  t ? e.showPopover() : e.hidePopover();
1139
1323
  } catch {}
1140
- }, n = c.define((n) => {
1324
+ }, r = n.define((n) => {
1141
1325
  n.dom.appendChild(e);
1142
1326
  let r = new MutationObserver(t);
1143
1327
  return r.observe(e, {
@@ -1147,99 +1331,193 @@ function mr() {
1147
1331
  r.disconnect(), e.remove();
1148
1332
  } };
1149
1333
  });
1150
- return [i({
1334
+ return [f({
1151
1335
  parent: e,
1152
1336
  tooltipSpace: () => ({
1153
- left: R,
1154
- top: R,
1155
- right: window.innerWidth - R,
1156
- bottom: window.innerHeight - R
1337
+ left: Hr,
1338
+ top: Hr,
1339
+ right: window.innerWidth - Hr,
1340
+ bottom: window.innerHeight - Hr
1157
1341
  })
1158
- }), n];
1342
+ }), r];
1159
1343
  }
1160
- function hr(e, t, n = () => null, r = (e) => String(e)) {
1161
- let i = _.updateListener.of((t) => {
1162
- t.docChanged && Ee(t.state) === null && t.transactions.some((e) => e.isUserEvent("delete")) && or(t.state, t.state.selection.main.head, e()) && Te(t.view);
1344
+ function Wr(e, t, n = () => null, r = (e) => String(e)) {
1345
+ let i = o.updateListener.of((t) => {
1346
+ t.docChanged && Oe(t.state) === null && t.transactions.some((e) => e.isUserEvent("delete")) && Pr(t.state, t.state.selection.main.head, e()) && De(t.view);
1163
1347
  });
1164
1348
  return [
1165
- mr(),
1166
- De({
1167
- override: [ur(e, t, n)],
1349
+ Ur(),
1350
+ ke({
1351
+ override: [Rr(e, t, n)],
1168
1352
  icons: !1,
1169
1353
  addToOptions: [{
1170
1354
  position: 20,
1171
- render: cr
1355
+ render: Ir
1172
1356
  }],
1173
- optionClass: lr
1357
+ optionClass: Lr
1174
1358
  }),
1175
1359
  i,
1176
- L,
1177
- fr,
1178
- pr(r)
1360
+ R,
1361
+ Br,
1362
+ Vr(r)
1363
+ ];
1364
+ }
1365
+ // src/components/inputs/text-editor/text-editor.variables.ts
1366
+ var Gr = /\{\{\s*([\p{L}\p{N}_.-]+)\s*\}\}/gu, Kr = m.define(), qr = b.define({
1367
+ create: () => /* @__PURE__ */ new Map(),
1368
+ update(e, t) {
1369
+ for (let e of t.effects) if (e.is(Kr)) return new Map(e.value.map((e) => [e.key, e]));
1370
+ return e;
1371
+ }
1372
+ }), Jr = class extends r {
1373
+ constructor(e, t, n, r) {
1374
+ super(), this.label = e, this.text = t, this.empty = n, this.selected = r;
1375
+ }
1376
+ eq(e) {
1377
+ return e.label === this.label && e.text === this.text && e.empty === this.empty && e.selected === this.selected;
1378
+ }
1379
+ toDOM() {
1380
+ let e = document.createElement("span");
1381
+ e.className = "cm-md-variable-token", e.setAttribute("spellcheck", "false"), this.empty && e.setAttribute("data-empty", ""), this.selected && e.setAttribute("data-selected", "");
1382
+ let t = document.createElement("span");
1383
+ t.className = "cm-md-variable-token-text", t.dataset.text = this.text, t.setAttribute("aria-hidden", "true");
1384
+ let n = document.createElement("span");
1385
+ if (n.className = "cm-md-token-spoken", n.textContent = this.empty ? this.text : `${this.text} (${this.label})`, e.append(n), this.empty) return e.append(t), e;
1386
+ let r = document.createElement("nldd-tooltip");
1387
+ return r.setAttribute("text", this.label), r.append(t), e.append(r), e;
1388
+ }
1389
+ ignoreEvent() {
1390
+ return !1;
1391
+ }
1392
+ };
1393
+ function Yr(e) {
1394
+ let t = e.field(qr);
1395
+ if (!t.size) return [];
1396
+ let n = [];
1397
+ for (let r of e.doc.toString().matchAll(Gr)) {
1398
+ let i = r.index;
1399
+ t.has(r[1]) && !D(e, i, 1, Le) && n.push({
1400
+ from: i,
1401
+ to: i + r[0].length,
1402
+ key: r[1]
1403
+ });
1404
+ }
1405
+ return n;
1406
+ }
1407
+ function Xr(e, t) {
1408
+ return e.selection.ranges.some((e) => !e.empty && e.from <= t.from && e.to >= t.to);
1409
+ }
1410
+ function Zr(e, n, r) {
1411
+ let i = e.field(qr), a = [], o = [];
1412
+ for (let s of n) {
1413
+ let n = Xr(e, s);
1414
+ n && o.push(s.from);
1415
+ let c = i.get(s.key), l = c.value === void 0 || c.value === "", u = l ? r(c.label) : c.value;
1416
+ a.push(t.replace({ widget: new Jr(c.label, u, l, n) }).range(s.from, s.to));
1417
+ }
1418
+ return {
1419
+ matches: n,
1420
+ look: o.join(" "),
1421
+ tokens: t.set(a)
1422
+ };
1423
+ }
1424
+ function Qr(e, t) {
1425
+ return (n) => {
1426
+ let { main: r } = n.state.selection;
1427
+ if (!r.empty || n.state.readOnly) return !1;
1428
+ let i = n.state.field(e).matches.find((e) => (t < 0 ? e.to : e.from) === r.head);
1429
+ return i ? (n.dispatch({ selection: {
1430
+ anchor: i.from,
1431
+ head: i.to
1432
+ } }), !0) : !1;
1433
+ };
1434
+ }
1435
+ function $r(e) {
1436
+ let n = b.define({
1437
+ create: (t) => Zr(t, Yr(t), e),
1438
+ update: (t, n) => {
1439
+ if (n.docChanged || E(n.startState, n.state) || n.effects.some((e) => e.is(Kr) || e.is(w))) return Zr(n.state, Yr(n.state), e);
1440
+ if (!n.selection) return t;
1441
+ let r = Zr(n.state, t.matches, e);
1442
+ return r.look === t.look ? t : r;
1443
+ },
1444
+ provide: (e) => o.decorations.from(e, (e) => e.tokens)
1445
+ });
1446
+ return [
1447
+ qr,
1448
+ v.highest(n),
1449
+ v.high(l.of([{
1450
+ key: "Backspace",
1451
+ run: Qr(n, -1)
1452
+ }, {
1453
+ key: "Delete",
1454
+ run: Qr(n, 1)
1455
+ }])),
1456
+ o.atomicRanges.of((e) => e.state.field(n, !1)?.tokens ?? t.none)
1179
1457
  ];
1180
1458
  }
1181
1459
  // src/components/inputs/text-editor/text-editor.spellcheck.ts
1182
- var gr = x.define(), _r = /* @__PURE__ */ new Set([
1460
+ var ei = x.define(), ti = /* @__PURE__ */ new Set([
1183
1461
  "InlineCode",
1184
1462
  "FencedCode",
1185
1463
  "CodeBlock",
1186
1464
  "URL",
1187
1465
  "Autolink"
1188
1466
  ]);
1189
- function vr(e, t) {
1190
- return e.name === "Link" && A(t, e.node);
1467
+ function ni(e, t) {
1468
+ return e.name === "Link" && O(t, e.node);
1191
1469
  }
1192
- var yr = gr.of((e, t) => _r.has(e.name) || vr(e, t)), br = v.mark({ attributes: { spellcheck: "false" } });
1193
- function xr(e) {
1194
- let t = e.state.facet(gr), n = new m(), r = s(e.state), i = -1;
1470
+ var ri = ei.of((e, t) => ti.has(e.name) || ni(e, t)), ii = t.mark({ attributes: { spellcheck: "false" } });
1471
+ function ai(e) {
1472
+ let t = e.state.facet(ei), n = new te(), r = y(e.state), i = -1;
1195
1473
  for (let { from: a, to: o } of e.visibleRanges) r.iterate({
1196
1474
  from: a,
1197
1475
  to: o,
1198
1476
  enter: (r) => {
1199
- if (t.some((t) => t(r, e.state))) return r.to > r.from && r.from >= i && (n.add(r.from, r.to, br), i = r.to), !1;
1477
+ if (t.some((t) => t(r, e.state))) return r.to > r.from && r.from >= i && (n.add(r.from, r.to, ii), i = r.to), !1;
1200
1478
  }
1201
1479
  });
1202
1480
  return n.finish();
1203
1481
  }
1204
- var Sr = c.fromClass(class {
1482
+ var oi = n.fromClass(class {
1205
1483
  constructor(e) {
1206
- this.decorations = xr(e);
1484
+ this.decorations = ai(e);
1207
1485
  }
1208
1486
  update(e) {
1209
- (e.docChanged || e.viewportChanged || O(e.startState, e.state)) && (this.decorations = xr(e.view));
1487
+ (e.docChanged || e.viewportChanged || E(e.startState, e.state)) && (this.decorations = ai(e.view));
1210
1488
  }
1211
- }, { decorations: (e) => e.decorations }), Cr = x.define({ combine: (e) => e.some(Boolean) }), wr = /* @__PURE__ */ new WeakMap(), Tr = _.domEventObservers({ keydown(e, t) {
1489
+ }, { decorations: (e) => e.decorations }), si = x.define({ combine: (e) => e.some(Boolean) }), ci = /* @__PURE__ */ new WeakMap(), li = o.domEventObservers({ keydown(e, t) {
1212
1490
  let n = e.isTrusted && !e.isComposing && !e.shiftKey && !e.altKey && !e.ctrlKey && !e.metaKey;
1213
- wr.set(t, n && (e.key === "Backspace" || e.key === "Delete") ? e.key : null);
1491
+ ci.set(t, n && (e.key === "Backspace" || e.key === "Delete") ? e.key : null);
1214
1492
  } });
1215
- function Er(e, t) {
1493
+ function ui(e, t) {
1216
1494
  let { node: n, offset: r } = e.domAtPos(t);
1217
1495
  return n.nodeType === Node.TEXT_NODE ? {
1218
1496
  node: n,
1219
1497
  offset: r
1220
1498
  } : null;
1221
1499
  }
1222
- function Dr(e, t) {
1223
- if (!e.state.facet(Cr) || wr.get(e) !== t) return !1;
1500
+ function di(e, t) {
1501
+ if (!e.state.facet(si) || ci.get(e) !== t) return !1;
1224
1502
  let { selection: n, doc: r } = e.state;
1225
1503
  if (n.ranges.length > 1) return !1;
1226
1504
  let { from: i, to: a, empty: o } = n.main, s = r.lineAt(i);
1227
1505
  if (!/\S/.test(e.state.sliceDoc(s.from, i)) && !(t === "Delete" && o)) return !1;
1228
- let c = Er(e, i);
1506
+ let c = ui(e, i);
1229
1507
  if (!c) return !1;
1230
1508
  if (!o) {
1231
- let t = Er(e, a);
1509
+ let t = ui(e, a);
1232
1510
  return t !== null && t.node === c.node && c.offset >= 1;
1233
1511
  }
1234
1512
  return t === "Backspace" ? c.offset >= 2 : c.offset >= 1 && c.offset <= c.node.length - 2;
1235
1513
  }
1236
- function Or() {
1514
+ function fi() {
1237
1515
  return [
1238
- _.contentAttributes.of({ spellcheck: "true" }),
1239
- yr,
1240
- y.highest(Sr),
1241
- Cr.of(!0),
1242
- Tr
1516
+ o.contentAttributes.of({ spellcheck: "true" }),
1517
+ ri,
1518
+ v.highest(oi),
1519
+ si.of(!0),
1520
+ li
1243
1521
  ];
1244
1522
  }
1245
1523
  function z(e) {
@@ -1250,20 +1528,20 @@ function B(e) {
1250
1528
  for (let n = e.indexOf("⁠"); n !== -1; n = e.indexOf("⁠", n + 1)) t.push(n);
1251
1529
  return t;
1252
1530
  }
1253
- function kr(e, t) {
1531
+ function pi(e, t) {
1254
1532
  let n = e.indexOf("⁠"), r = 0;
1255
1533
  for (; n !== -1 && n < t;) r++, n = e.indexOf("⁠", n + 1);
1256
1534
  return r;
1257
1535
  }
1258
1536
  function V(e, t) {
1259
- return t - kr(e, t);
1537
+ return t - pi(e, t);
1260
1538
  }
1261
1539
  function H(e, t) {
1262
1540
  let n = t;
1263
1541
  for (let t of e) t <= n && n++;
1264
1542
  return n;
1265
1543
  }
1266
- function Ar(e, t, n = Pr) {
1544
+ function mi(e, t, n = vi) {
1267
1545
  let r = [];
1268
1546
  for (let i of e) i.to <= i.from || (n(t, i.from, "start") && r.push({
1269
1547
  pos: i.from,
@@ -1274,13 +1552,13 @@ function Ar(e, t, n = Pr) {
1274
1552
  }));
1275
1553
  return r;
1276
1554
  }
1277
- function jr(e) {
1555
+ function hi(e) {
1278
1556
  let t = /* @__PURE__ */ new Map();
1279
1557
  for (let n of e) t.set(n.pos, (t.get(n.pos) ?? 0) + 1);
1280
1558
  return t;
1281
1559
  }
1282
- function Mr(e, t, n = Pr) {
1283
- let r = jr(Ar(t, t.length ? z(e) : "", n)), i = [], a = 0, o = 0;
1560
+ function gi(e, t, n = vi) {
1561
+ let r = hi(mi(t, t.length ? z(e) : "", n)), i = [], a = 0, o = 0;
1284
1562
  for (;;) {
1285
1563
  let t = 0;
1286
1564
  for (; a + t < e.length && e[a + t] === "⁠";) t++;
@@ -1296,37 +1574,39 @@ function Mr(e, t, n = Pr) {
1296
1574
  a++, o++;
1297
1575
  }
1298
1576
  }
1299
- var Nr = /^(\s*)(#{1,6}\s|[-*+]\s|\d+[.)]\s|>|`{3,}|~{3,})/;
1300
- function Pr(e, t, n) {
1301
- let r = e.lastIndexOf("\n", t - 1) + 1, i = e.indexOf("\n", t) === -1 ? e.length : e.indexOf("\n", t), a = e.slice(r, i), o = a.match(Nr);
1302
- return !(o && t < r + o[0].length || (a.slice(0, t - r).match(/~~/g) ?? []).length % 2 == 1);
1577
+ var _i = /^(\s*)(#{1,6}\s|[-*+]\s|\d+[.)]\s|>|`{3,}|~{3,})/;
1578
+ function vi(e, t, n) {
1579
+ let r = e.lastIndexOf("\n", t - 1) + 1, i = e.indexOf("\n", t) === -1 ? e.length : e.indexOf("\n", t), a = e.slice(r, i), o = a.match(_i);
1580
+ if (o && t < r + o[0].length) return !1;
1581
+ let s = a.replace(/(`+)(?!`)(.*?[^`])\1(?!`)/g, (e) => " ".repeat(e.length)).slice(0, t - r);
1582
+ return (s.match(/~~/g) ?? []).length % 2 == 0 && (s.match(/(?<!=)==(?!=)/g) ?? []).length % 2 == 0;
1303
1583
  }
1304
1584
  // src/components/inputs/text-editor/text-editor.annotations.ts
1305
- var Fr = b.define(), Ir = b.define(), Lr = b.define(), Rr = b.define();
1306
- function zr(e) {
1585
+ var yi = m.define(), bi = m.define(), xi = m.define(), Si = m.define();
1586
+ function Ci(e) {
1307
1587
  return e.field(U, !1) ?? [];
1308
1588
  }
1309
- function Br(e, t) {
1589
+ function wi(e, t) {
1310
1590
  return e.map((e) => ({
1311
1591
  id: e.id,
1312
1592
  from: Math.max(0, Math.min(e.start, t)),
1313
1593
  to: Math.max(0, Math.min(e.end, t))
1314
1594
  })).filter((e) => e.to > e.from);
1315
1595
  }
1316
- function Vr(e, t) {
1596
+ function Ti(e, t) {
1317
1597
  return {
1318
1598
  from: H(t, e.from),
1319
1599
  to: H(t, e.to - 1) + 1
1320
1600
  };
1321
1601
  }
1322
- var U = h.define({
1602
+ var U = b.define({
1323
1603
  create: () => [],
1324
1604
  update: (e, t) => {
1325
- let n = t.effects.find((e) => e.is(Ir));
1605
+ let n = t.effects.find((e) => e.is(bi));
1326
1606
  return n ? n.value : e;
1327
1607
  }
1328
1608
  });
1329
- function Hr(e) {
1609
+ function Ei(e) {
1330
1610
  let t = [];
1331
1611
  for (let n of e.toSorted((e, t) => e.from - t.from || e.to - t.to)) {
1332
1612
  let e = t[t.length - 1];
@@ -1338,13 +1618,13 @@ function Hr(e) {
1338
1618
  }
1339
1619
  return t;
1340
1620
  }
1341
- var Ur = 40;
1342
- function Wr(e) {
1343
- return e.length > Ur ? `${e.slice(0, Ur)}…` : e;
1621
+ var Di = 40;
1622
+ function Oi(e) {
1623
+ return e.length > Di ? `${e.slice(0, Di)}…` : e;
1344
1624
  }
1345
- var Gr = class extends t {
1625
+ var ki = class extends r {
1346
1626
  constructor(e, t, n) {
1347
- super(), this.ids = e, this.quote = t, this.ariaLabel = n(e.length, Wr(t));
1627
+ super(), this.ids = e, this.quote = t, this.ariaLabel = n(e.length, Oi(t));
1348
1628
  }
1349
1629
  eq(e) {
1350
1630
  return e.quote === this.quote && e.ids.length === this.ids.length && e.ids.every((e, t) => e === this.ids[t]) && e.ariaLabel === this.ariaLabel;
@@ -1354,7 +1634,7 @@ var Gr = class extends t {
1354
1634
  return e.className = "cm-annotation-badge", e.type = "button", e.dataset.annotations = this.ids.join(" "), e.textContent = String(this.ids.length), e.setAttribute("aria-label", this.ariaLabel), e;
1355
1635
  }
1356
1636
  coordsAt(e, t, n) {
1357
- let r = e.getBoundingClientRect(), i = getComputedStyle(e), a = at(e) ?? {
1637
+ let r = e.getBoundingClientRect(), i = getComputedStyle(e), a = ct(e) ?? {
1358
1638
  top: r.top,
1359
1639
  bottom: r.bottom
1360
1640
  }, o = e.closest(".cm-annotation"), s = o ? o.getClientRects() : null, c = s && s.length ? s[s.length - 1] : null, l = t <= 0 ? r.left - parseFloat(i.marginLeft) : c ? c.right : r.right + parseFloat(i.marginRight);
@@ -1365,13 +1645,13 @@ var Gr = class extends t {
1365
1645
  bottom: a.bottom
1366
1646
  };
1367
1647
  }
1368
- }, Kr = v.mark({
1648
+ }, Ai = t.mark({
1369
1649
  class: "cm-annotation",
1370
1650
  inclusiveEnd: !0
1371
- }), qr = v.mark({
1651
+ }), ji = t.mark({
1372
1652
  class: "cm-annotation is-selected",
1373
1653
  inclusiveEnd: !0
1374
- }), Jr = v.mark({ class: "is-selected" }), Yr = class e extends t {
1654
+ }), Mi = t.mark({ class: "is-selected" }), Ni = class e extends r {
1375
1655
  eq(t) {
1376
1656
  return t instanceof e;
1377
1657
  }
@@ -1383,7 +1663,7 @@ var Gr = class extends t {
1383
1663
  let r = e.nextElementSibling;
1384
1664
  for (; r instanceof HTMLElement && r.classList.contains("cm-widgetBuffer");) r = r.nextElementSibling;
1385
1665
  if (!(r instanceof HTMLElement) || !r.classList.contains("cm-annotation")) return null;
1386
- let i = parseFloat(getComputedStyle(r).paddingInlineStart || "0"), a = r.getClientRects()[0] ?? r.getBoundingClientRect(), o = at(e) ?? {
1666
+ let i = parseFloat(getComputedStyle(r).paddingInlineStart || "0"), a = r.getClientRects()[0] ?? r.getBoundingClientRect(), o = ct(e) ?? {
1387
1667
  top: a.top,
1388
1668
  bottom: a.bottom
1389
1669
  }, s = t <= 0 ? a.left : a.left + i;
@@ -1394,11 +1674,11 @@ var Gr = class extends t {
1394
1674
  bottom: o.bottom
1395
1675
  };
1396
1676
  }
1397
- }, Xr = v.replace({ widget: new Yr() }), Zr = v.mark({}), Qr = v.mark({
1677
+ }, Pi = t.replace({ widget: new Ni() }), Fi = t.mark({}), Ii = t.mark({
1398
1678
  class: "cm-annotation-tail",
1399
1679
  inclusiveEnd: !0
1400
1680
  });
1401
- function $r(e, t, n) {
1681
+ function Li(e, t, n) {
1402
1682
  let r = H(n, e.from), i = H(n, e.to - 1) + 1;
1403
1683
  return {
1404
1684
  docFrom: r,
@@ -1407,63 +1687,63 @@ function $r(e, t, n) {
1407
1687
  endSent: i < t.length && t[i] === "⁠" ? i : null
1408
1688
  };
1409
1689
  }
1410
- var ei = {
1411
- deco: v.none,
1412
- atomic: v.none
1690
+ var Ri = {
1691
+ deco: t.none,
1692
+ atomic: t.none
1413
1693
  };
1414
- function ti(e, t) {
1415
- if (!e.field(U).length) return ei;
1416
- let n = e.doc.toString(), r = e.selection.main, i = B(n), a = n.length - i.length, o = z(n), s = e.field(U).map((e) => ({
1694
+ function zi(e, n) {
1695
+ if (!e.field(U).length) return Ri;
1696
+ let r = e.doc.toString(), i = e.selection.main, a = B(r), o = r.length - a.length, s = z(r), c = e.field(U).map((e) => ({
1417
1697
  id: e.id,
1418
- from: Math.min(e.from, a),
1419
- to: Math.min(e.to, a)
1420
- })).filter((e) => e.to > e.from), c = [], l = [];
1421
- for (let e of Hr(s)) {
1698
+ from: Math.min(e.from, o),
1699
+ to: Math.min(e.to, o)
1700
+ })).filter((e) => e.to > e.from), l = [], u = [];
1701
+ for (let e of Ei(c)) {
1422
1702
  if (e.to <= e.from) continue;
1423
- let { docFrom: a, textTo: s, startSent: u, endSent: d } = $r(e, n, i), f = o.slice(e.from, e.to), p = d === null ? s : s + 1, m = !r.empty && r.from <= a && r.to >= p;
1424
- if (c.push((m ? qr : Kr).range(a, p)), !m && !r.empty) {
1425
- let e = Math.max(a, r.from), t = Math.min(p, r.to);
1426
- t > e && c.push(Jr.range(e, t));
1703
+ let { docFrom: o, textTo: c, startSent: d, endSent: f } = Li(e, r, a), p = s.slice(e.from, e.to), m = f === null ? c : c + 1, h = !i.empty && i.from <= o && i.to >= m;
1704
+ if (l.push((h ? ji : Ai).range(o, m)), !h && !i.empty) {
1705
+ let e = Math.max(o, i.from), t = Math.min(m, i.to);
1706
+ t > e && l.push(Mi.range(e, t));
1427
1707
  }
1428
- let h = d === null ? s : d + 1, g = n.slice(a, s).match(/\S+$/);
1429
- g && c.push(Qr.range(a + (g.index ?? 0), h)), d === null ? c.push(v.widget({
1430
- widget: new Gr(e.ids, f, t),
1708
+ let g = f === null ? c : f + 1, _ = r.slice(o, c).match(/\S+$/);
1709
+ _ && l.push(Ii.range(o + (_.index ?? 0), g)), f === null ? l.push(t.widget({
1710
+ widget: new ki(e.ids, p, n),
1431
1711
  side: -1
1432
- }).range(s)) : (c.push(v.replace({ widget: new Gr(e.ids, f, t) }).range(d, d + 1)), l.push(Zr.range(d, d + 1))), u !== null && (c.push(Xr.range(u, u + 1)), l.push(Zr.range(u, u + 1)));
1712
+ }).range(c)) : (l.push(t.replace({ widget: new ki(e.ids, p, n) }).range(f, f + 1)), u.push(Fi.range(f, f + 1))), d !== null && (l.push(Pi.range(d, d + 1)), u.push(Fi.range(d, d + 1)));
1433
1713
  }
1434
1714
  return {
1435
- deco: v.set(c, !0),
1436
- atomic: v.set(l, !0)
1715
+ deco: t.set(l, !0),
1716
+ atomic: t.set(u, !0)
1437
1717
  };
1438
1718
  }
1439
- function ni(e) {
1440
- return h.define({
1441
- create: (t) => ti(t, e),
1442
- update: (t, n) => t === ei && !n.state.field(U).length ? t : n.docChanged || !n.startState.selection.eq(n.state.selection) || n.effects.some((e) => e.is(Fr) || e.is(Pe)) ? ti(n.state, e) : t,
1443
- provide: (e) => _.decorations.from(e, (e) => e.deco)
1719
+ function Bi(e) {
1720
+ return b.define({
1721
+ create: (t) => zi(t, e),
1722
+ update: (t, n) => t === Ri && !n.state.field(U).length ? t : n.docChanged || !n.startState.selection.eq(n.state.selection) || n.effects.some((e) => e.is(yi) || e.is(w)) ? zi(n.state, e) : t,
1723
+ provide: (e) => o.decorations.from(e, (e) => e.deco)
1444
1724
  });
1445
1725
  }
1446
- var ri = g.transactionFilter.of((e) => {
1447
- let t = e.effects.find((e) => e.is(Fr));
1448
- if (!e.docChanged && !t || !(t || e.effects.some((e) => e.is(Rr) || e.is(Lr))) && !(e.startState.field(U, !1) ?? []).length) return e;
1726
+ var Vi = re.transactionFilter.of((e) => {
1727
+ let t = e.effects.find((e) => e.is(yi));
1728
+ if (!e.docChanged && !t || !(t || e.effects.some((e) => e.is(Si) || e.is(xi))) && !(e.startState.field(U, !1) ?? []).length) return e;
1449
1729
  let n = e.newDoc.toString(), r = z(n).length, i;
1450
- if (t) i = Br(t.value, r);
1730
+ if (t) i = wi(t.value, r);
1451
1731
  else {
1452
- let t = B(e.startState.doc.toString()), a = e.effects.find((e) => e.is(Lr))?.value;
1732
+ let t = B(e.startState.doc.toString()), a = e.effects.find((e) => e.is(xi))?.value;
1453
1733
  i = (e.startState.field(U, !1) ?? []).map((r) => {
1454
1734
  if (a && r.from >= a.from && r.to <= a.to) return {
1455
1735
  id: r.id,
1456
1736
  from: a.insertAt + (r.from - a.from),
1457
1737
  to: a.insertAt + (r.to - a.from)
1458
1738
  };
1459
- let i = Vr(r, t), o = e.changes.mapPos(i.from, -1), s = e.changes.mapPos(i.to, 1);
1739
+ let i = Ti(r, t), o = e.changes.mapPos(i.from, -1), s = e.changes.mapPos(i.to, 1);
1460
1740
  return {
1461
1741
  id: r.id,
1462
1742
  from: V(n, o),
1463
1743
  to: V(n, s)
1464
1744
  };
1465
1745
  }).filter((e) => e.to > e.from);
1466
- let o = e.effects.find((e) => e.is(Rr))?.value;
1746
+ let o = e.effects.find((e) => e.is(Si))?.value;
1467
1747
  o && (i = i.concat(o.anns.map((e) => ({
1468
1748
  id: e.id,
1469
1749
  from: Math.max(0, Math.min(o.at + e.from, r)),
@@ -1471,62 +1751,62 @@ var ri = g.transactionFilter.of((e) => {
1471
1751
  })).filter((e) => e.to > e.from)));
1472
1752
  }
1473
1753
  return [e, {
1474
- changes: Mr(n, Hr(i)),
1475
- effects: [Ir.of(i)],
1754
+ changes: gi(n, Ei(i)),
1755
+ effects: [bi.of(i)],
1476
1756
  sequential: !0
1477
1757
  }];
1478
- }), ii = he.of((e) => {
1479
- if (!e.effects.some((e) => e.is(Ir))) return [];
1758
+ }), Hi = _e.of((e) => {
1759
+ if (!e.effects.some((e) => e.is(bi))) return [];
1480
1760
  let t = e.startState.field(U, !1) ?? [];
1481
- return [Ir.of(t)];
1482
- }), ai = [_.clipboardOutputFilter.of((e) => z(e)), _.clipboardInputFilter.of((e) => z(e))];
1483
- function oi(e) {
1484
- let t = ni(e), n = _.atomicRanges.of((e) => e.state.field(t).atomic);
1761
+ return [bi.of(t)];
1762
+ }), Ui = [o.clipboardOutputFilter.of((e) => z(e)), o.clipboardInputFilter.of((e) => z(e))];
1763
+ function Wi(e) {
1764
+ let t = Bi(e), n = o.atomicRanges.of((e) => e.state.field(t).atomic);
1485
1765
  return [
1486
1766
  U,
1487
- y.highest(t),
1767
+ v.highest(t),
1488
1768
  n,
1489
- ri,
1490
- ii,
1491
- ai
1769
+ Vi,
1770
+ Hi,
1771
+ Ui
1492
1772
  ];
1493
1773
  }
1494
1774
  // src/components/inputs/text-editor/text-editor.paste.ts
1495
- var si = /^([ \t]*)(?:[•◦▪‣·]|o(?=\t))[ \t]+/, ci = /^([ \t]*)([-*+]|\d{1,9}[.)])\t+/, li = /^( *)([-*+]|\d{1,9}[.)]) $/;
1496
- function ui(e) {
1775
+ var Gi = /^([ \t]*)(?:[•◦▪‣·]|o(?=\t))[ \t]+/, Ki = /^([ \t]*)([-*+]|\d{1,9}[.)])\t+/, qi = /^( *)([-*+]|\d{1,9}[.)]) $/;
1776
+ function Ji(e) {
1497
1777
  let t = /^[ \t]*/.exec(e)[0], n = 0;
1498
1778
  for (let e of t) n = e === " " ? n + 4 - n % 4 : n + 1;
1499
1779
  return " ".repeat(n) + e.slice(t.length);
1500
1780
  }
1501
- var di = (e) => /^ */.exec(e)[0].length;
1502
- function fi(e, t) {
1503
- let { from: n, to: r } = e.selection.main, i = e.doc.lineAt(n), a = k(e, n, 1, E) ?? k(e, i.from, 1, E);
1781
+ var Yi = (e) => /^ */.exec(e)[0].length;
1782
+ function Xi(e, t) {
1783
+ let { from: n, to: r } = e.selection.main, i = e.doc.lineAt(n), a = D(e, n, 1, Ie) ?? D(e, i.from, 1, Ie);
1504
1784
  if (a && a.from < n) return null;
1505
- let o = i.text.slice(0, n - i.from), s = li.exec(o), c = !s && o.trim() !== "";
1785
+ let o = i.text.slice(0, n - i.from), s = qi.exec(o), c = !s && o.trim() !== "";
1506
1786
  if (c && (n !== i.to || e.doc.lineAt(r).to !== r)) return null;
1507
- let l = t.split("\n").map((e) => ui(e.replace(si, "$1- ").replace(ci, "$1$2 "))), u = l.filter((e) => e.trim() !== "");
1787
+ let l = t.split("\n").map((e) => Ji(e.replace(Gi, "$1- ").replace(Ki, "$1$2 "))), u = l.filter((e) => e.trim() !== "");
1508
1788
  if (u.length === 0) return null;
1509
- let d = Math.min(...u.map(di));
1789
+ let d = Math.min(...u.map(Yi));
1510
1790
  l = l.map((e) => e.trim() === "" ? "" : e.slice(d));
1511
- let f = l.find((e) => e.trim() !== ""), p = wn.test(f) && /\S/.test(f.replace(wn, ""));
1791
+ let f = l.find((e) => e.trim() !== ""), p = P.test(f) && /\S/.test(f.replace(P, ""));
1512
1792
  if (c && (!p || u.length < 2)) return null;
1513
1793
  let m = 0, h = n;
1514
1794
  if (c) {
1515
- let t = P(e, i.number + 1);
1795
+ let t = F(e, i.number + 1);
1516
1796
  return t.length && (m = d > 0 ? t[0].contentCol : t[0].markerCol), {
1517
1797
  from: n,
1518
1798
  to: r,
1519
- insert: "\n" + pi(l, m).join("\n")
1799
+ insert: "\n" + Zi(l, m).join("\n")
1520
1800
  };
1521
1801
  }
1522
1802
  if (p) {
1523
- let t = P(e, i.number);
1803
+ let t = F(e, i.number);
1524
1804
  if (s) {
1525
1805
  h = i.from;
1526
1806
  let e = s[1].length;
1527
1807
  m = d > 0 ? t.length ? t[0].contentCol : e + s[2].length + 1 : e;
1528
1808
  } else h = i.from, t.length && (m = d > 0 || o.length > 0 ? t[0].contentCol : t[0].markerCol);
1529
- l = pi(l, m);
1809
+ l = Zi(l, m);
1530
1810
  } else if ((s || d === 0) && l.join("\n") === t) return null;
1531
1811
  let g = l.join("\n");
1532
1812
  return g === e.sliceDoc(h, n) + t ? null : {
@@ -1535,11 +1815,11 @@ function fi(e, t) {
1535
1815
  insert: g
1536
1816
  };
1537
1817
  }
1538
- function pi(e, t) {
1818
+ function Zi(e, t) {
1539
1819
  let n = [];
1540
1820
  return e.map((e) => {
1541
1821
  if (e.trim() === "") return "";
1542
- let r = di(e), i = wn.exec(e);
1822
+ let r = Yi(e), i = P.exec(e);
1543
1823
  if (i) {
1544
1824
  for (; n.length && n[n.length - 1].orig >= r;) n.pop();
1545
1825
  let a = n.length ? n[n.length - 1].content : t;
@@ -1553,13 +1833,13 @@ function pi(e, t) {
1553
1833
  });
1554
1834
  }
1555
1835
  // src/components/inputs/text-editor/text-editor.clipboard.ts
1556
- var mi = class {
1836
+ var Qi = class {
1557
1837
  constructor() {
1558
1838
  this.cut = null;
1559
1839
  }
1560
1840
  annotationsInSelection(e) {
1561
1841
  let { from: t, to: n } = e.state.selection.main, r = e.state.doc.toString(), i = V(r, t), a = V(r, n);
1562
- return zr(e.state).filter((e) => e.from >= i && e.to <= a).map((e) => ({
1842
+ return Ci(e.state).filter((e) => e.from >= i && e.to <= a).map((e) => ({
1563
1843
  id: e.id,
1564
1844
  from: e.from - i,
1565
1845
  to: e.to - i
@@ -1582,12 +1862,12 @@ var mi = class {
1582
1862
  paste(e, t, n = !1) {
1583
1863
  let r = z(t).replace(/\r\n?/g, "\n");
1584
1864
  if (!r || e.state.readOnly) return;
1585
- let i = this.cut, a = !!(i && ((e, t) => e.replace(/\r\n/g, "\n") === t.replace(/\r\n/g, "\n"))(i.text, r) && i.anns.length > 0), o = V(e.state.doc.toString(), e.state.selection.main.from), s = a || n ? null : fi(e.state, r), c = e.state.selection.main.to, l = {
1865
+ let i = this.cut, a = !!(i && ((e, t) => e.replace(/\r\n/g, "\n") === t.replace(/\r\n/g, "\n"))(i.text, r) && i.anns.length > 0), o = V(e.state.doc.toString(), e.state.selection.main.from), s = a || n ? null : Xi(e.state, r), c = e.state.selection.main.to, l = {
1586
1866
  ...e.state.replaceSelection(r),
1587
1867
  userEvent: "input.paste"
1588
1868
  }, u = e.state.update(a ? {
1589
1869
  ...l,
1590
- effects: Rr.of({
1870
+ effects: Si.of({
1591
1871
  at: o,
1592
1872
  anns: i.anns
1593
1873
  })
@@ -1602,27 +1882,27 @@ var mi = class {
1602
1882
  },
1603
1883
  selection: { anchor: d + s.insert.length },
1604
1884
  userEvent: "input.complete",
1605
- annotations: se.of("before")
1885
+ annotations: le.of("before")
1606
1886
  });
1607
1887
  }
1608
- }, hi = 200, gi = /* @__PURE__ */ new WeakSet();
1609
- function _i(e) {
1610
- gi.has(e) || e.hasFocus || e.dispatch({ selection: { anchor: e.state.doc.length } });
1888
+ }, $i = 200, ea = /* @__PURE__ */ new WeakSet();
1889
+ function ta(e) {
1890
+ ea.has(e) || e.hasFocus || e.dispatch({ selection: { anchor: e.state.doc.length } });
1611
1891
  }
1612
- function vi() {
1892
+ function na() {
1613
1893
  let e = 0, t = 0, n = () => (t = Date.now(), !1);
1614
1894
  return [
1615
- _.updateListener.of((e) => {
1616
- e.transactions.some((e) => e.selection) && gi.add(e.view);
1895
+ o.updateListener.of((e) => {
1896
+ e.transactions.some((e) => e.selection) && ea.add(e.view);
1617
1897
  }),
1618
- _.domEventHandlers({
1619
- focus: (t, n) => (gi.add(n), e = Date.now(), !1),
1898
+ o.domEventHandlers({
1899
+ focus: (t, n) => (ea.add(n), e = Date.now(), !1),
1620
1900
  keydown: n,
1621
1901
  pointerdown: n,
1622
1902
  touchstart: n
1623
1903
  }),
1624
- g.transactionFilter.of((n) => {
1625
- if (n.docChanged || !n.selection || !n.isUserEvent("select") || n.isUserEvent("select.pointer") || Date.now() - e > hi || t >= e) return n;
1904
+ re.transactionFilter.of((n) => {
1905
+ if (n.docChanged || !n.selection || !n.isUserEvent("select") || n.isUserEvent("select.pointer") || Date.now() - e > $i || t >= e) return n;
1626
1906
  let r = n.startState.selection.main, i = n.selection.main;
1627
1907
  if (r.from === 0 || i.from !== 0) return n;
1628
1908
  let a = i.anchor === 0 ? i.head : i.anchor;
@@ -1634,12 +1914,13 @@ function vi() {
1634
1914
  ];
1635
1915
  }
1636
1916
  // src/components/inputs/text-editor/text-editor.commands.ts
1637
- var yi = {
1917
+ var ra = {
1638
1918
  bold: !1,
1639
1919
  italic: !1,
1640
1920
  inlineCode: !1,
1641
1921
  codeBlock: !1,
1642
1922
  strikethrough: !1,
1923
+ highlight: !1,
1643
1924
  link: !1,
1644
1925
  bulletList: !1,
1645
1926
  orderedList: !1,
@@ -1648,67 +1929,67 @@ var yi = {
1648
1929
  heading: 0
1649
1930
  };
1650
1931
  function W(e, t, n, r = 1) {
1651
- return k(e.state, t, r, n);
1932
+ return D(e.state, t, r, n);
1652
1933
  }
1653
- function bi(e, t, n) {
1934
+ function ia(e, t, n) {
1654
1935
  let r = W(e, t, n, -1), i = W(e, t, n, 1);
1655
1936
  return r && i && r.from === i.from && r.to === i.to ? i : null;
1656
1937
  }
1657
- function G(t, n, r) {
1658
- if (t.state.readOnly) return;
1659
- _i(t);
1660
- let { state: i } = t, a = n.length, o = i.field(N, !1);
1661
- t.dispatch(i.changeByRange((s) => {
1662
- let c = i.sliceDoc(s.from, s.to), l = /^\s*/.exec(c)[0].length;
1663
- if (!s.empty && l === c.length) return { range: s };
1664
- let u = s.from + l, d = s.to - /\s*$/.exec(c)[0].length, f = W(t, u, r) ?? (o && o.name === r && u >= o.from && d <= o.to ? o : null);
1665
- if (f) {
1666
- let t = i.sliceDoc(f.from + a, f.to - a);
1667
- if (s.empty && u === f.to - a && t.trim()) {
1668
- let t = {
1669
- from: f.from,
1670
- to: f.to,
1671
- name: r,
1672
- marker: i.sliceDoc(f.from, f.from + a),
1938
+ function G(e, t, n) {
1939
+ if (e.state.readOnly) return;
1940
+ ta(e);
1941
+ let { state: r } = e, i = t.length, a = r.field(M, !1);
1942
+ e.dispatch(r.changeByRange((o) => {
1943
+ let s = r.sliceDoc(o.from, o.to), c = /^\s*/.exec(s)[0].length;
1944
+ if (!o.empty && c === s.length) return { range: o };
1945
+ let l = o.from + c, u = o.to - /\s*$/.exec(s)[0].length, d = W(e, l, n) ?? (a && a.name === n && l >= a.from && u <= a.to ? a : null);
1946
+ if (d) {
1947
+ let e = r.sliceDoc(d.from + i, d.to - i);
1948
+ if (o.empty && l === d.to - i && e.trim()) {
1949
+ let e = {
1950
+ from: d.from,
1951
+ to: d.to,
1952
+ name: n,
1953
+ marker: r.sliceDoc(d.from, d.from + i),
1673
1954
  live: !1
1674
- }, n = sn.has(r) ? bn(i, t) : [], o = f.to;
1675
- for (; /[ \t]/.test(i.sliceDoc(o, o + 1));) o++;
1955
+ }, t = bn.has(n) ? Nn(r, e) : [], a = d.to;
1956
+ for (; /[ \t]/.test(r.sliceDoc(a, a + 1));) a++;
1676
1957
  return {
1677
- changes: n,
1678
- range: e.cursor(o)
1958
+ changes: t,
1959
+ range: g.cursor(a)
1679
1960
  };
1680
1961
  }
1681
- let n = i.changes([{
1682
- from: f.from,
1683
- to: f.from + a
1962
+ let t = r.changes([{
1963
+ from: d.from,
1964
+ to: d.from + i
1684
1965
  }, {
1685
- from: f.to - a,
1686
- to: f.to
1966
+ from: d.to - i,
1967
+ to: d.to
1687
1968
  }]);
1688
1969
  return {
1689
- changes: n,
1690
- range: e.range(n.mapPos(s.anchor), n.mapPos(s.head))
1970
+ changes: t,
1971
+ range: g.range(t.mapPos(o.anchor), t.mapPos(o.head))
1691
1972
  };
1692
1973
  }
1693
1974
  return {
1694
1975
  changes: [{
1695
- from: u,
1696
- insert: n
1976
+ from: l,
1977
+ insert: t
1697
1978
  }, {
1698
- from: d,
1699
- insert: n
1700
- }],
1701
- range: e.range(u + a, d + a),
1702
- effects: s.empty && s === i.selection.main && sn.has(r) ? un.of({
1703
1979
  from: u,
1704
- to: u + 2 * a,
1705
- name: r,
1706
- marker: n
1980
+ insert: t
1981
+ }],
1982
+ range: g.range(l + i, u + i),
1983
+ effects: o.empty && o === r.selection.main && bn.has(n) ? Cn.of({
1984
+ from: l,
1985
+ to: l + 2 * i,
1986
+ name: n,
1987
+ marker: t
1707
1988
  }) : void 0
1708
1989
  };
1709
- })), t.focus();
1990
+ })), e.focus();
1710
1991
  }
1711
- function xi(e, t) {
1992
+ function aa(e, t) {
1712
1993
  let n = e.text;
1713
1994
  if (t === n) return null;
1714
1995
  let r = 0;
@@ -1721,7 +2002,7 @@ function xi(e, t) {
1721
2002
  insert: t.slice(r, t.length - i)
1722
2003
  };
1723
2004
  }
1724
- function Si(e, t) {
2005
+ function oa(e, t) {
1725
2006
  if (t.length) {
1726
2007
  let { state: n } = e, r = n.changes(t), i = n.selection.main;
1727
2008
  e.dispatch({
@@ -1746,54 +2027,54 @@ function q(e, t) {
1746
2027
  if (e.state.readOnly) return;
1747
2028
  let { state: n } = e, { first: r, last: i } = K(e), a = [];
1748
2029
  for (let e = r; e <= i; e++) {
1749
- let r = n.doc.line(e), i = xi(r, t(r.text));
2030
+ let r = n.doc.line(e), i = aa(r, t(r.text));
1750
2031
  i && a.push(i);
1751
2032
  }
1752
- Si(e, a);
2033
+ oa(e, a);
1753
2034
  }
1754
- function Ci(e, t) {
2035
+ function sa(e, t) {
1755
2036
  let { first: n, last: r } = K(e);
1756
2037
  for (let i = n; i <= r; i++) if (!t(e.state.doc.line(i).text)) return !1;
1757
2038
  return !0;
1758
2039
  }
1759
- function wi(e, t) {
2040
+ function ca(e, t) {
1760
2041
  q(e, (e) => {
1761
2042
  let n = e.match(/^(#{1,6})\s+/), r = n ? n[1].length : 0, i = n ? e.slice(n[0].length) : e;
1762
2043
  return t === 0 || r === t ? i : `${"#".repeat(t)} ${i}`;
1763
2044
  });
1764
2045
  }
1765
- function Ti(e, t) {
2046
+ function la(e, t) {
1766
2047
  q(e, (e) => {
1767
2048
  let n = e.replace(/^#{1,6}\s+/, "");
1768
2049
  return t === 0 ? n : `${"#".repeat(t)} ${n}`;
1769
2050
  });
1770
2051
  }
1771
- function Ei(e) {
1772
- let t = /^(\s*)[-*+]\s+/, { loneBlank: n } = K(e), r = !n && Ci(e, (e) => t.test(e) || e.trim() === "");
2052
+ function ua(e) {
2053
+ let t = /^(\s*)[-*+]\s+/, { loneBlank: n } = K(e), r = !n && sa(e, (e) => t.test(e) || e.trim() === "");
1773
2054
  q(e, (e) => e.trim() === "" && !n ? e : r ? e.replace(t, "$1") : t.test(e) ? e : e.replace(/^(\s*)/, "$1- "));
1774
2055
  }
1775
- var Di = /^(\s*)[-*+]\s+\[[ xX]\]\s+/;
1776
- function Oi(e) {
1777
- let { loneBlank: t } = K(e), n = !t && Ci(e, (e) => Di.test(e) || e.trim() === "");
1778
- q(e, (e) => e.trim() === "" && !t ? e : n ? e.replace(Di, "$1- ") : Di.test(e) ? e : e.replace(J, "$1").replace(/^(\s*)/, "$1- [ ] "));
2056
+ var da = /^(\s*)[-*+]\s+\[[ xX]\]\s+/;
2057
+ function fa(e) {
2058
+ let { loneBlank: t } = K(e), n = !t && sa(e, (e) => da.test(e) || e.trim() === "");
2059
+ q(e, (e) => e.trim() === "" && !t ? e : n ? e.replace(da, "$1- ") : da.test(e) ? e : e.replace(J, "$1").replace(/^(\s*)/, "$1- [ ] "));
1779
2060
  }
1780
- var J = /^(\s*)(?:[-*+]|\d+[.)])(?:\s+|$)/, ki = /^(\s*)\[[ xX]\]\s+/;
1781
- function Ai(e, t) {
2061
+ var J = /^(\s*)(?:[-*+]|\d+[.)])(?:\s+|$)/, pa = /^(\s*)\[[ xX]\]\s+/;
2062
+ function ma(e, t) {
1782
2063
  if (e.state.readOnly) return;
1783
2064
  let { state: n } = e, { first: r, last: i, loneBlank: a } = K(e), o = [], s = 0;
1784
2065
  for (let e = r; e <= i; e++) {
1785
- let r = n.doc.line(e), i = r.text.replace(J, t === "none" ? "" : "$1"), c = i !== r.text, l = c ? i.replace(ki, t === "none" ? "" : "$1") : i, u = l;
2066
+ let r = n.doc.line(e), i = r.text.replace(J, t === "none" ? "" : "$1"), c = i !== r.text, l = c ? i.replace(pa, t === "none" ? "" : "$1") : i, u = l;
1786
2067
  if (t !== "none" && (l.trim() !== "" || c || a)) {
1787
2068
  s += 1;
1788
2069
  let e = t === "bullet" ? "- " : t === "task" ? "- [ ] " : `${s}. `;
1789
2070
  u = l.replace(/^(\s*)/, `$1${e}`);
1790
2071
  }
1791
- let d = xi(r, u);
2072
+ let d = aa(r, u);
1792
2073
  d && o.push(d);
1793
2074
  }
1794
- Si(e, o);
2075
+ oa(e, o);
1795
2076
  }
1796
- function ji(e, t, n) {
2077
+ function ha(e, t, n) {
1797
2078
  for (let r = t - 1; r >= 1; r--) {
1798
2079
  let t = e.doc.line(r).text;
1799
2080
  if (t.trim() === "") continue;
@@ -1803,13 +2084,13 @@ function ji(e, t, n) {
1803
2084
  }
1804
2085
  return null;
1805
2086
  }
1806
- function Mi(e) {
2087
+ function ga(e) {
1807
2088
  if (e.state.readOnly) return;
1808
2089
  let { state: t } = e, { from: n, to: r } = t.selection.main, i = t.doc.lineAt(n).number, a = t.doc.lineAt(r).number, o = [];
1809
2090
  for (let e = i; e <= a; e++) {
1810
2091
  let n = t.doc.line(e), r = n.text.match(J);
1811
2092
  if (!r) continue;
1812
- let i = r[1].length, a = ji(t, e, (e) => e <= i)?.[0].length ?? -1;
2093
+ let i = r[1].length, a = ha(t, e, (e) => e <= i)?.[0].length ?? -1;
1813
2094
  a > i && o.push({
1814
2095
  from: n.from,
1815
2096
  insert: " ".repeat(a - i)
@@ -1817,7 +2098,7 @@ function Mi(e) {
1817
2098
  }
1818
2099
  o.length && e.dispatch({ changes: o }), e.focus();
1819
2100
  }
1820
- function Ni(e) {
2101
+ function _a(e) {
1821
2102
  if (e.state.readOnly) return;
1822
2103
  let { state: t } = e, { from: n, to: r } = t.selection.main, i = t.doc.lineAt(n).number, a = t.doc.lineAt(r).number, o = [];
1823
2104
  for (let e = i; e <= a; e++) {
@@ -1825,7 +2106,7 @@ function Ni(e) {
1825
2106
  if (!r) continue;
1826
2107
  let i = r[1].length;
1827
2108
  if (i === 0) continue;
1828
- let a = ji(t, e, (e) => e < i)?.[1].length ?? 0;
2109
+ let a = ha(t, e, (e) => e < i)?.[1].length ?? 0;
1829
2110
  o.push({
1830
2111
  from: n.from,
1831
2112
  to: n.from + (i - a)
@@ -1833,23 +2114,23 @@ function Ni(e) {
1833
2114
  }
1834
2115
  o.length && e.dispatch({ changes: o }), e.focus();
1835
2116
  }
1836
- function Pi(e) {
2117
+ function va(e) {
1837
2118
  let { state: t } = e, n = t.doc.lineAt(t.selection.main.head), r = n.text.match(J);
1838
2119
  if (!r) return !1;
1839
- let i = r[1].length, a = ji(t, n.number, (e) => e <= i);
2120
+ let i = r[1].length, a = ha(t, n.number, (e) => e <= i);
1840
2121
  return a !== null && a[0].length > i;
1841
2122
  }
1842
- function Fi(e) {
2123
+ function ya(e) {
1843
2124
  let t = e.state.doc.lineAt(e.state.selection.main.head).text.match(J);
1844
2125
  return !!t && t[1].length > 0;
1845
2126
  }
1846
- function Ii(e) {
2127
+ function ba(e) {
1847
2128
  if (e.state.readOnly) return !0;
1848
2129
  let { state: t } = e, n = t.selection.main;
1849
2130
  if (!n.empty) return !1;
1850
2131
  let r = t.doc.lineAt(n.head), i = r.text.match(/^(\s*)(?:\d+[.)]|[-*+])\s/);
1851
- if (!i || n.head !== r.from + i[0].length || D(t, r.from)) return !1;
1852
- let a = i[1].length, o = a > 0 ? P(t, r.number).find((e) => e.markerCol < a) : void 0;
2132
+ if (!i || n.head !== r.from + i[0].length || Re(t, r.from)) return !1;
2133
+ let a = i[1].length, o = a > 0 ? F(t, r.number).find((e) => e.markerCol < a) : void 0;
1853
2134
  if (o) {
1854
2135
  let t = r.from + a, i = " ".repeat(o.markerCol);
1855
2136
  return e.dispatch({
@@ -1871,40 +2152,40 @@ function Ii(e) {
1871
2152
  userEvent: "delete.backward"
1872
2153
  }), !0;
1873
2154
  }
1874
- function Li(e) {
1875
- let t = /^(\s*)>\s?/, n = Ci(e, (e) => t.test(e) || e.trim() === "");
2155
+ function xa(e) {
2156
+ let t = /^(\s*)>\s?/, n = sa(e, (e) => t.test(e) || e.trim() === "");
1876
2157
  q(e, (e) => e.trim() === "" ? e : n ? e.replace(t, "$1") : t.test(e) ? e : e.replace(/^(\s*)/, "$1> "));
1877
2158
  }
1878
- function Ri(e, t) {
2159
+ function Sa(e, t) {
1879
2160
  let n = W(e, t, "Link");
1880
- return n && !A(e.state, n) ? n : null;
2161
+ return n && !O(e.state, n) ? n : null;
1881
2162
  }
1882
- function zi(t, n = "") {
1883
- if (t.state.readOnly) return;
1884
- let r = Ri(t, t.state.selection.main.head);
1885
- if (r) {
1886
- let n = t.state.sliceDoc(r.from, r.to).replace(/^\[(.*)\]\([^)]*\)$/, "$1");
1887
- t.dispatch({
2163
+ function Ca(e, t = "") {
2164
+ if (e.state.readOnly) return;
2165
+ let n = Sa(e, e.state.selection.main.head);
2166
+ if (n) {
2167
+ let t = e.state.sliceDoc(n.from, n.to).replace(/^\[(.*)\]\([^)]*\)$/, "$1");
2168
+ e.dispatch({
1888
2169
  changes: {
1889
- from: r.from,
1890
- to: r.to,
1891
- insert: n
2170
+ from: n.from,
2171
+ to: n.to,
2172
+ insert: t
1892
2173
  },
1893
- selection: e.range(r.from, r.from + n.length)
1894
- }), t.focus();
1895
- } else t.dispatch(t.state.changeByRange((r) => {
1896
- let i = t.state.sliceDoc(r.from, r.to), a = `[${i}](${n})`, o;
1897
- return o = i ? n ? r.from + a.length : r.from + 1 + i.length + 2 : r.from + 1, {
2174
+ selection: g.range(n.from, n.from + t.length)
2175
+ }), e.focus();
2176
+ } else e.dispatch(e.state.changeByRange((n) => {
2177
+ let r = e.state.sliceDoc(n.from, n.to), i = `[${r}](${t})`, a;
2178
+ return a = r ? t ? n.from + i.length : n.from + 1 + r.length + 2 : n.from + 1, {
1898
2179
  changes: {
1899
- from: r.from,
1900
- to: r.to,
1901
- insert: a
2180
+ from: n.from,
2181
+ to: n.to,
2182
+ insert: i
1902
2183
  },
1903
- range: e.cursor(o)
2184
+ range: g.cursor(a)
1904
2185
  };
1905
- })), t.focus();
2186
+ })), e.focus();
1906
2187
  }
1907
- function Bi(e) {
2188
+ function wa(e) {
1908
2189
  if (e.state.readOnly) return;
1909
2190
  let { state: t } = e, { from: n, to: r } = t.selection.main, i = t.doc.lineAt(n), a = t.doc.lineAt(r), o = i.number > 1 ? t.doc.line(i.number - 1) : null, s = a.number < t.doc.lines ? t.doc.line(a.number + 1) : null;
1910
2191
  o?.text.trim().startsWith("```") && s?.text.trim().startsWith("```") && o && s ? e.dispatch({ changes: [{
@@ -1921,27 +2202,28 @@ function Bi(e) {
1921
2202
  insert: "\n```"
1922
2203
  }] }), e.focus();
1923
2204
  }
1924
- function Vi(e) {
1925
- let { state: t } = e, n = t.selection.main.head, r = t.field(N, !1), i = (t) => bi(e, n, t) !== null || r?.name === t, a = t.doc.lineAt(n).text, o = t.doc.lineAt(n).from, s = a.match(/^(#{1,6})\s/), c = D(t, o);
2205
+ function Ta(e) {
2206
+ let { state: t } = e, n = t.selection.main.head, r = t.field(M, !1), i = (t) => ia(e, n, t) !== null || r?.name === t, a = t.doc.lineAt(n).text, o = t.doc.lineAt(n).from, s = a.match(/^(#{1,6})\s/), c = Re(t, o);
1926
2207
  return {
1927
2208
  bold: i("StrongEmphasis"),
1928
2209
  italic: i("Emphasis"),
1929
2210
  inlineCode: i("InlineCode"),
1930
2211
  codeBlock: c,
1931
2212
  strikethrough: i("Strikethrough"),
1932
- link: Ri(e, n) !== null,
1933
- bulletList: !c && /^\s*[-*+]\s/.test(a) && !Re(t, o),
2213
+ highlight: i("Highlight"),
2214
+ link: Sa(e, n) !== null,
2215
+ bulletList: !c && /^\s*[-*+]\s/.test(a) && !Ve(t, o),
1934
2216
  orderedList: !c && /^\s*\d+[.)]\s/.test(a),
1935
- taskList: !c && Di.test(a),
2217
+ taskList: !c && da.test(a),
1936
2218
  quote: W(e, o, "Blockquote") !== null,
1937
2219
  heading: c || !s ? 0 : s[1].length
1938
2220
  };
1939
2221
  }
1940
2222
  // src/components/inputs/text-editor/text-editor.keymap.ts
1941
- var Hi = [y.highest(n.of([{
2223
+ var Ea = [v.highest(l.of([{
1942
2224
  key: "Backspace",
1943
- run: Ii
1944
- }])), n.of([
2225
+ run: ba
2226
+ }])), l.of([
1945
2227
  {
1946
2228
  key: "Mod-b",
1947
2229
  run: (e) => (G(e, "**", "StrongEmphasis"), !0)
@@ -1956,37 +2238,37 @@ var Hi = [y.highest(n.of([{
1956
2238
  },
1957
2239
  {
1958
2240
  key: "Mod-k",
1959
- run: (e) => (zi(e), !0)
2241
+ run: (e) => (Ca(e), !0)
1960
2242
  },
1961
2243
  {
1962
2244
  key: "Backspace",
1963
- run: (e) => it(e, -1)
2245
+ run: (e) => st(e, -1)
1964
2246
  },
1965
2247
  {
1966
2248
  key: "Delete",
1967
- run: (e) => it(e, 1)
2249
+ run: (e) => st(e, 1)
1968
2250
  },
1969
2251
  {
1970
2252
  key: "Mod-]",
1971
- run: (e) => (Mi(e), !0)
2253
+ run: (e) => (ga(e), !0)
1972
2254
  },
1973
2255
  {
1974
2256
  key: "Mod-[",
1975
- run: (e) => (Ni(e), !0)
2257
+ run: (e) => (_a(e), !0)
1976
2258
  },
1977
2259
  {
1978
2260
  key: "Backspace",
1979
- run: (e) => !Dr(e, "Backspace") && me(e),
1980
- shift: me
2261
+ run: (e) => !di(e, "Backspace") && ge(e),
2262
+ shift: ge
1981
2263
  },
1982
2264
  {
1983
2265
  key: "Delete",
1984
- run: (e) => !Dr(e, "Delete") && ue(e)
2266
+ run: (e) => !di(e, "Delete") && fe(e)
1985
2267
  },
1986
- ...fe.filter((e) => e.key !== "Backspace" && e.key !== "Delete"),
1987
- ...pe
1988
- ])], Ui = /^(\s*)(\d+)[.)](?=\s|$)/, Wi = /^(?:[ ]{0,3}>[ ]?)*/, Gi = /^\s*(?:```|~~~)/, Ki = /^\s*[-*+]\s+\S/, qi = /^\s*(?:#{1,6}(?:\s|$)|[-*+](?:\s|$)|(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$)/, Ji = 1e3;
1989
- function Yi(e) {
2268
+ ...me.filter((e) => e.key !== "Backspace" && e.key !== "Delete"),
2269
+ ...he
2270
+ ])], Da = /^(\s*)(\d+)[.)](?=\s|$)/, Oa = /^(?:[ ]{0,3}>[ ]?)*/, ka = /^\s*(?:```|~~~)/, Aa = /^\s*[-*+]\s+\S/, ja = /^\s*(?:#{1,6}(?:\s|$)|[-*+](?:\s|$)|(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$)/, Ma = 1e3;
2271
+ function Na(e) {
1990
2272
  let t = [], n = [], r = (e) => {
1991
2273
  let t = 0;
1992
2274
  for (; t < n.length && e >= n[t].content;) t++;
@@ -1994,53 +2276,53 @@ function Yi(e) {
1994
2276
  }, i = 0, a = !1, o = 0, s = -1;
1995
2277
  for (let c of e.split("\n")) {
1996
2278
  let e = i;
1997
- if (i += c.length + 1, Gi.test(c)) {
2279
+ if (i += c.length + 1, ka.test(c)) {
1998
2280
  a = !a, n.length = 0, o = 0, s = -1;
1999
2281
  continue;
2000
2282
  }
2001
2283
  if (a) continue;
2002
- let l = Wi.exec(c)[0], u = c.slice(l.length), d = (l.match(/>/g) ?? []).length, f = Ui.exec(u);
2284
+ let l = Oa.exec(c)[0], u = c.slice(l.length), d = (l.match(/>/g) ?? []).length, f = Da.exec(u);
2003
2285
  if (f) {
2004
- let e = d * Ji + f[1].length, t = r(e);
2005
- e - Math.max(t > 0 ? n[t - 1].content : 0, d * Ji) >= 4 && (f = null);
2286
+ let e = d * Ma + f[1].length, t = r(e);
2287
+ e - Math.max(t > 0 ? n[t - 1].content : 0, d * Ma) >= 4 && (f = null);
2006
2288
  }
2007
2289
  if (!f) {
2008
2290
  if (u.trim() === "") {
2009
2291
  ++o >= 2 && (n.length = 0), s = -1;
2010
2292
  continue;
2011
2293
  }
2012
- if (o = 0, s >= d && n.length && !qi.test(u)) continue;
2013
- s = Ki.test(u) ? d : -1, n.length = r(d * Ji + /^\s*/.exec(u)[0].length);
2294
+ if (o = 0, s >= d && n.length && !ja.test(u)) continue;
2295
+ s = Aa.test(u) ? d : -1, n.length = r(d * Ma + /^\s*/.exec(u)[0].length);
2014
2296
  continue;
2015
2297
  }
2016
2298
  o = 0, s = u.slice(f[0].length).trim() === "" ? -1 : d;
2017
- let p = f[1].length, m = d * Ji + p, h = f[2], g = /^ */.exec(u.slice(f[0].length))[0].length, _ = m + f[0].length - p + (g >= 1 && g <= 4 ? g : 1), v = r(m), ee;
2299
+ let p = f[1].length, m = d * Ma + p, h = f[2], g = /^ */.exec(u.slice(f[0].length))[0].length, _ = m + f[0].length - p + (g >= 1 && g <= 4 ? g : 1), v = r(m), y;
2018
2300
  if (v < n.length) {
2019
2301
  n.length = v + 1;
2020
2302
  let e = n[v];
2021
- ee = e.next, e.next += 1, e.indent = m, e.content = _;
2022
- } else ee = 1, n.push({
2303
+ y = e.next, e.next += 1, e.indent = m, e.content = _;
2304
+ } else y = 1, n.push({
2023
2305
  indent: m,
2024
2306
  content: _,
2025
2307
  next: 2
2026
2308
  });
2027
- let te = String(ee);
2028
- if (te !== h) {
2309
+ let b = String(y);
2310
+ if (b !== h) {
2029
2311
  let n = e + l.length + p;
2030
2312
  t.push({
2031
2313
  from: n,
2032
2314
  to: n + h.length,
2033
- insert: te
2315
+ insert: b
2034
2316
  });
2035
2317
  }
2036
2318
  }
2037
2319
  return t;
2038
2320
  }
2039
- function Xi(e) {
2040
- let t = Wi.exec(e)[0], n = e.slice(t.length);
2041
- return n.trim() === "" ? "blank" : Ui.test(n) ? "ordered" : qi.test(n) || Gi.test(n) ? "block" : `plain${(t.match(/>/g) ?? []).length}`;
2321
+ function Pa(e) {
2322
+ let t = Oa.exec(e)[0], n = e.slice(t.length);
2323
+ return n.trim() === "" ? "blank" : Da.test(n) ? "ordered" : ja.test(n) || ka.test(n) ? "block" : `plain${(t.match(/>/g) ?? []).length}`;
2042
2324
  }
2043
- function Zi(e) {
2325
+ function Fa(e) {
2044
2326
  let t = !1;
2045
2327
  return e.changes.iterChanges((n, r, i, a, o) => {
2046
2328
  if (t) return;
@@ -2049,27 +2331,27 @@ function Zi(e) {
2049
2331
  t = !0;
2050
2332
  return;
2051
2333
  }
2052
- let c = (e) => Xi(e) === "ordered", l = s.lineAt(n).text, u = e.newDoc.lineAt(i).text;
2053
- (c(l) || c(u) || c(e.newDoc.lineAt(a).text) || Xi(l) !== Xi(u)) && (t = !0);
2334
+ let c = (e) => Pa(e) === "ordered", l = s.lineAt(n).text, u = e.newDoc.lineAt(i).text;
2335
+ (c(l) || c(u) || c(e.newDoc.lineAt(a).text) || Pa(l) !== Pa(u)) && (t = !0);
2054
2336
  }), t;
2055
2337
  }
2056
- var Qi = g.transactionFilter.of((e) => {
2057
- if (e.annotation(S.remote) || !e.docChanged || !Zi(e)) return e;
2058
- let t = Yi(e.newDoc.toString());
2338
+ var Ia = re.transactionFilter.of((e) => {
2339
+ if (e.annotation(h.remote) || !e.docChanged || !Fa(e)) return e;
2340
+ let t = Na(e.newDoc.toString());
2059
2341
  return t.length === 0 ? e : [e, {
2060
2342
  changes: t,
2061
2343
  sequential: !0
2062
2344
  }];
2063
- }), $i = b.define(), ea = h.define({
2345
+ }), La = m.define(), Ra = b.define({
2064
2346
  create: () => null,
2065
2347
  update(e, t) {
2066
- for (let e of t.effects) if (e.is($i)) return e.value;
2348
+ for (let e of t.effects) if (e.is(La)) return e.value;
2067
2349
  return e === null ? null : t.changes.mapPos(e);
2068
2350
  }
2069
- }), ta = class {
2351
+ }), za = class {
2070
2352
  constructor(e) {
2071
2353
  this.view = e, this.cursor = null, this.readPos = () => {
2072
- let e = this.view.state.field(ea);
2354
+ let e = this.view.state.field(Ra);
2073
2355
  if (e === null) return null;
2074
2356
  let t = this.view.coordsAtPos(e, 1);
2075
2357
  if (!t) return null;
@@ -2084,8 +2366,8 @@ var Qi = g.transactionFilter.of((e) => {
2084
2366
  };
2085
2367
  }
2086
2368
  update(e) {
2087
- let t = e.state.field(ea);
2088
- t === null ? this.remove() : (e.startState.field(ea) !== t || e.docChanged || e.geometryChanged) && this.view.requestMeasure({
2369
+ let t = e.state.field(Ra);
2370
+ t === null ? this.remove() : (e.startState.field(Ra) !== t || e.docChanged || e.geometryChanged) && this.view.requestMeasure({
2089
2371
  read: this.readPos,
2090
2372
  write: this.drawCursor
2091
2373
  });
@@ -2096,7 +2378,7 @@ var Qi = g.transactionFilter.of((e) => {
2096
2378
  destroy() {
2097
2379
  this.remove();
2098
2380
  }
2099
- }, na = c.fromClass(ta), ra = class {
2381
+ }, Ba = n.fromClass(za), Va = class {
2100
2382
  constructor(e) {
2101
2383
  this.view = e, this.state = null, this.ghost = null, this.onMove = (e) => {
2102
2384
  let t = this.state;
@@ -2110,11 +2392,11 @@ var Qi = g.transactionFilter.of((e) => {
2110
2392
  x: e.clientX,
2111
2393
  y: e.clientY
2112
2394
  }) : null, r = n === null || n >= t.from && n <= t.to ? null : n;
2113
- this.view.dispatch({ effects: $i.of(r) });
2395
+ this.view.dispatch({ effects: La.of(r) });
2114
2396
  }, this.onUp = (e) => {
2115
2397
  this.removeListeners(), this.view.scrollDOM.style.cursor = "", this.clearGhost();
2116
2398
  let t = this.state;
2117
- if (this.state = null, this.view.dispatch({ effects: $i.of(null) }), !t) return;
2399
+ if (this.state = null, this.view.dispatch({ effects: La.of(null) }), !t) return;
2118
2400
  let n = this.view.posAtCoords({
2119
2401
  x: e.clientX,
2120
2402
  y: e.clientY
@@ -2135,7 +2417,7 @@ var Qi = g.transactionFilter.of((e) => {
2135
2417
  anchor: i,
2136
2418
  head: i + r.length
2137
2419
  },
2138
- effects: Lr.of({
2420
+ effects: xi.of({
2139
2421
  from: a,
2140
2422
  to: o,
2141
2423
  insertAt: c
@@ -2185,7 +2467,7 @@ var Qi = g.transactionFilter.of((e) => {
2185
2467
  }
2186
2468
  showGhost(e, t) {
2187
2469
  let n = document.createElement("div");
2188
- n.className = "cm-drag-ghost", n.textContent = z(this.view.state.sliceDoc(e, t)).replace(Ge, "$1"), this.view.dom.appendChild(n), this.ghost = n;
2470
+ n.className = "cm-drag-ghost", n.textContent = z(this.view.state.sliceDoc(e, t)).replace(Je, "$1"), this.view.dom.appendChild(n), this.ghost = n;
2189
2471
  }
2190
2472
  moveGhost(e, t) {
2191
2473
  this.ghost && (this.ghost.style.left = `${e + 12}px`, this.ghost.style.top = `${t + 12}px`);
@@ -2196,87 +2478,87 @@ var Qi = g.transactionFilter.of((e) => {
2196
2478
  destroy() {
2197
2479
  this.removeListeners(), this.clearGhost();
2198
2480
  }
2199
- }, ia = c.fromClass(ra, { eventHandlers: { mousedown(e) {
2481
+ }, Ha = n.fromClass(Va, { eventHandlers: { mousedown(e) {
2200
2482
  return this.start(e);
2201
- } } }), aa = [
2202
- ea,
2203
- na,
2204
- ia
2205
- ], oa = 2, sa = /* @__PURE__ */ new WeakMap(), ca = f.define(), la = /* @__PURE__ */ new WeakMap();
2206
- function ua(e, t) {
2483
+ } } }), Ua = [
2484
+ Ra,
2485
+ Ba,
2486
+ Ha
2487
+ ], Wa = 2, Ga = /* @__PURE__ */ new WeakMap(), Ka = d.define(), qa = /* @__PURE__ */ new WeakMap();
2488
+ function Ja(e, t) {
2207
2489
  let n = e.coordsAtPos(t, -1), r = e.coordsAtPos(t, 1);
2208
2490
  return n && r ? {
2209
2491
  before: n,
2210
2492
  after: r
2211
2493
  } : null;
2212
2494
  }
2213
- var da = 8;
2214
- function fa(e) {
2215
- return Math.abs(e.before.top - e.after.top) < da;
2495
+ var Ya = 8;
2496
+ function Xa(e) {
2497
+ return Math.abs(e.before.top - e.after.top) < Ya;
2216
2498
  }
2217
- function pa(e, t, n) {
2218
- let r = ua(e, t);
2219
- if (r && fa(r) && Math.abs(r.before.left - r.after.left) <= oa) return 1;
2220
- let i = sa.get(e);
2499
+ function Za(e, t, n) {
2500
+ let r = Ja(e, t);
2501
+ if (r && Xa(r) && Math.abs(r.before.left - r.after.left) <= Wa) return 1;
2502
+ let i = Ga.get(e);
2221
2503
  if (i && i.head === t) {
2222
2504
  if (i.side !== "pointer") return i.side;
2223
- let t = la.get(e);
2505
+ let t = qa.get(e);
2224
2506
  if (t && r) return Math.abs(t.x - r.before.left) <= Math.abs(t.x - r.after.left) ? -1 : 1;
2225
2507
  }
2226
2508
  return n && n < 0 ? -1 : 1;
2227
2509
  }
2228
- var ma = _.domEventHandlers({
2510
+ var Qa = o.domEventHandlers({
2229
2511
  mousedown(e, t) {
2230
- return la.set(t, {
2512
+ return qa.set(t, {
2231
2513
  x: e.clientX,
2232
2514
  y: e.clientY
2233
2515
  }), !1;
2234
2516
  },
2235
2517
  mousemove(e, t) {
2236
- return e.buttons && la.set(t, {
2518
+ return e.buttons && qa.set(t, {
2237
2519
  x: e.clientX,
2238
2520
  y: e.clientY
2239
2521
  }), !1;
2240
2522
  },
2241
2523
  touchstart(e, t) {
2242
2524
  let n = e.touches[0];
2243
- return n && la.set(t, {
2525
+ return n && qa.set(t, {
2244
2526
  x: n.clientX,
2245
2527
  y: n.clientY
2246
2528
  }), !1;
2247
2529
  }
2248
2530
  });
2249
- function ha(t) {
2250
- return (n) => {
2251
- let { main: r } = n.state.selection;
2252
- return !r.empty || !an(n.state, r.head) || !ua(n, r.head) || pa(n, r.head, r.assoc) === t ? !1 : (n.dispatch({
2253
- selection: e.cursor(r.head, t),
2254
- annotations: ca.of(t),
2531
+ function $a(e) {
2532
+ return (t) => {
2533
+ let { main: n } = t.state.selection;
2534
+ return !n.empty || !vn(t.state, n.head) || !Ja(t, n.head) || Za(t, n.head, n.assoc) === e ? !1 : (t.dispatch({
2535
+ selection: g.cursor(n.head, e),
2536
+ annotations: Ka.of(e),
2255
2537
  userEvent: "select"
2256
2538
  }), !0);
2257
2539
  };
2258
2540
  }
2259
- var ga = y.high(n.of([
2541
+ var eo = v.high(l.of([
2260
2542
  {
2261
2543
  key: "ArrowLeft",
2262
- run: ha(-1)
2544
+ run: $a(-1)
2263
2545
  },
2264
2546
  {
2265
2547
  key: "ArrowRight",
2266
- run: ha(1)
2548
+ run: $a(1)
2267
2549
  },
2268
2550
  {
2269
2551
  key: "Backspace",
2270
- run: ha(-1)
2552
+ run: $a(-1)
2271
2553
  },
2272
2554
  {
2273
2555
  key: "Delete",
2274
- run: ha(1)
2556
+ run: $a(1)
2275
2557
  }
2276
- ])), _a = /^[\s<?!.,:*_~)]/, va = _.inputHandler.of((e, t, n, r) => {
2277
- if (t !== n || !r || e.composing || _a.test(r)) return !1;
2558
+ ])), to = /^[\s<?!.,:*_~)]/, no = o.inputHandler.of((e, t, n, r) => {
2559
+ if (t !== n || !r || e.composing || to.test(r)) return !1;
2278
2560
  let { main: i } = e.state.selection;
2279
- return !i.empty || i.head !== t || !on(e.state, t) || !ua(e, t) || pa(e, t, i.assoc) !== 1 ? !1 : (e.dispatch({
2561
+ return !i.empty || i.head !== t || !yn(e.state, t) || !Ja(e, t) || Za(e, t, i.assoc) !== 1 ? !1 : (e.dispatch({
2280
2562
  changes: {
2281
2563
  from: t,
2282
2564
  insert: ` ${r}`
@@ -2285,27 +2567,27 @@ var ga = y.high(n.of([
2285
2567
  userEvent: "input.type",
2286
2568
  scrollIntoView: !0
2287
2569
  }), !0);
2288
- }), ya = [
2289
- d({
2570
+ }), ro = [
2571
+ u({
2290
2572
  above: !0,
2291
2573
  class: "cm-nldd-cursorLayer",
2292
- markers(t) {
2293
- let { state: n } = t, r = u(n), i = [];
2294
- for (let a of n.selection.ranges) {
2295
- if (!a.empty && !r.drawRangeCursor) continue;
2296
- let s = a === n.selection.main ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary", c = e.cursor(a.head, pa(t, a.head, a.assoc));
2297
- i.push(...o.forRange(t, s, c));
2574
+ markers(e) {
2575
+ let { state: t } = e, n = ie(t), r = [];
2576
+ for (let i of t.selection.ranges) {
2577
+ if (!i.empty && !n.drawRangeCursor) continue;
2578
+ let a = i === t.selection.main ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary", o = g.cursor(i.head, Za(e, i.head, i.assoc));
2579
+ r.push(...s.forRange(e, a, o));
2298
2580
  }
2299
- return i;
2581
+ return r;
2300
2582
  },
2301
2583
  update(e, t) {
2302
2584
  if (e.docChanged || e.selectionSet) {
2303
- let { view: t } = e, n = e.state.selection.main.head, r = sa.get(t), i = r ? {
2585
+ let { view: t } = e, n = e.state.selection.main.head, r = Ga.get(t), i = r ? {
2304
2586
  ...r,
2305
2587
  head: e.changes.mapPos(r.head)
2306
2588
  } : null, a = e.startState.selection.main.head;
2307
2589
  for (let t of e.transactions) {
2308
- let r = t.annotation(ca);
2590
+ let r = t.annotation(Ka);
2309
2591
  if (r) i = {
2310
2592
  head: n,
2311
2593
  side: r
@@ -2315,34 +2597,34 @@ var ga = y.high(n.of([
2315
2597
  side: "pointer"
2316
2598
  };
2317
2599
  else if (t.isUserEvent("input") || t.isUserEvent("delete.backward")) {
2318
- let r = t.isUserEvent("input") && on(e.state, n);
2600
+ let r = t.isUserEvent("input") && yn(e.state, n);
2319
2601
  i = {
2320
2602
  head: n,
2321
- side: an(e.state, n) && !an(e.startState, a) && !r ? 1 : -1
2603
+ side: vn(e.state, n) && !vn(e.startState, a) && !r ? 1 : -1
2322
2604
  };
2323
2605
  } else t.isUserEvent("delete.forward") ? i = {
2324
2606
  head: n,
2325
2607
  side: 1
2326
2608
  } : t.selection && (i = null);
2327
2609
  }
2328
- i ? sa.set(t, i) : sa.delete(t);
2610
+ i ? Ga.set(t, i) : Ga.delete(t);
2329
2611
  }
2330
2612
  return e.transactions.some((e) => e.selection) && (t.style.animationName = t.style.animationName === "cm-blink" ? "cm-blink2" : "cm-blink"), e.docChanged || e.selectionSet;
2331
2613
  },
2332
2614
  mount(e, t) {
2333
- e.style.animationDuration = `${u(t.state).cursorBlinkRate}ms`;
2615
+ e.style.animationDuration = `${ie(t.state).cursorBlinkRate}ms`;
2334
2616
  }
2335
2617
  }),
2336
- ma,
2337
- ga,
2338
- va
2618
+ Qa,
2619
+ eo,
2620
+ no
2339
2621
  ];
2340
2622
  // src/components/inputs/text-editor/text-editor.selection.ts
2341
- function ba(e) {
2623
+ function io(e) {
2342
2624
  let t = e.dom.querySelector(".cm-selectionLayer");
2343
2625
  if (!t) return;
2344
2626
  let n = e.defaultLineHeight, r = e.contentDOM, i = r.getBoundingClientRect().right - (parseFloat(getComputedStyle(r).paddingRight) || 0);
2345
- xa([...t.querySelectorAll(".cm-selectionBackground")].map((t) => {
2627
+ ao([...t.querySelectorAll(".cm-selectionBackground")].map((t) => {
2346
2628
  let r = t.getBoundingClientRect();
2347
2629
  if (r.height >= n * 1.25) return {
2348
2630
  piece: t,
@@ -2371,17 +2653,17 @@ function ba(e) {
2371
2653
  return Math.abs(c - s) > .25 && (e.style.top = `${c}px`, o.top = t.top + (c - s)), Math.abs(t.height - n) > .25 && (e.style.height = `${n}px`, o.height = n), o;
2372
2654
  }), n);
2373
2655
  }
2374
- function xa(e, t) {
2656
+ function ao(e, t) {
2375
2657
  let n = e.toSorted((e, t) => e.top - t.top);
2376
2658
  for (let e = 1; e < n.length; e++) {
2377
2659
  let r = n[e - 1], i = n[e].top - (r.top + r.height);
2378
2660
  i > .25 && i < t / 2 && (r.piece.style.height = `${r.height + i}px`);
2379
2661
  }
2380
2662
  }
2381
- var Sa = class {
2663
+ var oo = class {
2382
2664
  constructor(e) {
2383
2665
  this.view = e, this.observer = new MutationObserver(() => {
2384
- ba(this.view), this.observer.takeRecords();
2666
+ io(this.view), this.observer.takeRecords();
2385
2667
  }), this.observing = !1, queueMicrotask(() => this.observe());
2386
2668
  }
2387
2669
  update() {
@@ -2399,18 +2681,17 @@ var Sa = class {
2399
2681
  destroy() {
2400
2682
  this.observer.disconnect();
2401
2683
  }
2402
- }, Ca = c.fromClass(Sa), wa = ie`
2684
+ }, so = n.fromClass(oo), co = oe`
2403
2685
 
2404
2686
 
2405
2687
  /* # Host */
2406
2688
 
2407
2689
  :host {
2408
- --_text-editor-caret-width: var(--primitives-border-width-regular);
2409
- --_text-editor-caret-color: var(--components-text-editor-caret-color);
2690
+ --_text-editor-caret-width: var(--semantics-input-fields-caret-width);
2691
+ --_text-editor-caret-color: var(--semantics-input-fields-caret-color);
2410
2692
  --_text-editor-drop-cursor-color: var(--components-text-editor-drop-cursor-color);
2411
2693
  --_text-editor-drag-ghost-background-color: var(--components-text-editor-drag-ghost-background-color);
2412
- --_text-editor-caret-ring-width: var(--primitives-border-width-thin);
2413
- --_text-editor-caret-ring-color: var(--semantics-surfaces-base-background-color);
2694
+ --_text-editor-drop-cursor-ring-color: var(--semantics-surfaces-base-background-color);
2414
2695
  --_text-editor-corner-radius: var(--primitives-corner-radius-lg);
2415
2696
  --_text-editor-background-color: var(--semantics-input-fields-background-color);
2416
2697
  --_text-editor-toolbar-background-color: var(--_text-editor-background-color);
@@ -2426,6 +2707,11 @@ var Sa = class {
2426
2707
  --_text-editor-padding-block: var(--semantics-controls-md-inline-padding);
2427
2708
  --_text-editor-padding-inline: var(--semantics-controls-md-inline-padding);
2428
2709
  --_text-editor-content-color: var(--semantics-content-color);
2710
+ --_text-editor-highlight-background-color: var(--semantics-content-mark-background-color);
2711
+ --_text-editor-highlight-color: var(--semantics-content-mark-color);
2712
+ --_text-editor-highlight-bare-inline-padding: var(--primitives-space-2);
2713
+ --_text-editor-highlight-is-selected-background-color: light-dark(var(--primitives-color-mark-200), var(--primitives-color-mark-400));
2714
+ --_text-editor-highlight-is-selected-color: var(--primitives-color-neutral-950);
2429
2715
  --_text-editor-mark-color: var(--semantics-content-secondary-color);
2430
2716
  --_text-editor-link-color: var(--semantics-links-color);
2431
2717
  --_text-editor-strong-font-weight: var(--primitives-font-weight-body-bold);
@@ -2513,6 +2799,11 @@ var Sa = class {
2513
2799
  --_text-editor-mention-token-content-color: var(--semantics-mentions-content-color);
2514
2800
  --_text-editor-mention-token-is-selected-background-color: var(--semantics-mentions-is-selected-background-color);
2515
2801
  --_text-editor-mention-token-is-selected-content-color: var(--semantics-mentions-is-selected-content-color);
2802
+ --_text-editor-variable-token-background-color: var(--semantics-surfaces-tinted-background-color);
2803
+ --_text-editor-variable-token-highlight-border-color: var(--semantics-surfaces-tinted-highlight-border-color);
2804
+ --_text-editor-variable-token-content-color: var(--semantics-content-color);
2805
+ --_text-editor-variable-token-empty-content-color: var(--semantics-content-secondary-color);
2806
+ --_text-editor-variable-token-is-selected-background-color: var(--_text-editor-code-token-is-selected-background-color);
2516
2807
  --_text-editor-rows: 6;
2517
2808
  --_text-editor-popup-corner-radius: var(--semantics-overlays-corner-radius);
2518
2809
  --_text-editor-popup-background-color: var(--semantics-surfaces-base-background-color);
@@ -2520,6 +2811,7 @@ var Sa = class {
2520
2811
  --_text-editor-popup-font-family: var(--primitives-font-family-body);
2521
2812
  --_text-editor-popup-font-size: var(--primitives-font-size-100);
2522
2813
  --_text-editor-popup-min-width: var(--primitives-area-280);
2814
+ --_text-editor-popup-max-width: var(--primitives-area-400);
2523
2815
  --_text-editor-popup-max-height: 14em;
2524
2816
  --_text-editor-popup-padding: var(--primitives-space-8);
2525
2817
  --_text-editor-popup-row-min-height: var(--semantics-controls-sm-min-size);
@@ -2542,7 +2834,7 @@ var Sa = class {
2542
2834
  --_text-editor-popup-message-padding-inline: var(--primitives-space-16);
2543
2835
  --_text-editor-popup-message-color: var(--semantics-content-secondary-color);
2544
2836
 
2545
- ${Ae}
2837
+ ${Me}
2546
2838
  display: flex;
2547
2839
  isolation: isolate;
2548
2840
  min-height: 0;
@@ -2585,9 +2877,9 @@ var Sa = class {
2585
2877
  --_text-editor-toolbar-padding: 0px;
2586
2878
  --_text-editor-stuck-gap: var(--_text-editor-toolbar-gap);
2587
2879
  --_text-editor-padding-block: 0px;
2588
- /* Room for the caret's own ink at the first and last position of a line:
2589
- its width plus its ring. Without it the edge carets are clipped. */
2590
- --_text-editor-padding-inline: calc(var(--_text-editor-caret-width) + var(--_text-editor-caret-ring-width));
2880
+ /* Room for the caret's own ink at the first and last position of a line.
2881
+ Without it the edge carets are clipped. */
2882
+ --_text-editor-padding-inline: var(--_text-editor-caret-width);
2591
2883
  }
2592
2884
 
2593
2885
 
@@ -2728,10 +3020,6 @@ var Sa = class {
2728
3020
  /* CodeMirror centers its own 1.2px caret with a -0.6px margin. Ours is wider,
2729
3021
  so recenter it on the insertion point from its own width. */
2730
3022
  margin-left: calc(var(--_text-editor-caret-width) / -2);
2731
- /* A thin surface-colored ring, like the drop cursor, so the caret stays legible
2732
- even over a tinted token (annotation, inline code) where the accent alone can
2733
- blend in. Blinks with the caret (opacity covers the shadow too). */
2734
- box-shadow: 0 0 0 var(--_text-editor-caret-ring-width) var(--_text-editor-caret-ring-color);
2735
3023
  }
2736
3024
 
2737
3025
  :host .cm-scroller {
@@ -2790,6 +3078,47 @@ var Sa = class {
2790
3078
  text-decoration: line-through;
2791
3079
  }
2792
3080
 
3081
+ .cm-md-highlight {
3082
+ padding-block: var(--_text-editor-token-block-padding-fit);
3083
+ background-color: var(--_text-editor-highlight-background-color);
3084
+ --context-content-color: var(--_text-editor-highlight-color);
3085
+ color: var(--_text-editor-highlight-color);
3086
+ border-radius: var(--_text-editor-token-corner-radius);
3087
+ -webkit-box-decoration-break: clone;
3088
+ box-decoration-break: clone;
3089
+ }
3090
+
3091
+ .cm-md-highlight-bare {
3092
+ padding-inline: var(--_text-editor-highlight-bare-inline-padding);
3093
+ }
3094
+
3095
+ .cm-md-highlight-selected {
3096
+ padding-block: var(--_text-editor-token-block-padding-fit);
3097
+ background-color: var(--_text-editor-highlight-is-selected-background-color);
3098
+ --context-content-color: var(--_text-editor-highlight-is-selected-color);
3099
+ color: var(--_text-editor-highlight-is-selected-color);
3100
+ }
3101
+
3102
+ .cm-md-highlight-selected .cm-md-highlight {
3103
+ background-color: transparent;
3104
+ }
3105
+
3106
+ .cm-md-highlight-selected-start {
3107
+ border-start-start-radius: var(--_text-editor-token-corner-radius);
3108
+ border-end-start-radius: var(--_text-editor-token-corner-radius);
3109
+ }
3110
+
3111
+ .cm-md-highlight-selected-end {
3112
+ border-start-end-radius: var(--_text-editor-token-corner-radius);
3113
+ border-end-end-radius: var(--_text-editor-token-corner-radius);
3114
+ }
3115
+
3116
+ :host .cm-md-highlight-selected ::selection,
3117
+ :host .cm-md-highlight-selected::selection {
3118
+ --context-content-color: var(--_text-editor-highlight-is-selected-color);
3119
+ color: var(--_text-editor-highlight-is-selected-color);
3120
+ }
3121
+
2793
3122
  /* The selected run is darkened with a decoration (see cm-md-code-selected
2794
3123
  below), since drawSelection hides the native selection. */
2795
3124
  .cm-md-code {
@@ -2963,6 +3292,46 @@ var Sa = class {
2963
3292
  background-color: var(--_text-editor-mention-token-is-selected-background-color);
2964
3293
  }
2965
3294
 
3295
+ .cm-md-variable-token {
3296
+ position: relative;
3297
+ padding-block: var(--_text-editor-token-block-padding-fit);
3298
+ padding-inline: var(--_text-editor-token-inline-padding);
3299
+ box-shadow: inset 0 0 0 var(--_text-editor-token-highlight-border-width) var(--_text-editor-variable-token-highlight-border-color);
3300
+ --context-content-color: var(--_text-editor-variable-token-content-color);
3301
+ color: var(--_text-editor-variable-token-content-color);
3302
+ background-color: var(--_text-editor-variable-token-background-color);
3303
+ border-radius: var(--_text-editor-token-corner-radius);
3304
+ white-space: nowrap;
3305
+ cursor: text;
3306
+ -webkit-box-decoration-break: clone;
3307
+ box-decoration-break: clone;
3308
+ text-indent: 0;
3309
+ }
3310
+
3311
+ .cm-md-variable-token[data-empty] {
3312
+ --context-content-color: var(--_text-editor-variable-token-empty-content-color);
3313
+ color: var(--_text-editor-variable-token-empty-content-color);
3314
+ }
3315
+
3316
+ .cm-md-variable-token-text::after {
3317
+ content: attr(data-text);
3318
+ }
3319
+
3320
+ .cm-md-token-spoken {
3321
+ position: absolute;
3322
+ margin: -1px;
3323
+ width: 1px;
3324
+ height: 1px;
3325
+ overflow: hidden;
3326
+ white-space: nowrap;
3327
+ clip-path: inset(50%);
3328
+ }
3329
+
3330
+ .cm-md-variable-token[data-selected] {
3331
+ box-shadow: none;
3332
+ background-color: var(--_text-editor-variable-token-is-selected-background-color);
3333
+ }
3334
+
2966
3335
  /* A native selection over a mention keeps its text light on the filled accent.
2967
3336
  :host bumps specificity so it wins over .cm-content ::selection wherever it sits. */
2968
3337
  :host .cm-md-mention-token ::selection {
@@ -3081,7 +3450,7 @@ var Sa = class {
3081
3450
  }
3082
3451
 
3083
3452
  .cm-md-task-box-label {
3084
- ${ke}
3453
+ ${je}
3085
3454
  }
3086
3455
 
3087
3456
  /* The opening line of a code block is its head: the language on the left,
@@ -3131,7 +3500,7 @@ var Sa = class {
3131
3500
  }
3132
3501
 
3133
3502
  .cm-md-code-copy-status {
3134
- ${ke}
3503
+ ${je}
3135
3504
  }
3136
3505
 
3137
3506
  .cm-md-code-language {
@@ -3214,6 +3583,7 @@ var Sa = class {
3214
3583
  margin: 0;
3215
3584
  padding: var(--_text-editor-popup-padding);
3216
3585
  min-width: var(--_text-editor-popup-min-width);
3586
+ max-width: var(--_text-editor-popup-max-width);
3217
3587
  max-height: var(--_text-editor-popup-max-height);
3218
3588
  font-family: var(--_text-editor-popup-font-family);
3219
3589
  font-size: var(--_text-editor-popup-font-size);
@@ -3236,6 +3606,22 @@ var Sa = class {
3236
3606
  flex: none;
3237
3607
  }
3238
3608
 
3609
+ /* A long supporting text gives way first: the text is what you choose. */
3610
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li > :is(.cm-completionLabel, .cm-completionDetail) {
3611
+ overflow: hidden;
3612
+ min-width: 0;
3613
+ white-space: nowrap;
3614
+ text-overflow: ellipsis;
3615
+ }
3616
+
3617
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li > .cm-completionLabel {
3618
+ flex: 0 1 auto;
3619
+ }
3620
+
3621
+ :host .cm-tooltip.cm-tooltip-autocomplete > ul > li > .cm-completionDetail {
3622
+ flex: 0 10000 auto;
3623
+ }
3624
+
3239
3625
  :host .cm-nldd-symbol {
3240
3626
  display: inline-flex;
3241
3627
  inline-size: var(--_text-editor-popup-symbol-size);
@@ -3294,7 +3680,7 @@ var Sa = class {
3294
3680
  }
3295
3681
 
3296
3682
  :host .cm-nldd-typeahead-status {
3297
- ${ke}
3683
+ ${je}
3298
3684
  }
3299
3685
 
3300
3686
  :host .cm-tooltip.cm-nldd-typeahead-empty {
@@ -3443,7 +3829,7 @@ var Sa = class {
3443
3829
  width: var(--primitives-border-width-regular);
3444
3830
  border-radius: var(--primitives-border-width-thin);
3445
3831
  background-color: var(--_text-editor-drop-cursor-color);
3446
- box-shadow: 0 0 0 var(--primitives-border-width-thin) var(--_text-editor-caret-ring-color);
3832
+ box-shadow: 0 0 0 var(--primitives-border-width-thin) var(--_text-editor-drop-cursor-ring-color);
3447
3833
  pointer-events: none;
3448
3834
  z-index: 4;
3449
3835
  }
@@ -3515,21 +3901,21 @@ var Sa = class {
3515
3901
  }
3516
3902
  `;
3517
3903
  // src/components/inputs/text-editor/text-editor.template.ts
3518
- function Ta(e) {
3519
- return Oe`<div class="text-editor"><slot name="toolbar" ?hidden=${!e._hasSlottedToolbar}></slot></div>`;
3904
+ function lo(e) {
3905
+ return Ae`<div class="text-editor"><slot name="toolbar" ?hidden=${!e._hasSlottedToolbar}></slot></div>`;
3520
3906
  }
3521
3907
  // src/components/inputs/text-editor/text-editor.code-copy.ts
3522
- var Ea = x.define({ combine: (e) => e[0] ?? {
3908
+ var uo = x.define({ combine: (e) => e[0] ?? {
3523
3909
  copy: () => "Kopieer",
3524
3910
  success: () => "Gekopieerd",
3525
3911
  failure: () => "Kopiëren mislukt"
3526
- } }), Da = 300, Oa = 2e3;
3527
- function ka() {
3912
+ } }), fo = 300, po = 2e3;
3913
+ function mo() {
3528
3914
  return typeof window < "u" && window.isSecureContext && typeof navigator.clipboard?.writeText == "function";
3529
3915
  }
3530
- function Aa(e, t) {
3916
+ function ho(e, t) {
3531
3917
  let n = "";
3532
- return s(e).iterate({
3918
+ return y(e).iterate({
3533
3919
  from: t,
3534
3920
  to: t,
3535
3921
  enter: (r) => {
@@ -3544,7 +3930,7 @@ function Y(e, t, n) {
3544
3930
  let r = n === "success" ? t.success() : n === "failure" ? t.failure() : t.copy();
3545
3931
  e.querySelector(".cm-md-code-copy-text").textContent = r, e.nextElementSibling.textContent = n === "idle" ? "" : r;
3546
3932
  }
3547
- var X = /* @__PURE__ */ new WeakMap(), ja = class extends t {
3933
+ var X = /* @__PURE__ */ new WeakMap(), go = class extends r {
3548
3934
  constructor(e, t, n) {
3549
3935
  super(), this.lineFrom = e, this.focusable = t, this.label = n;
3550
3936
  }
@@ -3552,7 +3938,7 @@ var X = /* @__PURE__ */ new WeakMap(), ja = class extends t {
3552
3938
  return e.lineFrom === this.lineFrom && e.focusable === this.focusable && e.label === this.label;
3553
3939
  }
3554
3940
  toDOM(e) {
3555
- let t = () => e.state.facet(Ea), n = document.createElement("button");
3941
+ let t = () => e.state.facet(uo), n = document.createElement("button");
3556
3942
  n.type = "button", n.className = "cm-md-code-copy", this.focusable || (n.tabIndex = -1);
3557
3943
  let r = document.createElement("nldd-icon");
3558
3944
  r.setAttribute("aria-hidden", "true"), r.className = "cm-md-code-copy-icon";
@@ -3574,13 +3960,13 @@ var X = /* @__PURE__ */ new WeakMap(), ja = class extends t {
3574
3960
  }), n.addEventListener("click", async () => {
3575
3961
  clearTimeout(X.get(o));
3576
3962
  try {
3577
- await navigator.clipboard.writeText(Aa(e.state, e.state.doc.lineAt(e.posAtDOM(n)).from)), Y(n, t(), "success");
3963
+ await navigator.clipboard.writeText(ho(e.state, e.state.doc.lineAt(e.posAtDOM(n)).from)), Y(n, t(), "success");
3578
3964
  } catch {
3579
3965
  Y(n, t(), "failure");
3580
3966
  }
3581
- s && s !== "mouse" && c(Oa);
3967
+ s && s !== "mouse" && c(po);
3582
3968
  }), n.addEventListener("pointerenter", () => clearTimeout(X.get(o))), n.addEventListener("pointerleave", () => {
3583
- n.dataset.state === "idle" || n.matches(":focus") || c(Da);
3969
+ n.dataset.state === "idle" || n.matches(":focus") || c(fo);
3584
3970
  }), n.addEventListener("blur", l), o;
3585
3971
  }
3586
3972
  destroy(e) {
@@ -3590,72 +3976,74 @@ var X = /* @__PURE__ */ new WeakMap(), ja = class extends t {
3590
3976
  return !0;
3591
3977
  }
3592
3978
  };
3593
- function Ma(e) {
3594
- if (!ka()) return v.none;
3595
- let t = [], n = e.readOnly, r = e.facet(Ea).copy();
3596
- return s(e).iterate({ enter: (i) => {
3597
- if (i.name !== "FencedCode") return;
3598
- let a = e.doc.lineAt(i.from);
3599
- return t.push(Na.range(a.from), v.widget({
3600
- widget: new ja(a.from, n, r),
3979
+ function _o(e) {
3980
+ if (!mo()) return t.none;
3981
+ let n = [], r = e.readOnly, i = e.facet(uo).copy();
3982
+ return y(e).iterate({ enter: (a) => {
3983
+ if (a.name !== "FencedCode") return;
3984
+ let o = e.doc.lineAt(a.from);
3985
+ return n.push(vo.range(o.from), t.widget({
3986
+ widget: new go(o.from, r, i),
3601
3987
  side: 1
3602
- }).range(a.to)), !1;
3603
- } }), v.set(t, !0);
3988
+ }).range(o.to)), !1;
3989
+ } }), t.set(n, !0);
3604
3990
  }
3605
- var Na = v.line({ class: "cm-md-code-head" });
3606
- function Pa(e, t) {
3607
- let n = t.state.facet(Ea);
3991
+ var vo = t.line({ class: "cm-md-code-head" });
3992
+ function yo(e, t) {
3993
+ let n = t.state.facet(uo);
3608
3994
  for (let e of t.dom.querySelectorAll(".cm-md-code-copy:not([data-state=\"idle\"])")) clearTimeout(X.get(e.parentElement)), Y(e, n, "idle");
3609
3995
  return !1;
3610
3996
  }
3611
- var Fa = _.domEventHandlers({
3612
- mousedown: Pa,
3613
- keydown: Pa
3997
+ var bo = o.domEventHandlers({
3998
+ mousedown: yo,
3999
+ keydown: yo
3614
4000
  });
3615
- function Ia(e) {
3616
- let t = h.define({
3617
- create: Ma,
3618
- update: (e, t) => t.docChanged || t.reconfigured || O(t.startState, t.state) ? Ma(t.state) : e,
3619
- provide: (e) => _.decorations.from(e)
4001
+ function xo(e) {
4002
+ let t = b.define({
4003
+ create: _o,
4004
+ update: (e, t) => t.docChanged || t.reconfigured || E(t.startState, t.state) ? _o(t.state) : e,
4005
+ provide: (e) => o.decorations.from(e)
3620
4006
  });
3621
4007
  return [
3622
- Ea.of(e),
4008
+ uo.of(e),
3623
4009
  t,
3624
- Fa
4010
+ bo
3625
4011
  ];
3626
4012
  }
3627
4013
  // src/components/inputs/text-editor/text-editor.toolbar.ts
3628
- var Z = "text-editor-command", La = "text-editor-for";
3629
- function Ra(e) {
4014
+ var Z = "text-editor-command", So = "text-editor-for";
4015
+ function Co(e) {
3630
4016
  let t = e.indexOf(":");
3631
4017
  if (t < 0) return [e.trim(), void 0];
3632
4018
  let n = e.slice(t + 1).trim();
3633
4019
  return [e.slice(0, t).trim(), /^\d+$/.test(n) ? Number(n) : n];
3634
4020
  }
3635
- function za(e) {
4021
+ function wo(e) {
3636
4022
  let { active: t } = e;
3637
4023
  return t.taskList ? "task" : t.orderedList ? "ordered" : t.bulletList ? "bullet" : "none";
3638
4024
  }
3639
- var Ba = /* @__PURE__ */ new Set([
4025
+ var To = /* @__PURE__ */ new Set([
3640
4026
  "bold",
3641
4027
  "italic",
3642
4028
  "inlineCode",
3643
4029
  "strikethrough",
4030
+ "highlight",
3644
4031
  "link",
3645
4032
  "quote",
3646
4033
  "codeBlock",
3647
4034
  "taskList"
3648
4035
  ]);
3649
- function Va(e, t, n) {
4036
+ function Eo(e, t, n) {
3650
4037
  let { active: r } = n;
3651
- return Ba.has(e) ? !!r[e] : e === "bulletList" ? r.bulletList && !r.taskList : e === "heading" ? r.heading === (typeof t == "number" ? t : 1) : e === "setHeading" ? !r.codeBlock && r.heading === (typeof t == "number" ? t : 0) : e === "setList" && !r.codeBlock && za(n) === (t ?? "none");
4038
+ return To.has(e) ? !!r[e] : e === "bulletList" ? r.bulletList && !r.taskList : e === "heading" ? r.heading === (typeof t == "number" ? t : 1) : e === "setHeading" ? !r.codeBlock && r.heading === (typeof t == "number" ? t : 0) : e === "setList" && !r.codeBlock && wo(n) === (t ?? "none");
3652
4039
  }
3653
- var Ha = /* @__PURE__ */ new Set([
4040
+ var Do = /* @__PURE__ */ new Set([
3654
4041
  "bold",
3655
4042
  "italic",
3656
4043
  "strikethrough",
4044
+ "highlight",
3657
4045
  "link"
3658
- ]), Ua = /* @__PURE__ */ new Set([
4046
+ ]), Oo = /* @__PURE__ */ new Set([
3659
4047
  "inlineCode",
3660
4048
  "quote",
3661
4049
  "bulletList",
@@ -3663,12 +4051,12 @@ var Ha = /* @__PURE__ */ new Set([
3663
4051
  "setList",
3664
4052
  "heading"
3665
4053
  ]);
3666
- function Wa(e, t, n) {
4054
+ function ko(e, t, n) {
3667
4055
  if (t.disabled) return !1;
3668
4056
  if (t.readonly) return e === "copy";
3669
4057
  let { active: r } = n;
3670
- if (Ha.has(e)) return !r.inlineCode && !r.codeBlock;
3671
- if (Ua.has(e)) return !r.codeBlock;
4058
+ if (Do.has(e)) return !r.inlineCode && !r.codeBlock;
4059
+ if (Oo.has(e)) return !r.codeBlock;
3672
4060
  switch (e) {
3673
4061
  case "undo": return n.canUndo;
3674
4062
  case "redo": return n.canRedo;
@@ -3679,72 +4067,72 @@ function Wa(e, t, n) {
3679
4067
  default: return !0;
3680
4068
  }
3681
4069
  }
3682
- var Ga = (e) => e.tagName.toLowerCase();
3683
- function* Ka(e) {
4070
+ var Ao = (e) => e.tagName.toLowerCase();
4071
+ function* jo(e) {
3684
4072
  let t = e;
3685
4073
  for (; t;) t instanceof Element && (yield t), t = t.parentNode ?? (t instanceof ShadowRoot ? t.host : null);
3686
4074
  }
3687
- function qa(e) {
4075
+ function Mo(e) {
3688
4076
  let t = e.getRootNode();
3689
- return t instanceof ShadowRoot && Ga(t.host) === "nldd-toolbar";
4077
+ return t instanceof ShadowRoot && Ao(t.host) === "nldd-toolbar";
3690
4078
  }
3691
- var Q = /* @__PURE__ */ new Set(), Ja = /* @__PURE__ */ new WeakMap();
3692
- function Ya(e) {
4079
+ var Q = /* @__PURE__ */ new Set(), No = /* @__PURE__ */ new WeakMap();
4080
+ function Po(e) {
3693
4081
  for (let t of Q) if (t.target.id === e) return t;
3694
4082
  }
3695
- function Xa(e) {
4083
+ function Fo(e) {
3696
4084
  for (let t of e.composedPath()) if (t instanceof Element) {
3697
- if (Ga(t) === "nldd-text-editor") return null;
3698
- if (t.hasAttribute(Z)) return qa(t) ? null : t;
4085
+ if (Ao(t) === "nldd-text-editor") return null;
4086
+ if (t.hasAttribute(Z)) return Mo(t) ? null : t;
3699
4087
  }
3700
4088
  return null;
3701
4089
  }
3702
- function Za(e) {
3703
- for (let t of Ka(e)) {
3704
- let e = t.getAttribute(La);
3705
- if (e !== null) return e === "" ? void 0 : Ya(e);
3706
- let n = Ja.get(t);
4090
+ function Io(e) {
4091
+ for (let t of jo(e)) {
4092
+ let e = t.getAttribute(So);
4093
+ if (e !== null) return e === "" ? void 0 : Po(e);
4094
+ let n = No.get(t);
3707
4095
  if (n) return n;
3708
4096
  }
3709
4097
  }
3710
- function Qa(e) {
4098
+ function Lo(e) {
3711
4099
  return (t) => {
3712
- let n = Xa(t);
3713
- (n && Za(n))?.handle(e, t, n);
4100
+ let n = Fo(t);
4101
+ (n && Io(n))?.handle(e, t, n);
3714
4102
  };
3715
4103
  }
3716
- var $a = [
4104
+ var Ro = [
3717
4105
  "click",
3718
4106
  "change",
3719
4107
  "select",
3720
4108
  "pointerdown",
3721
4109
  "keydown"
3722
- ].map((e) => [e, Qa(e)]), eo = /* @__PURE__ */ new Set(["pointerdown", "keydown"]), to = class {
4110
+ ].map((e) => [e, Lo(e)]), zo = /* @__PURE__ */ new Set(["pointerdown", "keydown"]), Bo = class {
3723
4111
  constructor(e, t) {
3724
4112
  this.target = e, this.focusText = t, this._listBeforePress = null;
3725
4113
  }
3726
4114
  connect() {
3727
- if (Q.size === 0) for (let [e, t] of $a) document.addEventListener(e, t, eo.has(e));
3728
- Q.add(this), Ja.set(this.target, this);
4115
+ if (Q.size === 0) for (let [e, t] of Ro) document.addEventListener(e, t, zo.has(e));
4116
+ Q.add(this), No.set(this.target, this);
3729
4117
  }
3730
4118
  disconnect() {
3731
- if (Q.delete(this), Ja.delete(this.target), Q.size === 0) for (let [e, t] of $a) document.removeEventListener(e, t, eo.has(e));
4119
+ if (Q.delete(this), No.delete(this.target), Q.size === 0) for (let [e, t] of Ro) document.removeEventListener(e, t, zo.has(e));
3732
4120
  }
3733
4121
  controls() {
3734
- let e = [...this.target.querySelectorAll(`[${Z}]`)], t = this.target.id, n = t && Ya(t) === this ? [...document.querySelectorAll(`[${La}="${CSS.escape(t)}"]`)].flatMap((e) => [...e.hasAttribute(Z) ? [e] : [], ...e.querySelectorAll(`[${Z}]`)]) : [];
3735
- return [...e, ...n].filter((e) => Za(e) === this);
4122
+ let e = [...this.target.querySelectorAll(`[${Z}]`)], t = this.target.id, n = t && Po(t) === this ? [...document.querySelectorAll(`[${So}="${CSS.escape(t)}"]`)].flatMap((e) => [...e.hasAttribute(Z) ? [e] : [], ...e.querySelectorAll(`[${Z}]`)]) : [];
4123
+ return [...e, ...n].filter((e) => Io(e) === this);
3736
4124
  }
3737
4125
  _run(e) {
3738
- let [t, n] = Ra(e);
4126
+ let [t, n] = Co(e);
3739
4127
  t === "setHeading" && this.target.getState().active.codeBlock && this.target.runCommand("codeBlock"), this.target.runCommand(t, n), queueMicrotask(this.focusText);
3740
4128
  }
3741
4129
  handle(e, t, n) {
3742
- let r = Ga(n), [i] = Ra(n.getAttribute(Z));
4130
+ let r = Ao(n), [i] = Co(n.getAttribute(Z));
3743
4131
  switch (e) {
3744
4132
  case "pointerdown":
3745
4133
  case "keydown":
3746
4134
  if (e === "keydown" && !["Enter", " "].includes(t.key)) return;
3747
- this._listBeforePress = r === "nldd-segmented-control" ? za(this.target.getState()) : null;
4135
+ this._listBeforePress = r === "nldd-segmented-control" ? wo(this.target.getState()) : null;
3748
4136
  return;
3749
4137
  case "click":
3750
4138
  if (r === "nldd-menu-item") return;
@@ -3763,19 +4151,24 @@ var $a = [
3763
4151
  }
3764
4152
  case "select": {
3765
4153
  if (r !== "nldd-menu-item") return;
3766
- let e = n.getAttribute(Z), [, t] = Ra(e);
3767
- if (n.getAttribute("type") === "radio" && Va(i, t, this.target.getState())) return;
4154
+ let e = n.getAttribute(Z), [, t] = Co(e);
4155
+ if (n.getAttribute("type") === "radio" && Eo(i, t, this.target.getState())) return;
3768
4156
  this._run(e);
3769
4157
  }
3770
4158
  }
3771
4159
  }
3772
4160
  reflect(e = this.target.getState()) {
3773
4161
  for (let t of this.controls()) {
3774
- let [n, r] = Ra(t.getAttribute(Z)), i = Ga(t);
3775
- t.toggleAttribute("disabled", !Wa(n, this.target, e)), i === "nldd-segmented-control" ? n === "setList" && (t.value = za(e)) : (i === "nldd-toggle-button" || i === "nldd-menu-item" || i === "nldd-segmented-control-item") && t.toggleAttribute("selected", Va(n, r, e));
4162
+ let [n, r] = Co(t.getAttribute(Z)), i = Ao(t);
4163
+ t.toggleAttribute("disabled", !ko(n, this.target, e)), i === "nldd-segmented-control" ? n === "setList" && (t.value = wo(e)) : (i === "nldd-toggle-button" || i === "nldd-menu-item" || i === "nldd-segmented-control-item") && t.toggleAttribute("selected", Eo(n, r, e));
4164
+ }
4165
+ for (let e of new Set(this.controls().map((e) => e.closest("nldd-segmented-control[type=\"checkbox\"]")))) {
4166
+ if (!e) continue;
4167
+ let t = e, n = [...e.querySelectorAll("nldd-segmented-control-item[selected]")].map((e) => e.value);
4168
+ (n.length !== t.values.length || n.some((e, n) => e !== t.values[n])) && (t.values = n);
3776
4169
  }
3777
4170
  }
3778
- }, no = class {
4171
+ }, Vo = class {
3779
4172
  constructor(e, t) {
3780
4173
  this.host = e, this.container = t, this._frame = 0, this._listening = !1, this._gap = 0, this._schedule = () => {
3781
4174
  this._frame || (this._frame = requestAnimationFrame(() => {
@@ -3802,26 +4195,26 @@ var $a = [
3802
4195
  let t = e.getBoundingClientRect().top - this.container().getBoundingClientRect().top, n = e.classList.contains("is-stuck") ? this._gap : 0;
3803
4196
  e.classList.toggle("is-stuck", t > n + .5);
3804
4197
  }
3805
- }, ro = class extends Me(ge, je) {
3806
- constructor(...e) {
3807
- super(...e), this.resize = "auto", this.embedded = !1, this.wrap = !0, this.syntax = "hidden", this.annotatable = !1, this.noSpellcheck = !1, this.typeaheads = [], this._mentionTypeahead = ((e) => ({
4198
+ }, Ho = class extends Pe(ve, Ne) {
4199
+ constructor(...t) {
4200
+ super(...t), this.resize = "auto", this.embedded = !1, this.wrap = !0, this.syntax = "hidden", this.annotatable = !1, this.noSpellcheck = !1, this.typeaheads = [], this._mentionTypeahead = ((e) => ({
3808
4201
  trigger: "@",
3809
4202
  source: (t) => e.mentionSource?.(t) ?? [],
3810
- insert: He,
4203
+ insert: Ge,
3811
4204
  get query() {
3812
4205
  return e.mentionQuery;
3813
4206
  },
3814
4207
  get emptyText() {
3815
4208
  return e.mentionEmptyText;
3816
4209
  }
3817
- }))(this), this.annotations = [], this.rowsProperty = "--_text-editor-rows", this._wrapCompartment = new l(), this._spellcheckCompartment = new l(), this._historyCompartment = new l(), this._syntaxCompartment = new l(), this._toolbar = new to(this, () => this.view?.focus()), this._stuck = new no(this, () => this._container ?? null), this._hasSlottedToolbar = !1, this._labels = null, this._clipboard = new mi(), this._plainPaste = null, this._lastState = null, this._onMentionPointerDown = (e) => {
4210
+ }))(this), this.annotations = [], this.variables = [], this.rowsProperty = "--_text-editor-rows", this._wrapCompartment = new e(), this._spellcheckCompartment = new e(), this._historyCompartment = new e(), this._syntaxCompartment = new e(), this._toolbar = new Bo(this, () => this.view?.focus()), this._stuck = new Vo(this, () => this._container ?? null), this._hasSlottedToolbar = !1, this._labels = null, this._clipboard = new Qi(), this._plainPaste = null, this._lastState = null, this._onMentionPointerDown = (e) => {
3818
4211
  let t = e.target?.closest?.(".cm-md-mention-token");
3819
4212
  if (!t || !this.view || this.view.state.readOnly) return;
3820
- let n = tt(this.view.state, this.view.posAtDOM(t));
4213
+ let n = it(this.view.state, this.view.posAtDOM(t));
3821
4214
  n && (e.preventDefault(), e.stopPropagation(), this.view.dispatch({ selection: {
3822
4215
  anchor: n.from,
3823
4216
  head: n.to
3824
- } }), this.view.focus(), e.button !== 0 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey || this.view.plugin(ia)?.startFor(e, n.from, n.to));
4217
+ } }), this.view.focus(), e.button !== 0 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey || this.view.plugin(Ha)?.startFor(e, n.from, n.to));
3825
4218
  }, this._onAnnotationBadgeClick = (e) => {
3826
4219
  let t = e.target?.closest?.(".cm-annotation-badge");
3827
4220
  if (!t) return;
@@ -3860,46 +4253,48 @@ var $a = [
3860
4253
  "components.text-editor.annotation-plural-lowercase",
3861
4254
  "components.text-editor.task-open-label",
3862
4255
  "components.text-editor.task-done-label",
3863
- "components.text-editor.copy-code-action"
4256
+ "components.text-editor.copy-code-action",
4257
+ "components.text-editor.variable-empty-text"
3864
4258
  ].map((e) => this._t(e)).join("\n");
3865
4259
  }
3866
4260
  buildExtensions() {
3867
4261
  return [
3868
4262
  ne,
3869
- er,
3870
- hr(() => this._typeaheadLists(), (e) => this._onTypeaheadChosen(e), (e) => this._t(e ? "components.text-editor.typeahead-no-results-text" : "components.text-editor.typeahead-start-typing-text"), (e) => e === 1 ? this._t("components.text-editor.typeahead-one-result-text") : this._t("components.text-editor.typeahead-results-text", { count: e })),
3871
- y.low(Qi),
3872
- oi((e, t) => this._t("components.text-editor.annotation-count-label", {
4263
+ Or,
4264
+ Wr(() => this._typeaheadLists(), (e) => this._onTypeaheadChosen(e), (e) => this._t(e ? "components.text-editor.typeahead-no-results-text" : "components.text-editor.typeahead-start-typing-text"), (e) => e === 1 ? this._t("components.text-editor.typeahead-one-result-text") : this._t("components.text-editor.typeahead-results-text", { count: e })),
4265
+ v.low(Ia),
4266
+ Wi((e, t) => this._t("components.text-editor.annotation-count-label", {
3873
4267
  count: e,
3874
4268
  noun: this._t(e === 1 ? "components.text-editor.annotation-singular-lowercase" : "components.text-editor.annotation-plural-lowercase"),
3875
4269
  quote: t
3876
4270
  })),
3877
- y.highest(rn((e) => this._t("components.text-editor.open-in-new-tab-label", { url: e }))),
3878
- Ia({
4271
+ v.highest(_n((e) => this._t("components.text-editor.open-in-new-tab-label", { url: e }))),
4272
+ $r((e) => this._t("components.text-editor.variable-empty-text", { label: e })),
4273
+ xo({
3879
4274
  copy: () => this._t("components.text-editor.copy-code-action"),
3880
4275
  success: () => this._t("components.text-editor.code-copy-success-text"),
3881
4276
  failure: () => this._t("components.text-editor.code-copy-failure-text")
3882
4277
  }),
3883
- pt({
4278
+ xt({
3884
4279
  open: () => this._t("components.text-editor.task-open-label"),
3885
4280
  done: () => this._t("components.text-editor.task-done-label")
3886
4281
  }),
3887
- this._historyCompartment.of(oe()),
3888
- r(),
3889
- Ca,
3890
- ya,
3891
- vi(),
4282
+ this._historyCompartment.of(ce()),
3892
4283
  a(),
3893
- aa,
3894
- Hi,
4284
+ so,
4285
+ ro,
4286
+ na(),
4287
+ c(),
4288
+ Ua,
4289
+ Ea,
3895
4290
  ...this.inputExtensions(),
3896
- this._wrapCompartment.of(this.wrap ? _.lineWrapping : []),
3897
- this._spellcheckCompartment.of(this.noSpellcheck ? [] : Or()),
3898
- this._syntaxCompartment.of(this.syntax === "hidden" ? [Jt(), M.of(!0)] : []),
3899
- _.updateListener.of((e) => {
4291
+ this._wrapCompartment.of(this.wrap ? o.lineWrapping : []),
4292
+ this._spellcheckCompartment.of(this.noSpellcheck ? [] : fi()),
4293
+ this._syntaxCompartment.of(this.syntax === "hidden" ? [rn(), j.of(!0)] : []),
4294
+ o.updateListener.of((e) => {
3900
4295
  (e.docChanged || e.selectionSet) && this._emitState();
3901
4296
  }),
3902
- _.domEventHandlers({
4297
+ o.domEventHandlers({
3903
4298
  mousedown: (e, t) => {
3904
4299
  if (e.detail < 3) return !1;
3905
4300
  let n = t.posAtCoords({
@@ -3951,20 +4346,23 @@ var $a = [
3951
4346
  return z(e);
3952
4347
  }
3953
4348
  beforeChangeCheck(e) {
3954
- xn(e);
4349
+ Pn(e), qn(e);
3955
4350
  }
3956
4351
  onEditorMounted() {
3957
- super.onEditorMounted(), this.view?.contentDOM.addEventListener("pointerdown", this._onMentionPointerDown, !0), this.view?.contentDOM.addEventListener("click", this._onAnnotationBadgeClick), this._syncAnnotations(), this._emitState();
4352
+ super.onEditorMounted(), this.view?.contentDOM.addEventListener("pointerdown", this._onMentionPointerDown, !0), this.view?.contentDOM.addEventListener("click", this._onAnnotationBadgeClick), this._syncAnnotations(), this._syncVariables(), this._emitState();
3958
4353
  }
3959
4354
  updated(e) {
3960
- if (super.updated(e), (e.has("disabled") || e.has("readonly")) && this._toolbar.reflect(), (e.has("embedded") || e.has("_hasSlottedToolbar")) && this.hasUpdated && this._stuck.update(), import.meta.env?.DEV && e.has("typeaheads") && Ne(this, "invalid-typeahead-query", ir(this.typeaheads)), !this.view) return;
4355
+ if (super.updated(e), (e.has("disabled") || e.has("readonly")) && this._toolbar.reflect(), (e.has("embedded") || e.has("_hasSlottedToolbar")) && this.hasUpdated && this._stuck.update(), import.meta.env?.DEV && e.has("typeaheads") && Fe(this, "invalid-typeahead-query", Mr(this.typeaheads)), !this.view) return;
3961
4356
  let t = this._labelSignature();
3962
- t !== this._labels && (this._labels !== null && this.view.dispatch({ effects: Pe.of(null) }), this._labels = t), e.has("wrap") && this.reconfigure(this._wrapCompartment, this.wrap ? _.lineWrapping : []), e.has("syntax") && this.reconfigure(this._syntaxCompartment, this.syntax === "hidden" ? [Jt(), M.of(!0)] : []), e.has("noSpellcheck") && (this.reconfigure(this._spellcheckCompartment, this.noSpellcheck ? [] : Or()), this._redrawForSpellcheck()), (e.has("annotations") || e.has("annotatable")) && this._syncAnnotations();
4357
+ t !== this._labels && (this._labels !== null && this.view.dispatch({ effects: w.of(null) }), this._labels = t), e.has("wrap") && this.reconfigure(this._wrapCompartment, this.wrap ? o.lineWrapping : []), e.has("syntax") && this.reconfigure(this._syntaxCompartment, this.syntax === "hidden" ? [rn(), j.of(!0)] : []), e.has("noSpellcheck") && (this.reconfigure(this._spellcheckCompartment, this.noSpellcheck ? [] : fi()), this._redrawForSpellcheck()), (e.has("annotations") || e.has("annotatable")) && this._syncAnnotations(), e.has("variables") && this._syncVariables();
4358
+ }
4359
+ _syncVariables() {
4360
+ this.view?.dispatch({ effects: Kr.of(this.variables) });
3963
4361
  }
3964
4362
  _syncAnnotations() {
3965
4363
  this.view?.dispatch({
3966
- effects: Fr.of(this.annotatable ? this.annotations : []),
3967
- annotations: S.addToHistory.of(!1)
4364
+ effects: yi.of(this.annotatable ? this.annotations : []),
4365
+ annotations: h.addToHistory.of(!1)
3968
4366
  });
3969
4367
  }
3970
4368
  toggleBold() {
@@ -3979,45 +4377,48 @@ var $a = [
3979
4377
  toggleStrikethrough() {
3980
4378
  this.view && G(this.view, "~~", "Strikethrough");
3981
4379
  }
4380
+ toggleHighlight() {
4381
+ this.view && G(this.view, "==", "Highlight");
4382
+ }
3982
4383
  toggleHeading(e) {
3983
- this.view && wi(this.view, e);
4384
+ this.view && ca(this.view, e);
3984
4385
  }
3985
4386
  setHeading(e) {
3986
- this.view && Ti(this.view, e);
4387
+ this.view && la(this.view, e);
3987
4388
  }
3988
4389
  toggleBulletList() {
3989
- this.view && Ei(this.view);
4390
+ this.view && ua(this.view);
3990
4391
  }
3991
4392
  toggleTaskList() {
3992
- this.view && Oi(this.view);
4393
+ this.view && fa(this.view);
3993
4394
  }
3994
4395
  setList(e) {
3995
- this.view && Ai(this.view, e);
4396
+ this.view && ma(this.view, e);
3996
4397
  }
3997
4398
  toggleQuote() {
3998
- this.view && Li(this.view);
4399
+ this.view && xa(this.view);
3999
4400
  }
4000
4401
  toggleLink(e = "") {
4001
- this.view && zi(this.view, e);
4402
+ this.view && Ca(this.view, e);
4002
4403
  }
4003
4404
  toggleCodeBlock() {
4004
- this.view && Bi(this.view);
4405
+ this.view && wa(this.view);
4005
4406
  }
4006
4407
  indent() {
4007
- this.view && Mi(this.view);
4408
+ this.view && ga(this.view);
4008
4409
  }
4009
4410
  outdent() {
4010
- this.view && Ni(this.view);
4411
+ this.view && _a(this.view);
4011
4412
  }
4012
4413
  undo() {
4013
- this.view && (ce(this.view), this.view.focus());
4414
+ this.view && (ue(this.view), this.view.focus());
4014
4415
  }
4015
4416
  redo() {
4016
- this.view && (de(this.view), this.view.focus());
4417
+ this.view && (pe(this.view), this.view.focus());
4017
4418
  }
4018
4419
  clearHistory() {
4019
4420
  let e = this.view;
4020
- e && (e.dispatch({ effects: this._historyCompartment.reconfigure([]) }), e.dispatch({ effects: this._historyCompartment.reconfigure(oe()) }), this._emitState());
4421
+ e && (e.dispatch({ effects: this._historyCompartment.reconfigure([]) }), e.dispatch({ effects: this._historyCompartment.reconfigure(ce()) }), this._emitState());
4021
4422
  }
4022
4423
  async copy() {
4023
4424
  if (!this.view || this.view.state.selection.main.empty) return;
@@ -4069,7 +4470,7 @@ var $a = [
4069
4470
  });
4070
4471
  t.dispatch({
4071
4472
  changes: a,
4072
- annotations: [S.remote.of(!0), S.addToHistory.of(!1)]
4473
+ annotations: [h.remote.of(!0), h.addToHistory.of(!1)]
4073
4474
  });
4074
4475
  }
4075
4476
  setDoc(e) {
@@ -4104,6 +4505,9 @@ var $a = [
4104
4505
  case "strikethrough":
4105
4506
  this.toggleStrikethrough();
4106
4507
  break;
4508
+ case "highlight":
4509
+ this.toggleHighlight();
4510
+ break;
4107
4511
  case "bulletList":
4108
4512
  this.toggleBulletList();
4109
4513
  break;
@@ -4149,17 +4553,17 @@ var $a = [
4149
4553
  case "paste":
4150
4554
  this.paste();
4151
4555
  break;
4152
- default: Ne(this, "unknown-command", !0);
4556
+ default: Fe(this, "unknown-command", !0);
4153
4557
  }
4154
4558
  }
4155
4559
  getState() {
4156
4560
  return {
4157
- active: this.view ? Vi(this.view) : { ...yi },
4561
+ active: this.view ? Ta(this.view) : { ...ra },
4158
4562
  empty: !this.view || this.view.state.selection.main.empty,
4159
- canIndent: this.view ? Pi(this.view) : !1,
4160
- canOutdent: this.view ? Fi(this.view) : !1,
4161
- canUndo: this.view ? le(this.view.state) > 0 : !1,
4162
- canRedo: this.view ? _e(this.view.state) > 0 : !1
4563
+ canIndent: this.view ? va(this.view) : !1,
4564
+ canOutdent: this.view ? ya(this.view) : !1,
4565
+ canUndo: this.view ? de(this.view.state) > 0 : !1,
4566
+ canRedo: this.view ? ye(this.view.state) > 0 : !1
4163
4567
  };
4164
4568
  }
4165
4569
  getSelection() {
@@ -4184,7 +4588,7 @@ var $a = [
4184
4588
  let e = this.view;
4185
4589
  if (!e) return [];
4186
4590
  let t = z(e.state.doc.toString());
4187
- return zr(e.state).map((e) => ({
4591
+ return Ci(e.state).map((e) => ({
4188
4592
  id: e.id,
4189
4593
  start: e.from,
4190
4594
  end: e.to,
@@ -4211,7 +4615,7 @@ var $a = [
4211
4615
  id: t,
4212
4616
  text: r,
4213
4617
  from: n,
4214
- to: n + Ve(e.candidate).length
4618
+ to: n + We(e.candidate).length
4215
4619
  });
4216
4620
  } else this.dispatchEvent(new CustomEvent("typeahead", {
4217
4621
  detail: {
@@ -4232,27 +4636,27 @@ var $a = [
4232
4636
  }));
4233
4637
  }
4234
4638
  render() {
4235
- return Ta(this);
4639
+ return lo(this);
4236
4640
  }
4237
- }, $ = (ro.styles = wa, ro);
4238
- w([C({
4641
+ }, $ = (Ho.styles = co, Ho);
4642
+ C([S({
4239
4643
  reflect: !0,
4240
- converter: ae("auto")
4241
- })], $.prototype, "resize", void 0), w([C({
4644
+ converter: se("auto")
4645
+ })], $.prototype, "resize", void 0), C([S({
4242
4646
  type: Boolean,
4243
4647
  reflect: !0
4244
- })], $.prototype, "embedded", void 0), w([C({
4648
+ })], $.prototype, "embedded", void 0), C([S({
4245
4649
  type: Boolean,
4246
4650
  reflect: !0
4247
- })], $.prototype, "wrap", void 0), w([C({
4651
+ })], $.prototype, "wrap", void 0), C([S({
4248
4652
  reflect: !0,
4249
- converter: ae("hidden")
4250
- })], $.prototype, "syntax", void 0), w([C({
4653
+ converter: se("hidden")
4654
+ })], $.prototype, "syntax", void 0), C([S({
4251
4655
  type: Boolean,
4252
4656
  reflect: !0
4253
- })], $.prototype, "annotatable", void 0), w([C({
4657
+ })], $.prototype, "annotatable", void 0), C([S({
4254
4658
  type: Boolean,
4255
4659
  reflect: !0,
4256
4660
  attribute: "no-spellcheck"
4257
- })], $.prototype, "noSpellcheck", void 0), w([C({ attribute: !1 })], $.prototype, "mentionSource", void 0), w([C({ attribute: !1 })], $.prototype, "mentionQuery", void 0), w([C({ attribute: !1 })], $.prototype, "mentionEmptyText", void 0), w([C({ attribute: !1 })], $.prototype, "typeaheads", void 0), w([C({ attribute: !1 })], $.prototype, "annotations", void 0), w([Ce(".text-editor")], $.prototype, "_container", void 0), w([re()], $.prototype, "_hasSlottedToolbar", void 0), $ = w([Se("nldd-text-editor")], $);
4258
- export { tr as DEFAULT_TYPEAHEAD_QUERY, $ as NLDDTextEditor };
4661
+ })], $.prototype, "noSpellcheck", void 0), C([S({ attribute: !1 })], $.prototype, "mentionSource", void 0), C([S({ attribute: !1 })], $.prototype, "mentionQuery", void 0), C([S({ attribute: !1 })], $.prototype, "mentionEmptyText", void 0), C([S({ attribute: !1 })], $.prototype, "typeaheads", void 0), C([S({ attribute: !1 })], $.prototype, "annotations", void 0), C([S({ attribute: !1 })], $.prototype, "variables", void 0), C([Te(".text-editor")], $.prototype, "_container", void 0), C([ae()], $.prototype, "_hasSlottedToolbar", void 0), $ = C([we("nldd-text-editor")], $);
4662
+ export { kr as DEFAULT_TYPEAHEAD_QUERY, $ as NLDDTextEditor };