mada-design-system 1.5.2 → 1.5.4

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 (300) hide show
  1. package/index.cjs113.js +1 -1
  2. package/index.cjs114.js +1 -1
  3. package/index.cjs115.js +1 -1
  4. package/index.cjs116.js +1 -1
  5. package/index.cjs117.js +1 -1
  6. package/index.cjs120.js +1 -1
  7. package/index.cjs126.js +1 -1
  8. package/index.cjs146.js +1 -1
  9. package/index.cjs147.js +1 -1
  10. package/index.cjs157.js +1 -1
  11. package/index.cjs159.js +1 -1
  12. package/index.cjs186.js +1 -1
  13. package/index.cjs190.js +1 -1
  14. package/index.cjs198.js +1 -1
  15. package/index.cjs199.js +1 -1
  16. package/index.cjs200.js +1 -1
  17. package/index.cjs206.js +1 -1
  18. package/index.cjs207.js +1 -1
  19. package/index.cjs208.js +1 -1
  20. package/index.cjs209.js +1 -1
  21. package/index.cjs210.js +1 -1
  22. package/index.cjs211.js +1 -1
  23. package/index.cjs212.js +1 -1
  24. package/index.cjs213.js +1 -1
  25. package/index.cjs214.js +1 -1
  26. package/index.cjs215.js +1 -1
  27. package/index.cjs216.js +1 -1
  28. package/index.cjs217.js +1 -1
  29. package/index.cjs218.js +1 -1
  30. package/index.cjs219.js +1 -1
  31. package/index.cjs220.js +1 -1
  32. package/index.cjs221.js +1 -1
  33. package/index.cjs222.js +1 -1
  34. package/index.cjs223.js +1 -1
  35. package/index.cjs224.js +1 -1
  36. package/index.cjs225.js +1 -1
  37. package/index.cjs226.js +1 -1
  38. package/index.cjs227.js +1 -1
  39. package/index.cjs228.js +1 -1
  40. package/index.cjs229.js +1 -1
  41. package/index.cjs230.js +1 -1
  42. package/index.cjs231.js +1 -1
  43. package/index.cjs232.js +1 -1
  44. package/index.cjs233.js +1 -1
  45. package/index.cjs234.js +1 -1
  46. package/index.cjs235.js +1 -1
  47. package/index.cjs236.js +1 -1
  48. package/index.cjs237.js +1 -1
  49. package/index.cjs238.js +1 -1
  50. package/index.cjs239.js +1 -1
  51. package/index.cjs240.js +1 -1
  52. package/index.cjs241.js +1 -1
  53. package/index.cjs242.js +1 -1
  54. package/index.cjs243.js +1 -1
  55. package/index.cjs244.js +1 -1
  56. package/index.cjs245.js +1 -1
  57. package/index.cjs246.js +1 -1
  58. package/index.cjs247.js +1 -1
  59. package/index.cjs248.js +1 -1
  60. package/index.cjs249.js +1 -1
  61. package/index.cjs250.js +1 -1
  62. package/index.cjs251.js +1 -1
  63. package/index.cjs252.js +1 -1
  64. package/index.cjs253.js +1 -1
  65. package/index.cjs254.js +1 -1
  66. package/index.cjs255.js +1 -1
  67. package/index.cjs256.js +1 -1
  68. package/index.cjs257.js +1 -1
  69. package/index.cjs258.js +1 -1
  70. package/index.cjs259.js +1 -1
  71. package/index.cjs260.js +1 -1
  72. package/index.cjs261.js +1 -1
  73. package/index.cjs262.js +1 -1
  74. package/index.cjs263.js +1 -1
  75. package/index.cjs264.js +1 -1
  76. package/index.cjs265.js +1 -1
  77. package/index.cjs266.js +1 -1
  78. package/index.cjs267.js +1 -1
  79. package/index.cjs268.js +1 -1
  80. package/index.cjs269.js +1 -1
  81. package/index.cjs270.js +1 -1
  82. package/index.cjs271.js +1 -1
  83. package/index.cjs272.js +1 -1
  84. package/index.cjs273.js +1 -1
  85. package/index.cjs274.js +1 -1
  86. package/index.cjs275.js +1 -1
  87. package/index.cjs276.js +1 -1
  88. package/index.cjs277.js +1 -1
  89. package/index.cjs278.js +1 -1
  90. package/index.cjs279.js +1 -1
  91. package/index.cjs280.js +1 -1
  92. package/index.cjs281.js +1 -1
  93. package/index.cjs282.js +1 -1
  94. package/index.cjs283.js +1 -1
  95. package/index.cjs284.js +1 -1
  96. package/index.cjs285.js +1 -1
  97. package/index.cjs286.js +1 -1
  98. package/index.cjs287.js +1 -1
  99. package/index.cjs29.js +1 -1
  100. package/index.cjs35.js +1 -1
  101. package/index.cjs354.js +1 -1
  102. package/index.cjs355.js +1 -1
  103. package/index.cjs374.js +1 -1
  104. package/index.cjs375.js +1 -1
  105. package/index.cjs376.js +1 -1
  106. package/index.cjs377.js +1 -1
  107. package/index.cjs378.js +1 -1
  108. package/index.cjs379.js +1 -1
  109. package/index.cjs380.js +1 -1
  110. package/index.cjs381.js +1 -1
  111. package/index.cjs382.js +1 -1
  112. package/index.cjs383.js +1 -1
  113. package/index.cjs384.js +1 -1
  114. package/index.cjs385.js +1 -1
  115. package/index.cjs386.js +1 -1
  116. package/index.cjs387.js +1 -1
  117. package/index.cjs388.js +1 -1
  118. package/index.cjs389.js +1 -1
  119. package/index.cjs390.js +1 -1
  120. package/index.cjs391.js +1 -1
  121. package/index.cjs392.js +1 -1
  122. package/index.cjs393.js +1 -1
  123. package/index.cjs394.js +1 -1
  124. package/index.cjs395.js +1 -1
  125. package/index.cjs396.js +1 -1
  126. package/index.cjs397.js +1 -1
  127. package/index.cjs398.js +1 -1
  128. package/index.cjs399.js +1 -1
  129. package/index.cjs400.js +1 -1
  130. package/index.cjs401.js +1 -1
  131. package/index.cjs402.js +1 -1
  132. package/index.cjs403.js +1 -1
  133. package/index.cjs404.js +1 -1
  134. package/index.cjs405.js +1 -1
  135. package/index.cjs406.js +1 -1
  136. package/index.cjs407.js +1 -1
  137. package/index.cjs408.js +1 -1
  138. package/index.cjs409.js +1 -1
  139. package/index.cjs410.js +1 -1
  140. package/index.cjs411.js +1 -1
  141. package/index.cjs412.js +1 -1
  142. package/index.cjs413.js +1 -1
  143. package/index.cjs414.js +1 -1
  144. package/index.cjs415.js +1 -1
  145. package/index.cjs416.js +1 -1
  146. package/index.cjs426.js +1 -1
  147. package/index.cjs427.js +1 -1
  148. package/index.cjs49.js +2 -2
  149. package/index.cjs54.js +1 -1
  150. package/index.es.d.ts +1 -0
  151. package/index.es113.js +3 -3
  152. package/index.es114.js +2 -2
  153. package/index.es115.js +5 -5
  154. package/index.es116.js +5 -5
  155. package/index.es117.js +5 -5
  156. package/index.es120.js +2 -2
  157. package/index.es126.js +1 -1
  158. package/index.es146.js +1 -1
  159. package/index.es147.js +1 -1
  160. package/index.es157.js +5 -5
  161. package/index.es159.js +7 -7
  162. package/index.es186.js +2 -2
  163. package/index.es190.js +1 -1
  164. package/index.es198.js +481 -2
  165. package/index.es199.js +13 -477
  166. package/index.es200.js +2 -17
  167. package/index.es206.js +98 -33
  168. package/index.es207.js +30 -1201
  169. package/index.es208.js +9 -13
  170. package/index.es209.js +139 -23
  171. package/index.es210.js +117 -11
  172. package/index.es211.js +98 -39
  173. package/index.es212.js +31 -2000
  174. package/index.es213.js +9 -7
  175. package/index.es214.js +141 -72
  176. package/index.es215.js +116 -24
  177. package/index.es216.js +36 -66
  178. package/index.es217.js +16 -16
  179. package/index.es218.js +7 -7
  180. package/index.es219.js +117 -105
  181. package/index.es220.js +70 -79
  182. package/index.es221.js +8 -98
  183. package/index.es222.js +6 -31
  184. package/index.es223.js +6 -9
  185. package/index.es224.js +18 -141
  186. package/index.es225.js +6 -117
  187. package/index.es226.js +6 -68
  188. package/index.es227.js +7 -31
  189. package/index.es228.js +14 -9
  190. package/index.es229.js +16 -153
  191. package/index.es230.js +9 -108
  192. package/index.es231.js +6 -7
  193. package/index.es232.js +10 -5
  194. package/index.es233.js +14 -5
  195. package/index.es234.js +5 -17
  196. package/index.es235.js +14 -5
  197. package/index.es236.js +5 -5
  198. package/index.es237.js +9 -7
  199. package/index.es238.js +6 -13
  200. package/index.es239.js +4 -15
  201. package/index.es240.js +6 -8
  202. package/index.es241.js +580 -6
  203. package/index.es242.js +50 -11
  204. package/index.es243.js +17 -14
  205. package/index.es244.js +8 -5
  206. package/index.es245.js +6 -14
  207. package/index.es246.js +7 -5
  208. package/index.es247.js +5 -8
  209. package/index.es248.js +6 -6
  210. package/index.es249.js +9 -4
  211. package/index.es250.js +4 -5
  212. package/index.es251.js +8 -580
  213. package/index.es252.js +13 -50
  214. package/index.es253.js +5 -17
  215. package/index.es254.js +9 -8
  216. package/index.es255.js +8 -6
  217. package/index.es256.js +10 -7
  218. package/index.es257.js +14 -5
  219. package/index.es258.js +4 -5
  220. package/index.es259.js +5 -9
  221. package/index.es260.js +4 -5
  222. package/index.es261.js +11 -8
  223. package/index.es262.js +10 -12
  224. package/index.es263.js +9 -4
  225. package/index.es264.js +11 -9
  226. package/index.es265.js +11 -8
  227. package/index.es266.js +38 -10
  228. package/index.es267.js +65 -15
  229. package/index.es268.js +9 -5
  230. package/index.es269.js +8 -5
  231. package/index.es270.js +7 -4
  232. package/index.es271.js +10 -11
  233. package/index.es272.js +7 -10
  234. package/index.es273.js +7 -10
  235. package/index.es274.js +6 -11
  236. package/index.es275.js +15 -11
  237. package/index.es276.js +11 -37
  238. package/index.es277.js +25 -65
  239. package/index.es278.js +10 -9
  240. package/index.es279.js +38 -8
  241. package/index.es280.js +1999 -7
  242. package/index.es281.js +6 -10
  243. package/index.es282.js +71 -7
  244. package/index.es283.js +24 -7
  245. package/index.es284.js +82 -6
  246. package/index.es285.js +2 -16
  247. package/index.es286.js +32 -82
  248. package/index.es287.js +1202 -2
  249. package/index.es29.js +30 -30
  250. package/index.es35.js +1 -1
  251. package/index.es354.js +1 -1
  252. package/index.es355.js +1 -1
  253. package/index.es374.js +7 -12
  254. package/index.es375.js +14 -96
  255. package/index.es376.js +11 -24
  256. package/index.es377.js +26 -36
  257. package/index.es378.js +4 -6
  258. package/index.es379.js +56 -15
  259. package/index.es380.js +30 -12
  260. package/index.es381.js +46 -28
  261. package/index.es382.js +66 -4
  262. package/index.es383.js +37 -56
  263. package/index.es384.js +13 -25
  264. package/index.es385.js +64 -38
  265. package/index.es386.js +53 -47
  266. package/index.es387.js +58 -21
  267. package/index.es388.js +69 -13
  268. package/index.es389.js +25 -52
  269. package/index.es390.js +26 -52
  270. package/index.es391.js +37 -53
  271. package/index.es392.js +27 -53
  272. package/index.es393.js +38 -37
  273. package/index.es394.js +57 -26
  274. package/index.es395.js +58 -39
  275. package/index.es396.js +81 -27
  276. package/index.es397.js +32 -32
  277. package/index.es398.js +31 -62
  278. package/index.es399.js +35 -66
  279. package/index.es400.js +22 -94
  280. package/index.es401.js +22 -39
  281. package/index.es402.js +22 -39
  282. package/index.es403.js +23 -39
  283. package/index.es404.js +21 -22
  284. package/index.es405.js +20 -20
  285. package/index.es406.js +14 -24
  286. package/index.es407.js +38 -23
  287. package/index.es408.js +38 -22
  288. package/index.es409.js +14 -24
  289. package/index.es410.js +14 -14
  290. package/index.es411.js +94 -42
  291. package/index.es412.js +23 -43
  292. package/index.es413.js +38 -19
  293. package/index.es414.js +8 -19
  294. package/index.es415.js +19 -8
  295. package/index.es416.js +12 -20
  296. package/index.es426.js +1 -1
  297. package/index.es427.js +1 -1
  298. package/index.es49.js +89 -69
  299. package/index.es54.js +34 -33
  300. package/package.json +1 -1
