@alfadocs/ui-kit 0.67.1 → 0.69.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 (347) hide show
  1. package/dist/_chunks/{accordion-9lJSMMsZ.js → accordion-DnIa7OHX.js} +69 -47
  2. package/dist/_chunks/actions-cell-renderer-DrcaxB0w.js +2061 -0
  3. package/dist/_chunks/address-autocomplete-BEX9PXty.js +496 -0
  4. package/dist/_chunks/{agenda-card.agent-B_R47-c9.js → agenda-card.agent-mTCrkKSZ.js} +6 -1
  5. package/dist/_chunks/{agenda-tray-T-BumlGZ.js → agenda-tray-g0kg7HwB.js} +36 -24
  6. package/dist/_chunks/{ai-consent-banner-Dxtx_WAh.js → ai-consent-banner-CXlsNX1c.js} +3 -3
  7. package/dist/_chunks/{ai-prompt-input-BwEACCPm.js → ai-prompt-input-CuhTo9mh.js} +80 -61
  8. package/dist/_chunks/{ai-tools-rail-CInA_1-E.js → ai-tools-rail-BA_sqy1A.js} +87 -70
  9. package/dist/_chunks/{alia-sidebar-Ckv0yCKi.js → alia-sidebar-B47qRQb5.js} +5 -5
  10. package/dist/_chunks/{anamnesis-card-N8pIKWuS.js → anamnesis-card-DRmE24OQ.js} +2 -2
  11. package/dist/_chunks/{appointment-tray-BMl89NPW.js → appointment-tray-CZtvtaH-.js} +32 -20
  12. package/dist/_chunks/{audio-recorder-DjXLP4aF.js → audio-recorder-DYXXnGug.js} +59 -56
  13. package/dist/_chunks/{autocomplete-CcCFlVf-.js → autocomplete-DOeGouCL.js} +157 -132
  14. package/dist/_chunks/bishop-score-PJI3AXzA.js +304 -0
  15. package/dist/_chunks/bmi-calculator-BZtIJ53x.js +434 -0
  16. package/dist/_chunks/{booking-L8-YP8BJ.js → booking-C3VqFReX.js} +420 -397
  17. package/dist/_chunks/{breadcrumb-OTbaY70e.js → breadcrumb-CchdeG7d.js} +42 -28
  18. package/dist/_chunks/{calculator-dialog-CFk4I91b.js → calculator-dialog-BR5iU0kf.js} +2 -2
  19. package/dist/_chunks/{calendar-oYWOCrnf.js → calendar-CZUjL8SZ.js} +258 -201
  20. package/dist/_chunks/{care-plan-card-BwVUyUBb.js → care-plan-card-CvFGXa2z.js} +10 -6
  21. package/dist/_chunks/{care-plan-entry-card-VzdQHcOL.js → care-plan-entry-card-C3E_gClk.js} +17 -13
  22. package/dist/_chunks/{carousel.agent-vt21A_el.js → carousel.agent-4v8Emr9E.js} +219 -198
  23. package/dist/_chunks/{chart-Cg3e9EH9.js → chart-CMr3eW62.js} +150 -109
  24. package/dist/_chunks/{chat-container-ogB4OskO.js → chat-container-DWho5hPR.js} +47 -34
  25. package/dist/_chunks/{chat-input-B5zjNEUN.js → chat-input-BcXTetgM.js} +57 -41
  26. package/dist/_chunks/{checkbox-DRcOdmXv.js → checkbox-BuZ1u__2.js} +41 -27
  27. package/dist/_chunks/{checkbox-group-CpUwlHug.js → checkbox-group-PqNmQ-cE.js} +3 -3
  28. package/dist/_chunks/{clinical-note-card-gtrxv6zn.js → clinical-note-card-DqQYf_D4.js} +2 -2
  29. package/dist/_chunks/{collapsible-X3oaLPU3.js → collapsible-BrnRiCC6.js} +26 -23
  30. package/dist/_chunks/{color-picker-FXpItIaF.js → color-picker-C_fZl6sA.js} +124 -112
  31. package/dist/_chunks/{combobox-BC-DFx8G.js → combobox-Clum7gJ1.js} +165 -128
  32. package/dist/_chunks/{command-palette-BiPAAno-.js → command-palette-CJzmc5pC.js} +87 -64
  33. package/dist/_chunks/{contact-profile-card-7BMB85T6.js → contact-profile-card-Dramqa9C.js} +13 -11
  34. package/dist/_chunks/{copy-field-CCq7j6Zc.js → copy-field-Bjw9u2cV.js} +42 -35
  35. package/dist/_chunks/counter-dRlTNC_y.js +55 -0
  36. package/dist/_chunks/{cycle-calculator-BF0ointe.js → cycle-calculator-DmRGJNaT.js} +3 -3
  37. package/dist/_chunks/{date-picker-oGg5BnXL.js → date-picker-Dl9RKxaV.js} +76 -57
  38. package/dist/_chunks/{date-range-picker-C5BWfH_T.js → date-range-picker-CTUeR6Bj.js} +73 -46
  39. package/dist/_chunks/{date-time-picker-Ze1My59T.js → date-time-picker-BhoogS5Q.js} +64 -40
  40. package/dist/_chunks/{dependent-selector-DpzGtr_J.js → dependent-selector-CG_FOHya.js} +44 -30
  41. package/dist/_chunks/{dialog-DMGnSelc.js → dialog-ZNuboNmy.js} +35 -28
  42. package/dist/_chunks/{document-scanner-D2qehl3-.js → document-scanner-CTubA0-N.js} +12 -4
  43. package/dist/_chunks/{dropdown-menu-DwwPovMZ.js → dropdown-menu-qrxjymfw.js} +94 -93
  44. package/dist/_chunks/{due-date-calculator-DU9AEWNy.js → due-date-calculator-BTmsIQqD.js} +4 -4
  45. package/dist/_chunks/editable-currency-cell-renderer-kgqp_mIw.js +448 -0
  46. package/dist/_chunks/{email-input-lQivsFrw.js → email-input-B_Y55f5G.js} +3 -3
  47. package/dist/_chunks/{fetal-weight-BVSzOhuR.js → fetal-weight-CRz7KE2D.js} +2 -2
  48. package/dist/_chunks/{file-upload-BosbPDb1.js → file-upload-5ScQd4fE.js} +118 -100
  49. package/dist/_chunks/{fiscal-code-input-DPtqluVb.js → fiscal-code-input-Cf-8O4Fj.js} +76 -63
  50. package/dist/_chunks/{freemium-paywall-CkWjv3o6.js → freemium-paywall-DZ2mBS3w.js} +78 -71
  51. package/dist/_chunks/{gestational-age-calculator-DBlFdoiP.js → gestational-age-calculator-BleUdhbI.js} +5 -5
  52. package/dist/_chunks/{hcg-doubling-if4Q8aSX.js → hcg-doubling-CnjDXX6U.js} +3 -3
  53. package/dist/_chunks/{header-settings-CNOqIhoW.js → header-settings-DJqoAl5m.js} +86 -46
  54. package/dist/_chunks/{index.modern-D2LGACWg.js → index.modern-Zta-A4Jm.js} +3 -3
  55. package/dist/_chunks/{list-BOwqwy03.js → list-DgE1xWBM.js} +99 -84
  56. package/dist/_chunks/{locale-picker-C9JmBht3.js → locale-picker-ChYYSX2N.js} +47 -35
  57. package/dist/_chunks/{map-view-Tb5VfK9Y.js → map-view-BkOoGoX2.js} +160 -115
  58. package/dist/_chunks/{marketplace-app-shell-D4-T9Qzz.js → marketplace-app-shell-6T9W4Knl.js} +4 -4
  59. package/dist/_chunks/{message-card.agent-4IeIgrnJ.js → message-card.agent-ZLhx3Bs5.js} +6 -1
  60. package/dist/_chunks/{message-tray-CVyJajVJ.js → message-tray-DwrBLJlf.js} +90 -48
  61. package/dist/_chunks/{multi-select-BcPylvHR.js → multi-select-BdHHDrRN.js} +196 -153
  62. package/dist/_chunks/{navigation-menu-C6lBYVv9.js → navigation-menu-DRUi6sSj.js} +75 -42
  63. package/dist/_chunks/{notification-card.agent-Rqt3ofk9.js → notification-card.agent-DxGBZb8T.js} +5 -1
  64. package/dist/_chunks/{notification-tray-DlgenTEe.js → notification-tray-Btb9oQeZ.js} +112 -97
  65. package/dist/_chunks/{number-input-Dj5L3pXK.js → number-input-DxphVG_A.js} +36 -27
  66. package/dist/_chunks/{operator-hero-f_KaRhw5.js → operator-hero-CP2Nhupm.js} +12 -8
  67. package/dist/_chunks/{otp-input-xQ4Ps5VY.js → otp-input-DzBQ-CpE.js} +52 -33
  68. package/dist/_chunks/{pagination-DQOgnxxw.js → pagination-D58kglCr.js} +181 -162
  69. package/dist/_chunks/{patient-search-DR9XUYRQ.js → patient-search-CBC_ySF6.js} +69 -60
  70. package/dist/_chunks/{patient-shell-BfgufL_q.js → patient-shell-DV3XEtIB.js} +3 -3
  71. package/dist/_chunks/{patient-summary-card-hEmr4eTW.js → patient-summary-card-B836_fDB.js} +95 -103
  72. package/dist/_chunks/patient-table-CDuosVru.js +889 -0
  73. package/dist/_chunks/{payment-form-nXocS_MX.js → payment-form-DvjwYVIT.js} +56 -44
  74. package/dist/_chunks/{payment-request-card-CYE5vhZ0.js → payment-request-card-DioWKBUq.js} +2 -2
  75. package/dist/_chunks/{pdf-viewer-GsfNqeeT.js → pdf-viewer-D6BPfW2D.js} +205 -157
  76. package/dist/_chunks/{periodontal-chart-card-Dh3KgvYG.js → periodontal-chart-card-BuDEMbHE.js} +2 -2
  77. package/dist/_chunks/{phone-input-DVXhNlIl.js → phone-input-DjU-XmO_.js} +64 -47
  78. package/dist/_chunks/{popover-DTbfAuR0.js → popover-B2qCDhJC.js} +37 -32
  79. package/dist/_chunks/{practice-results-DND2SAt7.js → practice-results-KrTHqZua.js} +278 -242
  80. package/dist/_chunks/{pregnancy-dating-QY-sqpvj.js → pregnancy-dating-DORUAOHB.js} +6 -6
  81. package/dist/_chunks/{pregnancy-weight-gain-DOJXXNYP.js → pregnancy-weight-gain-DVz4rr7-.js} +3 -3
  82. package/dist/_chunks/{privacy-lock-C7JyMf0y.js → privacy-lock-BzMLQu-j.js} +32 -28
  83. package/dist/_chunks/{product-hub-panel-CAXDFeGP.js → product-hub-panel-e6pW220e.js} +45 -27
  84. package/dist/_chunks/{progress-kzIRcdaq.js → progress-DA413-zn.js} +2 -2
  85. package/dist/_chunks/{public-footer.agent-CfXuW1x6.js → public-footer.agent-D0cFbjWl.js} +151 -146
  86. package/dist/_chunks/{public-header.agent-BOhJgZEU.js → public-header.agent-DqkqA-ca.js} +107 -102
  87. package/dist/_chunks/{qr-code-DNXhi6se.js → qr-code-CPkEs5mG.js} +52 -46
  88. package/dist/_chunks/{radio-group-CLjK-SlK.js → radio-group-BPt7pKZW.js} +5 -5
  89. package/dist/_chunks/{recaptcha-widget-BCNHsgqt.js → recaptcha-widget-BC-4To9b.js} +9 -2
  90. package/dist/_chunks/registry-DvAUVLHh.js +51 -0
  91. package/dist/_chunks/{resizable-3vzqDlg6.js → resizable-DVGcfOrk.js} +193 -173
  92. package/dist/_chunks/{reviews-panel-DBktKm7i.js → reviews-panel-Dq7LMDcH.js} +87 -68
  93. package/dist/_chunks/rich-text-editor-BsV7zUdg.js +2142 -0
  94. package/dist/_chunks/{search-bar-SY2BcV2N.js → search-bar-C_T3pBJn.js} +105 -78
  95. package/dist/_chunks/{search-input-DbxrnHkW.js → search-input-DQvGxR74.js} +2 -2
  96. package/dist/_chunks/{search-input.agent-CfZvViOd.js → search-input.agent-DRH54coT.js} +19 -4
  97. package/dist/_chunks/{select-CEtRcon5.js → select-DMLG44F5.js} +72 -56
  98. package/dist/_chunks/{session-countdown-LPnhTHjn.js → session-countdown-X1Ki6i0M.js} +3 -3
  99. package/dist/_chunks/{sheet-taJer-Ha.js → sheet-BxsE7eQm.js} +59 -45
  100. package/dist/_chunks/{sidebar-DaB4ulxH.js → sidebar-DY9jGjgt.js} +254 -248
  101. package/dist/_chunks/{sign-document-CdAiHiCh.js → sign-document-B4DeRhTe.js} +75 -49
  102. package/dist/_chunks/{signature-capture-COi0Uiqu.js → signature-capture-Ct_4Md4e.js} +138 -104
  103. package/dist/_chunks/{slider-BHWzXdjt.js → slider-DN1CWkKB.js} +85 -65
  104. package/dist/_chunks/{sparkline-DGhCSw8M.js → sparkline-iOXYgvJe.js} +75 -53
  105. package/dist/_chunks/{stepper-accordion.agent-C4quJ-MD.js → stepper-accordion.agent-cmEguIdx.js} +7 -1
  106. package/dist/_chunks/{stepper-progress-DDjq5nei.js → stepper-progress-Bv0njx4g.js} +30 -24
  107. package/dist/_chunks/{suggestion-chip.agent-6sNWFj7m.js → suggestion-chip.agent-Brn3CiFE.js} +9 -8
  108. package/dist/_chunks/{switch-BJ6HD3Mn.js → switch-OILsBLWo.js} +25 -19
  109. package/dist/_chunks/{tabs-BIQ0ew1T.js → tabs-BxcOziCo.js} +67 -58
  110. package/dist/_chunks/{task-card.agent-CUPKYd7w.js → task-card.agent-Bt14CzUd.js} +4 -1
  111. package/dist/_chunks/{task-tray-CAncV-QQ.js → task-tray-qOEQflu4.js} +74 -57
  112. package/dist/_chunks/{text-area-BIx0tZ05.js → text-area-Bt3p7Pt0.js} +41 -34
  113. package/dist/_chunks/{text-input-BaClJL8Y.js → text-input-B-OWQ1Je.js} +15 -8
  114. package/dist/_chunks/{theme-toggle-DETmSu_h.js → theme-toggle-XB6o_lgs.js} +38 -26
  115. package/dist/_chunks/{time-picker-B5umYwfv.js → time-picker-BPlJWm8w.js} +41 -31
  116. package/dist/_chunks/{timeline-DQa5Tyz4.js → timeline-CqA4nKTI.js} +33 -25
  117. package/dist/_chunks/{toast.agent-vuLRRn2a.js → toast.agent-57UzyR9U.js} +62 -45
  118. package/dist/_chunks/{tooth-scheme-BIx1O2aJ.js → tooth-scheme-yBr53cvv.js} +421 -348
  119. package/dist/_chunks/{transcript-panel-CLHmv83g.js → transcript-panel-3THQX6nJ.js} +47 -33
  120. package/dist/_chunks/unit-converter-YEpD9evj.js +337 -0
  121. package/dist/_chunks/{use-password-requirements-DsgduV1x.js → use-password-requirements-BXvS2MBS.js} +131 -117
  122. package/dist/_chunks/users-MBVtUzwd.js +17 -0
  123. package/dist/_chunks/warning-stack-BsgaEbL8.js +283 -0
  124. package/dist/_chunks/{whatsapp-button-DUjlWGKf.js → whatsapp-button-BIy6NaJK.js} +6 -3
  125. package/dist/_chunks/{workflow-map-JAZryZJr.js → workflow-map-Bdam9pGp.js} +99 -88
  126. package/dist/agent/index.d.ts +4 -4
  127. package/dist/agent/index.js +36 -0
  128. package/dist/agent/registry.d.ts +33 -0
  129. package/dist/agent/types.d.ts +78 -2
  130. package/dist/agent-catalog.json +6905 -509
  131. package/dist/agent-i18n/en.json +1175 -0
  132. package/dist/components/accordion/index.js +1 -1
  133. package/dist/components/address-autocomplete/address-autocomplete.agent.d.ts +4 -0
  134. package/dist/components/address-autocomplete/address-autocomplete.d.ts +18 -0
  135. package/dist/components/address-autocomplete/index.d.ts +2 -1
  136. package/dist/components/address-autocomplete/index.js +3 -2
  137. package/dist/components/agenda-card/index.js +1 -1
  138. package/dist/components/agenda-tray/index.js +1 -1
  139. package/dist/components/ai-consent-banner/index.js +1 -1
  140. package/dist/components/ai-prompt-input/index.js +1 -1
  141. package/dist/components/ai-tools-rail/index.js +1 -1
  142. package/dist/components/anamnesis-card/index.js +1 -1
  143. package/dist/components/appointment-card/index.js +1 -1
  144. package/dist/components/audio-recorder/index.js +1 -1
  145. package/dist/components/autocomplete/index.js +1 -1
  146. package/dist/components/bishop-score/bishop-score.agent.d.ts +4 -0
  147. package/dist/components/bishop-score/bishop-score.d.ts +17 -1
  148. package/dist/components/bishop-score/index.js +1 -1
  149. package/dist/components/bmi-calculator/bmi-calculator.agent.d.ts +4 -0
  150. package/dist/components/bmi-calculator/bmi-calculator.d.ts +26 -0
  151. package/dist/components/bmi-calculator/index.js +1 -1
  152. package/dist/components/booking/index.js +1 -1
  153. package/dist/components/breadcrumb/index.js +1 -1
  154. package/dist/components/calculator-dialog/index.js +1 -1
  155. package/dist/components/calendar/index.js +1 -1
  156. package/dist/components/care-plan-card/index.js +1 -1
  157. package/dist/components/care-plan-entry-card/index.js +1 -1
  158. package/dist/components/carousel/index.js +1 -1
  159. package/dist/components/chart/index.js +1 -1
  160. package/dist/components/chat-container/index.js +1 -1
  161. package/dist/components/chat-input/index.js +1 -1
  162. package/dist/components/checkbox/index.js +1 -1
  163. package/dist/components/checkbox-group/index.js +1 -1
  164. package/dist/components/clinical-note-card/index.js +1 -1
  165. package/dist/components/collapsible/index.js +1 -1
  166. package/dist/components/color-picker/index.js +1 -1
  167. package/dist/components/combobox/index.js +1 -1
  168. package/dist/components/command-palette/index.js +1 -1
  169. package/dist/components/contact-profile-card/index.js +1 -1
  170. package/dist/components/copy-field/index.js +1 -1
  171. package/dist/components/counter/counter.d.ts +22 -0
  172. package/dist/components/counter/index.d.ts +3 -0
  173. package/dist/components/counter/index.js +5 -0
  174. package/dist/components/cycle-calculator/index.js +1 -1
  175. package/dist/components/data-table/data-table.d.ts +1 -1
  176. package/dist/components/data-table/filters/date-range-filter.d.ts +1 -1
  177. package/dist/components/data-table/index.js +31 -30
  178. package/dist/components/data-table/toolbar.d.ts +4 -1
  179. package/dist/components/date-picker/index.js +1 -1
  180. package/dist/components/date-range-picker/index.js +1 -1
  181. package/dist/components/date-time-picker/index.js +1 -1
  182. package/dist/components/dependent-selector/index.js +1 -1
  183. package/dist/components/dialog/index.js +1 -1
  184. package/dist/components/document-scanner/index.js +1 -1
  185. package/dist/components/dropdown-menu/index.js +1 -1
  186. package/dist/components/due-date-calculator/index.js +1 -1
  187. package/dist/components/email-input/index.js +1 -1
  188. package/dist/components/fetal-weight/index.js +1 -1
  189. package/dist/components/file-upload/index.js +1 -1
  190. package/dist/components/fiscal-code-input/index.js +1 -1
  191. package/dist/components/freemium-paywall/freemium-paywall.d.ts +6 -0
  192. package/dist/components/freemium-paywall/index.js +1 -1
  193. package/dist/components/gestational-age-calculator/index.js +1 -1
  194. package/dist/components/hcg-doubling/index.js +1 -1
  195. package/dist/components/header-settings/index.js +1 -1
  196. package/dist/components/index.d.ts +2 -0
  197. package/dist/components/list/index.js +1 -1
  198. package/dist/components/locale-picker/index.js +1 -1
  199. package/dist/components/map-view/index.js +1 -1
  200. package/dist/components/message-card/index.js +1 -1
  201. package/dist/components/message-tray/index.js +1 -1
  202. package/dist/components/multi-select/index.js +1 -1
  203. package/dist/components/navigation-menu/index.js +1 -1
  204. package/dist/components/notification-card/index.js +1 -1
  205. package/dist/components/notification-tray/index.js +1 -1
  206. package/dist/components/number-input/index.js +1 -1
  207. package/dist/components/operator-hero/index.js +1 -1
  208. package/dist/components/otp-input/index.js +1 -1
  209. package/dist/components/pagination/index.js +1 -1
  210. package/dist/components/password-input/index.js +1 -1
  211. package/dist/components/patient-search/index.js +1 -1
  212. package/dist/components/patient-summary-card/index.js +1 -1
  213. package/dist/components/patient-table/cell-renderers/balance-badge-cell.d.ts +13 -0
  214. package/dist/components/patient-table/cell-renderers/care-plan-status-cell.d.ts +43 -0
  215. package/dist/components/patient-table/cell-renderers/contact-cell.d.ts +45 -0
  216. package/dist/components/patient-table/cell-renderers/next-appointment-cell.d.ts +24 -0
  217. package/dist/components/patient-table/cell-renderers/patient-identity-cell.d.ts +26 -0
  218. package/dist/components/patient-table/columns.d.ts +102 -0
  219. package/dist/components/patient-table/index.d.ts +24 -0
  220. package/dist/components/patient-table/index.js +13 -0
  221. package/dist/components/patient-table/patient-table.d.ts +138 -0
  222. package/dist/components/patient-table/types.d.ts +172 -0
  223. package/dist/components/patient-table/use-responsive-columns.d.ts +109 -0
  224. package/dist/components/payment-card/index.js +1 -1
  225. package/dist/components/payment-form/index.js +1 -1
  226. package/dist/components/pdf-viewer/index.js +1 -1
  227. package/dist/components/periodontal-chart-card/index.js +1 -1
  228. package/dist/components/phone-input/index.js +1 -1
  229. package/dist/components/popover/index.js +1 -1
  230. package/dist/components/practice-results/index.js +1 -1
  231. package/dist/components/pregnancy-dating/index.js +1 -1
  232. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  233. package/dist/components/privacy-lock/index.js +1 -1
  234. package/dist/components/product-hub-tray/index.js +1 -1
  235. package/dist/components/progress/index.js +1 -1
  236. package/dist/components/public-footer/index.js +1 -1
  237. package/dist/components/public-header/index.js +1 -1
  238. package/dist/components/qr-code/index.js +1 -1
  239. package/dist/components/radio-group/index.js +1 -1
  240. package/dist/components/recaptcha-widget/index.js +1 -1
  241. package/dist/components/resizable/index.js +1 -1
  242. package/dist/components/reviews-panel/index.js +1 -1
  243. package/dist/components/rich-text-editor/index.js +1 -1
  244. package/dist/components/rich-text-editor/rich-text-editor.d.ts +15 -0
  245. package/dist/components/search-bar/index.js +1 -1
  246. package/dist/components/search-input/index.js +2 -2
  247. package/dist/components/select/index.js +1 -1
  248. package/dist/components/session-countdown/index.js +1 -1
  249. package/dist/components/sheet/index.js +1 -1
  250. package/dist/components/sidebar/index.js +1 -1
  251. package/dist/components/sidebar/sidebar.d.ts +7 -0
  252. package/dist/components/sign-document/index.js +1 -1
  253. package/dist/components/signature-capture/index.js +1 -1
  254. package/dist/components/slider/index.js +1 -1
  255. package/dist/components/sparkline/index.js +1 -1
  256. package/dist/components/stepper-accordion/index.js +1 -1
  257. package/dist/components/stepper-progress/index.js +1 -1
  258. package/dist/components/suggestion-chip/index.js +1 -1
  259. package/dist/components/switch/index.js +1 -1
  260. package/dist/components/tabs/index.js +1 -1
  261. package/dist/components/task-card/index.js +1 -1
  262. package/dist/components/task-tray/index.js +1 -1
  263. package/dist/components/text-area/index.js +1 -1
  264. package/dist/components/text-input/index.js +1 -1
  265. package/dist/components/theme-toggle/index.js +1 -1
  266. package/dist/components/time-picker/index.js +1 -1
  267. package/dist/components/timeline/index.js +1 -1
  268. package/dist/components/toast/index.js +1 -1
  269. package/dist/components/tooth-scheme/index.js +1 -1
  270. package/dist/components/transcript-panel/index.js +1 -1
  271. package/dist/components/unit-converter/index.js +1 -1
  272. package/dist/components/unit-converter/unit-converter.agent.d.ts +4 -0
  273. package/dist/components/unit-converter/unit-converter.d.ts +27 -0
  274. package/dist/components/warning-stack/index.js +1 -1
  275. package/dist/components/warning-stack/warning-stack.d.ts +9 -0
  276. package/dist/components/whatsapp-button/index.d.ts +1 -1
  277. package/dist/components/whatsapp-button/index.js +3 -2
  278. package/dist/components/whatsapp-button/whatsapp-button.d.ts +3 -0
  279. package/dist/components/workflow/index.js +1 -1
  280. package/dist/i18n/locales/ar.d.ts +74 -0
  281. package/dist/i18n/locales/ar.js +76 -2
  282. package/dist/i18n/locales/de.d.ts +74 -0
  283. package/dist/i18n/locales/de.js +76 -2
  284. package/dist/i18n/locales/el.d.ts +74 -0
  285. package/dist/i18n/locales/el.js +76 -2
  286. package/dist/i18n/locales/en.d.ts +92 -0
  287. package/dist/i18n/locales/en.js +94 -2
  288. package/dist/i18n/locales/es.d.ts +74 -0
  289. package/dist/i18n/locales/es.js +76 -2
  290. package/dist/i18n/locales/fr.d.ts +74 -0
  291. package/dist/i18n/locales/fr.js +76 -2
  292. package/dist/i18n/locales/hi.d.ts +74 -0
  293. package/dist/i18n/locales/hi.js +76 -2
  294. package/dist/i18n/locales/it.d.ts +74 -0
  295. package/dist/i18n/locales/it.js +76 -2
  296. package/dist/i18n/locales/ja.d.ts +74 -0
  297. package/dist/i18n/locales/ja.js +76 -2
  298. package/dist/i18n/locales/nl.d.ts +74 -0
  299. package/dist/i18n/locales/nl.js +76 -2
  300. package/dist/i18n/locales/pl.d.ts +74 -0
  301. package/dist/i18n/locales/pl.js +76 -2
  302. package/dist/i18n/locales/pt.d.ts +74 -0
  303. package/dist/i18n/locales/pt.js +76 -2
  304. package/dist/i18n/locales/ro.d.ts +74 -0
  305. package/dist/i18n/locales/ro.js +76 -2
  306. package/dist/i18n/locales/ru.d.ts +74 -0
  307. package/dist/i18n/locales/ru.js +76 -2
  308. package/dist/i18n/locales/sq.d.ts +74 -0
  309. package/dist/i18n/locales/sq.js +76 -2
  310. package/dist/i18n/locales/sv.d.ts +74 -0
  311. package/dist/i18n/locales/sv.js +76 -2
  312. package/dist/i18n/locales/tr.d.ts +74 -0
  313. package/dist/i18n/locales/tr.js +76 -2
  314. package/dist/i18n/locales/zh.d.ts +74 -0
  315. package/dist/i18n/locales/zh.js +76 -2
  316. package/dist/index.js +688 -673
  317. package/dist/locales/ar.json +76 -2
  318. package/dist/locales/de.json +76 -2
  319. package/dist/locales/el.json +76 -2
  320. package/dist/locales/en.json +76 -2
  321. package/dist/locales/es.json +76 -2
  322. package/dist/locales/fr.json +76 -2
  323. package/dist/locales/hi.json +76 -2
  324. package/dist/locales/it.json +76 -2
  325. package/dist/locales/ja.json +76 -2
  326. package/dist/locales/nl.json +76 -2
  327. package/dist/locales/pl.json +76 -2
  328. package/dist/locales/pt.json +76 -2
  329. package/dist/locales/ro.json +76 -2
  330. package/dist/locales/ru.json +76 -2
  331. package/dist/locales/sq.json +76 -2
  332. package/dist/locales/sv.json +76 -2
  333. package/dist/locales/tr.json +76 -2
  334. package/dist/locales/zh.json +76 -2
  335. package/dist/patterns/alia-assistant/index.js +1 -1
  336. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  337. package/dist/patterns/patient-shell/index.js +1 -1
  338. package/dist/tokens.css +3 -2
  339. package/package.json +14 -1
  340. package/dist/_chunks/address-autocomplete-CT-9AOli.js +0 -358
  341. package/dist/_chunks/bishop-score-CjsB9bM-.js +0 -185
  342. package/dist/_chunks/bmi-calculator-n-823_1V.js +0 -258
  343. package/dist/_chunks/editable-currency-cell-renderer-D1ewvJKO.js +0 -2391
  344. package/dist/_chunks/registry-nPAVE19X.js +0 -21
  345. package/dist/_chunks/rich-text-editor-DAeCXiQG.js +0 -1973
  346. package/dist/_chunks/unit-converter-C1V3ACM9.js +0 -196
  347. package/dist/_chunks/warning-stack-Cv4fr5zo.js +0 -220
