@alfadocs/ui-kit 1.50.1 → 1.52.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 (597) hide show
  1. package/dist/_chunks/{actions-cell-renderer-DMittsR3.js → actions-cell-renderer-DhmUGzRY.js} +5 -5
  2. package/dist/_chunks/{address-autocomplete-Dp5uMvKP.js → address-autocomplete-BVLoHU3E.js} +3 -3
  3. package/dist/_chunks/{address-fields-QfC-N3pw.js → address-fields-UiEXHxEX.js} +9 -9
  4. package/dist/_chunks/{agenda-card-CjjxlA9K.js → agenda-card-CakEvwnM.js} +4 -4
  5. package/dist/_chunks/{agenda-tray-BhZASyJm.js → agenda-tray-C-_iu6Fo.js} +5 -5
  6. package/dist/_chunks/{ai-credits-notice-C-kz_RrY.js → ai-credits-notice-Da0fJPXO.js} +5 -5
  7. package/dist/_chunks/{ai-permission-notice-BRZeS3mT.js → ai-permission-notice-C5q_uHBA.js} +7 -7
  8. package/dist/_chunks/{ai-prompt-input-CxvnXsAs.js → ai-prompt-input-IObcUWqB.js} +5 -5
  9. package/dist/_chunks/{alert-CiQ5Pa3Q.js → alert-BhCstf2h.js} +3 -3
  10. package/dist/_chunks/{alia-sidebar-Dx-oeOV2.js → alia-sidebar-DyQMsyiz.js} +23 -23
  11. package/dist/_chunks/{anamnesis-card-D8Si-2GV.js → anamnesis-card-D4RWzQXP.js} +5 -5
  12. package/dist/_chunks/{anamnesis-summary-card-DPyScUMM.js → anamnesis-summary-card-Bv0CZ-mk.js} +3 -3
  13. package/dist/_chunks/anamnesis-summary-rows-DaSoA80I.js +20926 -0
  14. package/dist/_chunks/{annotation-marker-CsUJGZjQ.js → annotation-marker-D-M7y4R1.js} +2 -2
  15. package/dist/_chunks/{antenatal-schedule-timeline-8fm3vPSV.js → antenatal-schedule-timeline-BZzgjfyd.js} +13 -13
  16. package/dist/_chunks/{app-frame-DIEMIC5V.js → app-frame-Cos-GSfw.js} +5 -5
  17. package/dist/_chunks/{appointment-card-BgLpE6T5.js → appointment-card-CA2ynsmN.js} +8 -8
  18. package/dist/_chunks/{appointment-peek-Dk11UOVW.js → appointment-peek-DpPzeYXm.js} +6 -6
  19. package/dist/_chunks/{appointment-timeline-wQ-PdkFV.js → appointment-timeline-BZErHbD1.js} +7 -7
  20. package/dist/_chunks/{appointment-tray-D7Gt6m8x.js → appointment-tray-DR_Zm4Gw.js} +10 -10
  21. package/dist/_chunks/{appointment-workflow-status-CS8ufF1f.js → appointment-workflow-status-DrWCNLbB.js} +2 -2
  22. package/dist/_chunks/{ar-BR1FGFP2.js → ar-pLopgMbL.js} +12 -12
  23. package/dist/_chunks/{audio-recorder-DZBtAvLH.js → audio-recorder-BafA28cX.js} +7 -7
  24. package/dist/_chunks/{audio-visualiser-l6zPd0AG.js → audio-visualiser-CK2JyQW1.js} +2 -2
  25. package/dist/_chunks/{autocomplete-DSasZUf6.js → autocomplete-IfLaXwyb.js} +3 -3
  26. package/dist/_chunks/{avatar-BVvjKNTp.js → avatar-DYtwj1-R.js} +2 -2
  27. package/dist/_chunks/{badge-BAkd6_Pj.js → badge-hnBt8o7n.js} +6 -6
  28. package/dist/_chunks/{balance-badge-cell-klaxFNL_.js → balance-badge-cell-CS-iKkLM.js} +8 -8
  29. package/dist/_chunks/{bishop-score-BMLRvXYF.js → bishop-score-BfDsm9HH.js} +6 -6
  30. package/dist/_chunks/{bmi-calculator-DUhRyyrA.js → bmi-calculator-BNtmMzQy.js} +6 -6
  31. package/dist/_chunks/{booking-Cdzd8kyY.js → booking-DP543-BT.js} +43 -42
  32. package/dist/_chunks/{breadcrumb-D3boYzD4.js → breadcrumb-xgVpPH2H.js} +4 -4
  33. package/dist/_chunks/{button-18oBsI3n.js → button-CYPx2xFq.js} +38 -36
  34. package/dist/_chunks/{button-group-BSDqso_C.js → button-group-DnSR6eN6.js} +30 -30
  35. package/dist/_chunks/{calculator-dialog-C0ixc3SU.js → calculator-dialog-BRjZMWuE.js} +2 -2
  36. package/dist/_chunks/calendar-BwF5nQuW.js +1469 -0
  37. package/dist/_chunks/{calendar-event-card-DyFSIehr.js → calendar-event-card-DXAYWH6k.js} +2 -2
  38. package/dist/_chunks/calendar-workspace-B9MKJXER.js +10608 -0
  39. package/dist/_chunks/{care-plan-card-ciBaaguw.js → care-plan-card-BanlKJZn.js} +8 -8
  40. package/dist/_chunks/{care-plan-entry-card-D7A0whiZ.js → care-plan-entry-card-ByqT84_P.js} +9 -9
  41. package/dist/_chunks/{care-plan-header-DKV1gLqv.js → care-plan-header-BwfUHMgM.js} +6 -6
  42. package/dist/_chunks/{carousel.agent-DqDGR2yH.js → carousel.agent-WKODAYVw.js} +6 -6
  43. package/dist/_chunks/{chart-VjuXDXOZ.js → chart-CuE30cfr.js} +4 -4
  44. package/dist/_chunks/{chat-container-CYYego1W.js → chat-container-CAfyTxat.js} +3 -3
  45. package/dist/_chunks/{chat-input-BVho_SqP.js → chat-input-DA10w969.js} +3 -3
  46. package/dist/_chunks/{chat-message-B4ihjNy3.js → chat-message-DoMjMa-M.js} +6 -6
  47. package/dist/_chunks/{checkbox-group-DomUzpkF.js → checkbox-group-C7czpHmJ.js} +2 -2
  48. package/dist/_chunks/{city-input-BGYc4lRV.js → city-input-CAnTVgBZ.js} +10 -10
  49. package/dist/_chunks/{clinical-note-card-B7s5BtEl.js → clinical-note-card-kvlUrmP-.js} +6 -6
  50. package/dist/_chunks/{code-block-C_eNHWaa.js → code-block-NtHjtagI.js} +6 -6
  51. package/dist/_chunks/{color-picker-Bl5f0iK1.js → color-picker-Yl99lHuF.js} +3 -3
  52. package/dist/_chunks/{combobox-B_rLwmSv.js → combobox-Iel8y3u6.js} +2 -2
  53. package/dist/_chunks/{command-palette-DhgGo7GJ.js → command-palette-D9TBzmOG.js} +4 -4
  54. package/dist/_chunks/{connection-status-Cfux3TvH.js → connection-status-Dz8o-Fui.js} +5 -5
  55. package/dist/_chunks/{contact-card-0hnFJwrz.js → contact-card-D2gXrxlL.js} +12 -12
  56. package/dist/_chunks/{contact-profile-card-Dj4NgBL-.js → contact-profile-card-B7cXr8g5.js} +5 -5
  57. package/dist/_chunks/{control-room-rail-DAO0qfOI.js → control-room-rail-B446rHSL.js} +4 -4
  58. package/dist/_chunks/{copy-field-Cm4y5Bff.js → copy-field-CiIuVbKe.js} +3 -3
  59. package/dist/_chunks/{country-select-C5jZjO8O.js → country-select-BYa4BrEi.js} +3 -3
  60. package/dist/_chunks/{cycle-calculator-B9lBRNiZ.js → cycle-calculator-D_5f9VSN.js} +10 -10
  61. package/dist/_chunks/{dashboard-grid-uX7x1ePj.js → dashboard-grid-DWNP02Ff.js} +4 -4
  62. package/dist/_chunks/data-table-DJvEwZZx.js +1989 -0
  63. package/dist/_chunks/{data-table-tabs-CzYYKp2_.js → data-table-tabs-Dc6zvoI_.js} +6 -6
  64. package/dist/_chunks/{date-picker-6tFnKFty.js → date-picker-p9yz3pxc.js} +83 -80
  65. package/dist/_chunks/{date-picker-variants-B9NLAfUK.js → date-picker-variants-B3AFKDSu.js} +706 -658
  66. package/dist/_chunks/{date-range-picker-TpmECKRh.js → date-range-picker-DIy8gNY0.js} +153 -150
  67. package/dist/_chunks/{date-time-picker-DijEae25.js → date-time-picker-C3UVzqOm.js} +86 -77
  68. package/dist/_chunks/{de-3iM4rGqo.js → de-lVkJRPnh.js} +5 -5
  69. package/dist/_chunks/{dependent-selector-58hTg5rB.js → dependent-selector-CPiolWiw.js} +4 -4
  70. package/dist/_chunks/{description-list-1A2DEbE6.js → description-list-9rchqp5q.js} +3 -3
  71. package/dist/_chunks/{dialog-BJiLqhx6.js → dialog-D52AI4nF.js} +2 -2
  72. package/dist/_chunks/{document-preview-Od2Hz4z5.js → document-preview-1CZJg6CX.js} +6 -6
  73. package/dist/_chunks/{document-scanner-p0aGlzCy.js → document-scanner-T5jHiraQ.js} +5 -5
  74. package/dist/_chunks/dropdown-menu-B5mgV1kV.js +594 -0
  75. package/dist/_chunks/{due-date-calculator-BVqJaxzd.js → due-date-calculator-iJXm6HOj.js} +11 -11
  76. package/dist/_chunks/{editable-currency-cell-renderer-D_G2Ap61.js → editable-currency-cell-renderer-DdMHme5y.js} +9 -9
  77. package/dist/_chunks/{editable-description-B4NVdjvd.js → editable-description-Cy3AZ5K2.js} +4 -4
  78. package/dist/_chunks/{editor-overlay-BDiBvQmL.js → editor-overlay-C0awV6ba.js} +3 -3
  79. package/dist/_chunks/{el-C96rGJvU.js → el-CHzxNWPj.js} +6 -6
  80. package/dist/_chunks/{email-input-Dpe63k0K.js → email-input-ebdovOmh.js} +3 -3
  81. package/dist/_chunks/{empty-state-DTBZ1ENT.js → empty-state-DActfjdn.js} +3 -3
  82. package/dist/_chunks/en-GB-CwxYmmhU.js +45 -0
  83. package/dist/_chunks/{entity-summary-CFJfBdVP.js → entity-summary-oW3_jFhU.js} +8 -8
  84. package/dist/_chunks/{error-boundary-BxTqEXqj.js → error-boundary--w5hYiQ-.js} +3 -3
  85. package/dist/_chunks/{es-Cxiqjx8r.js → es-Ck-oxbHW.js} +8 -8
  86. package/dist/_chunks/{face-scheme-fku-RShg.js → face-scheme-Dg7KcbW2.js} +11 -11
  87. package/dist/_chunks/{fetal-weight-B69yOS9W.js → fetal-weight-BoIkl2t1.js} +6 -6
  88. package/dist/_chunks/{field-array-lIXrFWS0.js → field-array-BF2nCmvt.js} +4 -4
  89. package/dist/_chunks/{file-manager-C6QQPQV5.js → file-manager-BGHShxn_.js} +21 -21
  90. package/dist/_chunks/{file-upload-B242a_Y1.js → file-upload-OMlGHz70.js} +2 -2
  91. package/dist/_chunks/{finished-terminal-B2oqXO0Y.js → finished-terminal-BguGAUdg.js} +3 -3
  92. package/dist/_chunks/{fiscal-code-input-BEF8eKIG.js → fiscal-code-input-CuuE8_dt.js} +3 -3
  93. package/dist/_chunks/{floating-action-button-pojvb9gG.js → floating-action-button-BesoUmO_.js} +6 -6
  94. package/dist/_chunks/{form-field-CahJzTxp.js → form-field-YUJl_U5l.js} +2 -2
  95. package/dist/_chunks/{format-4HNwNGrN.js → format-D-1gTdHF.js} +47 -43
  96. package/dist/_chunks/{fr-Bhr6SYKj.js → fr-fWRnDcSD.js} +13 -13
  97. package/dist/_chunks/{freemium-paywall-B6JITu4l.js → freemium-paywall-BhxKSEJD.js} +5 -5
  98. package/dist/_chunks/{gestational-age-calculator-DsGN6_HS.js → gestational-age-calculator-CjZ7v-8x.js} +13 -13
  99. package/dist/_chunks/{hcg-doubling-D2SH-e7t.js → hcg-doubling-BYMogA0e.js} +15 -15
  100. package/dist/_chunks/{header-CCjp5GvE.js → header-CzJbtTGQ.js} +5 -5
  101. package/dist/_chunks/header-settings-BqdBe4zk.js +305 -0
  102. package/dist/_chunks/{help-me-write-templates-DQtT1qs_.js → help-me-write-templates-CGCyhAVE.js} +17 -17
  103. package/dist/_chunks/{hi-BxXX26d_.js → hi-B5uX0h3V.js} +14 -14
  104. package/dist/_chunks/{hover-card-BplP5SzQ.js → hover-card-DEMPFs9M.js} +3 -3
  105. package/dist/_chunks/{iban-input-DXIA8Ln_.js → iban-input-D88HRGZo.js} +2 -2
  106. package/dist/_chunks/{icon-button-CY7GU_Se.js → icon-button-JAXAkqWC.js} +2 -2
  107. package/dist/_chunks/{icon-button-group-B_426QN_.js → icon-button-group-DHRz90jY.js} +4 -4
  108. package/dist/_chunks/{icon-picker-ZLebyB0U.js → icon-picker-C5Fhx1-3.js} +5 -5
  109. package/dist/_chunks/{image-cropper-_HiNN79d.js → image-cropper-CNBGkG7P.js} +3 -3
  110. package/dist/_chunks/{info-tip-laBxZhKu.js → info-tip-DfmEvyAF.js} +3 -3
  111. package/dist/_chunks/{insert-result-CSuPQyKL.js → insert-result-BuWQl11Z.js} +3 -3
  112. package/dist/_chunks/intl-locale-CXM-B8EP.js +16 -0
  113. package/dist/_chunks/{isSameWeek-B73MagWB.js → isSameWeek-u81Z-J7h.js} +2 -2
  114. package/dist/_chunks/{it-Xmjomvyj.js → it-DBoNIelY.js} +17 -17
  115. package/dist/_chunks/{ja-mfZvt1ZV.js → ja-Du8gfg8p.js} +6 -6
  116. package/dist/_chunks/{kbd-D855ZXIW.js → kbd-BLovyx1R.js} +2 -2
  117. package/dist/_chunks/{key-value-pair-Dcdl3Gni.js → key-value-pair-DZH8ESsc.js} +3 -3
  118. package/dist/_chunks/{kit-extensions-BTJSnM_H.js → kit-extensions-CF5mDF_Z.js} +6 -6
  119. package/dist/_chunks/{link-CPb_pZPr.js → link-BlVUIKk1.js} +2 -2
  120. package/dist/_chunks/{link-cell-renderer-CkNbUsBM.js → link-cell-renderer-DvcbSHyp.js} +12 -12
  121. package/dist/_chunks/{list-DgE1xWBM.js → list-RRN2TJ_7.js} +2 -2
  122. package/dist/_chunks/{locale-picker-DGkQmhV9.js → locale-picker-DYDppQdZ.js} +218 -213
  123. package/dist/_chunks/{map-view-Bb7ClKSF.js → map-view-CmNGS6Ok.js} +4 -4
  124. package/dist/_chunks/{marketplace-app-shell-1uKqs4gD.js → marketplace-app-shell-rd1bSSm4.js} +137 -128
  125. package/dist/_chunks/{message-card-C2zsvyj0.js → message-card-Dub3790J.js} +6 -6
  126. package/dist/_chunks/{message-tray-CMlmxdH2.js → message-tray-CTd6CsnG.js} +6 -6
  127. package/dist/_chunks/{money-BXLBIRVO.js → money-GypsuFk2.js} +2 -2
  128. package/dist/_chunks/{multi-select-N4Smh-gj.js → multi-select-Bx0_cgPI.js} +2 -2
  129. package/dist/_chunks/{muscle-scheme-Co0NIgbU.js → muscle-scheme-X2bdmsQt.js} +4 -4
  130. package/dist/_chunks/{nav-grid-gRudLsPX.js → nav-grid-BnY0Ilet.js} +2 -2
  131. package/dist/_chunks/{navigation-menu-D3VndouD.js → navigation-menu-DbaSlvdO.js} +25 -25
  132. package/dist/_chunks/{nl-DDs-KEnD.js → nl-BCBwxYi8.js} +9 -9
  133. package/dist/_chunks/{note-attachment-CGjNTrAC.js → note-attachment-CpPRIfSn.js} +4 -4
  134. package/dist/_chunks/{note-timeline-CVnKL0p6.js → note-timeline-CZUmobcn.js} +3 -3
  135. package/dist/_chunks/{notes-panel-xxpFt-I1.js → notes-panel-CPfxz-1j.js} +10 -10
  136. package/dist/_chunks/{notification-card-DDzBCi8l.js → notification-card-B39g86vM.js} +13 -13
  137. package/dist/_chunks/{notification-tray-PnH2PBlZ.js → notification-tray-WsP7c1jf.js} +6 -6
  138. package/dist/_chunks/{number-input-Cgu2TtA8.js → number-input-BLrx3utH.js} +2 -2
  139. package/dist/_chunks/{operator-hero-DyrNLoRO.js → operator-hero-BnBPxwOi.js} +10 -10
  140. package/dist/_chunks/{optical-prescription-DUufWXfZ.js → optical-prescription-x--Rpmmx.js} +6 -6
  141. package/dist/_chunks/{otp-input-DzBQ-CpE.js → otp-input-Dz8WMg4F.js} +2 -2
  142. package/dist/_chunks/{pagination-B0N2qGy_.js → pagination-CzEkpfti.js} +6 -6
  143. package/dist/_chunks/{panel-subview-CzHutkA8.js → panel-subview-DAY-ToM3.js} +2 -2
  144. package/dist/_chunks/{parse-DPqj4JtD.js → parse-DeDYl04y.js} +32 -32
  145. package/dist/_chunks/{parseISO-fOGpHKXm.js → parseISO-y3LncvfO.js} +2 -2
  146. package/dist/_chunks/{patient-details-tTlvrJSU.js → patient-details-BSAMAd3I.js} +6 -6
  147. package/dist/_chunks/{patient-field-row-DElFbpKc.js → patient-field-row-dUF2cW2G.js} +288 -268
  148. package/dist/_chunks/{patient-search-DgXdGkhK.js → patient-search-CXl0FNfN.js} +14 -14
  149. package/dist/_chunks/{patient-summary-card-DQ__6DR-.js → patient-summary-card-DF-Mxcma.js} +10 -10
  150. package/dist/_chunks/{payment-automation-upsell-ugi4np1l.js → payment-automation-upsell-DNiraNhF.js} +6 -6
  151. package/dist/_chunks/{payment-form-DqJFiplX.js → payment-form-DxsjXYHJ.js} +6 -6
  152. package/dist/_chunks/{payment-request-card-DMJB57Tv.js → payment-request-card-BFsmHLtf.js} +8 -8
  153. package/dist/_chunks/{pdf-viewer-DUKdn5iq.js → pdf-viewer-hzfM5pZf.js} +6 -6
  154. package/dist/_chunks/{periodontal-chart-DbGzKDj7.js → periodontal-chart-Bvii6uOg.js} +3 -3
  155. package/dist/_chunks/{periodontal-chart-card-DvHyP47v.js → periodontal-chart-card-DTbvFQO7.js} +4 -4
  156. package/dist/_chunks/{periodontal-diagnosis-B8WqI0eU.js → periodontal-diagnosis-BqEo0usu.js} +3 -3
  157. package/dist/_chunks/{periodontal-risk-chart-DsFRFFSz.js → periodontal-risk-chart-C1Y5f-md.js} +3 -3
  158. package/dist/_chunks/{permission-matrix-VdAXjjHU.js → permission-matrix-DHKECaNW.js} +3 -3
  159. package/dist/_chunks/{phone-input-sQj-zi59.js → phone-input-opMMHkyh.js} +2 -2
  160. package/dist/_chunks/{pl-BYYMnEWP.js → pl-HwLM6gPs.js} +7 -7
  161. package/dist/_chunks/{popover-Dvb40vPH.js → popover-CGYPYIVi.js} +3 -3
  162. package/dist/_chunks/{position-grid-CcvqHaKN.js → position-grid-D2D5_Tze.js} +2 -2
  163. package/dist/_chunks/{postal-code-input-BznBxVxf.js → postal-code-input-Dv02t5MD.js} +3 -3
  164. package/dist/_chunks/{practice-profile-hero-B-WcJYNH.js → practice-profile-hero-Bc3AyBiM.js} +4 -4
  165. package/dist/_chunks/{practice-results-EKRiqWtQ.js → practice-results-DjhcggtZ.js} +29 -29
  166. package/dist/_chunks/{pregnancy-dating-lfjjZVZH.js → pregnancy-dating-CcPxK3S3.js} +14 -14
  167. package/dist/_chunks/{pregnancy-weight-gain-WpNt-S0q.js → pregnancy-weight-gain-tGbbravi.js} +6 -6
  168. package/dist/_chunks/{privacy-lock-D6gq0GDg.js → privacy-lock-Bh4O7Y7g.js} +17 -17
  169. package/dist/_chunks/{privacy-mask-BC5lw2zB.js → privacy-mask-noG15O9q.js} +24 -24
  170. package/dist/_chunks/{product-hub-panel-CKeSCSeE.js → product-hub-panel-BmBzDba9.js} +24 -24
  171. package/dist/_chunks/{progress-CK8otcQ-.js → progress-TIAsNHQW.js} +4 -4
  172. package/dist/_chunks/{province-select-BiszMRRY.js → province-select-BZtM0RSR.js} +3 -3
  173. package/dist/_chunks/{pt-BSPnVrQ7.js → pt-BxhT5ZQH.js} +10 -10
  174. package/dist/_chunks/{public-footer.agent-BKkK3T3V.js → public-footer.agent-CVYmHY94.js} +4 -4
  175. package/dist/_chunks/{public-header.agent-B9wDmUeB.js → public-header.agent-1mcrQqIM.js} +4 -4
  176. package/dist/_chunks/{qr-code-DOJs4suh.js → qr-code-C3m9o7om.js} +2 -2
  177. package/dist/_chunks/{radiograph-panel.agent-TmyIvTOa.js → radiograph-panel.agent-BP71J_VB.js} +14 -14
  178. package/dist/_chunks/{rating-BYbUowdK.js → rating-C1Vrmpsi.js} +2 -2
  179. package/dist/_chunks/{recaptcha-widget-BC-4To9b.js → recaptcha-widget-BNAeSTCo.js} +2 -2
  180. package/dist/_chunks/{resizable-DVGcfOrk.js → resizable-BKkNmZCl.js} +2 -2
  181. package/dist/_chunks/resource-chip-DQeCJzJf.js +143 -0
  182. package/dist/_chunks/{reviews-panel-BdwFp_0c.js → reviews-panel-DDb_t7vy.js} +8 -8
  183. package/dist/_chunks/rich-text-editor-C7N4Cem6.js +4231 -0
  184. package/dist/_chunks/{ro-BbiylGmG.js → ro-Do9W55ae.js} +2 -2
  185. package/dist/_chunks/{ru-BX_qsV67.js → ru-PDBX5gdf.js} +13 -13
  186. package/dist/_chunks/{search-bar-6bHatpYJ.js → search-bar-Blq_QeSe.js} +4 -4
  187. package/dist/_chunks/{search-input-B7GmlPIE.js → search-input-DfsAu3P2.js} +4 -4
  188. package/dist/_chunks/{select-upNAltly.js → select-Br88h070.js} +2 -2
  189. package/dist/_chunks/{session-countdown-ACJyTXH2.js → session-countdown-DWUVDDox.js} +4 -4
  190. package/dist/_chunks/{sheet-D0Lh0KR2.js → sheet-BE6oi30q.js} +3 -3
  191. package/dist/_chunks/{sidebar-DbZXLl8h.js → sidebar-2GBc0ZUa.js} +7 -7
  192. package/dist/_chunks/{sign-document-CRQuAn4W.js → sign-document-Buw-zC_7.js} +4 -4
  193. package/dist/_chunks/{sign-in-with-alfadocs-button-CDyJAIzW.js → sign-in-with-alfadocs-button-Bd4VPGQh.js} +4 -4
  194. package/dist/_chunks/{signature-capture-D6ut9_IR.js → signature-capture-F6KViBF_.js} +2 -2
  195. package/dist/_chunks/{signature-field-0rFODJlW.js → signature-field-DBIGiY-J.js} +3 -3
  196. package/dist/_chunks/{signature-request-BUGeG8oD.js → signature-request-DqZkn-iB.js} +156 -156
  197. package/dist/_chunks/{signature-status-chip-Dz6sS2oA.js → signature-status-chip-DP3qRijv.js} +3 -3
  198. package/dist/_chunks/{skip-link-BaSMtPwB.js → skip-link-BOQzBUVb.js} +2 -2
  199. package/dist/_chunks/{slider-DN1CWkKB.js → slider-BRq2lL-l.js} +2 -2
  200. package/dist/_chunks/{slot-grid-4fWH3Euk.js → slot-grid-Bkg9MVXP.js} +7 -7
  201. package/dist/_chunks/{smart-date-CsPlilQA.js → smart-date-pYK6WmM_.js} +2 -2
  202. package/dist/_chunks/{social-sign-in-button-dlpPI5l7.js → social-sign-in-button-Bb2UQpsA.js} +8 -8
  203. package/dist/_chunks/{sparkline-Dx_sxK3J.js → sparkline-ZOxMBU76.js} +3 -3
  204. package/dist/_chunks/{spinner-hbwuKwMf.js → spinner-DxjSZLD-.js} +2 -2
  205. package/dist/_chunks/{sq-i9UOk4P7.js → sq-DnvsgyIh.js} +6 -6
  206. package/dist/_chunks/{stat-Bs80Z6Yv.js → stat-Ce9ymEKm.js} +3 -3
  207. package/dist/_chunks/{stepper-accordion-jMR8NaOB.js → stepper-accordion-BPNS6J6B.js} +2 -2
  208. package/dist/_chunks/{stepper-progress-Bv0njx4g.js → stepper-progress-D6H8wQiV.js} +2 -2
  209. package/dist/_chunks/{streaming-text-eRiizArc.js → streaming-text-D0IJeRBg.js} +2 -2
  210. package/dist/_chunks/subDays-XBMBTVOO.js +8 -0
  211. package/dist/_chunks/{suggestion-chip-Bk4PmYTg.js → suggestion-chip-BNRWZL51.js} +2 -2
  212. package/dist/_chunks/{sv-CpTdtmDQ.js → sv-CpFSK8xS.js} +4 -4
  213. package/dist/_chunks/{switch-OILsBLWo.js → switch-DXGD2Drz.js} +2 -2
  214. package/dist/_chunks/{tab-bar-BHFf6knq.js → tab-bar-DRKiomgj.js} +4 -4
  215. package/dist/_chunks/tabs-DLXVEDsa.js +413 -0
  216. package/dist/_chunks/{tag-B65tLWvD.js → tag-CS5cXpfx.js} +2 -2
  217. package/dist/_chunks/{task-card-jaOhnj_q.js → task-card-CngF4Zee.js} +3 -3
  218. package/dist/_chunks/{task-editor-DlvTwAfv.js → task-editor-Dz93rRXg.js} +18 -18
  219. package/dist/_chunks/{task-tray-HHyxi9ga.js → task-tray-CB6_BvH9.js} +5 -5
  220. package/dist/_chunks/{tasks-panel-DbSjq_mz.js → tasks-panel-DHAoTQtR.js} +11 -11
  221. package/dist/_chunks/{text-area-Bt3p7Pt0.js → text-area-Cjtw7mna.js} +2 -2
  222. package/dist/_chunks/{text-input-CUvCb6ST.js → text-input-CLaItY93.js} +2 -2
  223. package/dist/_chunks/{theme-toggle-LUBxlNDm.js → theme-toggle-Byg0x2vB.js} +10 -10
  224. package/dist/_chunks/{time-picker-D0RS391l.js → time-picker-BG7G3ujX.js} +2 -2
  225. package/dist/_chunks/{timeline-ChY7iZrs.js → timeline-CVLjybJ3.js} +4 -4
  226. package/dist/_chunks/{timestamp-BV2lC-wV.js → timestamp-DPLDWdxA.js} +2 -2
  227. package/dist/_chunks/{toast-CT8hjr9r.js → toast-6wbpghjF.js} +3 -3
  228. package/dist/_chunks/{token-insert-menu-klwbxVKh.js → token-insert-menu-DgtBIbNu.js} +3 -3
  229. package/dist/_chunks/{tool-rail-DEeX4PdN.js → tool-rail-CXcLzxPb.js} +4 -4
  230. package/dist/_chunks/{tooth-finding-palette-vqC-D2Ye.js → tooth-finding-palette-DNQ3G2Tz.js} +2 -2
  231. package/dist/_chunks/{tooth-scheme-BkjhkI8g.js → tooth-scheme-BLbwUVer.js} +663 -718
  232. package/dist/_chunks/{tr-DXG2QN1K.js → tr-DW4oQYHT.js} +5 -5
  233. package/dist/_chunks/{transaction-chip-CwgcJiqF.js → transaction-chip-CohY6sTA.js} +6 -6
  234. package/dist/_chunks/{transcript-panel-u2HHxZB6.js → transcript-panel-Dve7bsm7.js} +3 -3
  235. package/dist/_chunks/{treatment-receipt-C-gWZ6uv.js → treatment-receipt-DF2Slh-x.js} +5 -5
  236. package/dist/_chunks/{typing-indicator-DHeVN4ob.js → typing-indicator-BmwMQSxw.js} +9 -9
  237. package/dist/_chunks/{unit-converter-Dp_KDxE6.js → unit-converter-D8WnJbZm.js} +6 -6
  238. package/dist/_chunks/use-appointment-details-read-YsuJgYeB.js +2198 -0
  239. package/dist/_chunks/{use-edge-resize-BHesP0kg.js → use-edge-resize-DHbyQwu8.js} +15 -15
  240. package/dist/_chunks/use-locale-BExNy9Dl.js +16 -0
  241. package/dist/_chunks/{use-password-requirements-Bwtqx1qN.js → use-password-requirements-DK4hV1Ik.js} +4 -4
  242. package/dist/_chunks/{variables-menu-aJLKJ_cu.js → variables-menu-DQl8H4Gh.js} +2 -2
  243. package/dist/_chunks/{wallet-pay-button--dnR6NfJ.js → wallet-pay-button-C-GFl7RO.js} +3 -3
  244. package/dist/_chunks/{warning-stack-CEgYkI1z.js → warning-stack-CzKSeB5v.js} +5 -5
  245. package/dist/_chunks/{whatsapp-button-Ai4YAVkl.js → whatsapp-button-DV9JFmtq.js} +2 -2
  246. package/dist/_chunks/{widget-picker-CilQvcNL.js → widget-picker-b5NCHxFe.js} +28 -28
  247. package/dist/_chunks/{workflow-map-qGkQTNvS.js → workflow-map-C7fHKTXL.js} +17 -17
  248. package/dist/_chunks/{workflow-status-ClHfz4Kr.js → workflow-status-DDnsIrLt.js} +4 -4
  249. package/dist/_chunks/{zh-CN-vPkPEK6H.js → zh-CN-QGEs29fQ.js} +7 -7
  250. package/dist/agent-catalog.json +103 -38
  251. package/dist/agent-i18n/en.json +7 -4
  252. package/dist/components/_shared/date-locale.d.ts +2 -2
  253. package/dist/components/_shared/day-picker-labels.d.ts +6 -0
  254. package/dist/components/_shared/entity-card/entity-card.d.ts +1 -1
  255. package/dist/components/_shared/intl-locale.d.ts +10 -0
  256. package/dist/components/address-autocomplete/index.js +1 -1
  257. package/dist/components/address-fields/index.js +1 -1
  258. package/dist/components/agenda-card/index.js +1 -1
  259. package/dist/components/agenda-tray/index.js +1 -1
  260. package/dist/components/ai-credits-notice/index.js +1 -1
  261. package/dist/components/ai-permission-notice/index.js +1 -1
  262. package/dist/components/ai-prompt-input/index.js +1 -1
  263. package/dist/components/alert/index.js +1 -1
  264. package/dist/components/anamnesis-card/index.js +1 -1
  265. package/dist/components/anamnesis-summary-card/anamnesis-summary-card.d.ts +1 -1
  266. package/dist/components/anamnesis-summary-card/index.js +1 -1
  267. package/dist/components/annotation-marker/index.js +1 -1
  268. package/dist/components/app-frame/index.js +1 -1
  269. package/dist/components/appointment-card/index.js +2 -2
  270. package/dist/components/appointment-details-panel/appointment-details-panel.d.ts +3 -0
  271. package/dist/components/appointment-details-panel/appointment-details-panel.history.d.ts +19 -5
  272. package/dist/components/appointment-details-panel/appointment-details-panel.sections.d.ts +6 -2
  273. package/dist/components/appointment-details-panel/appointment-details-panel.types.d.ts +51 -1
  274. package/dist/components/appointment-details-panel/index.d.ts +1 -1
  275. package/dist/components/appointment-details-panel/index.js +1 -1
  276. package/dist/components/appointment-peek/index.js +1 -1
  277. package/dist/components/appointment-timeline/index.js +1 -1
  278. package/dist/components/audio-recorder/index.js +1 -1
  279. package/dist/components/audio-visualiser/index.js +1 -1
  280. package/dist/components/autocomplete/index.js +1 -1
  281. package/dist/components/avatar/index.js +1 -1
  282. package/dist/components/badge/index.js +1 -1
  283. package/dist/components/bishop-score/index.js +1 -1
  284. package/dist/components/bmi-calculator/index.js +1 -1
  285. package/dist/components/booking/index.js +1 -1
  286. package/dist/components/breadcrumb/index.js +1 -1
  287. package/dist/components/button/button.d.ts +11 -0
  288. package/dist/components/button/icon-button.d.ts +4 -0
  289. package/dist/components/button/index.js +2 -2
  290. package/dist/components/button-group/index.js +1 -1
  291. package/dist/components/calculator-dialog/index.js +1 -1
  292. package/dist/components/calendar/calendar-locale.d.ts +5 -0
  293. package/dist/components/calendar/calendar.d.ts +6 -4
  294. package/dist/components/calendar/index.js +1 -1
  295. package/dist/components/calendar-event-card/index.js +1 -1
  296. package/dist/components/care-plan-card/index.js +1 -1
  297. package/dist/components/care-plan-entry-card/index.js +1 -1
  298. package/dist/components/care-plan-header/index.js +1 -1
  299. package/dist/components/carousel/index.js +1 -1
  300. package/dist/components/chart/chart.d.ts +1 -1
  301. package/dist/components/chart/index.js +1 -1
  302. package/dist/components/chat-container/index.js +1 -1
  303. package/dist/components/chat-input/index.js +1 -1
  304. package/dist/components/chat-message/index.js +1 -1
  305. package/dist/components/checkbox-group/index.js +1 -1
  306. package/dist/components/city-input/index.js +1 -1
  307. package/dist/components/clinical-note-card/index.js +1 -1
  308. package/dist/components/color-picker/index.js +1 -1
  309. package/dist/components/combobox/index.js +1 -1
  310. package/dist/components/command-palette/index.js +1 -1
  311. package/dist/components/connection-status/index.js +1 -1
  312. package/dist/components/contact-card/index.js +1 -1
  313. package/dist/components/contact-profile-card/index.js +1 -1
  314. package/dist/components/control-room-rail/index.js +1 -1
  315. package/dist/components/copy-field/index.js +1 -1
  316. package/dist/components/country-select/index.js +1 -1
  317. package/dist/components/cycle-calculator/index.js +1 -1
  318. package/dist/components/dashboard-grid/index.js +1 -1
  319. package/dist/components/data-table/ag-grid-locale.d.ts +5 -0
  320. package/dist/components/data-table/index.js +4 -4
  321. package/dist/components/data-table-tabs/index.js +1 -1
  322. package/dist/components/date-picker/index.js +1 -1
  323. package/dist/components/date-range-picker/index.js +1 -1
  324. package/dist/components/date-time-picker/index.js +1 -1
  325. package/dist/components/dependent-selector/index.js +1 -1
  326. package/dist/components/description-list/index.js +1 -1
  327. package/dist/components/dialog/index.js +1 -1
  328. package/dist/components/document-preview/index.js +1 -1
  329. package/dist/components/document-scanner/index.js +1 -1
  330. package/dist/components/dropdown-menu/dropdown-menu.d.ts +52 -2
  331. package/dist/components/dropdown-menu/index.d.ts +1 -1
  332. package/dist/components/dropdown-menu/index.js +1 -1
  333. package/dist/components/due-date-calculator/index.js +2 -2
  334. package/dist/components/editable-description/index.js +1 -1
  335. package/dist/components/editor-overlay/index.js +1 -1
  336. package/dist/components/email-input/index.js +1 -1
  337. package/dist/components/empty-state/index.js +1 -1
  338. package/dist/components/entity-summary/index.js +1 -1
  339. package/dist/components/error-boundary/index.js +1 -1
  340. package/dist/components/face-scheme/index.js +1 -1
  341. package/dist/components/fetal-weight/index.js +1 -1
  342. package/dist/components/field-array/index.js +1 -1
  343. package/dist/components/file-manager/index.js +1 -1
  344. package/dist/components/file-upload/index.js +1 -1
  345. package/dist/components/finished-terminal/index.js +1 -1
  346. package/dist/components/fiscal-code-input/index.js +1 -1
  347. package/dist/components/floating-action-button/index.js +1 -1
  348. package/dist/components/form-field/index.js +1 -1
  349. package/dist/components/freemium-paywall/index.js +1 -1
  350. package/dist/components/gestational-age-calculator/index.js +1 -1
  351. package/dist/components/hcg-doubling/hcg.d.ts +1 -1
  352. package/dist/components/hcg-doubling/index.js +1 -1
  353. package/dist/components/header/index.js +1 -1
  354. package/dist/components/header-settings/header-settings.d.ts +3 -3
  355. package/dist/components/header-settings/index.js +1 -1
  356. package/dist/components/hover-card/index.js +1 -1
  357. package/dist/components/iban-input/index.js +1 -1
  358. package/dist/components/icon-button/index.js +1 -1
  359. package/dist/components/icon-button-group/index.js +1 -1
  360. package/dist/components/icon-picker/index.js +1 -1
  361. package/dist/components/image-cropper/index.js +1 -1
  362. package/dist/components/info-tip/index.js +1 -1
  363. package/dist/components/kbd/index.js +1 -1
  364. package/dist/components/key-value-pair/index.js +1 -1
  365. package/dist/components/link/index.js +1 -1
  366. package/dist/components/list/index.js +1 -1
  367. package/dist/components/locale-picker/index.js +1 -1
  368. package/dist/components/locale-picker/locale-picker.d.ts +7 -0
  369. package/dist/components/map-view/index.js +1 -1
  370. package/dist/components/message-card/index.js +1 -1
  371. package/dist/components/message-tray/index.js +1 -1
  372. package/dist/components/money/index.js +1 -1
  373. package/dist/components/multi-select/index.js +1 -1
  374. package/dist/components/muscle-scheme/index.js +1 -1
  375. package/dist/components/nav-grid/index.js +1 -1
  376. package/dist/components/navigation-menu/index.js +2 -2
  377. package/dist/components/note-timeline/index.js +1 -1
  378. package/dist/components/notes-panel/index.js +1 -1
  379. package/dist/components/notification-card/index.js +1 -1
  380. package/dist/components/notification-tray/index.js +1 -1
  381. package/dist/components/number-input/index.js +1 -1
  382. package/dist/components/operator-hero/index.js +1 -1
  383. package/dist/components/operator-hero/operator-hero.d.ts +1 -1
  384. package/dist/components/optical-prescription/index.js +1 -1
  385. package/dist/components/otp-input/index.js +1 -1
  386. package/dist/components/pagination/index.js +1 -1
  387. package/dist/components/panel-subview/index.js +1 -1
  388. package/dist/components/password-input/index.js +1 -1
  389. package/dist/components/patient-details/index.js +1 -1
  390. package/dist/components/patient-details/patient-details.d.ts +1 -1
  391. package/dist/components/patient-search/index.js +1 -1
  392. package/dist/components/patient-summary-card/index.js +1 -1
  393. package/dist/components/patient-summary-card/patient-summary-card.d.ts +1 -1
  394. package/dist/components/patient-table/index.js +1 -1
  395. package/dist/components/payment-card/index.js +1 -1
  396. package/dist/components/payment-form/index.js +1 -1
  397. package/dist/components/pdf-viewer/index.js +1 -1
  398. package/dist/components/periodontal-chart/index.js +1 -1
  399. package/dist/components/periodontal-chart-card/index.js +1 -1
  400. package/dist/components/periodontal-diagnosis/index.js +1 -1
  401. package/dist/components/periodontal-risk-chart/index.js +1 -1
  402. package/dist/components/permission-matrix/index.js +1 -1
  403. package/dist/components/phone-input/index.js +1 -1
  404. package/dist/components/popover/index.js +1 -1
  405. package/dist/components/position-grid/index.js +1 -1
  406. package/dist/components/postal-code-input/index.js +1 -1
  407. package/dist/components/practice-profile-hero/index.js +1 -1
  408. package/dist/components/practice-results/index.js +1 -1
  409. package/dist/components/pregnancy-dating/index.js +1 -1
  410. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  411. package/dist/components/privacy-lock/index.js +1 -1
  412. package/dist/components/product-hub-tray/index.js +1 -1
  413. package/dist/components/progress/index.js +1 -1
  414. package/dist/components/province-select/index.js +1 -1
  415. package/dist/components/public-footer/index.js +1 -1
  416. package/dist/components/public-header/index.js +1 -1
  417. package/dist/components/qr-code/index.js +1 -1
  418. package/dist/components/radiograph-panel/index.js +1 -1
  419. package/dist/components/rating/index.js +1 -1
  420. package/dist/components/recaptcha-widget/index.js +1 -1
  421. package/dist/components/resizable/index.js +1 -1
  422. package/dist/components/resource-chip/index.d.ts +1 -1
  423. package/dist/components/resource-chip/index.js +3 -2
  424. package/dist/components/resource-chip/resource-chip.d.ts +20 -0
  425. package/dist/components/reviews-panel/index.js +1 -1
  426. package/dist/components/rich-text-editor/index.js +2 -2
  427. package/dist/components/rich-text-editor/redactor-locale.d.ts +4 -0
  428. package/dist/components/rich-text-editor/rich-text-editor.d.ts +8 -3
  429. package/dist/components/search-bar/index.js +1 -1
  430. package/dist/components/search-input/index.js +1 -1
  431. package/dist/components/select/index.js +1 -1
  432. package/dist/components/session-countdown/index.js +1 -1
  433. package/dist/components/sheet/index.js +1 -1
  434. package/dist/components/sidebar/index.js +1 -1
  435. package/dist/components/sign-document/index.js +1 -1
  436. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  437. package/dist/components/signature-capture/index.js +1 -1
  438. package/dist/components/signature-field/index.js +1 -1
  439. package/dist/components/signature-status-chip/index.js +1 -1
  440. package/dist/components/skeleton-scheme/index.js +3 -3
  441. package/dist/components/skip-link/index.js +1 -1
  442. package/dist/components/skip-link/skip-link.d.ts +1 -1
  443. package/dist/components/slider/index.js +1 -1
  444. package/dist/components/slot-grid/index.js +1 -1
  445. package/dist/components/smart-date/index.js +1 -1
  446. package/dist/components/smart-date/smart-date.d.ts +1 -1
  447. package/dist/components/social-sign-in-button/index.js +1 -1
  448. package/dist/components/sparkline/index.js +1 -1
  449. package/dist/components/spinner/index.js +1 -1
  450. package/dist/components/stat/index.js +1 -1
  451. package/dist/components/stepper-accordion/index.js +1 -1
  452. package/dist/components/stepper-progress/index.js +1 -1
  453. package/dist/components/streaming-text/index.js +1 -1
  454. package/dist/components/suggestion-chip/index.js +1 -1
  455. package/dist/components/switch/index.js +1 -1
  456. package/dist/components/tab-bar/index.js +1 -1
  457. package/dist/components/tabs/index.js +1 -1
  458. package/dist/components/tag/index.js +1 -1
  459. package/dist/components/task-card/index.js +1 -1
  460. package/dist/components/task-editor/index.js +1 -1
  461. package/dist/components/task-tray/index.js +1 -1
  462. package/dist/components/tasks-panel/index.js +1 -1
  463. package/dist/components/text-area/index.js +1 -1
  464. package/dist/components/text-input/index.js +1 -1
  465. package/dist/components/theme-toggle/index.js +1 -1
  466. package/dist/components/time-picker/index.js +1 -1
  467. package/dist/components/timeline/index.js +1 -1
  468. package/dist/components/timestamp/index.js +1 -1
  469. package/dist/components/toast/index.js +1 -1
  470. package/dist/components/token-insert-menu/index.js +1 -1
  471. package/dist/components/tool-rail/index.js +1 -1
  472. package/dist/components/tooth-finding-palette/index.js +1 -1
  473. package/dist/components/tooth-scheme/index.js +1 -1
  474. package/dist/components/tooth-scheme/tooth-scheme.d.ts +2 -2
  475. package/dist/components/transaction-chip/index.js +1 -1
  476. package/dist/components/transcript-panel/index.js +1 -1
  477. package/dist/components/treatment-receipt/index.js +1 -1
  478. package/dist/components/typing-indicator/index.js +1 -1
  479. package/dist/components/unit-converter/index.js +1 -1
  480. package/dist/components/variables-menu/index.js +1 -1
  481. package/dist/components/wallet-pay-button/index.js +1 -1
  482. package/dist/components/warning-stack/index.js +1 -1
  483. package/dist/components/whatsapp-button/index.js +1 -1
  484. package/dist/components/widget-picker/index.js +1 -1
  485. package/dist/components/workflow/index.js +1 -1
  486. package/dist/components/workflow/workflow-card.d.ts +1 -1
  487. package/dist/components/workflow-status/index.js +2 -2
  488. package/dist/hooks/index.js +2 -2
  489. package/dist/hooks/use-locale.d.ts +2 -16
  490. package/dist/i18n/config.d.ts +17 -13
  491. package/dist/i18n/config.js +127 -62
  492. package/dist/i18n/locale-meta.d.ts +1 -1
  493. package/dist/i18n/locales/ar.d.ts +915 -660
  494. package/dist/i18n/locales/ar.js +916 -665
  495. package/dist/i18n/locales/de.d.ts +722 -479
  496. package/dist/i18n/locales/de.js +723 -484
  497. package/dist/i18n/locales/el.d.ts +965 -722
  498. package/dist/i18n/locales/el.js +965 -726
  499. package/dist/i18n/locales/en.d.ts +308 -65
  500. package/dist/i18n/locales/en.js +309 -70
  501. package/dist/i18n/locales/es.d.ts +787 -541
  502. package/dist/i18n/locales/es.js +788 -546
  503. package/dist/i18n/locales/fr.d.ts +730 -484
  504. package/dist/i18n/locales/fr.js +731 -489
  505. package/dist/i18n/locales/hi.d.ts +875 -632
  506. package/dist/i18n/locales/hi.js +876 -637
  507. package/dist/i18n/locales/it.d.ts +937 -691
  508. package/dist/i18n/locales/it.js +943 -696
  509. package/dist/i18n/locales/ja.d.ts +698 -455
  510. package/dist/i18n/locales/ja.js +699 -460
  511. package/dist/i18n/locales/nl.d.ts +723 -480
  512. package/dist/i18n/locales/nl.js +724 -485
  513. package/dist/i18n/locales/pl.d.ts +1019 -770
  514. package/dist/i18n/locales/pl.js +1019 -774
  515. package/dist/i18n/locales/pt.d.ts +811 -562
  516. package/dist/i18n/locales/pt.js +812 -567
  517. package/dist/i18n/locales/ro.d.ts +1060 -814
  518. package/dist/i18n/locales/ro.js +1061 -819
  519. package/dist/i18n/locales/ru.d.ts +1037 -788
  520. package/dist/i18n/locales/ru.js +1032 -787
  521. package/dist/i18n/locales/sq.d.ts +1288 -1045
  522. package/dist/i18n/locales/sq.js +1288 -1049
  523. package/dist/i18n/locales/sv.d.ts +809 -566
  524. package/dist/i18n/locales/sv.js +810 -571
  525. package/dist/i18n/locales/tr.d.ts +768 -525
  526. package/dist/i18n/locales/tr.js +769 -530
  527. package/dist/i18n/locales/zh.d.ts +756 -513
  528. package/dist/i18n/locales/zh.js +757 -518
  529. package/dist/i18n/registerUiBundle.d.ts +3 -2
  530. package/dist/i18n/resources.d.ts +2 -7
  531. package/dist/i18n/supported-locales.d.ts +8 -0
  532. package/dist/index.js +552 -551
  533. package/dist/locales/ar.json +920 -665
  534. package/dist/locales/de.json +727 -484
  535. package/dist/locales/el.json +970 -727
  536. package/dist/locales/en.json +313 -70
  537. package/dist/locales/es.json +792 -546
  538. package/dist/locales/fr.json +735 -489
  539. package/dist/locales/hi.json +880 -637
  540. package/dist/locales/it.json +942 -696
  541. package/dist/locales/ja.json +703 -460
  542. package/dist/locales/nl.json +728 -485
  543. package/dist/locales/pl.json +1024 -775
  544. package/dist/locales/pt.json +816 -567
  545. package/dist/locales/ro.json +1065 -819
  546. package/dist/locales/ru.json +1042 -793
  547. package/dist/locales/sq.json +1293 -1050
  548. package/dist/locales/sv.json +814 -571
  549. package/dist/locales/tr.json +773 -530
  550. package/dist/locales/zh.json +761 -518
  551. package/dist/patterns/alia-assistant/index.js +1 -1
  552. package/dist/patterns/anamnesis/anamnesis-format.d.ts +1 -1
  553. package/dist/patterns/anamnesis/anamnesis-i18n.d.ts +3 -2
  554. package/dist/patterns/anamnesis/index.js +1 -1
  555. package/dist/patterns/anamnesis/locales/ar.d.ts +776 -0
  556. package/dist/patterns/anamnesis/locales/de.d.ts +740 -0
  557. package/dist/patterns/anamnesis/locales/el.d.ts +740 -0
  558. package/dist/patterns/anamnesis/locales/en.d.ts +740 -0
  559. package/dist/patterns/anamnesis/locales/es.d.ts +749 -0
  560. package/dist/patterns/anamnesis/locales/fr.d.ts +749 -0
  561. package/dist/patterns/anamnesis/locales/hi.d.ts +740 -0
  562. package/dist/patterns/anamnesis/locales/it.d.ts +749 -0
  563. package/dist/patterns/anamnesis/locales/ja.d.ts +740 -0
  564. package/dist/patterns/anamnesis/locales/nl.d.ts +740 -0
  565. package/dist/patterns/anamnesis/locales/pl.d.ts +758 -0
  566. package/dist/patterns/anamnesis/locales/pt.d.ts +758 -0
  567. package/dist/patterns/anamnesis/locales/ro.d.ts +749 -0
  568. package/dist/patterns/anamnesis/locales/ru.d.ts +758 -0
  569. package/dist/patterns/anamnesis/locales/sq.d.ts +740 -0
  570. package/dist/patterns/anamnesis/locales/sv.d.ts +740 -0
  571. package/dist/patterns/anamnesis/locales/tr.d.ts +740 -0
  572. package/dist/patterns/anamnesis/locales/zh.d.ts +740 -0
  573. package/dist/patterns/calendar/calendar-appointment-details.d.ts +4 -1
  574. package/dist/patterns/calendar/calendar-workspace.d.ts +5 -0
  575. package/dist/patterns/calendar/calendar.sheets.d.ts +4 -1
  576. package/dist/patterns/calendar/calendar.surface.d.ts +4 -1
  577. package/dist/patterns/calendar/calendar.types.d.ts +3 -1
  578. package/dist/patterns/calendar/index.d.ts +1 -1
  579. package/dist/patterns/calendar/index.js +1 -1
  580. package/dist/patterns/help-me-write-templates/index.js +1 -1
  581. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  582. package/dist/patterns/payment-automation-upsell/index.js +1 -1
  583. package/dist/patterns/signature-request/index.js +1 -1
  584. package/dist/tokens.css +6 -2
  585. package/package.json +12 -2
  586. package/dist/_chunks/anamnesis-summary-rows-CZirLRuv.js +0 -9416
  587. package/dist/_chunks/calendar-E6Yu4lzC.js +0 -1381
  588. package/dist/_chunks/calendar-workspace-DjbGFjg1.js +0 -10584
  589. package/dist/_chunks/data-table-CrI3_bjH.js +0 -1824
  590. package/dist/_chunks/dropdown-menu-C8PaW3lR.js +0 -369
  591. package/dist/_chunks/header-settings-ZXa6hXuu.js +0 -335
  592. package/dist/_chunks/resource-chip-DYTG0IQQ.js +0 -83
  593. package/dist/_chunks/rich-text-editor-y6ML0KeV.js +0 -4154
  594. package/dist/_chunks/subDays-HPvBuvq3.js +0 -8
  595. package/dist/_chunks/tabs-CFsuMQ5H.js +0 -409
  596. package/dist/_chunks/use-appointment-details-read-5-hV-2xA.js +0 -2045
  597. package/dist/_chunks/use-locale-BkCIHujH.js +0 -20