package/index.es198.js CHANGED
@@ -1,2 +1,481 @@
1
- import { __require as e } from "./index.es286.js";
2
- e();
1
+ import { memo as f, notUndefined as v, approxEqual as M, debounce as z } from "./index.es205.js";
2
+ const b = (r) => {
3
+ const { offsetWidth: h, offsetHeight: t } = r;
4
+ return { width: h, height: t };
5
+ }, w = (r) => r, I = (r) => {
6
+ const h = Math.max(r.startIndex - r.overscan, 0), t = Math.min(r.endIndex + r.overscan, r.count - 1), s = [];
7
+ for (let e = h; e <= t; e++)
8
+ s.push(e);
9
+ return s;
10
+ }, A = (r, h) => {
11
+ const t = r.scrollElement;
12
+ if (!t)
13
+ return;
14
+ const s = r.targetWindow;
15
+ if (!s)
16
+ return;
17
+ const e = (n) => {
18
+ const { width: o, height: a } = n;
19
+ h({ width: Math.round(o), height: Math.round(a) });
20
+ };
21
+ if (e(b(t)), !s.ResizeObserver)
22
+ return () => {
23
+ };
24
+ const i = new s.ResizeObserver((n) => {
25
+ const o = () => {
26
+ const a = n[0];
27
+ if (a != null && a.borderBoxSize) {
28
+ const c = a.borderBoxSize[0];
29
+ if (c) {
30
+ e({ width: c.inlineSize, height: c.blockSize });
31
+ return;
32
+ }
33
+ }
34
+ e(b(t));
35
+ };
36
+ r.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
37
+ });
38
+ return i.observe(t, { box: "border-box" }), () => {
39
+ i.unobserve(t);
40
+ };
41
+ }, x = {
42
+ passive: !0
43
+ }, E = typeof window > "u" ? !0 : "onscrollend" in window, F = (r, h) => {
44
+ const t = r.scrollElement;
45
+ if (!t)
46
+ return;
47
+ const s = r.targetWindow;
48
+ if (!s)
49
+ return;
50
+ let e = 0;
51
+ const i = r.options.useScrollendEvent && E ? () => {
52
+ } : z(
53
+ s,
54
+ () => {
55
+ h(e, !1);
56
+ },
57
+ r.options.isScrollingResetDelay
58
+ ), n = (l) => () => {
59
+ const { horizontal: d, isRtl: u } = r.options;
60
+ e = d ? t.scrollLeft * (u && -1 || 1) : t.scrollTop, i(), h(e, l);
61
+ }, o = n(!0), a = n(!1);
62
+ a(), t.addEventListener("scroll", o, x);
63
+ const c = r.options.useScrollendEvent && E;
64
+ return c && t.addEventListener("scrollend", a, x), () => {
65
+ t.removeEventListener("scroll", o), c && t.removeEventListener("scrollend", a);
66
+ };
67
+ }, C = (r, h, t) => {
68
+ if (h != null && h.borderBoxSize) {
69
+ const s = h.borderBoxSize[0];
70
+ if (s)
71
+ return Math.round(
72
+ s[t.options.horizontal ? "inlineSize" : "blockSize"]
73
+ );
74
+ }
75
+ return r[t.options.horizontal ? "offsetWidth" : "offsetHeight"];
76
+ }, N = (r, {
77
+ adjustments: h = 0,
78
+ behavior: t
79
+ }, s) => {
80
+ var e, i;
81
+ const n = r + h;
82
+ (i = (e = s.scrollElement) == null ? void 0 : e.scrollTo) == null || i.call(e, {
83
+ [s.options.horizontal ? "left" : "top"]: n,
84
+ behavior: t
85
+ });
86
+ };
87
+ class W {
88
+ constructor(h) {
89
+ this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
90
+ let t = null;
91
+ const s = () => t || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : t = new this.targetWindow.ResizeObserver((e) => {
92
+ e.forEach((i) => {
93
+ const n = () => {
94
+ this._measureElement(i.target, i);
95
+ };
96
+ this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(n) : n();
97
+ });
98
+ }));
99
+ return {
100
+ disconnect: () => {
101
+ var e;
102
+ (e = s()) == null || e.disconnect(), t = null;
103
+ },
104
+ observe: (e) => {
105
+ var i;
106
+ return (i = s()) == null ? void 0 : i.observe(e, { box: "border-box" });
107
+ },
108
+ unobserve: (e) => {
109
+ var i;
110
+ return (i = s()) == null ? void 0 : i.unobserve(e);
111
+ }
112
+ };
113
+ })(), this.range = null, this.setOptions = (t) => {
114
+ Object.entries(t).forEach(([s, e]) => {
115
+ typeof e > "u" && delete t[s];
116
+ }), this.options = {
117
+ debug: !1,
118
+ initialOffset: 0,
119
+ overscan: 1,
120
+ paddingStart: 0,
121
+ paddingEnd: 0,
122
+ scrollPaddingStart: 0,
123
+ scrollPaddingEnd: 0,
124
+ horizontal: !1,
125
+ getItemKey: w,
126
+ rangeExtractor: I,
127
+ onChange: () => {
128
+ },
129
+ measureElement: C,
130
+ initialRect: { width: 0, height: 0 },
131
+ scrollMargin: 0,
132
+ gap: 0,
133
+ indexAttribute: "data-index",
134
+ initialMeasurementsCache: [],
135
+ lanes: 1,
136
+ isScrollingResetDelay: 150,
137
+ enabled: !0,
138
+ isRtl: !1,
139
+ useScrollendEvent: !1,
140
+ useAnimationFrameWithResizeObserver: !1,
141
+ ...t
142
+ };
143
+ }, this.notify = (t) => {
144
+ var s, e;
145
+ (e = (s = this.options).onChange) == null || e.call(s, this, t);
146
+ }, this.maybeNotify = f(
147
+ () => (this.calculateRange(), [
148
+ this.isScrolling,
149
+ this.range ? this.range.startIndex : null,
150
+ this.range ? this.range.endIndex : null
151
+ ]),
152
+ (t) => {
153
+ this.notify(t);
154
+ },
155
+ {
156
+ key: process.env.NODE_ENV !== "production" && "maybeNotify",
157
+ debug: () => this.options.debug,
158
+ initialDeps: [
159
+ this.isScrolling,
160
+ this.range ? this.range.startIndex : null,
161
+ this.range ? this.range.endIndex : null
162
+ ]
163
+ }
164
+ ), this.cleanup = () => {
165
+ this.unsubs.filter(Boolean).forEach((t) => t()), this.unsubs = [], this.observer.disconnect(), this.scrollElement = null, this.targetWindow = null;
166
+ }, this._didMount = () => () => {
167
+ this.cleanup();
168
+ }, this._willUpdate = () => {
169
+ var t;
170
+ const s = this.options.enabled ? this.options.getScrollElement() : null;
171
+ if (this.scrollElement !== s) {
172
+ if (this.cleanup(), !s) {
173
+ this.maybeNotify();
174
+ return;
175
+ }
176
+ this.scrollElement = s, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((t = this.scrollElement) == null ? void 0 : t.window) ?? null, this.elementsCache.forEach((e) => {
177
+ this.observer.observe(e);
178
+ }), this._scrollToOffset(this.getScrollOffset(), {
179
+ adjustments: void 0,
180
+ behavior: void 0
181
+ }), this.unsubs.push(
182
+ this.options.observeElementRect(this, (e) => {
183
+ this.scrollRect = e, this.maybeNotify();
184
+ })
185
+ ), this.unsubs.push(
186
+ this.options.observeElementOffset(this, (e, i) => {
187
+ this.scrollAdjustments = 0, this.scrollDirection = i ? this.getScrollOffset() < e ? "forward" : "backward" : null, this.scrollOffset = e, this.isScrolling = i, this.maybeNotify();
188
+ })
189
+ );
190
+ }
191
+ }, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (t, s) => {
192
+ const e = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
193
+ for (let n = s - 1; n >= 0; n--) {
194
+ const o = t[n];
195
+ if (e.has(o.lane))
196
+ continue;
197
+ const a = i.get(
198
+ o.lane
199
+ );
200
+ if (a == null || o.end > a.end ? i.set(o.lane, o) : o.end < a.end && e.set(o.lane, !0), e.size === this.options.lanes)
201
+ break;
202
+ }
203
+ return i.size === this.options.lanes ? Array.from(i.values()).sort((n, o) => n.end === o.end ? n.index - o.index : n.end - o.end)[0] : void 0;
204
+ }, this.getMeasurementOptions = f(
205
+ () => [
206
+ this.options.count,
207
+ this.options.paddingStart,
208
+ this.options.scrollMargin,
209
+ this.options.getItemKey,
210
+ this.options.enabled
211
+ ],
212
+ (t, s, e, i, n) => (this.pendingMeasuredCacheIndexes = [], {
213
+ count: t,
214
+ paddingStart: s,
215
+ scrollMargin: e,
216
+ getItemKey: i,
217
+ enabled: n
218
+ }),
219
+ {
220
+ key: !1
221
+ }
222
+ ), this.getMeasurements = f(
223
+ () => [this.getMeasurementOptions(), this.itemSizeCache],
224
+ ({ count: t, paddingStart: s, scrollMargin: e, getItemKey: i, enabled: n }, o) => {
225
+ if (!n)
226
+ return this.measurementsCache = [], this.itemSizeCache.clear(), [];
227
+ this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((l) => {
228
+ this.itemSizeCache.set(l.key, l.size);
229
+ }));
230
+ const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
231
+ this.pendingMeasuredCacheIndexes = [];
232
+ const c = this.measurementsCache.slice(0, a);
233
+ for (let l = a; l < t; l++) {
234
+ const d = i(l), u = this.options.lanes === 1 ? c[l - 1] : this.getFurthestMeasurement(c, l), g = u ? u.end + this.options.gap : s + e, m = o.get(d), p = typeof m == "number" ? m : this.options.estimateSize(l), O = g + p, y = u ? u.lane : l % this.options.lanes;
235
+ c[l] = {
236
+ index: l,
237
+ start: g,
238
+ size: p,
239
+ end: O,
240
+ key: d,
241
+ lane: y
242
+ };
243
+ }
244
+ return this.measurementsCache = c, c;
245
+ },
246
+ {
247
+ key: process.env.NODE_ENV !== "production" && "getMeasurements",
248
+ debug: () => this.options.debug
249
+ }
250
+ ), this.calculateRange = f(
251
+ () => [
252
+ this.getMeasurements(),
253
+ this.getSize(),
254
+ this.getScrollOffset(),
255
+ this.options.lanes
256
+ ],
257
+ (t, s, e, i) => this.range = t.length > 0 && s > 0 ? R({
258
+ measurements: t,
259
+ outerSize: s,
260
+ scrollOffset: e,
261
+ lanes: i
262
+ }) : null,
263
+ {
264
+ key: process.env.NODE_ENV !== "production" && "calculateRange",
265
+ debug: () => this.options.debug
266
+ }
267
+ ), this.getVirtualIndexes = f(
268
+ () => {
269
+ let t = null, s = null;
270
+ const e = this.calculateRange();
271
+ return e && (t = e.startIndex, s = e.endIndex), this.maybeNotify.updateDeps([this.isScrolling, t, s]), [
272
+ this.options.rangeExtractor,
273
+ this.options.overscan,
274
+ this.options.count,
275
+ t,
276
+ s
277
+ ];
278
+ },
279
+ (t, s, e, i, n) => i === null || n === null ? [] : t({
280
+ startIndex: i,
281
+ endIndex: n,
282
+ overscan: s,
283
+ count: e
284
+ }),
285
+ {
286
+ key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
287
+ debug: () => this.options.debug
288
+ }
289
+ ), this.indexFromElement = (t) => {
290
+ const s = this.options.indexAttribute, e = t.getAttribute(s);
291
+ return e ? parseInt(e, 10) : -1;
292
+ }, this._measureElement = (t, s) => {
293
+ const e = this.indexFromElement(t), i = this.measurementsCache[e];
294
+ if (!i)
295
+ return;
296
+ const n = i.key, o = this.elementsCache.get(n);
297
+ o !== t && (o && this.observer.unobserve(o), this.observer.observe(t), this.elementsCache.set(n, t)), t.isConnected && this.resizeItem(e, this.options.measureElement(t, s, this));
298
+ }, this.resizeItem = (t, s) => {
299
+ const e = this.measurementsCache[t];
300
+ if (!e)
301
+ return;
302
+ const i = this.itemSizeCache.get(e.key) ?? e.size, n = s - i;
303
+ n !== 0 && ((this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(e, n, this) : e.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug, this._scrollToOffset(this.getScrollOffset(), {
304
+ adjustments: this.scrollAdjustments += n,
305
+ behavior: void 0
306
+ })), this.pendingMeasuredCacheIndexes.push(e.index), this.itemSizeCache = new Map(this.itemSizeCache.set(e.key, s)), this.notify(!1));
307
+ }, this.measureElement = (t) => {
308
+ if (!t) {
309
+ this.elementsCache.forEach((s, e) => {
310
+ s.isConnected || (this.observer.unobserve(s), this.elementsCache.delete(e));
311
+ });
312
+ return;
313
+ }
314
+ this._measureElement(t, void 0);
315
+ }, this.getVirtualItems = f(
316
+ () => [this.getVirtualIndexes(), this.getMeasurements()],
317
+ (t, s) => {
318
+ const e = [];
319
+ for (let i = 0, n = t.length; i < n; i++) {
320
+ const o = t[i], a = s[o];
321
+ e.push(a);
322
+ }
323
+ return e;
324
+ },
325
+ {
326
+ key: process.env.NODE_ENV !== "production" && "getVirtualItems",
327
+ debug: () => this.options.debug
328
+ }
329
+ ), this.getVirtualItemForOffset = (t) => {
330
+ const s = this.getMeasurements();
331
+ if (s.length !== 0)
332
+ return v(
333
+ s[S(
334
+ 0,
335
+ s.length - 1,
336
+ (e) => v(s[e]).start,
337
+ t
338
+ )]
339
+ );
340
+ }, this.getOffsetForAlignment = (t, s, e = 0) => {
341
+ const i = this.getSize(), n = this.getScrollOffset();
342
+ s === "auto" && (s = t >= n + i ? "end" : "start"), s === "center" ? t += (e - i) / 2 : s === "end" && (t -= i);
343
+ const o = this.getTotalSize() + this.options.scrollMargin - i;
344
+ return Math.max(Math.min(o, t), 0);
345
+ }, this.getOffsetForIndex = (t, s = "auto") => {
346
+ t = Math.max(0, Math.min(t, this.options.count - 1));
347
+ const e = this.measurementsCache[t];
348
+ if (!e)
349
+ return;
350
+ const i = this.getSize(), n = this.getScrollOffset();
351
+ if (s === "auto")
352
+ if (e.end >= n + i - this.options.scrollPaddingEnd)
353
+ s = "end";
354
+ else if (e.start <= n + this.options.scrollPaddingStart)
355
+ s = "start";
356
+ else
357
+ return [n, s];
358
+ const o = s === "end" ? e.end + this.options.scrollPaddingEnd : e.start - this.options.scrollPaddingStart;
359
+ return [
360
+ this.getOffsetForAlignment(o, s, e.size),
361
+ s
362
+ ];
363
+ }, this.isDynamicMode = () => this.elementsCache.size > 0, this.scrollToOffset = (t, { align: s = "start", behavior: e } = {}) => {
364
+ e === "smooth" && this.isDynamicMode(), this._scrollToOffset(this.getOffsetForAlignment(t, s), {
365
+ adjustments: void 0,
366
+ behavior: e
367
+ });
368
+ }, this.scrollToIndex = (t, { align: s = "auto", behavior: e } = {}) => {
369
+ e === "smooth" && this.isDynamicMode(), t = Math.max(0, Math.min(t, this.options.count - 1));
370
+ let i = 0;
371
+ const n = 10, o = (c) => {
372
+ if (!this.targetWindow) return;
373
+ const l = this.getOffsetForIndex(t, c);
374
+ if (!l)
375
+ return;
376
+ const [d, u] = l;
377
+ this._scrollToOffset(d, { adjustments: void 0, behavior: e }), this.targetWindow.requestAnimationFrame(() => {
378
+ const g = this.getScrollOffset(), m = this.getOffsetForIndex(t, u);
379
+ m && (M(m[0], g) || a(u));
380
+ });
381
+ }, a = (c) => {
382
+ this.targetWindow && (i++, i < n && (process.env.NODE_ENV !== "production" && this.options.debug, this.targetWindow.requestAnimationFrame(() => o(c))));
383
+ };
384
+ o(s);
385
+ }, this.scrollBy = (t, { behavior: s } = {}) => {
386
+ s === "smooth" && this.isDynamicMode(), this._scrollToOffset(this.getScrollOffset() + t, {
387
+ adjustments: void 0,
388
+ behavior: s
389
+ });
390
+ }, this.getTotalSize = () => {
391
+ var t;
392
+ const s = this.getMeasurements();
393
+ let e;
394
+ if (s.length === 0)
395
+ e = this.options.paddingStart;
396
+ else if (this.options.lanes === 1)
397
+ e = ((t = s[s.length - 1]) == null ? void 0 : t.end) ?? 0;
398
+ else {
399
+ const i = Array(this.options.lanes).fill(null);
400
+ let n = s.length - 1;
401
+ for (; n >= 0 && i.some((o) => o === null); ) {
402
+ const o = s[n];
403
+ i[o.lane] === null && (i[o.lane] = o.end), n--;
404
+ }
405
+ e = Math.max(...i.filter((o) => o !== null));
406
+ }
407
+ return Math.max(
408
+ e - this.options.scrollMargin + this.options.paddingEnd,
409
+ 0
410
+ );
411
+ }, this._scrollToOffset = (t, {
412
+ adjustments: s,
413
+ behavior: e
414
+ }) => {
415
+ this.options.scrollToFn(t, { behavior: e, adjustments: s }, this);
416
+ }, this.measure = () => {
417
+ this.itemSizeCache = /* @__PURE__ */ new Map(), this.notify(!1);
418
+ }, this.setOptions(h);
419
+ }
420
+ }
421
+ const S = (r, h, t, s) => {
422
+ for (; r <= h; ) {
423
+ const e = (r + h) / 2 | 0, i = t(e);
424
+ if (i < s)
425
+ r = e + 1;
426
+ else if (i > s)
427
+ h = e - 1;
428
+ else
429
+ return e;
430
+ }
431
+ return r > 0 ? r - 1 : 0;
432
+ };
433
+ function R({
434
+ measurements: r,
435
+ outerSize: h,
436
+ scrollOffset: t,
437
+ lanes: s
438
+ }) {
439
+ const e = r.length - 1, i = (a) => r[a].start;
440
+ if (r.length <= s)
441
+ return {
442
+ startIndex: 0,
443
+ endIndex: e
444
+ };
445
+ let n = S(
446
+ 0,
447
+ e,
448
+ i,
449
+ t
450
+ ), o = n;
451
+ if (s === 1)
452
+ for (; o < e && r[o].end < t + h; )
453
+ o++;
454
+ else if (s > 1) {
455
+ const a = Array(s).fill(0);
456
+ for (; o < e && a.some((l) => l < t + h); ) {
457
+ const l = r[o];
458
+ a[l.lane] = l.end, o++;
459
+ }
460
+ const c = Array(s).fill(t + h);
461
+ for (; n >= 0 && c.some((l) => l >= t); ) {
462
+ const l = r[n];
463
+ c[l.lane] = l.start, n--;
464
+ }
465
+ n = Math.max(0, n - n % s), o = Math.min(e, o + (s - 1 - o % s));
466
+ }
467
+ return { startIndex: n, endIndex: o };
468
+ }
469
+ export {
470
+ W as Virtualizer,
471
+ M as approxEqual,
472
+ z as debounce,
473
+ w as defaultKeyExtractor,
474
+ I as defaultRangeExtractor,
475
+ N as elementScroll,
476
+ C as measureElement,
477
+ f as memo,
478
+ v as notUndefined,
479
+ F as observeElementOffset,
480
+ A as observeElementRect
481
+ };