@clevertask/scribe 0.1.4 → 0.1.5

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 (85) hide show
  1. package/README.md +3 -0
  2. package/dist/BarMenu-V1uRL3bt.js +272 -0
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.d.ts.map +1 -1
  5. package/dist/components/Menu/BarMenu.js +2 -10
  6. package/dist/components/Menu/BubbleMenu.d.ts.map +1 -1
  7. package/dist/components/Menu/BubbleMenu.js +165 -1023
  8. package/dist/components/Menu/LinkBubbleMenu.d.ts +8 -0
  9. package/dist/components/Menu/LinkBubbleMenu.d.ts.map +1 -0
  10. package/dist/components/Menu/LinkBubbleMenu.js +78 -0
  11. package/dist/components/Menu/LinkEditor.d.ts +14 -0
  12. package/dist/components/Menu/LinkEditor.d.ts.map +1 -0
  13. package/dist/components/Menu/LinkEditor.js +140 -0
  14. package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
  15. package/dist/components/Menu/Mobile/ListOptionBar.js +38 -44
  16. package/dist/components/Menu/linkBubbleMenuPlugin.d.ts +5 -0
  17. package/dist/components/Menu/linkBubbleMenuPlugin.d.ts.map +1 -0
  18. package/dist/components/Menu/linkBubbleMenuPlugin.js +7 -0
  19. package/dist/components/Menu/linkUrl.d.ts +2 -0
  20. package/dist/components/Menu/linkUrl.d.ts.map +1 -0
  21. package/dist/components/Menu/linkUrl.js +21 -0
  22. package/dist/components/Scribe/extension/emoji/EmojiList.js +58 -45
  23. package/dist/components/Scribe/extension/emoji/suggest.d.ts +2 -2
  24. package/dist/components/Scribe/extension/emoji/suggest.d.ts.map +1 -1
  25. package/dist/components/Scribe/extension/emoji/suggest.js +39 -43
  26. package/dist/components/Scribe/extension/extension-link.d.ts.map +1 -1
  27. package/dist/components/Scribe/extension/extension-link.js +2 -4
  28. package/dist/components/Scribe/extension/extension-markdown-paste.d.ts.map +1 -1
  29. package/dist/components/Scribe/extension/extension-markdown-paste.js +50 -45
  30. package/dist/components/Scribe/extension/extension-selectedText.d.ts.map +1 -1
  31. package/dist/components/Scribe/extension/extension-selectedText.js +10 -12
  32. package/dist/components/Scribe/extension/getPopupMountTarget.d.ts.map +1 -1
  33. package/dist/components/Scribe/extension/getPopupMountTarget.js +12 -15
  34. package/dist/components/Scribe/extension/index.d.ts +4 -4
  35. package/dist/components/Scribe/extension/index.d.ts.map +1 -1
  36. package/dist/components/Scribe/extension/index.js +2 -39521
  37. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +3369 -3731
  38. package/dist/components/Scribe/extension/slashCommand/index.js +2 -6
  39. package/dist/components/Scribe/extension/slashCommand/items.d.ts.map +1 -1
  40. package/dist/components/Scribe/extension/slashCommand/items.js +177 -176
  41. package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts.map +1 -1
  42. package/dist/components/Scribe/extension/slashCommand/renderItems.js +35 -41
  43. package/dist/components/Scribe/extension/tableOfContents.js +153 -180
  44. package/dist/components/Scribe/index.d.ts.map +1 -1
  45. package/dist/components/Scribe/index.js +113 -153
  46. package/dist/dist-BQjH-i-q.js +7016 -0
  47. package/dist/dist-CnXCIcnl.js +3506 -0
  48. package/dist/dist-RuuEA1GJ.js +686 -0
  49. package/dist/extension-CZOsheCI.js +56236 -0
  50. package/dist/extension-link-DZID_SYl.js +908 -0
  51. package/dist/floating-ui.dom-rih69525.js +928 -0
  52. package/dist/html-to-markdown-CrNOkSye.js +497 -0
  53. package/dist/icons/ToolbarIcons.d.ts.map +1 -1
  54. package/dist/icons/ToolbarIcons.js +76 -135
  55. package/dist/main.css +10 -0
  56. package/dist/main.js +7 -15
  57. package/dist/markdown-to-html-DEczPfuq.js +1458 -0
  58. package/dist/menus-CzX7kyXn.js +633 -0
  59. package/dist/purify.es-DF9CW1cl.js +767 -0
  60. package/dist/rolldown-runtime-B8UxIWdF.js +7 -0
  61. package/dist/slashCommand-B7CRIaKG.js +429 -0
  62. package/dist/tables-CjOC70rm.js +1345 -0
  63. package/dist/tippy.esm-D9LL2xiE.js +1713 -0
  64. package/dist/utils/convert-legacy-math-delimiters.d.ts.map +1 -1
  65. package/dist/utils/convert-legacy-math-delimiters.js +7 -13
  66. package/dist/utils/create-scribe-editor.js +2 -31
  67. package/dist/utils/html-to-markdown.d.ts.map +1 -1
  68. package/dist/utils/html-to-markdown.js +2 -600
  69. package/dist/utils/index.js +24 -12
  70. package/dist/utils/is-in-viewport.d.ts.map +1 -1
  71. package/dist/utils/is-in-viewport.js +6 -6
  72. package/dist/utils/markdown-to-html.d.ts.map +1 -1
  73. package/dist/utils/markdown-to-html.js +2 -5
  74. package/dist/vite-env.d.js +0 -1
  75. package/package.json +36 -34
  76. package/dist/BarMenu-BNk2I0zi.js +0 -327
  77. package/dist/extension-link-P1rro4zO.js +0 -1059
  78. package/dist/floating-ui.dom-ZRy7FSVk.js +0 -1246
  79. package/dist/index-BMISMQrG.js +0 -855
  80. package/dist/index-ByyiiYsp.js +0 -1410
  81. package/dist/index-CnKS-BY2.js +0 -13834
  82. package/dist/index-CnQHDObA.js +0 -539
  83. package/dist/markdown-to-html-Bw9L43K6.js +0 -1135
  84. package/dist/purify.es-DC1iJOxX.js +0 -864
  85. package/dist/tippy.esm-DLHdsnfG.js +0 -1711