@@ -0,0 +1,4231 @@
1
+ import { jsx as t, jsxs as A, Fragment as Ie } from "react/jsx-runtime";
2
+ import { useId as qe, useState as N, useRef as C, useCallback as v, useEffect as _, Fragment as gt, forwardRef as Zo, useMemo as tt, useImperativeHandle as Qo } from "react";
3
+ import { c as Bn } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as re } from "react-i18next";
5
+ import { SafeHtml as Yo, sanitiseHtml as Jo } from "../safe-html/index.js";
6
+ import { u as ei } from "./registry-DvAUVLHh.js";
7
+ import { u as ti } from "./use-ai-sparkle-Cf4yVTLB.js";
8
+ import { S as Pn } from "./spinner-DxjSZLD-.js";
9
+ import { A as ni } from "./ai-sparkle-D23NT8Z_.js";
10
+ import { B as Ee } from "./button-CYPx2xFq.js";
11
+ import { I as j } from "./icon-button-JAXAkqWC.js";
12
+ import { A as ri } from "./ai-permission-notice-C5q_uHBA.js";
13
+ import { T as oi } from "./text-area-Cjtw7mna.js";
14
+ import { E as Sn } from "./editor-overlay-C0awV6ba.js";
15
+ import { X as Sr } from "./x-B5YnXwCz.js";
16
+ import { R as ii } from "./rotate-ccw-BBQnIVTr.js";
17
+ import { C as ai } from "./check-DrFSN__t.js";
18
+ import { S as Tt } from "./square-DASBRZ0U.js";
19
+ import { M as Ln } from "./mic-CUklMZGF.js";
20
+ import { S as si } from "./send-C5kDJ-Mz.js";
21
+ import { D as X } from "./dropdown-menu-B5mgV1kV.js";
22
+ import * as Zt from "@radix-ui/react-popover";
23
+ import { V as Xr } from "./variables-menu-DQl8H4Gh.js";
24
+ import { a as Fn } from "./tooltip-Cp-PLePW.js";
25
+ import { P as ne } from "./popover-CGYPYIVi.js";
26
+ import { D as ae } from "./dialog-D52AI4nF.js";
27
+ import { C as jn } from "./color-picker-Yl99lHuF.js";
28
+ import { T as en } from "./text-input-CLaItY93.js";
29
+ import { C as li } from "./checkbox-CZkipDn7.js";
30
+ import { F as ci } from "./file-upload-OMlGHz70.js";
31
+ import { c as I } from "./createLucideIcon-DhHxpK9K.js";
32
+ import { E as di } from "./ellipsis-dRo9ouSU.js";
33
+ import { H as ui, U as mi } from "./undo-2-CYNAzclj.js";
34
+ import { I as fi } from "./image-B_5MNK0x.js";
35
+ import { C as Ur } from "./chevron-down-DWE7GSq9.js";
36
+ import { P as gi } from "./plus-DzMQ_c6b.js";
37
+ import { S as hi } from "./settings-d25ju_6L.js";
38
+ import { T as pi } from "./trash-2-uumy3fy1.js";
39
+ import { H as Hn, u as bi } from "./hover-card-DEMPFs9M.js";
40
+ import { A as vi } from "./ai-credits-notice-Da0fJPXO.js";
41
+ /**
42
+ * @license lucide-react v1.22.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */
47
+ const yi = [
48
+ ["path", { d: "M4 20h16", key: "14thso" }],
49
+ ["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
50
+ ["path", { d: "M8 12h8", key: "1wcyev" }]
51
+ ], wi = I("baseline", yi);
52
+ /**
53
+ * @license lucide-react v1.22.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */
58
+ const ki = [
59
+ ["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
60
+ ["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
61
+ ["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
62
+ ], xi = I("between-horizontal-end", ki);
63
+ /**
64
+ * @license lucide-react v1.22.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */
69
+ const Ci = [
70
+ ["rect", { width: "13", height: "7", x: "8", y: "3", rx: "1", key: "pkso9a" }],
71
+ ["path", { d: "m2 9 3 3-3 3", key: "1agib5" }],
72
+ ["rect", { width: "13", height: "7", x: "8", y: "14", rx: "1", key: "1q5fc1" }]
73
+ ], Ai = I("between-horizontal-start", Ci);
74
+ /**
75
+ * @license lucide-react v1.22.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */
80
+ const Ti = [
81
+ ["rect", { width: "7", height: "13", x: "3", y: "3", rx: "1", key: "1fdu0f" }],
82
+ ["path", { d: "m9 22 3-3 3 3", key: "17z65a" }],
83
+ ["rect", { width: "7", height: "13", x: "14", y: "3", rx: "1", key: "1squn4" }]
84
+ ], Ei = I("between-vertical-end", Ti);
85
+ /**
86
+ * @license lucide-react v1.22.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */
91
+ const Ni = [
92
+ ["rect", { width: "7", height: "13", x: "3", y: "8", rx: "1", key: "1fjrkv" }],
93
+ ["path", { d: "m15 2-3 3-3-3", key: "1uh6eb" }],
94
+ ["rect", { width: "7", height: "13", x: "14", y: "8", rx: "1", key: "w3fjg8" }]
95
+ ], Mi = I("between-vertical-start", Ni);
96
+ /**
97
+ * @license lucide-react v1.22.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */
102
+ const Ri = [
103
+ [
104
+ "path",
105
+ {
106
+ d: "M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",
107
+ key: "1ah6g2"
108
+ }
109
+ ],
110
+ ["rect", { x: "14", y: "2", width: "8", height: "8", rx: "1", key: "88lufb" }]
111
+ ], In = I("blocks", Ri);
112
+ /**
113
+ * @license lucide-react v1.22.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */
118
+ const zi = [
119
+ [
120
+ "path",
121
+ { d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
122
+ ]
123
+ ], _i = I("bold", zi);
124
+ /**
125
+ * @license lucide-react v1.22.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */
130
+ const Si = [
131
+ [
132
+ "path",
133
+ { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
134
+ ],
135
+ [
136
+ "path",
137
+ {
138
+ d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
139
+ key: "e1hn23"
140
+ }
141
+ ]
142
+ ], Li = I("braces", Si);
143
+ /**
144
+ * @license lucide-react v1.22.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */
149
+ const Hi = [
150
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
151
+ ["path", { d: "M12 3v18", key: "108xh3" }]
152
+ ], Ii = I("columns-2", Hi);
153
+ /**
154
+ * @license lucide-react v1.22.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */
159
+ const $i = [
160
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
161
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
162
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
163
+ ["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
164
+ ], Di = I("heading-2", $i);
165
+ /**
166
+ * @license lucide-react v1.22.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */
171
+ const Oi = [
172
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
173
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
174
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
175
+ ["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
176
+ ["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
177
+ ], qi = I("heading-3", Oi);
178
+ /**
179
+ * @license lucide-react v1.22.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */
184
+ const Bi = [
185
+ ["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
186
+ ["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
187
+ ["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
188
+ ], Pi = I("italic", Bi);
189
+ /**
190
+ * @license lucide-react v1.22.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */
195
+ const Fi = [
196
+ ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
197
+ ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
198
+ ], ji = I("link", Fi);
199
+ /**
200
+ * @license lucide-react v1.22.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */
205
+ const Gi = [
206
+ ["path", { d: "M11 5h10", key: "1cz7ny" }],
207
+ ["path", { d: "M11 12h10", key: "1438ji" }],
208
+ ["path", { d: "M11 19h10", key: "11t30w" }],
209
+ ["path", { d: "M4 4h1v5", key: "10yrso" }],
210
+ ["path", { d: "M4 9h2", key: "r1h2o0" }],
211
+ ["path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02", key: "xtkcd5" }]
212
+ ], Ki = I("list-ordered", Gi);
213
+ /**
214
+ * @license lucide-react v1.22.0 - ISC
215
+ *
216
+ * This source code is licensed under the ISC license.
217
+ * See the LICENSE file in the root directory of this source tree.
218
+ */
219
+ const Vi = [
220
+ ["path", { d: "M3 5h.01", key: "18ugdj" }],
221
+ ["path", { d: "M3 12h.01", key: "nlz23k" }],
222
+ ["path", { d: "M3 19h.01", key: "noohij" }],
223
+ ["path", { d: "M8 5h13", key: "1pao27" }],
224
+ ["path", { d: "M8 12h13", key: "1za7za" }],
225
+ ["path", { d: "M8 19h13", key: "m83p4d" }]
226
+ ], Wi = I("list", Vi);
227
+ /**
228
+ * @license lucide-react v1.22.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */
233
+ const Xi = [
234
+ ["path", { d: "M11 7 6 2", key: "1jwth8" }],
235
+ ["path", { d: "M18.992 12H2.041", key: "xw1gg" }],
236
+ [
237
+ "path",
238
+ {
239
+ d: "M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595",
240
+ key: "1nkol4"
241
+ }
242
+ ],
243
+ [
244
+ "path",
245
+ {
246
+ d: "m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33",
247
+ key: "1nk1rd"
248
+ }
249
+ ]
250
+ ], Ui = I("paint-bucket", Xi);
251
+ /**
252
+ * @license lucide-react v1.22.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */
257
+ const Zi = [
258
+ ["rect", { width: "16", height: "6", x: "2", y: "2", rx: "2", key: "jcyz7m" }],
259
+ ["path", { d: "M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2", key: "1b9h7c" }],
260
+ ["rect", { width: "4", height: "6", x: "8", y: "16", rx: "1", key: "d6e7yl" }]
261
+ ], Qi = I("paint-roller", Zi);
262
+ /**
263
+ * @license lucide-react v1.22.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */
268
+ const Yi = [
269
+ [
270
+ "path",
271
+ {
272
+ d: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",
273
+ key: "e79jfc"
274
+ }
275
+ ],
276
+ ["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
277
+ ["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
278
+ ["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
279
+ ["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
280
+ ], Ji = I("palette", Yi);
281
+ /**
282
+ * @license lucide-react v1.22.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */
287
+ const ea = [
288
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
289
+ ["path", { d: "M9 3v18", key: "fh3hqa" }]
290
+ ], ta = I("panel-left", ea);
291
+ /**
292
+ * @license lucide-react v1.22.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */
297
+ const na = [
298
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
299
+ ["path", { d: "M15 3v18", key: "14nvp0" }]
300
+ ], ra = I("panel-right", na);
301
+ /**
302
+ * @license lucide-react v1.22.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */
307
+ const oa = [
308
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
309
+ ["path", { d: "M14 9h1", key: "l0svgy" }],
310
+ ["path", { d: "M19 9h2", key: "te2zfg" }],
311
+ ["path", { d: "M3 9h2", key: "1h4ldw" }],
312
+ ["path", { d: "M9 9h1", key: "15jzuz" }]
313
+ ], ia = I("panel-top-dashed", oa);
314
+ /**
315
+ * @license lucide-react v1.22.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */
320
+ const aa = [
321
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
322
+ ["path", { d: "M3 9h18", key: "1pudct" }]
323
+ ], sa = I("panel-top", aa);
324
+ /**
325
+ * @license lucide-react v1.22.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */
330
+ const la = [
331
+ ["path", { d: "M10 3H8", key: "mzdi2d" }],
332
+ ["path", { d: "m15.007 5.008 3.987 3.986", key: "1scubj" }],
333
+ ["path", { d: "M20 15v4", key: "nmhudv" }],
334
+ [
335
+ "path",
336
+ {
337
+ d: "M21.174 6.813a2.82 2.82 0 0 0-3.986-3.987L3.842 16.175a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
338
+ key: "fs0856"
339
+ }
340
+ ],
341
+ ["path", { d: "M22 17h-4", key: "1sj068" }],
342
+ ["path", { d: "M4 5v4", key: "13jjxc" }],
343
+ ["path", { d: "M6 7H2", key: "8zbtv0" }],
344
+ ["path", { d: "M9 2v2", key: "165o2o" }]
345
+ ], Lr = I("pencil-sparkles", la);
346
+ /**
347
+ * @license lucide-react v1.22.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */
352
+ const ca = [
353
+ ["path", { d: "M13 4v16", key: "8vvj80" }],
354
+ ["path", { d: "M17 4v16", key: "7dpous" }],
355
+ ["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
356
+ ], da = I("pilcrow", ca);
357
+ /**
358
+ * @license lucide-react v1.22.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */
363
+ const ua = [
364
+ [
365
+ "path",
366
+ {
367
+ d: "M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
368
+ key: "rib7q0"
369
+ }
370
+ ],
371
+ [
372
+ "path",
373
+ {
374
+ d: "M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",
375
+ key: "1ymkrd"
376
+ }
377
+ ]
378
+ ], ma = I("quote", ua);
379
+ /**
380
+ * @license lucide-react v1.22.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */
385
+ const fa = [
386
+ ["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
387
+ ["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13", key: "6uklza" }]
388
+ ], ga = I("redo-2", fa);
389
+ /**
390
+ * @license lucide-react v1.22.0 - ISC
391
+ *
392
+ * This source code is licensed under the ISC license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */
395
+ const ha = [
396
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
397
+ ["path", { d: "M3 12h18", key: "1i2n21" }]
398
+ ], pa = I("rows-2", ha);
399
+ /**
400
+ * @license lucide-react v1.22.0 - ISC
401
+ *
402
+ * This source code is licensed under the ISC license.
403
+ * See the LICENSE file in the root directory of this source tree.
404
+ */
405
+ const ba = [
406
+ ["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
407
+ ["path", { d: "M8 12h8", key: "1wcyev" }],
408
+ ["path", { d: "m16 20 2 2 4-4", key: "13tcca" }]
409
+ ], Hr = I("spell-check", ba);
410
+ /**
411
+ * @license lucide-react v1.22.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */
416
+ const va = [
417
+ ["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
418
+ ["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
419
+ ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
420
+ ], ya = I("strikethrough", va);
421
+ /**
422
+ * @license lucide-react v1.22.0 - ISC
423
+ *
424
+ * This source code is licensed under the ISC license.
425
+ * See the LICENSE file in the root directory of this source tree.
426
+ */
427
+ const wa = [
428
+ ["path", { d: "M12 3v18", key: "108xh3" }],
429
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
430
+ ["path", { d: "M3 9h18", key: "1pudct" }],
431
+ ["path", { d: "M3 15h18", key: "5xshup" }]
432
+ ], ka = I("table", wa);
433
+ /**
434
+ * @license lucide-react v1.22.0 - ISC
435
+ *
436
+ * This source code is licensed under the ISC license.
437
+ * See the LICENSE file in the root directory of this source tree.
438
+ */
439
+ const xa = [
440
+ ["path", { d: "M21 5H3", key: "1fi0y6" }],
441
+ ["path", { d: "M17 12H7", key: "16if0g" }],
442
+ ["path", { d: "M19 19H5", key: "vjpgq2" }]
443
+ ], Ca = I("text-align-center", xa);
444
+ /**
445
+ * @license lucide-react v1.22.0 - ISC
446
+ *
447
+ * This source code is licensed under the ISC license.
448
+ * See the LICENSE file in the root directory of this source tree.
449
+ */
450
+ const Aa = [
451
+ ["path", { d: "M21 5H3", key: "1fi0y6" }],
452
+ ["path", { d: "M21 12H9", key: "dn1m92" }],
453
+ ["path", { d: "M21 19H7", key: "4cu937" }]
454
+ ], Ta = I("text-align-end", Aa);
455
+ /**
456
+ * @license lucide-react v1.22.0 - ISC
457
+ *
458
+ * This source code is licensed under the ISC license.
459
+ * See the LICENSE file in the root directory of this source tree.
460
+ */
461
+ const Ea = [
462
+ ["path", { d: "M21 5H3", key: "1fi0y6" }],
463
+ ["path", { d: "M15 12H3", key: "6jk70r" }],
464
+ ["path", { d: "M17 19H3", key: "z6ezky" }]
465
+ ], Na = I("text-align-start", Ea);
466
+ /**
467
+ * @license lucide-react v1.22.0 - ISC
468
+ *
469
+ * This source code is licensed under the ISC license.
470
+ * See the LICENSE file in the root directory of this source tree.
471
+ */
472
+ const Ma = [
473
+ ["rect", { width: "18", height: "12", x: "3", y: "8", rx: "1", key: "158fvp" }],
474
+ ["path", { d: "M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3", key: "s0042v" }],
475
+ ["path", { d: "M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3", key: "9wmeh2" }]
476
+ ], $n = I("toy-brick", Ma);
477
+ /**
478
+ * @license lucide-react v1.22.0 - ISC
479
+ *
480
+ * This source code is licensed under the ISC license.
481
+ * See the LICENSE file in the root directory of this source tree.
482
+ */
483
+ const Ra = [
484
+ ["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
485
+ ["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
486
+ ], za = I("underline", Ra);
487
+ /**
488
+ * @license lucide-react v1.22.0 - ISC
489
+ *
490
+ * This source code is licensed under the ISC license.
491
+ * See the LICENSE file in the root directory of this source tree.
492
+ */
493
+ const _a = [
494
+ [
495
+ "path",
496
+ {
497
+ d: "m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",
498
+ key: "ul74o6"
499
+ }
500
+ ],
501
+ ["path", { d: "m14 7 3 3", key: "1r5n42" }],
502
+ ["path", { d: "M5 6v4", key: "ilb8ba" }],
503
+ ["path", { d: "M19 14v4", key: "blhpug" }],
504
+ ["path", { d: "M10 2v2", key: "7u0qdc" }],
505
+ ["path", { d: "M7 8H3", key: "zfb6yr" }],
506
+ ["path", { d: "M21 16h-4", key: "1cnmox" }],
507
+ ["path", { d: "M11 3H9", key: "1obp7u" }]
508
+ ], Ir = I("wand-sparkles", _a);
509
+ function $r(n) {
510
+ return {
511
+ format: n("editor.vendor.format"),
512
+ image: n("editor.vendor.image"),
513
+ file: n("editor.vendor.file"),
514
+ link: n("editor.vendor.link"),
515
+ bold: n("editor.bold"),
516
+ italic: n("editor.italic"),
517
+ deleted: n("editor.strike"),
518
+ underline: n("editor.underline"),
519
+ superscript: n("editor.vendor.superscript"),
520
+ subscript: n("editor.vendor.subscript"),
521
+ "bold-abbr": n("editor.vendor.boldAbbr"),
522
+ "italic-abbr": n("editor.vendor.italicAbbr"),
523
+ "deleted-abbr": n("editor.vendor.deletedAbbr"),
524
+ "underline-abbr": n("editor.vendor.underlineAbbr"),
525
+ "superscript-abbr": n("editor.vendor.superscriptAbbr"),
526
+ "subscript-abbr": n("editor.vendor.subscriptAbbr"),
527
+ lists: n("editor.vendor.lists"),
528
+ "link-insert": n("editor.link.insert"),
529
+ "link-edit": n("editor.link.edit"),
530
+ "link-in-new-tab": n("editor.vendor.linkInNewTab"),
531
+ unlink: n("editor.vendor.unlink"),
532
+ cancel: n("common.cancel"),
533
+ close: n("common.close"),
534
+ insert: n("editor.link.insertAction"),
535
+ save: n("common.save"),
536
+ delete: n("common.delete"),
537
+ text: n("editor.vendor.text"),
538
+ edit: n("editor.vendor.edit"),
539
+ title: n("editor.image.alt"),
540
+ paragraph: n("editor.vendor.paragraph"),
541
+ quote: n("editor.quote"),
542
+ code: n("editor.vendor.code"),
543
+ heading1: n("editor.vendor.heading1"),
544
+ heading2: n("editor.heading2"),
545
+ heading3: n("editor.heading3"),
546
+ heading4: n("editor.vendor.heading4"),
547
+ heading5: n("editor.vendor.heading5"),
548
+ heading6: n("editor.vendor.heading6"),
549
+ filename: n("editor.vendor.filename"),
550
+ optional: n("common.optional"),
551
+ unorderedlist: n("editor.vendor.unorderedlist"),
552
+ orderedlist: n("editor.vendor.orderedlist"),
553
+ outdent: n("editor.vendor.outdent"),
554
+ indent: n("editor.vendor.indent"),
555
+ horizontalrule: n("editor.vendor.horizontalrule"),
556
+ upload: n("editor.image.upload"),
557
+ "upload-label": n("editor.vendor.uploadLabel"),
558
+ "accessibility-help-label": n("editor.regionLabel"),
559
+ caption: n("editor.vendor.caption"),
560
+ bulletslist: n("editor.vendor.bulletslist"),
561
+ numberslist: n("editor.vendor.numberslist"),
562
+ "image-position": n("editor.vendor.imagePosition"),
563
+ none: n("editor.vendor.none"),
564
+ left: n("editor.vendor.left"),
565
+ right: n("editor.vendor.right"),
566
+ center: n("editor.vendor.center"),
567
+ undo: n("editor.undo"),
568
+ redo: n("editor.redo"),
569
+ size: n("editor.vendor.fontSize"),
570
+ "remove-size": n("editor.vendor.removeSize"),
571
+ fontcolor: n("editor.textColor"),
572
+ highlight: n("editor.highlightColor"),
573
+ table: n("editor.vendor.table"),
574
+ "insert-table": n("editor.table.insert"),
575
+ "insert-row-above": n("editor.table.rowAbove"),
576
+ "insert-row-below": n("editor.table.rowBelow"),
577
+ "insert-column-left": n("editor.table.columnLeft"),
578
+ "insert-column-right": n("editor.table.columnRight"),
579
+ "add-head": n("editor.table.addHeader"),
580
+ "delete-head": n("editor.table.deleteHeader"),
581
+ "delete-column": n("editor.table.deleteColumn"),
582
+ "delete-row": n("editor.table.deleteRow"),
583
+ "delete-table": n("editor.table.deleteTable")
584
+ };
585
+ }
586
+ const Sa = {
587
+ id: "rich-text-editor",
588
+ capabilities: ["edit_inline"],
589
+ state: {
590
+ html: {
591
+ type: "string",
592
+ descriptionKey: "ui.agent.richTextEditor.state.html",
593
+ description: "Sanitised HTML representation of the editor content.",
594
+ read: (n) => n.getHTML()
595
+ },
596
+ text: {
597
+ type: "string",
598
+ descriptionKey: "ui.agent.richTextEditor.state.text",
599
+ description: "Plain-text content of the editor (tags stripped).",
600
+ read: (n) => n.getText()
601
+ },
602
+ markdown: {
603
+ type: "string",
604
+ descriptionKey: "ui.agent.richTextEditor.state.markdown",
605
+ description: "Markdown representation of the editor content. The Redactor engine has no native Markdown serialiser, so this is always empty — read `html` instead.",
606
+ read: (n) => n.getMarkdown()
607
+ },
608
+ aiBusy: {
609
+ type: "boolean",
610
+ descriptionKey: "ui.agent.richTextEditor.state.aiBusy",
611
+ description: "True while a one-shot AI action (a practice template, spelling or auto-format) is rewriting the note. Read `html` once it is false.",
612
+ read: (n) => n.isAiBusy()
613
+ }
614
+ },
615
+ // Image wrap/align/resize are intentionally NOT agent actions — they target
616
+ // the ephemeral click-selected image the handle can't address. Agents emit
617
+ // `<img class="wysiwyg-img-*" style="width:N%">` via set_content instead.
618
+ actions: {
619
+ set_content: {
620
+ // Replaces the whole document — discards whatever the user had typed.
621
+ safety: "destructive",
622
+ argsType: "{ html: string }",
623
+ argsSchema: {
624
+ type: "object",
625
+ properties: {
626
+ html: {
627
+ type: "string",
628
+ description: "Replacement HTML (sanitised via DOMPurify)."
629
+ }
630
+ },
631
+ required: ["html"]
632
+ },
633
+ idempotent: !0,
634
+ descriptionKey: "ui.agent.richTextEditor.actions.setContent",
635
+ description: "Replace the editor content. Loses unsaved input.",
636
+ invoke: (n, a) => {
637
+ n.setContent(a.html);
638
+ }
639
+ },
640
+ insert_at_cursor: {
641
+ // Reversible via the editor's own undo stack — write, not destructive.
642
+ safety: "write",
643
+ argsType: "{ content: string; asHtml?: boolean }",
644
+ argsSchema: {
645
+ type: "object",
646
+ properties: {
647
+ content: {
648
+ type: "string",
649
+ description: "Content to insert at the caret."
650
+ },
651
+ asHtml: {
652
+ type: "boolean",
653
+ description: "Treat content as HTML (sanitised). Pass false for plain text. Defaults to true."
654
+ }
655
+ },
656
+ required: ["content"]
657
+ },
658
+ descriptionKey: "ui.agent.richTextEditor.actions.insertAtCursor",
659
+ description: "Insert content at the caret (replacing any selection). HTML is sanitised; pass asHtml:false for plain text. Seam for merge/template variables and AI-generated drafts.",
660
+ examples: [
661
+ {
662
+ args: { content: "{{patient.firstName}}", asHtml: !1 },
663
+ note: "Insert a merge variable as plain text."
664
+ }
665
+ ],
666
+ invoke: (n, a) => {
667
+ n.insertAtCursor(a.content, { asHtml: a.asHtml });
668
+ }
669
+ },
670
+ apply_format: {
671
+ // Reversible via undo — write, not destructive.
672
+ safety: "write",
673
+ argsType: "{ format: 'bold' | 'italic' | 'strikethrough' | 'bulletedList' | 'numberedList' | 'heading' | 'quote' | 'paragraph' }",
674
+ argsSchema: {
675
+ type: "object",
676
+ properties: {
677
+ format: {
678
+ type: "string",
679
+ enum: [
680
+ "bold",
681
+ "italic",
682
+ "strikethrough",
683
+ "bulletedList",
684
+ "numberedList",
685
+ "heading",
686
+ "quote",
687
+ "paragraph"
688
+ ],
689
+ description: "Block or inline format to toggle/apply."
690
+ }
691
+ },
692
+ required: ["format"]
693
+ },
694
+ descriptionKey: "ui.agent.richTextEditor.actions.applyFormat",
695
+ description: "Toggle/apply a block or inline format on the current selection (bold, italic, strikethrough, bulleted/numbered list, heading, quote, paragraph).",
696
+ examples: [{ args: { format: "bold" }, note: "Bold the selection." }],
697
+ invoke: (n, a) => {
698
+ n.applyFormat(a.format);
699
+ }
700
+ },
701
+ clear: {
702
+ // Empties the document — loses unsaved input.
703
+ safety: "destructive",
704
+ idempotent: !0,
705
+ descriptionKey: "ui.agent.richTextEditor.actions.clear",
706
+ description: "Empty the editor. Loses unsaved input.",
707
+ invoke: (n) => {
708
+ n.clear();
709
+ }
710
+ },
711
+ focus: {
712
+ safety: "read",
713
+ idempotent: !0,
714
+ descriptionKey: "ui.agent.richTextEditor.actions.focus",
715
+ description: "Move keyboard focus to the editor surface.",
716
+ invoke: (n) => {
717
+ n.focus();
718
+ }
719
+ }
720
+ },
721
+ domHooks: {
722
+ root: { attr: "data-component", value: "rich-text-editor" },
723
+ instanceId: {
724
+ attr: "data-component-id",
725
+ sourceProp: "id",
726
+ description: "Sourced from the id prop."
727
+ }
728
+ }
729
+ }, La = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", nt = "ds:!size-[var(--min-target-size)]", Ha = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Ia = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]";
730
+ function Zr({ id: n }) {
731
+ const { t: a } = re("ui");
732
+ return /* @__PURE__ */ t(
733
+ "p",
734
+ {
735
+ "data-component": "editor-request-error",
736
+ id: n,
737
+ role: "alert",
738
+ className: Ia,
739
+ children: a("editor.ai.error")
740
+ }
741
+ );
742
+ }
743
+ const Dr = [
744
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
745
+ "ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
746
+ "ds:p-[var(--spacing-sm)] ds:[max-block-size:10rem] ds:overflow-y-auto",
747
+ "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]",
748
+ // The preview renders arbitrary model-generated rich text, and the
749
+ // `rich-text` SafeHtml profile allows ul/ol/li. Inside a
750
+ // [data-component] preflight's list reset still applies and the host
751
+ // undo deliberately does not reach, so markers and indent have to be
752
+ // asked for explicitly — otherwise a generated bullet list previews as
753
+ // flush, marker-less lines.
754
+ "ds:[&_ul]:list-disc ds:[&_ol]:list-decimal",
755
+ "ds:[&_ul]:ps-[var(--spacing-md)] ds:[&_ol]:ps-[var(--spacing-md)]"
756
+ ].join(" ");
757
+ function Or(n, a) {
758
+ return a ? n ? /\s$/.test(n) ? `${n}${a}` : `${n} ${a}` : a : n;
759
+ }
760
+ function $a({
761
+ open: n,
762
+ onClose: a,
763
+ onRequestAiDraft: c,
764
+ onInsert: s,
765
+ previewAsHtml: h = !0,
766
+ privacyNotice: u,
767
+ onDictate: m
768
+ }) {
769
+ const { t: p } = re("ui"), y = qe(), k = qe(), [w, S] = N(""), [T, L] = N(!1), [q, f] = N(!1), [d, g] = N(null), z = C(null), [M, B] = N(!1), [V, O] = N(""), [P, E] = N(""), U = C(null), F = v(() => {
770
+ var R;
771
+ (R = U.current) == null || R.abort();
772
+ }, []), Q = v(() => {
773
+ if (!m) return;
774
+ const R = new AbortController();
775
+ U.current = R, B(!0), O(""), E(p("editor.ai.listening")), m({
776
+ signal: R.signal,
777
+ onPartialTranscript: (K) => {
778
+ R.signal.aborted || O(K);
779
+ },
780
+ onFinalTranscript: (K) => {
781
+ if (R.signal.aborted) return;
782
+ const J = K.trim();
783
+ O(""), J && (S((se) => Or(se, J)), E(J));
784
+ }
785
+ }).catch(() => {
786
+ }).finally(() => {
787
+ O(""), U.current === R && (U.current = null, B(!1), E(""));
788
+ });
789
+ }, [m, p]), pe = v(() => {
790
+ M ? F() : Q();
791
+ }, [M, Q, F]);
792
+ _(() => {
793
+ var R, K;
794
+ n ? (S(""), L(!1), f(!1), g(null), O(""), E("")) : ((R = z.current) == null || R.abort(), z.current = null, (K = U.current) == null || K.abort());
795
+ }, [n]), _(
796
+ () => () => {
797
+ var R, K;
798
+ (R = z.current) == null || R.abort(), (K = U.current) == null || K.abort();
799
+ },
800
+ []
801
+ );
802
+ const Y = v(() => {
803
+ var J;
804
+ const R = w.trim();
805
+ if (!R || T) return;
806
+ F(), (J = z.current) == null || J.abort();
807
+ const K = new AbortController();
808
+ z.current = K, f(!1), L(!0), c({ prompt: R, signal: K.signal }).then((se) => {
809
+ K.signal.aborted || (g(se), L(!1));
810
+ }).catch((se) => {
811
+ K.signal.aborted || se && typeof se == "object" && "name" in se && se.name === "AbortError" || (f(!0), L(!1));
812
+ });
813
+ }, [w, T, c, F]), Ne = v(() => {
814
+ d != null && (s(d), a());
815
+ }, [d, s, a]), G = d != null, oe = M ? Or(w, V) : w;
816
+ return /* @__PURE__ */ t(
817
+ Sn,
818
+ {
819
+ open: n,
820
+ onClose: a,
821
+ ariaLabel: p("editor.ai.dialogTitle"),
822
+ children: G ? /* @__PURE__ */ A("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
823
+ /* @__PURE__ */ t(
824
+ j,
825
+ {
826
+ size: "md",
827
+ intent: "outline",
828
+ className: nt,
829
+ icon: /* @__PURE__ */ t(Sr, {}),
830
+ "aria-label": p("common.close"),
831
+ onClick: a
832
+ }
833
+ ),
834
+ /* @__PURE__ */ t("div", { className: "ds:min-w-0 ds:flex-1", children: h ? /* @__PURE__ */ t(
835
+ Yo,
836
+ {
837
+ html: d,
838
+ profile: "rich-text",
839
+ className: Dr,
840
+ tabIndex: 0,
841
+ "aria-label": p("editor.ai.dialogTitle")
842
+ }
843
+ ) : (
844
+ // Focusable so a keyboard user can scroll a long draft preview
845
+ // (mirrors the SafeHtml preview branch above). The lint rule's
846
+ // tabIndex allowlist doesn't cover a scrollable, non-interactive
847
+ // text region.
848
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
849
+ /* @__PURE__ */ t("p", { className: Dr, tabIndex: 0, children: d })
850
+ ) }),
851
+ /* @__PURE__ */ t(
852
+ j,
853
+ {
854
+ size: "md",
855
+ intent: "outline",
856
+ className: `${nt} ds:rounded-full`,
857
+ icon: /* @__PURE__ */ t(ii, {}),
858
+ "aria-label": p("editor.ai.retry"),
859
+ onClick: () => g(null)
860
+ }
861
+ ),
862
+ /* @__PURE__ */ t(
863
+ j,
864
+ {
865
+ size: "md",
866
+ intent: "primary",
867
+ className: `${nt} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
868
+ icon: /* @__PURE__ */ t(ai, {}),
869
+ "aria-label": p("common.confirm"),
870
+ onClick: Ne
871
+ }
872
+ )
873
+ ] }) : /* @__PURE__ */ A(Ie, { children: [
874
+ /* @__PURE__ */ A("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
875
+ /* @__PURE__ */ t(
876
+ j,
877
+ {
878
+ size: "md",
879
+ intent: "outline",
880
+ className: nt,
881
+ icon: /* @__PURE__ */ t(Sr, {}),
882
+ "aria-label": p("common.close"),
883
+ onClick: a
884
+ }
885
+ ),
886
+ /* @__PURE__ */ t("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ t(
887
+ oi,
888
+ {
889
+ id: y,
890
+ size: "md",
891
+ value: oe,
892
+ onChange: (R) => S(R.target.value),
893
+ placeholder: p("editor.ai.promptPlaceholder"),
894
+ "aria-label": p("editor.ai.promptLabel"),
895
+ autoResize: !0,
896
+ minRows: 1,
897
+ maxRows: 3,
898
+ readOnly: M,
899
+ tone: q ? "error" : "default",
900
+ "aria-describedby": q ? k : void 0
901
+ }
902
+ ) }),
903
+ m ? /* @__PURE__ */ t(
904
+ j,
905
+ {
906
+ size: "md",
907
+ intent: "outline",
908
+ className: M ? `${nt} ${La}` : nt,
909
+ icon: M ? /* @__PURE__ */ t(Tt, { className: "ds:fill-current" }) : /* @__PURE__ */ t(Ln, {}),
910
+ "aria-pressed": M,
911
+ "aria-label": p(M ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
912
+ onClick: pe
913
+ }
914
+ ) : null,
915
+ /* @__PURE__ */ t(
916
+ j,
917
+ {
918
+ size: "md",
919
+ intent: "primary",
920
+ icon: T ? /* @__PURE__ */ t(Pn, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ t(si, {}),
921
+ className: `${nt} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
922
+ disabled: T || !w.trim(),
923
+ "aria-busy": T || void 0,
924
+ "aria-label": p("editor.ai.generate"),
925
+ onClick: Y
926
+ }
927
+ )
928
+ ] }),
929
+ m ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: P }) : null,
930
+ q ? /* @__PURE__ */ t(Zr, { id: k }) : u ? /* @__PURE__ */ t("p", { className: Ha, children: u }) : null
931
+ ] })
932
+ }
933
+ );
934
+ }
935
+ function Qr(n, a) {
936
+ return n(a, { nsSeparator: !1, defaultValue: a });
937
+ }
938
+ const Yr = {
939
+ // Redactor's own history. AI rewrites push onto it too (see
940
+ // `pushUndoState` in rich-text-editor.tsx), so Undo steps back over them.
941
+ undo: {
942
+ id: "undo",
943
+ icon: /* @__PURE__ */ t(mi, {}),
944
+ label: ["editor.undo", "Undo"],
945
+ command: ["module.buffer.undo"]
946
+ },
947
+ redo: {
948
+ id: "redo",
949
+ icon: /* @__PURE__ */ t(ga, {}),
950
+ label: ["editor.redo", "Redo"],
951
+ command: ["module.buffer.redo"]
952
+ },
953
+ bold: {
954
+ id: "bold",
955
+ icon: /* @__PURE__ */ t(_i, {}),
956
+ label: ["editor.bold", "Bold"],
957
+ command: ["module.inline.format", { tag: "b" }],
958
+ toggle: "bold"
959
+ },
960
+ italic: {
961
+ id: "italic",
962
+ icon: /* @__PURE__ */ t(Pi, {}),
963
+ label: ["editor.italic", "Italic"],
964
+ command: ["module.inline.format", { tag: "i" }],
965
+ toggle: "italic"
966
+ },
967
+ underline: {
968
+ id: "underline",
969
+ icon: /* @__PURE__ */ t(za, {}),
970
+ label: ["editor.underline", "Underline"],
971
+ command: ["module.inline.format", { tag: "u" }],
972
+ toggle: "underline"
973
+ },
974
+ strike: {
975
+ id: "strike",
976
+ icon: /* @__PURE__ */ t(ya, {}),
977
+ label: ["editor.strike", "Strikethrough"],
978
+ command: ["module.inline.format", { tag: "del" }],
979
+ toggle: "strike"
980
+ },
981
+ ul: {
982
+ id: "ul",
983
+ icon: /* @__PURE__ */ t(Wi, {}),
984
+ label: ["editor.list.bullet", "Bulleted list"],
985
+ command: ["module.list.toggle", "ul"],
986
+ toggle: "ul"
987
+ },
988
+ ol: {
989
+ id: "ol",
990
+ icon: /* @__PURE__ */ t(Ki, {}),
991
+ label: ["editor.list.ordered", "Numbered list"],
992
+ command: ["module.list.toggle", "ol"],
993
+ toggle: "ol"
994
+ }
995
+ }, zn = [
996
+ {
997
+ id: "paragraph",
998
+ tag: "p",
999
+ icon: /* @__PURE__ */ t(da, {}),
1000
+ label: ["editor.paragraph", "Paragraph"]
1001
+ },
1002
+ {
1003
+ id: "h2",
1004
+ tag: "h2",
1005
+ icon: /* @__PURE__ */ t(Di, {}),
1006
+ label: ["editor.heading2", "Heading 2"]
1007
+ },
1008
+ {
1009
+ id: "h3",
1010
+ tag: "h3",
1011
+ icon: /* @__PURE__ */ t(qi, {}),
1012
+ label: ["editor.heading3", "Heading 3"]
1013
+ },
1014
+ {
1015
+ id: "quote",
1016
+ tag: "blockquote",
1017
+ icon: /* @__PURE__ */ t(ma, {}),
1018
+ label: ["editor.quote", "Quote"]
1019
+ }
1020
+ ], Da = {
1021
+ minimal: ["bold", "italic", "underline", "link"],
1022
+ standard: [
1023
+ "undo",
1024
+ "redo",
1025
+ "format",
1026
+ "bold",
1027
+ "italic",
1028
+ "underline",
1029
+ "strike",
1030
+ "ul",
1031
+ "ol",
1032
+ "link"
1033
+ ],
1034
+ full: [
1035
+ "undo",
1036
+ "redo",
1037
+ "format",
1038
+ "bold",
1039
+ "italic",
1040
+ "underline",
1041
+ "strike",
1042
+ "ul",
1043
+ "ol",
1044
+ "link"
1045
+ ]
1046
+ }, Jr = [
1047
+ {
1048
+ id: "rowAbove",
1049
+ command: "plugin.table.addRowAbove",
1050
+ icon: /* @__PURE__ */ t(Ai, {}),
1051
+ label: ["editor.table.rowAbove", "Add row above"]
1052
+ },
1053
+ {
1054
+ id: "rowBelow",
1055
+ command: "plugin.table.addRowBelow",
1056
+ icon: /* @__PURE__ */ t(xi, {}),
1057
+ label: ["editor.table.rowBelow", "Add row below"]
1058
+ },
1059
+ {
1060
+ id: "colLeft",
1061
+ command: "plugin.table.addColumnLeft",
1062
+ icon: /* @__PURE__ */ t(Mi, {}),
1063
+ label: ["editor.table.columnLeft", "Add column left"]
1064
+ },
1065
+ {
1066
+ id: "colRight",
1067
+ command: "plugin.table.addColumnRight",
1068
+ icon: /* @__PURE__ */ t(Ei, {}),
1069
+ label: ["editor.table.columnRight", "Add column right"]
1070
+ },
1071
+ {
1072
+ id: "addHead",
1073
+ command: "plugin.table.addHead",
1074
+ icon: /* @__PURE__ */ t(sa, {}),
1075
+ label: ["editor.table.addHeader", "Add header row"]
1076
+ },
1077
+ {
1078
+ id: "deleteHead",
1079
+ command: "plugin.table.deleteHead",
1080
+ icon: /* @__PURE__ */ t(ia, {}),
1081
+ label: ["editor.table.deleteHeader", "Remove header row"]
1082
+ },
1083
+ {
1084
+ id: "deleteRow",
1085
+ command: "plugin.table.deleteRow",
1086
+ icon: /* @__PURE__ */ t(pa, {}),
1087
+ label: ["editor.table.deleteRow", "Delete row"]
1088
+ },
1089
+ {
1090
+ id: "deleteColumn",
1091
+ command: "plugin.table.deleteColumn",
1092
+ icon: /* @__PURE__ */ t(Ii, {}),
1093
+ label: ["editor.table.deleteColumn", "Delete column"]
1094
+ },
1095
+ {
1096
+ id: "deleteTable",
1097
+ command: "plugin.table.deleteTable",
1098
+ icon: /* @__PURE__ */ t(pi, {}),
1099
+ label: ["editor.table.deleteTable", "Delete table"]
1100
+ }
1101
+ ], Qt = 6, eo = "ds:[&_[data-intent=ghost]:hover]:bg-[color-mix(in_srgb,var(--accent)_12%,transparent)] ds:[&_[data-intent=ghost]:hover]:text-[color:var(--accent)]", Oa = Bn(
1102
+ [
1103
+ "ds:@container/toolbar",
1104
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1105
+ "ds:bg-[var(--background)] ds:p-[var(--spacing-xs)]",
1106
+ "ds:shadow-[var(--shadow-md)]",
1107
+ eo
1108
+ ].join(" ")
1109
+ ), qa = "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", nn = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", Et = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
1110
+ function tn(n) {
1111
+ return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1112
+ }
1113
+ function Ba({
1114
+ variables: n,
1115
+ recentVariableTokens: a,
1116
+ insertVariable: c,
1117
+ saveSelection: s
1118
+ }) {
1119
+ const { t: h } = re("ui"), [u, m] = N(!1), [p, y] = N(""), k = C(null), w = C(!1), S = n;
1120
+ return /* @__PURE__ */ A(
1121
+ Zt.Root,
1122
+ {
1123
+ open: u,
1124
+ onOpenChange: (T) => {
1125
+ T && s(), m(T), T && y("");
1126
+ },
1127
+ children: [
1128
+ /* @__PURE__ */ t(Zt.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1129
+ j,
1130
+ {
1131
+ ref: k,
1132
+ size: "sm",
1133
+ intent: "ghost",
1134
+ icon: /* @__PURE__ */ t(Li, {}),
1135
+ "aria-label": h("editor.insertVariable", "Insert variable")
1136
+ }
1137
+ ) }),
1138
+ /* @__PURE__ */ t(Zt.Portal, { children: /* @__PURE__ */ t(
1139
+ Zt.Content,
1140
+ {
1141
+ align: "start",
1142
+ sideOffset: 4,
1143
+ className: "ds:z-[var(--z-popover)]",
1144
+ onCloseAutoFocus: (T) => {
1145
+ w.current && (T.preventDefault(), w.current = !1);
1146
+ },
1147
+ children: /* @__PURE__ */ t(
1148
+ Xr,
1149
+ {
1150
+ variables: S,
1151
+ recentTokens: a,
1152
+ query: p,
1153
+ onQueryChange: y,
1154
+ searchFocusable: !0,
1155
+ "aria-label": h("editor.insertVariable", "Insert variable"),
1156
+ onSelect: (T) => {
1157
+ w.current = !0, c(T.token), m(!1);
1158
+ },
1159
+ onClose: () => m(!1)
1160
+ }
1161
+ )
1162
+ }
1163
+ ) })
1164
+ ]
1165
+ }
1166
+ );
1167
+ }
1168
+ function Pa({
1169
+ run: n,
1170
+ active: a,
1171
+ onTriggerDown: c
1172
+ }) {
1173
+ const { t: s } = re("ui"), h = zn.find((u) => a.has(u.id)) ?? zn[0];
1174
+ return /* @__PURE__ */ A(X.Root, { children: [
1175
+ /* @__PURE__ */ t(X.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1176
+ Ee,
1177
+ {
1178
+ size: "sm",
1179
+ intent: "ghost",
1180
+ startIcon: h.icon,
1181
+ endIcon: /* @__PURE__ */ t(Ur, {}),
1182
+ "aria-label": `${s("editor.format", "Paragraph style")}: ${s(
1183
+ h.label[0],
1184
+ h.label[1]
1185
+ )}`,
1186
+ onMouseDown: c,
1187
+ children: /* @__PURE__ */ t("span", { className: "ds:hidden ds:@[448px]/toolbar:inline", children: s(h.label[0], h.label[1]) })
1188
+ }
1189
+ ) }),
1190
+ /* @__PURE__ */ t(X.Content, { align: "start", children: zn.map((u) => /* @__PURE__ */ t(
1191
+ X.Item,
1192
+ {
1193
+ startIcon: u.icon,
1194
+ onSelect: () => n("module.block.format", { tag: u.tag }),
1195
+ children: s(u.label[0], u.label[1])
1196
+ },
1197
+ u.id
1198
+ )) })
1199
+ ] });
1200
+ }
1201
+ function Fa({
1202
+ insertHtml: n,
1203
+ saveSelection: a,
1204
+ restoreSelection: c,
1205
+ getSelectedText: s
1206
+ }) {
1207
+ const { t: h } = re("ui"), [u, m] = N(!1), [p, y] = N(""), [k, w] = N(""), [S, T] = N(!1), L = qe(), q = qe(), f = () => {
1208
+ y(""), w(""), T(!1);
1209
+ }, d = () => {
1210
+ const g = p.trim();
1211
+ if (!g) return;
1212
+ const z = k.trim() || g, M = S ? ' target="_blank" rel="noopener noreferrer"' : "", B = `<a href="${tn(g)}"${M}>${tn(z)}</a>`;
1213
+ m(!1), f(), window.requestAnimationFrame(() => {
1214
+ c(), n(B);
1215
+ });
1216
+ };
1217
+ return /* @__PURE__ */ A(ae.Root, { open: u, onOpenChange: m, children: [
1218
+ /* @__PURE__ */ t(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1219
+ j,
1220
+ {
1221
+ size: "sm",
1222
+ intent: "ghost",
1223
+ icon: /* @__PURE__ */ t(ji, {}),
1224
+ "aria-label": h("editor.link.insert", "Insert link"),
1225
+ onMouseDown: () => {
1226
+ a(), w(s());
1227
+ }
1228
+ }
1229
+ ) }),
1230
+ /* @__PURE__ */ A(ae.Content, { children: [
1231
+ /* @__PURE__ */ t(ae.Header, { children: /* @__PURE__ */ t(ae.Title, { children: h("editor.link.insert", "Insert link") }) }),
1232
+ /* @__PURE__ */ A(ae.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1233
+ /* @__PURE__ */ A("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1234
+ /* @__PURE__ */ t("label", { htmlFor: L, className: Et, children: h("editor.link.url", "URL") }),
1235
+ /* @__PURE__ */ t(
1236
+ en,
1237
+ {
1238
+ id: L,
1239
+ type: "url",
1240
+ value: p,
1241
+ onChange: (g) => y(g.target.value),
1242
+ placeholder: "https://…"
1243
+ }
1244
+ )
1245
+ ] }),
1246
+ /* @__PURE__ */ A("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1247
+ /* @__PURE__ */ t("label", { htmlFor: q, className: Et, children: h("editor.link.text", "Text to display") }),
1248
+ /* @__PURE__ */ t(
1249
+ en,
1250
+ {
1251
+ id: q,
1252
+ value: k,
1253
+ onChange: (g) => w(g.target.value),
1254
+ placeholder: h("editor.link.textPlaceholder", "Link text")
1255
+ }
1256
+ )
1257
+ ] }),
1258
+ /* @__PURE__ */ t(
1259
+ li,
1260
+ {
1261
+ checked: S,
1262
+ onCheckedChange: (g) => T(g === !0),
1263
+ label: h("editor.link.newTab", "Open in new tab")
1264
+ }
1265
+ )
1266
+ ] }),
1267
+ /* @__PURE__ */ A(ae.Footer, { children: [
1268
+ /* @__PURE__ */ t(ae.Close, { asChild: !0, children: /* @__PURE__ */ t(Ee, { intent: "secondary", children: h("common.cancel") }) }),
1269
+ /* @__PURE__ */ t(Ee, { onClick: d, disabled: !p.trim(), children: h("editor.link.insertAction", "Insert") })
1270
+ ] })
1271
+ ] })
1272
+ ] });
1273
+ }
1274
+ function ja({
1275
+ insertHtml: n,
1276
+ saveSelection: a,
1277
+ restoreSelection: c,
1278
+ uploadImage: s
1279
+ }) {
1280
+ const { t: h } = re("ui"), [u, m] = N(!1), [p, y] = N(""), [k, w] = N(""), S = qe(), T = qe(), L = (f, d) => {
1281
+ const g = `<img src="${tn(f)}" alt="${tn(d)}" loading="lazy">`;
1282
+ m(!1), y(""), w(""), window.requestAnimationFrame(() => {
1283
+ c(), n(g);
1284
+ });
1285
+ }, q = () => {
1286
+ const f = p.trim();
1287
+ f && L(f, k.trim());
1288
+ };
1289
+ return /* @__PURE__ */ A(ae.Root, { open: u, onOpenChange: m, children: [
1290
+ /* @__PURE__ */ t(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1291
+ j,
1292
+ {
1293
+ size: "sm",
1294
+ intent: "ghost",
1295
+ icon: /* @__PURE__ */ t(fi, {}),
1296
+ "aria-label": h("editor.image.insert", "Insert image"),
1297
+ onMouseDown: () => a()
1298
+ }
1299
+ ) }),
1300
+ /* @__PURE__ */ A(ae.Content, { children: [
1301
+ /* @__PURE__ */ t(ae.Header, { children: /* @__PURE__ */ t(ae.Title, { children: h("editor.image.insert", "Insert image") }) }),
1302
+ /* @__PURE__ */ A(ae.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1303
+ s ? /* @__PURE__ */ A("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1304
+ /* @__PURE__ */ t("span", { className: Et, children: h("editor.image.upload", "Upload") }),
1305
+ /* @__PURE__ */ t(
1306
+ ci,
1307
+ {
1308
+ variant: "dropzone",
1309
+ accept: {
1310
+ "image/*": [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"]
1311
+ },
1312
+ maxFiles: 1,
1313
+ onUpload: async (f, { signal: d }) => {
1314
+ const g = await s(f, d);
1315
+ L(g, f.name);
1316
+ }
1317
+ }
1318
+ ),
1319
+ /* @__PURE__ */ t("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: h("editor.image.orUrl", "Or paste an image URL") })
1320
+ ] }) : null,
1321
+ /* @__PURE__ */ A("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1322
+ /* @__PURE__ */ t("label", { htmlFor: S, className: Et, children: h("editor.image.url", "Image URL") }),
1323
+ /* @__PURE__ */ t(
1324
+ en,
1325
+ {
1326
+ id: S,
1327
+ type: "url",
1328
+ value: p,
1329
+ onChange: (f) => y(f.target.value),
1330
+ placeholder: "https://…"
1331
+ }
1332
+ )
1333
+ ] }),
1334
+ /* @__PURE__ */ A("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1335
+ /* @__PURE__ */ t("label", { htmlFor: T, className: Et, children: h("editor.image.alt", "Alt text") }),
1336
+ /* @__PURE__ */ t(
1337
+ en,
1338
+ {
1339
+ id: T,
1340
+ value: k,
1341
+ onChange: (f) => w(f.target.value),
1342
+ placeholder: h(
1343
+ "editor.image.altPlaceholder",
1344
+ "Describe the image"
1345
+ )
1346
+ }
1347
+ )
1348
+ ] })
1349
+ ] }),
1350
+ /* @__PURE__ */ A(ae.Footer, { children: [
1351
+ /* @__PURE__ */ t(ae.Close, { asChild: !0, children: /* @__PURE__ */ t(Ee, { intent: "secondary", children: h("common.cancel") }) }),
1352
+ /* @__PURE__ */ t(Ee, { onClick: q, disabled: !p.trim(), children: h("editor.image.insertAction", "Insert") })
1353
+ ] })
1354
+ ] })
1355
+ ] });
1356
+ }
1357
+ function Ga({
1358
+ run: n,
1359
+ saveSelection: a,
1360
+ restoreSelection: c
1361
+ }) {
1362
+ const { t: s } = re("ui"), [h, u] = N("#1f2a5c"), m = (y) => {
1363
+ u(y), c(), n("module.inline.format", {
1364
+ tag: "span",
1365
+ style: { color: y },
1366
+ type: "toggle"
1367
+ });
1368
+ }, p = () => {
1369
+ c(), n("module.inline.remove", { style: "color" });
1370
+ };
1371
+ return /* @__PURE__ */ A(ne, { onOpenChange: (y) => y && a(), children: [
1372
+ /* @__PURE__ */ t(ne.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1373
+ j,
1374
+ {
1375
+ size: "sm",
1376
+ intent: "ghost",
1377
+ icon: /* @__PURE__ */ t(Ji, {}),
1378
+ "aria-label": s("editor.textColor", "Text colour"),
1379
+ onMouseDown: (y) => {
1380
+ y.preventDefault(), a();
1381
+ }
1382
+ }
1383
+ ) }),
1384
+ /* @__PURE__ */ A(ne.Content, { side: "bottom", align: "start", children: [
1385
+ /* @__PURE__ */ t(ne.Heading, { children: s("editor.textColor", "Text colour") }),
1386
+ /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
1387
+ jn,
1388
+ {
1389
+ variant: "inline",
1390
+ size: "sm",
1391
+ value: h,
1392
+ onChange: m
1393
+ }
1394
+ ) }),
1395
+ /* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(Ee, { size: "sm", intent: "secondary", onClick: p, children: s("editor.color.remove", "Remove colour") }) })
1396
+ ] })
1397
+ ] });
1398
+ }
1399
+ function Ka({
1400
+ run: n,
1401
+ saveSelection: a,
1402
+ restoreSelection: c
1403
+ }) {
1404
+ const { t: s } = re("ui"), [h, u] = N("#fff3a3"), m = (y) => {
1405
+ u(y), c(), n("module.inline.format", {
1406
+ tag: "span",
1407
+ style: { "background-color": y },
1408
+ type: "toggle"
1409
+ });
1410
+ }, p = () => {
1411
+ c(), n("module.inline.remove", { style: "background-color" });
1412
+ };
1413
+ return /* @__PURE__ */ A(ne, { onOpenChange: (y) => y && a(), children: [
1414
+ /* @__PURE__ */ t(ne.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1415
+ j,
1416
+ {
1417
+ size: "sm",
1418
+ intent: "ghost",
1419
+ icon: /* @__PURE__ */ t(ui, {}),
1420
+ "aria-label": s("editor.highlightColor", "Highlight"),
1421
+ onMouseDown: (y) => {
1422
+ y.preventDefault(), a();
1423
+ }
1424
+ }
1425
+ ) }),
1426
+ /* @__PURE__ */ A(ne.Content, { side: "bottom", align: "start", children: [
1427
+ /* @__PURE__ */ t(ne.Heading, { children: s("editor.highlightColor", "Highlight") }),
1428
+ /* @__PURE__ */ t("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ t(
1429
+ jn,
1430
+ {
1431
+ variant: "inline",
1432
+ size: "sm",
1433
+ value: h,
1434
+ onChange: m
1435
+ }
1436
+ ) }),
1437
+ /* @__PURE__ */ t("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ t(Ee, { size: "sm", intent: "secondary", onClick: p, children: s("editor.highlight.remove", "Remove highlight") }) })
1438
+ ] })
1439
+ ] });
1440
+ }
1441
+ function Va(n, a) {
1442
+ const c = Array.from({ length: a }, () => "<td><br></td>").join("");
1443
+ return `<table><tbody>${Array.from({ length: n }, () => `<tr>${c}</tr>`).join("")}</tbody></table>`;
1444
+ }
1445
+ function Wa({
1446
+ run: n,
1447
+ insertTable: a,
1448
+ active: c
1449
+ }) {
1450
+ const { t: s } = re("ui"), [h, u] = N({ r: 0, c: 0 }), [m, p] = N(!1), y = c.has("table") || m, k = /* @__PURE__ */ t(
1451
+ j,
1452
+ {
1453
+ size: "sm",
1454
+ intent: "ghost",
1455
+ icon: /* @__PURE__ */ t(ka, {}),
1456
+ "aria-label": s("editor.table.insert", "Insert table"),
1457
+ onMouseDown: (w) => w.preventDefault()
1458
+ }
1459
+ );
1460
+ return y ? /* @__PURE__ */ A(X.Root, { open: m, onOpenChange: p, children: [
1461
+ /* @__PURE__ */ t(X.Trigger, { asChild: !0, children: k }),
1462
+ /* @__PURE__ */ t(X.Content, { side: "bottom", align: "start", children: Jr.map((w) => /* @__PURE__ */ t(
1463
+ X.Item,
1464
+ {
1465
+ startIcon: w.icon,
1466
+ onSelect: () => n(w.command),
1467
+ children: s(w.label[0], w.label[1])
1468
+ },
1469
+ w.id
1470
+ )) })
1471
+ ] }) : /* @__PURE__ */ A(ne, { onOpenChange: (w) => !w && u({ r: 0, c: 0 }), children: [
1472
+ /* @__PURE__ */ t(ne.Trigger, { asChild: !0, children: k }),
1473
+ /* @__PURE__ */ A(ne.Content, { side: "bottom", align: "start", children: [
1474
+ /* @__PURE__ */ t(ne.Heading, { children: s("editor.table.insert", "Insert table") }),
1475
+ /* @__PURE__ */ t(
1476
+ "div",
1477
+ {
1478
+ role: "group",
1479
+ "aria-label": s("editor.table.sizePicker", "Table size"),
1480
+ className: "ds:mt-[var(--spacing-sm)] ds:grid ds:w-fit ds:grid-cols-6 ds:gap-[var(--spacing-2xs)]",
1481
+ onMouseLeave: () => u({ r: 0, c: 0 }),
1482
+ children: Array.from({ length: Qt * Qt }, (w, S) => {
1483
+ const T = Math.floor(S / Qt) + 1, L = S % Qt + 1, q = T <= h.r && L <= h.c;
1484
+ return /* @__PURE__ */ t(
1485
+ "button",
1486
+ {
1487
+ type: "button",
1488
+ "aria-label": s("editor.table.sizeCell", "{{r}}×{{c}}", {
1489
+ r: T,
1490
+ c: L
1491
+ }),
1492
+ onMouseEnter: () => u({ r: T, c: L }),
1493
+ onClick: () => a(Va(T, L)),
1494
+ className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${q ? "ds:bg-[var(--primary)]" : "ds:bg-[var(--muted)]"}`
1495
+ },
1496
+ S
1497
+ );
1498
+ })
1499
+ }
1500
+ ),
1501
+ /* @__PURE__ */ t("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: h.r > 0 ? s("editor.table.sizeCell", "{{r}}×{{c}}", {
1502
+ r: h.r,
1503
+ c: h.c
1504
+ }) : s("editor.table.sizeHint", "Pick a size") })
1505
+ ] })
1506
+ ] });
1507
+ }
1508
+ const Xa = Object.fromEntries(Jr.map((n) => [n.id, n])), Ua = [
1509
+ "ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1510
+ "ds:[inset-block-start:var(--rte-tt-top)] ds:[inset-inline-start:var(--rte-tt-start)]",
1511
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1512
+ "ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
1513
+ ].join(" "), Za = "#fde68a";
1514
+ function qr({
1515
+ scope: n,
1516
+ icon: a,
1517
+ label: c,
1518
+ onOpenChange: s,
1519
+ saveTableCell: h,
1520
+ applyTableBackground: u
1521
+ }) {
1522
+ const { t: m } = re("ui"), [p, y] = N(Za);
1523
+ return /* @__PURE__ */ A(
1524
+ ne,
1525
+ {
1526
+ onOpenChange: (k) => {
1527
+ s(k), k && h();
1528
+ },
1529
+ children: [
1530
+ /* @__PURE__ */ t(ne.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
1531
+ j,
1532
+ {
1533
+ size: "sm",
1534
+ intent: "ghost",
1535
+ icon: a,
1536
+ tooltip: c,
1537
+ onMouseDown: (k) => k.preventDefault()
1538
+ }
1539
+ ) }),
1540
+ /* @__PURE__ */ A(ne.Content, { side: "bottom", align: "center", children: [
1541
+ /* @__PURE__ */ t(
1542
+ jn,
1543
+ {
1544
+ variant: "inline",
1545
+ size: "sm",
1546
+ value: p,
1547
+ onChange: (k) => {
1548
+ y(k), u(n, k);
1549
+ }
1550
+ }
1551
+ ),
1552
+ /* @__PURE__ */ t(
1553
+ Ee,
1554
+ {
1555
+ size: "sm",
1556
+ intent: "ghost",
1557
+ className: "ds:mt-[var(--spacing-xs)] ds:w-full",
1558
+ onClick: () => u(n, null),
1559
+ children: m("editor.table.clearColor", "Clear colour")
1560
+ }
1561
+ )
1562
+ ] })
1563
+ ]
1564
+ }
1565
+ );
1566
+ }
1567
+ function Qa({
1568
+ active: n,
1569
+ run: a,
1570
+ areaRef: c,
1571
+ getActiveTableEl: s,
1572
+ enableColor: h = !1,
1573
+ saveTableCell: u,
1574
+ applyTableBackground: m
1575
+ }) {
1576
+ const { t: p } = re("ui"), y = n.has("table"), [k, w] = N(null), S = C(0), [T, L] = N(!1), q = v((d) => {
1577
+ S.current = Math.max(
1578
+ 0,
1579
+ S.current + (d ? 1 : -1)
1580
+ ), L(S.current > 0);
1581
+ }, []);
1582
+ if (_(() => {
1583
+ if (T) return;
1584
+ if (!y || typeof window > "u") {
1585
+ w(null);
1586
+ return;
1587
+ }
1588
+ const d = () => {
1589
+ const B = c.current, V = s();
1590
+ if (!B || !V) {
1591
+ w(null);
1592
+ return;
1593
+ }
1594
+ const O = B.getBoundingClientRect(), P = V.getBoundingClientRect(), E = getComputedStyle(B).direction === "rtl", U = Math.max(0, P.top - O.top - 44), F = E ? O.right - P.right + P.width / 2 : P.left - O.left + P.width / 2;
1595
+ w({ top: U, start: Math.max(0, F), rtl: E });
1596
+ };
1597
+ d();
1598
+ const g = new ResizeObserver(d), z = c.current, M = s();
1599
+ return z && g.observe(z), M && g.observe(M), window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
1600
+ g.disconnect(), window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
1601
+ };
1602
+ }, [y, T, c, s]), !y && !T || !k) return null;
1603
+ const f = [
1604
+ ["rowAbove", "rowBelow"],
1605
+ ["colLeft", "colRight"],
1606
+ ["addHead"],
1607
+ ...h ? ["colour"] : [],
1608
+ ["deleteRow", "deleteColumn"],
1609
+ ["deleteTable"]
1610
+ ];
1611
+ return (
1612
+ // Tooltips disambiguate the icon-only ops on hover (and provide each
1613
+ // button's accessible name via IconButton's `tooltip` prop). Radix Tooltip
1614
+ // needs a provider ancestor, so scope one to the bar.
1615
+ /* @__PURE__ */ t(Fn, { children: /* @__PURE__ */ t(
1616
+ "div",
1617
+ {
1618
+ role: "group",
1619
+ "aria-label": p("editor.table.toolbar", "Table tools"),
1620
+ className: `${Ua} ${k.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
1621
+ style: {
1622
+ "--rte-tt-top": `${k.top}px`,
1623
+ "--rte-tt-start": `${k.start}px`
1624
+ },
1625
+ children: f.map((d, g) => /* @__PURE__ */ A(gt, { children: [
1626
+ g > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: nn }) : null,
1627
+ d === "colour" ? /* @__PURE__ */ A(Ie, { children: [
1628
+ /* @__PURE__ */ t(
1629
+ qr,
1630
+ {
1631
+ scope: "cell",
1632
+ icon: /* @__PURE__ */ t(Ui, {}),
1633
+ label: p("editor.table.cellColor", "Cell colour"),
1634
+ onOpenChange: q,
1635
+ saveTableCell: u,
1636
+ applyTableBackground: m
1637
+ }
1638
+ ),
1639
+ /* @__PURE__ */ t(
1640
+ qr,
1641
+ {
1642
+ scope: "row",
1643
+ icon: /* @__PURE__ */ t(Qi, {}),
1644
+ label: p("editor.table.rowColor", "Row colour"),
1645
+ onOpenChange: q,
1646
+ saveTableCell: u,
1647
+ applyTableBackground: m
1648
+ }
1649
+ )
1650
+ ] }) : d.map((z) => {
1651
+ const M = Xa[z];
1652
+ return /* @__PURE__ */ t(
1653
+ j,
1654
+ {
1655
+ size: "sm",
1656
+ intent: "ghost",
1657
+ icon: M.icon,
1658
+ tooltip: p(M.label[0], M.label[1]),
1659
+ onMouseDown: (B) => B.preventDefault(),
1660
+ onClick: () => a(M.command)
1661
+ },
1662
+ z
1663
+ );
1664
+ })
1665
+ ] }, d === "colour" ? "colour" : d[0]))
1666
+ }
1667
+ ) })
1668
+ );
1669
+ }
1670
+ const Dn = [
1671
+ "wysiwyg-img-inline",
1672
+ "wysiwyg-img-wrap-left",
1673
+ "wysiwyg-img-wrap-right"
1674
+ ], to = [
1675
+ "wysiwyg-img-align-left",
1676
+ "wysiwyg-img-align-center",
1677
+ "wysiwyg-img-align-right"
1678
+ ];
1679
+ function Br(n, a) {
1680
+ return a.find((c) => n.classList.contains(c)) ?? "";
1681
+ }
1682
+ function Ya(n) {
1683
+ const a = n.closest(".redactor-in"), c = a instanceof HTMLElement ? a.clientWidth : 0, s = n.getBoundingClientRect().width;
1684
+ return c <= 0 || s <= 0 ? Nt : Math.round(Math.min(Nt, s / c * 100));
1685
+ }
1686
+ const On = 10, Nt = 100, Ja = 5, es = 10, Pr = (n) => Math.min(Nt, Math.max(On, Math.round(n))), ts = [
1687
+ {
1688
+ id: "wysiwyg-img-inline",
1689
+ icon: /* @__PURE__ */ t(wi, {}),
1690
+ label: ["editor.image.inline", "Inline with text"]
1691
+ },
1692
+ {
1693
+ id: "wysiwyg-img-wrap-left",
1694
+ icon: /* @__PURE__ */ t(ta, {}),
1695
+ label: ["editor.image.wrapLeft", "Wrap left"]
1696
+ },
1697
+ {
1698
+ id: "wysiwyg-img-wrap-right",
1699
+ icon: /* @__PURE__ */ t(ra, {}),
1700
+ label: ["editor.image.wrapRight", "Wrap right"]
1701
+ }
1702
+ ], ns = [
1703
+ {
1704
+ id: "wysiwyg-img-align-left",
1705
+ icon: /* @__PURE__ */ t(Na, {}),
1706
+ label: ["editor.image.alignLeft", "Align left"]
1707
+ },
1708
+ {
1709
+ id: "wysiwyg-img-align-center",
1710
+ icon: /* @__PURE__ */ t(Ca, {}),
1711
+ label: ["editor.image.alignCenter", "Align centre"]
1712
+ },
1713
+ {
1714
+ id: "wysiwyg-img-align-right",
1715
+ icon: /* @__PURE__ */ t(Ta, {}),
1716
+ label: ["editor.image.alignRight", "Align right"]
1717
+ }
1718
+ ], rs = [
1719
+ {
1720
+ id: "tl",
1721
+ pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
1722
+ cursor: "ds:cursor-nwse-resize",
1723
+ sign: -1,
1724
+ labelKey: "editor.image.resizeTopStart",
1725
+ labelFallback: "Resize image, top-start corner"
1726
+ },
1727
+ {
1728
+ id: "tr",
1729
+ pos: "ds:[inset-block-start:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-end:calc(var(--spacing-md)*-0.5)]",
1730
+ cursor: "ds:cursor-nesw-resize",
1731
+ sign: 1,
1732
+ labelKey: "editor.image.resizeTopEnd",
1733
+ labelFallback: "Resize image, top-end corner"
1734
+ },
1735
+ {
1736
+ id: "bl",
1737
+ pos: "ds:[inset-block-end:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-start:calc(var(--spacing-md)*-0.5)]",
1738
+ cursor: "ds:cursor-nesw-resize",
1739
+ sign: -1,
1740
+ labelKey: "editor.image.resizeBottomStart",
1741
+ labelFallback: "Resize image, bottom-start corner"
1742
+ },
1743
+ {
1744
+ id: "br",
1745
+ pos: "ds:[inset-block-end:calc(var(--spacing-md)*-0.5)] ds:[inset-inline-end:calc(var(--spacing-md)*-0.5)]",
1746
+ cursor: "ds:cursor-nwse-resize",
1747
+ sign: 1,
1748
+ labelKey: "editor.image.resizeBottomEnd",
1749
+ labelFallback: "Resize image, bottom-end corner"
1750
+ }
1751
+ ], os = [
1752
+ "ds:absolute ds:z-20 ds:pointer-events-none",
1753
+ "ds:[inset-block-start:var(--rte-img-top)] ds:[inset-inline-start:var(--rte-img-start)]",
1754
+ "ds:[inline-size:var(--rte-img-width)] ds:[block-size:var(--rte-img-height)]",
1755
+ "ds:rounded-[var(--radius-2xs)]",
1756
+ "ds:[outline-style:solid] ds:[outline-width:var(--border-width-md)]",
1757
+ "ds:[outline-color:var(--accent)] ds:[outline-offset:var(--focus-ring-offset)]"
1758
+ ].join(" "), is = [
1759
+ "ds:absolute ds:pointer-events-auto ds:touch-none",
1760
+ "ds:[inline-size:var(--spacing-md)] ds:[block-size:var(--spacing-md)]",
1761
+ "ds:rounded-[var(--radius-2xs)] ds:shadow-[var(--shadow-sm)]",
1762
+ "ds:bg-[var(--accent)] ds:border ds:border-[color:var(--background)]",
1763
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
1764
+ "ds:focus-visible:outline-solid ds:focus-visible:outline-[var(--ring)]",
1765
+ "ds:focus-visible:[outline-offset:var(--focus-ring-offset)]",
1766
+ "ds:forced-colors:bg-[CanvasText]"
1767
+ ].join(" "), as = [
1768
+ "ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1769
+ "ds:[inset-block-start:var(--rte-img-bar-top)] ds:[inset-inline-start:var(--rte-img-center)]",
1770
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1771
+ "ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
1772
+ ].join(" ");
1773
+ function ss({
1774
+ areaRef: n,
1775
+ activeImageEl: a,
1776
+ applyImageClass: c,
1777
+ setImageWidth: s
1778
+ }) {
1779
+ const { t: h } = re("ui"), [u, m] = N(null), p = C(null);
1780
+ _(() => {
1781
+ if (!a || typeof window > "u") {
1782
+ m(null);
1783
+ return;
1784
+ }
1785
+ const f = () => {
1786
+ const B = n.current;
1787
+ if (!B) {
1788
+ m(null);
1789
+ return;
1790
+ }
1791
+ const V = B.getBoundingClientRect(), O = a.getBoundingClientRect(), P = getComputedStyle(B).direction === "rtl", E = O.top - V.top, U = P ? V.right - O.right : O.left - V.left, F = U + O.width / 2, Q = Math.max(0, E - 44);
1792
+ m({
1793
+ top: E,
1794
+ start: Math.max(0, U),
1795
+ width: O.width,
1796
+ height: O.height,
1797
+ center: Math.max(0, F),
1798
+ barTop: Q,
1799
+ pct: Ya(a),
1800
+ rtl: P
1801
+ });
1802
+ };
1803
+ f();
1804
+ const d = new ResizeObserver(f);
1805
+ d.observe(a);
1806
+ const g = n.current;
1807
+ g && d.observe(g);
1808
+ const z = a.closest(".redactor-in");
1809
+ let M = null;
1810
+ return z && (M = new MutationObserver(f), M.observe(z, {
1811
+ subtree: !0,
1812
+ childList: !0,
1813
+ characterData: !0,
1814
+ attributes: !0,
1815
+ attributeFilter: ["class", "style", "width", "height", "src"]
1816
+ })), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
1817
+ d.disconnect(), M == null || M.disconnect(), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
1818
+ };
1819
+ }, [a, n]);
1820
+ const y = v(
1821
+ (f) => (d) => {
1822
+ !d.isPrimary || !u || (d.preventDefault(), d.currentTarget.setPointerCapture(d.pointerId), p.current = {
1823
+ pointerId: d.pointerId,
1824
+ startX: d.clientX,
1825
+ startPct: u.pct,
1826
+ sign: f.sign * (u.rtl ? -1 : 1)
1827
+ });
1828
+ },
1829
+ [u]
1830
+ ), k = v(
1831
+ (f) => {
1832
+ const d = p.current;
1833
+ if (!d || f.pointerId !== d.pointerId || !a) return;
1834
+ const g = a.closest(".redactor-in"), z = g instanceof HTMLElement ? g.clientWidth : 0;
1835
+ if (z <= 0) return;
1836
+ const M = d.sign * (f.clientX - d.startX) / z * 100;
1837
+ s(Pr(d.startPct + M));
1838
+ },
1839
+ [a, s]
1840
+ ), w = v(
1841
+ (f) => {
1842
+ const d = p.current;
1843
+ !d || f.pointerId !== d.pointerId || (f.currentTarget.releasePointerCapture(f.pointerId), p.current = null);
1844
+ },
1845
+ []
1846
+ ), S = v(
1847
+ (f) => {
1848
+ if (!u) return;
1849
+ let d = null;
1850
+ const g = f.shiftKey ? es : Ja;
1851
+ switch (f.key) {
1852
+ // Up / right always grow; down / left always shrink — independent of
1853
+ // which corner has focus, so the gesture reads the same everywhere.
1854
+ case "ArrowRight":
1855
+ case "ArrowUp":
1856
+ d = u.pct + g;
1857
+ break;
1858
+ case "ArrowLeft":
1859
+ case "ArrowDown":
1860
+ d = u.pct - g;
1861
+ break;
1862
+ case "Home":
1863
+ d = On;
1864
+ break;
1865
+ case "End":
1866
+ d = Nt;
1867
+ break;
1868
+ default:
1869
+ return;
1870
+ }
1871
+ f.preventDefault(), s(Pr(d));
1872
+ },
1873
+ [u, s]
1874
+ );
1875
+ if (!a || !u) return null;
1876
+ const T = Br(a, Dn), L = Br(a, to), q = h("editor.image.widthAnnounce", {
1877
+ width: u.pct,
1878
+ defaultValue: "{{width}} percent"
1879
+ });
1880
+ return /* @__PURE__ */ A(Ie, { children: [
1881
+ /* @__PURE__ */ t(
1882
+ "div",
1883
+ {
1884
+ className: os,
1885
+ style: {
1886
+ "--rte-img-top": `${u.top}px`,
1887
+ "--rte-img-start": `${u.start}px`,
1888
+ "--rte-img-width": `${u.width}px`,
1889
+ "--rte-img-height": `${u.height}px`
1890
+ },
1891
+ children: rs.map((f) => /* @__PURE__ */ t(
1892
+ "div",
1893
+ {
1894
+ role: "slider",
1895
+ tabIndex: 0,
1896
+ "aria-label": h(f.labelKey, f.labelFallback),
1897
+ "aria-orientation": "horizontal",
1898
+ "aria-valuemin": On,
1899
+ "aria-valuemax": Nt,
1900
+ "aria-valuenow": u.pct,
1901
+ "aria-valuetext": q,
1902
+ className: `${is} ${f.pos} ${f.cursor}`,
1903
+ onPointerDown: y(f),
1904
+ onPointerMove: k,
1905
+ onPointerUp: w,
1906
+ onPointerCancel: w,
1907
+ onKeyDown: S
1908
+ },
1909
+ f.id
1910
+ ))
1911
+ }
1912
+ ),
1913
+ /* @__PURE__ */ t(Fn, { children: /* @__PURE__ */ t(
1914
+ "div",
1915
+ {
1916
+ role: "group",
1917
+ "aria-label": h("editor.image.toolbar", "Image tools"),
1918
+ className: `${as} ${u.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
1919
+ style: {
1920
+ "--rte-img-bar-top": `${u.barTop}px`,
1921
+ "--rte-img-center": `${u.center}px`
1922
+ },
1923
+ children: [ts, ns].map((f, d) => /* @__PURE__ */ A(gt, { children: [
1924
+ d > 0 ? /* @__PURE__ */ t("span", { "aria-hidden": "true", className: nn }) : null,
1925
+ f.map((g) => {
1926
+ const z = d === 0 ? T === g.id : L === g.id;
1927
+ return /* @__PURE__ */ t(
1928
+ j,
1929
+ {
1930
+ size: "sm",
1931
+ intent: "ghost",
1932
+ icon: g.icon,
1933
+ "aria-pressed": z,
1934
+ tooltip: h(g.label[0], g.label[1]),
1935
+ onMouseDown: (M) => M.preventDefault(),
1936
+ onClick: () => c(g.id)
1937
+ },
1938
+ g.id
1939
+ );
1940
+ })
1941
+ ] }, d === 0 ? "flow" : "align"))
1942
+ }
1943
+ ) })
1944
+ ] });
1945
+ }
1946
+ function ls({
1947
+ templates: n,
1948
+ onPick: a,
1949
+ onManage: c,
1950
+ noteEmpty: s,
1951
+ onOpenChange: h,
1952
+ trigger: u,
1953
+ side: m = "top"
1954
+ }) {
1955
+ const { t: p } = re("ui"), y = qe();
1956
+ return /* @__PURE__ */ A(X.Root, { onOpenChange: h, children: [
1957
+ /* @__PURE__ */ t(X.Trigger, { asChild: !0, children: u }),
1958
+ /* @__PURE__ */ A(X.Content, { side: m, align: "end", sideOffset: 8, children: [
1959
+ /* @__PURE__ */ t(X.Label, { children: n.length > 0 ? p("editor.ai.templatesGroup") : p("editor.ai.noTemplates") }),
1960
+ n.map((k) => /* @__PURE__ */ t(
1961
+ X.Item,
1962
+ {
1963
+ startIcon: /* @__PURE__ */ t(In, {}),
1964
+ description: k.description || void 0,
1965
+ "aria-disabled": s || void 0,
1966
+ "aria-describedby": s ? y : void 0,
1967
+ className: "ds:aria-disabled:opacity-50 ds:aria-disabled:cursor-not-allowed",
1968
+ onSelect: (w) => {
1969
+ if (s) {
1970
+ w.preventDefault();
1971
+ return;
1972
+ }
1973
+ a(k);
1974
+ },
1975
+ children: k.name
1976
+ },
1977
+ k.id
1978
+ )),
1979
+ s && n.length > 0 ? /* @__PURE__ */ t(
1980
+ "p",
1981
+ {
1982
+ id: y,
1983
+ className: "ds:m-0 ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-2xs)] ds:text-[length:var(--font-size-xs)] ds:text-[color:var(--muted-foreground)]",
1984
+ children: p("editor.ai.templatesNoteEmpty")
1985
+ }
1986
+ ) : null,
1987
+ c && n.length === 0 ? /* @__PURE__ */ t(
1988
+ X.Item,
1989
+ {
1990
+ startIcon: /* @__PURE__ */ t(gi, {}),
1991
+ onSelect: () => c("create"),
1992
+ children: p("editor.ai.createFirstTemplate")
1993
+ }
1994
+ ) : null,
1995
+ c && n.length > 0 ? /* @__PURE__ */ A(Ie, { children: [
1996
+ /* @__PURE__ */ t(X.Separator, {}),
1997
+ /* @__PURE__ */ t(
1998
+ X.Item,
1999
+ {
2000
+ startIcon: /* @__PURE__ */ t(hi, {}),
2001
+ onSelect: () => c("list"),
2002
+ children: p("editor.ai.manageTemplates")
2003
+ }
2004
+ )
2005
+ ] }) : null
2006
+ ] })
2007
+ ] });
2008
+ }
2009
+ const cs = [
2010
+ "ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
2011
+ "ds:[inset-block-start:var(--rte-sel-top)] ds:[inset-inline-start:var(--rte-sel-start)]",
2012
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
2013
+ "ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]",
2014
+ eo
2015
+ ].join(" "), ds = ["bold", "italic", "underline", "strike"];
2016
+ function us({
2017
+ active: n,
2018
+ run: a,
2019
+ areaRef: c,
2020
+ getEditorRoot: s,
2021
+ suppressed: h = !1,
2022
+ holdOpen: u = !1,
2023
+ children: m
2024
+ }) {
2025
+ const { t: p } = re("ui"), y = C(null), [k, w] = N(null), S = C(u);
2026
+ return _(() => {
2027
+ S.current = u;
2028
+ }, [u]), _(() => {
2029
+ if (h || typeof window > "u") {
2030
+ w(null);
2031
+ return;
2032
+ }
2033
+ let T = !1, L = 0, q = !1, f = !1;
2034
+ const d = () => {
2035
+ var J;
2036
+ if (S.current || T) return;
2037
+ if (f) {
2038
+ w(null);
2039
+ return;
2040
+ }
2041
+ const O = c.current, P = s(), E = window.getSelection();
2042
+ if (!O || !P || !E || E.rangeCount === 0 || E.isCollapsed || !O.contains(document.activeElement)) {
2043
+ w(null);
2044
+ return;
2045
+ }
2046
+ const U = E.getRangeAt(0);
2047
+ if (!P.contains(U.commonAncestorContainer)) {
2048
+ w(null);
2049
+ return;
2050
+ }
2051
+ if (!U.toString().trim()) {
2052
+ w(null);
2053
+ return;
2054
+ }
2055
+ const F = O.getBoundingClientRect(), Q = U.getBoundingClientRect(), pe = getComputedStyle(O).direction === "rtl", Y = Q.top - F.top - 48, Ne = Y >= 0 ? Y : Q.bottom - F.top + 8, G = ((J = y.current) == null ? void 0 : J.offsetWidth) ?? 0, oe = pe ? F.right - Q.right + Q.width / 2 : Q.left - F.left + Q.width / 2, R = G / 2, K = Math.min(
2056
+ Math.max(oe, R),
2057
+ Math.max(R, F.width - R)
2058
+ );
2059
+ w({ top: Ne, start: K, rtl: pe }), G === 0 && !q && (q = !0, L = requestAnimationFrame(d));
2060
+ }, g = () => {
2061
+ cancelAnimationFrame(L), L = requestAnimationFrame(d);
2062
+ }, z = (O) => {
2063
+ const P = s();
2064
+ P && O.target instanceof Node && P.contains(O.target) && (T = !0, w(null));
2065
+ }, M = () => {
2066
+ T && (T = !1, g());
2067
+ }, B = (O) => {
2068
+ if (O.key !== "Escape") return;
2069
+ const P = c.current;
2070
+ !P || !P.contains(document.activeElement) || (f = !0, w(null));
2071
+ }, V = () => {
2072
+ f = !1, g();
2073
+ };
2074
+ return document.addEventListener("selectionchange", V), document.addEventListener("focusin", g), document.addEventListener("keydown", B, !0), document.addEventListener("pointerdown", z, !0), document.addEventListener("pointerup", M, !0), document.addEventListener("pointercancel", M, !0), window.addEventListener("scroll", g, !0), window.addEventListener("resize", g), g(), () => {
2075
+ cancelAnimationFrame(L), document.removeEventListener("selectionchange", V), document.removeEventListener("focusin", g), document.removeEventListener("keydown", B, !0), document.removeEventListener("pointerdown", z, !0), document.removeEventListener("pointerup", M, !0), document.removeEventListener("pointercancel", M, !0), window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", g);
2076
+ };
2077
+ }, [h, c, s]), h || !k ? null : /* @__PURE__ */ t(Fn, { children: /* @__PURE__ */ A(
2078
+ "div",
2079
+ {
2080
+ ref: y,
2081
+ role: "group",
2082
+ "aria-label": p("editor.ai.selectionTools"),
2083
+ "data-component-part": "selection-toolbar",
2084
+ className: `${cs} ${k.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
2085
+ style: {
2086
+ "--rte-sel-top": `${k.top}px`,
2087
+ "--rte-sel-start": `${k.start}px`
2088
+ },
2089
+ children: [
2090
+ ds.map((T) => {
2091
+ const L = Yr[T];
2092
+ return /* @__PURE__ */ t(
2093
+ j,
2094
+ {
2095
+ size: "sm",
2096
+ intent: "ghost",
2097
+ icon: L.icon,
2098
+ tooltip: p(L.label[0], L.label[1]),
2099
+ "aria-pressed": L.toggle ? n.has(L.toggle) : void 0,
2100
+ onMouseDown: (q) => q.preventDefault(),
2101
+ onClick: () => a(...L.command)
2102
+ },
2103
+ T
2104
+ );
2105
+ }),
2106
+ m ? /* @__PURE__ */ A(Ie, { children: [
2107
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", className: nn }),
2108
+ m
2109
+ ] }) : null
2110
+ ]
2111
+ }
2112
+ ) });
2113
+ }
2114
+ function ms({
2115
+ run: n,
2116
+ active: a,
2117
+ preset: c,
2118
+ insertHtml: s,
2119
+ insertTable: h,
2120
+ saveSelection: u,
2121
+ restoreSelection: m,
2122
+ getSelectedText: p,
2123
+ uploadImage: y,
2124
+ enableColor: k = !1,
2125
+ enableImage: w = !1,
2126
+ enableTable: S = !1,
2127
+ showExtensions: T = !1,
2128
+ extensionControl: L,
2129
+ variables: q,
2130
+ recentVariableTokens: f,
2131
+ insertVariable: d
2132
+ }) {
2133
+ const { t: g } = re("ui"), z = (oe) => oe.preventDefault(), M = (oe) => Da[c].includes(oe), B = (oe) => {
2134
+ if (!M(oe)) return null;
2135
+ const R = Yr[oe];
2136
+ return /* @__PURE__ */ t(
2137
+ j,
2138
+ {
2139
+ size: "sm",
2140
+ intent: "ghost",
2141
+ icon: R.icon,
2142
+ "aria-label": g(R.label[0], R.label[1]),
2143
+ "aria-pressed": R.toggle ? a.has(R.toggle) : void 0,
2144
+ onMouseDown: z,
2145
+ onClick: () => n(...R.command)
2146
+ },
2147
+ R.id
2148
+ );
2149
+ }, V = () => /* @__PURE__ */ t("span", { "aria-hidden": "true", className: nn }), O = M("format"), P = [B("undo"), B("redo")].filter(Boolean), E = [
2150
+ B("bold"),
2151
+ B("italic"),
2152
+ B("underline"),
2153
+ B("strike"),
2154
+ k ? /* @__PURE__ */ t(
2155
+ Ga,
2156
+ {
2157
+ run: n,
2158
+ saveSelection: u,
2159
+ restoreSelection: m
2160
+ },
2161
+ "colour"
2162
+ ) : null,
2163
+ k ? /* @__PURE__ */ t(
2164
+ Ka,
2165
+ {
2166
+ run: n,
2167
+ saveSelection: u,
2168
+ restoreSelection: m
2169
+ },
2170
+ "highlight"
2171
+ ) : null
2172
+ ].filter(Boolean), U = P.length > 0 || O || E.length > 0, F = [B("ul"), B("ol")].filter(Boolean), Q = [
2173
+ M("link") ? /* @__PURE__ */ t(
2174
+ Fa,
2175
+ {
2176
+ insertHtml: s,
2177
+ saveSelection: u,
2178
+ restoreSelection: m,
2179
+ getSelectedText: p
2180
+ },
2181
+ "link"
2182
+ ) : null,
2183
+ w ? /* @__PURE__ */ t(
2184
+ ja,
2185
+ {
2186
+ insertHtml: s,
2187
+ saveSelection: u,
2188
+ restoreSelection: m,
2189
+ uploadImage: y
2190
+ },
2191
+ "image"
2192
+ ) : null,
2193
+ S ? /* @__PURE__ */ t(
2194
+ Wa,
2195
+ {
2196
+ run: n,
2197
+ insertTable: h,
2198
+ active: a
2199
+ },
2200
+ "table"
2201
+ ) : null,
2202
+ q && q.length > 0 && d ? /* @__PURE__ */ t(
2203
+ Ba,
2204
+ {
2205
+ variables: q,
2206
+ recentVariableTokens: f,
2207
+ insertVariable: d,
2208
+ saveSelection: u
2209
+ },
2210
+ "variables"
2211
+ ) : null
2212
+ ].filter(Boolean), pe = L ? [/* @__PURE__ */ t(gt, { children: L }, "extensions")] : T ? [
2213
+ /* @__PURE__ */ t(
2214
+ j,
2215
+ {
2216
+ size: "sm",
2217
+ intent: "ghost",
2218
+ icon: /* @__PURE__ */ t($n, {}),
2219
+ "aria-label": g("editor.extensions", "Editor extensions"),
2220
+ disabled: !0,
2221
+ onMouseDown: z
2222
+ },
2223
+ "extensions"
2224
+ )
2225
+ ] : [], Y = [F, Q, pe].filter(
2226
+ (oe) => oe.length > 0
2227
+ ), Ne = Y.length > 0, G = (oe) => Y.map((R, K) => /* @__PURE__ */ A(gt, { children: [
2228
+ K > 0 || oe ? /* @__PURE__ */ t(V, {}) : null,
2229
+ R
2230
+ ] }, K));
2231
+ return (
2232
+ // Outer element is the query container + visual chrome; the flex row is an
2233
+ // inner child so `container-type` never lands on the flex parent (which
2234
+ // would blockify the inline controls).
2235
+ /* @__PURE__ */ t("div", { className: Oa(), "data-component": "editor-toolbar", children: /* @__PURE__ */ A(
2236
+ "div",
2237
+ {
2238
+ role: "group",
2239
+ "aria-label": g("editor.toolbarLabel"),
2240
+ className: qa,
2241
+ children: [
2242
+ P,
2243
+ P.length > 0 && (O || E.length > 0) ? /* @__PURE__ */ t(V, {}) : null,
2244
+ O ? /* @__PURE__ */ t(Pa, { run: n, active: a, onTriggerDown: z }) : null,
2245
+ O && E.length > 0 ? /* @__PURE__ */ t(V, {}) : null,
2246
+ E,
2247
+ Ne ? /* @__PURE__ */ A(Ie, { children: [
2248
+ /* @__PURE__ */ t("div", { className: "ds:hidden ds:@[384px]/toolbar:contents", children: G(U) }),
2249
+ /* @__PURE__ */ A("div", { className: "ds:contents ds:@[384px]/toolbar:hidden", children: [
2250
+ U ? /* @__PURE__ */ t(V, {}) : null,
2251
+ /* @__PURE__ */ A(ne, { children: [
2252
+ /* @__PURE__ */ t(ne.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
2253
+ j,
2254
+ {
2255
+ size: "sm",
2256
+ intent: "ghost",
2257
+ icon: /* @__PURE__ */ t(di, {}),
2258
+ "aria-label": g("editor.more", "More options"),
2259
+ onMouseDown: z
2260
+ }
2261
+ ) }),
2262
+ /* @__PURE__ */ t(ne.Content, { side: "bottom", align: "end", children: /* @__PURE__ */ t("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: G(!1) }) })
2263
+ ] })
2264
+ ] })
2265
+ ] }) : null
2266
+ ]
2267
+ }
2268
+ ) })
2269
+ );
2270
+ }
2271
+ function xe(n) {
2272
+ return Jo(n, "rich-text");
2273
+ }
2274
+ function Yt(n = "") {
2275
+ const a = String(n).trim();
2276
+ if (a === "" || a === "<p><br></p>" || a === "<p>&nbsp;</p>")
2277
+ return "";
2278
+ const c = a.replace(/<br\s*\/?>/gi, "").replace(/&nbsp;/gi, "").replace(/<[^>]+>/g, "").trim();
2279
+ return c === "" && /<img\b[^>]*>/i.test(a) ? a : c === "" ? "" : a;
2280
+ }
2281
+ function Fr(n) {
2282
+ return n.replace(
2283
+ /<img(?![^>]*\sloading=)([^>]*)>/gi,
2284
+ '<img loading="lazy"$1>'
2285
+ );
2286
+ }
2287
+ const _n = /^[A-Za-z0-9_]+$/, no = /\[\[([A-Za-z0-9_]+)\]\]/g, qn = "rte-variable-invalid", fs = new RegExp(
2288
+ `\\s*\\b${qn}\\b`,
2289
+ "g"
2290
+ );
2291
+ function jr(n) {
2292
+ return n.includes('data-redactor-type="variable"') ? n.replace(
2293
+ /<span\b[^>]*data-redactor-type="variable"[^>]*>/g,
2294
+ (a) => a.replace(/\s(?:data-label|title)="[^"]*"/g, "").replace(fs, "").replace(/\sclass=""/g, "")
2295
+ ) : n;
2296
+ }
2297
+ function gs(n) {
2298
+ const a = n.replace(/<[^>]*>/g, " ");
2299
+ return Array.from(a.matchAll(no), (c) => c[1]);
2300
+ }
2301
+ function Gr(n) {
2302
+ return typeof n == "object" && n !== null && "name" in n && n.name === "AiCreditsExhaustedError";
2303
+ }
2304
+ function hs(n) {
2305
+ return typeof n == "object" && n !== null && "name" in n && n.name === "AbortError";
2306
+ }
2307
+ function ps(n) {
2308
+ const a = document.createElement("template");
2309
+ return a.content.appendChild(n), a.innerHTML;
2310
+ }
2311
+ function Kr(n) {
2312
+ const a = document.createElement("template");
2313
+ return a.innerHTML = n, (a.content.textContent ?? "").replace(/\s+/g, " ").trim();
2314
+ }
2315
+ function Vr(n) {
2316
+ return n.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, "").replace(/[\s\u200B\uFEFF]+/g, "");
2317
+ }
2318
+ function bs(n) {
2319
+ const a = window.getSelection();
2320
+ if (!a || a.rangeCount === 0) return null;
2321
+ const c = a.getRangeAt(0);
2322
+ if (!n.contains(c.startContainer)) return null;
2323
+ const s = document.createRange();
2324
+ return s.selectNodeContents(n), s.setEnd(c.startContainer, c.startOffset), s.toString().length;
2325
+ }
2326
+ function vs(n, a) {
2327
+ var u;
2328
+ const c = window.getSelection();
2329
+ if (!c) return;
2330
+ const s = document.createTreeWalker(n, NodeFilter.SHOW_TEXT);
2331
+ let h = 0;
2332
+ for (let m = s.nextNode(); m; m = s.nextNode()) {
2333
+ const p = m;
2334
+ if (h + p.data.length >= a) {
2335
+ const y = document.createRange(), k = (u = p.parentElement) == null ? void 0 : u.closest(
2336
+ '[data-redactor-type="variable"]'
2337
+ );
2338
+ k ? y.setStartAfter(k) : y.setStart(p, a - h), y.collapse(!0), c.removeAllRanges(), c.addRange(y);
2339
+ return;
2340
+ }
2341
+ h += p.data.length;
2342
+ }
2343
+ }
2344
+ function Wr(n) {
2345
+ return `<span data-redactor-type="variable">[[${n}]]</span>`;
2346
+ }
2347
+ function mt(n, a) {
2348
+ var m;
2349
+ if (a.size === 0 || !n.includes("[[") || typeof DOMParser > "u")
2350
+ return n;
2351
+ const c = new DOMParser().parseFromString(
2352
+ `<body>${n}</body>`,
2353
+ "text/html"
2354
+ ), s = c.createTreeWalker(c.body, NodeFilter.SHOW_TEXT), h = [];
2355
+ for (let p = s.nextNode(); p; p = s.nextNode()) {
2356
+ const y = p;
2357
+ (m = y.parentElement) != null && m.closest('[data-redactor-type="variable"]') || y.data.includes("[[") && h.push(y);
2358
+ }
2359
+ let u = !1;
2360
+ for (const p of h) {
2361
+ const y = c.createDocumentFragment();
2362
+ let k = 0;
2363
+ for (const w of p.data.matchAll(no)) {
2364
+ const S = a.get(w[1].toLowerCase());
2365
+ if (!S || w.index === void 0) continue;
2366
+ y.append(p.data.slice(k, w.index));
2367
+ const T = c.createElement("span");
2368
+ T.setAttribute("data-redactor-type", "variable"), T.textContent = `[[${S}]]`, y.append(T), k = w.index + w[0].length;
2369
+ }
2370
+ k !== 0 && (y.append(p.data.slice(k)), p.replaceWith(y), u = !0);
2371
+ }
2372
+ return u ? c.body.innerHTML : n;
2373
+ }
2374
+ function ys(n) {
2375
+ if (!n || typeof n != "object") return;
2376
+ const a = n, c = (s) => {
2377
+ if (s && typeof s == "object" && "url" in s) {
2378
+ const h = s.url;
2379
+ return typeof h == "string" ? h : void 0;
2380
+ }
2381
+ };
2382
+ return typeof a.url == "string" ? a.url : c(a.file) ?? c(a.data) ?? Object.values(a).map(c).find(Boolean);
2383
+ }
2384
+ function ws(n) {
2385
+ if (n) return n;
2386
+ if (typeof window > "u") return null;
2387
+ const a = window;
2388
+ return a.$R ?? a.Redactor ?? null;
2389
+ }
2390
+ const ks = {
2391
+ bold: ["module.inline.format", { tag: "b" }],
2392
+ italic: ["module.inline.format", { tag: "i" }],
2393
+ strikethrough: ["module.inline.format", { tag: "del" }],
2394
+ bulletedList: ["module.list.toggle", "ul"],
2395
+ numberedList: ["module.list.toggle", "ol"],
2396
+ heading: ["module.block.format", { tag: "h2" }],
2397
+ quote: ["module.block.format", { tag: "blockquote" }],
2398
+ paragraph: ["module.block.format", { tag: "p" }]
2399
+ }, xs = {
2400
+ zh: "zh_cn",
2401
+ pt: "pt_br"
2402
+ };
2403
+ function Cs(n) {
2404
+ const a = n.split("-")[0];
2405
+ return xs[a] ?? a ?? "en";
2406
+ }
2407
+ const As = Bn(
2408
+ "redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
2409
+ ), Ts = [
2410
+ "ds:absolute ds:z-30",
2411
+ "ds:[inset-inline-start:var(--rte-typeahead-x)] ds:[inset-block-start:var(--rte-typeahead-y)]"
2412
+ ].join(" "), Es = Bn(
2413
+ [
2414
+ "ds:block ds:[inline-size:100%]",
2415
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
2416
+ "ds:bg-[var(--background)] ds:text-[var(--foreground)]",
2417
+ "ds:shadow-[var(--shadow-md)]",
2418
+ "ds:font-[family-name:var(--font-sans)] ds:text-[length:var(--font-size-base)]",
2419
+ "ds:p-[var(--spacing-md)] ds:[min-block-size:var(--rich-text-editor-min-block-size)]",
2420
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
2421
+ "ds:focus-visible:outline-solid",
2422
+ "ds:focus-visible:outline-[var(--ring)]",
2423
+ "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
2424
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
2425
+ ].join(" ")
2426
+ ), ro = [
2427
+ "ds:inline-flex ds:items-center ds:justify-center",
2428
+ "ds:[min-block-size:var(--min-target-size)] ds:[min-inline-size:var(--min-target-size)]",
2429
+ "ds:text-[color:var(--primary-foreground)]",
2430
+ "ds:transition-colors",
2431
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
2432
+ "ds:focus-visible:outline-solid",
2433
+ "ds:focus-visible:outline-[var(--primary-foreground)]",
2434
+ "ds:focus-visible:[outline-offset:calc(var(--focus-ring-width)*-1)]"
2435
+ ].join(" "), Ns = `${ro} ds:hover:bg-[color-mix(in_srgb,var(--primary-foreground)_15%,transparent)]`, Ms = `${ro} ds:bg-[var(--destructive)] ds:hover:bg-[color-mix(in_srgb,var(--destructive)_88%,var(--primary-foreground))]`;
2436
+ function Rs({
2437
+ notice: n,
2438
+ children: a
2439
+ }) {
2440
+ const [c, s] = N(!1);
2441
+ return /* @__PURE__ */ A(Hn, { open: c, onOpenChange: s, children: [
2442
+ /* @__PURE__ */ t(
2443
+ zs,
2444
+ {
2445
+ onOpen: () => s(!0),
2446
+ onPress: () => s(!1),
2447
+ children: a
2448
+ }
2449
+ ),
2450
+ /* @__PURE__ */ t(
2451
+ Hn.Content,
2452
+ {
2453
+ side: "bottom",
2454
+ align: "start",
2455
+ size: "sm",
2456
+ collisionPadding: 8,
2457
+ children: /* @__PURE__ */ t(vi, { ...n })
2458
+ }
2459
+ )
2460
+ ] });
2461
+ }
2462
+ function zs({
2463
+ onOpen: n,
2464
+ onPress: a,
2465
+ children: c
2466
+ }) {
2467
+ const { cancelClose: s, closeWithDelay: h } = bi(), u = C(null), m = v(() => {
2468
+ u.current && (clearTimeout(u.current), u.current = null);
2469
+ }, []);
2470
+ _(() => m, [m]);
2471
+ const p = v(() => {
2472
+ m(), s(), u.current = setTimeout(n, 300);
2473
+ }, [m, s, n]), y = v(() => {
2474
+ m(), h();
2475
+ }, [m, h]), k = C(!1), w = v(() => {
2476
+ k.current = !0, m(), a();
2477
+ }, [m, a]);
2478
+ _(() => {
2479
+ const T = () => {
2480
+ k.current = !1;
2481
+ };
2482
+ return document.addEventListener("keydown", T), () => document.removeEventListener("keydown", T);
2483
+ }, []);
2484
+ const S = v(() => {
2485
+ if (k.current) {
2486
+ k.current = !1;
2487
+ return;
2488
+ }
2489
+ m(), s(), n();
2490
+ }, [m, s, n]);
2491
+ return (
2492
+ // `ds:inline-flex` — NOT `ds:contents` — so this span has a real box
2493
+ // that hugs the button and Floating UI has a real rect to measure.
2494
+ // `display: contents` generates no box of its own; inside the pill's
2495
+ // flex/absolute layout that collapsed to a zero-size rect at the
2496
+ // editor's origin, so the card rendered top-left instead of at the
2497
+ // trigger (caught in review on :6007).
2498
+ /* @__PURE__ */ t(Hn.Anchor, { asChild: !0, children: /* @__PURE__ */ t(
2499
+ "span",
2500
+ {
2501
+ className: "ds:inline-flex",
2502
+ onMouseEnter: p,
2503
+ onMouseLeave: y,
2504
+ onPointerDown: w,
2505
+ onFocusCapture: S,
2506
+ onBlurCapture: y,
2507
+ children: c
2508
+ }
2509
+ ) })
2510
+ );
2511
+ }
2512
+ function ft(n, a) {
2513
+ return a ? /* @__PURE__ */ t(Rs, { notice: a, children: n }) : n;
2514
+ }
2515
+ function Jt(n, a) {
2516
+ return a ? { "aria-label": n } : { tooltip: n };
2517
+ }
2518
+ const oo = ["kit", "marketplace"];
2519
+ function _s({
2520
+ groupedExtensions: n,
2521
+ showExtensionGroups: a,
2522
+ extensionPending: c,
2523
+ extensionSession: s,
2524
+ extensionError: h,
2525
+ openExtension: u,
2526
+ closeExtension: m,
2527
+ saveSelection: p,
2528
+ closeSignal: y,
2529
+ restoreFocusOnCloseRef: k
2530
+ }) {
2531
+ const { t: w } = re("ui"), [S, T] = N(!1), L = C(null), q = C(!1);
2532
+ return _(() => {
2533
+ T(!1);
2534
+ }, [y]), _(() => {
2535
+ q.current && !s && (q.current = !1, k.current && window.requestAnimationFrame(() => {
2536
+ var f;
2537
+ return (f = L.current) == null ? void 0 : f.focus();
2538
+ }));
2539
+ }, [s, k]), /* @__PURE__ */ A(
2540
+ X.Root,
2541
+ {
2542
+ open: S,
2543
+ onOpenChange: (f) => {
2544
+ f ? (p(), T(!0)) : (T(!1), c && m());
2545
+ },
2546
+ children: [
2547
+ /* @__PURE__ */ t(X.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
2548
+ j,
2549
+ {
2550
+ ref: L,
2551
+ "data-component-part": "extensions-trigger",
2552
+ size: "sm",
2553
+ intent: "ghost",
2554
+ icon: /* @__PURE__ */ t($n, {}),
2555
+ "aria-label": w("editor.extensions"),
2556
+ onPointerDown: () => p()
2557
+ }
2558
+ ) }),
2559
+ /* @__PURE__ */ t(
2560
+ X.Content,
2561
+ {
2562
+ align: "end",
2563
+ onCloseAutoFocus: (f) => {
2564
+ (s == null ? void 0 : s.extension.kind) === "panel" && !h && f.preventDefault();
2565
+ },
2566
+ children: n.map(
2567
+ (f, d) => f.length > 0 ? /* @__PURE__ */ A(gt, { children: [
2568
+ a ? /* @__PURE__ */ t(X.Label, { children: w(
2569
+ d === 0 ? "editor.extensionsKit" : "editor.extensionsMarketplace"
2570
+ ) }) : null,
2571
+ f.map((g) => {
2572
+ var z;
2573
+ return /* @__PURE__ */ A(
2574
+ X.Item,
2575
+ {
2576
+ "data-extension-id": g.id,
2577
+ disabled: c && (s == null ? void 0 : s.extension.id) !== g.id,
2578
+ "aria-busy": c && (s == null ? void 0 : s.extension.id) === g.id || void 0,
2579
+ onSelect: (M) => {
2580
+ g.kind === "action" && M.preventDefault(), q.current = !0, u(g);
2581
+ },
2582
+ children: [
2583
+ c && (s == null ? void 0 : s.extension.id) === g.id ? /* @__PURE__ */ t(Pn, { size: "sm" }) : g.icon ?? /* @__PURE__ */ t($n, {}),
2584
+ /* @__PURE__ */ A("span", { className: "ds:flex ds:min-w-0 ds:flex-col ds:text-start", children: [
2585
+ /* @__PURE__ */ t("span", { children: Qr(w, g.label) }),
2586
+ g.description ? /* @__PURE__ */ t("span", { className: "type-meta ds:text-muted-foreground", children: g.description }) : null,
2587
+ ((z = g.source) == null ? void 0 : z.kind) === "marketplace" ? /* @__PURE__ */ A("span", { className: "type-meta ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-muted-foreground", children: [
2588
+ g.source.appIconUrl ? /* @__PURE__ */ t(
2589
+ "img",
2590
+ {
2591
+ src: g.source.appIconUrl,
2592
+ alt: "",
2593
+ className: "ds:size-[var(--spacing-md)]"
2594
+ }
2595
+ ) : null,
2596
+ g.source.appName
2597
+ ] }) : null
2598
+ ] })
2599
+ ]
2600
+ },
2601
+ g.id
2602
+ );
2603
+ })
2604
+ ] }, oo[d]) : null
2605
+ )
2606
+ }
2607
+ )
2608
+ ]
2609
+ }
2610
+ );
2611
+ }
2612
+ const Ss = Zo(
2613
+ ({
2614
+ id: n,
2615
+ defaultValue: a,
2616
+ value: c,
2617
+ onChange: s,
2618
+ toolbar: h = "standard",
2619
+ placeholder: u,
2620
+ readOnly: m = !1,
2621
+ ariaLabel: p,
2622
+ minHeight: y,
2623
+ showExtensions: k,
2624
+ extensions: w,
2625
+ extensionContext: S,
2626
+ onExtensionRun: T,
2627
+ className: L,
2628
+ redactor: q,
2629
+ options: f,
2630
+ plugins: d,
2631
+ lang: g,
2632
+ imageUploadUrl: z,
2633
+ onUploadImage: M,
2634
+ onKeyDown: B,
2635
+ onRequestAiDraft: V,
2636
+ aiDraftFormat: O = "html",
2637
+ aiPrivacyNotice: P,
2638
+ aiConsent: E,
2639
+ aiConsentHeadingLevel: U,
2640
+ onDictate: F,
2641
+ onProofread: Q,
2642
+ onAutoFormat: pe,
2643
+ aiTemplates: Y,
2644
+ onAiApplied: Ne,
2645
+ aiSparkle: G = !0,
2646
+ selectionToolbar: oe,
2647
+ variables: R,
2648
+ recentVariableTokens: K,
2649
+ onVariableInserted: J,
2650
+ validateVariable: se,
2651
+ onVariableValidityChange: rn,
2652
+ renderHelpMeWrite: Be,
2653
+ onAiCreditsExhausted: on,
2654
+ aiCreditsNotice: $e
2655
+ }, io) => {
2656
+ var zr, _r;
2657
+ const { t: $, i18n: Gn } = re("ui"), Kn = qe(), Pe = tt(
2658
+ () => `rte-${Kn.replace(/[^a-zA-Z0-9-_]/g, "")}`,
2659
+ [Kn]
2660
+ ), D = `#${Pe}`, ee = C(null), te = C(null), Me = C(null), an = C(!1), Mt = C(m), W = C(null), ht = C(null), [ue, Vn] = N(!1), [pt, De] = N(!1), [be, Wn] = N(null), [sn, Xn] = N(!1), [ln, cn] = N(!1), bt = C(null), Rt = C(T);
2661
+ Rt.current = T;
2662
+ const Fe = C(null), [ao, so] = N(0), Un = C(!0), dn = v((e = !0) => {
2663
+ Un.current = e, so((r) => r + 1);
2664
+ }, []), un = v(() => {
2665
+ var e, r;
2666
+ (e = bt.current) == null || e.abort(), bt.current = null, (r = Fe.current) == null || r.call(Fe, { status: "aborted" }), Wn(null), cn(!1), Xn(!1);
2667
+ }, []), Re = v(
2668
+ (e = !0) => {
2669
+ un(), dn(e);
2670
+ },
2671
+ [un, dn]
2672
+ );
2673
+ _(
2674
+ () => () => {
2675
+ var e, r;
2676
+ (e = bt.current) == null || e.abort(), (r = Fe.current) == null || r.call(Fe, { status: "aborted" });
2677
+ },
2678
+ []
2679
+ );
2680
+ const [lo, co] = N(""), [uo, mo] = N(
2681
+ "document"
2682
+ ), [fo, mn] = N(!1), je = C(on), fn = C(Be);
2683
+ _(() => {
2684
+ je.current = on, fn.current = Be;
2685
+ }, [on, Be]);
2686
+ const zt = C(null), me = tt(
2687
+ () => new Map(
2688
+ (R ?? []).map((e) => e.token).filter((e) => _n.test(e)).map((e) => [e.toLowerCase(), e])
2689
+ ),
2690
+ [R]
2691
+ ), Zn = tt(
2692
+ () => new Map(
2693
+ (R ?? []).map(
2694
+ (e) => [e.token.toLowerCase(), e.label]
2695
+ )
2696
+ ),
2697
+ [R]
2698
+ ), rt = C(me);
2699
+ _(() => {
2700
+ rt.current = me;
2701
+ }, [me]);
2702
+ const Qn = tt(
2703
+ () => (R ?? []).filter((e) => _n.test(e.token)),
2704
+ [R]
2705
+ ), gn = C(se);
2706
+ _(() => {
2707
+ gn.current = se;
2708
+ }, [se]);
2709
+ const hn = se !== void 0, pn = v(
2710
+ (e) => hn && gn.current ? gn.current(e) : me.has(e.toLowerCase()),
2711
+ [hn, me]
2712
+ ), ot = me.size > 0 || hn, [it, Yn] = N([]), Ge = C(rn);
2713
+ _(() => {
2714
+ Ge.current = rn;
2715
+ }, [rn]);
2716
+ const ze = C(() => {
2717
+ }), [bn, go] = N(
2718
+ () => /* @__PURE__ */ new Set()
2719
+ ), _t = C(null), [ho, po] = N(
2720
+ null
2721
+ ), St = v((e) => {
2722
+ _t.current = e, po(e);
2723
+ }, []), vt = C(null), Lt = C(null), fe = C(s), Ht = C(B);
2724
+ _(() => {
2725
+ fe.current = s, Ht.current = B;
2726
+ }, [s, B]);
2727
+ const bo = C(
2728
+ (() => {
2729
+ const e = c ?? a ?? "";
2730
+ return e ? xe(e) : "";
2731
+ })()
2732
+ ), le = v(() => {
2733
+ var r;
2734
+ const e = te.current;
2735
+ if (e)
2736
+ try {
2737
+ const o = e(D, "source.getCode");
2738
+ if (typeof o == "string") return jr(o);
2739
+ } catch {
2740
+ }
2741
+ return ((r = ee.current) == null ? void 0 : r.value) ?? "";
2742
+ }, [D]);
2743
+ _(() => {
2744
+ ze.current = () => {
2745
+ var o;
2746
+ if (!ot) {
2747
+ Yn((i) => i.length ? [] : i);
2748
+ return;
2749
+ }
2750
+ const e = (o = W.current) == null ? void 0 : o.querySelector(".redactor-in");
2751
+ e == null || e.querySelectorAll('[data-redactor-type="variable"]').forEach((i) => {
2752
+ const l = /^\[\[([A-Za-z0-9_]+)\]\]$/.exec(
2753
+ i.textContent ?? ""
2754
+ ), b = !l || !pn(l[1]);
2755
+ i.classList.contains(qn) !== b && i.classList.toggle(qn, b);
2756
+ const x = l ? Zn.get(l[1].toLowerCase()) ?? l[1] : i.textContent ?? "";
2757
+ i.getAttribute("data-label") !== x && i.setAttribute("data-label", x);
2758
+ const H = i.textContent ?? "";
2759
+ i.getAttribute("title") !== H && i.setAttribute("title", H);
2760
+ });
2761
+ const r = Array.from(
2762
+ new Set(
2763
+ gs(le()).filter(
2764
+ (i) => !pn(i)
2765
+ )
2766
+ )
2767
+ );
2768
+ Yn(
2769
+ (i) => i.length === r.length && i.every((l, b) => l === r[b]) ? i : r
2770
+ );
2771
+ }, ze.current();
2772
+ }, [ot, pn, Zn, le]), _(() => {
2773
+ var o;
2774
+ const r = ((o = W.current) == null ? void 0 : o.querySelector(".redactor-in")) ?? ee.current;
2775
+ r && (it.length > 0 ? (r.setAttribute("aria-invalid", "true"), r.setAttribute("aria-describedby", `${Pe}-variables-error`)) : (r.removeAttribute("aria-invalid"), r.removeAttribute("aria-describedby")));
2776
+ }, [it, Pe, ue]);
2777
+ const vn = C(!1);
2778
+ _(() => {
2779
+ var e, r;
2780
+ ot ? (vn.current = !0, (e = Ge.current) == null || e.call(Ge, it)) : vn.current && (vn.current = !1, (r = Ge.current) == null || r.call(Ge, []));
2781
+ }, [it, ot]), _(() => {
2782
+ se && ze.current();
2783
+ }, [se]);
2784
+ const ce = v(
2785
+ (e, ...r) => {
2786
+ const o = te.current;
2787
+ if (!o) return !1;
2788
+ const i = Mt.current;
2789
+ if (i)
2790
+ try {
2791
+ o(D, "disableReadOnly");
2792
+ } catch {
2793
+ }
2794
+ try {
2795
+ return o(D, e, ...r), !0;
2796
+ } catch {
2797
+ return !1;
2798
+ } finally {
2799
+ if (i)
2800
+ try {
2801
+ o(D, "enableReadOnly");
2802
+ } catch {
2803
+ }
2804
+ }
2805
+ },
2806
+ [D]
2807
+ ), de = v(
2808
+ (e, r) => {
2809
+ var ge;
2810
+ const o = (r == null ? void 0 : r.asHtml) ?? !0, i = o ? xe(e) : e;
2811
+ if (ce(o ? "insertion.insertHtml" : "insertion.insertText", i)) return;
2812
+ const b = ee.current;
2813
+ if (!b) return;
2814
+ const x = b.selectionStart ?? b.value.length, H = b.selectionEnd ?? b.value.length;
2815
+ b.value = b.value.slice(0, x) + i + b.value.slice(H);
2816
+ const Z = x + i.length;
2817
+ try {
2818
+ b.setSelectionRange(Z, Z);
2819
+ } catch {
2820
+ }
2821
+ (ge = fe.current) == null || ge.call(fe, { html: xe(b.value), markdown: "" });
2822
+ },
2823
+ [ce]
2824
+ ), ve = C(null), ye = v(() => {
2825
+ var i;
2826
+ const e = (i = W.current) == null ? void 0 : i.querySelector(".redactor-in"), r = typeof window < "u" ? window.getSelection() : null, o = /* @__PURE__ */ new Set();
2827
+ if (e && r && r.anchorNode && e.contains(r.anchorNode) && typeof document.queryCommandState == "function") {
2828
+ r.rangeCount > 0 && (ve.current = r.getRangeAt(0).cloneRange());
2829
+ try {
2830
+ document.queryCommandState("bold") && o.add("bold"), document.queryCommandState("italic") && o.add("italic"), document.queryCommandState("underline") && o.add("underline"), document.queryCommandState("strikeThrough") && o.add("strike"), document.queryCommandState("insertUnorderedList") && o.add("ul"), document.queryCommandState("insertOrderedList") && o.add("ol");
2831
+ const l = String(
2832
+ document.queryCommandValue("formatBlock") || ""
2833
+ ).toLowerCase();
2834
+ /^h[1-6]$/.test(l) ? (o.add("heading"), o.add(l)) : l === "blockquote" ? o.add("quote") : o.add("paragraph");
2835
+ const b = r.anchorNode.nodeType === Node.TEXT_NODE ? r.anchorNode.parentElement : r.anchorNode;
2836
+ b && e.contains(b) && b.closest("table") && o.add("table");
2837
+ } catch {
2838
+ }
2839
+ }
2840
+ go(
2841
+ (l) => l.size === o.size && [...o].every((b) => l.has(b)) ? l : o
2842
+ );
2843
+ }, []), Ke = v(
2844
+ (e, ...r) => {
2845
+ ce(e, ...r), typeof window < "u" ? window.requestAnimationFrame(() => ye()) : ye();
2846
+ },
2847
+ [ce, ye]
2848
+ );
2849
+ _(() => {
2850
+ const e = W.current;
2851
+ if (!e) return;
2852
+ const r = {
2853
+ b: ["module.inline.format", { tag: "b" }],
2854
+ i: ["module.inline.format", { tag: "i" }],
2855
+ u: ["module.inline.format", { tag: "u" }]
2856
+ }, o = (i) => {
2857
+ if (!(i.metaKey || i.ctrlKey) || i.altKey || i.shiftKey || i.isComposing) return;
2858
+ const l = r[i.key.toLowerCase()];
2859
+ if (!l) return;
2860
+ const b = e.querySelector(".redactor-in");
2861
+ !b || !(i.target instanceof Node) || !b.contains(i.target) || Mt.current || (i.preventDefault(), i.stopImmediatePropagation(), Ke(...l));
2862
+ };
2863
+ return e.addEventListener("keydown", o, !0), () => e.removeEventListener("keydown", o, !0);
2864
+ }, [Ke]);
2865
+ const Ve = v(
2866
+ (e) => {
2867
+ de(e, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => ye());
2868
+ },
2869
+ [de, ye]
2870
+ ), [at, yn] = N(null), It = C(null), wn = `${Pe}-variables`, Jn = C(null), [kn, vo] = N(void 0), Ce = v(() => {
2871
+ It.current = null, yn(null);
2872
+ }, []), $t = v(
2873
+ (e, r) => {
2874
+ const o = window.getSelection();
2875
+ if (!o) return;
2876
+ const i = document.createRange();
2877
+ i.setStart(r.node, r.start), i.setEnd(r.node, r.end), o.removeAllRanges(), o.addRange(i), Ve(Wr(e)), window.requestAnimationFrame(() => ze.current());
2878
+ },
2879
+ [Ve]
2880
+ );
2881
+ _(() => {
2882
+ const e = W.current;
2883
+ if (!e || !ot) return;
2884
+ const r = () => {
2885
+ var He;
2886
+ const l = e.querySelector(".redactor-in"), b = window.getSelection();
2887
+ if (!l || !b || b.rangeCount === 0 || !b.isCollapsed) {
2888
+ Ce();
2889
+ return;
2890
+ }
2891
+ const { startContainer: x, startOffset: H } = b.getRangeAt(0);
2892
+ if (x.nodeType !== Node.TEXT_NODE || !l.contains(x) || (((He = x.parentElement) == null ? void 0 : He.closest(
2893
+ '[data-redactor-type="variable"]'
2894
+ )) ?? null) !== null) {
2895
+ Ce();
2896
+ return;
2897
+ }
2898
+ const Z = x, ge = Z.data.slice(0, H), Te = /\[\[([A-Za-z0-9_]+)\]\]$/.exec(ge);
2899
+ if (Te) {
2900
+ Ce(), $t(
2901
+ me.get(Te[1].toLowerCase()) ?? Te[1],
2902
+ { node: Z, start: H - Te[0].length, end: H }
2903
+ );
2904
+ return;
2905
+ }
2906
+ const dt = /\[\[([A-Za-z0-9_ ]{0,40})$/.exec(ge), ie = ht.current;
2907
+ if (!dt || !ie || (R ?? []).length === 0) {
2908
+ Ce();
2909
+ return;
2910
+ }
2911
+ const Le = {
2912
+ node: Z,
2913
+ start: H - dt[0].length,
2914
+ end: H
2915
+ };
2916
+ It.current = Le;
2917
+ const ut = document.createRange();
2918
+ ut.setStart(Z, Le.start), ut.setEnd(Z, Le.end);
2919
+ const et = ut.getBoundingClientRect(), At = ie.getBoundingClientRect(), Rn = getComputedStyle(ie).direction === "rtl";
2920
+ yn({
2921
+ query: dt[1],
2922
+ left: Rn ? At.right - et.right : et.left - At.left,
2923
+ top: et.bottom - At.top + 4
2924
+ });
2925
+ }, o = (l) => {
2926
+ var x;
2927
+ if (!It.current || !["ArrowDown", "ArrowUp", "Home", "End", "Enter", "Escape"].includes(
2928
+ l.key
2929
+ ))
2930
+ return;
2931
+ (((x = Jn.current) == null ? void 0 : x.handleKeyDown(l)) ?? !1) && (l.preventDefault(), l.stopImmediatePropagation());
2932
+ }, i = () => Ce();
2933
+ return e.addEventListener("input", r), e.addEventListener("keydown", o, !0), e.addEventListener("focusout", i), () => {
2934
+ e.removeEventListener("input", r), e.removeEventListener("keydown", o, !0), e.removeEventListener("focusout", i);
2935
+ };
2936
+ }, [
2937
+ ot,
2938
+ me,
2939
+ R,
2940
+ $t,
2941
+ Ce
2942
+ ]), _(() => {
2943
+ var r;
2944
+ const e = (r = W.current) == null ? void 0 : r.querySelector(".redactor-in");
2945
+ e && (at ? (e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-controls", `${wn}-list`), kn ? e.setAttribute("aria-activedescendant", kn) : e.removeAttribute("aria-activedescendant")) : (e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls"), e.removeAttribute("aria-activedescendant")));
2946
+ }, [at, wn, kn]);
2947
+ const yo = v(
2948
+ (e) => {
2949
+ const r = It.current;
2950
+ Ce(), r && $t(e.token, r), J == null || J(e.token);
2951
+ },
2952
+ [Ce, $t, J]
2953
+ ), wo = v(() => {
2954
+ Ce();
2955
+ }, [Ce]), ko = v((e) => {
2956
+ yn((r) => r && { ...r, query: e });
2957
+ }, []), st = v(() => {
2958
+ var r;
2959
+ if (typeof window < "u") {
2960
+ const o = (r = W.current) == null ? void 0 : r.querySelector(".redactor-in"), i = window.getSelection();
2961
+ o && i && i.rangeCount > 0 && i.anchorNode && o.contains(i.anchorNode) && (ve.current = i.getRangeAt(0).cloneRange());
2962
+ }
2963
+ const e = te.current;
2964
+ if (e)
2965
+ try {
2966
+ e(D, "selection.save");
2967
+ } catch {
2968
+ }
2969
+ }, [D]), he = v(() => {
2970
+ const e = te.current;
2971
+ if (!e) return;
2972
+ const r = ve.current;
2973
+ try {
2974
+ e(D, "editor.focus");
2975
+ } catch {
2976
+ }
2977
+ if (r && typeof window < "u") {
2978
+ const o = window.getSelection();
2979
+ if (o)
2980
+ try {
2981
+ o.removeAllRanges(), o.addRange(r);
2982
+ return;
2983
+ } catch {
2984
+ }
2985
+ }
2986
+ try {
2987
+ e(D, "selection.restore");
2988
+ } catch {
2989
+ }
2990
+ }, [D]), xo = v(() => {
2991
+ var o;
2992
+ if (typeof window > "u") return "";
2993
+ const e = (o = W.current) == null ? void 0 : o.querySelector(".redactor-in"), r = window.getSelection();
2994
+ return !e || !r || !r.anchorNode || !e.contains(r.anchorNode) ? "" : r.toString();
2995
+ }, []), Co = v(() => {
2996
+ var l;
2997
+ if (typeof window > "u") return null;
2998
+ const e = (l = W.current) == null ? void 0 : l.querySelector(".redactor-in"), r = window.getSelection();
2999
+ if (!e || !r || r.rangeCount === 0) return null;
3000
+ const o = r.anchorNode, i = o && o.nodeType === Node.TEXT_NODE ? o.parentElement : o;
3001
+ return !i || !e.contains(i) ? null : i.closest("table");
3002
+ }, []), er = C(null), Dt = v(() => {
3003
+ var l;
3004
+ if (typeof window > "u") return null;
3005
+ const e = (l = W.current) == null ? void 0 : l.querySelector(".redactor-in"), r = window.getSelection();
3006
+ if (!e || !r || r.rangeCount === 0) return null;
3007
+ const o = r.anchorNode, i = o && o.nodeType === Node.TEXT_NODE ? o.parentElement : o;
3008
+ return !i || !e.contains(i) ? null : i.closest("td,th");
3009
+ }, []), Ao = v(() => {
3010
+ er.current = Dt();
3011
+ }, [Dt]), To = v(
3012
+ (e, r) => {
3013
+ var b;
3014
+ const o = er.current ?? Dt();
3015
+ if (!o) return;
3016
+ const i = e === "row" ? Array.from(((b = o.closest("tr")) == null ? void 0 : b.children) ?? [o]).filter(
3017
+ (x) => x instanceof HTMLElement && (x.tagName === "TD" || x.tagName === "TH")
3018
+ ) : [o], l = te.current;
3019
+ if (l)
3020
+ try {
3021
+ l(D, "module.buffer.trigger");
3022
+ } catch {
3023
+ }
3024
+ for (const x of i)
3025
+ r ? x.style.setProperty("background-color", r) : x.style.removeProperty("background-color");
3026
+ if (l)
3027
+ try {
3028
+ l(D, "broadcast", "hardsync");
3029
+ } catch {
3030
+ }
3031
+ typeof window < "u" && window.requestAnimationFrame(() => ye());
3032
+ },
3033
+ [Dt, D, ye]
3034
+ );
3035
+ _(() => {
3036
+ const e = W.current;
3037
+ if (typeof window > "u" || !e) return;
3038
+ const r = (l) => {
3039
+ const b = e.querySelector(".redactor-in"), x = l.target;
3040
+ if (!b || !(x instanceof Node) || !b.contains(x))
3041
+ return;
3042
+ const H = x instanceof Element ? x.closest("img") : null;
3043
+ St(H && b.contains(H) ? H : null);
3044
+ }, o = (l) => {
3045
+ l.key === "Escape" && _t.current && St(null);
3046
+ }, i = (l) => {
3047
+ const b = l.relatedTarget;
3048
+ (!(b instanceof Node) || !e.contains(b)) && St(null);
3049
+ };
3050
+ return e.addEventListener("click", r), e.addEventListener("keydown", o), e.addEventListener("focusout", i), () => {
3051
+ e.removeEventListener("click", r), e.removeEventListener("keydown", o), e.removeEventListener("focusout", i);
3052
+ };
3053
+ }, [St]);
3054
+ const Eo = v(
3055
+ (e) => {
3056
+ const r = _t.current;
3057
+ if (!r) return;
3058
+ const o = Dn.includes(
3059
+ e
3060
+ ) ? Dn : to, i = te.current;
3061
+ if (i)
3062
+ try {
3063
+ i(D, "module.buffer.trigger");
3064
+ } catch {
3065
+ }
3066
+ for (const l of o) r.classList.remove(l);
3067
+ if (r.classList.add(e), i)
3068
+ try {
3069
+ i(D, "broadcast", "hardsync");
3070
+ } catch {
3071
+ }
3072
+ typeof window < "u" && window.requestAnimationFrame(() => ye());
3073
+ },
3074
+ [D, ye]
3075
+ ), No = v(
3076
+ (e) => {
3077
+ const r = _t.current;
3078
+ if (!r) return;
3079
+ const o = te.current;
3080
+ if (o)
3081
+ try {
3082
+ o(D, "module.buffer.trigger");
3083
+ } catch {
3084
+ }
3085
+ if (r.style.setProperty("width", `${e}%`), o)
3086
+ try {
3087
+ o(D, "broadcast", "hardsync");
3088
+ } catch {
3089
+ }
3090
+ typeof window < "u" && window.requestAnimationFrame(() => ye());
3091
+ },
3092
+ [D, ye]
3093
+ ), Mo = v(
3094
+ (e) => {
3095
+ var o;
3096
+ const r = te.current;
3097
+ if (r && typeof window < "u") {
3098
+ const i = (o = W.current) == null ? void 0 : o.querySelector(".redactor-in"), l = window.getSelection(), b = l == null ? void 0 : l.anchorNode, x = b && b.nodeType === Node.TEXT_NODE ? b.parentElement : b, H = x && (i != null && i.contains(x)) ? x.closest("ul,ol") : null;
3099
+ if (H)
3100
+ try {
3101
+ r(D, "caret.setAfter", H);
3102
+ } catch {
3103
+ }
3104
+ }
3105
+ Ve(e), typeof window < "u" && window.requestAnimationFrame(() => {
3106
+ var l;
3107
+ const i = (l = W.current) == null ? void 0 : l.querySelector(".redactor-in");
3108
+ i == null || i.querySelectorAll("table td, table th").forEach((b) => {
3109
+ let x = b.lastChild;
3110
+ for (; x && x.nodeType === Node.TEXT_NODE && !(x.textContent ?? "").trim(); ) {
3111
+ const H = x.previousSibling;
3112
+ b.removeChild(x), x = H;
3113
+ }
3114
+ });
3115
+ });
3116
+ },
3117
+ [Ve, D]
3118
+ ), tr = v(
3119
+ async (e, r) => {
3120
+ if (M) return M(e, r);
3121
+ if (!z) throw new Error("No image upload URL configured.");
3122
+ const o = new FormData();
3123
+ o.append("file", e);
3124
+ const i = await fetch(z, {
3125
+ method: "POST",
3126
+ body: o,
3127
+ credentials: "same-origin",
3128
+ signal: r
3129
+ });
3130
+ if (!i.ok) throw new Error(`Image upload failed (${i.status}).`);
3131
+ const l = ys(await i.json());
3132
+ if (!l) throw new Error("Image upload response contained no URL.");
3133
+ return l;
3134
+ },
3135
+ [z, M]
3136
+ ), We = ti({ enabled: G }), {
3137
+ start: lt,
3138
+ land: _e,
3139
+ reset: ct
3140
+ } = We, yt = C(null), Ot = C(null), [we, nr] = N(!1), [Ro, rr] = N(!1), [zo, qt] = N(""), Bt = v(() => {
3141
+ const e = Ot.current;
3142
+ e != null && e.parentNode && e.parentNode.removeChild(e), Ot.current = null;
3143
+ }, []), or = v((e) => {
3144
+ var i;
3145
+ const r = (i = W.current) == null ? void 0 : i.querySelector(
3146
+ ".redactor-in"
3147
+ );
3148
+ if (!r) return;
3149
+ let o = Ot.current;
3150
+ if (!o || !r.contains(o)) {
3151
+ o = document.createElement("span"), o.setAttribute("data-rte-interim", ""), o.setAttribute("contenteditable", "false");
3152
+ const l = window.getSelection();
3153
+ if (l && l.rangeCount > 0 && r.contains(l.anchorNode)) {
3154
+ const b = l.getRangeAt(0);
3155
+ b.collapse(!1), b.insertNode(o);
3156
+ } else
3157
+ r.appendChild(o);
3158
+ Ot.current = o;
3159
+ }
3160
+ o.textContent = e;
3161
+ }, []), Pt = v(() => {
3162
+ var e;
3163
+ (e = yt.current) == null || e.abort();
3164
+ }, []), ir = v(() => {
3165
+ var b;
3166
+ if (typeof window > "u") return !1;
3167
+ const e = window.getSelection(), r = (b = W.current) == null ? void 0 : b.querySelector(".redactor-in");
3168
+ if (!e || e.rangeCount === 0 || !r) return !1;
3169
+ const { startContainer: o, startOffset: i } = e.getRangeAt(0);
3170
+ if (!r.contains(o) || o.nodeType !== Node.TEXT_NODE || i === 0)
3171
+ return !1;
3172
+ const l = o.data.charAt(i - 1);
3173
+ return /\S/.test(l) && l !== " ";
3174
+ }, []), ke = E !== void 0 && !E.granted, xn = C(null), Ft = v(() => {
3175
+ if (!F || ke) return;
3176
+ const e = new AbortController();
3177
+ yt.current = e, rr(!1), nr(!0), qt($("editor.ai.listening")), G && lt(), Bt(), F({
3178
+ signal: e.signal,
3179
+ // Interim text shows live in the editor (grey + caret); each final
3180
+ // replaces it with committed text at the caret.
3181
+ onPartialTranscript: (r) => {
3182
+ e.signal.aborted || or(r);
3183
+ },
3184
+ onFinalTranscript: (r) => {
3185
+ if (e.signal.aborted) return;
3186
+ Bt();
3187
+ const o = r.trim();
3188
+ if (o) {
3189
+ const i = xn.current;
3190
+ if (i) {
3191
+ xn.current = null, ve.current = i, he(), de(`${o} `, { asHtml: !1 }), G && _e(), qt(o);
3192
+ return;
3193
+ }
3194
+ const l = ir() ? " " : "";
3195
+ de(`${l}${o} `, { asHtml: !1 }), G && _e(), qt(o);
3196
+ }
3197
+ }
3198
+ }).catch((r) => {
3199
+ var o;
3200
+ if (!(e.signal.aborted || r && typeof r == "object" && "name" in r && r.name === "AbortError")) {
3201
+ if (Gr(r) && ((o = je.current) == null || o.call(je), fn.current)) {
3202
+ mn(!0), De(!0);
3203
+ return;
3204
+ }
3205
+ rr(!0);
3206
+ }
3207
+ }).finally(() => {
3208
+ Bt(), yt.current === e && (yt.current = null, nr(!1), qt(""), G && !Se.current && ct());
3209
+ });
3210
+ }, [
3211
+ F,
3212
+ ke,
3213
+ de,
3214
+ he,
3215
+ Bt,
3216
+ or,
3217
+ ir,
3218
+ G,
3219
+ lt,
3220
+ _e,
3221
+ ct,
3222
+ $
3223
+ ]);
3224
+ _(() => () => {
3225
+ var e;
3226
+ return (e = yt.current) == null ? void 0 : e.abort();
3227
+ }, []);
3228
+ const [jt, wt] = N(null), Xe = C(null), Gt = C(null), [_o, ar] = N(!1), So = ((E == null ? void 0 : E.pending) ?? !1) || _o, Kt = C(!1), Cn = v(() => {
3229
+ Xe.current = null, Gt.current = null, Kt.current = !1, wt(null);
3230
+ }, []), Lo = v(() => {
3231
+ var r;
3232
+ Kt.current = !0;
3233
+ const e = (r = E == null ? void 0 : E.onGrant) == null ? void 0 : r.call(E);
3234
+ e && typeof e.then == "function" && (ar(!0), Promise.resolve(e).catch(() => {
3235
+ }).finally(() => ar(!1)));
3236
+ }, [E]), sr = C((E == null ? void 0 : E.granted) ?? !0);
3237
+ _(() => {
3238
+ const e = sr.current;
3239
+ if (sr.current = (E == null ? void 0 : E.granted) ?? !0, !e && (E != null && E.granted) && Xe.current) {
3240
+ const r = Xe.current, o = Kt.current;
3241
+ Xe.current = null, Kt.current = !1, wt(null);
3242
+ const i = Gt.current;
3243
+ if (Gt.current = null, !o) return;
3244
+ r === "write" ? De(!0) : r === "action" ? i == null || i() : (he(), Ft());
3245
+ }
3246
+ }, [E == null ? void 0 : E.granted, he, Ft]), _(() => {
3247
+ ke && (De(!1), we && Pt());
3248
+ }, [ke, we, Pt]);
3249
+ const lr = v(
3250
+ (e = "document") => {
3251
+ if (we) {
3252
+ Pt();
3253
+ return;
3254
+ }
3255
+ st();
3256
+ const r = ve.current;
3257
+ if (xn.current = e === "selection" && r && !r.collapsed ? r.cloneRange() : null, ke) {
3258
+ Xe.current = "dictate", wt("dictate");
3259
+ return;
3260
+ }
3261
+ Ft();
3262
+ },
3263
+ [we, Pt, ke, st, Ft]
3264
+ ), cr = v(
3265
+ (e = "document") => {
3266
+ st();
3267
+ const r = ve.current, o = r ? r.cloneRange() : null, i = e === "selection" && !!(o && !o.collapsed);
3268
+ if (o && !i && o.collapse(!1), zt.current = o, mo(i ? "selection" : "document"), co(i && o ? o.toString() : ""), ke) {
3269
+ Xe.current = "write", wt("write");
3270
+ return;
3271
+ }
3272
+ De(!0);
3273
+ },
3274
+ [st, ke]
3275
+ ), dr = tt(() => E != null && E.granted ? /* @__PURE__ */ A(Ie, { children: [
3276
+ $(
3277
+ "editor.ai.consentRecorded",
3278
+ "AI assistance consent has been recorded."
3279
+ ),
3280
+ P ? /* @__PURE__ */ A(Ie, { children: [
3281
+ " ",
3282
+ P
3283
+ ] }) : null
3284
+ ] }) : P, [E, P, $]), [Ue, An] = N(null), [Ho, Vt] = N(!1), [ur, mr] = N(!1), [Io, Ze] = N(""), fr = C(null), Se = C(null), Wt = C(Ne);
3285
+ _(() => {
3286
+ Wt.current = Ne;
3287
+ }, [Ne]), _(() => {
3288
+ G && (!we && Ue === null || We.state === null && lt());
3289
+ }, [G, we, Ue, We.state, lt]);
3290
+ const kt = (e) => e.preventDefault(), gr = v(
3291
+ (e) => {
3292
+ var o;
3293
+ const r = te.current;
3294
+ if (r)
3295
+ try {
3296
+ const i = r(D);
3297
+ (o = i == null ? void 0 : i.broadcast) == null || o.call(i, "state", !1, e);
3298
+ } catch {
3299
+ }
3300
+ },
3301
+ [D]
3302
+ ), hr = C(!1), Qe = v(
3303
+ (e) => {
3304
+ const r = te.current;
3305
+ if (!r || hr.current === e) return;
3306
+ hr.current = e;
3307
+ const o = e || m;
3308
+ Mt.current = o;
3309
+ try {
3310
+ r(D, o ? "enableReadOnly" : "disableReadOnly");
3311
+ } catch {
3312
+ }
3313
+ },
3314
+ [D, m]
3315
+ ), Tn = v(
3316
+ (e) => {
3317
+ var o;
3318
+ const r = mt(
3319
+ xe(e),
3320
+ rt.current
3321
+ );
3322
+ !ce("source.setCode", r) && ee.current && (ee.current.value = r), (o = fe.current) == null || o.call(fe, { html: r, markdown: "" });
3323
+ },
3324
+ [ce]
3325
+ ), Ye = v(
3326
+ (e) => {
3327
+ var l;
3328
+ const r = (l = W.current) == null ? void 0 : l.querySelector(".redactor-in"), o = typeof window < "u" ? window.getSelection() : null;
3329
+ if (e === "selection" && r && o && o.rangeCount > 0 && !o.isCollapsed) {
3330
+ const b = o.getRangeAt(0);
3331
+ if (r.contains(b.commonAncestorContainer)) {
3332
+ const x = b.toString();
3333
+ if (x.trim())
3334
+ return {
3335
+ scope: "selection",
3336
+ range: b.cloneRange(),
3337
+ html: ps(b.cloneContents()),
3338
+ text: x
3339
+ };
3340
+ }
3341
+ }
3342
+ const i = le();
3343
+ return { scope: "document", range: null, html: i, text: Kr(i) };
3344
+ },
3345
+ [le]
3346
+ ), En = v(
3347
+ (e, r, o, i) => {
3348
+ if (Se.current || !o.text.trim()) return;
3349
+ const l = new AbortController();
3350
+ Se.current = l, An(e), mr(!1), fr.current = e, Ze($("editor.ai.generating")), Vt(!1), G && lt();
3351
+ const b = le();
3352
+ Qe(!0), Promise.resolve(
3353
+ r({
3354
+ html: o.html,
3355
+ text: o.text,
3356
+ scope: o.scope,
3357
+ signal: l.signal
3358
+ })
3359
+ ).then((x) => {
3360
+ var Z;
3361
+ if (l.signal.aborted) return;
3362
+ Qe(!1);
3363
+ const H = String(x ?? "");
3364
+ if (le() !== b) {
3365
+ mr(!0), Ze("");
3366
+ return;
3367
+ }
3368
+ if (!Kr(H)) {
3369
+ Vt(!0), Ze("");
3370
+ return;
3371
+ }
3372
+ if (gr(b), o.scope === "selection" && o.range) {
3373
+ if (!o.range.startContainer.isConnected) {
3374
+ Vt(!0), Ze("");
3375
+ return;
3376
+ }
3377
+ ve.current = o.range, he();
3378
+ const ge = mt(
3379
+ xe(H),
3380
+ rt.current
3381
+ );
3382
+ ce("insertion.insertHtml", ge) || de(H, { asHtml: !0 });
3383
+ } else
3384
+ Tn(H);
3385
+ G && _e(), Ze($("editor.ai.actionDone")), (Z = Wt.current) == null || Z.call(Wt, {
3386
+ action: e,
3387
+ template: i,
3388
+ scope: o.scope,
3389
+ previousHtml: b,
3390
+ undo: () => Tn(b)
3391
+ });
3392
+ }).catch((x) => {
3393
+ var H;
3394
+ if (Qe(!1), !(l.signal.aborted || hs(x))) {
3395
+ if (Gr(x) && ((H = je.current) == null || H.call(je), fn.current)) {
3396
+ mn(!0), De(!0);
3397
+ return;
3398
+ }
3399
+ Vt(!0), Ze("");
3400
+ }
3401
+ }).finally(() => {
3402
+ Se.current === l && (Se.current = null, Qe(!1), An(null), ct());
3403
+ });
3404
+ },
3405
+ [
3406
+ G,
3407
+ lt,
3408
+ _e,
3409
+ ct,
3410
+ Qe,
3411
+ le,
3412
+ he,
3413
+ ce,
3414
+ de,
3415
+ Tn,
3416
+ gr,
3417
+ $
3418
+ ]
3419
+ ), xt = v(
3420
+ (e, r, o, i) => {
3421
+ if (ke) {
3422
+ Gt.current = () => En(e, r, o, i), Xe.current = "action", wt("action");
3423
+ return;
3424
+ }
3425
+ En(e, r, o, i);
3426
+ },
3427
+ [ke, En]
3428
+ ), pr = v(
3429
+ (e, r) => {
3430
+ const o = Y == null ? void 0 : Y.onRun;
3431
+ o && xt(
3432
+ "template",
3433
+ (i) => o({ ...i, template: e }),
3434
+ r,
3435
+ e
3436
+ );
3437
+ },
3438
+ [Y, xt]
3439
+ ), br = v(() => {
3440
+ var e;
3441
+ (e = Se.current) == null || e.abort(), Se.current = null, Qe(!1), An(null), Ze(""), ct();
3442
+ }, [Qe, ct]), vr = C(null);
3443
+ _(() => {
3444
+ const e = Ue ?? fr.current;
3445
+ if (!e) return;
3446
+ const r = e === "template" ? "ai-templates" : `ai-${e}`, o = requestAnimationFrame(() => {
3447
+ var l, b;
3448
+ const i = document.activeElement;
3449
+ i && i !== document.body && i.isConnected || (b = (l = vr.current) == null ? void 0 : l.querySelector(`[data-component-part="${r}"]`)) == null || b.focus();
3450
+ });
3451
+ return () => cancelAnimationFrame(o);
3452
+ }, [Ue]), _(() => () => {
3453
+ var e;
3454
+ return (e = Se.current) == null ? void 0 : e.abort();
3455
+ }, []), _(() => {
3456
+ const e = ee.current;
3457
+ if (!e) return;
3458
+ e.value = bo.current, ze.current();
3459
+ const r = ws(q);
3460
+ if (!r) {
3461
+ Vn(!0);
3462
+ return;
3463
+ }
3464
+ if (te.current = r, e.value = mt(e.value, rt.current), g === void 0 && (f == null ? void 0 : f.lang) === void 0 && r.addLang && r.lang) {
3465
+ const x = `alfadocs-${Pe}`;
3466
+ r.addLang(x, $r($)), Me.current = x;
3467
+ }
3468
+ const o = {
3469
+ lang: Me.current ?? g ?? Cs(Gn.language || "en"),
3470
+ // The kit renders its OWN toolbar (EditorToolbar) and drives Redactor
3471
+ // via the command API, so Redactor's native toolbar is suppressed.
3472
+ toolbar: !1,
3473
+ plugins: d ?? [],
3474
+ placeholder: u ?? $("editor.placeholder"),
3475
+ toolbarFixed: !1,
3476
+ // Platform parity (RedactorWysiwyg.js:84): no inline shortcode expansion.
3477
+ shortcodes: !1,
3478
+ // The kit owns image editing: ImageFloatingToolbar provides DS-native,
3479
+ // keyboard-accessible resize + wrap/align, so Redactor's own image
3480
+ // popup AND its single-handle drag-resizer are both disabled to avoid a
3481
+ // second, untokenised, mouse-only UI competing with ours.
3482
+ imageEditable: !1,
3483
+ imageResizable: !1
3484
+ }, i = z ? { imageUpload: z } : {}, l = (f == null ? void 0 : f.callbacks) ?? {}, b = {
3485
+ ...o,
3486
+ ...i,
3487
+ ...f ?? {},
3488
+ // Re-pin safety-critical keys LAST so consumer `options` can't override
3489
+ // the sanitising change handler or re-enable Redactor's native image UI
3490
+ // (the kit's ImageFloatingToolbar replaces both — see kitDefaults above).
3491
+ imageEditable: !1,
3492
+ imageResizable: !1,
3493
+ callbacks: {
3494
+ ...l,
3495
+ changed(x) {
3496
+ ze.current();
3497
+ const H = Yt(
3498
+ Fr(jr(x))
3499
+ ), Z = xe(H), ge = wr.current;
3500
+ if (ge && Date.now() < ge.until && Vr(Z) === ge.text) {
3501
+ Lt.current = Z;
3502
+ return;
3503
+ }
3504
+ Z !== Lt.current && (Lt.current = Z, an.current = !0, fe.current && (vt.current && clearTimeout(vt.current), vt.current = setTimeout(() => {
3505
+ var Te;
3506
+ (Te = fe.current) == null || Te.call(fe, { html: Z, markdown: "" });
3507
+ }, 100)));
3508
+ },
3509
+ keydown(x) {
3510
+ var H;
3511
+ (H = Ht.current) == null || H.call(Ht, x);
3512
+ },
3513
+ observe() {
3514
+ ye();
3515
+ }
3516
+ }
3517
+ };
3518
+ try {
3519
+ if (r(D, b), Lt.current = xe(
3520
+ Yt(Fr(le()))
3521
+ ), ze.current(), m)
3522
+ try {
3523
+ r(D, "enableReadOnly");
3524
+ } catch {
3525
+ }
3526
+ } catch {
3527
+ Me.current && r.lang && delete r.lang[Me.current], Me.current = null, te.current = null, Vn(!0);
3528
+ }
3529
+ return () => {
3530
+ vt.current && clearTimeout(vt.current);
3531
+ try {
3532
+ r(D, "destroy");
3533
+ } catch {
3534
+ }
3535
+ Me.current && r.lang && delete r.lang[Me.current], Me.current = null, te.current = null;
3536
+ };
3537
+ }, []), _(() => {
3538
+ const e = te.current, r = Me.current;
3539
+ if (!(!(e != null && e.addLang) || !r)) {
3540
+ e.addLang(r, $r($));
3541
+ try {
3542
+ e(D, "lang.rebuild", r);
3543
+ } catch {
3544
+ }
3545
+ }
3546
+ }, [$, Gn.language, D]);
3547
+ const yr = C(me), wr = C(
3548
+ null
3549
+ );
3550
+ _(() => {
3551
+ var o, i;
3552
+ if (yr.current === me || (yr.current = me, !te.current || me.size === 0)) return;
3553
+ const e = le(), r = mt(e, me);
3554
+ if (r !== e) {
3555
+ const l = (o = W.current) == null ? void 0 : o.querySelector(".redactor-in"), x = l != null && l.contains(document.activeElement) && l ? bs(l) : null;
3556
+ wr.current = {
3557
+ text: Vr(e),
3558
+ until: Date.now() + 1e3
3559
+ }, ce("source.setCode", r);
3560
+ const H = (i = W.current) == null ? void 0 : i.querySelector(".redactor-in");
3561
+ x !== null && H && vs(H, x);
3562
+ }
3563
+ window.requestAnimationFrame(() => ze.current());
3564
+ }, [me, le, ce]), _(() => {
3565
+ if (!te.current || c === void 0) return;
3566
+ if (an.current) {
3567
+ an.current = !1;
3568
+ return;
3569
+ }
3570
+ const e = mt(
3571
+ xe(Yt(c)),
3572
+ rt.current
3573
+ );
3574
+ Yt(le()) !== e && ce("source.setCode", e);
3575
+ }, [c, le, ce]), _(() => {
3576
+ Mt.current = m;
3577
+ const e = te.current;
3578
+ if (e)
3579
+ try {
3580
+ e(D, m ? "enableReadOnly" : "disableReadOnly");
3581
+ } catch {
3582
+ }
3583
+ }, [m, D]), _(() => {
3584
+ if (!ue || c === void 0) return;
3585
+ const e = ee.current;
3586
+ if (!e) return;
3587
+ const r = xe(c);
3588
+ e.value !== r && document.activeElement !== e && (e.value = r);
3589
+ }, [ue, c]);
3590
+ const Oe = tt(
3591
+ () => ({
3592
+ getHTML() {
3593
+ return le();
3594
+ },
3595
+ getText() {
3596
+ return le().replace(/<[^>]*>/g, " ").replace(/&nbsp;/gi, " ").replace(/\s+/g, " ").trim();
3597
+ },
3598
+ getMarkdown() {
3599
+ return "";
3600
+ },
3601
+ isAiBusy() {
3602
+ return Se.current !== null;
3603
+ },
3604
+ setContent(e) {
3605
+ const r = xe(e);
3606
+ ce(
3607
+ "source.setCode",
3608
+ mt(r, rt.current)
3609
+ ) || ee.current && (ee.current.value = r);
3610
+ },
3611
+ insertAtCursor: de,
3612
+ applyFormat(e) {
3613
+ const r = ks[e];
3614
+ r && Ke(...r);
3615
+ },
3616
+ focus() {
3617
+ var r;
3618
+ const e = te.current;
3619
+ if (e)
3620
+ try {
3621
+ e(D, "editor.focus");
3622
+ return;
3623
+ } catch {
3624
+ }
3625
+ (r = ee.current) == null || r.focus();
3626
+ },
3627
+ clear() {
3628
+ ce("source.setCode", "") || ee.current && (ee.current.value = "");
3629
+ }
3630
+ }),
3631
+ [D, le, ce, de, Ke]
3632
+ );
3633
+ Qo(io, () => Oe, [Oe]), ei(Sa, Oe, n);
3634
+ const $o = v(
3635
+ (e) => {
3636
+ var r;
3637
+ ze.current(), (r = fe.current) == null || r.call(fe, {
3638
+ html: xe(e.target.value),
3639
+ markdown: ""
3640
+ });
3641
+ },
3642
+ []
3643
+ ), Xt = p ?? $("editor.regionLabel"), Nn = f == null ? void 0 : f.placeholder, Ct = typeof Nn == "string" || Nn === !1 ? Nn : u ?? $("editor.placeholder");
3644
+ _(() => {
3645
+ var i;
3646
+ if (ue) return;
3647
+ const e = (i = W.current) == null ? void 0 : i.querySelector(".redactor-in");
3648
+ if (!e) return;
3649
+ const r = () => {
3650
+ e.getAttribute("role") !== "textbox" && e.setAttribute("role", "textbox"), e.getAttribute("aria-multiline") !== "true" && e.setAttribute("aria-multiline", "true"), e.getAttribute("aria-label") !== Xt && e.setAttribute("aria-label", Xt), Ct === !1 ? e.hasAttribute("placeholder") && e.removeAttribute("placeholder") : e.getAttribute("placeholder") !== Ct && e.setAttribute("placeholder", Ct), e.hasAttribute("aria-labelledby") && e.removeAttribute("aria-labelledby");
3651
+ };
3652
+ r();
3653
+ const o = new MutationObserver(r);
3654
+ return o.observe(e, {
3655
+ attributes: !0,
3656
+ attributeFilter: ["role", "aria-labelledby", "placeholder"]
3657
+ }), () => o.disconnect();
3658
+ }, [ue, Xt, Ct]);
3659
+ const Ut = Ue !== null, Do = v(
3660
+ (e) => {
3661
+ _n.test(e) && (ue ? de(`[[${e}]]`, { asHtml: !1 }) : (he(), Ve(Wr(e))), J == null || J(e));
3662
+ },
3663
+ [
3664
+ ue,
3665
+ de,
3666
+ he,
3667
+ Ve,
3668
+ J
3669
+ ]
3670
+ ), Mn = C(null), [Oo, qo] = N(!1), [Bo, Po] = N(!1), Fo = v(
3671
+ (e, r) => {
3672
+ if (Po(e), !e) return;
3673
+ const o = Ye(r);
3674
+ Mn.current = o, qo(!o.text.trim());
3675
+ },
3676
+ [Ye]
3677
+ ), jo = v(
3678
+ (e) => {
3679
+ const r = Mn.current ?? Ye("document");
3680
+ Mn.current = null, pr(e, r);
3681
+ },
3682
+ [Ye, pr]
3683
+ ), kr = (e, r) => {
3684
+ if (!r) return null;
3685
+ const o = Ue === e;
3686
+ return {
3687
+ key: e,
3688
+ // While running, the segment becomes a Stop/Cancel button (progress
3689
+ // shows on the scrim spinner).
3690
+ icon: o ? /* @__PURE__ */ t(Tt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : e === "proofread" ? /* @__PURE__ */ t(Hr, { "aria-hidden": "true", className: "ds:size-5" }) : /* @__PURE__ */ t(Ir, { "aria-hidden": "true", className: "ds:size-5" }),
3691
+ label: o ? $("common.cancel") : e === "proofread" ? $("editor.ai.proofread", "Check spelling & grammar") : $("editor.ai.autoFormat", "Auto-format document"),
3692
+ onClick: o ? br : () => xt(e, r, Ye("document")),
3693
+ running: o
3694
+ };
3695
+ }, [xr, Go] = N(() => /* @__PURE__ */ new Set()), Ae = tt(() => {
3696
+ if (!$e || xr.has($e.mode)) return;
3697
+ if (!$e.onDismiss) return $e;
3698
+ const e = $e.onDismiss, r = $e.mode;
3699
+ return {
3700
+ ...$e,
3701
+ onDismiss: () => {
3702
+ Go((o) => new Set(o).add(r)), e();
3703
+ }
3704
+ };
3705
+ }, [$e, xr]), Je = [];
3706
+ if (F && Je.push({
3707
+ key: "dictate",
3708
+ icon: we ? /* @__PURE__ */ t(Tt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(Ln, { "aria-hidden": "true", className: "ds:size-5" }),
3709
+ label: $(we ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
3710
+ onClick: () => lr("document"),
3711
+ recording: we
3712
+ }), Y) {
3713
+ const e = Ue === "template";
3714
+ Je.push({
3715
+ key: "templates",
3716
+ icon: e ? /* @__PURE__ */ t(Tt, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ t(In, { "aria-hidden": "true", className: "ds:size-5" }),
3717
+ label: $(e ? "common.cancel" : "editor.ai.templates"),
3718
+ onClick: e ? br : void 0,
3719
+ running: e,
3720
+ menu: !e
3721
+ });
3722
+ }
3723
+ const Cr = kr("proofread", Q);
3724
+ Cr && Je.push(Cr);
3725
+ const Ar = kr("format", pe);
3726
+ Ar && Je.push(Ar), (V || Be) && Je.push({
3727
+ key: "write",
3728
+ icon: /* @__PURE__ */ t(Lr, { "aria-hidden": "true", className: "ds:size-5" }),
3729
+ label: $("editor.ai.helpMeWrite"),
3730
+ onClick: () => cr("document")
3731
+ });
3732
+ const Tr = (e, r) => Y ? /* @__PURE__ */ t(
3733
+ ls,
3734
+ {
3735
+ side: r === "document" ? "top" : "bottom",
3736
+ templates: Y.templates,
3737
+ onPick: jo,
3738
+ onManage: Y.onManage,
3739
+ noteEmpty: Oo,
3740
+ onOpenChange: (o) => Fo(o, r),
3741
+ trigger: e
3742
+ }
3743
+ ) : null, Er = (w ?? []).filter(
3744
+ (e) => !e.contexts || S !== void 0 && e.contexts.includes(S)
3745
+ );
3746
+ _(() => {
3747
+ (pt || jt !== null || m) && Re(!1);
3748
+ }, [pt, jt, m, Re]), _(() => {
3749
+ be && !(w ?? []).some(
3750
+ (e) => e.id === be.extension.id && (!e.contexts || S !== void 0 && e.contexts.includes(S))
3751
+ ) && Re();
3752
+ }, [w, S, be, Re]);
3753
+ const Ko = (e) => {
3754
+ var Te, dt;
3755
+ if (ln) return;
3756
+ un(), De(!1), Cn();
3757
+ const r = new AbortController();
3758
+ bt.current = r;
3759
+ const o = (Te = ve.current) == null ? void 0 : Te.cloneRange(), i = ee.current ? [
3760
+ ee.current.selectionStart,
3761
+ ee.current.selectionEnd
3762
+ ] : null, l = (o == null ? void 0 : o.toString()) ?? (i ? (((dt = ee.current) == null ? void 0 : dt.value) ?? "").slice(...i) : "");
3763
+ let b = !1;
3764
+ const x = (ie) => {
3765
+ var Le;
3766
+ b || (b = !0, (Le = Rt.current) == null || Le.call(Rt, e.id, ie));
3767
+ };
3768
+ Fe.current = x;
3769
+ const H = () => {
3770
+ r.signal.aborted || (x({ status: "error" }), r.abort(), cn(!1), Xn(!0), dn());
3771
+ }, Z = async (ie) => {
3772
+ var ut;
3773
+ if (r.signal.aborted) return;
3774
+ let Le = ie.mode === "image" ? "" : ie.html;
3775
+ if (ie.mode !== "text") {
3776
+ const et = await ie.pngDataUri();
3777
+ if (r.signal.aborted) return;
3778
+ const At = await (await fetch(et.dataUri, { signal: r.signal })).blob(), Rn = await tr(
3779
+ new File([At], "extension-result.png", { type: "image/png" }),
3780
+ r.signal
3781
+ );
3782
+ if (r.signal.aborted) return;
3783
+ const He = document.createElement("img");
3784
+ He.src = Rn, He.alt = ie.text, He.width = et.width, He.height = et.height, He.loading = "lazy", Le += He.outerHTML;
3785
+ }
3786
+ r.signal.aborted || (o && (ve.current = o.cloneRange()), i && ((ut = ee.current) == null || ut.setSelectionRange(...i)), he(), de(Le, { asHtml: !0 }), x({ status: "success" }), Re());
3787
+ }, ge = {
3788
+ html: Oe.getHTML(),
3789
+ text: Oe.getText(),
3790
+ selectionText: l,
3791
+ scope: l ? "selection" : "document",
3792
+ signal: r.signal,
3793
+ close: () => {
3794
+ bt.current === r && Re();
3795
+ },
3796
+ insert: async (ie) => {
3797
+ try {
3798
+ await Z(ie);
3799
+ } catch {
3800
+ H();
3801
+ }
3802
+ }
3803
+ };
3804
+ Wn({ extension: e, context: ge }), e.kind === "action" && (cn(!0), (async () => {
3805
+ try {
3806
+ if (!e.run) throw new Error("Missing extension run");
3807
+ const ie = await e.run(ge);
3808
+ if (r.signal.aborted) return;
3809
+ ie ? await Z(ie) : (x({ status: "success" }), Re());
3810
+ } catch {
3811
+ H();
3812
+ }
3813
+ })());
3814
+ }, Nr = oo.map(
3815
+ (e) => Er.filter(
3816
+ (r) => {
3817
+ var o;
3818
+ return (((o = r.source) == null ? void 0 : o.kind) ?? "kit") === e;
3819
+ }
3820
+ )
3821
+ ), Vo = Nr.every(
3822
+ (e) => e.length > 0
3823
+ ), Wo = Er.length > 0 ? /* @__PURE__ */ t(
3824
+ _s,
3825
+ {
3826
+ groupedExtensions: Nr,
3827
+ showExtensionGroups: Vo,
3828
+ extensionPending: ln,
3829
+ extensionSession: be,
3830
+ extensionError: sn,
3831
+ openExtension: Ko,
3832
+ closeExtension: Re,
3833
+ saveSelection: st,
3834
+ closeSignal: ao,
3835
+ restoreFocusOnCloseRef: Un
3836
+ }
3837
+ ) : void 0, Mr = !!(V || Be), Rr = !!(Y || Q || pe || Mr || F), Xo = !ue && !m && (oe ?? Rr), Uo = v(
3838
+ () => {
3839
+ var e;
3840
+ return ((e = W.current) == null ? void 0 : e.querySelector(".redactor-in")) ?? null;
3841
+ },
3842
+ []
3843
+ );
3844
+ return /* @__PURE__ */ A(
3845
+ "div",
3846
+ {
3847
+ ref: W,
3848
+ className: [As(), L].filter(Boolean).join(" "),
3849
+ "data-component": "rich-text-editor",
3850
+ "data-component-id": n,
3851
+ "data-min-height": y,
3852
+ children: [
3853
+ !ue && !m ? /* @__PURE__ */ t(
3854
+ ms,
3855
+ {
3856
+ run: Ke,
3857
+ active: bn,
3858
+ preset: h,
3859
+ insertHtml: Ve,
3860
+ insertTable: Mo,
3861
+ saveSelection: st,
3862
+ restoreSelection: he,
3863
+ getSelectedText: xo,
3864
+ uploadImage: z || M ? tr : void 0,
3865
+ enableColor: (d == null ? void 0 : d.includes("fontcolor")) ?? !1,
3866
+ enableImage: !!(z || M),
3867
+ enableTable: (d == null ? void 0 : d.includes("table")) ?? !1,
3868
+ showExtensions: k,
3869
+ extensionControl: Wo,
3870
+ variables: Qn,
3871
+ recentVariableTokens: K,
3872
+ insertVariable: Do
3873
+ }
3874
+ ) : null,
3875
+ /* @__PURE__ */ A("div", { className: "ds:relative", ref: ht, children: [
3876
+ /* @__PURE__ */ t(
3877
+ "textarea",
3878
+ {
3879
+ ref: ee,
3880
+ id: Pe,
3881
+ "aria-label": Xt,
3882
+ "aria-multiline": "true",
3883
+ "aria-busy": Ut || void 0,
3884
+ placeholder: Ct || void 0,
3885
+ onChange: ue ? $o : void 0,
3886
+ readOnly: ue ? m : void 0,
3887
+ className: ue ? Es() : void 0
3888
+ }
3889
+ ),
3890
+ Ut ? /* @__PURE__ */ t(
3891
+ "div",
3892
+ {
3893
+ "aria-hidden": "true",
3894
+ className: "ds:absolute ds:inset-0 ds:z-[5] ds:flex ds:items-center ds:justify-center ds:cursor-wait ds:rounded-[var(--radius-md)] ds:bg-[color-mix(in_srgb,var(--background)_40%,transparent)]",
3895
+ children: /* @__PURE__ */ t(Pn, { size: "lg", variant: "prism" })
3896
+ }
3897
+ ) : null,
3898
+ /* @__PURE__ */ A("div", { className: "ds:sticky ds:bottom-0 ds:z-10", children: [
3899
+ Je.length > 0 ? /* @__PURE__ */ A(
3900
+ "div",
3901
+ {
3902
+ ref: vr,
3903
+ className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10",
3904
+ "data-ai-sparkle": We.props["data-ai-sparkle"],
3905
+ children: [
3906
+ /* @__PURE__ */ A("div", { className: "ds:relative ds:flex ds:items-center ds:overflow-hidden ds:rounded-full ds:bg-[var(--primary)] ds:bg-[image:var(--gradient-brand)] ds:shadow-[0_8px_24px_color-mix(in_srgb,var(--primary)_35%,transparent)]", children: [
3907
+ Je.map((e, r) => {
3908
+ const o = /* @__PURE__ */ t(
3909
+ "button",
3910
+ {
3911
+ type: "button",
3912
+ onClick: e.onClick,
3913
+ "aria-pressed": e.recording || void 0,
3914
+ "aria-busy": e.running || void 0,
3915
+ "aria-haspopup": e.menu ? "menu" : void 0,
3916
+ "data-component-part": `ai-${e.key}`,
3917
+ disabled: Ut && !e.running || void 0,
3918
+ "aria-label": e.label,
3919
+ className: e.recording ? Ms : Ns,
3920
+ children: e.icon
3921
+ }
3922
+ );
3923
+ return /* @__PURE__ */ A(gt, { children: [
3924
+ r > 0 ? /* @__PURE__ */ t(
3925
+ "span",
3926
+ {
3927
+ "aria-hidden": "true",
3928
+ className: "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[color-mix(in_srgb,var(--primary-foreground)_35%,transparent)]"
3929
+ }
3930
+ ) : null,
3931
+ ft(
3932
+ e.menu ? Tr(o, "document") : o,
3933
+ Ae
3934
+ )
3935
+ ] }, e.key);
3936
+ }),
3937
+ We.state ? /* @__PURE__ */ t(
3938
+ "span",
3939
+ {
3940
+ "aria-hidden": "true",
3941
+ className: `ds:pointer-events-none ds:absolute ds:inset-0 ds:-translate-x-full ds:bg-[linear-gradient(90deg,transparent,color-mix(in_srgb,var(--primary-foreground)_45%,transparent),transparent)] ${We.props.className}`
3942
+ }
3943
+ ) : null
3944
+ ] }),
3945
+ /* @__PURE__ */ t(ni, { state: We.state })
3946
+ ]
3947
+ }
3948
+ ) : null,
3949
+ /* @__PURE__ */ t(
3950
+ Sn,
3951
+ {
3952
+ open: !!(be && (!ln || sn)),
3953
+ onClose: Re,
3954
+ title: be ? Qr($, be.extension.label) : void 0,
3955
+ children: sn ? /* @__PURE__ */ t(Zr, {}) : /* @__PURE__ */ t("div", { className: "ds:overflow-y-auto ds:[max-block-size:min(60dvh,calc(var(--rich-text-editor-min-block-size)*3))]", children: (_r = be == null ? void 0 : (zr = be.extension).render) == null ? void 0 : _r.call(
3956
+ zr,
3957
+ be.context
3958
+ ) })
3959
+ }
3960
+ ),
3961
+ Be ? Be({
3962
+ open: pt && !ke,
3963
+ onClose: () => {
3964
+ De(!1), mn(!1);
3965
+ },
3966
+ selectionText: lo,
3967
+ scope: uo,
3968
+ creditsExhausted: fo,
3969
+ getHTML: Oe.getHTML,
3970
+ getText: Oe.getText,
3971
+ // All three write seams put AI output into the note, so
3972
+ // each one is an action landing and sparkles the pill.
3973
+ insertAtSelection: (e) => {
3974
+ zt.current && (ve.current = zt.current.cloneRange()), he(), de(e, { asHtml: !0 }), G && _e();
3975
+ },
3976
+ insertAfterSelection: (e) => {
3977
+ const r = zt.current ?? ve.current;
3978
+ if (r) {
3979
+ const o = r.cloneRange();
3980
+ o.collapse(!1), ve.current = o;
3981
+ }
3982
+ he(), de(e, { asHtml: !0 }), G && _e();
3983
+ },
3984
+ setContent: (e) => {
3985
+ Oe.setContent(e), G && _e();
3986
+ },
3987
+ onDictate: F,
3988
+ privacyNotice: dr
3989
+ }) : V ? /* @__PURE__ */ t(
3990
+ $a,
3991
+ {
3992
+ open: pt && !ke,
3993
+ onClose: () => De(!1),
3994
+ onRequestAiDraft: V,
3995
+ onInsert: (e) => {
3996
+ he(), de(e, { asHtml: O !== "text" }), G && _e();
3997
+ },
3998
+ previewAsHtml: O !== "text",
3999
+ privacyNotice: dr,
4000
+ onDictate: F
4001
+ }
4002
+ ) : null,
4003
+ E ? /* @__PURE__ */ t(
4004
+ Sn,
4005
+ {
4006
+ open: jt !== null,
4007
+ onClose: Cn,
4008
+ ariaLabel: $(
4009
+ "editor.ai.consentRegionLabel",
4010
+ "AI assistance consent for this document"
4011
+ ),
4012
+ footer: /* @__PURE__ */ t(Ee, { intent: "ghost", size: "sm", onClick: Cn, children: $("common.close") }),
4013
+ children: /* @__PURE__ */ t(
4014
+ ri,
4015
+ {
4016
+ granted: E.granted,
4017
+ grantedAt: E.grantedAt,
4018
+ grantedBy: E.grantedBy,
4019
+ canGrant: (E.canGrant ?? !0) && E.onGrant !== void 0,
4020
+ pending: So,
4021
+ onGrantConsent: Lo,
4022
+ headingLevel: U,
4023
+ "aria-label": $(
4024
+ "editor.ai.consentRegionLabel",
4025
+ "AI assistance consent for this document"
4026
+ )
4027
+ }
4028
+ )
4029
+ }
4030
+ ) : null
4031
+ ] }),
4032
+ !ue && !m && ((d == null ? void 0 : d.includes("table")) ?? !1) ? /* @__PURE__ */ t(
4033
+ Qa,
4034
+ {
4035
+ active: bn,
4036
+ run: Ke,
4037
+ areaRef: ht,
4038
+ getActiveTableEl: Co,
4039
+ enableColor: (d == null ? void 0 : d.includes("fontcolor")) ?? !1,
4040
+ saveTableCell: Ao,
4041
+ applyTableBackground: To
4042
+ }
4043
+ ) : null,
4044
+ !ue && !m ? /* @__PURE__ */ t(
4045
+ ss,
4046
+ {
4047
+ areaRef: ht,
4048
+ activeImageEl: ho,
4049
+ applyImageClass: Eo,
4050
+ setImageWidth: No
4051
+ }
4052
+ ) : null,
4053
+ Xo ? /* @__PURE__ */ t(
4054
+ us,
4055
+ {
4056
+ active: bn,
4057
+ run: Ke,
4058
+ areaRef: ht,
4059
+ getEditorRoot: Uo,
4060
+ suppressed: Ut || pt || jt !== null || be !== null,
4061
+ holdOpen: Bo,
4062
+ children: Rr ? /* @__PURE__ */ A(Ie, { children: [
4063
+ F ? ft(
4064
+ /* @__PURE__ */ t(
4065
+ j,
4066
+ {
4067
+ size: "sm",
4068
+ intent: "ghost",
4069
+ "data-component-part": "selection-ai-dictate",
4070
+ onMouseDown: kt,
4071
+ icon: we ? /* @__PURE__ */ t(Tt, {}) : /* @__PURE__ */ t(Ln, {}),
4072
+ "aria-pressed": we,
4073
+ ...Jt(
4074
+ $(we ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
4075
+ !!Ae
4076
+ ),
4077
+ onClick: () => lr("selection")
4078
+ }
4079
+ ),
4080
+ Ae
4081
+ ) : null,
4082
+ Y ? ft(
4083
+ Tr(
4084
+ /* @__PURE__ */ t(
4085
+ Ee,
4086
+ {
4087
+ size: "sm",
4088
+ intent: "ghost",
4089
+ "data-component-part": "selection-ai-templates",
4090
+ onMouseDown: kt,
4091
+ startIcon: /* @__PURE__ */ t(In, {}),
4092
+ endIcon: /* @__PURE__ */ t(Ur, {}),
4093
+ children: $("editor.ai.templates")
4094
+ }
4095
+ ),
4096
+ "selection"
4097
+ ),
4098
+ Ae
4099
+ ) : null,
4100
+ Q ? ft(
4101
+ /* @__PURE__ */ t(
4102
+ j,
4103
+ {
4104
+ size: "sm",
4105
+ intent: "ghost",
4106
+ "data-component-part": "selection-ai-proofread",
4107
+ onMouseDown: kt,
4108
+ icon: /* @__PURE__ */ t(Hr, {}),
4109
+ ...Jt(
4110
+ $("editor.ai.proofread"),
4111
+ !!Ae
4112
+ ),
4113
+ onClick: () => xt(
4114
+ "proofread",
4115
+ Q,
4116
+ Ye("selection")
4117
+ )
4118
+ }
4119
+ ),
4120
+ Ae
4121
+ ) : null,
4122
+ pe ? ft(
4123
+ /* @__PURE__ */ t(
4124
+ j,
4125
+ {
4126
+ size: "sm",
4127
+ intent: "ghost",
4128
+ "data-component-part": "selection-ai-format",
4129
+ onMouseDown: kt,
4130
+ icon: /* @__PURE__ */ t(Ir, {}),
4131
+ ...Jt(
4132
+ $("editor.ai.autoFormat"),
4133
+ !!Ae
4134
+ ),
4135
+ onClick: () => xt(
4136
+ "format",
4137
+ pe,
4138
+ Ye("selection")
4139
+ )
4140
+ }
4141
+ ),
4142
+ Ae
4143
+ ) : null,
4144
+ Mr ? ft(
4145
+ /* @__PURE__ */ t(
4146
+ j,
4147
+ {
4148
+ size: "sm",
4149
+ intent: "ghost",
4150
+ "data-component-part": "selection-ai-write",
4151
+ onMouseDown: kt,
4152
+ icon: /* @__PURE__ */ t(Lr, {}),
4153
+ ...Jt(
4154
+ $("editor.ai.helpMeWrite"),
4155
+ !!Ae
4156
+ ),
4157
+ onClick: () => cr("selection")
4158
+ }
4159
+ ),
4160
+ Ae
4161
+ ) : null
4162
+ ] }) : null
4163
+ }
4164
+ ) : null,
4165
+ at ? /* @__PURE__ */ t(
4166
+ "div",
4167
+ {
4168
+ className: Ts,
4169
+ style: {
4170
+ "--rte-typeahead-x": `${at.left}px`,
4171
+ "--rte-typeahead-y": `${at.top}px`
4172
+ },
4173
+ children: /* @__PURE__ */ t(
4174
+ Xr,
4175
+ {
4176
+ ref: Jn,
4177
+ id: wn,
4178
+ variables: Qn,
4179
+ recentTokens: K,
4180
+ query: at.query,
4181
+ onQueryChange: ko,
4182
+ onSelect: yo,
4183
+ onClose: wo,
4184
+ searchFocusable: !1,
4185
+ onActiveDescendantChange: vo
4186
+ }
4187
+ )
4188
+ }
4189
+ ) : null
4190
+ ] }),
4191
+ F ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: zo }) : null,
4192
+ it.length > 0 ? /* @__PURE__ */ t(
4193
+ "p",
4194
+ {
4195
+ id: `${Pe}-variables-error`,
4196
+ role: "alert",
4197
+ className: "ds:m-0 ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
4198
+ children: $("editor.variableInvalid", {
4199
+ tokens: it.map((e) => `[[${e}]]`).join(", ")
4200
+ })
4201
+ }
4202
+ ) : null,
4203
+ F && Ro ? /* @__PURE__ */ t(
4204
+ "p",
4205
+ {
4206
+ role: "alert",
4207
+ className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
4208
+ children: $("editor.ai.dictationError")
4209
+ }
4210
+ ) : null,
4211
+ Y || Q || pe ? /* @__PURE__ */ t("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: Io }) : null,
4212
+ Ho || ur ? /* @__PURE__ */ t(
4213
+ "p",
4214
+ {
4215
+ role: "alert",
4216
+ className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
4217
+ children: $(ur ? "editor.ai.actionStale" : "editor.ai.actionError")
4218
+ }
4219
+ ) : null
4220
+ ]
4221
+ }
4222
+ );
4223
+ }
4224
+ );
4225
+ Ss.displayName = "RichTextEditor";
4226
+ export {
4227
+ Ss as R,
4228
+ Sa as r,
4229
+ As as w
4230
+ };
4231
+ //# sourceMappingURL=rich-text-editor-C7N4Cem6.js.map