@banzamel/mineralui 1.8.0 → 1.9.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 (220) hide show
  1. package/README.md +1 -1
  2. package/dist/{MAvatar-BcayQCnp.js → MAvatar-D_dVAPaR.js} +3 -3
  3. package/dist/{MAvatar-BcayQCnp.js.map → MAvatar-D_dVAPaR.js.map} +1 -1
  4. package/dist/{MAvatar-BgevCYi3.cjs → MAvatar-DzZPRbot.cjs} +2 -2
  5. package/dist/{MAvatar-BgevCYi3.cjs.map → MAvatar-DzZPRbot.cjs.map} +1 -1
  6. package/dist/MAvatarStack-CrhkO_SO.js +330 -0
  7. package/dist/MAvatarStack-CrhkO_SO.js.map +1 -0
  8. package/dist/MAvatarStack-DN79aJo1.cjs +2 -0
  9. package/dist/MAvatarStack-DN79aJo1.cjs.map +1 -0
  10. package/dist/{MButton-DZLLrtQb.js → MButton-C1pnL4_j.js} +2 -2
  11. package/dist/{MButton-DZLLrtQb.js.map → MButton-C1pnL4_j.js.map} +1 -1
  12. package/dist/{MButton-8UCydOik.cjs → MButton-DFRHWHzh.cjs} +2 -2
  13. package/dist/{MButton-8UCydOik.cjs.map → MButton-DFRHWHzh.cjs.map} +1 -1
  14. package/dist/{MDataTable-95_Mb6jE.cjs → MDataTable-7nJuwzJR.cjs} +2 -2
  15. package/dist/{MDataTable-95_Mb6jE.cjs.map → MDataTable-7nJuwzJR.cjs.map} +1 -1
  16. package/dist/{MDataTable-DxDS5auV.js → MDataTable-CQt_pINO.js} +4 -4
  17. package/dist/{MDataTable-DxDS5auV.js.map → MDataTable-CQt_pINO.js.map} +1 -1
  18. package/dist/{MDrawer-CXNHYwPO.js → MDrawer-B83--EVv.js} +2 -2
  19. package/dist/{MDrawer-CXNHYwPO.js.map → MDrawer-B83--EVv.js.map} +1 -1
  20. package/dist/{MDrawer-DzqtHVeA.cjs → MDrawer-D6cy9K7J.cjs} +2 -2
  21. package/dist/{MDrawer-DzqtHVeA.cjs.map → MDrawer-D6cy9K7J.cjs.map} +1 -1
  22. package/dist/MGrid-B-fP4GME.cjs +2 -0
  23. package/dist/MGrid-B-fP4GME.cjs.map +1 -0
  24. package/dist/{MGrid-DR0fHItF.js → MGrid-DVluuula.js} +56 -56
  25. package/dist/MGrid-DVluuula.js.map +1 -0
  26. package/dist/{MHeading-MPh8Qm9q.js → MHeading-B7KgSP4T.js} +3 -3
  27. package/dist/{MHeading-MPh8Qm9q.js.map → MHeading-B7KgSP4T.js.map} +1 -1
  28. package/dist/{MHeading-CKe5lcM_.cjs → MHeading-f3hwkW3r.cjs} +2 -2
  29. package/dist/{MHeading-CKe5lcM_.cjs.map → MHeading-f3hwkW3r.cjs.map} +1 -1
  30. package/dist/{MInput-D_zaoWwX.cjs → MInput-BLGduKL_.cjs} +2 -2
  31. package/dist/{MInput-D_zaoWwX.cjs.map → MInput-BLGduKL_.cjs.map} +1 -1
  32. package/dist/{MInput-7i0Dy1t4.js → MInput-IsUELgN2.js} +2 -2
  33. package/dist/{MInput-7i0Dy1t4.js.map → MInput-IsUELgN2.js.map} +1 -1
  34. package/dist/{MInputExpDate-DhO5zN7L.js → MInputExpDate-CeCmw6fj.js} +2 -2
  35. package/dist/{MInputExpDate-DhO5zN7L.js.map → MInputExpDate-CeCmw6fj.js.map} +1 -1
  36. package/dist/{MInputExpDate-DWWwjMYK.cjs → MInputExpDate-DZ8JtSjs.cjs} +2 -2
  37. package/dist/{MInputExpDate-DWWwjMYK.cjs.map → MInputExpDate-DZ8JtSjs.cjs.map} +1 -1
  38. package/dist/{MInputSearch-CmzHPnmC.js → MInputSearch-BBxUF5pw.js} +2 -2
  39. package/dist/{MInputSearch-CmzHPnmC.js.map → MInputSearch-BBxUF5pw.js.map} +1 -1
  40. package/dist/{MInputSearch-DpHSVpmL.cjs → MInputSearch-_7jfFGr1.cjs} +2 -2
  41. package/dist/{MInputSearch-DpHSVpmL.cjs.map → MInputSearch-_7jfFGr1.cjs.map} +1 -1
  42. package/dist/{MLink-rFKN1mcM.js → MLink-Bd8fLH1N.js} +2 -2
  43. package/dist/{MLink-rFKN1mcM.js.map → MLink-Bd8fLH1N.js.map} +1 -1
  44. package/dist/{MLink-B3ImjkJV.cjs → MLink-CRK8YvR4.cjs} +2 -2
  45. package/dist/{MLink-B3ImjkJV.cjs.map → MLink-CRK8YvR4.cjs.map} +1 -1
  46. package/dist/{MModal-DGmeQlWo.js → MModal-DiTjBO8B.js} +2 -2
  47. package/dist/{MModal-DGmeQlWo.js.map → MModal-DiTjBO8B.js.map} +1 -1
  48. package/dist/{MModal-CP0e31pv.cjs → MModal-eJDG6riB.cjs} +2 -2
  49. package/dist/{MModal-CP0e31pv.cjs.map → MModal-eJDG6riB.cjs.map} +1 -1
  50. package/dist/{MPagination-CS62B9kZ.cjs → MPagination-D1hYqLDb.cjs} +2 -2
  51. package/dist/{MPagination-CS62B9kZ.cjs.map → MPagination-D1hYqLDb.cjs.map} +1 -1
  52. package/dist/{MPagination-Dr110are.js → MPagination-DvToi2cs.js} +2 -2
  53. package/dist/{MPagination-Dr110are.js.map → MPagination-DvToi2cs.js.map} +1 -1
  54. package/dist/{MQrCode-B0-Np-N3.cjs → MQrCode-HO2YIC7e.cjs} +2 -2
  55. package/dist/{MQrCode-B0-Np-N3.cjs.map → MQrCode-HO2YIC7e.cjs.map} +1 -1
  56. package/dist/{MQrCode-6ANDcExA.js → MQrCode-Kb997gaE.js} +5 -5
  57. package/dist/{MQrCode-6ANDcExA.js.map → MQrCode-Kb997gaE.js.map} +1 -1
  58. package/dist/{MSkeleton-BvXgnYs_.js → MSkeleton-CVofhuDp.js} +3 -3
  59. package/dist/{MSkeleton-BvXgnYs_.js.map → MSkeleton-CVofhuDp.js.map} +1 -1
  60. package/dist/{MSkeleton-BdwhPx-k.cjs → MSkeleton-CuYA8eN3.cjs} +2 -2
  61. package/dist/{MSkeleton-BdwhPx-k.cjs.map → MSkeleton-CuYA8eN3.cjs.map} +1 -1
  62. package/dist/{MStack-DFIc3S4_.js → MStack-C4Eocfb5.js} +2 -2
  63. package/dist/{MStack-DFIc3S4_.js.map → MStack-C4Eocfb5.js.map} +1 -1
  64. package/dist/{MStack-ByFYGSsy.cjs → MStack-w8XcuIJK.cjs} +2 -2
  65. package/dist/{MStack-ByFYGSsy.cjs.map → MStack-w8XcuIJK.cjs.map} +1 -1
  66. package/dist/{MSubText-BFdfBlpS.js → MSubText-C-N15d4Z.js} +3 -3
  67. package/dist/{MSubText-BFdfBlpS.js.map → MSubText-C-N15d4Z.js.map} +1 -1
  68. package/dist/{MSubText-1ilKSz8e.cjs → MSubText-CIMKPb8o.cjs} +2 -2
  69. package/dist/{MSubText-1ilKSz8e.cjs.map → MSubText-CIMKPb8o.cjs.map} +1 -1
  70. package/dist/{MSurface-CpAuwpHv.cjs → MSurface-KvAS2hkl.cjs} +2 -2
  71. package/dist/{MSurface-CpAuwpHv.cjs.map → MSurface-KvAS2hkl.cjs.map} +1 -1
  72. package/dist/{MSurface-CmVIQC1A.js → MSurface-odrvQXkb.js} +2 -2
  73. package/dist/{MSurface-CmVIQC1A.js.map → MSurface-odrvQXkb.js.map} +1 -1
  74. package/dist/{MTag-DwQ-j1sV.cjs → MTag-DZqV4S13.cjs} +2 -2
  75. package/dist/{MTag-DwQ-j1sV.cjs.map → MTag-DZqV4S13.cjs.map} +1 -1
  76. package/dist/{MTag-C4SUJly2.js → MTag-DgB6ukFJ.js} +3 -3
  77. package/dist/{MTag-C4SUJly2.js.map → MTag-DgB6ukFJ.js.map} +1 -1
  78. package/dist/{MText-D0fI_D_Q.cjs → MText-BHbI7KJO.cjs} +2 -2
  79. package/dist/{MText-D0fI_D_Q.cjs.map → MText-BHbI7KJO.cjs.map} +1 -1
  80. package/dist/{MText-DcB1GAt-.js → MText-CL-LPcXi.js} +2 -2
  81. package/dist/{MText-DcB1GAt-.js.map → MText-CL-LPcXi.js.map} +1 -1
  82. package/dist/{cards-D7oHIHmU.js → cards-C50fpYud.js} +20 -16
  83. package/dist/cards-C50fpYud.js.map +1 -0
  84. package/dist/cards-Ci1FoV9C.cjs +2 -0
  85. package/dist/cards-Ci1FoV9C.cjs.map +1 -0
  86. package/dist/cards.cjs +1 -1
  87. package/dist/cards.js +3 -3
  88. package/dist/components/cards/MCardGrid/MCardGrid.types.d.ts +40 -1
  89. package/dist/components/cards/MCardGrid/index.d.ts +1 -1
  90. package/dist/components/cards/MStatCard/MStatCard.d.ts +0 -1
  91. package/dist/components/cards/MStatCard/MStatCard.types.d.ts +0 -2
  92. package/dist/components/cards/MStatCard/index.d.ts +2 -2
  93. package/dist/components/cards/index.d.ts +3 -3
  94. package/dist/components/data/MTimelineCalendar/DayStrip.d.ts +11 -0
  95. package/dist/components/data/MTimelineCalendar/EventPopover.d.ts +18 -0
  96. package/dist/components/data/MTimelineCalendar/MTimelineCalendar.d.ts +2 -0
  97. package/dist/components/data/MTimelineCalendar/MTimelineCalendar.helpers.d.ts +55 -0
  98. package/dist/components/data/MTimelineCalendar/MTimelineCalendar.types.d.ts +89 -0
  99. package/dist/components/data/MTimelineCalendar/index.d.ts +2 -0
  100. package/dist/components/data/index.d.ts +4 -0
  101. package/dist/components/layout/MGrid/MGrid.d.ts +1 -1
  102. package/dist/components/layout/MNavbar/MNavbar.d.ts +1 -1
  103. package/dist/components/layout/MNavbar/MNavbar.types.d.ts +19 -0
  104. package/dist/components/layout/index.d.ts +0 -4
  105. package/dist/components/media/MAvatarStack/MAvatarStack.d.ts +1 -1
  106. package/dist/components/media/MAvatarStack/MAvatarStack.types.d.ts +14 -1
  107. package/dist/components/typography/MHeading/MHeading.d.ts +1 -562
  108. package/dist/{controls-BfV0vxeJ.cjs → controls-CYQxPd4U.cjs} +2 -2
  109. package/dist/{controls-BfV0vxeJ.cjs.map → controls-CYQxPd4U.cjs.map} +1 -1
  110. package/dist/{controls-BczTk73I.js → controls-CcbEqqWo.js} +3 -3
  111. package/dist/{controls-BczTk73I.js.map → controls-CcbEqqWo.js.map} +1 -1
  112. package/dist/controls.cjs +1 -1
  113. package/dist/controls.js +2 -2
  114. package/dist/data-DtShJEic.cjs +2 -0
  115. package/dist/data-DtShJEic.cjs.map +1 -0
  116. package/dist/data-RXuvb9VI.js +3454 -0
  117. package/dist/data-RXuvb9VI.js.map +1 -0
  118. package/dist/data.cjs +1 -1
  119. package/dist/data.js +3 -3
  120. package/dist/{display-Cw3-bTsm.cjs → display-96-TEGmZ.cjs} +2 -2
  121. package/dist/{display-Cw3-bTsm.cjs.map → display-96-TEGmZ.cjs.map} +1 -1
  122. package/dist/{display-DyC7084n.js → display-C7YRf4Ze.js} +5 -5
  123. package/dist/{display-DyC7084n.js.map → display-C7YRf4Ze.js.map} +1 -1
  124. package/dist/display.cjs +1 -1
  125. package/dist/display.js +2 -2
  126. package/dist/{dropdowns-6eO0b6eI.cjs → dropdowns-Ce3Pb2JM.cjs} +2 -2
  127. package/dist/{dropdowns-6eO0b6eI.cjs.map → dropdowns-Ce3Pb2JM.cjs.map} +1 -1
  128. package/dist/{dropdowns-zXgrjNXZ.js → dropdowns-DfXhVlWQ.js} +4 -4
  129. package/dist/{dropdowns-zXgrjNXZ.js.map → dropdowns-DfXhVlWQ.js.map} +1 -1
  130. package/dist/dropdowns.cjs +1 -1
  131. package/dist/dropdowns.js +1 -1
  132. package/dist/{feedback-DfBjzJAw.js → feedback-DGT28-Zx.js} +11 -11
  133. package/dist/{feedback-DfBjzJAw.js.map → feedback-DGT28-Zx.js.map} +1 -1
  134. package/dist/{feedback-BvRmoSzV.cjs → feedback-Dr7G3K_R.cjs} +2 -2
  135. package/dist/{feedback-BvRmoSzV.cjs.map → feedback-Dr7G3K_R.cjs.map} +1 -1
  136. package/dist/feedback.cjs +1 -1
  137. package/dist/feedback.js +4 -4
  138. package/dist/index.cjs +1 -1
  139. package/dist/index.cjs.map +1 -1
  140. package/dist/index.d.ts +2 -4
  141. package/dist/index.js +52 -52
  142. package/dist/index.js.map +1 -1
  143. package/dist/{inputs-C1I1SLZ8.cjs → inputs-BJMmyEdL.cjs} +2 -2
  144. package/dist/{inputs-C1I1SLZ8.cjs.map → inputs-BJMmyEdL.cjs.map} +1 -1
  145. package/dist/{inputs-Dy1WurNK.js → inputs-CNPeF6gb.js} +3 -3
  146. package/dist/{inputs-Dy1WurNK.js.map → inputs-CNPeF6gb.js.map} +1 -1
  147. package/dist/inputs.cjs +1 -1
  148. package/dist/inputs.js +4 -4
  149. package/dist/layout-dUrQeGc2.cjs +2 -0
  150. package/dist/layout-dUrQeGc2.cjs.map +1 -0
  151. package/dist/{layout-D1-mF4xn.js → layout-tIq6BGQK.js} +240 -301
  152. package/dist/layout-tIq6BGQK.js.map +1 -0
  153. package/dist/layout.cjs +1 -1
  154. package/dist/layout.js +8 -8
  155. package/dist/licensing-9sZ43Cif.cjs +2 -0
  156. package/dist/licensing-9sZ43Cif.cjs.map +1 -0
  157. package/dist/{licensing-ZFCUU4Z8.js → licensing-Bq78CLC_.js} +5 -5
  158. package/dist/licensing-Bq78CLC_.js.map +1 -0
  159. package/dist/media-BySr5LGc.cjs +2 -0
  160. package/dist/media-BySr5LGc.cjs.map +1 -0
  161. package/dist/media-IQ4iYTs-.js +391 -0
  162. package/dist/media-IQ4iYTs-.js.map +1 -0
  163. package/dist/media.cjs +1 -1
  164. package/dist/media.js +4 -4
  165. package/dist/{overlays-B0khU6Wb.js → overlays-BabXGLEM.js} +7 -7
  166. package/dist/{overlays-B0khU6Wb.js.map → overlays-BabXGLEM.js.map} +1 -1
  167. package/dist/{overlays-VAh5PqAe.cjs → overlays-CTR3n21O.cjs} +2 -2
  168. package/dist/{overlays-VAh5PqAe.cjs.map → overlays-CTR3n21O.cjs.map} +1 -1
  169. package/dist/overlays.cjs +1 -1
  170. package/dist/overlays.js +3 -3
  171. package/dist/style-runtime.cjs +1 -1
  172. package/dist/style-runtime.js +1 -1
  173. package/dist/styles.css +1 -1
  174. package/dist/theme/MTheme.types.d.ts +5 -0
  175. package/dist/theme/responsive.d.ts +1 -10
  176. package/dist/{theme-D_f-cmSA.js → theme-DAOU1aPs.js} +4 -3
  177. package/dist/{theme-D_f-cmSA.js.map → theme-DAOU1aPs.js.map} +1 -1
  178. package/dist/{theme-BaroO-OB.cjs → theme-DsTDooyX.cjs} +2 -2
  179. package/dist/{theme-BaroO-OB.cjs.map → theme-DsTDooyX.cjs.map} +1 -1
  180. package/dist/theme.cjs +1 -1
  181. package/dist/theme.js +1 -1
  182. package/dist/{typography-CldwDFse.js → typography-CAW17MDj.js} +2 -2
  183. package/dist/{typography-CldwDFse.js.map → typography-CAW17MDj.js.map} +1 -1
  184. package/dist/{typography-D7COsP1O.cjs → typography-sbLuXqFn.cjs} +2 -2
  185. package/dist/{typography-D7COsP1O.cjs.map → typography-sbLuXqFn.cjs.map} +1 -1
  186. package/dist/typography.cjs +1 -1
  187. package/dist/typography.js +5 -5
  188. package/dist/utils/commandPaletteFromNavGroups.d.ts +74 -0
  189. package/dist/utils/licensing.d.ts +4 -4
  190. package/dist/utils.cjs +1 -1
  191. package/dist/utils.js +1 -1
  192. package/package.json +1 -1
  193. package/dist/MGrid-C4kPZDSa.cjs +0 -2
  194. package/dist/MGrid-C4kPZDSa.cjs.map +0 -1
  195. package/dist/MGrid-DR0fHItF.js.map +0 -1
  196. package/dist/MImage-BZ6SrSao.cjs +0 -2
  197. package/dist/MImage-BZ6SrSao.cjs.map +0 -1
  198. package/dist/MImage-Btx_7g2Z.js +0 -257
  199. package/dist/MImage-Btx_7g2Z.js.map +0 -1
  200. package/dist/cards-B9g6Lf1n.cjs +0 -2
  201. package/dist/cards-B9g6Lf1n.cjs.map +0 -1
  202. package/dist/cards-D7oHIHmU.js.map +0 -1
  203. package/dist/components/layout/MAppMenu/MAppMenu.d.ts +0 -2
  204. package/dist/components/layout/MAppMenu/MAppMenu.types.d.ts +0 -63
  205. package/dist/components/layout/MAppMenu/index.d.ts +0 -2
  206. package/dist/data-7kG1MC1Z.cjs +0 -2
  207. package/dist/data-7kG1MC1Z.cjs.map +0 -1
  208. package/dist/data-z3e8XTSt.js +0 -2692
  209. package/dist/data-z3e8XTSt.js.map +0 -1
  210. package/dist/layout-D1-mF4xn.js.map +0 -1
  211. package/dist/layout-Op6GWQ8w.cjs +0 -2
  212. package/dist/layout-Op6GWQ8w.cjs.map +0 -1
  213. package/dist/licensing-DmF0ObpG.cjs +0 -2
  214. package/dist/licensing-DmF0ObpG.cjs.map +0 -1
  215. package/dist/licensing-ZFCUU4Z8.js.map +0 -1
  216. package/dist/media-DbToUupt.cjs +0 -2
  217. package/dist/media-DbToUupt.cjs.map +0 -1
  218. package/dist/media-DdChr0Cw.js +0 -431
  219. package/dist/media-DdChr0Cw.js.map +0 -1
  220. package/dist/utils/commandPaletteFromAppMenu.d.ts +0 -42
