@zenuml/core 3.23.9 → 3.23.11

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.
@@ -1,1716 +0,0 @@
1
- import { b as L, u as H, r as F, s as Me, w as j, g as nt, d as ot, e as Q, F as Ie, m as ge, t as Ae, f as _e, n as it, p as rt, h as st, i as lt, j as te, U as at, k as Se, l as ct, T as ut, q as ft, v as dt, x as mt, y as pt, P as gt, o as Te, z as ht, A as vt, a as he, c as yt, B as wt, C as xt, D as bt, E as Ct, G as Ot, H as Et } from "./core.2db7f197.js";
2
- const ze = ["top", "right", "bottom", "left"], Re = ["start", "end"], Pe = /* @__PURE__ */ ze.reduce((e, t) => e.concat(t, t + "-" + Re[0], t + "-" + Re[1]), []), J = Math.min, Y = Math.max, le = Math.round, se = Math.floor, X = (e) => ({
3
- x: e,
4
- y: e
5
- }), At = {
6
- left: "right",
7
- right: "left",
8
- bottom: "top",
9
- top: "bottom"
10
- }, St = {
11
- start: "end",
12
- end: "start"
13
- };
14
- function ye(e, t, n) {
15
- return Y(e, J(t, n));
16
- }
17
- function K(e, t) {
18
- return typeof e == "function" ? e(t) : e;
19
- }
20
- function V(e) {
21
- return e.split("-")[0];
22
- }
23
- function M(e) {
24
- return e.split("-")[1];
25
- }
26
- function He(e) {
27
- return e === "x" ? "y" : "x";
28
- }
29
- function xe(e) {
30
- return e === "y" ? "height" : "width";
31
- }
32
- function fe(e) {
33
- return ["top", "bottom"].includes(V(e)) ? "y" : "x";
34
- }
35
- function be(e) {
36
- return He(fe(e));
37
- }
38
- function Ve(e, t, n) {
39
- n === void 0 && (n = !1);
40
- const i = M(e), o = be(e), r = xe(o);
41
- let s = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
42
- return t.reference[r] > t.floating[r] && (s = ce(s)), [s, ce(s)];
43
- }
44
- function Tt(e) {
45
- const t = ce(e);
46
- return [ae(e), t, ae(t)];
47
- }
48
- function ae(e) {
49
- return e.replace(/start|end/g, (t) => St[t]);
50
- }
51
- function Rt(e, t, n) {
52
- const i = ["left", "right"], o = ["right", "left"], r = ["top", "bottom"], s = ["bottom", "top"];
53
- switch (e) {
54
- case "top":
55
- case "bottom":
56
- return n ? t ? o : i : t ? i : o;
57
- case "left":
58
- case "right":
59
- return t ? r : s;
60
- default:
61
- return [];
62
- }
63
- }
64
- function Pt(e, t, n, i) {
65
- const o = M(e);
66
- let r = Rt(V(e), n === "start", i);
67
- return o && (r = r.map((s) => s + "-" + o), t && (r = r.concat(r.map(ae)))), r;
68
- }
69
- function ce(e) {
70
- return e.replace(/left|right|bottom|top/g, (t) => At[t]);
71
- }
72
- function Ft(e) {
73
- return {
74
- top: 0,
75
- right: 0,
76
- bottom: 0,
77
- left: 0,
78
- ...e
79
- };
80
- }
81
- function We(e) {
82
- return typeof e != "number" ? Ft(e) : {
83
- top: e,
84
- right: e,
85
- bottom: e,
86
- left: e
87
- };
88
- }
89
- function ue(e) {
90
- return {
91
- ...e,
92
- top: e.y,
93
- left: e.x,
94
- right: e.x + e.width,
95
- bottom: e.y + e.height
96
- };
97
- }
98
- function Fe(e, t, n) {
99
- let {
100
- reference: i,
101
- floating: o
102
- } = e;
103
- const r = fe(t), s = be(t), l = xe(s), c = V(t), u = r === "y", m = i.x + i.width / 2 - o.width / 2, d = i.y + i.height / 2 - o.height / 2, p = i[l] / 2 - o[l] / 2;
104
- let f;
105
- switch (c) {
106
- case "top":
107
- f = {
108
- x: m,
109
- y: i.y - o.height
110
- };
111
- break;
112
- case "bottom":
113
- f = {
114
- x: m,
115
- y: i.y + i.height
116
- };
117
- break;
118
- case "right":
119
- f = {
120
- x: i.x + i.width,
121
- y: d
122
- };
123
- break;
124
- case "left":
125
- f = {
126
- x: i.x - o.width,
127
- y: d
128
- };
129
- break;
130
- default:
131
- f = {
132
- x: i.x,
133
- y: i.y
134
- };
135
- }
136
- switch (M(t)) {
137
- case "start":
138
- f[s] -= p * (n && u ? -1 : 1);
139
- break;
140
- case "end":
141
- f[s] += p * (n && u ? -1 : 1);
142
- break;
143
- }
144
- return f;
145
- }
146
- const Lt = async (e, t, n) => {
147
- const {
148
- placement: i = "bottom",
149
- strategy: o = "absolute",
150
- middleware: r = [],
151
- platform: s
152
- } = n, l = r.filter(Boolean), c = await (s.isRTL == null ? void 0 : s.isRTL(t));
153
- let u = await s.getElementRects({
154
- reference: e,
155
- floating: t,
156
- strategy: o
157
- }), {
158
- x: m,
159
- y: d
160
- } = Fe(u, i, c), p = i, f = {}, a = 0;
161
- for (let h = 0; h < l.length; h++) {
162
- const {
163
- name: v,
164
- fn: g
165
- } = l[h], {
166
- x,
167
- y: b,
168
- data: C,
169
- reset: w
170
- } = await g({
171
- x: m,
172
- y: d,
173
- initialPlacement: i,
174
- placement: p,
175
- strategy: o,
176
- middlewareData: f,
177
- rects: u,
178
- platform: s,
179
- elements: {
180
- reference: e,
181
- floating: t
182
- }
183
- });
184
- if (m = x != null ? x : m, d = b != null ? b : d, f = {
185
- ...f,
186
- [v]: {
187
- ...f[v],
188
- ...C
189
- }
190
- }, w && a <= 50) {
191
- a++, typeof w == "object" && (w.placement && (p = w.placement), w.rects && (u = w.rects === !0 ? await s.getElementRects({
192
- reference: e,
193
- floating: t,
194
- strategy: o
195
- }) : w.rects), {
196
- x: m,
197
- y: d
198
- } = Fe(u, p, c)), h = -1;
199
- continue;
200
- }
201
- }
202
- return {
203
- x: m,
204
- y: d,
205
- placement: p,
206
- strategy: o,
207
- middlewareData: f
208
- };
209
- };
210
- async function ne(e, t) {
211
- var n;
212
- t === void 0 && (t = {});
213
- const {
214
- x: i,
215
- y: o,
216
- platform: r,
217
- rects: s,
218
- elements: l,
219
- strategy: c
220
- } = e, {
221
- boundary: u = "clippingAncestors",
222
- rootBoundary: m = "viewport",
223
- elementContext: d = "floating",
224
- altBoundary: p = !1,
225
- padding: f = 0
226
- } = K(t, e), a = We(f), v = l[p ? d === "floating" ? "reference" : "floating" : d], g = ue(await r.getClippingRect({
227
- element: (n = await (r.isElement == null ? void 0 : r.isElement(v))) == null || n ? v : v.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
228
- boundary: u,
229
- rootBoundary: m,
230
- strategy: c
231
- })), x = d === "floating" ? {
232
- ...s.floating,
233
- x: i,
234
- y: o
235
- } : s.reference, b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l.floating)), C = await (r.isElement == null ? void 0 : r.isElement(b)) ? await (r.getScale == null ? void 0 : r.getScale(b)) || {
236
- x: 1,
237
- y: 1
238
- } : {
239
- x: 1,
240
- y: 1
241
- }, w = ue(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
242
- rect: x,
243
- offsetParent: b,
244
- strategy: c
245
- }) : x);
246
- return {
247
- top: (g.top - w.top + a.top) / C.y,
248
- bottom: (w.bottom - g.bottom + a.bottom) / C.y,
249
- left: (g.left - w.left + a.left) / C.x,
250
- right: (w.right - g.right + a.right) / C.x
251
- };
252
- }
253
- const Bt = (e) => ({
254
- name: "arrow",
255
- options: e,
256
- async fn(t) {
257
- const {
258
- x: n,
259
- y: i,
260
- placement: o,
261
- rects: r,
262
- platform: s,
263
- elements: l,
264
- middlewareData: c
265
- } = t, {
266
- element: u,
267
- padding: m = 0
268
- } = K(e, t) || {};
269
- if (u == null)
270
- return {};
271
- const d = We(m), p = {
272
- x: n,
273
- y: i
274
- }, f = be(o), a = xe(f), h = await s.getDimensions(u), v = f === "y", g = v ? "top" : "left", x = v ? "bottom" : "right", b = v ? "clientHeight" : "clientWidth", C = r.reference[a] + r.reference[f] - p[f] - r.floating[a], w = p[f] - r.reference[f], O = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(u));
275
- let E = O ? O[b] : 0;
276
- (!E || !await (s.isElement == null ? void 0 : s.isElement(O))) && (E = l.floating[b] || r.floating[a]);
277
- const A = C / 2 - w / 2, R = E / 2 - h[a] / 2 - 1, T = J(d[g], R), S = J(d[x], R), P = T, _ = E - h[a] - S, B = E / 2 - h[a] / 2 + A, N = ye(P, B, _), $ = !c.arrow && M(o) != null && B != N && r.reference[a] / 2 - (B < P ? T : S) - h[a] / 2 < 0, z = $ ? B < P ? B - P : B - _ : 0;
278
- return {
279
- [f]: p[f] + z,
280
- data: {
281
- [f]: N,
282
- centerOffset: B - N - z,
283
- ...$ && {
284
- alignmentOffset: z
285
- }
286
- },
287
- reset: $
288
- };
289
- }
290
- });
291
- function kt(e, t, n) {
292
- return (e ? [...n.filter((o) => M(o) === e), ...n.filter((o) => M(o) !== e)] : n.filter((o) => V(o) === o)).filter((o) => e ? M(o) === e || (t ? ae(o) !== o : !1) : !0);
293
- }
294
- const Dt = function(e) {
295
- return e === void 0 && (e = {}), {
296
- name: "autoPlacement",
297
- options: e,
298
- async fn(t) {
299
- var n, i, o;
300
- const {
301
- rects: r,
302
- middlewareData: s,
303
- placement: l,
304
- platform: c,
305
- elements: u
306
- } = t, {
307
- crossAxis: m = !1,
308
- alignment: d,
309
- allowedPlacements: p = Pe,
310
- autoAlignment: f = !0,
311
- ...a
312
- } = K(e, t), h = d !== void 0 || p === Pe ? kt(d || null, f, p) : p, v = await ne(t, a), g = ((n = s.autoPlacement) == null ? void 0 : n.index) || 0, x = h[g];
313
- if (x == null)
314
- return {};
315
- const b = Ve(x, r, await (c.isRTL == null ? void 0 : c.isRTL(u.floating)));
316
- if (l !== x)
317
- return {
318
- reset: {
319
- placement: h[0]
320
- }
321
- };
322
- const C = [v[V(x)], v[b[0]], v[b[1]]], w = [...((i = s.autoPlacement) == null ? void 0 : i.overflows) || [], {
323
- placement: x,
324
- overflows: C
325
- }], O = h[g + 1];
326
- if (O)
327
- return {
328
- data: {
329
- index: g + 1,
330
- overflows: w
331
- },
332
- reset: {
333
- placement: O
334
- }
335
- };
336
- const E = w.map((T) => {
337
- const S = M(T.placement);
338
- return [T.placement, S && m ? T.overflows.slice(0, 2).reduce((P, _) => P + _, 0) : T.overflows[0], T.overflows];
339
- }).sort((T, S) => T[1] - S[1]), R = ((o = E.filter((T) => T[2].slice(
340
- 0,
341
- M(T[0]) ? 2 : 3
342
- ).every((S) => S <= 0))[0]) == null ? void 0 : o[0]) || E[0][0];
343
- return R !== l ? {
344
- data: {
345
- index: g + 1,
346
- overflows: w
347
- },
348
- reset: {
349
- placement: R
350
- }
351
- } : {};
352
- }
353
- };
354
- }, Nt = function(e) {
355
- return e === void 0 && (e = {}), {
356
- name: "flip",
357
- options: e,
358
- async fn(t) {
359
- var n, i;
360
- const {
361
- placement: o,
362
- middlewareData: r,
363
- rects: s,
364
- initialPlacement: l,
365
- platform: c,
366
- elements: u
367
- } = t, {
368
- mainAxis: m = !0,
369
- crossAxis: d = !0,
370
- fallbackPlacements: p,
371
- fallbackStrategy: f = "bestFit",
372
- fallbackAxisSideDirection: a = "none",
373
- flipAlignment: h = !0,
374
- ...v
375
- } = K(e, t);
376
- if ((n = r.arrow) != null && n.alignmentOffset)
377
- return {};
378
- const g = V(o), x = V(l) === l, b = await (c.isRTL == null ? void 0 : c.isRTL(u.floating)), C = p || (x || !h ? [ce(l)] : Tt(l));
379
- !p && a !== "none" && C.push(...Pt(l, h, a, b));
380
- const w = [l, ...C], O = await ne(t, v), E = [];
381
- let A = ((i = r.flip) == null ? void 0 : i.overflows) || [];
382
- if (m && E.push(O[g]), d) {
383
- const P = Ve(o, s, b);
384
- E.push(O[P[0]], O[P[1]]);
385
- }
386
- if (A = [...A, {
387
- placement: o,
388
- overflows: E
389
- }], !E.every((P) => P <= 0)) {
390
- var R, T;
391
- const P = (((R = r.flip) == null ? void 0 : R.index) || 0) + 1, _ = w[P];
392
- if (_)
393
- return {
394
- data: {
395
- index: P,
396
- overflows: A
397
- },
398
- reset: {
399
- placement: _
400
- }
401
- };
402
- let B = (T = A.filter((N) => N.overflows[0] <= 0).sort((N, $) => N.overflows[1] - $.overflows[1])[0]) == null ? void 0 : T.placement;
403
- if (!B)
404
- switch (f) {
405
- case "bestFit": {
406
- var S;
407
- const N = (S = A.map(($) => [$.placement, $.overflows.filter((z) => z > 0).reduce((z, tt) => z + tt, 0)]).sort(($, z) => $[1] - z[1])[0]) == null ? void 0 : S[0];
408
- N && (B = N);
409
- break;
410
- }
411
- case "initialPlacement":
412
- B = l;
413
- break;
414
- }
415
- if (o !== B)
416
- return {
417
- reset: {
418
- placement: B
419
- }
420
- };
421
- }
422
- return {};
423
- }
424
- };
425
- };
426
- function Le(e, t) {
427
- return {
428
- top: e.top - t.height,
429
- right: e.right - t.width,
430
- bottom: e.bottom - t.height,
431
- left: e.left - t.width
432
- };
433
- }
434
- function Be(e) {
435
- return ze.some((t) => e[t] >= 0);
436
- }
437
- const $t = function(e) {
438
- return e === void 0 && (e = {}), {
439
- name: "hide",
440
- options: e,
441
- async fn(t) {
442
- const {
443
- rects: n
444
- } = t, {
445
- strategy: i = "referenceHidden",
446
- ...o
447
- } = K(e, t);
448
- switch (i) {
449
- case "referenceHidden": {
450
- const r = await ne(t, {
451
- ...o,
452
- elementContext: "reference"
453
- }), s = Le(r, n.reference);
454
- return {
455
- data: {
456
- referenceHiddenOffsets: s,
457
- referenceHidden: Be(s)
458
- }
459
- };
460
- }
461
- case "escaped": {
462
- const r = await ne(t, {
463
- ...o,
464
- altBoundary: !0
465
- }), s = Le(r, n.floating);
466
- return {
467
- data: {
468
- escapedOffsets: s,
469
- escaped: Be(s)
470
- }
471
- };
472
- }
473
- default:
474
- return {};
475
- }
476
- }
477
- };
478
- };
479
- async function jt(e, t) {
480
- const {
481
- placement: n,
482
- platform: i,
483
- elements: o
484
- } = e, r = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), s = V(n), l = M(n), c = fe(n) === "y", u = ["left", "top"].includes(s) ? -1 : 1, m = r && c ? -1 : 1, d = K(t, e);
485
- let {
486
- mainAxis: p,
487
- crossAxis: f,
488
- alignmentAxis: a
489
- } = typeof d == "number" ? {
490
- mainAxis: d,
491
- crossAxis: 0,
492
- alignmentAxis: null
493
- } : {
494
- mainAxis: 0,
495
- crossAxis: 0,
496
- alignmentAxis: null,
497
- ...d
498
- };
499
- return l && typeof a == "number" && (f = l === "end" ? a * -1 : a), c ? {
500
- x: f * m,
501
- y: p * u
502
- } : {
503
- x: p * u,
504
- y: f * m
505
- };
506
- }
507
- const Mt = function(e) {
508
- return e === void 0 && (e = 0), {
509
- name: "offset",
510
- options: e,
511
- async fn(t) {
512
- const {
513
- x: n,
514
- y: i
515
- } = t, o = await jt(t, e);
516
- return {
517
- x: n + o.x,
518
- y: i + o.y,
519
- data: o
520
- };
521
- }
522
- };
523
- }, It = function(e) {
524
- return e === void 0 && (e = {}), {
525
- name: "shift",
526
- options: e,
527
- async fn(t) {
528
- const {
529
- x: n,
530
- y: i,
531
- placement: o
532
- } = t, {
533
- mainAxis: r = !0,
534
- crossAxis: s = !1,
535
- limiter: l = {
536
- fn: (v) => {
537
- let {
538
- x: g,
539
- y: x
540
- } = v;
541
- return {
542
- x: g,
543
- y: x
544
- };
545
- }
546
- },
547
- ...c
548
- } = K(e, t), u = {
549
- x: n,
550
- y: i
551
- }, m = await ne(t, c), d = fe(V(o)), p = He(d);
552
- let f = u[p], a = u[d];
553
- if (r) {
554
- const v = p === "y" ? "top" : "left", g = p === "y" ? "bottom" : "right", x = f + m[v], b = f - m[g];
555
- f = ye(x, f, b);
556
- }
557
- if (s) {
558
- const v = d === "y" ? "top" : "left", g = d === "y" ? "bottom" : "right", x = a + m[v], b = a - m[g];
559
- a = ye(x, a, b);
560
- }
561
- const h = l.fn({
562
- ...t,
563
- [p]: f,
564
- [d]: a
565
- });
566
- return {
567
- ...h,
568
- data: {
569
- x: h.x - n,
570
- y: h.y - i
571
- }
572
- };
573
- }
574
- };
575
- };
576
- function q(e) {
577
- return Ue(e) ? (e.nodeName || "").toLowerCase() : "#document";
578
- }
579
- function k(e) {
580
- var t;
581
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
582
- }
583
- function U(e) {
584
- var t;
585
- return (t = (Ue(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
586
- }
587
- function Ue(e) {
588
- return e instanceof Node || e instanceof k(e).Node;
589
- }
590
- function W(e) {
591
- return e instanceof Element || e instanceof k(e).Element;
592
- }
593
- function I(e) {
594
- return e instanceof HTMLElement || e instanceof k(e).HTMLElement;
595
- }
596
- function ke(e) {
597
- return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof k(e).ShadowRoot;
598
- }
599
- function re(e) {
600
- const {
601
- overflow: t,
602
- overflowX: n,
603
- overflowY: i,
604
- display: o
605
- } = D(e);
606
- return /auto|scroll|overlay|hidden|clip/.test(t + i + n) && !["inline", "contents"].includes(o);
607
- }
608
- function _t(e) {
609
- return ["table", "td", "th"].includes(q(e));
610
- }
611
- function Ce(e) {
612
- const t = Oe(), n = D(e);
613
- return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (n.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (n.contain || "").includes(i));
614
- }
615
- function zt(e) {
616
- let t = ee(e);
617
- for (; I(t) && !de(t); ) {
618
- if (Ce(t))
619
- return t;
620
- t = ee(t);
621
- }
622
- return null;
623
- }
624
- function Oe() {
625
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
626
- }
627
- function de(e) {
628
- return ["html", "body", "#document"].includes(q(e));
629
- }
630
- function D(e) {
631
- return k(e).getComputedStyle(e);
632
- }
633
- function me(e) {
634
- return W(e) ? {
635
- scrollLeft: e.scrollLeft,
636
- scrollTop: e.scrollTop
637
- } : {
638
- scrollLeft: e.pageXOffset,
639
- scrollTop: e.pageYOffset
640
- };
641
- }
642
- function ee(e) {
643
- if (q(e) === "html")
644
- return e;
645
- const t = e.assignedSlot || e.parentNode || ke(e) && e.host || U(e);
646
- return ke(t) ? t.host : t;
647
- }
648
- function Xe(e) {
649
- const t = ee(e);
650
- return de(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : I(t) && re(t) ? t : Xe(t);
651
- }
652
- function oe(e, t, n) {
653
- var i;
654
- t === void 0 && (t = []), n === void 0 && (n = !0);
655
- const o = Xe(e), r = o === ((i = e.ownerDocument) == null ? void 0 : i.body), s = k(o);
656
- return r ? t.concat(s, s.visualViewport || [], re(o) ? o : [], s.frameElement && n ? oe(s.frameElement) : []) : t.concat(o, oe(o, [], n));
657
- }
658
- function qe(e) {
659
- const t = D(e);
660
- let n = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
661
- const o = I(e), r = o ? e.offsetWidth : n, s = o ? e.offsetHeight : i, l = le(n) !== r || le(i) !== s;
662
- return l && (n = r, i = s), {
663
- width: n,
664
- height: i,
665
- $: l
666
- };
667
- }
668
- function Ee(e) {
669
- return W(e) ? e : e.contextElement;
670
- }
671
- function Z(e) {
672
- const t = Ee(e);
673
- if (!I(t))
674
- return X(1);
675
- const n = t.getBoundingClientRect(), {
676
- width: i,
677
- height: o,
678
- $: r
679
- } = qe(t);
680
- let s = (r ? le(n.width) : n.width) / i, l = (r ? le(n.height) : n.height) / o;
681
- return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
682
- x: s,
683
- y: l
684
- };
685
- }
686
- const Ht = /* @__PURE__ */ X(0);
687
- function Ye(e) {
688
- const t = k(e);
689
- return !Oe() || !t.visualViewport ? Ht : {
690
- x: t.visualViewport.offsetLeft,
691
- y: t.visualViewport.offsetTop
692
- };
693
- }
694
- function Vt(e, t, n) {
695
- return t === void 0 && (t = !1), !n || t && n !== k(e) ? !1 : t;
696
- }
697
- function G(e, t, n, i) {
698
- t === void 0 && (t = !1), n === void 0 && (n = !1);
699
- const o = e.getBoundingClientRect(), r = Ee(e);
700
- let s = X(1);
701
- t && (i ? W(i) && (s = Z(i)) : s = Z(e));
702
- const l = Vt(r, n, i) ? Ye(r) : X(0);
703
- let c = (o.left + l.x) / s.x, u = (o.top + l.y) / s.y, m = o.width / s.x, d = o.height / s.y;
704
- if (r) {
705
- const p = k(r), f = i && W(i) ? k(i) : i;
706
- let a = p.frameElement;
707
- for (; a && i && f !== p; ) {
708
- const h = Z(a), v = a.getBoundingClientRect(), g = D(a), x = v.left + (a.clientLeft + parseFloat(g.paddingLeft)) * h.x, b = v.top + (a.clientTop + parseFloat(g.paddingTop)) * h.y;
709
- c *= h.x, u *= h.y, m *= h.x, d *= h.y, c += x, u += b, a = k(a).frameElement;
710
- }
711
- }
712
- return ue({
713
- width: m,
714
- height: d,
715
- x: c,
716
- y: u
717
- });
718
- }
719
- function Wt(e) {
720
- let {
721
- rect: t,
722
- offsetParent: n,
723
- strategy: i
724
- } = e;
725
- const o = I(n), r = U(n);
726
- if (n === r)
727
- return t;
728
- let s = {
729
- scrollLeft: 0,
730
- scrollTop: 0
731
- }, l = X(1);
732
- const c = X(0);
733
- if ((o || !o && i !== "fixed") && ((q(n) !== "body" || re(r)) && (s = me(n)), I(n))) {
734
- const u = G(n);
735
- l = Z(n), c.x = u.x + n.clientLeft, c.y = u.y + n.clientTop;
736
- }
737
- return {
738
- width: t.width * l.x,
739
- height: t.height * l.y,
740
- x: t.x * l.x - s.scrollLeft * l.x + c.x,
741
- y: t.y * l.y - s.scrollTop * l.y + c.y
742
- };
743
- }
744
- function Ut(e) {
745
- return Array.from(e.getClientRects());
746
- }
747
- function Ge(e) {
748
- return G(U(e)).left + me(e).scrollLeft;
749
- }
750
- function Xt(e) {
751
- const t = U(e), n = me(e), i = e.ownerDocument.body, o = Y(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = Y(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
752
- let s = -n.scrollLeft + Ge(e);
753
- const l = -n.scrollTop;
754
- return D(i).direction === "rtl" && (s += Y(t.clientWidth, i.clientWidth) - o), {
755
- width: o,
756
- height: r,
757
- x: s,
758
- y: l
759
- };
760
- }
761
- function qt(e, t) {
762
- const n = k(e), i = U(e), o = n.visualViewport;
763
- let r = i.clientWidth, s = i.clientHeight, l = 0, c = 0;
764
- if (o) {
765
- r = o.width, s = o.height;
766
- const u = Oe();
767
- (!u || u && t === "fixed") && (l = o.offsetLeft, c = o.offsetTop);
768
- }
769
- return {
770
- width: r,
771
- height: s,
772
- x: l,
773
- y: c
774
- };
775
- }
776
- function Yt(e, t) {
777
- const n = G(e, !0, t === "fixed"), i = n.top + e.clientTop, o = n.left + e.clientLeft, r = I(e) ? Z(e) : X(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, c = o * r.x, u = i * r.y;
778
- return {
779
- width: s,
780
- height: l,
781
- x: c,
782
- y: u
783
- };
784
- }
785
- function De(e, t, n) {
786
- let i;
787
- if (t === "viewport")
788
- i = qt(e, n);
789
- else if (t === "document")
790
- i = Xt(U(e));
791
- else if (W(t))
792
- i = Yt(t, n);
793
- else {
794
- const o = Ye(e);
795
- i = {
796
- ...t,
797
- x: t.x - o.x,
798
- y: t.y - o.y
799
- };
800
- }
801
- return ue(i);
802
- }
803
- function Ke(e, t) {
804
- const n = ee(e);
805
- return n === t || !W(n) || de(n) ? !1 : D(n).position === "fixed" || Ke(n, t);
806
- }
807
- function Gt(e, t) {
808
- const n = t.get(e);
809
- if (n)
810
- return n;
811
- let i = oe(e, [], !1).filter((l) => W(l) && q(l) !== "body"), o = null;
812
- const r = D(e).position === "fixed";
813
- let s = r ? ee(e) : e;
814
- for (; W(s) && !de(s); ) {
815
- const l = D(s), c = Ce(s);
816
- !c && l.position === "fixed" && (o = null), (r ? !c && !o : !c && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || re(s) && !c && Ke(e, s)) ? i = i.filter((m) => m !== s) : o = l, s = ee(s);
817
- }
818
- return t.set(e, i), i;
819
- }
820
- function Kt(e) {
821
- let {
822
- element: t,
823
- boundary: n,
824
- rootBoundary: i,
825
- strategy: o
826
- } = e;
827
- const s = [...n === "clippingAncestors" ? Gt(t, this._c) : [].concat(n), i], l = s[0], c = s.reduce((u, m) => {
828
- const d = De(t, m, o);
829
- return u.top = Y(d.top, u.top), u.right = J(d.right, u.right), u.bottom = J(d.bottom, u.bottom), u.left = Y(d.left, u.left), u;
830
- }, De(t, l, o));
831
- return {
832
- width: c.right - c.left,
833
- height: c.bottom - c.top,
834
- x: c.left,
835
- y: c.top
836
- };
837
- }
838
- function Qt(e) {
839
- return qe(e);
840
- }
841
- function Zt(e, t, n) {
842
- const i = I(t), o = U(t), r = n === "fixed", s = G(e, !0, r, t);
843
- let l = {
844
- scrollLeft: 0,
845
- scrollTop: 0
846
- };
847
- const c = X(0);
848
- if (i || !i && !r)
849
- if ((q(t) !== "body" || re(o)) && (l = me(t)), i) {
850
- const u = G(t, !0, r, t);
851
- c.x = u.x + t.clientLeft, c.y = u.y + t.clientTop;
852
- } else
853
- o && (c.x = Ge(o));
854
- return {
855
- x: s.left + l.scrollLeft - c.x,
856
- y: s.top + l.scrollTop - c.y,
857
- width: s.width,
858
- height: s.height
859
- };
860
- }
861
- function Ne(e, t) {
862
- return !I(e) || D(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
863
- }
864
- function Qe(e, t) {
865
- const n = k(e);
866
- if (!I(e))
867
- return n;
868
- let i = Ne(e, t);
869
- for (; i && _t(i) && D(i).position === "static"; )
870
- i = Ne(i, t);
871
- return i && (q(i) === "html" || q(i) === "body" && D(i).position === "static" && !Ce(i)) ? n : i || zt(e) || n;
872
- }
873
- const Jt = async function(e) {
874
- let {
875
- reference: t,
876
- floating: n,
877
- strategy: i
878
- } = e;
879
- const o = this.getOffsetParent || Qe, r = this.getDimensions;
880
- return {
881
- reference: Zt(t, await o(n), i),
882
- floating: {
883
- x: 0,
884
- y: 0,
885
- ...await r(n)
886
- }
887
- };
888
- };
889
- function en(e) {
890
- return D(e).direction === "rtl";
891
- }
892
- const tn = {
893
- convertOffsetParentRelativeRectToViewportRelativeRect: Wt,
894
- getDocumentElement: U,
895
- getClippingRect: Kt,
896
- getOffsetParent: Qe,
897
- getElementRects: Jt,
898
- getClientRects: Ut,
899
- getDimensions: Qt,
900
- getScale: Z,
901
- isElement: W,
902
- isRTL: en
903
- };
904
- function nn(e, t) {
905
- let n = null, i;
906
- const o = U(e);
907
- function r() {
908
- clearTimeout(i), n && n.disconnect(), n = null;
909
- }
910
- function s(l, c) {
911
- l === void 0 && (l = !1), c === void 0 && (c = 1), r();
912
- const {
913
- left: u,
914
- top: m,
915
- width: d,
916
- height: p
917
- } = e.getBoundingClientRect();
918
- if (l || t(), !d || !p)
919
- return;
920
- const f = se(m), a = se(o.clientWidth - (u + d)), h = se(o.clientHeight - (m + p)), v = se(u), x = {
921
- rootMargin: -f + "px " + -a + "px " + -h + "px " + -v + "px",
922
- threshold: Y(0, J(1, c)) || 1
923
- };
924
- let b = !0;
925
- function C(w) {
926
- const O = w[0].intersectionRatio;
927
- if (O !== c) {
928
- if (!b)
929
- return s();
930
- O ? s(!1, O) : i = setTimeout(() => {
931
- s(!1, 1e-7);
932
- }, 100);
933
- }
934
- b = !1;
935
- }
936
- try {
937
- n = new IntersectionObserver(C, {
938
- ...x,
939
- root: o.ownerDocument
940
- });
941
- } catch {
942
- n = new IntersectionObserver(C, x);
943
- }
944
- n.observe(e);
945
- }
946
- return s(!0), r;
947
- }
948
- function on(e, t, n, i) {
949
- i === void 0 && (i = {});
950
- const {
951
- ancestorScroll: o = !0,
952
- ancestorResize: r = !0,
953
- elementResize: s = typeof ResizeObserver == "function",
954
- layoutShift: l = typeof IntersectionObserver == "function",
955
- animationFrame: c = !1
956
- } = i, u = Ee(e), m = o || r ? [...u ? oe(u) : [], ...oe(t)] : [];
957
- m.forEach((g) => {
958
- o && g.addEventListener("scroll", n, {
959
- passive: !0
960
- }), r && g.addEventListener("resize", n);
961
- });
962
- const d = u && l ? nn(u, n) : null;
963
- let p = -1, f = null;
964
- s && (f = new ResizeObserver((g) => {
965
- let [x] = g;
966
- x && x.target === u && f && (f.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
967
- f && f.observe(t);
968
- })), n();
969
- }), u && !c && f.observe(u), f.observe(t));
970
- let a, h = c ? G(e) : null;
971
- c && v();
972
- function v() {
973
- const g = G(e);
974
- h && (g.x !== h.x || g.y !== h.y || g.width !== h.width || g.height !== h.height) && n(), h = g, a = requestAnimationFrame(v);
975
- }
976
- return n(), () => {
977
- m.forEach((g) => {
978
- o && g.removeEventListener("scroll", n), r && g.removeEventListener("resize", n);
979
- }), d && d(), f && f.disconnect(), f = null, c && cancelAnimationFrame(a);
980
- };
981
- }
982
- const rn = (e, t, n) => {
983
- const i = /* @__PURE__ */ new Map(), o = {
984
- platform: tn,
985
- ...n
986
- }, r = {
987
- ...o.platform,
988
- _c: i
989
- };
990
- return Lt(e, t, {
991
- ...o,
992
- platform: r
993
- });
994
- };
995
- function we(e) {
996
- var t;
997
- return (t = e == null ? void 0 : e.$el) != null ? t : e;
998
- }
999
- function sn(e) {
1000
- return {
1001
- name: "arrow",
1002
- options: e,
1003
- fn(t) {
1004
- const n = we(H(e.element));
1005
- return n == null ? {} : Bt({
1006
- element: n,
1007
- padding: e.padding
1008
- }).fn(t);
1009
- }
1010
- };
1011
- }
1012
- function ln(e, t, n) {
1013
- n === void 0 && (n = {});
1014
- const i = n.whileElementsMounted, o = L(() => {
1015
- var w;
1016
- return (w = H(n.open)) != null ? w : !0;
1017
- }), r = L(() => H(n.middleware)), s = L(() => {
1018
- var w;
1019
- return (w = H(n.placement)) != null ? w : "bottom";
1020
- }), l = L(() => {
1021
- var w;
1022
- return (w = H(n.strategy)) != null ? w : "absolute";
1023
- }), c = L(() => we(e.value)), u = L(() => we(t.value)), m = F(null), d = F(null), p = F(l.value), f = F(s.value), a = Me({}), h = F(!1);
1024
- let v;
1025
- function g() {
1026
- c.value == null || u.value == null || rn(c.value, u.value, {
1027
- middleware: r.value,
1028
- placement: s.value,
1029
- strategy: l.value
1030
- }).then((w) => {
1031
- m.value = w.x, d.value = w.y, p.value = w.strategy, f.value = w.placement, a.value = w.middlewareData, h.value = !0;
1032
- });
1033
- }
1034
- function x() {
1035
- typeof v == "function" && (v(), v = void 0);
1036
- }
1037
- function b() {
1038
- if (x(), i === void 0) {
1039
- g();
1040
- return;
1041
- }
1042
- if (c.value != null && u.value != null) {
1043
- v = i(c.value, u.value, g);
1044
- return;
1045
- }
1046
- }
1047
- function C() {
1048
- o.value || (h.value = !1);
1049
- }
1050
- return j([r, s, l], g, {
1051
- flush: "sync"
1052
- }), j([c, u], b, {
1053
- flush: "sync"
1054
- }), j(o, C, {
1055
- flush: "sync"
1056
- }), nt() && ot(x), {
1057
- x: Q(m),
1058
- y: Q(d),
1059
- strategy: Q(p),
1060
- placement: Q(f),
1061
- middlewareData: Q(a),
1062
- isPositioned: Q(h),
1063
- update: g
1064
- };
1065
- }
1066
- var an = Object.defineProperty, cn = (e, t, n) => t in e ? an(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, un = (e, t, n) => (cn(e, typeof t != "symbol" ? t + "" : t, n), n);
1067
- function ie(e) {
1068
- var n;
1069
- if (e == null || e.value == null)
1070
- return null;
1071
- const t = (n = e.value.$el) != null ? n : e.value;
1072
- return t.$el ? ie(F(t)) : t;
1073
- }
1074
- class fn {
1075
- constructor() {
1076
- un(this, "current", this.detect());
1077
- }
1078
- set(t) {
1079
- this.current !== t && (this.current = t);
1080
- }
1081
- reset() {
1082
- this.set(this.detect());
1083
- }
1084
- get isServer() {
1085
- return this.current === "server";
1086
- }
1087
- get isClient() {
1088
- return this.current === "client";
1089
- }
1090
- detect() {
1091
- return typeof window > "u" || typeof document > "u" ? "server" : "client";
1092
- }
1093
- }
1094
- const pe = new fn();
1095
- function Ze(e) {
1096
- return e.reduce((t, n) => n.type === Ie ? t.concat(Ze(n.children)) : t.concat(n), []);
1097
- }
1098
- function dn(e) {
1099
- return e == null ? !1 : typeof e.type == "string" || typeof e.type == "object" || typeof e.type == "function";
1100
- }
1101
- function $e(e) {
1102
- return e = H(e), e && (e == null ? void 0 : e.nodeType) !== Node.COMMENT_NODE;
1103
- }
1104
- function mn(e) {
1105
- if (pe.isServer)
1106
- return null;
1107
- if (e instanceof Node)
1108
- return e.ownerDocument;
1109
- if (Object.prototype.hasOwnProperty.call(e, "value")) {
1110
- const t = ie(e);
1111
- if (t)
1112
- return t.ownerDocument;
1113
- }
1114
- return document;
1115
- }
1116
- function pn(e, t, n, i, o) {
1117
- j([
1118
- () => o.offset,
1119
- () => o.flip,
1120
- () => o.shift,
1121
- () => o.autoPlacement,
1122
- () => o.arrow,
1123
- () => o.hide,
1124
- () => o.middleware
1125
- ], () => {
1126
- const r = [];
1127
- (typeof o.offset == "number" || typeof o.offset == "object" || typeof o.offset == "function") && r.push(Mt(o.offset)), (o.flip === !0 || typeof o.flip == "number" || typeof o.flip == "object") && r.push(Nt({
1128
- padding: typeof o.flip == "number" ? o.flip : void 0,
1129
- ...typeof o.flip == "object" ? o.flip : {}
1130
- })), (o.shift === !0 || typeof o.shift == "number" || typeof o.shift == "object") && r.push(It({
1131
- padding: typeof o.shift == "number" ? o.shift : void 0,
1132
- ...typeof o.shift == "object" ? o.shift : {}
1133
- })), (o.autoPlacement === !0 || typeof o.autoPlacement == "object") && r.push(Dt(
1134
- typeof o.autoPlacement == "object" ? o.autoPlacement : void 0
1135
- )), (o.arrow === !0 || typeof o.arrow == "number") && r.push(sn({
1136
- element: i,
1137
- padding: o.arrow === !0 ? 0 : o.arrow
1138
- })), r.push(...typeof o.middleware == "function" ? o.middleware({
1139
- referenceEl: t,
1140
- floatingEl: n
1141
- }) : o.middleware || []), (o.hide === !0 || typeof o.hide == "object") && r.push($t(
1142
- typeof o.hide == "object" ? o.hide : void 0
1143
- )), e.value = r;
1144
- }, { immediate: !0 });
1145
- }
1146
- function gn(e, t, n) {
1147
- let i = () => {
1148
- };
1149
- _e(() => {
1150
- if (e && pe.isClient && typeof ResizeObserver < "u" && t.value && t.value instanceof Element) {
1151
- const o = new ResizeObserver(([r]) => {
1152
- n.value = r.borderBoxSize.reduce((s, { inlineSize: l }) => s + l, 0);
1153
- });
1154
- o.observe(t.value), i = () => {
1155
- o.disconnect(), n.value = null;
1156
- };
1157
- }
1158
- }), st(() => {
1159
- i();
1160
- });
1161
- }
1162
- const hn = (e) => {
1163
- switch (e) {
1164
- case "top":
1165
- return "origin-bottom";
1166
- case "bottom":
1167
- return "origin-top";
1168
- case "left":
1169
- return "origin-right";
1170
- case "right":
1171
- return "origin-left";
1172
- case "top-start":
1173
- case "right-end":
1174
- return "origin-bottom-left";
1175
- case "top-end":
1176
- case "left-end":
1177
- return "origin-bottom-right";
1178
- case "right-start":
1179
- case "bottom-start":
1180
- return "origin-top-left";
1181
- case "left-start":
1182
- case "bottom-end":
1183
- return "origin-top-right";
1184
- default:
1185
- return "";
1186
- }
1187
- };
1188
- function vn(e, t) {
1189
- const n = L(() => {
1190
- if (typeof e.originClass == "function")
1191
- return e.originClass(t.value);
1192
- if (typeof e.originClass == "string")
1193
- return e.originClass;
1194
- if (e.tailwindcssOriginClass)
1195
- return hn(t.value);
1196
- }), i = L(
1197
- () => e.enter || n.value ? `${e.enter || ""} ${n.value || ""}` : void 0
1198
- ), o = L(
1199
- () => e.leave || n.value ? `${e.leave || ""} ${n.value || ""}` : void 0
1200
- );
1201
- return { originClassRef: n, enterActiveClassRef: i, leaveActiveClassRef: o };
1202
- }
1203
- function Je(e, t, ...n) {
1204
- if (e in t) {
1205
- const o = t[e];
1206
- return typeof o == "function" ? o(...n) : o;
1207
- }
1208
- const i = new Error(
1209
- `Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(
1210
- t
1211
- ).map((o) => `"${o}"`).join(", ")}.`
1212
- );
1213
- throw Error.captureStackTrace && Error.captureStackTrace(i, Je), i;
1214
- }
1215
- const je = [
1216
- "[contentEditable=true]",
1217
- "[tabindex]",
1218
- "a[href]",
1219
- "area[href]",
1220
- "button:not([disabled])",
1221
- "iframe",
1222
- "input:not([disabled])",
1223
- "select:not([disabled])",
1224
- "textarea:not([disabled])"
1225
- ].map(
1226
- (e) => `${e}:not([tabindex='-1'])`
1227
- ).join(",");
1228
- var et = /* @__PURE__ */ ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(et || {});
1229
- function yn(e, t = 0) {
1230
- var n;
1231
- return e === ((n = mn(e)) == null ? void 0 : n.body) ? !1 : Je(t, {
1232
- 0() {
1233
- return e.matches(je);
1234
- },
1235
- 1() {
1236
- let i = e;
1237
- for (; i !== null; ) {
1238
- if (i.matches(je))
1239
- return !0;
1240
- i = i.parentElement;
1241
- }
1242
- return !1;
1243
- }
1244
- });
1245
- }
1246
- function ve(e, t, n) {
1247
- pe.isServer || lt((i) => {
1248
- document.addEventListener(e, t, n), i(() => document.removeEventListener(e, t, n));
1249
- });
1250
- }
1251
- function wn(e, t, n = L(() => !0)) {
1252
- function i(r, s) {
1253
- if (!n.value || r.defaultPrevented)
1254
- return;
1255
- const l = s(r);
1256
- if (l === null || !l.getRootNode().contains(l))
1257
- return;
1258
- const c = function u(m) {
1259
- return typeof m == "function" ? u(m()) : Array.isArray(m) || m instanceof Set ? m : [m];
1260
- }(e);
1261
- for (const u of c) {
1262
- if (u === null)
1263
- continue;
1264
- const m = u instanceof HTMLElement ? u : ie(u);
1265
- if (m != null && m.contains(l) || r.composed && r.composedPath().includes(m))
1266
- return;
1267
- }
1268
- return !yn(l, et.Loose) && l.tabIndex !== -1 && r.preventDefault(), t(r, l);
1269
- }
1270
- const o = F(null);
1271
- ve("mousedown", (r) => {
1272
- var s, l;
1273
- n.value && (o.value = ((l = (s = r.composedPath) == null ? void 0 : s.call(r)) == null ? void 0 : l[0]) || r.target);
1274
- }, !0), ve(
1275
- "click",
1276
- (r) => {
1277
- o.value && (i(r, () => o.value), o.value = null);
1278
- },
1279
- !0
1280
- ), ve("blur", (r) => i(
1281
- r,
1282
- () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null
1283
- ), !0);
1284
- }
1285
- const xn = Symbol("ArrowContext"), y = {
1286
- as: {
1287
- type: [String, Function],
1288
- default: "template"
1289
- },
1290
- floatingAs: {
1291
- type: [String, Function],
1292
- default: "div"
1293
- },
1294
- show: {
1295
- type: Boolean,
1296
- default: null
1297
- },
1298
- placement: {
1299
- type: String,
1300
- default: "bottom-start"
1301
- },
1302
- strategy: {
1303
- type: String,
1304
- default: "absolute"
1305
- },
1306
- offset: [Number, Function, Object],
1307
- shift: {
1308
- type: [Boolean, Number, Object],
1309
- default: !1
1310
- },
1311
- flip: {
1312
- type: [Boolean, Number, Object],
1313
- default: !1
1314
- },
1315
- arrow: {
1316
- type: [Boolean, Number],
1317
- default: !1
1318
- },
1319
- autoPlacement: {
1320
- type: [Boolean, Object],
1321
- default: !1
1322
- },
1323
- hide: {
1324
- type: [Boolean, Object],
1325
- default: !1
1326
- },
1327
- autoUpdate: {
1328
- type: [Boolean, Object],
1329
- default: !0
1330
- },
1331
- zIndex: {
1332
- type: [Number, String],
1333
- default: 9999
1334
- },
1335
- transitionName: String,
1336
- transitionType: String,
1337
- enter: String,
1338
- enterFrom: String,
1339
- enterTo: String,
1340
- leave: String,
1341
- leaveFrom: String,
1342
- leaveTo: String,
1343
- originClass: [String, Function],
1344
- tailwindcssOriginClass: {
1345
- type: Boolean,
1346
- default: !1
1347
- },
1348
- portal: {
1349
- type: Boolean,
1350
- default: !1
1351
- },
1352
- transform: {
1353
- type: Boolean,
1354
- default: !0
1355
- },
1356
- adaptiveWidth: {
1357
- type: Boolean,
1358
- default: !1
1359
- },
1360
- composable: {
1361
- type: Boolean,
1362
- default: !1
1363
- },
1364
- dialog: {
1365
- type: Boolean,
1366
- default: !1
1367
- },
1368
- middleware: {
1369
- type: [Array, Function],
1370
- default: () => []
1371
- }
1372
- };
1373
- function bn(e, t, n, i) {
1374
- const { floatingRef: o, props: r, mounted: s, show: l, x: c, y: u, placement: m, strategy: d, referenceElWidth: p, updateFloating: f } = i, a = ge(
1375
- { ...r, as: r.floatingAs },
1376
- t
1377
- ), { enterActiveClassRef: h, leaveActiveClassRef: v } = vn(a, m), g = {
1378
- enterActiveClass: h.value,
1379
- enterFromClass: a.enterFrom,
1380
- enterToClass: a.enterTo,
1381
- leaveActiveClass: v.value,
1382
- leaveFromClass: a.leaveFrom,
1383
- leaveToClass: a.leaveTo
1384
- }, x = {
1385
- name: a.transitionName,
1386
- type: a.transitionType,
1387
- appear: !0,
1388
- ...a.transitionName ? {} : g,
1389
- onBeforeEnter() {
1390
- l.value = !0;
1391
- },
1392
- onAfterLeave() {
1393
- l.value = !1;
1394
- }
1395
- }, b = {
1396
- enter: h.value,
1397
- enterFrom: a.enterFrom,
1398
- enterTo: a.enterTo,
1399
- leave: v.value,
1400
- leaveFrom: a.leaveFrom,
1401
- leaveTo: a.leaveTo,
1402
- onBeforeEnter: x.onBeforeEnter,
1403
- onAfterLeave: x.onAfterLeave
1404
- }, C = {
1405
- style: {
1406
- ...!a.dialog && a.transform ? {
1407
- position: d.value,
1408
- zIndex: a.zIndex,
1409
- top: "0px",
1410
- left: "0px",
1411
- right: "auto",
1412
- bottom: "auto",
1413
- transform: `translate(${Math.round(c.value || 0)}px,${Math.round(u.value || 0)}px)`
1414
- } : {
1415
- position: d.value,
1416
- zIndex: a.zIndex,
1417
- top: `${u.value || 0}px`,
1418
- left: `${c.value || 0}px`
1419
- },
1420
- width: a.adaptiveWidth && typeof p.value == "number" ? `${p.value}px` : void 0
1421
- }
1422
- };
1423
- function w(A) {
1424
- return a.portal ? te(at, () => A) : A;
1425
- }
1426
- function O(A) {
1427
- const R = ge(
1428
- C,
1429
- n,
1430
- a.dialog ? {} : { ref: o }
1431
- );
1432
- return a.as === "template" ? A : typeof a.as == "string" ? te(a.as, R, A) : te(a.as, R, () => A);
1433
- }
1434
- function E() {
1435
- function A() {
1436
- var R;
1437
- const T = a.as === "template" ? ge(
1438
- C,
1439
- n,
1440
- a.dialog ? {} : { ref: o }
1441
- ) : null, S = ft(e, T);
1442
- return ((R = S.props) == null ? void 0 : R.unmount) === !1 ? (f(), S) : typeof a.show != "boolean" || a.show ? S : Se();
1443
- }
1444
- return pe.isServer ? s.value && a.show ? A() : Se() : a.transitionChild ? te(ct, {
1445
- key: `placement-${m.value}`,
1446
- ...a.dialog ? { ref: o } : {},
1447
- as: "template",
1448
- ...b
1449
- }, A) : te(ut, {
1450
- ...a.dialog ? { ref: o } : {},
1451
- ...x
1452
- }, A);
1453
- }
1454
- return w(
1455
- O(
1456
- E()
1457
- )
1458
- );
1459
- }
1460
- function Cn(e, t, n, i, o) {
1461
- const r = F(!1), s = Ae(i, "placement"), l = Ae(i, "strategy"), c = Me({}), u = F(null), m = F(void 0), d = F(void 0), p = L(() => ie(t)), f = L(() => ie(n)), a = L(
1462
- () => $e(p) && $e(f)
1463
- ), { x: h, y: v, placement: g, strategy: x, middlewareData: b, update: C } = ln(p, f, {
1464
- placement: s,
1465
- strategy: l,
1466
- middleware: c,
1467
- whileElementsMounted: () => {
1468
- }
1469
- }), w = F(null);
1470
- _e(() => {
1471
- r.value = !0;
1472
- }), j(e, (S, P) => {
1473
- S && !P ? o("show") : !S && P && o("hide");
1474
- }, { immediate: !0 });
1475
- function O() {
1476
- a.value && (C(), o("update"));
1477
- }
1478
- j([s, l, c], O, { flush: "sync" }), pn(
1479
- c,
1480
- p,
1481
- f,
1482
- u,
1483
- i
1484
- ), j(b, () => {
1485
- const S = b.value.arrow;
1486
- m.value = S == null ? void 0 : S.x, d.value = S == null ? void 0 : S.y;
1487
- }), gn(i.adaptiveWidth, p, w), j(e, async (S, P, _) => {
1488
- if (await it(), e.value && a.value && i.autoUpdate) {
1489
- const B = on(
1490
- p.value,
1491
- f.value,
1492
- O,
1493
- typeof i.autoUpdate == "object" ? i.autoUpdate : void 0
1494
- );
1495
- _(B);
1496
- }
1497
- }, { flush: "post", immediate: !0 });
1498
- const E = F(!0);
1499
- j(p, () => {
1500
- !(p.value instanceof Element) && a.value && E.value && (E.value = !1, window.requestAnimationFrame(() => {
1501
- E.value = !0, O();
1502
- }));
1503
- }, { flush: "sync" });
1504
- const A = {
1505
- referenceRef: t,
1506
- placement: g
1507
- }, R = {
1508
- floatingRef: n,
1509
- props: i,
1510
- mounted: r,
1511
- show: e,
1512
- x: h,
1513
- y: v,
1514
- placement: g,
1515
- strategy: x,
1516
- referenceElWidth: w,
1517
- updateFloating: O
1518
- }, T = {
1519
- ref: u,
1520
- placement: g,
1521
- x: m,
1522
- y: d
1523
- };
1524
- return rt(xn, T), { referenceApi: A, floatingApi: R, arrowApi: T, x: h, y: v, placement: g, strategy: x, referenceEl: p, floatingEl: f, middlewareData: b, update: O };
1525
- }
1526
- ({
1527
- ...y.as
1528
- });
1529
- const On = {
1530
- as: y.as,
1531
- show: y.show,
1532
- placement: y.placement,
1533
- strategy: y.strategy,
1534
- offset: y.offset,
1535
- shift: y.shift,
1536
- flip: y.flip,
1537
- arrow: y.arrow,
1538
- autoPlacement: y.autoPlacement,
1539
- hide: y.hide,
1540
- autoUpdate: y.autoUpdate,
1541
- zIndex: y.zIndex,
1542
- transitionName: y.transitionName,
1543
- transitionType: y.transitionType,
1544
- enter: y.enter,
1545
- enterFrom: y.enterFrom,
1546
- enterTo: y.enterTo,
1547
- leave: y.leave,
1548
- leaveFrom: y.leaveFrom,
1549
- leaveTo: y.leaveTo,
1550
- originClass: y.originClass,
1551
- tailwindcssOriginClass: y.tailwindcssOriginClass,
1552
- portal: y.portal,
1553
- transform: y.transform,
1554
- middleware: y.middleware
1555
- }, En = {
1556
- name: "FloatVirtual",
1557
- inheritAttrs: !1,
1558
- props: On,
1559
- emits: ["initial", "show", "hide", "update"],
1560
- setup(e, { emit: t, slots: n, attrs: i }) {
1561
- var m;
1562
- const o = F((m = e.show) != null ? m : !1), r = F({
1563
- getBoundingClientRect() {
1564
- return {
1565
- x: 0,
1566
- y: 0,
1567
- top: 0,
1568
- left: 0,
1569
- bottom: 0,
1570
- right: 0,
1571
- width: 0,
1572
- height: 0
1573
- };
1574
- }
1575
- }), s = F(null), {
1576
- floatingApi: l,
1577
- placement: c
1578
- } = Cn(o, r, s, e, t);
1579
- j(() => e.show, () => {
1580
- var d;
1581
- o.value = (d = e.show) != null ? d : !1;
1582
- });
1583
- function u() {
1584
- o.value = !1;
1585
- }
1586
- return t("initial", {
1587
- show: o,
1588
- placement: c,
1589
- reference: r,
1590
- floating: s
1591
- }), () => {
1592
- if (!n.default)
1593
- return;
1594
- const d = {
1595
- placement: c.value,
1596
- close: u
1597
- }, [p] = Ze(n.default(d)).filter(dn);
1598
- return bn(
1599
- p,
1600
- {
1601
- as: e.as,
1602
- show: o.value
1603
- },
1604
- i,
1605
- l
1606
- );
1607
- };
1608
- }
1609
- };
1610
- y.as, y.placement, y.strategy, y.offset, y.shift, {
1611
- ...y.flip
1612
- }, y.arrow, y.autoPlacement, y.hide, y.autoUpdate, y.zIndex, y.transitionName, y.transitionType, y.enter, y.enterFrom, y.enterTo, y.leave, y.leaveFrom, y.leaveTo, y.originClass, y.tailwindcssOriginClass, y.transform, y.middleware;
1613
- const An = { class: "flex bg-white shadow-md z-10 rounded-md p-1" }, Sn = ["onClick"], Rn = /* @__PURE__ */ dt({
1614
- __name: "StylePanel",
1615
- setup(e) {
1616
- const t = F({ value: null }), n = mt(), i = L(
1617
- () => n.getters.onContentChange || (() => {
1618
- })
1619
- ), o = L(
1620
- () => pt(n.getters.diagramElement) + gt
1621
- ), r = L(() => n.getters.code), s = (d) => {
1622
- n.dispatch("updateCode", { code: d }), i.value(d);
1623
- }, l = F([]);
1624
- let c;
1625
- const u = ({ show: d, reference: p, floating: f }) => {
1626
- let a, h, v, g, x, b;
1627
- n.commit("onMessageClick", (C, w) => {
1628
- var O;
1629
- if (a = C.value.start.start, h = Ct(r.value, a), v = Ot(r.value, a), g = ((O = r.value.slice(h).match(/^\s*/)) == null ? void 0 : O[0]) || "", x = v.trim().startsWith("//"), x) {
1630
- const E = v.trimStart().slice(2).trimStart(), A = E.indexOf("["), R = E.indexOf("]");
1631
- b = Boolean(A === 0 && R), b ? l.value = E.slice(A + 1, R).split(",").map((T) => T.trim()) : l.value = [];
1632
- }
1633
- p.value = {
1634
- getBoundingClientRect: () => w.getBoundingClientRect()
1635
- }, t.value = C, d.value = !0;
1636
- }), wn(
1637
- f,
1638
- () => {
1639
- d.value = !1, l.value = [];
1640
- },
1641
- L(() => d.value)
1642
- ), c = (C) => {
1643
- var w;
1644
- if (d.value = !1, !!t.value.value)
1645
- if (x) {
1646
- let O = "";
1647
- if (b) {
1648
- let E;
1649
- l.value.includes(C) ? E = l.value.filter((A) => A !== C) : E = [...l.value, C], O = `${g}// [${E.filter(Boolean).join(", ")}] ${v.slice(v.indexOf("]") + 1).trimStart()}`;
1650
- } else
1651
- O = `${g}// [${C}] ${v.slice((((w = v.match(/\/\/*/)) == null ? void 0 : w.index) || -2) + 2).trimStart()}`;
1652
- O.endsWith(`
1653
- `) || (O += `
1654
- `), s(
1655
- r.value.slice(0, Et(r.value, a)) + O + r.value.slice(h)
1656
- );
1657
- } else
1658
- s(
1659
- r.value.slice(0, h) + `${g}// [${C}]
1660
- ` + r.value.slice(h)
1661
- );
1662
- };
1663
- }, m = [
1664
- {
1665
- name: "bold",
1666
- content: "B",
1667
- class: "font-bold"
1668
- },
1669
- {
1670
- name: "italic",
1671
- content: "I",
1672
- class: "italic"
1673
- },
1674
- {
1675
- name: "underline",
1676
- content: "U",
1677
- class: "underline"
1678
- },
1679
- {
1680
- name: "strikethrough",
1681
- content: "S",
1682
- class: "line-through"
1683
- }
1684
- ];
1685
- return (d, p) => (Te(), ht(H(En), {
1686
- key: "tool",
1687
- onInitial: u,
1688
- placement: "top",
1689
- offset: 5,
1690
- flip: { padding: H(o) },
1691
- shift: "",
1692
- zIndex: "30"
1693
- }, {
1694
- default: vt(() => [
1695
- he("div", An, [
1696
- (Te(), yt(Ie, null, wt(m, (f) => he("div", {
1697
- onClick: () => H(c)(f.class),
1698
- key: f.name
1699
- }, [
1700
- he("div", {
1701
- class: xt(["w-6 mx-1 py-1 rounded-md text-black text-center cursor-pointer hover:bg-gray-200", [
1702
- f.class,
1703
- { "bg-gray-100": l.value.includes(f.class) }
1704
- ]])
1705
- }, bt(f.content), 3)
1706
- ], 8, Sn)), 64))
1707
- ])
1708
- ], void 0, !0),
1709
- _: 1
1710
- }, 8, ["flip"]));
1711
- }
1712
- });
1713
- export {
1714
- Rn as default
1715
- };
1716
- //# sourceMappingURL=StylePanel.2584aeb2.js.map