@@ -1,1246 +0,0 @@
1
- const Ft = ["top", "right", "bottom", "left"], bt = ["start", "end"], Rt = /* @__PURE__ */ Ft.reduce((t, e) => t.concat(e, e + "-" + bt[0], e + "-" + bt[1]), []), H = Math.min, L = Math.max, it = Math.round, ot = Math.floor, I = (t) => ({
2
- x: t,
3
- y: t
4
- }), Yt = {
5
- left: "right",
6
- right: "left",
7
- bottom: "top",
8
- top: "bottom"
9
- };
10
- function mt(t, e, n) {
11
- return L(t, H(e, n));
12
- }
13
- function Y(t, e) {
14
- return typeof t == "function" ? t(e) : t;
15
- }
16
- function $(t) {
17
- return t.split("-")[0];
18
- }
19
- function N(t) {
20
- return t.split("-")[1];
21
- }
22
- function Mt(t) {
23
- return t === "x" ? "y" : "x";
24
- }
25
- function gt(t) {
26
- return t === "y" ? "height" : "width";
27
- }
28
- function z(t) {
29
- const e = t[0];
30
- return e === "t" || e === "b" ? "y" : "x";
31
- }
32
- function pt(t) {
33
- return Mt(z(t));
34
- }
35
- function Bt(t, e, n) {
36
- n === void 0 && (n = !1);
37
- const o = N(t), i = pt(t), s = gt(i);
38
- let r = i === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
39
- return e.reference[s] > e.floating[s] && (r = rt(r)), [r, rt(r)];
40
- }
41
- function jt(t) {
42
- const e = rt(t);
43
- return [st(t), e, st(e)];
44
- }
45
- function st(t) {
46
- return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
47
- }
48
- const Ot = ["left", "right"], At = ["right", "left"], qt = ["top", "bottom"], Ut = ["bottom", "top"];
49
- function Kt(t, e, n) {
50
- switch (t) {
51
- case "top":
52
- case "bottom":
53
- return n ? e ? At : Ot : e ? Ot : At;
54
- case "left":
55
- case "right":
56
- return e ? qt : Ut;
57
- default:
58
- return [];
59
- }
60
- }
61
- function Gt(t, e, n, o) {
62
- const i = N(t);
63
- let s = Kt($(t), n === "start", o);
64
- return i && (s = s.map((r) => r + "-" + i), e && (s = s.concat(s.map(st)))), s;
65
- }
66
- function rt(t) {
67
- const e = $(t);
68
- return Yt[e] + t.slice(e.length);
69
- }
70
- function Jt(t) {
71
- return {
72
- top: 0,
73
- right: 0,
74
- bottom: 0,
75
- left: 0,
76
- ...t
77
- };
78
- }
79
- function wt(t) {
80
- return typeof t != "number" ? Jt(t) : {
81
- top: t,
82
- right: t,
83
- bottom: t,
84
- left: t
85
- };
86
- }
87
- function Q(t) {
88
- const {
89
- x: e,
90
- y: n,
91
- width: o,
92
- height: i
93
- } = t;
94
- return {
95
- width: o,
96
- height: i,
97
- top: n,
98
- left: e,
99
- right: e + o,
100
- bottom: n + i,
101
- x: e,
102
- y: n
103
- };
104
- }
105
- function Ct(t, e, n) {
106
- let {
107
- reference: o,
108
- floating: i
109
- } = t;
110
- const s = z(e), r = pt(e), c = gt(r), a = $(e), d = s === "y", u = o.x + o.width / 2 - i.width / 2, l = o.y + o.height / 2 - i.height / 2, m = o[c] / 2 - i[c] / 2;
111
- let f;
112
- switch (a) {
113
- case "top":
114
- f = {
115
- x: u,
116
- y: o.y - i.height
117
- };
118
- break;
119
- case "bottom":
120
- f = {
121
- x: u,
122
- y: o.y + o.height
123
- };
124
- break;
125
- case "right":
126
- f = {
127
- x: o.x + o.width,
128
- y: l
129
- };
130
- break;
131
- case "left":
132
- f = {
133
- x: o.x - i.width,
134
- y: l
135
- };
136
- break;
137
- default:
138
- f = {
139
- x: o.x,
140
- y: o.y
141
- };
142
- }
143
- switch (N(e)) {
144
- case "start":
145
- f[r] -= m * (n && d ? -1 : 1);
146
- break;
147
- case "end":
148
- f[r] += m * (n && d ? -1 : 1);
149
- break;
150
- }
151
- return f;
152
- }
153
- async function Qt(t, e) {
154
- var n;
155
- e === void 0 && (e = {});
156
- const {
157
- x: o,
158
- y: i,
159
- platform: s,
160
- rects: r,
161
- elements: c,
162
- strategy: a
163
- } = t, {
164
- boundary: d = "clippingAncestors",
165
- rootBoundary: u = "viewport",
166
- elementContext: l = "floating",
167
- altBoundary: m = !1,
168
- padding: f = 0
169
- } = Y(e, t), h = wt(f), w = c[m ? l === "floating" ? "reference" : "floating" : l], p = Q(await s.getClippingRect({
170
- element: (n = await (s.isElement == null ? void 0 : s.isElement(w))) == null || n ? w : w.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
171
- boundary: d,
172
- rootBoundary: u,
173
- strategy: a
174
- })), x = l === "floating" ? {
175
- x: o,
176
- y: i,
177
- width: r.floating.width,
178
- height: r.floating.height
179
- } : r.reference, y = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), b = await (s.isElement == null ? void 0 : s.isElement(y)) ? await (s.getScale == null ? void 0 : s.getScale(y)) || {
180
- x: 1,
181
- y: 1
182
- } : {
183
- x: 1,
184
- y: 1
185
- }, O = Q(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
186
- elements: c,
187
- rect: x,
188
- offsetParent: y,
189
- strategy: a
190
- }) : x);
191
- return {
192
- top: (p.top - O.top + h.top) / b.y,
193
- bottom: (O.bottom - p.bottom + h.bottom) / b.y,
194
- left: (p.left - O.left + h.left) / b.x,
195
- right: (O.right - p.right + h.right) / b.x
196
- };
197
- }
198
- const Zt = 50, te = async (t, e, n) => {
199
- const {
200
- placement: o = "bottom",
201
- strategy: i = "absolute",
202
- middleware: s = [],
203
- platform: r
204
- } = n, c = r.detectOverflow ? r : {
205
- ...r,
206
- detectOverflow: Qt
207
- }, a = await (r.isRTL == null ? void 0 : r.isRTL(e));
208
- let d = await r.getElementRects({
209
- reference: t,
210
- floating: e,
211
- strategy: i
212
- }), {
213
- x: u,
214
- y: l
215
- } = Ct(d, o, a), m = o, f = 0;
216
- const h = {};
217
- for (let g = 0; g < s.length; g++) {
218
- const w = s[g];
219
- if (!w)
220
- continue;
221
- const {
222
- name: p,
223
- fn: x
224
- } = w, {
225
- x: y,
226
- y: b,
227
- data: O,
228
- reset: R
229
- } = await x({
230
- x: u,
231
- y: l,
232
- initialPlacement: o,
233
- placement: m,
234
- strategy: i,
235
- middlewareData: h,
236
- rects: d,
237
- platform: c,
238
- elements: {
239
- reference: t,
240
- floating: e
241
- }
242
- });
243
- u = y ?? u, l = b ?? l, h[p] = {
244
- ...h[p],
245
- ...O
246
- }, R && f < Zt && (f++, typeof R == "object" && (R.placement && (m = R.placement), R.rects && (d = R.rects === !0 ? await r.getElementRects({
247
- reference: t,
248
- floating: e,
249
- strategy: i
250
- }) : R.rects), {
251
- x: u,
252
- y: l
253
- } = Ct(d, m, a)), g = -1);
254
- }
255
- return {
256
- x: u,
257
- y: l,
258
- placement: m,
259
- strategy: i,
260
- middlewareData: h
261
- };
262
- }, ee = (t) => ({
263
- name: "arrow",
264
- options: t,
265
- async fn(e) {
266
- const {
267
- x: n,
268
- y: o,
269
- placement: i,
270
- rects: s,
271
- platform: r,
272
- elements: c,
273
- middlewareData: a
274
- } = e, {
275
- element: d,
276
- padding: u = 0
277
- } = Y(t, e) || {};
278
- if (d == null)
279
- return {};
280
- const l = wt(u), m = {
281
- x: n,
282
- y: o
283
- }, f = pt(i), h = gt(f), g = await r.getDimensions(d), w = f === "y", p = w ? "top" : "left", x = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = s.reference[h] + s.reference[f] - m[f] - s.floating[h], O = m[f] - s.reference[f], R = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(d));
284
- let A = R ? R[y] : 0;
285
- (!A || !await (r.isElement == null ? void 0 : r.isElement(R))) && (A = c.floating[y] || s.floating[h]);
286
- const B = b / 2 - O / 2, T = A / 2 - g[h] / 2 - 1, v = H(l[p], T), C = H(l[x], T), P = v, E = A - g[h] - C, S = A / 2 - g[h] / 2 + B, k = mt(P, S, E), W = !a.arrow && N(i) != null && S !== k && s.reference[h] / 2 - (S < P ? v : C) - g[h] / 2 < 0, D = W ? S < P ? S - P : S - E : 0;
287
- return {
288
- [f]: m[f] + D,
289
- data: {
290
- [f]: k,
291
- centerOffset: S - k - D,
292
- ...W && {
293
- alignmentOffset: D
294
- }
295
- },
296
- reset: W
297
- };
298
- }
299
- });
300
- function ne(t, e, n) {
301
- return (t ? [...n.filter((i) => N(i) === t), ...n.filter((i) => N(i) !== t)] : n.filter((i) => $(i) === i)).filter((i) => t ? N(i) === t || (e ? st(i) !== i : !1) : !0);
302
- }
303
- const oe = function(t) {
304
- return t === void 0 && (t = {}), {
305
- name: "autoPlacement",
306
- options: t,
307
- async fn(e) {
308
- var n, o, i;
309
- const {
310
- rects: s,
311
- middlewareData: r,
312
- placement: c,
313
- platform: a,
314
- elements: d
315
- } = e, {
316
- crossAxis: u = !1,
317
- alignment: l,
318
- allowedPlacements: m = Rt,
319
- autoAlignment: f = !0,
320
- ...h
321
- } = Y(t, e), g = l !== void 0 || m === Rt ? ne(l || null, f, m) : m, w = await a.detectOverflow(e, h), p = ((n = r.autoPlacement) == null ? void 0 : n.index) || 0, x = g[p];
322
- if (x == null)
323
- return {};
324
- const y = Bt(x, s, await (a.isRTL == null ? void 0 : a.isRTL(d.floating)));
325
- if (c !== x)
326
- return {
327
- reset: {
328
- placement: g[0]
329
- }
330
- };
331
- const b = [w[$(x)], w[y[0]], w[y[1]]], O = [...((o = r.autoPlacement) == null ? void 0 : o.overflows) || [], {
332
- placement: x,
333
- overflows: b
334
- }], R = g[p + 1];
335
- if (R)
336
- return {
337
- data: {
338
- index: p + 1,
339
- overflows: O
340
- },
341
- reset: {
342
- placement: R
343
- }
344
- };
345
- const A = O.map((v) => {
346
- const C = N(v.placement);
347
- return [v.placement, C && u ? (
348
- // Check along the mainAxis and main crossAxis side.
349
- v.overflows.slice(0, 2).reduce((P, E) => P + E, 0)
350
- ) : (
351
- // Check only the mainAxis.
352
- v.overflows[0]
353
- ), v.overflows];
354
- }).sort((v, C) => v[1] - C[1]), T = ((i = A.filter((v) => v[2].slice(
355
- 0,
356
- // Aligned placements should not check their opposite crossAxis
357
- // side.
358
- N(v[0]) ? 2 : 3
359
- ).every((C) => C <= 0))[0]) == null ? void 0 : i[0]) || A[0][0];
360
- return T !== c ? {
361
- data: {
362
- index: p + 1,
363
- overflows: O
364
- },
365
- reset: {
366
- placement: T
367
- }
368
- } : {};
369
- }
370
- };
371
- }, ie = function(t) {
372
- return t === void 0 && (t = {}), {
373
- name: "flip",
374
- options: t,
375
- async fn(e) {
376
- var n, o;
377
- const {
378
- placement: i,
379
- middlewareData: s,
380
- rects: r,
381
- initialPlacement: c,
382
- platform: a,
383
- elements: d
384
- } = e, {
385
- mainAxis: u = !0,
386
- crossAxis: l = !0,
387
- fallbackPlacements: m,
388
- fallbackStrategy: f = "bestFit",
389
- fallbackAxisSideDirection: h = "none",
390
- flipAlignment: g = !0,
391
- ...w
392
- } = Y(t, e);
393
- if ((n = s.arrow) != null && n.alignmentOffset)
394
- return {};
395
- const p = $(i), x = z(c), y = $(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(d.floating)), O = m || (y || !g ? [rt(c)] : jt(c)), R = h !== "none";
396
- !m && R && O.push(...Gt(c, g, h, b));
397
- const A = [c, ...O], B = await a.detectOverflow(e, w), T = [];
398
- let v = ((o = s.flip) == null ? void 0 : o.overflows) || [];
399
- if (u && T.push(B[p]), l) {
400
- const S = Bt(i, r, b);
401
- T.push(B[S[0]], B[S[1]]);
402
- }
403
- if (v = [...v, {
404
- placement: i,
405
- overflows: T
406
- }], !T.every((S) => S <= 0)) {
407
- var C, P;
408
- const S = (((C = s.flip) == null ? void 0 : C.index) || 0) + 1, k = A[S];
409
- if (k && (!(l === "alignment" ? x !== z(k) : !1) || // We leave the current main axis only if every placement on that axis
410
- // overflows the main axis.
411
- v.every((F) => z(F.placement) === x ? F.overflows[0] > 0 : !0)))
412
- return {
413
- data: {
414
- index: S,
415
- overflows: v
416
- },
417
- reset: {
418
- placement: k
419
- }
420
- };
421
- let W = (P = v.filter((D) => D.overflows[0] <= 0).sort((D, F) => D.overflows[1] - F.overflows[1])[0]) == null ? void 0 : P.placement;
422
- if (!W)
423
- switch (f) {
424
- case "bestFit": {
425
- var E;
426
- const D = (E = v.filter((F) => {
427
- if (R) {
428
- const q = z(F.placement);
429
- return q === x || // Create a bias to the `y` side axis due to horizontal
430
- // reading directions favoring greater width.
431
- q === "y";
432
- }
433
- return !0;
434
- }).map((F) => [F.placement, F.overflows.filter((q) => q > 0).reduce((q, Xt) => q + Xt, 0)]).sort((F, q) => F[1] - q[1])[0]) == null ? void 0 : E[0];
435
- D && (W = D);
436
- break;
437
- }
438
- case "initialPlacement":
439
- W = c;
440
- break;
441
- }
442
- if (i !== W)
443
- return {
444
- reset: {
445
- placement: W
446
- }
447
- };
448
- }
449
- return {};
450
- }
451
- };
452
- };
453
- function St(t, e) {
454
- return {
455
- top: t.top - e.height,
456
- right: t.right - e.width,
457
- bottom: t.bottom - e.height,
458
- left: t.left - e.width
459
- };
460
- }
461
- function Lt(t) {
462
- return Ft.some((e) => t[e] >= 0);
463
- }
464
- const se = function(t) {
465
- return t === void 0 && (t = {}), {
466
- name: "hide",
467
- options: t,
468
- async fn(e) {
469
- const {
470
- rects: n,
471
- platform: o
472
- } = e, {
473
- strategy: i = "referenceHidden",
474
- ...s
475
- } = Y(t, e);
476
- switch (i) {
477
- case "referenceHidden": {
478
- const r = await o.detectOverflow(e, {
479
- ...s,
480
- elementContext: "reference"
481
- }), c = St(r, n.reference);
482
- return {
483
- data: {
484
- referenceHiddenOffsets: c,
485
- referenceHidden: Lt(c)
486
- }
487
- };
488
- }
489
- case "escaped": {
490
- const r = await o.detectOverflow(e, {
491
- ...s,
492
- altBoundary: !0
493
- }), c = St(r, n.floating);
494
- return {
495
- data: {
496
- escapedOffsets: c,
497
- escaped: Lt(c)
498
- }
499
- };
500
- }
501
- default:
502
- return {};
503
- }
504
- }
505
- };
506
- };
507
- function Wt(t) {
508
- const e = H(...t.map((s) => s.left)), n = H(...t.map((s) => s.top)), o = L(...t.map((s) => s.right)), i = L(...t.map((s) => s.bottom));
509
- return {
510
- x: e,
511
- y: n,
512
- width: o - e,
513
- height: i - n
514
- };
515
- }
516
- function re(t) {
517
- const e = t.slice().sort((i, s) => i.y - s.y), n = [];
518
- let o = null;
519
- for (let i = 0; i < e.length; i++) {
520
- const s = e[i];
521
- !o || s.y - o.y > o.height / 2 ? n.push([s]) : n[n.length - 1].push(s), o = s;
522
- }
523
- return n.map((i) => Q(Wt(i)));
524
- }
525
- const ce = function(t) {
526
- return t === void 0 && (t = {}), {
527
- name: "inline",
528
- options: t,
529
- async fn(e) {
530
- const {
531
- placement: n,
532
- elements: o,
533
- rects: i,
534
- platform: s,
535
- strategy: r
536
- } = e, {
537
- padding: c = 2,
538
- x: a,
539
- y: d
540
- } = Y(t, e), u = Array.from(await (s.getClientRects == null ? void 0 : s.getClientRects(o.reference)) || []), l = re(u), m = Q(Wt(u)), f = wt(c);
541
- function h() {
542
- if (l.length === 2 && l[0].left > l[1].right && a != null && d != null)
543
- return l.find((w) => a > w.left - f.left && a < w.right + f.right && d > w.top - f.top && d < w.bottom + f.bottom) || m;
544
- if (l.length >= 2) {
545
- if (z(n) === "y") {
546
- const v = l[0], C = l[l.length - 1], P = $(n) === "top", E = v.top, S = C.bottom, k = P ? v.left : C.left, W = P ? v.right : C.right, D = W - k, F = S - E;
547
- return {
548
- top: E,
549
- bottom: S,
550
- left: k,
551
- right: W,
552
- width: D,
553
- height: F,
554
- x: k,
555
- y: E
556
- };
557
- }
558
- const w = $(n) === "left", p = L(...l.map((v) => v.right)), x = H(...l.map((v) => v.left)), y = l.filter((v) => w ? v.left === x : v.right === p), b = y[0].top, O = y[y.length - 1].bottom, R = x, A = p, B = A - R, T = O - b;
559
- return {
560
- top: b,
561
- bottom: O,
562
- left: R,
563
- right: A,
564
- width: B,
565
- height: T,
566
- x: R,
567
- y: b
568
- };
569
- }
570
- return m;
571
- }
572
- const g = await s.getElementRects({
573
- reference: {
574
- getBoundingClientRect: h
575
- },
576
- floating: o.floating,
577
- strategy: r
578
- });
579
- return i.reference.x !== g.reference.x || i.reference.y !== g.reference.y || i.reference.width !== g.reference.width || i.reference.height !== g.reference.height ? {
580
- reset: {
581
- rects: g
582
- }
583
- } : {};
584
- }
585
- };
586
- }, le = /* @__PURE__ */ new Set(["left", "top"]);
587
- async function ae(t, e) {
588
- const {
589
- placement: n,
590
- platform: o,
591
- elements: i
592
- } = t, s = await (o.isRTL == null ? void 0 : o.isRTL(i.floating)), r = $(n), c = N(n), a = z(n) === "y", d = le.has(r) ? -1 : 1, u = s && a ? -1 : 1, l = Y(e, t);
593
- let {
594
- mainAxis: m,
595
- crossAxis: f,
596
- alignmentAxis: h
597
- } = typeof l == "number" ? {
598
- mainAxis: l,
599
- crossAxis: 0,
600
- alignmentAxis: null
601
- } : {
602
- mainAxis: l.mainAxis || 0,
603
- crossAxis: l.crossAxis || 0,
604
- alignmentAxis: l.alignmentAxis
605
- };
606
- return c && typeof h == "number" && (f = c === "end" ? h * -1 : h), a ? {
607
- x: f * u,
608
- y: m * d
609
- } : {
610
- x: m * d,
611
- y: f * u
612
- };
613
- }
614
- const fe = function(t) {
615
- return t === void 0 && (t = 0), {
616
- name: "offset",
617
- options: t,
618
- async fn(e) {
619
- var n, o;
620
- const {
621
- x: i,
622
- y: s,
623
- placement: r,
624
- middlewareData: c
625
- } = e, a = await ae(e, t);
626
- return r === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
627
- x: i + a.x,
628
- y: s + a.y,
629
- data: {
630
- ...a,
631
- placement: r
632
- }
633
- };
634
- }
635
- };
636
- }, ue = function(t) {
637
- return t === void 0 && (t = {}), {
638
- name: "shift",
639
- options: t,
640
- async fn(e) {
641
- const {
642
- x: n,
643
- y: o,
644
- placement: i,
645
- platform: s
646
- } = e, {
647
- mainAxis: r = !0,
648
- crossAxis: c = !1,
649
- limiter: a = {
650
- fn: (p) => {
651
- let {
652
- x,
653
- y
654
- } = p;
655
- return {
656
- x,
657
- y
658
- };
659
- }
660
- },
661
- ...d
662
- } = Y(t, e), u = {
663
- x: n,
664
- y: o
665
- }, l = await s.detectOverflow(e, d), m = z($(i)), f = Mt(m);
666
- let h = u[f], g = u[m];
667
- if (r) {
668
- const p = f === "y" ? "top" : "left", x = f === "y" ? "bottom" : "right", y = h + l[p], b = h - l[x];
669
- h = mt(y, h, b);
670
- }
671
- if (c) {
672
- const p = m === "y" ? "top" : "left", x = m === "y" ? "bottom" : "right", y = g + l[p], b = g - l[x];
673
- g = mt(y, g, b);
674
- }
675
- const w = a.fn({
676
- ...e,
677
- [f]: h,
678
- [m]: g
679
- });
680
- return {
681
- ...w,
682
- data: {
683
- x: w.x - n,
684
- y: w.y - o,
685
- enabled: {
686
- [f]: r,
687
- [m]: c
688
- }
689
- }
690
- };
691
- }
692
- };
693
- }, de = function(t) {
694
- return t === void 0 && (t = {}), {
695
- name: "size",
696
- options: t,
697
- async fn(e) {
698
- var n, o;
699
- const {
700
- placement: i,
701
- rects: s,
702
- platform: r,
703
- elements: c
704
- } = e, {
705
- apply: a = () => {
706
- },
707
- ...d
708
- } = Y(t, e), u = await r.detectOverflow(e, d), l = $(i), m = N(i), f = z(i) === "y", {
709
- width: h,
710
- height: g
711
- } = s.floating;
712
- let w, p;
713
- l === "top" || l === "bottom" ? (w = l, p = m === (await (r.isRTL == null ? void 0 : r.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (p = l, w = m === "end" ? "top" : "bottom");
714
- const x = g - u.top - u.bottom, y = h - u.left - u.right, b = H(g - u[w], x), O = H(h - u[p], y), R = !e.middlewareData.shift;
715
- let A = b, B = O;
716
- if ((n = e.middlewareData.shift) != null && n.enabled.x && (B = y), (o = e.middlewareData.shift) != null && o.enabled.y && (A = x), R && !m) {
717
- const v = L(u.left, 0), C = L(u.right, 0), P = L(u.top, 0), E = L(u.bottom, 0);
718
- f ? B = h - 2 * (v !== 0 || C !== 0 ? v + C : L(u.left, u.right)) : A = g - 2 * (P !== 0 || E !== 0 ? P + E : L(u.top, u.bottom));
719
- }
720
- await a({
721
- ...e,
722
- availableWidth: B,
723
- availableHeight: A
724
- });
725
- const T = await r.getDimensions(c.floating);
726
- return h !== T.width || g !== T.height ? {
727
- reset: {
728
- rects: !0
729
- }
730
- } : {};
731
- }
732
- };
733
- };
734
- function ct() {
735
- return typeof window < "u";
736
- }
737
- function tt(t) {
738
- return $t(t) ? (t.nodeName || "").toLowerCase() : "#document";
739
- }
740
- function M(t) {
741
- var e;
742
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
743
- }
744
- function X(t) {
745
- var e;
746
- return (e = ($t(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
747
- }
748
- function $t(t) {
749
- return ct() ? t instanceof Node || t instanceof M(t).Node : !1;
750
- }
751
- function _(t) {
752
- return ct() ? t instanceof Element || t instanceof M(t).Element : !1;
753
- }
754
- function j(t) {
755
- return ct() ? t instanceof HTMLElement || t instanceof M(t).HTMLElement : !1;
756
- }
757
- function Tt(t) {
758
- return !ct() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof M(t).ShadowRoot;
759
- }
760
- function nt(t) {
761
- const {
762
- overflow: e,
763
- overflowX: n,
764
- overflowY: o,
765
- display: i
766
- } = V(t);
767
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && i !== "inline" && i !== "contents";
768
- }
769
- function me(t) {
770
- return /^(table|td|th)$/.test(tt(t));
771
- }
772
- function lt(t) {
773
- try {
774
- if (t.matches(":popover-open"))
775
- return !0;
776
- } catch {
777
- }
778
- try {
779
- return t.matches(":modal");
780
- } catch {
781
- return !1;
782
- }
783
- }
784
- const he = /transform|translate|scale|rotate|perspective|filter/, ge = /paint|layout|strict|content/, K = (t) => !!t && t !== "none";
785
- let ut;
786
- function xt(t) {
787
- const e = _(t) ? V(t) : t;
788
- return K(e.transform) || K(e.translate) || K(e.scale) || K(e.rotate) || K(e.perspective) || !yt() && (K(e.backdropFilter) || K(e.filter)) || he.test(e.willChange || "") || ge.test(e.contain || "");
789
- }
790
- function pe(t) {
791
- let e = U(t);
792
- for (; j(e) && !Z(e); ) {
793
- if (xt(e))
794
- return e;
795
- if (lt(e))
796
- return null;
797
- e = U(e);
798
- }
799
- return null;
800
- }
801
- function yt() {
802
- return ut == null && (ut = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), ut;
803
- }
804
- function Z(t) {
805
- return /^(html|body|#document)$/.test(tt(t));
806
- }
807
- function V(t) {
808
- return M(t).getComputedStyle(t);
809
- }
810
- function at(t) {
811
- return _(t) ? {
812
- scrollLeft: t.scrollLeft,
813
- scrollTop: t.scrollTop
814
- } : {
815
- scrollLeft: t.scrollX,
816
- scrollTop: t.scrollY
817
- };
818
- }
819
- function U(t) {
820
- if (tt(t) === "html")
821
- return t;
822
- const e = (
823
- // Step into the shadow DOM of the parent of a slotted node.
824
- t.assignedSlot || // DOM Element detected.
825
- t.parentNode || // ShadowRoot detected.
826
- Tt(t) && t.host || // Fallback.
827
- X(t)
828
- );
829
- return Tt(e) ? e.host : e;
830
- }
831
- function kt(t) {
832
- const e = U(t);
833
- return Z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : j(e) && nt(e) ? e : kt(e);
834
- }
835
- function et(t, e, n) {
836
- var o;
837
- e === void 0 && (e = []), n === void 0 && (n = !0);
838
- const i = kt(t), s = i === ((o = t.ownerDocument) == null ? void 0 : o.body), r = M(i);
839
- if (s) {
840
- const c = ht(r);
841
- return e.concat(r, r.visualViewport || [], nt(i) ? i : [], c && n ? et(c) : []);
842
- } else
843
- return e.concat(i, et(i, [], n));
844
- }
845
- function ht(t) {
846
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
847
- }
848
- function Nt(t) {
849
- const e = V(t);
850
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
851
- const i = j(t), s = i ? t.offsetWidth : n, r = i ? t.offsetHeight : o, c = it(n) !== s || it(o) !== r;
852
- return c && (n = s, o = r), {
853
- width: n,
854
- height: o,
855
- $: c
856
- };
857
- }
858
- function vt(t) {
859
- return _(t) ? t : t.contextElement;
860
- }
861
- function J(t) {
862
- const e = vt(t);
863
- if (!j(e))
864
- return I(1);
865
- const n = e.getBoundingClientRect(), {
866
- width: o,
867
- height: i,
868
- $: s
869
- } = Nt(e);
870
- let r = (s ? it(n.width) : n.width) / o, c = (s ? it(n.height) : n.height) / i;
871
- return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
872
- x: r,
873
- y: c
874
- };
875
- }
876
- const we = /* @__PURE__ */ I(0);
877
- function Ht(t) {
878
- const e = M(t);
879
- return !yt() || !e.visualViewport ? we : {
880
- x: e.visualViewport.offsetLeft,
881
- y: e.visualViewport.offsetTop
882
- };
883
- }
884
- function xe(t, e, n) {
885
- return e === void 0 && (e = !1), !n || e && n !== M(t) ? !1 : e;
886
- }
887
- function G(t, e, n, o) {
888
- e === void 0 && (e = !1), n === void 0 && (n = !1);
889
- const i = t.getBoundingClientRect(), s = vt(t);
890
- let r = I(1);
891
- e && (o ? _(o) && (r = J(o)) : r = J(t));
892
- const c = xe(s, n, o) ? Ht(s) : I(0);
893
- let a = (i.left + c.x) / r.x, d = (i.top + c.y) / r.y, u = i.width / r.x, l = i.height / r.y;
894
- if (s) {
895
- const m = M(s), f = o && _(o) ? M(o) : o;
896
- let h = m, g = ht(h);
897
- for (; g && o && f !== h; ) {
898
- const w = J(g), p = g.getBoundingClientRect(), x = V(g), y = p.left + (g.clientLeft + parseFloat(x.paddingLeft)) * w.x, b = p.top + (g.clientTop + parseFloat(x.paddingTop)) * w.y;
899
- a *= w.x, d *= w.y, u *= w.x, l *= w.y, a += y, d += b, h = M(g), g = ht(h);
900
- }
901
- }
902
- return Q({
903
- width: u,
904
- height: l,
905
- x: a,
906
- y: d
907
- });
908
- }
909
- function ft(t, e) {
910
- const n = at(t).scrollLeft;
911
- return e ? e.left + n : G(X(t)).left + n;
912
- }
913
- function _t(t, e) {
914
- const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - ft(t, n), i = n.top + e.scrollTop;
915
- return {
916
- x: o,
917
- y: i
918
- };
919
- }
920
- function ye(t) {
921
- let {
922
- elements: e,
923
- rect: n,
924
- offsetParent: o,
925
- strategy: i
926
- } = t;
927
- const s = i === "fixed", r = X(o), c = e ? lt(e.floating) : !1;
928
- if (o === r || c && s)
929
- return n;
930
- let a = {
931
- scrollLeft: 0,
932
- scrollTop: 0
933
- }, d = I(1);
934
- const u = I(0), l = j(o);
935
- if ((l || !l && !s) && ((tt(o) !== "body" || nt(r)) && (a = at(o)), l)) {
936
- const f = G(o);
937
- d = J(o), u.x = f.x + o.clientLeft, u.y = f.y + o.clientTop;
938
- }
939
- const m = r && !l && !s ? _t(r, a) : I(0);
940
- return {
941
- width: n.width * d.x,
942
- height: n.height * d.y,
943
- x: n.x * d.x - a.scrollLeft * d.x + u.x + m.x,
944
- y: n.y * d.y - a.scrollTop * d.y + u.y + m.y
945
- };
946
- }
947
- function ve(t) {
948
- return Array.from(t.getClientRects());
949
- }
950
- function be(t) {
951
- const e = X(t), n = at(t), o = t.ownerDocument.body, i = L(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), s = L(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
952
- let r = -n.scrollLeft + ft(t);
953
- const c = -n.scrollTop;
954
- return V(o).direction === "rtl" && (r += L(e.clientWidth, o.clientWidth) - i), {
955
- width: i,
956
- height: s,
957
- x: r,
958
- y: c
959
- };
960
- }
961
- const Pt = 25;
962
- function Re(t, e) {
963
- const n = M(t), o = X(t), i = n.visualViewport;
964
- let s = o.clientWidth, r = o.clientHeight, c = 0, a = 0;
965
- if (i) {
966
- s = i.width, r = i.height;
967
- const u = yt();
968
- (!u || u && e === "fixed") && (c = i.offsetLeft, a = i.offsetTop);
969
- }
970
- const d = ft(o);
971
- if (d <= 0) {
972
- const u = o.ownerDocument, l = u.body, m = getComputedStyle(l), f = u.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, h = Math.abs(o.clientWidth - l.clientWidth - f);
973
- h <= Pt && (s -= h);
974
- } else d <= Pt && (s += d);
975
- return {
976
- width: s,
977
- height: r,
978
- x: c,
979
- y: a
980
- };
981
- }
982
- function Oe(t, e) {
983
- const n = G(t, !0, e === "fixed"), o = n.top + t.clientTop, i = n.left + t.clientLeft, s = j(t) ? J(t) : I(1), r = t.clientWidth * s.x, c = t.clientHeight * s.y, a = i * s.x, d = o * s.y;
984
- return {
985
- width: r,
986
- height: c,
987
- x: a,
988
- y: d
989
- };
990
- }
991
- function Et(t, e, n) {
992
- let o;
993
- if (e === "viewport")
994
- o = Re(t, n);
995
- else if (e === "document")
996
- o = be(X(t));
997
- else if (_(e))
998
- o = Oe(e, n);
999
- else {
1000
- const i = Ht(t);
1001
- o = {
1002
- x: e.x - i.x,
1003
- y: e.y - i.y,
1004
- width: e.width,
1005
- height: e.height
1006
- };
1007
- }
1008
- return Q(o);
1009
- }
1010
- function Vt(t, e) {
1011
- const n = U(t);
1012
- return n === e || !_(n) || Z(n) ? !1 : V(n).position === "fixed" || Vt(n, e);
1013
- }
1014
- function Ae(t, e) {
1015
- const n = e.get(t);
1016
- if (n)
1017
- return n;
1018
- let o = et(t, [], !1).filter((c) => _(c) && tt(c) !== "body"), i = null;
1019
- const s = V(t).position === "fixed";
1020
- let r = s ? U(t) : t;
1021
- for (; _(r) && !Z(r); ) {
1022
- const c = V(r), a = xt(r);
1023
- !a && c.position === "fixed" && (i = null), (s ? !a && !i : !a && c.position === "static" && !!i && (i.position === "absolute" || i.position === "fixed") || nt(r) && !a && Vt(t, r)) ? o = o.filter((u) => u !== r) : i = c, r = U(r);
1024
- }
1025
- return e.set(t, o), o;
1026
- }
1027
- function Ce(t) {
1028
- let {
1029
- element: e,
1030
- boundary: n,
1031
- rootBoundary: o,
1032
- strategy: i
1033
- } = t;
1034
- const r = [...n === "clippingAncestors" ? lt(e) ? [] : Ae(e, this._c) : [].concat(n), o], c = Et(e, r[0], i);
1035
- let a = c.top, d = c.right, u = c.bottom, l = c.left;
1036
- for (let m = 1; m < r.length; m++) {
1037
- const f = Et(e, r[m], i);
1038
- a = L(f.top, a), d = H(f.right, d), u = H(f.bottom, u), l = L(f.left, l);
1039
- }
1040
- return {
1041
- width: d - l,
1042
- height: u - a,
1043
- x: l,
1044
- y: a
1045
- };
1046
- }
1047
- function Se(t) {
1048
- const {
1049
- width: e,
1050
- height: n
1051
- } = Nt(t);
1052
- return {
1053
- width: e,
1054
- height: n
1055
- };
1056
- }
1057
- function Le(t, e, n) {
1058
- const o = j(e), i = X(e), s = n === "fixed", r = G(t, !0, s, e);
1059
- let c = {
1060
- scrollLeft: 0,
1061
- scrollTop: 0
1062
- };
1063
- const a = I(0);
1064
- function d() {
1065
- a.x = ft(i);
1066
- }
1067
- if (o || !o && !s)
1068
- if ((tt(e) !== "body" || nt(i)) && (c = at(e)), o) {
1069
- const f = G(e, !0, s, e);
1070
- a.x = f.x + e.clientLeft, a.y = f.y + e.clientTop;
1071
- } else i && d();
1072
- s && !o && i && d();
1073
- const u = i && !o && !s ? _t(i, c) : I(0), l = r.left + c.scrollLeft - a.x - u.x, m = r.top + c.scrollTop - a.y - u.y;
1074
- return {
1075
- x: l,
1076
- y: m,
1077
- width: r.width,
1078
- height: r.height
1079
- };
1080
- }
1081
- function dt(t) {
1082
- return V(t).position === "static";
1083
- }
1084
- function Dt(t, e) {
1085
- if (!j(t) || V(t).position === "fixed")
1086
- return null;
1087
- if (e)
1088
- return e(t);
1089
- let n = t.offsetParent;
1090
- return X(t) === n && (n = n.ownerDocument.body), n;
1091
- }
1092
- function zt(t, e) {
1093
- const n = M(t);
1094
- if (lt(t))
1095
- return n;
1096
- if (!j(t)) {
1097
- let i = U(t);
1098
- for (; i && !Z(i); ) {
1099
- if (_(i) && !dt(i))
1100
- return i;
1101
- i = U(i);
1102
- }
1103
- return n;
1104
- }
1105
- let o = Dt(t, e);
1106
- for (; o && me(o) && dt(o); )
1107
- o = Dt(o, e);
1108
- return o && Z(o) && dt(o) && !xt(o) ? n : o || pe(t) || n;
1109
- }
1110
- const Te = async function(t) {
1111
- const e = this.getOffsetParent || zt, n = this.getDimensions, o = await n(t.floating);
1112
- return {
1113
- reference: Le(t.reference, await e(t.floating), t.strategy),
1114
- floating: {
1115
- x: 0,
1116
- y: 0,
1117
- width: o.width,
1118
- height: o.height
1119
- }
1120
- };
1121
- };
1122
- function Pe(t) {
1123
- return V(t).direction === "rtl";
1124
- }
1125
- const Ee = {
1126
- convertOffsetParentRelativeRectToViewportRelativeRect: ye,
1127
- getDocumentElement: X,
1128
- getClippingRect: Ce,
1129
- getOffsetParent: zt,
1130
- getElementRects: Te,
1131
- getClientRects: ve,
1132
- getDimensions: Se,
1133
- getScale: J,
1134
- isElement: _,
1135
- isRTL: Pe
1136
- };
1137
- function It(t, e) {
1138
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1139
- }
1140
- function De(t, e) {
1141
- let n = null, o;
1142
- const i = X(t);
1143
- function s() {
1144
- var c;
1145
- clearTimeout(o), (c = n) == null || c.disconnect(), n = null;
1146
- }
1147
- function r(c, a) {
1148
- c === void 0 && (c = !1), a === void 0 && (a = 1), s();
1149
- const d = t.getBoundingClientRect(), {
1150
- left: u,
1151
- top: l,
1152
- width: m,
1153
- height: f
1154
- } = d;
1155
- if (c || e(), !m || !f)
1156
- return;
1157
- const h = ot(l), g = ot(i.clientWidth - (u + m)), w = ot(i.clientHeight - (l + f)), p = ot(u), y = {
1158
- rootMargin: -h + "px " + -g + "px " + -w + "px " + -p + "px",
1159
- threshold: L(0, H(1, a)) || 1
1160
- };
1161
- let b = !0;
1162
- function O(R) {
1163
- const A = R[0].intersectionRatio;
1164
- if (A !== a) {
1165
- if (!b)
1166
- return r();
1167
- A ? r(!1, A) : o = setTimeout(() => {
1168
- r(!1, 1e-7);
1169
- }, 1e3);
1170
- }
1171
- A === 1 && !It(d, t.getBoundingClientRect()) && r(), b = !1;
1172
- }
1173
- try {
1174
- n = new IntersectionObserver(O, {
1175
- ...y,
1176
- // Handle <iframe>s
1177
- root: i.ownerDocument
1178
- });
1179
- } catch {
1180
- n = new IntersectionObserver(O, y);
1181
- }
1182
- n.observe(t);
1183
- }
1184
- return r(!0), s;
1185
- }
1186
- function Fe(t, e, n, o) {
1187
- o === void 0 && (o = {});
1188
- const {
1189
- ancestorScroll: i = !0,
1190
- ancestorResize: s = !0,
1191
- elementResize: r = typeof ResizeObserver == "function",
1192
- layoutShift: c = typeof IntersectionObserver == "function",
1193
- animationFrame: a = !1
1194
- } = o, d = vt(t), u = i || s ? [...d ? et(d) : [], ...e ? et(e) : []] : [];
1195
- u.forEach((p) => {
1196
- i && p.addEventListener("scroll", n, {
1197
- passive: !0
1198
- }), s && p.addEventListener("resize", n);
1199
- });
1200
- const l = d && c ? De(d, n) : null;
1201
- let m = -1, f = null;
1202
- r && (f = new ResizeObserver((p) => {
1203
- let [x] = p;
1204
- x && x.target === d && f && e && (f.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1205
- var y;
1206
- (y = f) == null || y.observe(e);
1207
- })), n();
1208
- }), d && !a && f.observe(d), e && f.observe(e));
1209
- let h, g = a ? G(t) : null;
1210
- a && w();
1211
- function w() {
1212
- const p = G(t);
1213
- g && !It(g, p) && n(), g = p, h = requestAnimationFrame(w);
1214
- }
1215
- return n(), () => {
1216
- var p;
1217
- u.forEach((x) => {
1218
- i && x.removeEventListener("scroll", n), s && x.removeEventListener("resize", n);
1219
- }), l?.(), (p = f) == null || p.disconnect(), f = null, a && cancelAnimationFrame(h);
1220
- };
1221
- }
1222
- const Me = fe, Be = oe, We = ue, $e = ie, ke = de, Ne = se, He = ee, _e = ce, Ve = (t, e, n) => {
1223
- const o = /* @__PURE__ */ new Map(), i = {
1224
- platform: Ee,
1225
- ...n
1226
- }, s = {
1227
- ...i.platform,
1228
- _c: o
1229
- };
1230
- return te(t, e, {
1231
- ...i,
1232
- platform: s
1233
- });
1234
- };
1235
- export {
1236
- Fe as a,
1237
- He as b,
1238
- Ve as c,
1239
- ke as d,
1240
- Be as e,
1241
- $e as f,
1242
- Ne as h,
1243
- _e as i,
1244
- Me as o,
1245
- We as s
1246
- };