@@ -0,0 +1,3454 @@
1
+ import { t as e } from "./theme-DAOU1aPs.js";
2
+ import { $r as t, Ai as n, Ar as r, At as i, Br as a, Cr as o, Dr as s, Ei as c, Fi as l, Fr as u, Gr as d, Hr as f, Ir as p, Jr as m, Kr as h, Li as g, Lr as _, Mr as v, Or as y, Pi as ee, Pr as b, Qr as x, Rr as S, Sr as C, Tr as w, Ur as T, Vr as E, Wr as D, Yr as te, br as O, cn as ne, dn as k, ei as re, en as ie, ii as ae, jr as oe, jt as se, kr as ce, nn as le, pi as ue, qr as A, sn as de, ti as fe, tn as pe, vr as me, wr as he, xr as ge, zr as _e } from "./icons-CfpYxnfg.js";
3
+ import { t as j } from "./cn-YER3QsV1.js";
4
+ import { t as M } from "./MPortal-Ba2Sxset.js";
5
+ import { t as ve } from "./MPopover-Cqz5TsHg.js";
6
+ import { n as N, t as ye } from "./MStack-C4Eocfb5.js";
7
+ import { t as P } from "./MText-CL-LPcXi.js";
8
+ import { t as F } from "./MHeading-B7KgSP4T.js";
9
+ import { t as be } from "./MSubText-C-N15d4Z.js";
10
+ import { r as I, t as L } from "./MButton-C1pnL4_j.js";
11
+ import { t as R } from "./MCheckbox-B7SpcD4H.js";
12
+ import { n as xe, r as z, s as B } from "./MSkeleton-CVofhuDp.js";
13
+ import { t as Se } from "./MModal-DiTjBO8B.js";
14
+ import { t as V } from "./MInputSearch-BBxUF5pw.js";
15
+ import { t as H } from "./MTooltip-jSf4VBtB.js";
16
+ import { i as U, r as W } from "./MDropdownMenu-CeiC1tz3.js";
17
+ import { t as Ce } from "./locale-CS1-IY_I.js";
18
+ import { t as G } from "./MTimeAgo-Db8gOade.js";
19
+ import { n as K, t as we } from "./MAvatarStack-CrhkO_SO.js";
20
+ import { t as Te } from "./MAvatar-D_dVAPaR.js";
21
+ import { a as Ee, c as De, d as Oe, f as ke, i as Ae, l as je, o as Me, p as Ne, r as Pe, s as Fe, t as Ie, u as Le } from "./MTreeView-AqH8XMPz.js";
22
+ import { a as Re, r as ze, t as q } from "./frameworkTexts-BTFyhWFD.js";
23
+ import { t as Be } from "./MTabs-BQZ--mMq.js";
24
+ import { Children as Ve, createContext as He, isValidElement as Ue, useCallback as J, useContext as We, useEffect as Ge, useLayoutEffect as Ke, useMemo as Y, useRef as X, useState as Z } from "react";
25
+ import { Fragment as qe, jsx as Q, jsxs as $ } from "react/jsx-runtime";
26
+ //#region src/components/data/MChat/MChatContext.ts
27
+ var Je = He({});
28
+ function Ye() {
29
+ return We(Je);
30
+ }
31
+ //#endregion
32
+ //#region src/components/data/MChat/MChat.tsx
33
+ function Xe(e, t) {
34
+ return Ue(e) && !!e.type[t];
35
+ }
36
+ function Ze({ variant: e = "inline", open: t, onToggle: n, unreadCount: r, color: a = "primary", className: o, children: s, ...c }) {
37
+ let l = null, u = null, d = [];
38
+ Ve.forEach(s, (e) => {
39
+ if (Xe(e, "__chatHeader")) {
40
+ l = e;
41
+ return;
42
+ }
43
+ if (Xe(e, "__chatConversationList")) {
44
+ u = e;
45
+ return;
46
+ }
47
+ d.push(e);
48
+ });
49
+ let f = Y(() => ({ color: a }), [a]), p = /* @__PURE__ */ Q(Je.Provider, {
50
+ value: f,
51
+ children: /* @__PURE__ */ $("div", {
52
+ className: j("chat", e, `color-${a}`, e === "floating" && t && "open", o),
53
+ ...c,
54
+ children: [u && /* @__PURE__ */ Q("div", {
55
+ className: "chat-sidebar",
56
+ children: u
57
+ }), /* @__PURE__ */ $("div", {
58
+ className: "chat-main",
59
+ children: [l, d]
60
+ })]
61
+ })
62
+ });
63
+ return e === "floating" ? /* @__PURE__ */ Q(M, { children: /* @__PURE__ */ $("div", {
64
+ className: j("chat-floating-wrapper", t && "open"),
65
+ children: [t && p, /* @__PURE__ */ Q(L, {
66
+ variant: "filled",
67
+ color: a,
68
+ shape: "circle",
69
+ size: "lg",
70
+ className: "chat-floating-trigger",
71
+ onClick: n,
72
+ "aria-label": t ? "Close chat" : "Open chat",
73
+ badge: !t && r ? r : void 0,
74
+ badgeColor: "error",
75
+ badgePulsing: !t && !!r,
76
+ children: /* @__PURE__ */ Q(i, {})
77
+ })]
78
+ }) }) : p;
79
+ }
80
+ //#endregion
81
+ //#region src/components/data/MChat/MChatHeader.tsx
82
+ function Qe({ bordered: e = !1, className: t, children: n, ...r }) {
83
+ return /* @__PURE__ */ Q("div", {
84
+ className: j("chat-header", e && "bordered", t),
85
+ ...r,
86
+ children: n
87
+ });
88
+ }
89
+ Qe.__chatHeader = !0;
90
+ //#endregion
91
+ //#region src/components/data/MChat/MChatMessage.tsx
92
+ function $e({ status: e }) {
93
+ if (!e) return null;
94
+ let t = e === "delivered" || e === "read";
95
+ return /* @__PURE__ */ Q("span", {
96
+ className: j("chat-status", e === "read" ? "chat-status-read" : ""),
97
+ "aria-label": e,
98
+ children: t ? "✓✓" : "✓"
99
+ });
100
+ }
101
+ function et({ message: e, showAvatar: t = !0, showTimestamp: n = !0, color: r, className: i, ...a }) {
102
+ let { content: o, sender: s, timestamp: c, status: l, isOwn: u, images: d } = e;
103
+ return /* @__PURE__ */ $("div", {
104
+ className: j("chat-message", u && "own", r || void 0, i),
105
+ ...a,
106
+ children: [t && !u && /* @__PURE__ */ Q(Te, {
107
+ src: s.avatar,
108
+ name: s.name,
109
+ size: "sm",
110
+ color: r,
111
+ className: "chat-message-avatar"
112
+ }), /* @__PURE__ */ $("div", {
113
+ className: "chat-message-content",
114
+ children: [
115
+ !u && /* @__PURE__ */ Q(P, {
116
+ className: "chat-message-sender",
117
+ color: "neutral",
118
+ children: s.name
119
+ }),
120
+ /* @__PURE__ */ $("div", {
121
+ className: "chat-message-bubble",
122
+ children: [o && /* @__PURE__ */ Q(P, { children: o }), d && d.length > 0 && /* @__PURE__ */ Q("div", {
123
+ className: j("chat-message-images", d.length > 1 && "grid"),
124
+ children: d.map((e, t) => /* @__PURE__ */ Q(K, {
125
+ src: e,
126
+ alt: "",
127
+ fit: "cover",
128
+ rounded: !0,
129
+ className: "chat-message-image"
130
+ }, t))
131
+ })]
132
+ }),
133
+ /* @__PURE__ */ $("div", {
134
+ className: "chat-message-meta",
135
+ children: [u && /* @__PURE__ */ Q($e, { status: l }), n && /* @__PURE__ */ Q(be, {
136
+ className: "chat-message-time",
137
+ children: /* @__PURE__ */ Q(G, { value: c })
138
+ })]
139
+ })
140
+ ]
141
+ })]
142
+ });
143
+ }
144
+ //#endregion
145
+ //#region src/components/data/MChat/MChatBody.tsx
146
+ function tt({ messages: e, onScrollTop: t, loading: n = !1, color: r, className: i, children: a, ...o }) {
147
+ let { color: s } = Ye(), c = r ?? s, l = X(null), u = X(!0), d = X(0), f = J(() => {
148
+ let e = l.current;
149
+ e && (e.scrollTop = e.scrollHeight);
150
+ }, []);
151
+ return Ge(() => {
152
+ let t = e?.length ?? 0;
153
+ t > d.current && u.current && f(), d.current = t;
154
+ }, [e?.length, f]), Ge(() => {
155
+ f();
156
+ }, [f]), /* @__PURE__ */ $("div", {
157
+ ref: l,
158
+ className: j("chat-body", i),
159
+ onScroll: () => {
160
+ let e = l.current;
161
+ e && (u.current = e.scrollHeight - e.scrollTop - e.clientHeight < 40, e.scrollTop < 40 && t && !n && t());
162
+ },
163
+ ...o,
164
+ children: [
165
+ n && /* @__PURE__ */ Q("div", {
166
+ className: "chat-body-loader",
167
+ children: /* @__PURE__ */ Q(I, { size: "sm" })
168
+ }),
169
+ e?.map((e) => /* @__PURE__ */ Q(et, {
170
+ message: e,
171
+ color: c
172
+ }, e.id)),
173
+ a
174
+ ]
175
+ });
176
+ }
177
+ //#endregion
178
+ //#region src/components/data/MChat/emojis.ts
179
+ var nt = [
180
+ {
181
+ label: "Smileys",
182
+ emojis: /* @__PURE__ */ "😀.😃.😄.😁.😆.😅.🤣.😂.🙂.😊.😇.🥰.😍.🤩.😘.😗.😋.😛.😜.🤪.😝.🤗.🤔.🫡.🤐.🤨.😐.😑.😶.🫠.😏.😒.🙄.😬.😮‍💨.🤥.😌.😔.😪.🤤.😴.😷.🤒.🤕.🤢.🤮.🤧.🥵.🥶.😵.🤯.🥳.🥸.😎.🤓.🧐".split(".")
183
+ },
184
+ {
185
+ label: "Gestures",
186
+ emojis: /* @__PURE__ */ "👋.🤚.🖐️.✋.🖖.🫱.🫲.👌.🤌.🤏.✌️.🤞.🫰.🤟.🤘.🤙.👈.👉.👆.👇.☝️.👍.👎.✊.👊.🤛.🤜.👏.🙌.🫶.👐.🤝".split(".")
187
+ },
188
+ {
189
+ label: "Hearts",
190
+ emojis: [
191
+ "❤️",
192
+ "🧡",
193
+ "💛",
194
+ "💚",
195
+ "💙",
196
+ "💜",
197
+ "🖤",
198
+ "🤍",
199
+ "🤎",
200
+ "💔",
201
+ "❤️‍🔥",
202
+ "❤️‍🩹",
203
+ "💕",
204
+ "💞",
205
+ "💓",
206
+ "💗",
207
+ "💖",
208
+ "💘",
209
+ "💝",
210
+ "💟"
211
+ ]
212
+ },
213
+ {
214
+ label: "Objects",
215
+ emojis: [
216
+ "🔥",
217
+ "✨",
218
+ "🌟",
219
+ "💫",
220
+ "⚡",
221
+ "💥",
222
+ "🎉",
223
+ "🎊",
224
+ "🏆",
225
+ "🥇",
226
+ "🎯",
227
+ "💡",
228
+ "📌",
229
+ "📎",
230
+ "✅",
231
+ "❌",
232
+ "⭐",
233
+ "💬",
234
+ "👁️‍🗨️",
235
+ "🔔"
236
+ ]
237
+ }
238
+ ], rt = "image/png,image/jpeg,image/gif,image/webp";
239
+ function it({ onSend: e, placeholder: t = "Type a message…", disabled: n = !1, showEmoji: r = !0, showAttach: i = !0, onTyping: a, color: o, className: s, ...l }) {
240
+ let { color: u } = Ye(), d = o ?? u, [f, p] = Z(""), [m, h] = Z(!1), [_, v] = Z([]), [y, ee] = Z([]), [b, x] = Z(!1), S = X(null), C = X(null), w = X(null), T = X(!1), E = X(void 0), D = J((e) => {
241
+ let t = e.filter((e) => e.type.startsWith("image/"));
242
+ t.length !== 0 && (v((e) => [...e, ...t]), t.forEach((e) => {
243
+ let t = URL.createObjectURL(e);
244
+ ee((e) => [...e, t]);
245
+ }));
246
+ }, []), te = J((e) => {
247
+ ee((t) => (URL.revokeObjectURL(t[e]), t.filter((t, n) => n !== e))), v((t) => t.filter((t, n) => n !== e));
248
+ }, []);
249
+ Ge(() => () => y.forEach((e) => URL.revokeObjectURL(e)), []);
250
+ let O = J(() => {
251
+ let t = f.trim();
252
+ !t && _.length === 0 || n || (e?.(t, _.length > 0 ? _ : void 0), p(""), v([]), ee((e) => (e.forEach((e) => URL.revokeObjectURL(e)), [])), S.current && (S.current.style.height = "auto"), T.current && (T.current = !1, a?.(!1)));
253
+ }, [
254
+ f,
255
+ _,
256
+ n,
257
+ e,
258
+ a
259
+ ]), ne = (e) => {
260
+ e.key === "Enter" && !e.shiftKey && (e.preventDefault(), O());
261
+ }, k = (e) => {
262
+ p(e.target.value), re(e.target), a && (T.current || (T.current = !0, a(!0)), clearTimeout(E.current), E.current = setTimeout(() => {
263
+ T.current = !1, a(!1);
264
+ }, 1500));
265
+ }, re = (e) => {
266
+ e.style.height = "auto", e.style.height = Math.min(e.scrollHeight, 120) + "px";
267
+ };
268
+ Ge(() => () => clearTimeout(E.current), []);
269
+ let ie = (e) => {
270
+ p((t) => t + e), h(!1), S.current?.focus();
271
+ }, ae = (e) => {
272
+ e.preventDefault(), x(!0);
273
+ }, oe = (e) => {
274
+ e.preventDefault(), x(!1);
275
+ }, ce = (e) => {
276
+ e.preventDefault(), x(!1), D(Array.from(e.dataTransfer.files));
277
+ }, le = () => {
278
+ let e = w.current?.files;
279
+ e && D(Array.from(e)), w.current && (w.current.value = "");
280
+ }, ue = f.trim() || _.length > 0;
281
+ return /* @__PURE__ */ $("div", {
282
+ className: j("chat-input", b && "drag-over", s),
283
+ onDragOver: ae,
284
+ onDragLeave: oe,
285
+ onDrop: ce,
286
+ ...l,
287
+ children: [y.length > 0 && /* @__PURE__ */ Q("div", {
288
+ className: "chat-input-previews",
289
+ children: y.map((e, t) => /* @__PURE__ */ $("div", {
290
+ className: "chat-input-preview",
291
+ children: [/* @__PURE__ */ Q(K, {
292
+ src: e,
293
+ alt: "",
294
+ fit: "cover",
295
+ rounded: !0,
296
+ className: "chat-input-preview-img"
297
+ }), /* @__PURE__ */ Q("button", {
298
+ type: "button",
299
+ className: "chat-input-preview-remove",
300
+ onClick: () => te(t),
301
+ "aria-label": "Remove image",
302
+ children: /* @__PURE__ */ Q(g, {})
303
+ })]
304
+ }, t))
305
+ }), /* @__PURE__ */ $("div", {
306
+ className: "chat-input-field",
307
+ children: [
308
+ r && /* @__PURE__ */ $(qe, { children: [/* @__PURE__ */ Q("button", {
309
+ ref: C,
310
+ type: "button",
311
+ className: "chat-input-emoji-trigger",
312
+ onClick: () => h((e) => !e),
313
+ "aria-label": "Emoji",
314
+ disabled: n,
315
+ children: "😊"
316
+ }), /* @__PURE__ */ Q(ve, {
317
+ open: m,
318
+ anchorRef: C,
319
+ onClose: () => h(!1),
320
+ placement: "top-start",
321
+ children: /* @__PURE__ */ Q("div", {
322
+ className: "chat-emoji-picker",
323
+ children: nt.map((e) => /* @__PURE__ */ $("div", {
324
+ className: "chat-emoji-category",
325
+ children: [/* @__PURE__ */ Q("div", {
326
+ className: "chat-emoji-category-label",
327
+ children: e.label
328
+ }), /* @__PURE__ */ Q("div", {
329
+ className: "chat-emoji-grid",
330
+ children: e.emojis.map((e) => /* @__PURE__ */ Q("button", {
331
+ type: "button",
332
+ className: "chat-emoji-btn",
333
+ onClick: () => ie(e),
334
+ children: e
335
+ }, e))
336
+ })]
337
+ }, e.label))
338
+ })
339
+ })] }),
340
+ i && /* @__PURE__ */ $(qe, { children: [/* @__PURE__ */ Q("input", {
341
+ ref: w,
342
+ type: "file",
343
+ accept: rt,
344
+ multiple: !0,
345
+ className: "chat-input-file-hidden",
346
+ onChange: le,
347
+ tabIndex: -1
348
+ }), /* @__PURE__ */ Q("button", {
349
+ type: "button",
350
+ className: "chat-input-attach-trigger",
351
+ onClick: () => w.current?.click(),
352
+ "aria-label": "Attach image",
353
+ disabled: n,
354
+ children: /* @__PURE__ */ Q(c, { color: "inherit" })
355
+ })] }),
356
+ /* @__PURE__ */ Q("textarea", {
357
+ ref: S,
358
+ className: "chat-input-textarea",
359
+ value: f,
360
+ onChange: k,
361
+ onKeyDown: ne,
362
+ placeholder: t,
363
+ disabled: n,
364
+ rows: 1
365
+ }),
366
+ /* @__PURE__ */ Q(L, {
367
+ variant: "filled",
368
+ size: "sm",
369
+ color: d ?? "primary",
370
+ iconOnly: !0,
371
+ shape: "circle",
372
+ className: "chat-input-send",
373
+ onClick: O,
374
+ disabled: n || !ue,
375
+ "aria-label": "Send",
376
+ children: /* @__PURE__ */ Q(se, {})
377
+ })
378
+ ]
379
+ })]
380
+ });
381
+ }
382
+ //#endregion
383
+ //#region src/components/data/MChat/MChatTypingIndicator.tsx
384
+ function at({ users: e = [], visible: t = !0, className: n, ...r }) {
385
+ if (!t || e.length === 0) return null;
386
+ let i = e.length === 1 ? `${e[0].name} is typing` : e.length === 2 ? `${e[0].name} and ${e[1].name} are typing` : `${e[0].name} and ${e.length - 1} others are typing`;
387
+ return /* @__PURE__ */ $("div", {
388
+ className: j("chat-typing", n),
389
+ "aria-label": i,
390
+ ...r,
391
+ children: [e.length === 1 && /* @__PURE__ */ Q(Te, {
392
+ src: e[0].avatar,
393
+ name: e[0].name,
394
+ size: "sm",
395
+ className: "chat-typing-avatar"
396
+ }), /* @__PURE__ */ $("div", {
397
+ className: "chat-typing-dots",
398
+ children: [
399
+ /* @__PURE__ */ Q("span", { className: "chat-typing-dot" }),
400
+ /* @__PURE__ */ Q("span", { className: "chat-typing-dot" }),
401
+ /* @__PURE__ */ Q("span", { className: "chat-typing-dot" })
402
+ ]
403
+ })]
404
+ });
405
+ }
406
+ //#endregion
407
+ //#region src/components/data/MChat/MChatConversationList.tsx
408
+ function ot({ className: e, children: t, ...n }) {
409
+ return /* @__PURE__ */ Q("div", {
410
+ className: j("chat-conversation-list", e),
411
+ ...n,
412
+ children: t
413
+ });
414
+ }
415
+ ot.__chatConversationList = !0;
416
+ //#endregion
417
+ //#region src/components/data/MChat/MChatConversationItem.tsx
418
+ function st({ conversation: e, active: t = !1, color: n, onClick: r, className: i, ...a }) {
419
+ let { color: o } = Ye(), s = n ?? o, { title: c, participants: l, lastMessage: u, unreadCount: d } = e, f = c ?? l.map((e) => e.name).join(", "), p = l[0], m = l.some((e) => e.online);
420
+ return /* @__PURE__ */ $("div", {
421
+ className: j("chat-conversation-item", t && "active", i),
422
+ onClick: () => r?.(e),
423
+ role: "button",
424
+ tabIndex: 0,
425
+ onKeyDown: (t) => {
426
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), r?.(e));
427
+ },
428
+ ...a,
429
+ children: [/* @__PURE__ */ Q(Te, {
430
+ src: p?.avatar,
431
+ name: p?.name,
432
+ size: "md",
433
+ color: s,
434
+ badge: m,
435
+ badgeColor: "success",
436
+ className: "chat-conversation-avatar"
437
+ }), /* @__PURE__ */ $("div", {
438
+ className: "chat-conversation-info",
439
+ children: [/* @__PURE__ */ $("div", {
440
+ className: "chat-conversation-top",
441
+ children: [/* @__PURE__ */ Q(P, {
442
+ className: "chat-conversation-name",
443
+ children: f
444
+ }), u && /* @__PURE__ */ Q(be, {
445
+ className: "chat-conversation-time",
446
+ children: /* @__PURE__ */ Q(G, { value: u.timestamp })
447
+ })]
448
+ }), u && /* @__PURE__ */ $("div", {
449
+ className: "chat-conversation-bottom",
450
+ children: [/* @__PURE__ */ $(be, {
451
+ className: "chat-conversation-preview",
452
+ children: [u.isOwn ? "You: " : "", u.content]
453
+ }), !!d && d > 0 && /* @__PURE__ */ Q(B, {
454
+ color: s ?? "primary",
455
+ size: "sm",
456
+ rounded: !0,
457
+ children: d
458
+ })]
459
+ })]
460
+ })]
461
+ });
462
+ }
463
+ //#endregion
464
+ //#region src/components/data/MTaskList/MTaskList.tsx
465
+ function ct({ items: e, color: t = "primary", strikethrough: n = !0, onChange: r, className: i, ...a }) {
466
+ return /* @__PURE__ */ Q("div", {
467
+ className: j("task list", `color-${t}`, i),
468
+ role: "list",
469
+ ...a,
470
+ children: e.map((e) => /* @__PURE__ */ $("div", {
471
+ className: j("task item", e.checked && "checked", e.disabled && "disabled"),
472
+ role: "listitem",
473
+ onClick: (t) => {
474
+ e.disabled || t.target.closest(".checkbox") || r?.(e.id, !(e.checked ?? !1));
475
+ },
476
+ children: [/* @__PURE__ */ Q(R, {
477
+ className: "task control",
478
+ checked: e.checked ?? !1,
479
+ color: t,
480
+ size: "sm",
481
+ disabled: e.disabled,
482
+ onChange: (t) => r?.(e.id, t.target.checked),
483
+ clickEffect: "ripple"
484
+ }), /* @__PURE__ */ Q("span", {
485
+ className: j("task label", e.checked && n && "done"),
486
+ children: e.label
487
+ })]
488
+ }, e.id))
489
+ });
490
+ }
491
+ //#endregion
492
+ //#region src/components/data/MTimelineCalendar/MTimelineCalendar.helpers.ts
493
+ var lt = 36e5, ut = 6e4, dt = 24 * lt;
494
+ function ft() {
495
+ return typeof window > "u" ? 960 : Math.max(320, Math.min(1600, window.innerWidth - 200));
496
+ }
497
+ function pt(e) {
498
+ return e instanceof Date ? e : new Date(e);
499
+ }
500
+ function mt(e) {
501
+ if (!e) return null;
502
+ let t = /^(\d{1,2}):(\d{2})$/.exec(e);
503
+ return t ? Number(t[1]) * 60 + Number(t[2]) : null;
504
+ }
505
+ function ht(e) {
506
+ let t = new Date(e);
507
+ return t.setHours(0, 0, 0, 0), t;
508
+ }
509
+ function gt(e, t) {
510
+ let n = new Date(e);
511
+ return n.setDate(n.getDate() + t), n;
512
+ }
513
+ function _t(e, t) {
514
+ return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
515
+ }
516
+ function vt(e, t) {
517
+ return new Intl.DateTimeFormat(t, {
518
+ hour: "2-digit",
519
+ minute: "2-digit",
520
+ hour12: !1
521
+ }).format(e);
522
+ }
523
+ function yt(e, t) {
524
+ return new Intl.DateTimeFormat(t, {
525
+ weekday: "short",
526
+ day: "2-digit",
527
+ month: "short"
528
+ }).format(e);
529
+ }
530
+ function bt(e, t) {
531
+ return new Intl.DateTimeFormat(t, { weekday: "short" }).format(e);
532
+ }
533
+ function xt(e, t, n) {
534
+ return `${vt(e, n)} – ${vt(t, n)}`;
535
+ }
536
+ function St(e, t) {
537
+ return new Intl.DateTimeFormat(t, {
538
+ weekday: "long",
539
+ day: "numeric",
540
+ month: "long",
541
+ year: "numeric"
542
+ }).format(e);
543
+ }
544
+ function Ct(e, t) {
545
+ let n = [], r = [], i = new Map(e.map((e, t) => [e, t]));
546
+ return e.forEach((e) => {
547
+ let a = i.get(e) ?? 0, o = t.filter((t) => t.rowId === e).map((e) => ({
548
+ event: e,
549
+ startMs: pt(e.startAt).getTime(),
550
+ endMs: pt(e.endAt).getTime()
551
+ })).filter((e) => e.endMs > e.startMs).sort((e, t) => e.startMs - t.startMs);
552
+ o.forEach((e, t) => {
553
+ let r = !1;
554
+ for (let n = 0; n < o.length; n += 1) if (n !== t && o[n].startMs < e.endMs && o[n].endMs > e.startMs) {
555
+ r = !0;
556
+ break;
557
+ }
558
+ n.push({
559
+ event: e.event,
560
+ startMs: e.startMs,
561
+ endMs: e.endMs,
562
+ rowIndex: a,
563
+ overlapping: r
564
+ });
565
+ });
566
+ let s = [];
567
+ o.forEach((e) => {
568
+ s.push({
569
+ time: e.startMs,
570
+ delta: 1
571
+ }), s.push({
572
+ time: e.endMs,
573
+ delta: -1
574
+ });
575
+ }), s.sort((e, t) => e.time - t.time || e.delta - t.delta);
576
+ let c = 0, l = null, u = 0;
577
+ s.forEach((e) => {
578
+ let t = c;
579
+ c += e.delta, t < 2 && c >= 2 ? (l = e.time, u = c) : t >= 2 && c >= 2 ? u = Math.max(u, c) : t >= 2 && c < 2 && l !== null && (r.push({
580
+ rowIndex: a,
581
+ startMs: l,
582
+ endMs: e.time,
583
+ count: u
584
+ }), l = null, u = 0);
585
+ });
586
+ }), {
587
+ positioned: n,
588
+ bands: r
589
+ };
590
+ }
591
+ function wt(e, t, n) {
592
+ let r = null, i = null;
593
+ return e.forEach((e) => {
594
+ e.endMs <= t ? (!r || e.endMs > r.targetMs) && (r = {
595
+ direction: "before",
596
+ targetMs: e.startMs,
597
+ daysAway: Math.floor((t - e.endMs) / dt) + 1
598
+ }) : e.startMs >= n && (!i || e.startMs < i.targetMs) && (i = {
599
+ direction: "after",
600
+ targetMs: e.startMs,
601
+ daysAway: Math.floor((e.startMs - n) / dt) + 1
602
+ });
603
+ }), {
604
+ before: r,
605
+ after: i
606
+ };
607
+ }
608
+ function Tt(e, t, n) {
609
+ let r = [
610
+ 5,
611
+ 10,
612
+ 15,
613
+ 30,
614
+ 60,
615
+ 120,
616
+ 180,
617
+ 240,
618
+ 360,
619
+ 720,
620
+ 1440
621
+ ], i = 60 / n * 96, a = r.find((e) => e >= i) ?? r[r.length - 1], o = a * ut, s = Math.ceil(e / o) * o, c = [];
622
+ for (let e = s; e <= t; e += o) {
623
+ let t = new Date(e), n = t.getHours() === 0 && t.getMinutes() === 0, r = n || a >= 60;
624
+ c.push({
625
+ time: e,
626
+ major: r,
627
+ isDayBoundary: n
628
+ });
629
+ }
630
+ return c;
631
+ }
632
+ function Et(e, t, n, r) {
633
+ if (e === null || t === null || t <= e) return [];
634
+ let i = ht(new Date(n)), a = [];
635
+ for (let o = i.getTime() - dt; o <= r + dt; o += dt) {
636
+ let i = o + e * ut, s = o + t * ut;
637
+ s < n || i > r || a.push({
638
+ startMs: i,
639
+ endMs: s
640
+ });
641
+ }
642
+ return a;
643
+ }
644
+ //#endregion
645
+ //#region src/components/data/MTimelineCalendar/DayStrip.tsx
646
+ function Dt({ centerAt: e, now: t, locale: n, days: r, conflictDayKeys: i, onSelectDay: a, onStep: o }) {
647
+ let s = Y(() => {
648
+ let t = ht(e), n = [];
649
+ for (let e = -r; e <= r; e += 1) n.push(gt(t, e));
650
+ return n;
651
+ }, [e, r]);
652
+ return /* @__PURE__ */ $("div", {
653
+ className: "mtimeline-day-strip",
654
+ role: "tablist",
655
+ "aria-label": "Day navigator",
656
+ children: [
657
+ /* @__PURE__ */ Q(L, {
658
+ size: "sm",
659
+ variant: "outlined",
660
+ color: "neutral",
661
+ iconOnly: !0,
662
+ "aria-label": "Previous day",
663
+ className: "mtimeline-day-arrow",
664
+ startIcon: /* @__PURE__ */ Q(l, { size: 16 }),
665
+ onClick: () => o(-1)
666
+ }),
667
+ /* @__PURE__ */ Q("div", {
668
+ className: "mtimeline-day-strip-track",
669
+ children: s.map((r) => {
670
+ let o = _t(r, e), s = _t(r, t), c = r.toISOString().slice(0, 10), l = i.has(c);
671
+ return /* @__PURE__ */ $("button", {
672
+ type: "button",
673
+ role: "tab",
674
+ "aria-selected": o,
675
+ className: j("mtimeline-day-cell", o && "active", s && "today", l && "has-conflict"),
676
+ onClick: () => a(r),
677
+ children: [
678
+ /* @__PURE__ */ Q("span", {
679
+ className: "mtimeline-day-cell-weekday",
680
+ children: bt(r, n)
681
+ }),
682
+ /* @__PURE__ */ Q("span", {
683
+ className: "mtimeline-day-cell-number",
684
+ children: r.getDate()
685
+ }),
686
+ l && /* @__PURE__ */ Q("span", {
687
+ className: "mtimeline-day-cell-dot",
688
+ "aria-hidden": "true"
689
+ })
690
+ ]
691
+ }, c);
692
+ })
693
+ }),
694
+ /* @__PURE__ */ Q(L, {
695
+ size: "sm",
696
+ variant: "outlined",
697
+ color: "neutral",
698
+ iconOnly: !0,
699
+ "aria-label": "Next day",
700
+ className: "mtimeline-day-arrow",
701
+ startIcon: /* @__PURE__ */ Q(ee, { size: 16 }),
702
+ onClick: () => o(1)
703
+ })
704
+ ]
705
+ });
706
+ }
707
+ //#endregion
708
+ //#region src/components/data/MTimelineCalendar/EventPopover.tsx
709
+ function Ot({ event: e, locale: t, startMs: n, endMs: r, rowLabel: i, overlapping: a, eventActionsLabel: o, menuItems: s, renderDetails: c, onLeaderClick: l, onParticipantClick: u, onClose: d }) {
710
+ let f = new Date(n), p = new Date(r), m = e.leader, h = !!(l && m), g = m ? /* @__PURE__ */ $(qe, { children: [/* @__PURE__ */ Q(Te, {
711
+ size: "md",
712
+ src: m.avatar,
713
+ name: m.name,
714
+ backgroundColor: m.color
715
+ }), /* @__PURE__ */ $("div", {
716
+ className: "mtimeline-popover-leader-text",
717
+ children: [/* @__PURE__ */ Q(P, {
718
+ size: "sm",
719
+ weight: "semibold",
720
+ children: m.name
721
+ }), m.role ? /* @__PURE__ */ Q(P, {
722
+ size: "xs",
723
+ tone: "muted",
724
+ children: m.role
725
+ }) : null]
726
+ })] }) : null;
727
+ return /* @__PURE__ */ Q(xe, {
728
+ className: "mtimeline-popover-card",
729
+ outlined: !1,
730
+ children: /* @__PURE__ */ Q(z, { children: /* @__PURE__ */ $("div", {
731
+ className: "mtimeline-popover",
732
+ children: [
733
+ /* @__PURE__ */ $("div", {
734
+ className: "mtimeline-popover-head",
735
+ children: [
736
+ /* @__PURE__ */ Q("div", {
737
+ className: "mtimeline-popover-accent",
738
+ style: e.color ? { "--mineral-timeline-event-color": e.color } : void 0,
739
+ "aria-hidden": "true"
740
+ }),
741
+ /* @__PURE__ */ $("div", {
742
+ className: "mtimeline-popover-titles",
743
+ children: [/* @__PURE__ */ Q(F, {
744
+ level: 5,
745
+ children: e.title ?? xt(f, p, t)
746
+ }), /* @__PURE__ */ Q(P, {
747
+ size: "xs",
748
+ tone: "muted",
749
+ children: i
750
+ })]
751
+ }),
752
+ s.length > 0 && /* @__PURE__ */ Q(U, {
753
+ placement: "bottom-end",
754
+ trigger: /* @__PURE__ */ Q(L, {
755
+ size: "sm",
756
+ variant: "ghost",
757
+ color: "neutral",
758
+ iconOnly: !0,
759
+ "aria-label": o,
760
+ startIcon: /* @__PURE__ */ Q(de, {})
761
+ }),
762
+ children: s.map((t) => t.href ? /* @__PURE__ */ Q(W, {
763
+ icon: t.icon,
764
+ label: t.label,
765
+ href: t.href,
766
+ color: t.color,
767
+ disabled: t.disabled
768
+ }, t.id) : /* @__PURE__ */ Q(W, {
769
+ icon: t.icon,
770
+ label: t.label,
771
+ color: t.color,
772
+ disabled: t.disabled,
773
+ onClick: () => {
774
+ t.onSelect?.(e), d();
775
+ }
776
+ }, t.id))
777
+ })
778
+ ]
779
+ }),
780
+ /* @__PURE__ */ $("div", {
781
+ className: "mtimeline-popover-meta",
782
+ children: [/* @__PURE__ */ $(P, {
783
+ size: "sm",
784
+ children: [
785
+ St(f, t),
786
+ " · ",
787
+ xt(f, p, t)
788
+ ]
789
+ }), a && /* @__PURE__ */ $(B, {
790
+ color: "warning",
791
+ size: "sm",
792
+ children: [/* @__PURE__ */ Q(ue, { size: 12 }), " Conflict"]
793
+ })]
794
+ }),
795
+ e.location && /* @__PURE__ */ Q(P, {
796
+ size: "sm",
797
+ tone: "muted",
798
+ children: e.location
799
+ }),
800
+ e.description && /* @__PURE__ */ Q(P, {
801
+ size: "sm",
802
+ tone: "muted",
803
+ children: e.description
804
+ }),
805
+ m && (h ? /* @__PURE__ */ Q("button", {
806
+ type: "button",
807
+ className: "mtimeline-popover-leader interactive",
808
+ onClick: () => {
809
+ l?.(m, e), d();
810
+ },
811
+ children: g
812
+ }) : /* @__PURE__ */ Q("div", {
813
+ className: "mtimeline-popover-leader",
814
+ children: g
815
+ })),
816
+ e.participants && e.participants.length > 0 && /* @__PURE__ */ $("div", {
817
+ className: "mtimeline-popover-participants",
818
+ children: [/* @__PURE__ */ $(P, {
819
+ size: "xs",
820
+ tone: "muted",
821
+ weight: "semibold",
822
+ children: [
823
+ "Participants (",
824
+ e.participants.length,
825
+ e.capacity ? ` / ${e.capacity}` : null,
826
+ ")"
827
+ ]
828
+ }), /* @__PURE__ */ Q(we, {
829
+ items: e.participants.map((t, n) => ({
830
+ id: t.id ?? `${t.name}-${n}`,
831
+ name: t.name,
832
+ description: t.role,
833
+ avatar: t.avatar,
834
+ backgroundColor: t.color,
835
+ onClick: u ? () => {
836
+ u(t, e), d();
837
+ } : void 0
838
+ })),
839
+ max: e.capacity ?? 8,
840
+ size: "sm"
841
+ })]
842
+ }),
843
+ c ? /* @__PURE__ */ Q("div", {
844
+ className: "mtimeline-popover-extra",
845
+ children: c(e)
846
+ }) : null
847
+ ]
848
+ }) })
849
+ });
850
+ }
851
+ //#endregion
852
+ //#region src/components/data/MTimelineCalendar/MTimelineCalendar.tsx
853
+ function kt({ rows: e, events: t, centerAt: n, defaultCenterAt: r, pixelsPerHour: i = 96, rowLabelWidth: a = 168, rowHeight: o = 56, headerHeight: s = 56, dayStripHeight: c = 56, dayStripDays: u = 14, workdayStart: d, workdayEnd: f, showNowLine: p = !0, showDayStrip: m = !0, overlapHighlight: h = !0, panKeyStepMinutes: g = 30, locale: _, emptyStateText: v, height: y, fullHeight: b = !0, eventMenuItems: x, renderEventDetails: S, eventActionsLabel: C = "Event actions", onEventClick: w, onEventOpen: T, onLeaderClick: E, onParticipantClick: D, onCenterChange: te, onRangeChange: O, rangeBufferRatio: ne = 1, rangeChangeDebounceMs: k = 200, loading: re, className: ie, style: ae, ...oe }) {
854
+ let se = Ce(_), ce = n !== void 0, [le, A] = Z(() => r ?? /* @__PURE__ */ new Date()), [de, fe] = Z(() => ft()), [pe, me] = Z(null), [he, ge] = Z(() => /* @__PURE__ */ new Date()), _e = X(null), M = X(/* @__PURE__ */ new Map()), N = X(null), ye = X(null), F = X(null), be = X(null);
855
+ Ge(() => {
856
+ ce && n && A(n);
857
+ }, [ce, n]), Ke(() => {
858
+ let e = _e.current;
859
+ if (!e) return;
860
+ let t = () => {
861
+ let t = e.getBoundingClientRect();
862
+ t.width > 0 && fe(t.width);
863
+ };
864
+ t();
865
+ let n = null;
866
+ typeof window < "u" && (n = window.requestAnimationFrame(t));
867
+ let r = null;
868
+ return typeof ResizeObserver < "u" && (r = new ResizeObserver((e) => {
869
+ let t = e[0];
870
+ t && t.contentRect.width > 0 && fe(t.contentRect.width);
871
+ }), r.observe(e)), () => {
872
+ n !== null && typeof window < "u" && window.cancelAnimationFrame(n), r?.disconnect();
873
+ };
874
+ }, []), Ge(() => {
875
+ if (!p) return;
876
+ let e = () => ge(/* @__PURE__ */ new Date());
877
+ return e(), ye.current = window.setInterval(e, 3e4), () => {
878
+ ye.current !== null && window.clearInterval(ye.current);
879
+ };
880
+ }, [p]);
881
+ let I = ce ? n ?? le : le, R = i, xe = R / lt, z = J((e) => {
882
+ ce || A(e), te?.(e);
883
+ }, [ce, te]), B = e.length * o, Se = Math.max(de, 320) / 2 / xe, V = I.getTime() - Se, H = I.getTime() + Se, U = Se * 2 * Math.max(0, ne), { positioned: W, bands: G } = Y(() => Ct(e.map((e) => e.id), t), [e, t]), K = Y(() => W.filter((e) => e.endMs > V && e.startMs < H), [
884
+ W,
885
+ V,
886
+ H
887
+ ]), we = Y(() => h ? G.filter((e) => e.endMs > V && e.startMs < H) : [], [
888
+ G,
889
+ h,
890
+ V,
891
+ H
892
+ ]), Ee = Y(() => wt(G, V, H), [
893
+ G,
894
+ V,
895
+ H
896
+ ]), De = Y(() => {
897
+ let e = /* @__PURE__ */ new Set();
898
+ return G.forEach((t) => {
899
+ let n = ht(new Date(t.startMs));
900
+ e.add(n.toISOString().slice(0, 10));
901
+ }), e;
902
+ }, [G]), Oe = Y(() => Tt(V, H, R), [
903
+ V,
904
+ H,
905
+ R
906
+ ]), ke = Y(() => Et(mt(d), mt(f), V, H), [
907
+ d,
908
+ f,
909
+ V,
910
+ H
911
+ ]), Ae = (e) => (e - V) * xe;
912
+ Ge(() => {
913
+ if (!O) return;
914
+ let e = Math.round(V), t = Math.round(H), n = be.current;
915
+ if (!(n && n.startMs === e && n.endMs === t)) return F.current !== null && window.clearTimeout(F.current), F.current = window.setTimeout(() => {
916
+ let n = {
917
+ visibleStart: new Date(V),
918
+ visibleEnd: new Date(H),
919
+ bufferStart: new Date(V - U),
920
+ bufferEnd: new Date(H + U),
921
+ pixelsPerHour: R
922
+ };
923
+ be.current = {
924
+ startMs: e,
925
+ endMs: t
926
+ }, O(n);
927
+ }, Math.max(0, k)), () => {
928
+ F.current !== null && (window.clearTimeout(F.current), F.current = null);
929
+ };
930
+ }, [
931
+ V,
932
+ H,
933
+ U,
934
+ R,
935
+ O,
936
+ k
937
+ ]);
938
+ let je = J((e) => {
939
+ let t = new Date(e);
940
+ t.setHours(12, 0, 0, 0), z(t);
941
+ }, [z]), Me = J((e) => z(gt(I, e)), [I, z]), Ne = J((e) => {
942
+ let t = ht(new Date(e));
943
+ t.setHours(12, 0, 0, 0), z(t);
944
+ }, [z]), Pe = (e) => {
945
+ if (e.button !== 0 && e.pointerType === "mouse") return;
946
+ let t = e.target;
947
+ if (t.closest(".mtimeline-event") || t.closest(".mtimeline-conflict-marker") || t.closest(".mtimeline-loading")) return;
948
+ let n = _e.current;
949
+ n && (n.setPointerCapture(e.pointerId), N.current = {
950
+ pointerId: e.pointerId,
951
+ startX: e.clientX,
952
+ centerAtMs: I.getTime(),
953
+ moved: !1
954
+ });
955
+ }, Fe = (e) => {
956
+ let t = N.current;
957
+ if (!t || t.pointerId !== e.pointerId) return;
958
+ let n = e.clientX - t.startX;
959
+ Math.abs(n) > 3 && (t.moved = !0);
960
+ let r = n / xe;
961
+ z(new Date(t.centerAtMs - r));
962
+ }, Ie = (e) => {
963
+ let t = N.current;
964
+ if (t && t.pointerId === e.pointerId) {
965
+ let t = _e.current;
966
+ t && t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), N.current = null;
967
+ }
968
+ }, Le = (e) => {
969
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
970
+ e.preventDefault();
971
+ let t = e.key === "ArrowLeft" ? -1 : 1;
972
+ if (e.shiftKey) {
973
+ Me(t);
974
+ return;
975
+ }
976
+ let n = g * ut;
977
+ z(new Date(I.getTime() + t * n));
978
+ } else e.key === "Home" && (e.preventDefault(), z(/* @__PURE__ */ new Date()));
979
+ }, Re = {
980
+ ...ae,
981
+ "--mineral-timeline-row-height": `${o}px`,
982
+ "--mineral-timeline-row-label-width": `${a}px`,
983
+ "--mineral-timeline-header-height": `${s}px`,
984
+ "--mineral-timeline-day-strip-height": `${c}px`
985
+ };
986
+ y !== void 0 && (Re.height = typeof y == "number" ? `${y}px` : y);
987
+ let ze = t.length === 0, q = pe ? W.find((e) => e.event.id === pe) ?? null : null, Be = {
988
+ get current() {
989
+ return pe ? M.current.get(pe) ?? null : null;
990
+ },
991
+ set current(e) {}
992
+ }, Ve = q ? e[q.rowIndex]?.label ?? "" : "", He = q && x ? x(q.event) : [];
993
+ return /* @__PURE__ */ $("div", {
994
+ className: j("mtimeline", b && "full-height", ie),
995
+ style: Re,
996
+ ...oe,
997
+ children: [
998
+ m && /* @__PURE__ */ Q(Dt, {
999
+ centerAt: I,
1000
+ now: he,
1001
+ locale: se,
1002
+ days: u,
1003
+ conflictDayKeys: De,
1004
+ onSelectDay: je,
1005
+ onStep: Me
1006
+ }),
1007
+ /* @__PURE__ */ $("div", {
1008
+ className: "mtimeline-body",
1009
+ children: [/* @__PURE__ */ $("div", {
1010
+ className: "mtimeline-rail",
1011
+ children: [/* @__PURE__ */ Q("div", {
1012
+ className: "mtimeline-rail-header",
1013
+ "aria-hidden": "true",
1014
+ children: /* @__PURE__ */ Q(P, {
1015
+ size: "xs",
1016
+ tone: "muted",
1017
+ children: yt(I, se)
1018
+ })
1019
+ }), /* @__PURE__ */ Q("div", {
1020
+ className: "mtimeline-rail-rows",
1021
+ style: { height: `${B}px` },
1022
+ children: e.map((e) => /* @__PURE__ */ $("div", {
1023
+ className: "mtimeline-rail-row",
1024
+ style: { height: `${o}px` },
1025
+ children: [e.avatar || e.icon ? /* @__PURE__ */ Q("span", {
1026
+ className: "mtimeline-rail-avatar",
1027
+ style: e.color ? { "--mineral-timeline-row-accent": e.color } : void 0,
1028
+ children: e.avatar ? /* @__PURE__ */ Q(Te, {
1029
+ size: "sm",
1030
+ src: e.avatar,
1031
+ name: e.label
1032
+ }) : e.icon
1033
+ }) : null, /* @__PURE__ */ $("span", {
1034
+ className: "mtimeline-rail-text",
1035
+ children: [/* @__PURE__ */ Q(P, {
1036
+ size: "sm",
1037
+ weight: "semibold",
1038
+ children: e.label
1039
+ }), e.sublabel ? /* @__PURE__ */ Q(P, {
1040
+ size: "xs",
1041
+ tone: "muted",
1042
+ children: e.sublabel
1043
+ }) : null]
1044
+ })]
1045
+ }, e.id))
1046
+ })]
1047
+ }), /* @__PURE__ */ $("div", {
1048
+ ref: _e,
1049
+ className: "mtimeline-viewport",
1050
+ role: "region",
1051
+ "aria-label": "Timeline",
1052
+ tabIndex: 0,
1053
+ "data-mtimeline-viewport-width": Math.round(de),
1054
+ "data-mtimeline-tick-count": Oe.length,
1055
+ "data-mtimeline-event-count": K.length,
1056
+ onPointerDown: Pe,
1057
+ onPointerMove: Fe,
1058
+ onPointerUp: Ie,
1059
+ onPointerCancel: Ie,
1060
+ onKeyDown: Le,
1061
+ children: [
1062
+ /* @__PURE__ */ $("div", {
1063
+ className: "mtimeline-header",
1064
+ children: [ke.map((e, t) => /* @__PURE__ */ Q("span", {
1065
+ className: "mtimeline-workday-marker",
1066
+ style: {
1067
+ left: `${Ae(e.startMs)}px`,
1068
+ width: `${(e.endMs - e.startMs) * xe}px`
1069
+ },
1070
+ "aria-hidden": "true"
1071
+ }, `workday-${t}`)), Oe.map((e) => {
1072
+ let t = new Date(e.time);
1073
+ return /* @__PURE__ */ Q("div", {
1074
+ className: j("mtimeline-tick", e.major && "major", e.isDayBoundary && "day-boundary"),
1075
+ style: { left: `${Ae(e.time)}px` },
1076
+ children: /* @__PURE__ */ Q("span", {
1077
+ className: "mtimeline-tick-label",
1078
+ children: e.isDayBoundary ? yt(t, se) : new Intl.DateTimeFormat(se, {
1079
+ hour: "2-digit",
1080
+ minute: "2-digit",
1081
+ hour12: !1
1082
+ }).format(t)
1083
+ })
1084
+ }, e.time);
1085
+ })]
1086
+ }),
1087
+ /* @__PURE__ */ $("div", {
1088
+ className: "mtimeline-canvas",
1089
+ style: { height: `${B}px` },
1090
+ children: [
1091
+ ke.map((e, t) => /* @__PURE__ */ Q("span", {
1092
+ className: "mtimeline-workday-band",
1093
+ style: {
1094
+ left: `${Ae(e.startMs)}px`,
1095
+ width: `${(e.endMs - e.startMs) * xe}px`
1096
+ },
1097
+ "aria-hidden": "true"
1098
+ }, `workday-canvas-${t}`)),
1099
+ Oe.map((e) => /* @__PURE__ */ Q("span", {
1100
+ className: j("mtimeline-gridline", e.major && "major", e.isDayBoundary && "day-boundary"),
1101
+ style: { left: `${Ae(e.time)}px` },
1102
+ "aria-hidden": "true"
1103
+ }, `gridline-${e.time}`)),
1104
+ e.map((e, t) => /* @__PURE__ */ Q("span", {
1105
+ className: "mtimeline-row-line",
1106
+ style: { top: `${(t + 1) * o}px` },
1107
+ "aria-hidden": "true"
1108
+ }, `row-line-${t}`)),
1109
+ K.map((e) => {
1110
+ let t = Ae(e.startMs), n = Math.max(2, (e.endMs - e.startMs) * xe), r = e.rowIndex * o + 6, i = o - 12, a = e.event.color, s = pe === e.event.id;
1111
+ return /* @__PURE__ */ $("button", {
1112
+ ref: (t) => {
1113
+ t ? M.current.set(e.event.id, t) : M.current.delete(e.event.id);
1114
+ },
1115
+ type: "button",
1116
+ className: j("mtimeline-event", e.overlapping && "overlapping", s && "active"),
1117
+ style: {
1118
+ left: `${t}px`,
1119
+ width: `${n}px`,
1120
+ top: `${r}px`,
1121
+ height: `${i}px`,
1122
+ ...a ? { "--mineral-timeline-event-color": a } : null
1123
+ },
1124
+ onClick: (t) => {
1125
+ N.current?.moved || (t.stopPropagation(), e.event.onClick?.(e.event), w?.(e.event), me(e.event.id), T?.(e.event));
1126
+ },
1127
+ title: e.event.title ? `${e.event.title} · ${xt(new Date(e.startMs), new Date(e.endMs), se)}` : xt(new Date(e.startMs), new Date(e.endMs), se),
1128
+ children: [
1129
+ /* @__PURE__ */ Q("span", {
1130
+ className: "mtimeline-event-time",
1131
+ children: xt(new Date(e.startMs), new Date(e.endMs), se)
1132
+ }),
1133
+ e.event.title ? /* @__PURE__ */ Q("span", {
1134
+ className: "mtimeline-event-title",
1135
+ children: e.event.title
1136
+ }) : null,
1137
+ e.event.icon ? /* @__PURE__ */ Q("span", {
1138
+ className: "mtimeline-event-icon",
1139
+ children: e.event.icon
1140
+ }) : null
1141
+ ]
1142
+ }, e.event.id);
1143
+ }),
1144
+ we.map((e, t) => /* @__PURE__ */ Q("span", {
1145
+ className: "mtimeline-overlap",
1146
+ role: "note",
1147
+ style: {
1148
+ left: `${Ae(e.startMs)}px`,
1149
+ width: `${Math.max(2, (e.endMs - e.startMs) * xe)}px`,
1150
+ top: `${e.rowIndex * o}px`,
1151
+ height: `${o}px`
1152
+ },
1153
+ title: `${e.count} overlapping events`,
1154
+ children: /* @__PURE__ */ Q("span", {
1155
+ className: "mtimeline-overlap-icon",
1156
+ "aria-hidden": "true",
1157
+ children: /* @__PURE__ */ Q(ue, { size: 12 })
1158
+ })
1159
+ }, `overlap-${t}`)),
1160
+ p ? /* @__PURE__ */ Q("span", {
1161
+ className: "mtimeline-now",
1162
+ style: { left: `${Ae(he.getTime())}px` },
1163
+ "aria-hidden": "true"
1164
+ }) : null
1165
+ ]
1166
+ }),
1167
+ (() => {
1168
+ let e = Ee.before;
1169
+ return e ? /* @__PURE__ */ $(L, {
1170
+ size: "sm",
1171
+ variant: "outlined",
1172
+ color: "warning",
1173
+ shape: "circle",
1174
+ className: "mtimeline-conflict-marker before",
1175
+ onPointerDown: (e) => e.stopPropagation(),
1176
+ onClick: (t) => {
1177
+ t.stopPropagation(), Ne(e.targetMs);
1178
+ },
1179
+ startIcon: /* @__PURE__ */ Q(l, { size: 14 }),
1180
+ title: `Conflict ${e.daysAway} day(s) earlier`,
1181
+ children: [/* @__PURE__ */ Q(ue, { size: 12 }), /* @__PURE__ */ $("span", {
1182
+ className: "mtimeline-conflict-marker-label",
1183
+ children: [e.daysAway, "d"]
1184
+ })]
1185
+ }) : null;
1186
+ })(),
1187
+ (() => {
1188
+ let e = Ee.after;
1189
+ return e ? /* @__PURE__ */ $(L, {
1190
+ size: "sm",
1191
+ variant: "outlined",
1192
+ color: "warning",
1193
+ shape: "circle",
1194
+ className: "mtimeline-conflict-marker after",
1195
+ onPointerDown: (e) => e.stopPropagation(),
1196
+ onClick: (t) => {
1197
+ t.stopPropagation(), Ne(e.targetMs);
1198
+ },
1199
+ endIcon: /* @__PURE__ */ Q(ee, { size: 14 }),
1200
+ title: `Conflict in ${e.daysAway} day(s)`,
1201
+ children: [/* @__PURE__ */ $("span", {
1202
+ className: "mtimeline-conflict-marker-label",
1203
+ children: [e.daysAway, "d"]
1204
+ }), /* @__PURE__ */ Q(ue, { size: 12 })]
1205
+ }) : null;
1206
+ })(),
1207
+ ze ? /* @__PURE__ */ Q("div", {
1208
+ className: "mtimeline-empty",
1209
+ children: /* @__PURE__ */ Q(P, {
1210
+ size: "sm",
1211
+ tone: "muted",
1212
+ children: v ?? "No events to show"
1213
+ })
1214
+ }) : null,
1215
+ re ? /* @__PURE__ */ $("div", {
1216
+ className: "mtimeline-loading",
1217
+ "aria-live": "polite",
1218
+ children: [/* @__PURE__ */ Q("span", {
1219
+ className: "mtimeline-loading-dot",
1220
+ "aria-hidden": "true"
1221
+ }), /* @__PURE__ */ Q(P, {
1222
+ size: "xs",
1223
+ tone: "muted",
1224
+ children: "Loading…"
1225
+ })]
1226
+ }) : null
1227
+ ]
1228
+ })]
1229
+ }),
1230
+ /* @__PURE__ */ Q(ve, {
1231
+ open: q !== null,
1232
+ anchorRef: Be,
1233
+ onClose: () => me(null),
1234
+ placement: "bottom-start",
1235
+ children: q && /* @__PURE__ */ Q(Ot, {
1236
+ event: q.event,
1237
+ locale: se,
1238
+ startMs: q.startMs,
1239
+ endMs: q.endMs,
1240
+ rowLabel: Ve,
1241
+ overlapping: q.overlapping,
1242
+ eventActionsLabel: C,
1243
+ menuItems: He,
1244
+ renderDetails: S,
1245
+ onLeaderClick: E,
1246
+ onParticipantClick: D,
1247
+ onClose: () => me(null)
1248
+ })
1249
+ })
1250
+ ]
1251
+ });
1252
+ }
1253
+ //#endregion
1254
+ //#region src/components/data/MFileManager/MFileManager.tsx
1255
+ var At = {
1256
+ pdf: /* @__PURE__ */ Q(re, {}),
1257
+ ts: /* @__PURE__ */ Q(T, {}),
1258
+ tsx: /* @__PURE__ */ Q(D, {}),
1259
+ js: /* @__PURE__ */ Q(oe, {}),
1260
+ jsx: /* @__PURE__ */ Q(x, {}),
1261
+ css: /* @__PURE__ */ Q(he, {}),
1262
+ scss: /* @__PURE__ */ Q(he, {}),
1263
+ html: /* @__PURE__ */ Q(ce, {}),
1264
+ json: /* @__PURE__ */ Q(v, {}),
1265
+ md: /* @__PURE__ */ Q(b, {}),
1266
+ txt: /* @__PURE__ */ Q(d, {}),
1267
+ csv: /* @__PURE__ */ Q(w, {}),
1268
+ zip: /* @__PURE__ */ Q(te, {}),
1269
+ rar: /* @__PURE__ */ Q(E, {}),
1270
+ svg: /* @__PURE__ */ Q(f, {}),
1271
+ png: /* @__PURE__ */ Q(_e, {}),
1272
+ jpg: /* @__PURE__ */ Q(r, {}),
1273
+ jpeg: /* @__PURE__ */ Q(t, {}),
1274
+ gif: /* @__PURE__ */ Q(y, {}),
1275
+ webp: /* @__PURE__ */ Q(h, {}),
1276
+ php: /* @__PURE__ */ Q(S, {}),
1277
+ xml: /* @__PURE__ */ Q(m, {}),
1278
+ xls: /* @__PURE__ */ Q(A, {}),
1279
+ ppt: /* @__PURE__ */ Q(a, {}),
1280
+ odt: /* @__PURE__ */ Q(_, {}),
1281
+ exe: /* @__PURE__ */ Q(s, {}),
1282
+ mp3: /* @__PURE__ */ Q(u, {}),
1283
+ mp4: /* @__PURE__ */ Q(p, {})
1284
+ };
1285
+ function jt(e) {
1286
+ let t = e.lastIndexOf(".");
1287
+ return t < 1 ? null : e.slice(t + 1).toLowerCase();
1288
+ }
1289
+ function Mt(e) {
1290
+ return e?.kind === "folder" || !!e?.children?.length;
1291
+ }
1292
+ function Nt(e) {
1293
+ let t = jt(e);
1294
+ return t ? At[t] ?? /* @__PURE__ */ Q(fe, {}) : /* @__PURE__ */ Q(ae, {});
1295
+ }
1296
+ function Pt(e, t = !1) {
1297
+ return e.icon ? e.icon : Mt(e) ? Q(t ? C : o, {}) : Nt(e.label);
1298
+ }
1299
+ function Ft(e) {
1300
+ if (!e || e < 1) return null;
1301
+ let t = [
1302
+ "B",
1303
+ "KB",
1304
+ "MB",
1305
+ "GB",
1306
+ "TB"
1307
+ ], n = e, r = 0;
1308
+ for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
1309
+ let i = n >= 100 || r === 0 ? 0 : 1;
1310
+ return `${n.toFixed(i)} ${t[r]}`;
1311
+ }
1312
+ function It(e, t) {
1313
+ if (!e) return null;
1314
+ let n = e instanceof Date ? e : new Date(e);
1315
+ return Number.isNaN(n.getTime()) ? null : new Intl.DateTimeFormat(t, {
1316
+ year: "numeric",
1317
+ month: "short",
1318
+ day: "numeric",
1319
+ hour: "2-digit",
1320
+ minute: "2-digit"
1321
+ }).format(n);
1322
+ }
1323
+ function Lt(e) {
1324
+ let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1325
+ function r(e, i) {
1326
+ for (let a of e) t.set(a.id, a), n.set(a.id, i), a.children?.length && r(a.children, a.id);
1327
+ }
1328
+ return r(e, null), {
1329
+ nodeMap: t,
1330
+ parentMap: n
1331
+ };
1332
+ }
1333
+ function Rt(e) {
1334
+ return e.flatMap((e) => Mt(e) ? [{
1335
+ ...e,
1336
+ kind: "folder",
1337
+ children: Rt(e.children ?? [])
1338
+ }] : []);
1339
+ }
1340
+ function zt(e, t, n) {
1341
+ let r = [], i = e;
1342
+ for (; i;) {
1343
+ let e = t.get(i);
1344
+ if (!e) break;
1345
+ r.unshift(e), i = n.get(i) ?? null;
1346
+ }
1347
+ return r;
1348
+ }
1349
+ function Bt(e, t, n) {
1350
+ if (!e) return null;
1351
+ let r = t.get(e);
1352
+ return r ? Mt(r) ? r.id : n.get(r.id) ?? null : null;
1353
+ }
1354
+ function Vt(e, t) {
1355
+ return e ? e.children ?? [] : t;
1356
+ }
1357
+ function Ht(e, t, n, r, i) {
1358
+ let a = e ? t.get(e) ?? null : null, o = a ? n.get(a.id) ?? null : null;
1359
+ return {
1360
+ id: e,
1361
+ node: a,
1362
+ parentId: o,
1363
+ parentNode: o ? t.get(o) ?? null : null,
1364
+ activeFolderId: r,
1365
+ activeFolder: i
1366
+ };
1367
+ }
1368
+ function Ut(e, t) {
1369
+ return [
1370
+ ...Mt(e) ? [] : [{
1371
+ id: "download",
1372
+ label: t.download,
1373
+ icon: /* @__PURE__ */ Q(pe, {}),
1374
+ color: "primary"
1375
+ }],
1376
+ {
1377
+ id: "rename",
1378
+ label: t.rename,
1379
+ icon: /* @__PURE__ */ Q(le, {})
1380
+ },
1381
+ {
1382
+ id: "move",
1383
+ label: t.moveTo,
1384
+ icon: /* @__PURE__ */ Q(n, {})
1385
+ },
1386
+ {
1387
+ id: "delete",
1388
+ label: t.delete,
1389
+ icon: /* @__PURE__ */ Q(k, {}),
1390
+ color: "error"
1391
+ }
1392
+ ];
1393
+ }
1394
+ function Wt(e, t) {
1395
+ return [...Mt(e) ? [{
1396
+ id: "new-folder",
1397
+ label: t.newFolder,
1398
+ icon: /* @__PURE__ */ Q(ge, {})
1399
+ }] : [], ...Ut(e, t)];
1400
+ }
1401
+ function Gt({ items: e, locale: t, defaultExpanded: n = [], expanded: r, onExpandChange: i, folderId: a, defaultFolderId: o = null, onFolderChange: s, selectedId: c, onSelectionChange: l, view: u, defaultView: d = "list", onViewChange: f, searchValue: p, defaultSearchValue: m = "", onSearchChange: h, searchable: g = !0, searchPlaceholder: _, showSidebar: v = !0, showPreview: y = !0, emptyText: ee, toolbarActions: b = [], onToolbarAction: x, onOpenItem: S, onItemAction: C, onContextMenuAction: w, canDrop: T, onMove: E, renderPreview: D, className: te, ...O }) {
1402
+ let ne = Ce(t), k = Re(), [re, ie] = Z(o), [ae, oe] = Z(null), [se, ce] = Z(d), [le, ue] = Z(m), { nodeMap: A, parentMap: fe } = Y(() => Lt(e), [e]), pe = Y(() => Rt(e), [e]), he = Bt(a === void 0 ? re : a, A, fe), ge = he ? A.get(he) ?? null : null, _e = c === void 0 ? ae : c, M = _e ? A.get(_e) ?? null : null, ve = M ? M.id : null, F = u ?? se, be = p ?? le, I = Vt(ge, e), R = be.trim().toLowerCase(), xe = zt(he, A, fe), z = _ ?? k.searchPlaceholder, Se = ee ?? k.emptyText, H = !!(C || w), G = Y(() => R ? I.filter((e) => e.label.toLowerCase().includes(R)) : I, [I, R]);
1403
+ function K(e) {
1404
+ let t = Bt(e, A, fe), n = t ? A.get(t) ?? null : null;
1405
+ s ? s(t, n) : ie(t);
1406
+ }
1407
+ function we(e, t = he, n = ge) {
1408
+ let r = Ht(e, A, fe, t, n);
1409
+ l ? l(r) : oe(e);
1410
+ }
1411
+ function Te(e) {
1412
+ f ? f(e) : ce(e);
1413
+ }
1414
+ function Ee(e) {
1415
+ h ? h(e) : ue(e);
1416
+ }
1417
+ function De(e, t) {
1418
+ K(e), we(e, t.id, t);
1419
+ }
1420
+ function Oe(e) {
1421
+ if (Mt(e)) {
1422
+ K(e.id), we(e.id, e.id, e);
1423
+ return;
1424
+ }
1425
+ we(e.id);
1426
+ }
1427
+ function ke(e) {
1428
+ x && x({
1429
+ ...Ht(ve, A, fe, he, ge),
1430
+ actionId: e,
1431
+ visibleItems: G
1432
+ });
1433
+ }
1434
+ function Ae(e, t) {
1435
+ (C ?? w)?.(e, t);
1436
+ }
1437
+ function je(e, t) {
1438
+ (w ?? C)?.(e, t);
1439
+ }
1440
+ function Me(e) {
1441
+ let t = [], n = Ft(e.size), r = It(e.modifiedAt, ne);
1442
+ return Mt(e) && t.push(k.itemsCount(e.children?.length ?? 0)), n && t.push(n), r && t.push(r), t.join(" / ");
1443
+ }
1444
+ return /* @__PURE__ */ $("div", {
1445
+ className: j("file-manager", !v && "no-sidebar", !y && "no-preview", te),
1446
+ ...O,
1447
+ children: [/* @__PURE__ */ $("div", {
1448
+ className: "toolbar",
1449
+ children: [/* @__PURE__ */ $("div", {
1450
+ className: "toolbar-main",
1451
+ children: [/* @__PURE__ */ $("div", {
1452
+ className: "breadcrumbs",
1453
+ children: [/* @__PURE__ */ $("button", {
1454
+ type: "button",
1455
+ className: "breadcrumb root",
1456
+ onClick: () => K(null),
1457
+ children: [/* @__PURE__ */ Q(me, {}), /* @__PURE__ */ Q(P, {
1458
+ as: "span",
1459
+ weight: "semibold",
1460
+ children: k.home
1461
+ })]
1462
+ }), xe.map((e) => /* @__PURE__ */ $("div", {
1463
+ className: "breadcrumbs",
1464
+ children: [/* @__PURE__ */ Q("span", {
1465
+ className: "breadcrumb-separator",
1466
+ children: "/"
1467
+ }), /* @__PURE__ */ Q("button", {
1468
+ type: "button",
1469
+ className: "breadcrumb",
1470
+ onClick: () => K(e.id),
1471
+ children: /* @__PURE__ */ Q(P, {
1472
+ as: "span",
1473
+ children: e.label
1474
+ })
1475
+ })]
1476
+ }, e.id))]
1477
+ }), g && /* @__PURE__ */ Q(V, {
1478
+ className: "toolbar-search",
1479
+ size: "sm",
1480
+ placeholder: z,
1481
+ value: be,
1482
+ onChange: (e) => Ee(e.target.value),
1483
+ onClear: () => Ee("")
1484
+ })]
1485
+ }), /* @__PURE__ */ $("div", {
1486
+ className: "toolbar-actions",
1487
+ children: [b.map((e) => /* @__PURE__ */ Q(L, {
1488
+ size: "sm",
1489
+ variant: e.variant ?? "ghost",
1490
+ color: e.color,
1491
+ disabled: e.disabled,
1492
+ onClick: () => ke(e.id),
1493
+ startIcon: e.icon,
1494
+ children: e.label
1495
+ }, e.id)), /* @__PURE__ */ $("div", {
1496
+ className: "view-switch",
1497
+ children: [/* @__PURE__ */ Q(L, {
1498
+ size: "sm",
1499
+ variant: F === "list" ? "secondary" : "ghost",
1500
+ onClick: () => Te("list"),
1501
+ children: k.listView
1502
+ }), /* @__PURE__ */ Q(L, {
1503
+ size: "sm",
1504
+ variant: F === "grid" ? "secondary" : "ghost",
1505
+ onClick: () => Te("grid"),
1506
+ children: k.gridView
1507
+ })]
1508
+ })]
1509
+ })]
1510
+ }), /* @__PURE__ */ $("div", {
1511
+ className: "body",
1512
+ children: [
1513
+ v && /* @__PURE__ */ $("aside", {
1514
+ className: "panel",
1515
+ children: [/* @__PURE__ */ $("div", {
1516
+ className: "panel-header",
1517
+ children: [/* @__PURE__ */ Q(P, {
1518
+ weight: "semibold",
1519
+ children: k.folders
1520
+ }), /* @__PURE__ */ Q(B, {
1521
+ size: "sm",
1522
+ color: "info",
1523
+ children: pe.length
1524
+ })]
1525
+ }), /* @__PURE__ */ Q("div", {
1526
+ className: "panel-body sidebar-body",
1527
+ children: pe.length > 0 ? /* @__PURE__ */ Q(Ie, {
1528
+ items: pe,
1529
+ selectable: !0,
1530
+ fileIcons: !0,
1531
+ defaultExpanded: n,
1532
+ expanded: r,
1533
+ onExpandChange: i,
1534
+ selected: he,
1535
+ onSelect: (e, t) => De(e, t),
1536
+ draggable: !!E,
1537
+ canDrop: T ? (e, t) => T(e, t) : void 0,
1538
+ onMove: E ? (e) => E({
1539
+ draggedId: e.draggedId,
1540
+ draggedNode: e.draggedNode,
1541
+ targetId: e.targetId,
1542
+ targetNode: e.targetNode
1543
+ }) : void 0,
1544
+ contextMenuItems: H ? (e) => Wt(e, k) : void 0,
1545
+ onContextMenuAction: H ? (e, t) => je(e, t) : void 0
1546
+ }) : /* @__PURE__ */ Q("div", {
1547
+ className: "empty-state",
1548
+ children: k.noFoldersAvailable
1549
+ })
1550
+ })]
1551
+ }),
1552
+ /* @__PURE__ */ $("section", {
1553
+ className: "panel",
1554
+ children: [/* @__PURE__ */ $("div", {
1555
+ className: "panel-header",
1556
+ children: [/* @__PURE__ */ $(N, {
1557
+ align: "center",
1558
+ wrap: "wrap",
1559
+ children: [/* @__PURE__ */ Q(P, {
1560
+ weight: "semibold",
1561
+ children: ge?.label ?? k.home
1562
+ }), /* @__PURE__ */ Q(B, {
1563
+ size: "sm",
1564
+ children: G.length
1565
+ })]
1566
+ }), /* @__PURE__ */ Q(P, {
1567
+ size: "sm",
1568
+ tone: "muted",
1569
+ children: R ? k.filteredBy(be) : k.currentFolder
1570
+ })]
1571
+ }), /* @__PURE__ */ Q("div", {
1572
+ className: "panel-body",
1573
+ children: G.length > 0 ? /* @__PURE__ */ Q("div", {
1574
+ className: j("content-items", F),
1575
+ children: G.map((e) => {
1576
+ let t = ve === e.id, n = Me(e), r = H ? Ut(e, k) : [];
1577
+ return /* @__PURE__ */ $("div", {
1578
+ className: j("item-card", t && "selected"),
1579
+ children: [/* @__PURE__ */ $("button", {
1580
+ type: "button",
1581
+ className: "item-card-main",
1582
+ onClick: () => Oe(e),
1583
+ onDoubleClick: () => S?.(e),
1584
+ children: [/* @__PURE__ */ Q("span", {
1585
+ className: "item-icon",
1586
+ children: Pt(e)
1587
+ }), /* @__PURE__ */ $("span", {
1588
+ className: "item-text",
1589
+ children: [
1590
+ /* @__PURE__ */ Q(P, {
1591
+ as: "span",
1592
+ weight: "semibold",
1593
+ truncate: !0,
1594
+ children: e.label
1595
+ }),
1596
+ e.description ? /* @__PURE__ */ Q(P, {
1597
+ as: "span",
1598
+ size: "sm",
1599
+ tone: "muted",
1600
+ truncate: 2,
1601
+ children: e.description
1602
+ }) : null,
1603
+ /* @__PURE__ */ $("span", {
1604
+ className: "item-meta",
1605
+ children: [/* @__PURE__ */ Q(B, {
1606
+ size: "sm",
1607
+ color: Mt(e) ? "info" : "primary",
1608
+ children: Mt(e) ? k.folder : k.file
1609
+ }), n ? /* @__PURE__ */ Q(P, {
1610
+ as: "span",
1611
+ size: "sm",
1612
+ tone: "muted",
1613
+ truncate: !0,
1614
+ children: n
1615
+ }) : null]
1616
+ })
1617
+ ]
1618
+ })]
1619
+ }), r.length > 0 ? /* @__PURE__ */ Q("div", {
1620
+ className: "item-card-actions",
1621
+ children: /* @__PURE__ */ Q(U, {
1622
+ placement: "bottom-end",
1623
+ trigger: /* @__PURE__ */ Q(L, {
1624
+ "aria-label": `${k.preview}: ${e.label}`,
1625
+ variant: "ghost",
1626
+ size: "sm",
1627
+ iconOnly: !0,
1628
+ children: /* @__PURE__ */ Q(de, {})
1629
+ }),
1630
+ children: r.map((t) => /* @__PURE__ */ Q(W, {
1631
+ icon: t.icon,
1632
+ label: t.label,
1633
+ color: t.color,
1634
+ onClick: () => Ae(t.id, e)
1635
+ }, t.id))
1636
+ })
1637
+ }) : null]
1638
+ }, e.id);
1639
+ })
1640
+ }) : /* @__PURE__ */ Q("div", {
1641
+ className: "empty-state",
1642
+ children: Se
1643
+ })
1644
+ })]
1645
+ }),
1646
+ y && /* @__PURE__ */ $("aside", {
1647
+ className: "panel",
1648
+ children: [/* @__PURE__ */ $("div", {
1649
+ className: "panel-header",
1650
+ children: [/* @__PURE__ */ Q(P, {
1651
+ weight: "semibold",
1652
+ children: k.preview
1653
+ }), M ? /* @__PURE__ */ Q(B, {
1654
+ size: "sm",
1655
+ color: Mt(M) ? "info" : "primary",
1656
+ children: Mt(M) ? k.folder : k.file
1657
+ }) : null]
1658
+ }), /* @__PURE__ */ Q("div", {
1659
+ className: "panel-body",
1660
+ children: M ? /* @__PURE__ */ $(ye, { children: [
1661
+ /* @__PURE__ */ Q("div", {
1662
+ className: "preview-visual",
1663
+ children: D ? D(M) : M.preview ? M.preview : /* @__PURE__ */ Q("span", {
1664
+ className: "preview-icon",
1665
+ children: Pt(M, !0)
1666
+ })
1667
+ }),
1668
+ /* @__PURE__ */ Q(P, {
1669
+ weight: "semibold",
1670
+ children: M.label
1671
+ }),
1672
+ M.description ? /* @__PURE__ */ Q(P, {
1673
+ size: "sm",
1674
+ tone: "muted",
1675
+ children: M.description
1676
+ }) : null,
1677
+ /* @__PURE__ */ $("div", {
1678
+ className: "preview-meta",
1679
+ children: [
1680
+ /* @__PURE__ */ Q(B, {
1681
+ size: "sm",
1682
+ color: Mt(M) ? "info" : "primary",
1683
+ children: Mt(M) ? k.folder : k.file
1684
+ }),
1685
+ Ft(M.size) ? /* @__PURE__ */ Q(B, {
1686
+ size: "sm",
1687
+ children: Ft(M.size)
1688
+ }) : null,
1689
+ It(M.modifiedAt, ne) ? /* @__PURE__ */ Q(B, {
1690
+ size: "sm",
1691
+ color: "neutral",
1692
+ children: It(M.modifiedAt, ne)
1693
+ }) : null
1694
+ ]
1695
+ }),
1696
+ /* @__PURE__ */ $(P, {
1697
+ size: "sm",
1698
+ tone: "muted",
1699
+ children: [
1700
+ k.path,
1701
+ ":",
1702
+ " ",
1703
+ [k.home, ...zt(M.id, A, fe).map((e) => e.label)].join(" / ")
1704
+ ]
1705
+ })
1706
+ ] }) : /* @__PURE__ */ Q("div", {
1707
+ className: "preview-empty",
1708
+ children: k.selectItemToInspect
1709
+ })
1710
+ })]
1711
+ })
1712
+ ]
1713
+ })]
1714
+ });
1715
+ }
1716
+ //#endregion
1717
+ //#region src/components/data/MCalendarBoard/MCalendarBoard.tsx
1718
+ var Kt = 24, qt = 60, Jt = 56, Yt = 110, Xt = 6, Zt = ["rgba(14, 165, 233, 0.85)", "rgba(244, 63, 94, 0.85)"];
1719
+ function Qt(e) {
1720
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate());
1721
+ }
1722
+ function $t(e) {
1723
+ if (!e) return null;
1724
+ if (e instanceof Date) return Qt(e);
1725
+ let t = new Date(e);
1726
+ return Number.isNaN(t.getTime()) ? null : Qt(t);
1727
+ }
1728
+ function en(e) {
1729
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
1730
+ }
1731
+ function tn(e) {
1732
+ return $t(e.date);
1733
+ }
1734
+ function nn(e, t) {
1735
+ let n = new Date(e);
1736
+ return n.setDate(n.getDate() + t), Qt(n);
1737
+ }
1738
+ function rn(e, t) {
1739
+ let n = Qt(e);
1740
+ return nn(n, -((n.getDay() - t + 7) % 7));
1741
+ }
1742
+ function an(e) {
1743
+ return [...e].sort((e, t) => {
1744
+ let n = e.startTime ?? "99:99", r = t.startTime ?? "99:99";
1745
+ return n.localeCompare(r);
1746
+ });
1747
+ }
1748
+ function on(e, t) {
1749
+ let n = rn(new Date(e.getFullYear(), e.getMonth(), 1), t);
1750
+ return Array.from({ length: 42 }, (e, t) => nn(n, t));
1751
+ }
1752
+ function sn(e) {
1753
+ switch (e) {
1754
+ case "active": return "rgba(14, 165, 233, 1)";
1755
+ case "done": return "rgba(34, 197, 94, 1)";
1756
+ case "cancelled": return "rgba(239, 68, 68, 1)";
1757
+ default: return "rgba(245, 158, 11, 1)";
1758
+ }
1759
+ }
1760
+ function cn(e) {
1761
+ return e.color ?? sn(e.status);
1762
+ }
1763
+ function ln(e, t) {
1764
+ return new Intl.DateTimeFormat(t, {
1765
+ weekday: "long",
1766
+ day: "numeric",
1767
+ month: "long",
1768
+ year: "numeric"
1769
+ }).format(e);
1770
+ }
1771
+ function un(e, t) {
1772
+ let n = nn(e, 6), r = new Intl.DateTimeFormat(t, {
1773
+ day: "numeric",
1774
+ month: "short"
1775
+ });
1776
+ return `${r.format(e)} - ${r.format(n)}`;
1777
+ }
1778
+ function dn(e, t) {
1779
+ return e.startTime && e.endTime ? `${e.startTime} - ${e.endTime}` : e.startTime ? e.startTime : t.allDay;
1780
+ }
1781
+ function fn(e) {
1782
+ let t = /^(\d{1,2}):(\d{2})$/.exec(e);
1783
+ return t ? Number(t[1]) * 60 + Number(t[2]) : null;
1784
+ }
1785
+ function pn(e) {
1786
+ if (!e.startTime || !e.endTime) return null;
1787
+ let t = fn(e.startTime), n = fn(e.endTime);
1788
+ if (t === null || n === null || n <= t) return null;
1789
+ let r = n - t, i = Math.floor(r / 60), a = r % 60;
1790
+ return i === 0 ? `${a}m` : a === 0 ? `${i}h` : `${i}h ${a}m`;
1791
+ }
1792
+ function mn(e, t) {
1793
+ let n = /* @__PURE__ */ new Date(), r = new Date(e);
1794
+ r.setHours(t, 0, 0, 0);
1795
+ let i = new Date(r);
1796
+ return i.setHours(t + 1, 0, 0, 0), i <= n ? "past" : r <= n && i > n ? "active" : "upcoming";
1797
+ }
1798
+ function hn(e) {
1799
+ if (!e) return null;
1800
+ let [t, n] = e.split(":"), r = Number(t), i = Number(n ?? 0);
1801
+ return Number.isNaN(r) || Number.isNaN(i) ? null : r * qt + i;
1802
+ }
1803
+ function gn(e) {
1804
+ let t = hn(e.startTime);
1805
+ if (t === null) return null;
1806
+ let n = hn(e.endTime), r = n !== null && n > t ? n : t + qt;
1807
+ return {
1808
+ start: t,
1809
+ end: Math.min(r, Kt * qt)
1810
+ };
1811
+ }
1812
+ function _n(e, t) {
1813
+ let n = t * qt, r = n + qt, i = [];
1814
+ return e.forEach((e) => {
1815
+ let t = gn(e);
1816
+ if (!t) return;
1817
+ let a = Math.max(t.start, n), o = Math.min(t.end, r);
1818
+ o <= a || i.push({
1819
+ event: e,
1820
+ fromPercent: (a - n) / qt * 100,
1821
+ toPercent: (o - n) / qt * 100
1822
+ });
1823
+ }), i;
1824
+ }
1825
+ function vn(e) {
1826
+ let t = /* @__PURE__ */ new Set(), n = e.map((e) => {
1827
+ let t = gn(e);
1828
+ return t ? {
1829
+ event: e,
1830
+ ...t
1831
+ } : null;
1832
+ }).filter((e) => e !== null).sort((e, t) => e.start - t.start);
1833
+ for (let e = 0; e < n.length; e += 1) for (let r = e + 1; r < n.length && !(n[r].start >= n[e].end); r += 1) t.add(n[e].event.id), t.add(n[r].event.id);
1834
+ return t;
1835
+ }
1836
+ function yn(e, t, n) {
1837
+ if (!t.length || !n.length) return e;
1838
+ let r = t.filter((e) => n.includes(e.id));
1839
+ return r.length ? e.filter((e) => r.some((t) => t.predicate(e))) : e;
1840
+ }
1841
+ function bn(e, t, n, r) {
1842
+ return t === "week" ? un(rn(e, r), n) : new Intl.DateTimeFormat(n, {
1843
+ month: "long",
1844
+ year: "numeric"
1845
+ }).format(e);
1846
+ }
1847
+ function xn(e, t) {
1848
+ return e === "week" ? t.weekView : t.monthView;
1849
+ }
1850
+ function Sn(e, t) {
1851
+ let n = [];
1852
+ return e && n.push({
1853
+ id: "add",
1854
+ label: t ?? "Add event",
1855
+ icon: /* @__PURE__ */ Q(O, {}),
1856
+ onSelect: (t) => e(t)
1857
+ }), n;
1858
+ }
1859
+ function Cn(e, t, n) {
1860
+ let r = [];
1861
+ e.href && r.push({
1862
+ id: "open",
1863
+ label: "Open",
1864
+ icon: /* @__PURE__ */ Q(ie, {}),
1865
+ href: e.href
1866
+ });
1867
+ let i = e.onEdit ?? t;
1868
+ i && r.push({
1869
+ id: "edit",
1870
+ label: "Edit",
1871
+ icon: /* @__PURE__ */ Q(le, {}),
1872
+ onSelect: i
1873
+ });
1874
+ let a = e.onDelete ?? n;
1875
+ return a && r.push({
1876
+ id: "delete",
1877
+ label: "Delete",
1878
+ icon: /* @__PURE__ */ Q(k, {}),
1879
+ color: "error",
1880
+ onSelect: a
1881
+ }), r;
1882
+ }
1883
+ function wn({ date: e, events: t, overlapWarning: n = !1, orientation: r = "vertical", className: i, ...a }) {
1884
+ let o = q(), s = Y(() => vn(t), [t]), c = Array.from({ length: Kt }, (e, t) => t);
1885
+ return /* @__PURE__ */ Q("div", {
1886
+ className: j("calendar hourbar", r, i),
1887
+ "aria-hidden": "true",
1888
+ ...a,
1889
+ children: c.map((e) => {
1890
+ let r = _n(t, e), i = Math.min(100, r.reduce((e, t) => e + (t.toPercent - t.fromPercent), 0)), a = n && r.some((e) => s.has(e.event.id));
1891
+ return /* @__PURE__ */ Q("div", {
1892
+ className: j("hourbar slot", r.length > 0 && "filled", a && "overlap"),
1893
+ style: { "--mineral-hourbar-fill": `${i}%` },
1894
+ children: r.map((e, t) => {
1895
+ let n = a && r.length > 1 ? Zt[t % Zt.length] : cn(e.event), i = pn(e.event), s = dn(e.event, o);
1896
+ return /* @__PURE__ */ Q(H, {
1897
+ placement: "left",
1898
+ delay: 120,
1899
+ className: "hourbar segment-wrapper",
1900
+ style: {
1901
+ position: "absolute",
1902
+ left: 0,
1903
+ right: 0,
1904
+ top: `${e.fromPercent}%`,
1905
+ height: `${e.toPercent - e.fromPercent}%`,
1906
+ background: n
1907
+ },
1908
+ content: /* @__PURE__ */ $("div", {
1909
+ className: "hourbar tooltip-content",
1910
+ children: [/* @__PURE__ */ Q("strong", { children: e.event.title }), /* @__PURE__ */ Q("span", { children: i ? `${s} · ${i}` : s })]
1911
+ }),
1912
+ children: /* @__PURE__ */ Q("span", {
1913
+ className: "hourbar segment-fill",
1914
+ "aria-hidden": "true"
1915
+ })
1916
+ }, `${e.event.id}-${t}`);
1917
+ })
1918
+ }, e);
1919
+ })
1920
+ });
1921
+ }
1922
+ function Tn({ filters: e, activeFilterIds: t, onToggle: n }) {
1923
+ return e.length ? /* @__PURE__ */ Q("div", {
1924
+ className: "calendar filters",
1925
+ children: e.map((e) => {
1926
+ let r = t.includes(e.id);
1927
+ return /* @__PURE__ */ Q(L, {
1928
+ type: "button",
1929
+ size: "sm",
1930
+ variant: "outlined",
1931
+ color: r ? "primary" : "neutral",
1932
+ active: r,
1933
+ className: "calendar filter button",
1934
+ onClick: () => n(e.id),
1935
+ children: e.label
1936
+ }, e.id);
1937
+ })
1938
+ }) : null;
1939
+ }
1940
+ function En({ days: e, eventsByDay: t, selectedDate: n, activeDate: r, onDayInteract: i, dayBadge: a, renderDayCell: o, showHourBar: s, overlapWarning: c, onAddEvent: l, addEventLabel: u }) {
1941
+ let d = en(Qt(/* @__PURE__ */ new Date()));
1942
+ return /* @__PURE__ */ Q("div", {
1943
+ className: "calendar week",
1944
+ children: e.map((e) => {
1945
+ let f = en(e), p = t.get(f) ?? [], m = a?.(e, p) ?? (p.length > 0 ? /* @__PURE__ */ Q(B, {
1946
+ size: "sm",
1947
+ children: p.length
1948
+ }) : null), h = !!(n && en(n) === f), g = {
1949
+ date: e,
1950
+ events: p,
1951
+ badge: m,
1952
+ isToday: f === d,
1953
+ isSelected: h,
1954
+ isOutsideMonth: !1
1955
+ };
1956
+ return /* @__PURE__ */ Q("div", {
1957
+ className: "calendar week column",
1958
+ children: /* @__PURE__ */ Q(Dn, {
1959
+ date: e,
1960
+ events: p,
1961
+ badge: m,
1962
+ isToday: g.isToday,
1963
+ isSelected: h || !!(r && en(r) === f),
1964
+ isOutsideMonth: !1,
1965
+ showHourBar: s,
1966
+ overlapWarning: c,
1967
+ onAddEvent: l ? (e) => l(e) : void 0,
1968
+ addEventLabel: u,
1969
+ onClick: (t) => i(e, t.currentTarget, p),
1970
+ children: o ? o(e, g) : void 0
1971
+ })
1972
+ }, f);
1973
+ })
1974
+ });
1975
+ }
1976
+ function Dn({ date: e, events: t = [], badge: n, isToday: r = !1, isSelected: i = !1, isOutsideMonth: a = !1, showHourBar: o = !1, overlapWarning: s = !1, onAddEvent: c, addEventLabel: l, className: u, children: d, ...f }) {
1977
+ let p = (t) => {
1978
+ t.stopPropagation(), c?.(e);
1979
+ };
1980
+ return /* @__PURE__ */ Q("button", {
1981
+ type: "button",
1982
+ className: j("calendar day cell", r && "today", i && "selected", a && "outside-month", o && "has-hourbar", u),
1983
+ ...f,
1984
+ children: d ?? /* @__PURE__ */ $(qe, { children: [/* @__PURE__ */ $("div", {
1985
+ className: "day inner",
1986
+ children: [/* @__PURE__ */ $("div", {
1987
+ className: "day header",
1988
+ children: [/* @__PURE__ */ Q("span", {
1989
+ className: "day number",
1990
+ children: e.getDate()
1991
+ }), /* @__PURE__ */ Q("div", {
1992
+ className: "day meta",
1993
+ children: n
1994
+ })]
1995
+ }), c && /* @__PURE__ */ Q("div", {
1996
+ className: "day footer",
1997
+ children: /* @__PURE__ */ Q("span", {
1998
+ role: "button",
1999
+ tabIndex: -1,
2000
+ "aria-label": l,
2001
+ title: l,
2002
+ className: "day add",
2003
+ onClick: p,
2004
+ children: /* @__PURE__ */ Q(O, { size: 14 })
2005
+ })
2006
+ })]
2007
+ }), o && /* @__PURE__ */ Q(wn, {
2008
+ date: e,
2009
+ events: t,
2010
+ overlapWarning: s,
2011
+ className: "embedded"
2012
+ })] })
2013
+ });
2014
+ }
2015
+ function On({ event: e, locale: t, className: n, currentDate: r, menuItems: i, renderMenu: a, showActions: o = !0, overlap: s = !1, onSelect: c, onEdit: l, onDelete: u, ...d }) {
2016
+ let f = Ce(t), p = q(), m = e.status === "cancelled" ? "error" : e.status === "done" ? "success" : e.status === "active" ? "info" : "warning", h = e.menuItems ?? i ?? a?.(e) ?? Cn(e, l, u), g = !!(e.href || e.onClick || c), _ = cn(e), v = (t) => {
2017
+ t.target.closest(".event-menu, .event-menu-trigger") || (e.onClick?.(e), c?.(e));
2018
+ }, y = (t) => /* @__PURE__ */ $(t, {
2019
+ ...t === "a" ? {
2020
+ href: e.href,
2021
+ target: (e.href, void 0)
2022
+ } : {},
2023
+ ...t === "button" ? {
2024
+ type: "button",
2025
+ onClick: v
2026
+ } : {},
2027
+ ...t === "a" ? { onClick: v } : {},
2028
+ className: j("calendar event item", g && "interactive", s && "overlap", n),
2029
+ style: { "--mineral-event-accent": _ },
2030
+ ...d,
2031
+ children: [
2032
+ /* @__PURE__ */ $("div", {
2033
+ className: "event time",
2034
+ children: [/* @__PURE__ */ Q("span", {
2035
+ className: "event accent",
2036
+ "aria-hidden": "true"
2037
+ }), dn(e, p)]
2038
+ }),
2039
+ /* @__PURE__ */ $("div", {
2040
+ className: "event content",
2041
+ children: [
2042
+ /* @__PURE__ */ $("div", {
2043
+ className: "event title row",
2044
+ children: [/* @__PURE__ */ Q(F, {
2045
+ level: 5,
2046
+ children: e.title
2047
+ }), /* @__PURE__ */ $("div", {
2048
+ className: "event title meta",
2049
+ children: [s && /* @__PURE__ */ $(B, {
2050
+ color: "warning",
2051
+ size: "sm",
2052
+ children: [/* @__PURE__ */ Q(ue, { size: 12 }), " Overlap"]
2053
+ }), e.status && /* @__PURE__ */ Q(B, {
2054
+ color: m,
2055
+ size: "sm",
2056
+ children: e.status
2057
+ })]
2058
+ })]
2059
+ }),
2060
+ e.description && /* @__PURE__ */ Q(P, {
2061
+ size: "sm",
2062
+ tone: "muted",
2063
+ children: e.description
2064
+ }),
2065
+ /* @__PURE__ */ $("div", {
2066
+ className: "event details",
2067
+ children: [
2068
+ e.type && /* @__PURE__ */ Q(B, {
2069
+ color: "neutral",
2070
+ size: "sm",
2071
+ children: e.type
2072
+ }),
2073
+ e.badgeLabel && /* @__PURE__ */ Q(B, {
2074
+ size: "sm",
2075
+ children: e.badgeLabel
2076
+ }),
2077
+ e.user && /* @__PURE__ */ $("span", {
2078
+ className: "event user",
2079
+ children: [/* @__PURE__ */ Q(Te, {
2080
+ size: "sm",
2081
+ src: e.user.avatar,
2082
+ name: e.user.name,
2083
+ backgroundColor: e.user.color
2084
+ }), e.user.name]
2085
+ }),
2086
+ !e.startTime && !e.endTime && r && /* @__PURE__ */ Q(P, {
2087
+ size: "sm",
2088
+ tone: "muted",
2089
+ children: ln(r, f)
2090
+ })
2091
+ ]
2092
+ })
2093
+ ]
2094
+ }),
2095
+ o && h.length > 0 && /* @__PURE__ */ Q("div", {
2096
+ className: "event-menu",
2097
+ onClick: (e) => e.stopPropagation(),
2098
+ onMouseDown: (e) => e.stopPropagation(),
2099
+ children: /* @__PURE__ */ Q(U, {
2100
+ placement: "bottom-end",
2101
+ trigger: /* @__PURE__ */ Q("span", {
2102
+ className: "event-menu-trigger",
2103
+ "aria-label": "Event actions",
2104
+ role: "presentation",
2105
+ children: /* @__PURE__ */ Q(de, { size: 16 })
2106
+ }),
2107
+ children: h.map((t) => t.href ? /* @__PURE__ */ Q(W, {
2108
+ icon: t.icon,
2109
+ label: t.label,
2110
+ href: t.href,
2111
+ color: t.color,
2112
+ disabled: t.disabled
2113
+ }, t.id) : /* @__PURE__ */ Q(W, {
2114
+ icon: t.icon,
2115
+ label: t.label,
2116
+ color: t.color,
2117
+ disabled: t.disabled,
2118
+ onClick: () => t.onSelect?.(e)
2119
+ }, t.id))
2120
+ })
2121
+ })
2122
+ ]
2123
+ });
2124
+ return e.href ? y("a") : y(g ? "button" : "div");
2125
+ }
2126
+ function kn({ events: e, locale: t, currentDate: n, emptyStateText: r, overlapWarning: i = !1, renderEventItem: a, renderEventMenu: o, onEventSelect: s, onEventEdit: c, onEventDelete: l, className: u, ...d }) {
2127
+ let f = Ce(t), p = q(), m = Y(() => i ? vn(e) : /* @__PURE__ */ new Set(), [e, i]);
2128
+ return e.length ? /* @__PURE__ */ Q("div", {
2129
+ className: j("calendar event list", u),
2130
+ ...d,
2131
+ children: /* @__PURE__ */ Q(ye, { children: an(e).map((e) => a ? /* @__PURE__ */ Q("div", { children: a(e) }, e.id) : /* @__PURE__ */ Q(On, {
2132
+ event: e,
2133
+ locale: f,
2134
+ currentDate: n,
2135
+ renderMenu: o,
2136
+ overlap: m.has(e.id),
2137
+ onSelect: s,
2138
+ onEdit: c,
2139
+ onDelete: l
2140
+ }, e.id)) })
2141
+ }) : /* @__PURE__ */ Q(P, {
2142
+ size: "sm",
2143
+ tone: "muted",
2144
+ className: j("calendar event list", u),
2145
+ ...d,
2146
+ children: r ?? p.emptyStateText
2147
+ });
2148
+ }
2149
+ function An({ event: e, locale: t, date: n, timeLabel: r, overlap: i, renderEventMenu: a, onSelect: o, onEdit: s, onDelete: c }) {
2150
+ let [l, u] = Z(!1), d = X(null);
2151
+ return /* @__PURE__ */ $(qe, { children: [/* @__PURE__ */ $("button", {
2152
+ ref: d,
2153
+ type: "button",
2154
+ className: j("timeline event-chip", i && "overlap", l && "open"),
2155
+ style: { "--mineral-event-color": cn(e) },
2156
+ onClick: () => u((e) => !e),
2157
+ children: [/* @__PURE__ */ Q("span", {
2158
+ className: "timeline event-chip-time",
2159
+ children: r
2160
+ }), /* @__PURE__ */ Q("span", {
2161
+ className: "timeline event-chip-title",
2162
+ children: e.title
2163
+ })]
2164
+ }), /* @__PURE__ */ Q(ve, {
2165
+ open: l,
2166
+ anchorRef: d,
2167
+ onClose: () => u(!1),
2168
+ placement: "right-start",
2169
+ children: /* @__PURE__ */ Q(xe, {
2170
+ className: "timeline event-popup",
2171
+ outlined: !1,
2172
+ children: /* @__PURE__ */ Q(z, { children: /* @__PURE__ */ Q(On, {
2173
+ event: e,
2174
+ locale: t,
2175
+ currentDate: n,
2176
+ renderMenu: a,
2177
+ overlap: i,
2178
+ onSelect: o,
2179
+ onEdit: s,
2180
+ onDelete: c
2181
+ }) })
2182
+ })
2183
+ })] });
2184
+ }
2185
+ function jn({ date: e, events: t, locale: n, startHour: r = 0, endHour: i = 23, emptyStateText: a, overlapWarning: o = !1, onAddEvent: s, addEventLabel: c, renderEventItem: l, renderEventMenu: u, onEventSelect: d, onEventEdit: f, onEventDelete: p, className: m, ...h }) {
2186
+ let g = Ce(n), _ = q(), v = Math.max(0, Math.min(r, Kt - 1)), y = Math.max(v, Math.min(i, Kt - 1)), ee = Array.from({ length: y - v + 1 }, (e, t) => v + t), b = t.filter((e) => !e.startTime), x = Y(() => o ? vn(t) : /* @__PURE__ */ new Set(), [t, o]), S = /* @__PURE__ */ Q("div", {
2187
+ className: "timeline allday-panel",
2188
+ children: b.length > 0 ? /* @__PURE__ */ Q(ye, {
2189
+ spacing: "xs",
2190
+ children: b.map((t) => l ? /* @__PURE__ */ Q("div", { children: l(t) }, t.id) : /* @__PURE__ */ Q(On, {
2191
+ event: t,
2192
+ locale: g,
2193
+ currentDate: e,
2194
+ renderMenu: u,
2195
+ overlap: x.has(t.id),
2196
+ onSelect: d,
2197
+ onEdit: f,
2198
+ onDelete: p
2199
+ }, t.id))
2200
+ }) : /* @__PURE__ */ Q(P, {
2201
+ size: "sm",
2202
+ tone: "muted",
2203
+ children: a ?? _.emptyStateText
2204
+ })
2205
+ }), C = v * qt, w = (y + 1) * qt, T = (y - v + 1) * Jt, E = Y(() => {
2206
+ let e = an(t.filter((e) => !!e.startTime)), n = [];
2207
+ e.forEach((e) => {
2208
+ let t = gn(e);
2209
+ !t || t.end <= C || t.start >= w || n.push({
2210
+ event: e,
2211
+ start: t.start,
2212
+ end: t.end,
2213
+ column: 0,
2214
+ columns: 1
2215
+ });
2216
+ });
2217
+ let r = [];
2218
+ n.forEach((e) => {
2219
+ let t = -1;
2220
+ for (let n = 0; n < r.length; n++) if (r[n] <= e.start) {
2221
+ t = n, r[n] = e.end;
2222
+ break;
2223
+ }
2224
+ t === -1 && (t = r.length, r.push(e.end)), e.column = t;
2225
+ });
2226
+ let i = 0;
2227
+ for (; i < n.length;) {
2228
+ let e = i, t = n[i].end;
2229
+ for (; e + 1 < n.length && n[e + 1].start < t;) e++, t = Math.max(t, n[e].end);
2230
+ let r = 0;
2231
+ for (let t = i; t <= e; t++) r = Math.max(r, n[t].column + 1);
2232
+ for (let t = i; t <= e; t++) n[t].columns = r;
2233
+ i = e + 1;
2234
+ }
2235
+ return n;
2236
+ }, [
2237
+ t,
2238
+ C,
2239
+ w
2240
+ ]), D = /* @__PURE__ */ $("div", {
2241
+ className: "timeline canvas",
2242
+ style: {
2243
+ "--timeline-hour-height": `${Jt}px`,
2244
+ height: `${T}px`
2245
+ },
2246
+ children: [/* @__PURE__ */ Q("div", {
2247
+ className: "timeline rows",
2248
+ children: ee.map((t) => {
2249
+ let n = mn(e, t), r = s ? () => s(e, t) : void 0;
2250
+ return /* @__PURE__ */ $("div", {
2251
+ className: j("timeline row", n),
2252
+ children: [
2253
+ /* @__PURE__ */ $("div", {
2254
+ className: "row time-cell",
2255
+ children: [/* @__PURE__ */ Q("span", { children: `${String(t).padStart(2, "0")}:00` }), r && /* @__PURE__ */ Q("button", {
2256
+ type: "button",
2257
+ className: "row add",
2258
+ "aria-label": c,
2259
+ title: c,
2260
+ onClick: r,
2261
+ children: /* @__PURE__ */ Q(O, { size: 12 })
2262
+ })]
2263
+ }),
2264
+ /* @__PURE__ */ Q("div", {
2265
+ className: "row rail",
2266
+ "aria-hidden": "true"
2267
+ }),
2268
+ /* @__PURE__ */ Q("div", {
2269
+ className: "row body",
2270
+ "aria-hidden": "true"
2271
+ })
2272
+ ]
2273
+ }, t);
2274
+ })
2275
+ }), /* @__PURE__ */ Q("div", {
2276
+ className: "timeline events",
2277
+ children: E.length === 0 ? /* @__PURE__ */ Q("div", {
2278
+ className: "timeline events-empty",
2279
+ children: /* @__PURE__ */ Q(P, {
2280
+ size: "sm",
2281
+ tone: "muted",
2282
+ children: a ?? _.timelineEmptyState
2283
+ })
2284
+ }) : E.map((t) => {
2285
+ let n = Math.max(t.start, C) - C, r = Math.min(t.end, w) - C, i = n / qt * Jt, a = Math.max((r - n) / qt * Jt, 28), o = t.column * (Yt + Xt);
2286
+ return /* @__PURE__ */ Q("div", {
2287
+ className: "timeline event-block",
2288
+ style: {
2289
+ top: `${i}px`,
2290
+ height: `${a}px`,
2291
+ left: `${o}px`,
2292
+ width: `${Yt}px`
2293
+ },
2294
+ children: l ? l(t.event) : /* @__PURE__ */ Q(An, {
2295
+ event: t.event,
2296
+ locale: g,
2297
+ date: e,
2298
+ timeLabel: dn(t.event, _),
2299
+ overlap: x.has(t.event.id),
2300
+ renderEventMenu: u,
2301
+ onSelect: d,
2302
+ onEdit: f,
2303
+ onDelete: p
2304
+ })
2305
+ }, t.event.id);
2306
+ })
2307
+ })]
2308
+ });
2309
+ return /* @__PURE__ */ Q("div", {
2310
+ className: j("calendar timeline", m),
2311
+ ...h,
2312
+ children: /* @__PURE__ */ $(ye, { children: [/* @__PURE__ */ $("div", {
2313
+ className: "timeline header",
2314
+ children: [/* @__PURE__ */ Q(F, {
2315
+ level: 5,
2316
+ children: _.timelineTitle
2317
+ }), o && x.size > 0 && /* @__PURE__ */ $(B, {
2318
+ color: "warning",
2319
+ size: "sm",
2320
+ children: [/* @__PURE__ */ Q(ue, { size: 12 }), " Overlap"]
2321
+ })]
2322
+ }), b.length > 0 ? /* @__PURE__ */ Q(Be, {
2323
+ className: "calendar timeline-tabs",
2324
+ variant: "underline",
2325
+ size: "sm",
2326
+ fullWidth: !0,
2327
+ defaultValue: "timeline",
2328
+ items: [{
2329
+ value: "timeline",
2330
+ label: _.timelineTab,
2331
+ content: D
2332
+ }, {
2333
+ value: "allday",
2334
+ label: `${_.allDayTab} (${b.length})`,
2335
+ content: S
2336
+ }]
2337
+ }) : D] })
2338
+ });
2339
+ }
2340
+ function Mn({ date: e, events: t, locale: n, timelineStartHour: r, timelineEndHour: i, showTimeline: a, overlapWarning: o, emptyStateText: s, addEventLabel: c, dayMenuLabel: l, onAddEvent: u, renderDayMenu: d, onEventSelect: f, onEventEdit: p, onEventDelete: m, renderEventItem: h, renderEventMenu: g }) {
2341
+ let _ = q();
2342
+ if (!e) return null;
2343
+ let v = d?.(e, t) ?? Sn(u, c);
2344
+ return /* @__PURE__ */ $(ye, { children: [/* @__PURE__ */ $("div", {
2345
+ className: "calendar details header",
2346
+ children: [/* @__PURE__ */ $(ye, {
2347
+ spacing: "xs",
2348
+ children: [/* @__PURE__ */ Q(F, {
2349
+ level: 4,
2350
+ children: ln(e, n)
2351
+ }), /* @__PURE__ */ Q(P, {
2352
+ tone: "muted",
2353
+ size: "sm",
2354
+ children: t.length > 0 ? _.itemsCount(t.length) : s
2355
+ })]
2356
+ }), v.length > 0 && /* @__PURE__ */ Q(U, {
2357
+ placement: "bottom-end",
2358
+ trigger: /* @__PURE__ */ Q("button", {
2359
+ type: "button",
2360
+ className: "day-menu-trigger",
2361
+ "aria-label": l ?? "Day actions",
2362
+ title: l ?? "Day actions",
2363
+ children: /* @__PURE__ */ Q(ne, { size: 18 })
2364
+ }),
2365
+ children: v.map((n) => n.href ? /* @__PURE__ */ Q(W, {
2366
+ icon: n.icon,
2367
+ label: n.label,
2368
+ href: n.href,
2369
+ color: n.color,
2370
+ disabled: n.disabled
2371
+ }, n.id) : /* @__PURE__ */ Q(W, {
2372
+ icon: n.icon,
2373
+ label: n.label,
2374
+ color: n.color,
2375
+ disabled: n.disabled,
2376
+ onClick: () => n.onSelect?.(e, t)
2377
+ }, n.id))
2378
+ })]
2379
+ }), a ? /* @__PURE__ */ Q(jn, {
2380
+ date: e,
2381
+ events: t,
2382
+ locale: n,
2383
+ startHour: r,
2384
+ endHour: i,
2385
+ overlapWarning: o,
2386
+ onAddEvent: u,
2387
+ addEventLabel: c,
2388
+ renderEventItem: h,
2389
+ renderEventMenu: g,
2390
+ onEventSelect: f,
2391
+ onEventEdit: p,
2392
+ onEventDelete: m,
2393
+ emptyStateText: s
2394
+ }) : /* @__PURE__ */ Q(kn, {
2395
+ events: t,
2396
+ locale: n,
2397
+ currentDate: e,
2398
+ emptyStateText: s,
2399
+ overlapWarning: o,
2400
+ renderEventItem: h,
2401
+ renderEventMenu: g,
2402
+ onEventSelect: f,
2403
+ onEventEdit: p,
2404
+ onEventDelete: m
2405
+ })] });
2406
+ }
2407
+ function Nn({ open: e, anchorRef: t, onClose: n, date: r, events: i, locale: a, timelineStartHour: o = 0, timelineEndHour: s = 23, showTimeline: c = !0, emptyStateText: l, overlapWarning: u = !1, onAddEvent: d, addEventLabel: f, dayMenuLabel: p, onEventSelect: m, onEventEdit: h, onEventDelete: g, renderEventItem: _, renderEventMenu: v, renderDayMenu: y, className: ee, style: b }) {
2408
+ let x = Ce(a), S = q();
2409
+ return /* @__PURE__ */ $(qe, { children: [e && /* @__PURE__ */ Q(M, { children: /* @__PURE__ */ Q("div", {
2410
+ className: "calendar popover-shield",
2411
+ onMouseDown: (e) => {
2412
+ e.preventDefault(), e.stopPropagation(), n();
2413
+ },
2414
+ onClick: (e) => {
2415
+ e.preventDefault(), e.stopPropagation();
2416
+ },
2417
+ "aria-hidden": "true"
2418
+ }) }), /* @__PURE__ */ Q(ve, {
2419
+ open: e,
2420
+ anchorRef: t,
2421
+ onClose: n,
2422
+ placement: "bottom-start",
2423
+ className: j("calendar popover", ee),
2424
+ style: b,
2425
+ children: /* @__PURE__ */ Q(xe, {
2426
+ className: "calendar event-popover",
2427
+ children: /* @__PURE__ */ Q(z, { children: /* @__PURE__ */ Q("div", {
2428
+ className: "calendar popover-scroll",
2429
+ children: /* @__PURE__ */ Q(Mn, {
2430
+ date: r,
2431
+ events: i,
2432
+ locale: x,
2433
+ timelineStartHour: o,
2434
+ timelineEndHour: s,
2435
+ showTimeline: c,
2436
+ overlapWarning: u,
2437
+ emptyStateText: l ?? S.emptyStateText,
2438
+ addEventLabel: f,
2439
+ dayMenuLabel: p,
2440
+ onAddEvent: d,
2441
+ renderDayMenu: y,
2442
+ onEventSelect: m,
2443
+ onEventEdit: h,
2444
+ onEventDelete: g,
2445
+ renderEventItem: _,
2446
+ renderEventMenu: v
2447
+ })
2448
+ }) })
2449
+ })
2450
+ })] });
2451
+ }
2452
+ function Pn({ month: t, defaultMonth: n, onMonthChange: r, events: i = [], locale: a, weekStartsOn: o = 1, view: s, defaultView: c = "month", views: l = ["month", "week"], onViewChange: u, selectedDate: d, defaultSelectedDate: f, onDayClick: p, dayBadge: m, renderDayCell: h, renderEventItem: g, renderEventMenu: _, detailsMode: v = "auto", showTimeline: y = !0, showHourBar: ee = !0, timelineStartHour: b = 0, timelineEndHour: x = 23, overlapWarning: S = !1, onAddEvent: C, addEventLabel: w = "Add event", dayMenuLabel: T, renderDayMenu: E, onEventSelect: D, onEventEdit: te, onEventDelete: O, emptyStateText: ne, filters: k = [], activeFilters: re, defaultActiveFilters: ie = [], onActiveFiltersChange: ae, fullWidth: oe = !1, className: se, ...ce }) {
2453
+ let le = Ce(a), ue = ze(), A = q(), de = Qt(/* @__PURE__ */ new Date()), [fe, pe] = Z(Qt(n ?? t ?? de)), [me, he] = Z(c), [ge, _e] = Z($t(f)), [M, ve] = Z(ie), [N, be] = Z(null), [I, R] = Z(!1), [xe, z] = Z(!1), V = X(null), H = t !== void 0 && typeof r == "function", U = Qt(H ? t ?? fe : fe), W = s ?? me, G = $t(d) ?? ge, K = re ?? M;
2454
+ Ge(() => {
2455
+ let t = window.matchMedia(`(max-width: ${e.md}px)`), n = () => z(t.matches);
2456
+ return n(), t.addEventListener("change", n), () => t.removeEventListener("change", n);
2457
+ }, []), Ge(() => {
2458
+ H && t && pe(Qt(t));
2459
+ }, [H, t]), Ge(() => {
2460
+ s && he(s);
2461
+ }, [s]), Ge(() => {
2462
+ d !== void 0 && _e($t(d));
2463
+ }, [d]);
2464
+ let we = Y(() => yn(i, k, K), [
2465
+ i,
2466
+ k,
2467
+ K
2468
+ ]), Te = Y(() => {
2469
+ let e = /* @__PURE__ */ new Map();
2470
+ return we.forEach((t) => {
2471
+ let n = tn(t);
2472
+ if (!n) return;
2473
+ let r = en(n), i = e.get(r) ?? [];
2474
+ i.push(t), e.set(r, i);
2475
+ }), e;
2476
+ }, [we]), Ee = Y(() => {
2477
+ if (W === "week") {
2478
+ let e = rn(G ?? U, o);
2479
+ return Array.from({ length: 7 }, (t, n) => nn(e, n));
2480
+ }
2481
+ return on(U, o);
2482
+ }, [
2483
+ W,
2484
+ G,
2485
+ U,
2486
+ o
2487
+ ]), De = v === "auto" ? xe ? "modal" : "popover" : v, Oe = N ? Te.get(en(N)) ?? [] : [], ke = l.includes("month"), Ae = l.includes("week"), je = (e) => {
2488
+ let t = Qt(e);
2489
+ pe(t), r?.(t);
2490
+ }, Me = (e) => {
2491
+ if (W === "week") {
2492
+ let t = nn(G ?? U, e * 7);
2493
+ je(t), _e(t), be(t), R(!1);
2494
+ return;
2495
+ }
2496
+ je(new Date(U.getFullYear(), U.getMonth() + e, 1)), R(!1), be(null);
2497
+ }, Ne = (e) => {
2498
+ he(e), u?.(e);
2499
+ }, Pe = (e, t) => {
2500
+ let n = Qt(e);
2501
+ _e(n), p?.(n, t);
2502
+ }, Fe = (e, t, n) => {
2503
+ V.current = t, be(e), Pe(e, n), R(!0);
2504
+ }, Ie = (e, t, n) => {
2505
+ Fe(e, t, n), W === "month" && e.getMonth() !== U.getMonth() && je(new Date(e.getFullYear(), e.getMonth(), 1));
2506
+ }, Le = (e) => {
2507
+ let t = K.includes(e) ? K.filter((t) => t !== e) : [...K, e];
2508
+ ve(t), ae?.(t);
2509
+ }, Re = rn(W === "week" ? G ?? U : U, o);
2510
+ return /* @__PURE__ */ $("div", {
2511
+ className: j("calendar board", oe && "full-width", se),
2512
+ ...ce,
2513
+ children: [
2514
+ /* @__PURE__ */ $("div", {
2515
+ className: "calendar header",
2516
+ children: [/* @__PURE__ */ $(ye, { children: [/* @__PURE__ */ Q(F, {
2517
+ level: 3,
2518
+ children: bn(U, W, le, o)
2519
+ }), /* @__PURE__ */ Q(P, {
2520
+ size: "sm",
2521
+ tone: "muted",
2522
+ children: xn(W, A)
2523
+ })] }), /* @__PURE__ */ $(ye, {
2524
+ align: "end",
2525
+ children: [/* @__PURE__ */ $("div", {
2526
+ className: "calendar actions",
2527
+ children: [/* @__PURE__ */ Q(L, {
2528
+ type: "button",
2529
+ size: "sm",
2530
+ variant: "outlined",
2531
+ color: "neutral",
2532
+ onClick: () => Me(-1),
2533
+ children: W === "week" ? A.previousWeek : ue.previousMonth
2534
+ }), /* @__PURE__ */ Q(L, {
2535
+ type: "button",
2536
+ size: "sm",
2537
+ variant: "outlined",
2538
+ color: "neutral",
2539
+ onClick: () => Me(1),
2540
+ children: W === "week" ? A.nextWeek : ue.nextMonth
2541
+ })]
2542
+ }), (ke || Ae) && /* @__PURE__ */ $("div", {
2543
+ className: "calendar views",
2544
+ children: [ke && /* @__PURE__ */ Q(L, {
2545
+ type: "button",
2546
+ size: "sm",
2547
+ variant: "outlined",
2548
+ color: W === "month" ? "primary" : "neutral",
2549
+ active: W === "month",
2550
+ onClick: () => Ne("month"),
2551
+ children: A.monthView
2552
+ }), Ae && /* @__PURE__ */ Q(L, {
2553
+ type: "button",
2554
+ size: "sm",
2555
+ variant: "outlined",
2556
+ color: W === "week" ? "primary" : "neutral",
2557
+ active: W === "week",
2558
+ onClick: () => Ne("week"),
2559
+ children: A.weekView
2560
+ })]
2561
+ })]
2562
+ })]
2563
+ }),
2564
+ /* @__PURE__ */ Q(Tn, {
2565
+ filters: k,
2566
+ activeFilterIds: K,
2567
+ onToggle: Le
2568
+ }),
2569
+ /* @__PURE__ */ Q("div", {
2570
+ className: "calendar days",
2571
+ children: Array.from({ length: 7 }, (e, t) => nn(Re, t)).map((e) => /* @__PURE__ */ Q("div", {
2572
+ className: "calendar day",
2573
+ children: new Intl.DateTimeFormat(le, { weekday: "short" }).format(e)
2574
+ }, en(e)))
2575
+ }),
2576
+ W === "week" ? /* @__PURE__ */ Q(En, {
2577
+ days: Ee,
2578
+ eventsByDay: Te,
2579
+ selectedDate: G,
2580
+ activeDate: N,
2581
+ onDayInteract: Ie,
2582
+ dayBadge: m,
2583
+ renderDayCell: h,
2584
+ showHourBar: ee,
2585
+ overlapWarning: S,
2586
+ onAddEvent: C,
2587
+ addEventLabel: w
2588
+ }) : /* @__PURE__ */ Q("div", {
2589
+ className: "calendar grid",
2590
+ children: Ee.map((e) => {
2591
+ let t = en(e), n = Te.get(t) ?? [], r = m?.(e, n) ?? (n.length > 0 ? /* @__PURE__ */ Q(B, {
2592
+ size: "sm",
2593
+ children: n.length
2594
+ }) : null), i = t === en(de), a = !!(G && t === en(G)), o = e.getMonth() !== U.getMonth(), s = {
2595
+ date: e,
2596
+ events: n,
2597
+ badge: r,
2598
+ isToday: i,
2599
+ isSelected: a,
2600
+ isOutsideMonth: o
2601
+ };
2602
+ return /* @__PURE__ */ Q(Dn, {
2603
+ date: e,
2604
+ events: n,
2605
+ badge: r,
2606
+ isToday: i,
2607
+ isSelected: a || !!(N && t === en(N)),
2608
+ isOutsideMonth: o,
2609
+ showHourBar: ee,
2610
+ overlapWarning: S,
2611
+ onAddEvent: C ? (e) => C(e) : void 0,
2612
+ addEventLabel: w,
2613
+ onClick: (t) => Ie(e, t.currentTarget, n),
2614
+ children: h ? h(e, s) : void 0
2615
+ }, t);
2616
+ })
2617
+ }),
2618
+ De === "popover" ? /* @__PURE__ */ Q(Nn, {
2619
+ open: I && !!N && !!V.current,
2620
+ anchorRef: V,
2621
+ onClose: () => R(!1),
2622
+ date: N,
2623
+ events: Oe,
2624
+ locale: le,
2625
+ timelineStartHour: b,
2626
+ timelineEndHour: x,
2627
+ showTimeline: y,
2628
+ overlapWarning: S,
2629
+ onAddEvent: C,
2630
+ addEventLabel: w,
2631
+ dayMenuLabel: T,
2632
+ renderDayMenu: E,
2633
+ onEventSelect: D,
2634
+ onEventEdit: te,
2635
+ onEventDelete: O,
2636
+ emptyStateText: ne ?? A.emptyStateText,
2637
+ renderEventItem: g,
2638
+ renderEventMenu: _
2639
+ }) : /* @__PURE__ */ Q(Se, {
2640
+ open: I && !!N,
2641
+ onClose: () => R(!1),
2642
+ size: "lg",
2643
+ children: /* @__PURE__ */ Q("div", {
2644
+ className: "calendar popover-scroll",
2645
+ children: /* @__PURE__ */ Q(Mn, {
2646
+ date: N,
2647
+ events: Oe,
2648
+ locale: le,
2649
+ timelineStartHour: b,
2650
+ timelineEndHour: x,
2651
+ showTimeline: y,
2652
+ overlapWarning: S,
2653
+ emptyStateText: ne ?? A.emptyStateText,
2654
+ addEventLabel: w,
2655
+ dayMenuLabel: T,
2656
+ onAddEvent: C,
2657
+ renderDayMenu: E,
2658
+ onEventSelect: D,
2659
+ onEventEdit: te,
2660
+ onEventDelete: O,
2661
+ renderEventItem: g,
2662
+ renderEventMenu: _
2663
+ })
2664
+ })
2665
+ })
2666
+ ]
2667
+ });
2668
+ }
2669
+ //#endregion
2670
+ //#region src/components/data/MChart/MChart.types.ts
2671
+ var Fn = [
2672
+ "primary",
2673
+ "info",
2674
+ "success",
2675
+ "warning",
2676
+ "error",
2677
+ "news",
2678
+ "neutral",
2679
+ "dark"
2680
+ ], In = {
2681
+ top: 20,
2682
+ right: 20,
2683
+ bottom: 40,
2684
+ left: 50
2685
+ }, Ln = {
2686
+ top: 20,
2687
+ right: 20,
2688
+ bottom: 55,
2689
+ left: 65
2690
+ };
2691
+ //#endregion
2692
+ //#region src/components/data/MChart/utils/formats.ts
2693
+ function Rn(e) {
2694
+ return Math.abs(e) >= 1e6 ? (e / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : Math.abs(e) >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : Number.isInteger(e) ? String(e) : e.toFixed(1);
2695
+ }
2696
+ function zn(e) {
2697
+ return e;
2698
+ }
2699
+ //#endregion
2700
+ //#region src/components/data/MChart/parts/ChartGrid.tsx
2701
+ function Bn({ x: e, y: t, width: n, height: r, horizontalLines: i, verticalLines: a }) {
2702
+ return /* @__PURE__ */ $("g", {
2703
+ className: "chart-grid",
2704
+ children: [i.map((t, r) => /* @__PURE__ */ Q("line", {
2705
+ x1: e,
2706
+ y1: t,
2707
+ x2: e + n,
2708
+ y2: t,
2709
+ className: "chart-grid-line"
2710
+ }, `h${r}`)), a?.map((e, n) => /* @__PURE__ */ Q("line", {
2711
+ x1: e,
2712
+ y1: t,
2713
+ x2: e,
2714
+ y2: t + r,
2715
+ className: "chart-grid-line chart-grid-line-vertical"
2716
+ }, `v${n}`))]
2717
+ });
2718
+ }
2719
+ //#endregion
2720
+ //#region src/components/data/MChart/parts/ChartAxis.tsx
2721
+ function Vn({ type: e, x: t, y: n, length: r, ticks: i, title: a }) {
2722
+ let o = e === "x";
2723
+ return /* @__PURE__ */ $("g", {
2724
+ className: `chart-axis chart-axis-${e}`,
2725
+ children: [
2726
+ /* @__PURE__ */ Q("line", {
2727
+ x1: t,
2728
+ y1: n,
2729
+ x2: o ? t + r : t,
2730
+ y2: o ? n : n - r,
2731
+ className: "chart-axis-line"
2732
+ }),
2733
+ i.map((e, r) => /* @__PURE__ */ Q("g", { children: o ? /* @__PURE__ */ Q("text", {
2734
+ x: e.position,
2735
+ y: n + 16,
2736
+ textAnchor: "middle",
2737
+ className: "chart-axis-label",
2738
+ children: e.label
2739
+ }) : /* @__PURE__ */ Q("text", {
2740
+ x: t - 8,
2741
+ y: e.position,
2742
+ textAnchor: "end",
2743
+ dominantBaseline: "middle",
2744
+ className: "chart-axis-label",
2745
+ children: e.label
2746
+ }) }, r)),
2747
+ a && (o ? /* @__PURE__ */ Q("text", {
2748
+ x: t + r / 2,
2749
+ y: n + 36,
2750
+ textAnchor: "middle",
2751
+ className: "chart-axis-title",
2752
+ children: a
2753
+ }) : /* @__PURE__ */ Q("text", {
2754
+ x: t - 40,
2755
+ y: n - r / 2,
2756
+ textAnchor: "middle",
2757
+ dominantBaseline: "middle",
2758
+ transform: `rotate(-90, ${t - 40}, ${n - r / 2})`,
2759
+ className: "chart-axis-title",
2760
+ children: a
2761
+ }))
2762
+ ]
2763
+ });
2764
+ }
2765
+ //#endregion
2766
+ //#region src/components/data/MChart/charts/MLineChart.tsx
2767
+ function Hn({ data: e, colors: t, innerWidth: n, innerHeight: r, padding: i, xAxis: a, yAxis: o, showGrid: s, showXAxis: c, showYAxis: l, curved: u, animated: d, valueFormatter: f = Rn, onTooltip: p, onDataClick: m }) {
2768
+ let [h, g] = Z(null), _ = n - i.left - i.right, v = r - i.top - i.bottom, { yMin: y, yMax: ee, yTicks: b, xLabels: x, seriesPoints: S } = Y(() => {
2769
+ let t = e.map((e) => e.data), [n, r] = Le(t), i = o?.min ?? Ne(n), s = o?.max ?? ke(r, n), c = je(i, s, o?.ticks ?? 5), l = Math.max(...t.map((e) => e.length), 1), u = a?.labels ?? Array.from({ length: l }, (e, t) => String(t)), d = De([0, Math.max(l - 1, 1)], [0, _]), f = De([i, s], [v, 0]);
2770
+ return {
2771
+ yMin: i,
2772
+ yMax: s,
2773
+ yTicks: c,
2774
+ xLabels: u,
2775
+ seriesPoints: t.map((e) => e.map((e, t) => ({
2776
+ x: d(t),
2777
+ y: f(e)
2778
+ })))
2779
+ };
2780
+ }, [
2781
+ e,
2782
+ _,
2783
+ v,
2784
+ a,
2785
+ o
2786
+ ]), C = De([y, ee], [v, 0]), w = De([0, Math.max(x.length - 1, 1)], [0, _]), T = J((r) => {
2787
+ let a = r.currentTarget.closest("svg");
2788
+ if (!a) return;
2789
+ let o = a.getBoundingClientRect(), s = n / o.width, c = (r.clientX - o.left) * s - i.left, l = Math.round(c / _ * Math.max(x.length - 1, 1)), u = Math.max(0, Math.min(l, x.length - 1));
2790
+ g(u), p({
2791
+ label: x[u],
2792
+ items: e.map((e, n) => ({
2793
+ name: e.label,
2794
+ value: e.data[u] ?? 0,
2795
+ color: e.color ?? t[n % t.length]
2796
+ })),
2797
+ x: r.clientX - o.left,
2798
+ y: r.clientY - o.top
2799
+ });
2800
+ }, [
2801
+ e,
2802
+ t,
2803
+ x,
2804
+ _,
2805
+ i.left,
2806
+ n,
2807
+ p
2808
+ ]), E = J(() => {
2809
+ g(null), p(null);
2810
+ }, [p]), D = b.map((e) => i.top + C(e)), te = x.map((e, t) => i.left + w(t)), O = b.map((e) => ({
2811
+ position: i.top + C(e),
2812
+ label: (o?.formatter ?? f)(e)
2813
+ })), ne = x.map((e, t) => ({
2814
+ position: i.left + w(t),
2815
+ label: e
2816
+ }));
2817
+ return /* @__PURE__ */ $("g", { children: [
2818
+ s && /* @__PURE__ */ Q(Bn, {
2819
+ x: i.left,
2820
+ y: i.top,
2821
+ width: _,
2822
+ height: v,
2823
+ horizontalLines: D,
2824
+ verticalLines: te
2825
+ }),
2826
+ l && /* @__PURE__ */ Q(Vn, {
2827
+ type: "y",
2828
+ x: i.left,
2829
+ y: i.top + v,
2830
+ length: v,
2831
+ ticks: O,
2832
+ title: o?.title
2833
+ }),
2834
+ c && /* @__PURE__ */ Q(Vn, {
2835
+ type: "x",
2836
+ x: i.left,
2837
+ y: i.top + v,
2838
+ length: _,
2839
+ ticks: ne,
2840
+ title: a?.title
2841
+ }),
2842
+ /* @__PURE__ */ $("g", {
2843
+ onMouseMove: T,
2844
+ onMouseLeave: E,
2845
+ children: [
2846
+ /* @__PURE__ */ Q("rect", {
2847
+ x: i.left,
2848
+ y: i.top,
2849
+ width: _,
2850
+ height: v,
2851
+ fill: "transparent"
2852
+ }),
2853
+ S.map((n, r) => {
2854
+ let a = e[r].color ?? t[r % t.length], o = u ? Ae(n.map((e) => ({
2855
+ x: e.x + i.left,
2856
+ y: e.y + i.top
2857
+ }))) : Ee(n.map((e) => ({
2858
+ x: e.x + i.left,
2859
+ y: e.y + i.top
2860
+ })));
2861
+ return /* @__PURE__ */ $("g", { children: [/* @__PURE__ */ Q("path", {
2862
+ className: `chart-line ${a} ${d ? "animated" : ""}`,
2863
+ d: o
2864
+ }), n.map((t, n) => /* @__PURE__ */ Q("circle", {
2865
+ className: `chart-dot ${a} ${h === n ? "active" : ""}`,
2866
+ cx: t.x + i.left,
2867
+ cy: t.y + i.top,
2868
+ r: h === n ? 5 : 3,
2869
+ onClick: () => m?.(r, n, e[r].data[n]),
2870
+ style: { cursor: m ? "pointer" : void 0 }
2871
+ }, n))] }, r);
2872
+ }),
2873
+ h !== null && /* @__PURE__ */ Q("line", {
2874
+ className: "chart-crosshair",
2875
+ x1: i.left + w(h),
2876
+ y1: i.top,
2877
+ x2: i.left + w(h),
2878
+ y2: i.top + v
2879
+ })
2880
+ ]
2881
+ })
2882
+ ] });
2883
+ }
2884
+ //#endregion
2885
+ //#region src/components/data/MChart/charts/MBarChart.tsx
2886
+ function Un({ data: e, colors: t, innerWidth: n, innerHeight: r, padding: i, xAxis: a, yAxis: o, showGrid: s, showXAxis: c, showYAxis: l, stacked: u, animated: d, valueFormatter: f = Rn, onTooltip: p, onDataClick: m }) {
2887
+ let [h, g] = Z(null), _ = n - i.left - i.right, v = r - i.top - i.bottom, { yMin: y, yMax: ee, yTicks: b, xLabels: x, maxLen: S } = Y(() => {
2888
+ let t = e.map((e) => e.data), n = Math.max(...t.map((e) => e.length), 1), r, i;
2889
+ u ? [r, i] = Oe(t) : [r, i] = Le(t);
2890
+ let s = o?.min ?? Ne(r), c = o?.max ?? ke(i, r);
2891
+ return {
2892
+ yMin: s,
2893
+ yMax: c,
2894
+ yTicks: je(s, c, o?.ticks ?? 5),
2895
+ xLabels: a?.labels ?? Array.from({ length: n }, (e, t) => String(t)),
2896
+ maxLen: n
2897
+ };
2898
+ }, [
2899
+ e,
2900
+ a,
2901
+ o,
2902
+ u
2903
+ ]), C = De([y, ee], [v, 0]), w = _ / S, T = Math.max(w * .1, 2), E = e.length, D = J((n, r, i) => {
2904
+ g({
2905
+ di: n,
2906
+ pi: r
2907
+ });
2908
+ let a = i.currentTarget.closest("svg");
2909
+ if (!a) return;
2910
+ let o = a.getBoundingClientRect();
2911
+ p({
2912
+ label: x[r],
2913
+ items: u ? e.map((e, n) => ({
2914
+ name: e.label,
2915
+ value: e.data[r] ?? 0,
2916
+ color: e.color ?? t[n % t.length]
2917
+ })) : [{
2918
+ name: e[n].label,
2919
+ value: e[n].data[r],
2920
+ color: e[n].color ?? t[n % t.length]
2921
+ }],
2922
+ x: i.clientX - o.left,
2923
+ y: i.clientY - o.top
2924
+ });
2925
+ }, [
2926
+ e,
2927
+ t,
2928
+ x,
2929
+ u,
2930
+ p
2931
+ ]), te = J(() => {
2932
+ g(null), p(null);
2933
+ }, [p]), O = b.map((e) => i.top + C(e)), ne = x.map((e, t) => ({
2934
+ position: i.left + w * t + w / 2,
2935
+ label: e
2936
+ })), k = b.map((e) => ({
2937
+ position: i.top + C(e),
2938
+ label: (o?.formatter ?? f)(e)
2939
+ })), re = C(0);
2940
+ return /* @__PURE__ */ $("g", { children: [
2941
+ s && /* @__PURE__ */ Q(Bn, {
2942
+ x: i.left,
2943
+ y: i.top,
2944
+ width: _,
2945
+ height: v,
2946
+ horizontalLines: O
2947
+ }),
2948
+ l && /* @__PURE__ */ Q(Vn, {
2949
+ type: "y",
2950
+ x: i.left,
2951
+ y: i.top + v,
2952
+ length: v,
2953
+ ticks: k,
2954
+ title: o?.title
2955
+ }),
2956
+ c && /* @__PURE__ */ Q(Vn, {
2957
+ type: "x",
2958
+ x: i.left,
2959
+ y: i.top + v,
2960
+ length: _,
2961
+ ticks: ne,
2962
+ title: a?.title
2963
+ }),
2964
+ /* @__PURE__ */ Q("g", {
2965
+ onMouseLeave: te,
2966
+ children: u ? x.map((n, r) => {
2967
+ let a = re, o = w - T * 2, s = i.left + w * r + T;
2968
+ return /* @__PURE__ */ Q("g", { children: e.map((n, c) => {
2969
+ let l = n.data[r] ?? 0, u = re - C(l), f = a - u;
2970
+ a = f;
2971
+ let p = n.color ?? t[c % t.length], g = h?.di === c && h?.pi === r;
2972
+ return /* @__PURE__ */ Q("rect", {
2973
+ className: `chart-bar ${p} ${d ? "animated" : ""} ${g ? "active" : ""}`,
2974
+ x: s,
2975
+ y: i.top + f,
2976
+ width: Math.max(o, 1),
2977
+ height: Math.max(u, 0),
2978
+ rx: c === e.length - 1 ? 3 : 0,
2979
+ onMouseEnter: (e) => D(c, r, e),
2980
+ onClick: () => m?.(c, r, l),
2981
+ style: { cursor: m ? "pointer" : void 0 }
2982
+ }, c);
2983
+ }) }, r);
2984
+ }) : e.map((e, n) => {
2985
+ let r = (w - T * 2) / E;
2986
+ return /* @__PURE__ */ Q("g", { children: e.data.map((a, o) => {
2987
+ let s = re - C(a), c = i.left + w * o + T + r * n, l = Math.min(re, C(a)), u = e.color ?? t[n % t.length], f = h?.di === n && h?.pi === o;
2988
+ return /* @__PURE__ */ Q("rect", {
2989
+ className: `chart-bar ${u} ${d ? "animated" : ""} ${f ? "active" : ""}`,
2990
+ x: c,
2991
+ y: i.top + l,
2992
+ width: Math.max(r, 1),
2993
+ height: Math.max(Math.abs(s), 0),
2994
+ rx: 3,
2995
+ onMouseEnter: (e) => D(n, o, e),
2996
+ onClick: () => m?.(n, o, a),
2997
+ style: { cursor: m ? "pointer" : void 0 }
2998
+ }, o);
2999
+ }) }, n);
3000
+ })
3001
+ })
3002
+ ] });
3003
+ }
3004
+ //#endregion
3005
+ //#region src/components/data/MChart/charts/MAreaChart.tsx
3006
+ function Wn({ data: e, colors: t, innerWidth: n, innerHeight: r, padding: i, xAxis: a, yAxis: o, showGrid: s, showXAxis: c, showYAxis: l, curved: u, stacked: d, animated: f, valueFormatter: p = Rn, onTooltip: m, onDataClick: h }) {
3007
+ let [g, _] = Z(null), v = n - i.left - i.right, y = r - i.top - i.bottom, { yMin: ee, yMax: b, yTicks: x, xLabels: S, seriesPoints: C, stackedPaths: w } = Y(() => {
3008
+ let t = e.map((e) => e.data), n = Math.max(...t.map((e) => e.length), 1), r, s;
3009
+ d ? [r, s] = Oe(t) : [r, s] = Le(t);
3010
+ let c = o?.min ?? Ne(r), l = o?.max ?? ke(s, r), f = je(c, l, o?.ticks ?? 5), p = a?.labels ?? Array.from({ length: n }, (e, t) => String(t)), m = De([0, Math.max(n - 1, 1)], [0, v]), h = De([c, l], [y, 0]);
3011
+ if (d) {
3012
+ let e = [];
3013
+ for (let r = 0; r < t.length; r++) {
3014
+ e[r] = [];
3015
+ for (let i = 0; i < n; i++) e[r][i] = (t[r][i] ?? 0) + (r > 0 ? e[r - 1][i] : 0);
3016
+ }
3017
+ return {
3018
+ yMin: c,
3019
+ yMax: l,
3020
+ yTicks: f,
3021
+ xLabels: p,
3022
+ seriesPoints: [],
3023
+ stackedPaths: e.map((t, n) => {
3024
+ let r = t.map((e, t) => ({
3025
+ x: i.left + m(t),
3026
+ y: i.top + h(e)
3027
+ }));
3028
+ return {
3029
+ area: Fe(r, n === 0 ? t.map((e, t) => ({
3030
+ x: i.left + m(t),
3031
+ y: i.top + h(0)
3032
+ })) : e[n - 1].map((e, t) => ({
3033
+ x: i.left + m(t),
3034
+ y: i.top + h(e)
3035
+ })), u),
3036
+ line: u ? Ae(r) : Ee(r),
3037
+ topPts: r
3038
+ };
3039
+ })
3040
+ };
3041
+ }
3042
+ return {
3043
+ yMin: c,
3044
+ yMax: l,
3045
+ yTicks: f,
3046
+ xLabels: p,
3047
+ seriesPoints: t.map((e) => e.map((e, t) => ({
3048
+ x: i.left + m(t),
3049
+ y: i.top + h(e)
3050
+ }))),
3051
+ stackedPaths: void 0
3052
+ };
3053
+ }, [
3054
+ e,
3055
+ v,
3056
+ y,
3057
+ a,
3058
+ o,
3059
+ d,
3060
+ u,
3061
+ i
3062
+ ]), T = De([ee, b], [y, 0]), E = De([0, Math.max(S.length - 1, 1)], [0, v]), D = J((r) => {
3063
+ let a = r.currentTarget.closest("svg");
3064
+ if (!a) return;
3065
+ let o = a.getBoundingClientRect(), s = n / o.width, c = (r.clientX - o.left) * s - i.left, l = Math.round(c / v * Math.max(S.length - 1, 1)), u = Math.max(0, Math.min(l, S.length - 1));
3066
+ _(u), m({
3067
+ label: S[u],
3068
+ items: e.map((e, n) => ({
3069
+ name: e.label,
3070
+ value: e.data[u] ?? 0,
3071
+ color: e.color ?? t[n % t.length]
3072
+ })),
3073
+ x: r.clientX - o.left,
3074
+ y: r.clientY - o.top
3075
+ });
3076
+ }, [
3077
+ e,
3078
+ t,
3079
+ S,
3080
+ v,
3081
+ i.left,
3082
+ n,
3083
+ m
3084
+ ]), te = J(() => {
3085
+ _(null), m(null);
3086
+ }, [m]), O = x.map((e) => i.top + T(e)), ne = x.map((e) => ({
3087
+ position: i.top + T(e),
3088
+ label: (o?.formatter ?? p)(e)
3089
+ })), k = S.map((e, t) => ({
3090
+ position: i.left + E(t),
3091
+ label: e
3092
+ }));
3093
+ return /* @__PURE__ */ $("g", { children: [
3094
+ s && /* @__PURE__ */ Q(Bn, {
3095
+ x: i.left,
3096
+ y: i.top,
3097
+ width: v,
3098
+ height: y,
3099
+ horizontalLines: O
3100
+ }),
3101
+ l && /* @__PURE__ */ Q(Vn, {
3102
+ type: "y",
3103
+ x: i.left,
3104
+ y: i.top + y,
3105
+ length: y,
3106
+ ticks: ne,
3107
+ title: o?.title
3108
+ }),
3109
+ c && /* @__PURE__ */ Q(Vn, {
3110
+ type: "x",
3111
+ x: i.left,
3112
+ y: i.top + y,
3113
+ length: v,
3114
+ ticks: k,
3115
+ title: a?.title
3116
+ }),
3117
+ /* @__PURE__ */ $("g", {
3118
+ onMouseMove: D,
3119
+ onMouseLeave: te,
3120
+ children: [
3121
+ /* @__PURE__ */ Q("rect", {
3122
+ x: i.left,
3123
+ y: i.top,
3124
+ width: v,
3125
+ height: y,
3126
+ fill: "transparent"
3127
+ }),
3128
+ d && w ? w.map((n, r) => {
3129
+ let i = e[r].color ?? t[r % t.length];
3130
+ return /* @__PURE__ */ $("g", { children: [/* @__PURE__ */ Q("path", {
3131
+ className: `chart-area-fill ${i}`,
3132
+ d: n.area
3133
+ }), /* @__PURE__ */ Q("path", {
3134
+ className: `chart-line ${i} ${f ? "animated" : ""}`,
3135
+ d: n.line
3136
+ })] }, r);
3137
+ }) : C.map((n, r) => {
3138
+ let a = e[r].color ?? t[r % t.length], o = u ? Ae(n) : Ee(n), s = Pe(n, i.top + y, u);
3139
+ return /* @__PURE__ */ $("g", { children: [
3140
+ /* @__PURE__ */ Q("path", {
3141
+ className: `chart-area-fill ${a}`,
3142
+ d: s
3143
+ }),
3144
+ /* @__PURE__ */ Q("path", {
3145
+ className: `chart-line ${a} ${f ? "animated" : ""}`,
3146
+ d: o
3147
+ }),
3148
+ n.map((t, n) => /* @__PURE__ */ Q("circle", {
3149
+ className: `chart-dot ${a} ${g === n ? "active" : ""}`,
3150
+ cx: t.x,
3151
+ cy: t.y,
3152
+ r: g === n ? 5 : 3,
3153
+ onClick: () => h?.(r, n, e[r].data[n]),
3154
+ style: { cursor: h ? "pointer" : void 0 }
3155
+ }, n))
3156
+ ] }, r);
3157
+ }),
3158
+ g !== null && /* @__PURE__ */ Q("line", {
3159
+ className: "chart-crosshair",
3160
+ x1: i.left + E(g),
3161
+ y1: i.top,
3162
+ x2: i.left + E(g),
3163
+ y2: i.top + y
3164
+ })
3165
+ ]
3166
+ })
3167
+ ] });
3168
+ }
3169
+ //#endregion
3170
+ //#region src/components/data/MChart/charts/MPieChart.tsx
3171
+ function Gn({ data: e, colors: t, innerWidth: n, innerHeight: r, donut: i, donutWidth: a, animated: o, valueFormatter: s = Rn, xAxis: c, onTooltip: l, onDataClick: u }) {
3172
+ let [d, f] = Z(null), p = n / 2, m = r / 2, h = Math.min(p, m) - 10, g = i ? h - (a ?? h * .4) : 0, _ = Y(() => {
3173
+ let n = e.length === 1 ? e[0].data : e.map((e) => e.data[0] ?? 0), r = e.length === 1 ? c?.labels ?? n.map((e, t) => `Segment ${t + 1}`) : e.map((e) => e.label), i = n.reduce((e, t) => e + Math.max(t, 0), 0) || 1, a = -Math.PI / 2;
3174
+ return n.map((n, o) => {
3175
+ let s = Math.max(n, 0) / i * Math.PI * 2, c = {
3176
+ value: n,
3177
+ label: r[o] ?? `Segment ${o + 1}`,
3178
+ color: (e.length === 1 ? void 0 : e[o].color) ?? t[o % t.length],
3179
+ startAngle: a,
3180
+ endAngle: a + s,
3181
+ percentage: Math.max(n, 0) / i * 100
3182
+ };
3183
+ return a += s, c;
3184
+ });
3185
+ }, [
3186
+ e,
3187
+ t,
3188
+ c
3189
+ ]), v = J((e, t) => {
3190
+ f(e);
3191
+ let n = t.currentTarget.closest("svg");
3192
+ if (!n) return;
3193
+ let r = n.getBoundingClientRect();
3194
+ l({
3195
+ label: _[e].label,
3196
+ items: [{
3197
+ name: _[e].label,
3198
+ value: _[e].value,
3199
+ color: _[e].color
3200
+ }],
3201
+ x: t.clientX - r.left,
3202
+ y: t.clientY - r.top
3203
+ });
3204
+ }, [_, l]), y = J(() => {
3205
+ f(null), l(null);
3206
+ }, [l]);
3207
+ return /* @__PURE__ */ $("g", { children: [_.map((e, t) => {
3208
+ let n = d === t, r = Me(p, m, n ? h + 4 : h, g, e.startAngle, e.endAngle);
3209
+ return /* @__PURE__ */ Q("path", {
3210
+ className: `chart-pie-segment ${e.color} ${o ? "animated" : ""} ${n ? "active" : ""}`,
3211
+ d: r,
3212
+ onMouseEnter: (e) => v(t, e),
3213
+ onMouseLeave: y,
3214
+ onMouseMove: (t) => {
3215
+ let n = t.currentTarget.closest("svg");
3216
+ if (!n) return;
3217
+ let r = n.getBoundingClientRect();
3218
+ l({
3219
+ label: e.label,
3220
+ items: [{
3221
+ name: e.label,
3222
+ value: e.value,
3223
+ color: e.color
3224
+ }],
3225
+ x: t.clientX - r.left,
3226
+ y: t.clientY - r.top
3227
+ });
3228
+ },
3229
+ onClick: () => u?.(0, t, e.value),
3230
+ style: { cursor: u ? "pointer" : void 0 }
3231
+ }, t);
3232
+ }), i && /* @__PURE__ */ Q("text", {
3233
+ x: p,
3234
+ y: m,
3235
+ textAnchor: "middle",
3236
+ dominantBaseline: "middle",
3237
+ className: "chart-pie-center",
3238
+ children: s(d === null ? _.reduce((e, t) => e + t.value, 0) : _[d].value)
3239
+ })] });
3240
+ }
3241
+ //#endregion
3242
+ //#region src/components/data/MChart/parts/ChartDefs.tsx
3243
+ var Kn = [
3244
+ "primary",
3245
+ "info",
3246
+ "success",
3247
+ "warning",
3248
+ "error",
3249
+ "news",
3250
+ "neutral",
3251
+ "dark",
3252
+ "light"
3253
+ ];
3254
+ function qn() {
3255
+ return /* @__PURE__ */ $("defs", { children: [
3256
+ Kn.map((e) => /* @__PURE__ */ $("linearGradient", {
3257
+ id: `chart-bar-grad-${e}`,
3258
+ x1: "0",
3259
+ y1: "0",
3260
+ x2: "0",
3261
+ y2: "1",
3262
+ children: [/* @__PURE__ */ Q("stop", {
3263
+ offset: "0%",
3264
+ className: `chart-grad-stop-start ${e}`
3265
+ }), /* @__PURE__ */ Q("stop", {
3266
+ offset: "100%",
3267
+ className: `chart-grad-stop-end ${e}`
3268
+ })]
3269
+ }, `bar-${e}`)),
3270
+ Kn.map((e) => /* @__PURE__ */ $("linearGradient", {
3271
+ id: `chart-pie-grad-${e}`,
3272
+ x1: "0.3",
3273
+ y1: "0",
3274
+ x2: "0.7",
3275
+ y2: "1",
3276
+ children: [/* @__PURE__ */ Q("stop", {
3277
+ offset: "0%",
3278
+ className: `chart-grad-stop-start ${e}`
3279
+ }), /* @__PURE__ */ Q("stop", {
3280
+ offset: "100%",
3281
+ className: `chart-grad-stop-end ${e}`
3282
+ })]
3283
+ }, `pie-${e}`)),
3284
+ Kn.map((e) => /* @__PURE__ */ $("linearGradient", {
3285
+ id: `chart-area-grad-${e}`,
3286
+ x1: "0",
3287
+ y1: "0",
3288
+ x2: "0",
3289
+ y2: "1",
3290
+ children: [/* @__PURE__ */ Q("stop", {
3291
+ offset: "0%",
3292
+ className: `chart-grad-area-start ${e}`
3293
+ }), /* @__PURE__ */ Q("stop", {
3294
+ offset: "100%",
3295
+ className: `chart-grad-area-end ${e}`
3296
+ })]
3297
+ }, `area-${e}`))
3298
+ ] });
3299
+ }
3300
+ //#endregion
3301
+ //#region src/components/data/MChart/parts/ChartTooltip.tsx
3302
+ function Jn({ data: e, valueFormatter: t }) {
3303
+ return e ? /* @__PURE__ */ $("div", {
3304
+ className: "chart-tooltip",
3305
+ style: {
3306
+ left: e.x,
3307
+ top: e.y
3308
+ },
3309
+ children: [/* @__PURE__ */ Q("div", {
3310
+ className: "chart-tooltip-label",
3311
+ children: e.label
3312
+ }), e.items.map((e, n) => /* @__PURE__ */ $("div", {
3313
+ className: "chart-tooltip-row",
3314
+ children: [
3315
+ /* @__PURE__ */ Q("span", { className: `chart-tooltip-dot ${e.color}` }),
3316
+ /* @__PURE__ */ Q("span", {
3317
+ className: "chart-tooltip-name",
3318
+ children: e.name
3319
+ }),
3320
+ /* @__PURE__ */ Q("span", {
3321
+ className: "chart-tooltip-value",
3322
+ children: t(e.value)
3323
+ })
3324
+ ]
3325
+ }, n))]
3326
+ }) : null;
3327
+ }
3328
+ //#endregion
3329
+ //#region src/components/data/MChart/parts/ChartLegend.tsx
3330
+ function Yn({ items: e }) {
3331
+ return e.length <= 1 ? null : /* @__PURE__ */ Q("div", {
3332
+ className: "chart-legend",
3333
+ children: e.map((e, t) => /* @__PURE__ */ $("div", {
3334
+ className: "chart-legend-item",
3335
+ children: [/* @__PURE__ */ Q("span", { className: `chart-legend-dot ${e.color}` }), /* @__PURE__ */ Q("span", {
3336
+ className: "chart-legend-label",
3337
+ children: e.label
3338
+ })]
3339
+ }, t))
3340
+ });
3341
+ }
3342
+ //#endregion
3343
+ //#region src/components/data/MChart/MChart.tsx
3344
+ function Xn({ type: e, data: t, width: n = "100%", height: r = 300, aspectRatio: i, xAxis: a, yAxis: o, showGrid: s = !0, showXAxis: c = !0, showYAxis: l = !0, showLegend: u = !0, showTooltip: d = !0, animated: f = !0, stacked: p = !1, curved: m = !1, donut: h = !1, donutWidth: g, valueFormatter: _ = Rn, labelFormatter: v = zn, onDataClick: y, className: ee, style: b, ...x }) {
3345
+ let S = X(null), [C, w] = Z(null), T = Fn, E = a?.title || o?.title ? Ln : In, D = i ? void 0 : typeof r == "number" ? r : 300, te = D ?? 300, O = J((e) => {
3346
+ d && w(e);
3347
+ }, [d]), ne = Y(() => e === "pie" && t.length === 1 ? (a?.labels ?? t[0].data.map((e, t) => `Segment ${t + 1}`)).map((e, t) => ({
3348
+ label: e,
3349
+ color: T[t % T.length]
3350
+ })) : t.map((e, t) => ({
3351
+ label: e.label,
3352
+ color: e.color ?? T[t % T.length]
3353
+ })), [
3354
+ t,
3355
+ T,
3356
+ e,
3357
+ a
3358
+ ]), k = {
3359
+ data: t,
3360
+ colors: T,
3361
+ innerWidth: 600,
3362
+ innerHeight: te,
3363
+ padding: E,
3364
+ xAxis: a,
3365
+ yAxis: o,
3366
+ showGrid: s,
3367
+ showXAxis: c,
3368
+ showYAxis: l,
3369
+ animated: f,
3370
+ valueFormatter: _,
3371
+ onTooltip: O,
3372
+ onDataClick: y
3373
+ };
3374
+ return /* @__PURE__ */ $("div", {
3375
+ ref: S,
3376
+ className: j("chart", ee),
3377
+ style: {
3378
+ width: n,
3379
+ height: i ? void 0 : D,
3380
+ aspectRatio: i ? String(i) : void 0,
3381
+ ...b
3382
+ },
3383
+ ...x,
3384
+ children: [
3385
+ /* @__PURE__ */ $("svg", {
3386
+ viewBox: `0 0 600 ${te}`,
3387
+ preserveAspectRatio: "xMidYMid meet",
3388
+ className: "chart-svg",
3389
+ children: [
3390
+ /* @__PURE__ */ Q(qn, {}),
3391
+ e === "line" && /* @__PURE__ */ Q(Hn, {
3392
+ ...k,
3393
+ curved: m
3394
+ }),
3395
+ e === "bar" && /* @__PURE__ */ Q(Un, {
3396
+ ...k,
3397
+ stacked: p
3398
+ }),
3399
+ e === "area" && /* @__PURE__ */ Q(Wn, {
3400
+ ...k,
3401
+ curved: m,
3402
+ stacked: p
3403
+ }),
3404
+ e === "pie" && /* @__PURE__ */ Q(Gn, {
3405
+ ...k,
3406
+ donut: h,
3407
+ donutWidth: g
3408
+ })
3409
+ ]
3410
+ }),
3411
+ d && /* @__PURE__ */ Q(Jn, {
3412
+ data: C,
3413
+ valueFormatter: _
3414
+ }),
3415
+ u && /* @__PURE__ */ Q(Yn, { items: ne })
3416
+ ]
3417
+ });
3418
+ }
3419
+ //#endregion
3420
+ //#region src/components/data/MChart/MLineChart.tsx
3421
+ function Zn(e) {
3422
+ return /* @__PURE__ */ Q(Xn, {
3423
+ type: "line",
3424
+ ...e
3425
+ });
3426
+ }
3427
+ //#endregion
3428
+ //#region src/components/data/MChart/MBarChart.tsx
3429
+ function Qn(e) {
3430
+ return /* @__PURE__ */ Q(Xn, {
3431
+ type: "bar",
3432
+ ...e
3433
+ });
3434
+ }
3435
+ //#endregion
3436
+ //#region src/components/data/MChart/MAreaChart.tsx
3437
+ function $n(e) {
3438
+ return /* @__PURE__ */ Q(Xn, {
3439
+ type: "area",
3440
+ ...e
3441
+ });
3442
+ }
3443
+ //#endregion
3444
+ //#region src/components/data/MChart/MPieChart.tsx
3445
+ function er(e) {
3446
+ return /* @__PURE__ */ Q(Xn, {
3447
+ type: "pie",
3448
+ ...e
3449
+ });
3450
+ }
3451
+ //#endregion
3452
+ export { Ze as S, at as _, Pn as a, et as b, kn as c, jn as d, Gt as f, ot as g, st as h, Zn as i, Nn as l, ct as m, $n as n, Dn as o, kt as p, Qn as r, On as s, er as t, wn as u, it as v, Qe as x, tt as y };
3453
+
3454
+ //# sourceMappingURL=data-RXuvb9VI.js.map