@@ -0,0 +1,2142 @@
1
+ import { jsx as e, jsxs as y, Fragment as De } from "react/jsx-runtime";
2
+ import { useId as de, useState as T, useRef as $, useCallback as C, useEffect as Q, Fragment as ot, forwardRef as Tt, useMemo as Je, useImperativeHandle as zt } from "react";
3
+ import { c as qe } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as Z } from "react-i18next";
5
+ import { SafeHtml as Mt, sanitiseHtml as _t } from "../safe-html/index.js";
6
+ import { u as Rt } from "./registry-DvAUVLHh.js";
7
+ import { S as at } from "./spinner-hbwuKwMf.js";
8
+ import { I as P } from "./icon-button-LqoiKcUN.js";
9
+ import { T as St } from "./text-area-Bt3p7Pt0.js";
10
+ import { E as Et } from "./editor-overlay-wYm22wZK.js";
11
+ import { X as et } from "./x-CCcI3eJp.js";
12
+ import { R as At } from "./rotate-ccw-BWANpitO.js";
13
+ import { C as Ht } from "./check-DPdL_Sm7.js";
14
+ import { S as Me } from "./square-CZoGU14v.js";
15
+ import { M as it } from "./mic-B4Gog3Gi.js";
16
+ import { S as It } from "./send-CySZIRPJ.js";
17
+ import { B as oe } from "./button-DD_0Xdmr.js";
18
+ import { a as Lt } from "./tooltip-DvmfrNvB.js";
19
+ import { P as B } from "./popover-B2qCDhJC.js";
20
+ import { D as Te } from "./dropdown-menu-qrxjymfw.js";
21
+ import { D as j } from "./dialog-ZNuboNmy.js";
22
+ import { C as je } from "./color-picker-C_fZl6sA.js";
23
+ import { T as _e } from "./text-input-B-OWQ1Je.js";
24
+ import { C as $t } from "./checkbox-BuZ1u__2.js";
25
+ import { F as Ot } from "./file-upload-5ScQd4fE.js";
26
+ import { c as M } from "./createLucideIcon-CrFbzy84.js";
27
+ import { C as Dt } from "./chevron-down-BX_NP2Yh.js";
28
+ import { I as qt } from "./image-C6RM5hfF.js";
29
+ import { C as jt } from "./columns-2-BTOBZbep.js";
30
+ import { T as Pt } from "./trash-2-rPAKaRgB.js";
31
+ import { S as Bt } from "./sparkles-CuYXqQLg.js";
32
+ /**
33
+ * @license lucide-react v1.8.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */
38
+ const Ft = [
39
+ ["rect", { width: "13", height: "7", x: "3", y: "3", rx: "1", key: "11xb64" }],
40
+ ["path", { d: "m22 15-3-3 3-3", key: "26chmm" }],
41
+ ["rect", { width: "13", height: "7", x: "3", y: "14", rx: "1", key: "k6ky7n" }]
42
+ ], Vt = M("between-horizontal-end", Ft);
43
+ /**
44
+ * @license lucide-react v1.8.0 - ISC
45
+ *
46
+ * This source code is licensed under the ISC license.
47
+ * See the LICENSE file in the root directory of this source tree.
48
+ */
49
+ const Kt = [
50
+ ["rect", { width: "13", height: "7", x: "8", y: "3", rx: "1", key: "pkso9a" }],
51
+ ["path", { d: "m2 9 3 3-3 3", key: "1agib5" }],
52
+ ["rect", { width: "13", height: "7", x: "8", y: "14", rx: "1", key: "1q5fc1" }]
53
+ ], Gt = M("between-horizontal-start", Kt);
54
+ /**
55
+ * @license lucide-react v1.8.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */
60
+ const Wt = [
61
+ ["rect", { width: "7", height: "13", x: "3", y: "3", rx: "1", key: "1fdu0f" }],
62
+ ["path", { d: "m9 22 3-3 3 3", key: "17z65a" }],
63
+ ["rect", { width: "7", height: "13", x: "14", y: "3", rx: "1", key: "1squn4" }]
64
+ ], Ut = M("between-vertical-end", Wt);
65
+ /**
66
+ * @license lucide-react v1.8.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */
71
+ const Xt = [
72
+ ["rect", { width: "7", height: "13", x: "3", y: "8", rx: "1", key: "1fjrkv" }],
73
+ ["path", { d: "m15 2-3 3-3-3", key: "1uh6eb" }],
74
+ ["rect", { width: "7", height: "13", x: "14", y: "8", rx: "1", key: "w3fjg8" }]
75
+ ], Qt = M("between-vertical-start", Xt);
76
+ /**
77
+ * @license lucide-react v1.8.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */
82
+ const Zt = [
83
+ [
84
+ "path",
85
+ { 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" }
86
+ ]
87
+ ], Yt = M("bold", Zt);
88
+ /**
89
+ * @license lucide-react v1.8.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */
94
+ const Jt = [
95
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
96
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
97
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
98
+ ["path", { d: "M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1", key: "9jr5yi" }]
99
+ ], er = M("heading-2", Jt);
100
+ /**
101
+ * @license lucide-react v1.8.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */
106
+ const tr = [
107
+ ["path", { d: "M4 12h8", key: "17cfdx" }],
108
+ ["path", { d: "M4 18V6", key: "1rz3zl" }],
109
+ ["path", { d: "M12 18V6", key: "zqpxq5" }],
110
+ ["path", { d: "M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2", key: "68ncm8" }],
111
+ ["path", { d: "M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2", key: "1ejuhz" }]
112
+ ], rr = M("heading-3", tr);
113
+ /**
114
+ * @license lucide-react v1.8.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */
119
+ const nr = [
120
+ ["path", { d: "m9 11-6 6v3h9l3-3", key: "1a3l36" }],
121
+ ["path", { d: "m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4", key: "14a9rk" }]
122
+ ], or = M("highlighter", nr);
123
+ /**
124
+ * @license lucide-react v1.8.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */
129
+ const ar = [
130
+ ["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
131
+ ["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
132
+ ["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
133
+ ], ir = M("italic", ar);
134
+ /**
135
+ * @license lucide-react v1.8.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */
140
+ const sr = [
141
+ ["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" }],
142
+ ["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" }]
143
+ ], lr = M("link", sr);
144
+ /**
145
+ * @license lucide-react v1.8.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */
150
+ const dr = [
151
+ ["path", { d: "M11 5h10", key: "1cz7ny" }],
152
+ ["path", { d: "M11 12h10", key: "1438ji" }],
153
+ ["path", { d: "M11 19h10", key: "11t30w" }],
154
+ ["path", { d: "M4 4h1v5", key: "10yrso" }],
155
+ ["path", { d: "M4 9h2", key: "r1h2o0" }],
156
+ ["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" }]
157
+ ], cr = M("list-ordered", dr);
158
+ /**
159
+ * @license lucide-react v1.8.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */
164
+ const ur = [
165
+ ["path", { d: "M3 5h.01", key: "18ugdj" }],
166
+ ["path", { d: "M3 12h.01", key: "nlz23k" }],
167
+ ["path", { d: "M3 19h.01", key: "noohij" }],
168
+ ["path", { d: "M8 5h13", key: "1pao27" }],
169
+ ["path", { d: "M8 12h13", key: "1za7za" }],
170
+ ["path", { d: "M8 19h13", key: "m83p4d" }]
171
+ ], mr = M("list", ur);
172
+ /**
173
+ * @license lucide-react v1.8.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */
178
+ const hr = [
179
+ ["path", { d: "M11 7 6 2", key: "1jwth8" }],
180
+ ["path", { d: "M18.992 12H2.041", key: "xw1gg" }],
181
+ [
182
+ "path",
183
+ {
184
+ 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",
185
+ key: "1nkol4"
186
+ }
187
+ ],
188
+ [
189
+ "path",
190
+ {
191
+ 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",
192
+ key: "1nk1rd"
193
+ }
194
+ ]
195
+ ], fr = M("paint-bucket", hr);
196
+ /**
197
+ * @license lucide-react v1.8.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */
202
+ const gr = [
203
+ ["rect", { width: "16", height: "6", x: "2", y: "2", rx: "2", key: "jcyz7m" }],
204
+ ["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" }],
205
+ ["rect", { width: "4", height: "6", x: "8", y: "16", rx: "1", key: "d6e7yl" }]
206
+ ], pr = M("paint-roller", gr);
207
+ /**
208
+ * @license lucide-react v1.8.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */
213
+ const br = [
214
+ [
215
+ "path",
216
+ {
217
+ 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",
218
+ key: "e79jfc"
219
+ }
220
+ ],
221
+ ["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
222
+ ["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
223
+ ["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
224
+ ["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
225
+ ], yr = M("palette", br);
226
+ /**
227
+ * @license lucide-react v1.8.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */
232
+ const vr = [
233
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
234
+ ["path", { d: "M14 9h1", key: "l0svgy" }],
235
+ ["path", { d: "M19 9h2", key: "te2zfg" }],
236
+ ["path", { d: "M3 9h2", key: "1h4ldw" }],
237
+ ["path", { d: "M9 9h1", key: "15jzuz" }]
238
+ ], kr = M("panel-top-dashed", vr);
239
+ /**
240
+ * @license lucide-react v1.8.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */
245
+ const wr = [
246
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
247
+ ["path", { d: "M3 9h18", key: "1pudct" }]
248
+ ], xr = M("panel-top", wr);
249
+ /**
250
+ * @license lucide-react v1.8.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */
255
+ const Cr = [
256
+ ["path", { d: "M13 4v16", key: "8vvj80" }],
257
+ ["path", { d: "M17 4v16", key: "7dpous" }],
258
+ ["path", { d: "M19 4H9.5a4.5 4.5 0 0 0 0 9H13", key: "sh4n9v" }]
259
+ ], Nr = M("pilcrow", Cr);
260
+ /**
261
+ * @license lucide-react v1.8.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */
266
+ const Tr = [
267
+ [
268
+ "path",
269
+ {
270
+ 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",
271
+ key: "rib7q0"
272
+ }
273
+ ],
274
+ [
275
+ "path",
276
+ {
277
+ 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",
278
+ key: "1ymkrd"
279
+ }
280
+ ]
281
+ ], zr = M("quote", Tr);
282
+ /**
283
+ * @license lucide-react v1.8.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */
288
+ const Mr = [
289
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
290
+ ["path", { d: "M3 12h18", key: "1i2n21" }]
291
+ ], _r = M("rows-2", Mr);
292
+ /**
293
+ * @license lucide-react v1.8.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */
298
+ const Rr = [
299
+ ["path", { d: "m6 16 6-12 6 12", key: "1b4byz" }],
300
+ ["path", { d: "M8 12h8", key: "1wcyev" }],
301
+ ["path", { d: "m16 20 2 2 4-4", key: "13tcca" }]
302
+ ], Sr = M("spell-check", Rr);
303
+ /**
304
+ * @license lucide-react v1.8.0 - ISC
305
+ *
306
+ * This source code is licensed under the ISC license.
307
+ * See the LICENSE file in the root directory of this source tree.
308
+ */
309
+ const Er = [
310
+ ["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
311
+ ["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
312
+ ["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
313
+ ], Ar = M("strikethrough", Er);
314
+ /**
315
+ * @license lucide-react v1.8.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 Hr = [
321
+ ["path", { d: "M12 3v18", key: "108xh3" }],
322
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
323
+ ["path", { d: "M3 9h18", key: "1pudct" }],
324
+ ["path", { d: "M3 15h18", key: "5xshup" }]
325
+ ], Ir = M("table", Hr);
326
+ /**
327
+ * @license lucide-react v1.8.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */
332
+ const Lr = [
333
+ ["path", { d: "M6 4v6a6 6 0 0 0 12 0V4", key: "9kb039" }],
334
+ ["line", { x1: "4", x2: "20", y1: "20", y2: "20", key: "nun2al" }]
335
+ ], $r = M("underline", Lr);
336
+ /**
337
+ * @license lucide-react v1.8.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */
342
+ const Or = [
343
+ [
344
+ "path",
345
+ {
346
+ 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",
347
+ key: "ul74o6"
348
+ }
349
+ ],
350
+ ["path", { d: "m14 7 3 3", key: "1r5n42" }],
351
+ ["path", { d: "M5 6v4", key: "ilb8ba" }],
352
+ ["path", { d: "M19 14v4", key: "blhpug" }],
353
+ ["path", { d: "M10 2v2", key: "7u0qdc" }],
354
+ ["path", { d: "M7 8H3", key: "zfb6yr" }],
355
+ ["path", { d: "M21 16h-4", key: "1cnmox" }],
356
+ ["path", { d: "M11 3H9", key: "1obp7u" }]
357
+ ], Dr = M("wand-sparkles", Or);
358
+ /**
359
+ * @license lucide-react v1.8.0 - ISC
360
+ *
361
+ * This source code is licensed under the ISC license.
362
+ * See the LICENSE file in the root directory of this source tree.
363
+ */
364
+ const qr = [
365
+ [
366
+ "path",
367
+ {
368
+ d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",
369
+ key: "1ngwbx"
370
+ }
371
+ ]
372
+ ], jr = M("wrench", qr), Pr = {
373
+ id: "rich-text-editor",
374
+ capabilities: ["edit_inline"],
375
+ state: {
376
+ html: {
377
+ type: "string",
378
+ descriptionKey: "ui.agent.richTextEditor.state.html",
379
+ description: "Sanitised HTML representation of the editor content.",
380
+ read: (o) => o.getHTML()
381
+ },
382
+ text: {
383
+ type: "string",
384
+ descriptionKey: "ui.agent.richTextEditor.state.text",
385
+ description: "Plain-text content of the editor (tags stripped).",
386
+ read: (o) => o.getText()
387
+ },
388
+ markdown: {
389
+ type: "string",
390
+ descriptionKey: "ui.agent.richTextEditor.state.markdown",
391
+ description: "Markdown representation of the editor content. The Redactor engine has no native Markdown serialiser, so this is always empty — read `html` instead.",
392
+ read: (o) => o.getMarkdown()
393
+ }
394
+ },
395
+ actions: {
396
+ set_content: {
397
+ // Replaces the whole document — discards whatever the user had typed.
398
+ safety: "destructive",
399
+ argsType: "{ html: string }",
400
+ argsSchema: {
401
+ type: "object",
402
+ properties: {
403
+ html: {
404
+ type: "string",
405
+ description: "Replacement HTML (sanitised via DOMPurify)."
406
+ }
407
+ },
408
+ required: ["html"]
409
+ },
410
+ idempotent: !0,
411
+ descriptionKey: "ui.agent.richTextEditor.actions.setContent",
412
+ description: "Replace the editor content. Loses unsaved input.",
413
+ invoke: (o, a) => {
414
+ o.setContent(a.html);
415
+ }
416
+ },
417
+ insert_at_cursor: {
418
+ // Reversible via the editor's own undo stack — write, not destructive.
419
+ safety: "write",
420
+ argsType: "{ content: string; asHtml?: boolean }",
421
+ argsSchema: {
422
+ type: "object",
423
+ properties: {
424
+ content: {
425
+ type: "string",
426
+ description: "Content to insert at the caret."
427
+ },
428
+ asHtml: {
429
+ type: "boolean",
430
+ description: "Treat content as HTML (sanitised). Pass false for plain text. Defaults to true."
431
+ }
432
+ },
433
+ required: ["content"]
434
+ },
435
+ descriptionKey: "ui.agent.richTextEditor.actions.insertAtCursor",
436
+ 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.",
437
+ examples: [
438
+ {
439
+ args: { content: "{{patient.firstName}}", asHtml: !1 },
440
+ note: "Insert a merge variable as plain text."
441
+ }
442
+ ],
443
+ invoke: (o, a) => {
444
+ o.insertAtCursor(a.content, { asHtml: a.asHtml });
445
+ }
446
+ },
447
+ apply_format: {
448
+ // Reversible via undo — write, not destructive.
449
+ safety: "write",
450
+ argsType: "{ format: 'bold' | 'italic' | 'strikethrough' | 'bulletedList' | 'numberedList' | 'heading' | 'quote' | 'paragraph' }",
451
+ argsSchema: {
452
+ type: "object",
453
+ properties: {
454
+ format: {
455
+ type: "string",
456
+ enum: [
457
+ "bold",
458
+ "italic",
459
+ "strikethrough",
460
+ "bulletedList",
461
+ "numberedList",
462
+ "heading",
463
+ "quote",
464
+ "paragraph"
465
+ ],
466
+ description: "Block or inline format to toggle/apply."
467
+ }
468
+ },
469
+ required: ["format"]
470
+ },
471
+ descriptionKey: "ui.agent.richTextEditor.actions.applyFormat",
472
+ description: "Toggle/apply a block or inline format on the current selection (bold, italic, strikethrough, bulleted/numbered list, heading, quote, paragraph).",
473
+ examples: [{ args: { format: "bold" }, note: "Bold the selection." }],
474
+ invoke: (o, a) => {
475
+ o.applyFormat(a.format);
476
+ }
477
+ },
478
+ clear: {
479
+ // Empties the document — loses unsaved input.
480
+ safety: "destructive",
481
+ idempotent: !0,
482
+ descriptionKey: "ui.agent.richTextEditor.actions.clear",
483
+ description: "Empty the editor. Loses unsaved input.",
484
+ invoke: (o) => {
485
+ o.clear();
486
+ }
487
+ },
488
+ focus: {
489
+ safety: "read",
490
+ idempotent: !0,
491
+ descriptionKey: "ui.agent.richTextEditor.actions.focus",
492
+ description: "Move keyboard focus to the editor surface.",
493
+ invoke: (o) => {
494
+ o.focus();
495
+ }
496
+ }
497
+ },
498
+ domHooks: {
499
+ root: { attr: "data-component", value: "rich-text-editor" },
500
+ instanceId: {
501
+ attr: "data-component-id",
502
+ sourceProp: "id",
503
+ description: "Sourced from the id prop."
504
+ }
505
+ }
506
+ }, Br = "ds:aria-pressed:!bg-[var(--destructive)] ds:aria-pressed:!text-[var(--destructive-foreground)]", le = "ds:!size-[var(--min-target-size)]", Fr = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", Vr = "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]", tt = [
507
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
508
+ "ds:bg-[color-mix(in_srgb,var(--background)_70%,transparent)]",
509
+ "ds:p-[var(--spacing-sm)] ds:[max-block-size:10rem] ds:overflow-y-auto",
510
+ "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)]"
511
+ ].join(" ");
512
+ function rt(o, a) {
513
+ return a ? o ? /\s$/.test(o) ? `${o}${a}` : `${o} ${a}` : a : o;
514
+ }
515
+ function Kr({
516
+ open: o,
517
+ onClose: a,
518
+ onRequestAiDraft: c,
519
+ onInsert: l,
520
+ previewAsHtml: d = !0,
521
+ privacyNotice: g,
522
+ onDictate: p
523
+ }) {
524
+ const { t: s } = Z(), b = de(), v = de(), [z, I] = T(""), [S, w] = T(!1), [O, m] = T(!1), [f, k] = T(null), E = $(null), [_, A] = T(!1), [Y, L] = T(""), [D, H] = T(""), J = $(null), ee = C(() => {
525
+ var x;
526
+ (x = J.current) == null || x.abort();
527
+ }, []), me = C(() => {
528
+ if (!p) return;
529
+ const x = new AbortController();
530
+ J.current = x, A(!0), L(""), H(s("editor.ai.listening")), p({
531
+ signal: x.signal,
532
+ onPartialTranscript: (q) => {
533
+ x.signal.aborted || L(q);
534
+ },
535
+ onFinalTranscript: (q) => {
536
+ if (x.signal.aborted) return;
537
+ const F = q.trim();
538
+ L(""), F && (I((W) => rt(W, F)), H(F));
539
+ }
540
+ }).catch(() => {
541
+ }).finally(() => {
542
+ L(""), J.current === x && (J.current = null, A(!1), H(""));
543
+ });
544
+ }, [p, s]), R = C(() => {
545
+ _ ? ee() : me();
546
+ }, [_, me, ee]);
547
+ Q(() => {
548
+ var x, q;
549
+ o ? (I(""), w(!1), m(!1), k(null), L(""), H("")) : ((x = E.current) == null || x.abort(), E.current = null, (q = J.current) == null || q.abort());
550
+ }, [o]), Q(
551
+ () => () => {
552
+ var x, q;
553
+ (x = E.current) == null || x.abort(), (q = J.current) == null || q.abort();
554
+ },
555
+ []
556
+ );
557
+ const G = C(() => {
558
+ var F;
559
+ const x = z.trim();
560
+ if (!x || S) return;
561
+ ee(), (F = E.current) == null || F.abort();
562
+ const q = new AbortController();
563
+ E.current = q, m(!1), w(!0), c({ prompt: x, signal: q.signal }).then((W) => {
564
+ q.signal.aborted || (k(W), w(!1));
565
+ }).catch((W) => {
566
+ q.signal.aborted || W && typeof W == "object" && "name" in W && W.name === "AbortError" || (m(!0), w(!1));
567
+ });
568
+ }, [z, S, c, ee]), K = C(() => {
569
+ f != null && (l(f), a());
570
+ }, [f, l, a]), he = f != null, fe = _ ? rt(z, Y) : z;
571
+ return /* @__PURE__ */ e(
572
+ Et,
573
+ {
574
+ open: o,
575
+ onClose: a,
576
+ ariaLabel: s("editor.ai.dialogTitle"),
577
+ children: he ? /* @__PURE__ */ y("div", { className: "ds:flex ds:items-end ds:gap-[var(--spacing-sm)]", children: [
578
+ /* @__PURE__ */ e(
579
+ P,
580
+ {
581
+ size: "md",
582
+ intent: "outline",
583
+ className: le,
584
+ icon: /* @__PURE__ */ e(et, {}),
585
+ "aria-label": s("common.close"),
586
+ onClick: a
587
+ }
588
+ ),
589
+ /* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: d ? /* @__PURE__ */ e(
590
+ Mt,
591
+ {
592
+ html: f,
593
+ profile: "rich-text",
594
+ className: tt,
595
+ tabIndex: 0,
596
+ "aria-label": s("editor.ai.dialogTitle")
597
+ }
598
+ ) : (
599
+ // Focusable so a keyboard user can scroll a long draft preview
600
+ // (mirrors the SafeHtml preview branch above). The lint rule's
601
+ // tabIndex allowlist doesn't cover a scrollable, non-interactive
602
+ // text region.
603
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
604
+ /* @__PURE__ */ e("p", { className: tt, tabIndex: 0, children: f })
605
+ ) }),
606
+ /* @__PURE__ */ e(
607
+ P,
608
+ {
609
+ size: "md",
610
+ intent: "outline",
611
+ className: `${le} ds:rounded-full`,
612
+ icon: /* @__PURE__ */ e(At, {}),
613
+ "aria-label": s("editor.ai.retry"),
614
+ onClick: () => k(null)
615
+ }
616
+ ),
617
+ /* @__PURE__ */ e(
618
+ P,
619
+ {
620
+ size: "md",
621
+ intent: "primary",
622
+ className: `${le} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
623
+ icon: /* @__PURE__ */ e(Ht, {}),
624
+ "aria-label": s("common.confirm"),
625
+ onClick: K
626
+ }
627
+ )
628
+ ] }) : /* @__PURE__ */ y(De, { children: [
629
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:items-end ds:gap-[var(--spacing-sm)]", children: [
630
+ /* @__PURE__ */ e(
631
+ P,
632
+ {
633
+ size: "md",
634
+ intent: "outline",
635
+ className: le,
636
+ icon: /* @__PURE__ */ e(et, {}),
637
+ "aria-label": s("common.close"),
638
+ onClick: a
639
+ }
640
+ ),
641
+ /* @__PURE__ */ e("div", { className: "ds:min-w-0 ds:flex-1", children: /* @__PURE__ */ e(
642
+ St,
643
+ {
644
+ id: b,
645
+ size: "md",
646
+ className: "ds:content-center",
647
+ value: fe,
648
+ onChange: (x) => I(x.target.value),
649
+ placeholder: s("editor.ai.promptPlaceholder"),
650
+ "aria-label": s("editor.ai.promptLabel"),
651
+ autoResize: !0,
652
+ minRows: 1,
653
+ maxRows: 3,
654
+ readOnly: _,
655
+ tone: O ? "error" : "default",
656
+ "aria-describedby": O ? v : void 0
657
+ }
658
+ ) }),
659
+ p ? /* @__PURE__ */ e(
660
+ P,
661
+ {
662
+ size: "md",
663
+ intent: "outline",
664
+ className: _ ? `${le} ${Br}` : le,
665
+ icon: _ ? /* @__PURE__ */ e(Me, { className: "ds:fill-current" }) : /* @__PURE__ */ e(it, {}),
666
+ "aria-pressed": _,
667
+ "aria-label": s(_ ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
668
+ onClick: R
669
+ }
670
+ ) : null,
671
+ /* @__PURE__ */ e(
672
+ P,
673
+ {
674
+ size: "md",
675
+ intent: "primary",
676
+ icon: S ? /* @__PURE__ */ e(at, { size: "sm", variant: "pulse" }) : /* @__PURE__ */ e(It, {}),
677
+ className: `${le} ds:bg-[image:var(--gradient-brand)] ds:rounded-full`,
678
+ disabled: S || !z.trim(),
679
+ "aria-busy": S || void 0,
680
+ "aria-label": s("editor.ai.generate"),
681
+ onClick: G
682
+ }
683
+ )
684
+ ] }),
685
+ p ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: D }) : null,
686
+ O ? /* @__PURE__ */ e("p", { id: v, role: "alert", className: Vr, children: s("editor.ai.error") }) : g ? /* @__PURE__ */ e("p", { className: Fr, children: g }) : null
687
+ ] })
688
+ }
689
+ );
690
+ }
691
+ const Gr = {
692
+ bold: {
693
+ id: "bold",
694
+ icon: /* @__PURE__ */ e(Yt, {}),
695
+ label: ["editor.bold", "Bold"],
696
+ command: ["module.inline.format", { tag: "b" }],
697
+ toggle: "bold"
698
+ },
699
+ italic: {
700
+ id: "italic",
701
+ icon: /* @__PURE__ */ e(ir, {}),
702
+ label: ["editor.italic", "Italic"],
703
+ command: ["module.inline.format", { tag: "i" }],
704
+ toggle: "italic"
705
+ },
706
+ underline: {
707
+ id: "underline",
708
+ icon: /* @__PURE__ */ e($r, {}),
709
+ label: ["editor.underline", "Underline"],
710
+ command: ["module.inline.format", { tag: "u" }],
711
+ toggle: "underline"
712
+ },
713
+ strike: {
714
+ id: "strike",
715
+ icon: /* @__PURE__ */ e(Ar, {}),
716
+ label: ["editor.strike", "Strikethrough"],
717
+ command: ["module.inline.format", { tag: "del" }],
718
+ toggle: "strike"
719
+ },
720
+ ul: {
721
+ id: "ul",
722
+ icon: /* @__PURE__ */ e(mr, {}),
723
+ label: ["editor.list.bullet", "Bulleted list"],
724
+ command: ["module.list.toggle", "ul"],
725
+ toggle: "ul"
726
+ },
727
+ ol: {
728
+ id: "ol",
729
+ icon: /* @__PURE__ */ e(cr, {}),
730
+ label: ["editor.list.ordered", "Numbered list"],
731
+ command: ["module.list.toggle", "ol"],
732
+ toggle: "ol"
733
+ }
734
+ }, $e = [
735
+ {
736
+ id: "paragraph",
737
+ tag: "p",
738
+ icon: /* @__PURE__ */ e(Nr, {}),
739
+ label: ["editor.paragraph", "Paragraph"]
740
+ },
741
+ {
742
+ id: "h2",
743
+ tag: "h2",
744
+ icon: /* @__PURE__ */ e(er, {}),
745
+ label: ["editor.heading2", "Heading 2"]
746
+ },
747
+ {
748
+ id: "h3",
749
+ tag: "h3",
750
+ icon: /* @__PURE__ */ e(rr, {}),
751
+ label: ["editor.heading3", "Heading 3"]
752
+ },
753
+ {
754
+ id: "quote",
755
+ tag: "blockquote",
756
+ icon: /* @__PURE__ */ e(zr, {}),
757
+ label: ["editor.quote", "Quote"]
758
+ }
759
+ ], Wr = {
760
+ minimal: ["bold", "italic", "underline", "link"],
761
+ standard: [
762
+ "format",
763
+ "bold",
764
+ "italic",
765
+ "underline",
766
+ "strike",
767
+ "ul",
768
+ "ol",
769
+ "link"
770
+ ],
771
+ full: ["format", "bold", "italic", "underline", "strike", "ul", "ol", "link"]
772
+ }, st = [
773
+ {
774
+ id: "rowAbove",
775
+ command: "plugin.table.addRowAbove",
776
+ icon: /* @__PURE__ */ e(Gt, {}),
777
+ label: ["editor.table.rowAbove", "Add row above"]
778
+ },
779
+ {
780
+ id: "rowBelow",
781
+ command: "plugin.table.addRowBelow",
782
+ icon: /* @__PURE__ */ e(Vt, {}),
783
+ label: ["editor.table.rowBelow", "Add row below"]
784
+ },
785
+ {
786
+ id: "colLeft",
787
+ command: "plugin.table.addColumnLeft",
788
+ icon: /* @__PURE__ */ e(Qt, {}),
789
+ label: ["editor.table.columnLeft", "Add column left"]
790
+ },
791
+ {
792
+ id: "colRight",
793
+ command: "plugin.table.addColumnRight",
794
+ icon: /* @__PURE__ */ e(Ut, {}),
795
+ label: ["editor.table.columnRight", "Add column right"]
796
+ },
797
+ {
798
+ id: "addHead",
799
+ command: "plugin.table.addHead",
800
+ icon: /* @__PURE__ */ e(xr, {}),
801
+ label: ["editor.table.addHeader", "Add header row"]
802
+ },
803
+ {
804
+ id: "deleteHead",
805
+ command: "plugin.table.deleteHead",
806
+ icon: /* @__PURE__ */ e(kr, {}),
807
+ label: ["editor.table.deleteHeader", "Remove header row"]
808
+ },
809
+ {
810
+ id: "deleteRow",
811
+ command: "plugin.table.deleteRow",
812
+ icon: /* @__PURE__ */ e(_r, {}),
813
+ label: ["editor.table.deleteRow", "Delete row"]
814
+ },
815
+ {
816
+ id: "deleteColumn",
817
+ command: "plugin.table.deleteColumn",
818
+ icon: /* @__PURE__ */ e(jt, {}),
819
+ label: ["editor.table.deleteColumn", "Delete column"]
820
+ },
821
+ {
822
+ id: "deleteTable",
823
+ command: "plugin.table.deleteTable",
824
+ icon: /* @__PURE__ */ e(Pt, {}),
825
+ label: ["editor.table.deleteTable", "Delete table"]
826
+ }
827
+ ], ze = 6, Ur = qe(
828
+ [
829
+ "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
830
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
831
+ "ds:bg-[var(--background)] ds:p-[var(--spacing-xs)]",
832
+ "ds:shadow-[var(--shadow-md)]"
833
+ ].join(" ")
834
+ ), lt = "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[var(--border)] ds:[margin-inline:var(--spacing-2xs)]", ve = "ds:text-[length:var(--font-size-sm)] ds:font-medium ds:text-[color:var(--foreground)]";
835
+ function Re(o) {
836
+ return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
837
+ }
838
+ function Xr({
839
+ run: o,
840
+ active: a,
841
+ onTriggerDown: c
842
+ }) {
843
+ const { t: l } = Z(), d = $e.find((g) => a.has(g.id)) ?? $e[0];
844
+ return /* @__PURE__ */ y(Te.Root, { children: [
845
+ /* @__PURE__ */ e(Te.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
846
+ oe,
847
+ {
848
+ size: "sm",
849
+ intent: "ghost",
850
+ startIcon: d.icon,
851
+ endIcon: /* @__PURE__ */ e(Dt, {}),
852
+ "aria-label": l("editor.format", "Paragraph style"),
853
+ onMouseDown: c,
854
+ children: l(d.label[0], d.label[1])
855
+ }
856
+ ) }),
857
+ /* @__PURE__ */ e(Te.Content, { align: "start", children: $e.map((g) => /* @__PURE__ */ e(
858
+ Te.Item,
859
+ {
860
+ startIcon: g.icon,
861
+ onSelect: () => o("module.block.format", { tag: g.tag }),
862
+ children: l(g.label[0], g.label[1])
863
+ },
864
+ g.id
865
+ )) })
866
+ ] });
867
+ }
868
+ function Qr({
869
+ insertHtml: o,
870
+ saveSelection: a,
871
+ restoreSelection: c,
872
+ getSelectedText: l
873
+ }) {
874
+ const { t: d } = Z(), [g, p] = T(!1), [s, b] = T(""), [v, z] = T(""), [I, S] = T(!1), w = de(), O = de(), m = () => {
875
+ b(""), z(""), S(!1);
876
+ }, f = () => {
877
+ const k = s.trim();
878
+ if (!k) return;
879
+ const E = v.trim() || k, _ = I ? ' target="_blank" rel="noopener noreferrer"' : "", A = `<a href="${Re(k)}"${_}>${Re(E)}</a>`;
880
+ p(!1), m(), window.requestAnimationFrame(() => {
881
+ c(), o(A);
882
+ });
883
+ };
884
+ return /* @__PURE__ */ y(j.Root, { open: g, onOpenChange: p, children: [
885
+ /* @__PURE__ */ e(j.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
886
+ P,
887
+ {
888
+ size: "sm",
889
+ intent: "ghost",
890
+ icon: /* @__PURE__ */ e(lr, {}),
891
+ "aria-label": d("editor.link.insert", "Insert link"),
892
+ onMouseDown: () => {
893
+ a(), z(l());
894
+ }
895
+ }
896
+ ) }),
897
+ /* @__PURE__ */ y(j.Content, { children: [
898
+ /* @__PURE__ */ e(j.Header, { children: /* @__PURE__ */ e(j.Title, { children: d("editor.link.insert", "Insert link") }) }),
899
+ /* @__PURE__ */ y(j.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
900
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
901
+ /* @__PURE__ */ e("label", { htmlFor: w, className: ve, children: d("editor.link.url", "URL") }),
902
+ /* @__PURE__ */ e(
903
+ _e,
904
+ {
905
+ id: w,
906
+ type: "url",
907
+ value: s,
908
+ onChange: (k) => b(k.target.value),
909
+ placeholder: "https://…"
910
+ }
911
+ )
912
+ ] }),
913
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
914
+ /* @__PURE__ */ e("label", { htmlFor: O, className: ve, children: d("editor.link.text", "Text to display") }),
915
+ /* @__PURE__ */ e(
916
+ _e,
917
+ {
918
+ id: O,
919
+ value: v,
920
+ onChange: (k) => z(k.target.value),
921
+ placeholder: d("editor.link.textPlaceholder", "Link text")
922
+ }
923
+ )
924
+ ] }),
925
+ /* @__PURE__ */ e(
926
+ $t,
927
+ {
928
+ checked: I,
929
+ onCheckedChange: (k) => S(k === !0),
930
+ label: d("editor.link.newTab", "Open in new tab")
931
+ }
932
+ )
933
+ ] }),
934
+ /* @__PURE__ */ y(j.Footer, { children: [
935
+ /* @__PURE__ */ e(j.Close, { asChild: !0, children: /* @__PURE__ */ e(oe, { intent: "secondary", children: d("common.cancel") }) }),
936
+ /* @__PURE__ */ e(oe, { onClick: f, disabled: !s.trim(), children: d("editor.link.insertAction", "Insert") })
937
+ ] })
938
+ ] })
939
+ ] });
940
+ }
941
+ function Zr({
942
+ insertHtml: o,
943
+ saveSelection: a,
944
+ restoreSelection: c,
945
+ uploadImage: l
946
+ }) {
947
+ const { t: d } = Z(), [g, p] = T(!1), [s, b] = T(""), [v, z] = T(""), I = de(), S = de(), w = (m, f) => {
948
+ const k = `<img src="${Re(m)}" alt="${Re(f)}" loading="lazy">`;
949
+ p(!1), b(""), z(""), window.requestAnimationFrame(() => {
950
+ c(), o(k);
951
+ });
952
+ }, O = () => {
953
+ const m = s.trim();
954
+ m && w(m, v.trim());
955
+ };
956
+ return /* @__PURE__ */ y(j.Root, { open: g, onOpenChange: p, children: [
957
+ /* @__PURE__ */ e(j.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
958
+ P,
959
+ {
960
+ size: "sm",
961
+ intent: "ghost",
962
+ icon: /* @__PURE__ */ e(qt, {}),
963
+ "aria-label": d("editor.image.insert", "Insert image"),
964
+ onMouseDown: () => a()
965
+ }
966
+ ) }),
967
+ /* @__PURE__ */ y(j.Content, { children: [
968
+ /* @__PURE__ */ e(j.Header, { children: /* @__PURE__ */ e(j.Title, { children: d("editor.image.insert", "Insert image") }) }),
969
+ /* @__PURE__ */ y(j.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
970
+ l ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
971
+ /* @__PURE__ */ e("span", { className: ve, children: d("editor.image.upload", "Upload") }),
972
+ /* @__PURE__ */ e(
973
+ Ot,
974
+ {
975
+ variant: "dropzone",
976
+ accept: {
977
+ "image/*": [".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"]
978
+ },
979
+ maxFiles: 1,
980
+ onUpload: async (m, { signal: f }) => {
981
+ const k = await l(m, f);
982
+ w(k, m.name);
983
+ }
984
+ }
985
+ ),
986
+ /* @__PURE__ */ e("span", { className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: d("editor.image.orUrl", "Or paste an image URL") })
987
+ ] }) : null,
988
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
989
+ /* @__PURE__ */ e("label", { htmlFor: I, className: ve, children: d("editor.image.url", "Image URL") }),
990
+ /* @__PURE__ */ e(
991
+ _e,
992
+ {
993
+ id: I,
994
+ type: "url",
995
+ value: s,
996
+ onChange: (m) => b(m.target.value),
997
+ placeholder: "https://…"
998
+ }
999
+ )
1000
+ ] }),
1001
+ /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
1002
+ /* @__PURE__ */ e("label", { htmlFor: S, className: ve, children: d("editor.image.alt", "Alt text") }),
1003
+ /* @__PURE__ */ e(
1004
+ _e,
1005
+ {
1006
+ id: S,
1007
+ value: v,
1008
+ onChange: (m) => z(m.target.value),
1009
+ placeholder: d(
1010
+ "editor.image.altPlaceholder",
1011
+ "Describe the image"
1012
+ )
1013
+ }
1014
+ )
1015
+ ] })
1016
+ ] }),
1017
+ /* @__PURE__ */ y(j.Footer, { children: [
1018
+ /* @__PURE__ */ e(j.Close, { asChild: !0, children: /* @__PURE__ */ e(oe, { intent: "secondary", children: d("common.cancel") }) }),
1019
+ /* @__PURE__ */ e(oe, { onClick: O, disabled: !s.trim(), children: d("editor.image.insertAction", "Insert") })
1020
+ ] })
1021
+ ] })
1022
+ ] });
1023
+ }
1024
+ function Yr({
1025
+ run: o,
1026
+ saveSelection: a,
1027
+ restoreSelection: c
1028
+ }) {
1029
+ const { t: l } = Z(), [d, g] = T("#1f2a5c"), p = (b) => {
1030
+ g(b), c(), o("module.inline.format", {
1031
+ tag: "span",
1032
+ style: { color: b },
1033
+ type: "toggle"
1034
+ });
1035
+ }, s = () => {
1036
+ c(), o("module.inline.remove", { style: "color" });
1037
+ };
1038
+ return /* @__PURE__ */ y(B, { onOpenChange: (b) => b && a(), children: [
1039
+ /* @__PURE__ */ e(B.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
1040
+ P,
1041
+ {
1042
+ size: "sm",
1043
+ intent: "ghost",
1044
+ icon: /* @__PURE__ */ e(yr, {}),
1045
+ "aria-label": l("editor.textColor", "Text colour"),
1046
+ onMouseDown: (b) => {
1047
+ b.preventDefault(), a();
1048
+ }
1049
+ }
1050
+ ) }),
1051
+ /* @__PURE__ */ y(B.Content, { side: "bottom", align: "start", children: [
1052
+ /* @__PURE__ */ e(B.Heading, { children: l("editor.textColor", "Text colour") }),
1053
+ /* @__PURE__ */ e("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ e(
1054
+ je,
1055
+ {
1056
+ variant: "inline",
1057
+ size: "sm",
1058
+ value: d,
1059
+ onChange: p
1060
+ }
1061
+ ) }),
1062
+ /* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(oe, { size: "sm", intent: "secondary", onClick: s, children: l("editor.color.remove", "Remove colour") }) })
1063
+ ] })
1064
+ ] });
1065
+ }
1066
+ function Jr({
1067
+ run: o,
1068
+ saveSelection: a,
1069
+ restoreSelection: c
1070
+ }) {
1071
+ const { t: l } = Z(), [d, g] = T("#fff3a3"), p = (b) => {
1072
+ g(b), c(), o("module.inline.format", {
1073
+ tag: "span",
1074
+ style: { "background-color": b },
1075
+ type: "toggle"
1076
+ });
1077
+ }, s = () => {
1078
+ c(), o("module.inline.remove", { style: "background-color" });
1079
+ };
1080
+ return /* @__PURE__ */ y(B, { onOpenChange: (b) => b && a(), children: [
1081
+ /* @__PURE__ */ e(B.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
1082
+ P,
1083
+ {
1084
+ size: "sm",
1085
+ intent: "ghost",
1086
+ icon: /* @__PURE__ */ e(or, {}),
1087
+ "aria-label": l("editor.highlightColor", "Highlight"),
1088
+ onMouseDown: (b) => {
1089
+ b.preventDefault(), a();
1090
+ }
1091
+ }
1092
+ ) }),
1093
+ /* @__PURE__ */ y(B.Content, { side: "bottom", align: "start", children: [
1094
+ /* @__PURE__ */ e(B.Heading, { children: l("editor.highlightColor", "Highlight") }),
1095
+ /* @__PURE__ */ e("div", { className: "ds:pt-[var(--spacing-sm)]", children: /* @__PURE__ */ e(
1096
+ je,
1097
+ {
1098
+ variant: "inline",
1099
+ size: "sm",
1100
+ value: d,
1101
+ onChange: p
1102
+ }
1103
+ ) }),
1104
+ /* @__PURE__ */ e("div", { className: "ds:mt-[var(--spacing-sm)] ds:flex ds:items-center ds:justify-end", children: /* @__PURE__ */ e(oe, { size: "sm", intent: "secondary", onClick: s, children: l("editor.highlight.remove", "Remove highlight") }) })
1105
+ ] })
1106
+ ] });
1107
+ }
1108
+ function en(o, a) {
1109
+ const c = Array.from({ length: a }, () => "<td><br></td>").join("");
1110
+ return `<table><tbody>${Array.from({ length: o }, () => `<tr>${c}</tr>`).join("")}</tbody></table>`;
1111
+ }
1112
+ function tn({
1113
+ run: o,
1114
+ insertTable: a,
1115
+ active: c
1116
+ }) {
1117
+ const { t: l } = Z(), [d, g] = T({ r: 0, c: 0 }), p = c.has("table");
1118
+ return /* @__PURE__ */ y(B, { onOpenChange: (s) => !s && g({ r: 0, c: 0 }), children: [
1119
+ /* @__PURE__ */ e(B.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
1120
+ P,
1121
+ {
1122
+ size: "sm",
1123
+ intent: "ghost",
1124
+ icon: /* @__PURE__ */ e(Ir, {}),
1125
+ "aria-label": l("editor.table.insert", "Insert table"),
1126
+ onMouseDown: (s) => s.preventDefault()
1127
+ }
1128
+ ) }),
1129
+ /* @__PURE__ */ e(B.Content, { side: "bottom", align: "start", children: p ? (
1130
+ // Caret is already inside a table — offer the manage ops only, never
1131
+ // a nested-table insert (mirrors Redactor's native dropdown, which
1132
+ // disables "insert table" while the caret is in a table).
1133
+ /* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: st.map((s) => /* @__PURE__ */ y(
1134
+ "button",
1135
+ {
1136
+ type: "button",
1137
+ onClick: () => o(s.command),
1138
+ className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:rounded-[var(--radius-sm)] ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-2xs)] ds:text-start ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--foreground)] ds:hover:bg-[var(--muted)]",
1139
+ children: [
1140
+ /* @__PURE__ */ e(
1141
+ "span",
1142
+ {
1143
+ "aria-hidden": "true",
1144
+ className: "ds:inline-flex ds:size-4 ds:shrink-0 ds:items-center ds:justify-center ds:text-[color:var(--muted-foreground)]",
1145
+ children: s.icon
1146
+ }
1147
+ ),
1148
+ l(s.label[0], s.label[1])
1149
+ ]
1150
+ },
1151
+ s.id
1152
+ )) })
1153
+ ) : /* @__PURE__ */ y(De, { children: [
1154
+ /* @__PURE__ */ e(B.Heading, { children: l("editor.table.insert", "Insert table") }),
1155
+ /* @__PURE__ */ e(
1156
+ "div",
1157
+ {
1158
+ role: "group",
1159
+ "aria-label": l("editor.table.sizePicker", "Table size"),
1160
+ className: "ds:mt-[var(--spacing-sm)] ds:grid ds:w-fit ds:grid-cols-6 ds:gap-[var(--spacing-2xs)]",
1161
+ onMouseLeave: () => g({ r: 0, c: 0 }),
1162
+ children: Array.from({ length: ze * ze }, (s, b) => {
1163
+ const v = Math.floor(b / ze) + 1, z = b % ze + 1, I = v <= d.r && z <= d.c;
1164
+ return /* @__PURE__ */ e(
1165
+ "button",
1166
+ {
1167
+ type: "button",
1168
+ "aria-label": l("editor.table.sizeCell", "{{r}}×{{c}}", {
1169
+ r: v,
1170
+ c: z
1171
+ }),
1172
+ onMouseEnter: () => g({ r: v, c: z }),
1173
+ onClick: () => a(en(v, z)),
1174
+ className: `ds:size-5 ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--border)] ${I ? "ds:bg-[var(--primary)]" : "ds:bg-[var(--muted)]"}`
1175
+ },
1176
+ b
1177
+ );
1178
+ })
1179
+ }
1180
+ ),
1181
+ /* @__PURE__ */ e("p", { className: "ds:mt-[var(--spacing-xs)] ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--muted-foreground)]", children: d.r > 0 ? l("editor.table.sizeCell", "{{r}}×{{c}}", {
1182
+ r: d.r,
1183
+ c: d.c
1184
+ }) : l("editor.table.sizeHint", "Pick a size") })
1185
+ ] }) })
1186
+ ] });
1187
+ }
1188
+ const rn = Object.fromEntries(st.map((o) => [o.id, o])), nn = [
1189
+ "ds:absolute ds:z-20 ds:flex ds:items-center ds:gap-[var(--spacing-2xs)]",
1190
+ "ds:[inset-block-start:var(--rte-tt-top)] ds:[inset-inline-start:var(--rte-tt-start)]",
1191
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1192
+ "ds:bg-[var(--popover)] ds:p-[var(--spacing-2xs)] ds:shadow-[var(--shadow-lg)]"
1193
+ ].join(" "), on = "#fde68a";
1194
+ function nt({
1195
+ scope: o,
1196
+ icon: a,
1197
+ label: c,
1198
+ onOpenChange: l,
1199
+ saveTableCell: d,
1200
+ applyTableBackground: g
1201
+ }) {
1202
+ const { t: p } = Z(), [s, b] = T(on);
1203
+ return /* @__PURE__ */ y(
1204
+ B,
1205
+ {
1206
+ onOpenChange: (v) => {
1207
+ l(v), v && d();
1208
+ },
1209
+ children: [
1210
+ /* @__PURE__ */ e(B.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
1211
+ P,
1212
+ {
1213
+ size: "sm",
1214
+ intent: "ghost",
1215
+ icon: a,
1216
+ tooltip: c,
1217
+ onMouseDown: (v) => v.preventDefault()
1218
+ }
1219
+ ) }),
1220
+ /* @__PURE__ */ y(B.Content, { side: "bottom", align: "center", children: [
1221
+ /* @__PURE__ */ e(
1222
+ je,
1223
+ {
1224
+ variant: "inline",
1225
+ size: "sm",
1226
+ value: s,
1227
+ onChange: (v) => {
1228
+ b(v), g(o, v);
1229
+ }
1230
+ }
1231
+ ),
1232
+ /* @__PURE__ */ e(
1233
+ oe,
1234
+ {
1235
+ size: "sm",
1236
+ intent: "ghost",
1237
+ className: "ds:mt-[var(--spacing-xs)] ds:w-full",
1238
+ onClick: () => g(o, null),
1239
+ children: p("editor.table.clearColor", "Clear colour")
1240
+ }
1241
+ )
1242
+ ] })
1243
+ ]
1244
+ }
1245
+ );
1246
+ }
1247
+ function an({
1248
+ active: o,
1249
+ run: a,
1250
+ areaRef: c,
1251
+ getActiveTableEl: l,
1252
+ enableColor: d = !1,
1253
+ saveTableCell: g,
1254
+ applyTableBackground: p
1255
+ }) {
1256
+ const { t: s } = Z(), b = o.has("table"), [v, z] = T(null), I = $(0), [S, w] = T(!1), O = C((f) => {
1257
+ I.current = Math.max(
1258
+ 0,
1259
+ I.current + (f ? 1 : -1)
1260
+ ), w(I.current > 0);
1261
+ }, []);
1262
+ if (Q(() => {
1263
+ if (S) return;
1264
+ if (!b || typeof window > "u") {
1265
+ z(null);
1266
+ return;
1267
+ }
1268
+ const f = () => {
1269
+ const A = c.current, Y = l();
1270
+ if (!A || !Y) {
1271
+ z(null);
1272
+ return;
1273
+ }
1274
+ const L = A.getBoundingClientRect(), D = Y.getBoundingClientRect(), H = getComputedStyle(A).direction === "rtl", J = Math.max(0, D.top - L.top - 44), ee = H ? L.right - D.right + D.width / 2 : D.left - L.left + D.width / 2;
1275
+ z({ top: J, start: Math.max(0, ee), rtl: H });
1276
+ };
1277
+ f();
1278
+ const k = new ResizeObserver(f), E = c.current, _ = l();
1279
+ return E && k.observe(E), _ && k.observe(_), window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
1280
+ k.disconnect(), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
1281
+ };
1282
+ }, [b, S, c, l]), !b && !S || !v) return null;
1283
+ const m = [
1284
+ ["rowAbove", "rowBelow"],
1285
+ ["colLeft", "colRight"],
1286
+ ["addHead"],
1287
+ ...d ? ["colour"] : [],
1288
+ ["deleteRow", "deleteColumn"],
1289
+ ["deleteTable"]
1290
+ ];
1291
+ return (
1292
+ // Tooltips disambiguate the icon-only ops on hover (and provide each
1293
+ // button's accessible name via IconButton's `tooltip` prop). Radix Tooltip
1294
+ // needs a provider ancestor, so scope one to the bar.
1295
+ /* @__PURE__ */ e(Lt, { children: /* @__PURE__ */ e(
1296
+ "div",
1297
+ {
1298
+ role: "group",
1299
+ "aria-label": s("editor.table.toolbar", "Table tools"),
1300
+ className: `${nn} ${v.rtl ? "ds:translate-x-1/2" : "ds:-translate-x-1/2"}`,
1301
+ style: {
1302
+ "--rte-tt-top": `${v.top}px`,
1303
+ "--rte-tt-start": `${v.start}px`
1304
+ },
1305
+ children: m.map((f, k) => /* @__PURE__ */ y(ot, { children: [
1306
+ k > 0 ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: lt }) : null,
1307
+ f === "colour" ? /* @__PURE__ */ y(De, { children: [
1308
+ /* @__PURE__ */ e(
1309
+ nt,
1310
+ {
1311
+ scope: "cell",
1312
+ icon: /* @__PURE__ */ e(fr, {}),
1313
+ label: s("editor.table.cellColor", "Cell colour"),
1314
+ onOpenChange: O,
1315
+ saveTableCell: g,
1316
+ applyTableBackground: p
1317
+ }
1318
+ ),
1319
+ /* @__PURE__ */ e(
1320
+ nt,
1321
+ {
1322
+ scope: "row",
1323
+ icon: /* @__PURE__ */ e(pr, {}),
1324
+ label: s("editor.table.rowColor", "Row colour"),
1325
+ onOpenChange: O,
1326
+ saveTableCell: g,
1327
+ applyTableBackground: p
1328
+ }
1329
+ )
1330
+ ] }) : f.map((E) => {
1331
+ const _ = rn[E];
1332
+ return /* @__PURE__ */ e(
1333
+ P,
1334
+ {
1335
+ size: "sm",
1336
+ intent: "ghost",
1337
+ icon: _.icon,
1338
+ tooltip: s(_.label[0], _.label[1]),
1339
+ onMouseDown: (A) => A.preventDefault(),
1340
+ onClick: () => a(_.command)
1341
+ },
1342
+ E
1343
+ );
1344
+ })
1345
+ ] }, f === "colour" ? "colour" : f[0]))
1346
+ }
1347
+ ) })
1348
+ );
1349
+ }
1350
+ function sn({
1351
+ run: o,
1352
+ active: a,
1353
+ preset: c,
1354
+ insertHtml: l,
1355
+ insertTable: d,
1356
+ saveSelection: g,
1357
+ restoreSelection: p,
1358
+ getSelectedText: s,
1359
+ uploadImage: b,
1360
+ enableColor: v = !1,
1361
+ enableImage: z = !1,
1362
+ enableTable: I = !1,
1363
+ showExtensions: S = !1
1364
+ }) {
1365
+ const { t: w } = Z(), O = (L) => L.preventDefault(), m = (L) => Wr[c].includes(L), f = (L) => {
1366
+ if (!m(L)) return null;
1367
+ const D = Gr[L];
1368
+ return /* @__PURE__ */ e(
1369
+ P,
1370
+ {
1371
+ size: "sm",
1372
+ intent: "ghost",
1373
+ icon: D.icon,
1374
+ "aria-label": w(D.label[0], D.label[1]),
1375
+ "aria-pressed": D.toggle ? a.has(D.toggle) : void 0,
1376
+ onMouseDown: O,
1377
+ onClick: () => o(...D.command)
1378
+ },
1379
+ D.id
1380
+ );
1381
+ }, k = () => /* @__PURE__ */ e("span", { "aria-hidden": "true", className: lt }), E = m("format"), _ = m("bold") || m("italic") || m("underline") || m("strike") || v, A = m("ul") || m("ol"), Y = m("link") || z || I;
1382
+ return /* @__PURE__ */ y(
1383
+ "div",
1384
+ {
1385
+ role: "group",
1386
+ "aria-label": w("editor.toolbarLabel"),
1387
+ className: Ur(),
1388
+ "data-component": "editor-toolbar",
1389
+ children: [
1390
+ E ? /* @__PURE__ */ e(Xr, { run: o, active: a, onTriggerDown: O }) : null,
1391
+ E && _ ? /* @__PURE__ */ e(k, {}) : null,
1392
+ f("bold"),
1393
+ f("italic"),
1394
+ f("underline"),
1395
+ f("strike"),
1396
+ v ? /* @__PURE__ */ e(
1397
+ Yr,
1398
+ {
1399
+ run: o,
1400
+ saveSelection: g,
1401
+ restoreSelection: p
1402
+ }
1403
+ ) : null,
1404
+ v ? /* @__PURE__ */ e(
1405
+ Jr,
1406
+ {
1407
+ run: o,
1408
+ saveSelection: g,
1409
+ restoreSelection: p
1410
+ }
1411
+ ) : null,
1412
+ (E || _) && A ? /* @__PURE__ */ e(k, {}) : null,
1413
+ f("ul"),
1414
+ f("ol"),
1415
+ (E || _ || A) && Y ? /* @__PURE__ */ e(k, {}) : null,
1416
+ m("link") ? /* @__PURE__ */ e(
1417
+ Qr,
1418
+ {
1419
+ insertHtml: l,
1420
+ saveSelection: g,
1421
+ restoreSelection: p,
1422
+ getSelectedText: s
1423
+ }
1424
+ ) : null,
1425
+ z ? /* @__PURE__ */ e(
1426
+ Zr,
1427
+ {
1428
+ insertHtml: l,
1429
+ saveSelection: g,
1430
+ restoreSelection: p,
1431
+ uploadImage: b
1432
+ }
1433
+ ) : null,
1434
+ I ? /* @__PURE__ */ e(tn, { run: o, insertTable: d, active: a }) : null,
1435
+ S && (E || _ || A || Y) ? /* @__PURE__ */ e(k, {}) : null,
1436
+ S ? /* @__PURE__ */ e(
1437
+ P,
1438
+ {
1439
+ size: "sm",
1440
+ intent: "ghost",
1441
+ icon: /* @__PURE__ */ e(jr, {}),
1442
+ "aria-label": w("editor.extensions", "Editor extensions"),
1443
+ disabled: !0,
1444
+ onMouseDown: O
1445
+ }
1446
+ ) : null
1447
+ ]
1448
+ }
1449
+ );
1450
+ }
1451
+ function re(o) {
1452
+ return _t(o, "rich-text");
1453
+ }
1454
+ function Oe(o = "") {
1455
+ const a = String(o).trim();
1456
+ if (a === "" || a === "<p><br></p>" || a === "<p>&nbsp;</p>")
1457
+ return "";
1458
+ const c = a.replace(/<br\s*\/?>/gi, "").replace(/&nbsp;/gi, "").replace(/<[^>]+>/g, "").trim();
1459
+ return c === "" && /<img\b[^>]*>/i.test(a) ? a : c === "" ? "" : a;
1460
+ }
1461
+ function ln(o) {
1462
+ return o.replace(
1463
+ /<img(?![^>]*\sloading=)([^>]*)>/gi,
1464
+ '<img loading="lazy"$1>'
1465
+ );
1466
+ }
1467
+ function dn(o) {
1468
+ if (!o || typeof o != "object") return;
1469
+ const a = o, c = (l) => {
1470
+ if (l && typeof l == "object" && "url" in l) {
1471
+ const d = l.url;
1472
+ return typeof d == "string" ? d : void 0;
1473
+ }
1474
+ };
1475
+ return typeof a.url == "string" ? a.url : c(a.file) ?? c(a.data) ?? Object.values(a).map(c).find(Boolean);
1476
+ }
1477
+ function cn(o) {
1478
+ if (o) return o;
1479
+ if (typeof window > "u") return null;
1480
+ const a = window;
1481
+ return a.$R ?? a.Redactor ?? null;
1482
+ }
1483
+ const un = {
1484
+ bold: ["module.inline.format", { tag: "b" }],
1485
+ italic: ["module.inline.format", { tag: "i" }],
1486
+ strikethrough: ["module.inline.format", { tag: "del" }],
1487
+ bulletedList: ["module.list.toggle", "ul"],
1488
+ numberedList: ["module.list.toggle", "ol"],
1489
+ heading: ["module.block.format", { tag: "h2" }],
1490
+ quote: ["module.block.format", { tag: "blockquote" }],
1491
+ paragraph: ["module.block.format", { tag: "p" }]
1492
+ }, mn = {
1493
+ zh: "zh_cn",
1494
+ pt: "pt_br"
1495
+ };
1496
+ function hn(o) {
1497
+ const a = o.split("-")[0];
1498
+ return mn[a] ?? a ?? "en";
1499
+ }
1500
+ const fn = qe(
1501
+ "redactor-theme-alfadocs ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]"
1502
+ ), gn = qe(
1503
+ [
1504
+ "ds:block ds:[inline-size:100%]",
1505
+ "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
1506
+ "ds:bg-[var(--background)] ds:text-[var(--foreground)]",
1507
+ "ds:shadow-[var(--shadow-md)]",
1508
+ "ds:font-[family-name:var(--font-sans)] ds:text-[length:var(--font-size-base)]",
1509
+ "ds:p-[var(--spacing-md)] ds:[min-block-size:var(--rich-text-editor-min-block-size)]",
1510
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
1511
+ "ds:focus-visible:outline-solid",
1512
+ "ds:focus-visible:outline-[var(--ring)]",
1513
+ "ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1514
+ "ds:forced-colors:focus-visible:outline-[CanvasText]"
1515
+ ].join(" ")
1516
+ ), dt = [
1517
+ "ds:inline-flex ds:items-center ds:justify-center",
1518
+ "ds:[min-block-size:var(--min-target-size)] ds:[min-inline-size:var(--min-target-size)]",
1519
+ "ds:text-[color:var(--primary-foreground)]",
1520
+ "ds:transition-colors",
1521
+ "ds:focus-visible:outline-[length:var(--focus-ring-width)]",
1522
+ "ds:focus-visible:outline-solid",
1523
+ "ds:focus-visible:outline-[var(--primary-foreground)]",
1524
+ "ds:focus-visible:[outline-offset:calc(var(--focus-ring-width)*-1)]"
1525
+ ].join(" "), pn = `${dt} ds:hover:bg-[color-mix(in_srgb,var(--primary-foreground)_15%,transparent)]`, bn = `${dt} ds:bg-[var(--destructive)] ds:hover:bg-[color-mix(in_srgb,var(--destructive)_88%,var(--primary-foreground))]`, yn = Tt(
1526
+ ({
1527
+ id: o,
1528
+ defaultValue: a,
1529
+ value: c,
1530
+ onChange: l,
1531
+ toolbar: d = "standard",
1532
+ placeholder: g,
1533
+ readOnly: p = !1,
1534
+ ariaLabel: s,
1535
+ minHeight: b,
1536
+ showExtensions: v,
1537
+ className: z,
1538
+ redactor: I,
1539
+ options: S,
1540
+ plugins: w,
1541
+ lang: O,
1542
+ imageUploadUrl: m,
1543
+ onKeyDown: f,
1544
+ onRequestAiDraft: k,
1545
+ aiDraftFormat: E = "html",
1546
+ aiPrivacyNotice: _,
1547
+ onDictate: A,
1548
+ onProofread: Y,
1549
+ onAutoFormat: L
1550
+ }, D) => {
1551
+ const { t: H, i18n: J } = Z(), ee = de(), me = Je(
1552
+ () => `rte-${ee.replace(/[^a-zA-Z0-9-_]/g, "")}`,
1553
+ [ee]
1554
+ ), R = `#${me}`, G = $(null), K = $(null), he = $(!1), fe = $(p), x = $(null), q = $(null), [F, W] = T(!1), [ct, Pe] = T(!1), [Be, ut] = T(
1555
+ () => /* @__PURE__ */ new Set()
1556
+ ), ge = $(null), V = $(l), ke = $(f);
1557
+ Q(() => {
1558
+ V.current = l, ke.current = f;
1559
+ }, [l, f]);
1560
+ const mt = $(
1561
+ (() => {
1562
+ const t = c ?? a ?? "";
1563
+ return t ? re(t) : "";
1564
+ })()
1565
+ ), ae = C(() => {
1566
+ var r;
1567
+ const t = K.current;
1568
+ if (t)
1569
+ try {
1570
+ const n = t(R, "source.getCode");
1571
+ if (typeof n == "string") return n;
1572
+ } catch {
1573
+ }
1574
+ return ((r = G.current) == null ? void 0 : r.value) ?? "";
1575
+ }, [R]), U = C(
1576
+ (t, ...r) => {
1577
+ const n = K.current;
1578
+ if (!n) return !1;
1579
+ const i = fe.current;
1580
+ if (i)
1581
+ try {
1582
+ n(R, "disableReadOnly");
1583
+ } catch {
1584
+ }
1585
+ try {
1586
+ return n(R, t, ...r), !0;
1587
+ } catch {
1588
+ return !1;
1589
+ } finally {
1590
+ if (i)
1591
+ try {
1592
+ n(R, "enableReadOnly");
1593
+ } catch {
1594
+ }
1595
+ }
1596
+ },
1597
+ [R]
1598
+ ), ie = C(
1599
+ (t, r) => {
1600
+ var ye;
1601
+ const n = (r == null ? void 0 : r.asHtml) ?? !0, i = n ? re(t) : t;
1602
+ if (U(n ? "insertion.insertHtml" : "insertion.insertText", i)) return;
1603
+ const h = G.current;
1604
+ if (!h) return;
1605
+ const N = h.selectionStart ?? h.value.length, X = h.selectionEnd ?? h.value.length;
1606
+ h.value = h.value.slice(0, N) + i + h.value.slice(X);
1607
+ const Ne = N + i.length;
1608
+ try {
1609
+ h.setSelectionRange(Ne, Ne);
1610
+ } catch {
1611
+ }
1612
+ (ye = V.current) == null || ye.call(V, { html: re(h.value), markdown: "" });
1613
+ },
1614
+ [U]
1615
+ ), Se = $(null), ne = C(() => {
1616
+ var i;
1617
+ const t = (i = x.current) == null ? void 0 : i.querySelector(".redactor-in"), r = typeof window < "u" ? window.getSelection() : null, n = /* @__PURE__ */ new Set();
1618
+ if (t && r && r.anchorNode && t.contains(r.anchorNode) && typeof document.queryCommandState == "function") {
1619
+ r.rangeCount > 0 && (Se.current = r.getRangeAt(0).cloneRange());
1620
+ try {
1621
+ document.queryCommandState("bold") && n.add("bold"), document.queryCommandState("italic") && n.add("italic"), document.queryCommandState("underline") && n.add("underline"), document.queryCommandState("strikeThrough") && n.add("strike"), document.queryCommandState("insertUnorderedList") && n.add("ul"), document.queryCommandState("insertOrderedList") && n.add("ol");
1622
+ const u = String(
1623
+ document.queryCommandValue("formatBlock") || ""
1624
+ ).toLowerCase();
1625
+ /^h[1-6]$/.test(u) ? (n.add("heading"), n.add(u)) : u === "blockquote" ? n.add("quote") : n.add("paragraph");
1626
+ const h = r.anchorNode.nodeType === Node.TEXT_NODE ? r.anchorNode.parentElement : r.anchorNode;
1627
+ h && t.contains(h) && h.closest("table") && n.add("table");
1628
+ } catch {
1629
+ }
1630
+ }
1631
+ ut(
1632
+ (u) => u.size === n.size && [...n].every((h) => u.has(h)) ? u : n
1633
+ );
1634
+ }, []), ce = C(
1635
+ (t, ...r) => {
1636
+ U(t, ...r), typeof window < "u" ? window.requestAnimationFrame(() => ne()) : ne();
1637
+ },
1638
+ [U, ne]
1639
+ );
1640
+ Q(() => {
1641
+ const t = x.current;
1642
+ if (!t) return;
1643
+ const r = {
1644
+ b: ["module.inline.format", { tag: "b" }],
1645
+ i: ["module.inline.format", { tag: "i" }],
1646
+ u: ["module.inline.format", { tag: "u" }]
1647
+ }, n = (i) => {
1648
+ if (!(i.metaKey || i.ctrlKey) || i.altKey || i.shiftKey || i.isComposing) return;
1649
+ const u = r[i.key.toLowerCase()];
1650
+ if (!u) return;
1651
+ const h = t.querySelector(".redactor-in");
1652
+ !h || !(i.target instanceof Node) || !h.contains(i.target) || fe.current || (i.preventDefault(), i.stopImmediatePropagation(), ce(...u));
1653
+ };
1654
+ return t.addEventListener("keydown", n, !0), () => t.removeEventListener("keydown", n, !0);
1655
+ }, [ce]);
1656
+ const Ee = C(
1657
+ (t) => {
1658
+ ie(t, { asHtml: !0 }), typeof window < "u" && window.requestAnimationFrame(() => ne());
1659
+ },
1660
+ [ie, ne]
1661
+ ), Fe = C(() => {
1662
+ var r;
1663
+ if (typeof window < "u") {
1664
+ const n = (r = x.current) == null ? void 0 : r.querySelector(".redactor-in"), i = window.getSelection();
1665
+ n && i && i.rangeCount > 0 && i.anchorNode && n.contains(i.anchorNode) && (Se.current = i.getRangeAt(0).cloneRange());
1666
+ }
1667
+ const t = K.current;
1668
+ if (t)
1669
+ try {
1670
+ t(R, "selection.save");
1671
+ } catch {
1672
+ }
1673
+ }, [R]), Ve = C(() => {
1674
+ const t = K.current;
1675
+ if (!t) return;
1676
+ const r = Se.current;
1677
+ try {
1678
+ t(R, "editor.focus");
1679
+ } catch {
1680
+ }
1681
+ if (r && typeof window < "u") {
1682
+ const n = window.getSelection();
1683
+ if (n)
1684
+ try {
1685
+ n.removeAllRanges(), n.addRange(r);
1686
+ return;
1687
+ } catch {
1688
+ }
1689
+ }
1690
+ try {
1691
+ t(R, "selection.restore");
1692
+ } catch {
1693
+ }
1694
+ }, [R]), ht = C(() => {
1695
+ var n;
1696
+ if (typeof window > "u") return "";
1697
+ const t = (n = x.current) == null ? void 0 : n.querySelector(".redactor-in"), r = window.getSelection();
1698
+ return !t || !r || !r.anchorNode || !t.contains(r.anchorNode) ? "" : r.toString();
1699
+ }, []), ft = C(() => {
1700
+ var u;
1701
+ if (typeof window > "u") return null;
1702
+ const t = (u = x.current) == null ? void 0 : u.querySelector(".redactor-in"), r = window.getSelection();
1703
+ if (!t || !r || r.rangeCount === 0) return null;
1704
+ const n = r.anchorNode, i = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
1705
+ return !i || !t.contains(i) ? null : i.closest("table");
1706
+ }, []), Ke = $(null), we = C(() => {
1707
+ var u;
1708
+ if (typeof window > "u") return null;
1709
+ const t = (u = x.current) == null ? void 0 : u.querySelector(".redactor-in"), r = window.getSelection();
1710
+ if (!t || !r || r.rangeCount === 0) return null;
1711
+ const n = r.anchorNode, i = n && n.nodeType === Node.TEXT_NODE ? n.parentElement : n;
1712
+ return !i || !t.contains(i) ? null : i.closest("td,th");
1713
+ }, []), gt = C(() => {
1714
+ Ke.current = we();
1715
+ }, [we]), pt = C(
1716
+ (t, r) => {
1717
+ var h;
1718
+ const n = Ke.current ?? we();
1719
+ if (!n) return;
1720
+ const i = t === "row" ? Array.from(((h = n.closest("tr")) == null ? void 0 : h.children) ?? [n]).filter(
1721
+ (N) => N instanceof HTMLElement && (N.tagName === "TD" || N.tagName === "TH")
1722
+ ) : [n], u = K.current;
1723
+ if (u)
1724
+ try {
1725
+ u(R, "module.buffer.trigger");
1726
+ } catch {
1727
+ }
1728
+ for (const N of i)
1729
+ r ? N.style.setProperty("background-color", r) : N.style.removeProperty("background-color");
1730
+ if (u)
1731
+ try {
1732
+ u(R, "broadcast", "hardsync");
1733
+ } catch {
1734
+ }
1735
+ typeof window < "u" && window.requestAnimationFrame(() => ne());
1736
+ },
1737
+ [we, R, ne]
1738
+ ), bt = C(
1739
+ (t) => {
1740
+ var n;
1741
+ const r = K.current;
1742
+ if (r && typeof window < "u") {
1743
+ const i = (n = x.current) == null ? void 0 : n.querySelector(".redactor-in"), u = window.getSelection(), h = u == null ? void 0 : u.anchorNode, N = h && h.nodeType === Node.TEXT_NODE ? h.parentElement : h, X = N && (i != null && i.contains(N)) ? N.closest("ul,ol") : null;
1744
+ if (X)
1745
+ try {
1746
+ r(R, "caret.setAfter", X);
1747
+ } catch {
1748
+ }
1749
+ }
1750
+ Ee(t), typeof window < "u" && window.requestAnimationFrame(() => {
1751
+ var u;
1752
+ const i = (u = x.current) == null ? void 0 : u.querySelector(".redactor-in");
1753
+ i == null || i.querySelectorAll("table td, table th").forEach((h) => {
1754
+ let N = h.lastChild;
1755
+ for (; N && N.nodeType === Node.TEXT_NODE && !(N.textContent ?? "").trim(); ) {
1756
+ const X = N.previousSibling;
1757
+ h.removeChild(N), N = X;
1758
+ }
1759
+ });
1760
+ });
1761
+ },
1762
+ [Ee, R]
1763
+ ), yt = C(
1764
+ async (t, r) => {
1765
+ if (!m) throw new Error("No image upload URL configured.");
1766
+ const n = new FormData();
1767
+ n.append("file", t);
1768
+ const i = await fetch(m, {
1769
+ method: "POST",
1770
+ body: n,
1771
+ credentials: "same-origin",
1772
+ signal: r
1773
+ });
1774
+ if (!i.ok) throw new Error(`Image upload failed (${i.status}).`);
1775
+ const u = dn(await i.json());
1776
+ if (!u) throw new Error("Image upload response contained no URL.");
1777
+ return u;
1778
+ },
1779
+ [m]
1780
+ ), pe = $(null), xe = $(null), [be, Ge] = T(!1), [vt, We] = T(!1), [kt, Ae] = T(""), Ce = C(() => {
1781
+ const t = xe.current;
1782
+ t != null && t.parentNode && t.parentNode.removeChild(t), xe.current = null;
1783
+ }, []), Ue = C((t) => {
1784
+ var i;
1785
+ const r = (i = x.current) == null ? void 0 : i.querySelector(
1786
+ ".redactor-in"
1787
+ );
1788
+ if (!r) return;
1789
+ let n = xe.current;
1790
+ if (!n || !r.contains(n)) {
1791
+ n = document.createElement("span"), n.setAttribute("data-rte-interim", ""), n.setAttribute("contenteditable", "false");
1792
+ const u = window.getSelection();
1793
+ if (u && u.rangeCount > 0 && r.contains(u.anchorNode)) {
1794
+ const h = u.getRangeAt(0);
1795
+ h.collapse(!1), h.insertNode(n);
1796
+ } else
1797
+ r.appendChild(n);
1798
+ xe.current = n;
1799
+ }
1800
+ n.textContent = t;
1801
+ }, []), Xe = C(() => {
1802
+ var t;
1803
+ (t = pe.current) == null || t.abort();
1804
+ }, []), Qe = C(() => {
1805
+ if (!A) return;
1806
+ const t = new AbortController();
1807
+ pe.current = t, We(!1), Ge(!0), Ae(H("editor.ai.listening")), Ce(), A({
1808
+ signal: t.signal,
1809
+ // Interim text shows live in the editor (grey + caret); each final
1810
+ // replaces it with committed text at the caret.
1811
+ onPartialTranscript: (r) => {
1812
+ t.signal.aborted || Ue(r);
1813
+ },
1814
+ onFinalTranscript: (r) => {
1815
+ if (t.signal.aborted) return;
1816
+ Ce();
1817
+ const n = r.trim();
1818
+ n && (ie(`${n} `, { asHtml: !1 }), Ae(n));
1819
+ }
1820
+ }).catch((r) => {
1821
+ t.signal.aborted || r && typeof r == "object" && "name" in r && r.name === "AbortError" || We(!0);
1822
+ }).finally(() => {
1823
+ Ce(), pe.current === t && (pe.current = null, Ge(!1), Ae(""));
1824
+ });
1825
+ }, [A, ie, Ce, Ue, H]), wt = C(() => {
1826
+ be ? Xe() : Qe();
1827
+ }, [be, Qe, Xe]);
1828
+ Q(() => () => {
1829
+ var t;
1830
+ return (t = pe.current) == null ? void 0 : t.abort();
1831
+ }, []);
1832
+ const [te, He] = T(null), se = $(null), Ze = C(
1833
+ (t, r) => {
1834
+ if (se.current) return;
1835
+ const n = new AbortController();
1836
+ se.current = n, He(t);
1837
+ const i = ae();
1838
+ Promise.resolve(r({ html: i, signal: n.signal })).then((u) => {
1839
+ var N;
1840
+ if (n.signal.aborted) return;
1841
+ const h = re(String(u ?? ""));
1842
+ U("source.setCode", h), (N = V.current) == null || N.call(V, { html: h, markdown: "" });
1843
+ }).catch(() => {
1844
+ }).finally(() => {
1845
+ se.current === n && (se.current = null, He(null));
1846
+ });
1847
+ },
1848
+ [ae, U]
1849
+ ), Ye = C(() => {
1850
+ var t;
1851
+ (t = se.current) == null || t.abort(), se.current = null, He(null);
1852
+ }, []);
1853
+ Q(() => () => {
1854
+ var t;
1855
+ return (t = se.current) == null ? void 0 : t.abort();
1856
+ }, []), Q(() => {
1857
+ const t = G.current;
1858
+ if (!t) return;
1859
+ t.value = mt.current;
1860
+ const r = cn(I);
1861
+ if (!r) {
1862
+ W(!0);
1863
+ return;
1864
+ }
1865
+ K.current = r;
1866
+ const n = {
1867
+ lang: O ?? hn(J.language || "en"),
1868
+ // The kit renders its OWN toolbar (EditorToolbar) and drives Redactor
1869
+ // via the command API, so Redactor's native toolbar is suppressed.
1870
+ toolbar: !1,
1871
+ plugins: w ?? [],
1872
+ placeholder: g ?? H("editor.placeholder"),
1873
+ toolbarFixed: !1,
1874
+ // Platform parity (RedactorWysiwyg.js:84): no inline shortcode expansion.
1875
+ shortcodes: !1,
1876
+ imageEditable: !1,
1877
+ imageResizable: !0
1878
+ }, i = m ? { imageUpload: m } : {}, u = (S == null ? void 0 : S.callbacks) ?? {}, h = {
1879
+ ...n,
1880
+ ...i,
1881
+ ...S ?? {},
1882
+ // Re-pin safety-critical keys LAST so consumer `options` can't override
1883
+ // the sanitising change handler, re-enable image editing, or turn off
1884
+ // drag-resize (platform re-pins both image flags — RedactorWysiwyg.js:115-116).
1885
+ imageEditable: !1,
1886
+ imageResizable: !0,
1887
+ callbacks: {
1888
+ ...u,
1889
+ changed(N) {
1890
+ const X = Oe(ln(N)), Ne = re(X);
1891
+ he.current = !0, V.current && (ge.current && clearTimeout(ge.current), ge.current = setTimeout(() => {
1892
+ var ye;
1893
+ (ye = V.current) == null || ye.call(V, { html: Ne, markdown: "" });
1894
+ }, 100));
1895
+ },
1896
+ keydown(N) {
1897
+ var X;
1898
+ (X = ke.current) == null || X.call(ke, N);
1899
+ },
1900
+ observe() {
1901
+ ne();
1902
+ }
1903
+ }
1904
+ };
1905
+ try {
1906
+ if (r(R, h), p)
1907
+ try {
1908
+ r(R, "enableReadOnly");
1909
+ } catch {
1910
+ }
1911
+ } catch {
1912
+ W(!0);
1913
+ }
1914
+ return () => {
1915
+ ge.current && clearTimeout(ge.current);
1916
+ try {
1917
+ r(R, "destroy");
1918
+ } catch {
1919
+ }
1920
+ K.current = null;
1921
+ };
1922
+ }, []), Q(() => {
1923
+ if (!K.current || c === void 0) return;
1924
+ if (he.current) {
1925
+ he.current = !1;
1926
+ return;
1927
+ }
1928
+ const t = re(Oe(c));
1929
+ Oe(ae()) !== t && U("source.setCode", t);
1930
+ }, [c, ae, U]), Q(() => {
1931
+ fe.current = p;
1932
+ const t = K.current;
1933
+ if (t)
1934
+ try {
1935
+ t(R, p ? "enableReadOnly" : "disableReadOnly");
1936
+ } catch {
1937
+ }
1938
+ }, [p, R]), Q(() => {
1939
+ if (!F || c === void 0) return;
1940
+ const t = G.current;
1941
+ if (!t) return;
1942
+ const r = re(c);
1943
+ t.value !== r && document.activeElement !== t && (t.value = r);
1944
+ }, [F, c]);
1945
+ const Ie = Je(
1946
+ () => ({
1947
+ getHTML() {
1948
+ return ae();
1949
+ },
1950
+ getText() {
1951
+ return ae().replace(/<[^>]*>/g, " ").replace(/&nbsp;/gi, " ").replace(/\s+/g, " ").trim();
1952
+ },
1953
+ getMarkdown() {
1954
+ return "";
1955
+ },
1956
+ setContent(t) {
1957
+ const r = re(t);
1958
+ U("source.setCode", r) || G.current && (G.current.value = r);
1959
+ },
1960
+ insertAtCursor: ie,
1961
+ applyFormat(t) {
1962
+ const r = un[t];
1963
+ r && ce(...r);
1964
+ },
1965
+ focus() {
1966
+ var r;
1967
+ const t = K.current;
1968
+ if (t)
1969
+ try {
1970
+ t(R, "editor.focus");
1971
+ return;
1972
+ } catch {
1973
+ }
1974
+ (r = G.current) == null || r.focus();
1975
+ },
1976
+ clear() {
1977
+ U("source.setCode", "") || G.current && (G.current.value = "");
1978
+ }
1979
+ }),
1980
+ [R, ae, U, ie, ce]
1981
+ );
1982
+ zt(D, () => Ie, [Ie]), Rt(Pr, Ie, o);
1983
+ const xt = C(
1984
+ (t) => {
1985
+ var r;
1986
+ (r = V.current) == null || r.call(V, {
1987
+ html: re(t.target.value),
1988
+ markdown: ""
1989
+ });
1990
+ },
1991
+ []
1992
+ ), Ct = s ?? H("editor.regionLabel"), Nt = g ?? H("editor.placeholder"), Le = te !== null, ue = [];
1993
+ return A && ue.push({
1994
+ key: "dictate",
1995
+ icon: be ? /* @__PURE__ */ e(Me, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ e(it, { "aria-hidden": "true", className: "ds:size-5" }),
1996
+ label: H(be ? "editor.ai.dictateStop" : "editor.ai.dictateStart"),
1997
+ onClick: wt,
1998
+ recording: be
1999
+ }), Y && ue.push({
2000
+ key: "proofread",
2001
+ // While running, the segment becomes a STOP/cancel button (progress is
2002
+ // shown by the scrim spinner).
2003
+ icon: te === "proofread" ? /* @__PURE__ */ e(Me, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ e(Sr, { "aria-hidden": "true", className: "ds:size-5" }),
2004
+ label: te === "proofread" ? H("common.cancel") : H("editor.ai.proofread", "Check spelling & grammar"),
2005
+ onClick: te === "proofread" ? Ye : () => Ze("proofread", Y),
2006
+ running: te === "proofread"
2007
+ }), L && ue.push({
2008
+ key: "format",
2009
+ icon: te === "format" ? /* @__PURE__ */ e(Me, { "aria-hidden": "true", className: "ds:size-5 ds:fill-current" }) : /* @__PURE__ */ e(Dr, { "aria-hidden": "true", className: "ds:size-5" }),
2010
+ label: te === "format" ? H("common.cancel") : H("editor.ai.autoFormat", "Auto-format document"),
2011
+ onClick: te === "format" ? Ye : () => Ze("format", L),
2012
+ running: te === "format"
2013
+ }), k && ue.push({
2014
+ key: "write",
2015
+ icon: /* @__PURE__ */ e(Bt, { "aria-hidden": "true", className: "ds:size-5" }),
2016
+ label: H("editor.ai.helpMeWrite"),
2017
+ onClick: () => {
2018
+ Fe(), Pe(!0);
2019
+ }
2020
+ }), /* @__PURE__ */ y(
2021
+ "div",
2022
+ {
2023
+ ref: x,
2024
+ className: [fn(), z].filter(Boolean).join(" "),
2025
+ "data-component": "rich-text-editor",
2026
+ "data-component-id": o,
2027
+ "data-min-height": b,
2028
+ children: [
2029
+ !F && !p ? /* @__PURE__ */ e(
2030
+ sn,
2031
+ {
2032
+ run: ce,
2033
+ active: Be,
2034
+ preset: d,
2035
+ insertHtml: Ee,
2036
+ insertTable: bt,
2037
+ saveSelection: Fe,
2038
+ restoreSelection: Ve,
2039
+ getSelectedText: ht,
2040
+ uploadImage: m ? yt : void 0,
2041
+ enableColor: (w == null ? void 0 : w.includes("fontcolor")) ?? !1,
2042
+ enableImage: !!m,
2043
+ enableTable: (w == null ? void 0 : w.includes("table")) ?? !1,
2044
+ showExtensions: v
2045
+ }
2046
+ ) : null,
2047
+ /* @__PURE__ */ y("div", { className: "ds:relative", ref: q, children: [
2048
+ /* @__PURE__ */ e(
2049
+ "textarea",
2050
+ {
2051
+ ref: G,
2052
+ id: me,
2053
+ "aria-label": Ct,
2054
+ "aria-multiline": "true",
2055
+ "aria-busy": Le || void 0,
2056
+ placeholder: Nt,
2057
+ onChange: F ? xt : void 0,
2058
+ readOnly: F ? p : void 0,
2059
+ className: F ? gn() : void 0
2060
+ }
2061
+ ),
2062
+ Le ? /* @__PURE__ */ e(
2063
+ "div",
2064
+ {
2065
+ "aria-hidden": "true",
2066
+ 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)]",
2067
+ children: /* @__PURE__ */ e(at, { size: "lg", variant: "prism" })
2068
+ }
2069
+ ) : null,
2070
+ /* @__PURE__ */ y("div", { className: "ds:sticky ds:bottom-0 ds:z-10", children: [
2071
+ ue.length > 0 ? /* @__PURE__ */ e("div", { className: "ds:absolute ds:[inset-block-end:var(--spacing-md)] ds:[inset-inline-end:var(--spacing-md)] ds:z-10 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: ue.map((t, r) => /* @__PURE__ */ y(ot, { children: [
2072
+ r > 0 ? /* @__PURE__ */ e(
2073
+ "span",
2074
+ {
2075
+ "aria-hidden": "true",
2076
+ className: "ds:self-stretch ds:[inline-size:var(--border-width-sm)] ds:bg-[color-mix(in_srgb,var(--primary-foreground)_35%,transparent)]"
2077
+ }
2078
+ ) : null,
2079
+ /* @__PURE__ */ e(
2080
+ "button",
2081
+ {
2082
+ type: "button",
2083
+ onClick: t.onClick,
2084
+ "aria-pressed": t.recording || void 0,
2085
+ "aria-busy": t.running || void 0,
2086
+ disabled: Le && !t.running || void 0,
2087
+ "aria-label": t.label,
2088
+ title: t.label,
2089
+ className: t.recording ? bn : pn,
2090
+ children: t.icon
2091
+ }
2092
+ )
2093
+ ] }, t.key)) }) : null,
2094
+ k ? /* @__PURE__ */ e(
2095
+ Kr,
2096
+ {
2097
+ open: ct,
2098
+ onClose: () => Pe(!1),
2099
+ onRequestAiDraft: k,
2100
+ onInsert: (t) => {
2101
+ Ve(), ie(t, { asHtml: E !== "text" });
2102
+ },
2103
+ previewAsHtml: E !== "text",
2104
+ privacyNotice: _,
2105
+ onDictate: A
2106
+ }
2107
+ ) : null
2108
+ ] }),
2109
+ !F && !p && ((w == null ? void 0 : w.includes("table")) ?? !1) ? /* @__PURE__ */ e(
2110
+ an,
2111
+ {
2112
+ active: Be,
2113
+ run: ce,
2114
+ areaRef: q,
2115
+ getActiveTableEl: ft,
2116
+ enableColor: (w == null ? void 0 : w.includes("fontcolor")) ?? !1,
2117
+ saveTableCell: gt,
2118
+ applyTableBackground: pt
2119
+ }
2120
+ ) : null
2121
+ ] }),
2122
+ A ? /* @__PURE__ */ e("p", { className: "ds:sr-only", role: "status", "aria-live": "polite", children: kt }) : null,
2123
+ A && vt ? /* @__PURE__ */ e(
2124
+ "p",
2125
+ {
2126
+ role: "alert",
2127
+ className: "ds:text-[length:var(--font-size-sm)] ds:text-[color:var(--destructive)]",
2128
+ children: H("editor.ai.dictationError")
2129
+ }
2130
+ ) : null
2131
+ ]
2132
+ }
2133
+ );
2134
+ }
2135
+ );
2136
+ yn.displayName = "RichTextEditor";
2137
+ export {
2138
+ yn as R,
2139
+ Pr as r,
2140
+ fn as w
2141
+ };
2142
+ //# sourceMappingURL=rich-text-editor-BsV7zUdg.js.map