@trailguide/core 0.0.3 → 0.1.1
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.
- package/dist/analytics.d.ts +1 -1
- package/dist/analytics.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/storage.d.ts +21 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/trailguide.d.ts +1 -0
- package/dist/trailguide.d.ts.map +1 -1
- package/dist/trailguide.js +488 -418
- package/dist/trailguide.umd.js +4 -4
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -7
- package/LICENSE +0 -21
package/dist/trailguide.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
1
|
+
var Xt = Object.defineProperty;
|
|
2
|
+
var zt = (t, e, n) => e in t ? Xt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var C = (t, e, n) => zt(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
const Q = Math.min, z = Math.max, st = Math.round, L = (t) => ({
|
|
5
5
|
x: t,
|
|
6
6
|
y: t
|
|
7
|
-
}),
|
|
7
|
+
}), jt = {
|
|
8
8
|
left: "right",
|
|
9
9
|
right: "left",
|
|
10
10
|
bottom: "top",
|
|
11
11
|
top: "bottom"
|
|
12
|
-
},
|
|
12
|
+
}, Yt = {
|
|
13
13
|
start: "end",
|
|
14
14
|
end: "start"
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
return z(t,
|
|
16
|
+
function gt(t, e, n) {
|
|
17
|
+
return z(t, Q(e, n));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function tt(t, e) {
|
|
20
20
|
return typeof t == "function" ? t(e) : t;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function X(t) {
|
|
23
23
|
return t.split("-")[0];
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function et(t) {
|
|
26
26
|
return t.split("-")[1];
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function $t(t) {
|
|
29
29
|
return t === "x" ? "y" : "x";
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function wt(t) {
|
|
32
32
|
return t === "y" ? "height" : "width";
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const Kt = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
35
35
|
function _(t) {
|
|
36
|
-
return
|
|
36
|
+
return Kt.has(X(t)) ? "y" : "x";
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
38
|
+
function xt(t) {
|
|
39
|
+
return $t(_(t));
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function Gt(t, e, n) {
|
|
42
42
|
n === void 0 && (n = !1);
|
|
43
|
-
const i =
|
|
43
|
+
const i = et(t), o = xt(t), s = wt(o);
|
|
44
44
|
let r = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
45
|
-
return e.reference[s] > e.floating[s] && (r =
|
|
45
|
+
return e.reference[s] > e.floating[s] && (r = rt(r)), [r, rt(r)];
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const e =
|
|
49
|
-
return [
|
|
47
|
+
function Jt(t) {
|
|
48
|
+
const e = rt(t);
|
|
49
|
+
return [mt(t), e, mt(e)];
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return t.replace(/start|end/g, (e) =>
|
|
51
|
+
function mt(t) {
|
|
52
|
+
return t.replace(/start|end/g, (e) => Yt[e]);
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
function
|
|
54
|
+
const At = ["left", "right"], Tt = ["right", "left"], Ut = ["top", "bottom"], Qt = ["bottom", "top"];
|
|
55
|
+
function Zt(t, e, n) {
|
|
56
56
|
switch (t) {
|
|
57
57
|
case "top":
|
|
58
58
|
case "bottom":
|
|
59
|
-
return n ? e ?
|
|
59
|
+
return n ? e ? Tt : At : e ? At : Tt;
|
|
60
60
|
case "left":
|
|
61
61
|
case "right":
|
|
62
|
-
return e ?
|
|
62
|
+
return e ? Ut : Qt;
|
|
63
63
|
default:
|
|
64
64
|
return [];
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const o =
|
|
69
|
-
let s =
|
|
70
|
-
return o && (s = s.map((r) => r + "-" + o), e && (s = s.concat(s.map(
|
|
67
|
+
function te(t, e, n, i) {
|
|
68
|
+
const o = et(t);
|
|
69
|
+
let s = Zt(X(t), n === "start", i);
|
|
70
|
+
return o && (s = s.map((r) => r + "-" + o), e && (s = s.concat(s.map(mt)))), s;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
72
|
+
function rt(t) {
|
|
73
|
+
return t.replace(/left|right|bottom|top/g, (e) => jt[e]);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function ee(t) {
|
|
76
76
|
return {
|
|
77
77
|
top: 0,
|
|
78
78
|
right: 0,
|
|
@@ -81,15 +81,15 @@ function Ut(t) {
|
|
|
81
81
|
...t
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return typeof t != "number" ?
|
|
84
|
+
function Lt(t) {
|
|
85
|
+
return typeof t != "number" ? ee(t) : {
|
|
86
86
|
top: t,
|
|
87
87
|
right: t,
|
|
88
88
|
bottom: t,
|
|
89
89
|
left: t
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function lt(t) {
|
|
93
93
|
const {
|
|
94
94
|
x: e,
|
|
95
95
|
y: n,
|
|
@@ -107,55 +107,55 @@ function st(t) {
|
|
|
107
107
|
y: n
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Ct(t, e, n) {
|
|
111
111
|
let {
|
|
112
112
|
reference: i,
|
|
113
113
|
floating: o
|
|
114
114
|
} = t;
|
|
115
|
-
const s = _(e), r =
|
|
116
|
-
let
|
|
117
|
-
switch (
|
|
115
|
+
const s = _(e), r = xt(e), l = wt(r), a = X(e), c = s === "y", d = i.x + i.width / 2 - o.width / 2, u = i.y + i.height / 2 - o.height / 2, h = i[l] / 2 - o[l] / 2;
|
|
116
|
+
let f;
|
|
117
|
+
switch (a) {
|
|
118
118
|
case "top":
|
|
119
|
-
|
|
119
|
+
f = {
|
|
120
120
|
x: d,
|
|
121
121
|
y: i.y - o.height
|
|
122
122
|
};
|
|
123
123
|
break;
|
|
124
124
|
case "bottom":
|
|
125
|
-
|
|
125
|
+
f = {
|
|
126
126
|
x: d,
|
|
127
127
|
y: i.y + i.height
|
|
128
128
|
};
|
|
129
129
|
break;
|
|
130
130
|
case "right":
|
|
131
|
-
|
|
131
|
+
f = {
|
|
132
132
|
x: i.x + i.width,
|
|
133
|
-
y:
|
|
133
|
+
y: u
|
|
134
134
|
};
|
|
135
135
|
break;
|
|
136
136
|
case "left":
|
|
137
|
-
|
|
137
|
+
f = {
|
|
138
138
|
x: i.x - o.width,
|
|
139
|
-
y:
|
|
139
|
+
y: u
|
|
140
140
|
};
|
|
141
141
|
break;
|
|
142
142
|
default:
|
|
143
|
-
|
|
143
|
+
f = {
|
|
144
144
|
x: i.x,
|
|
145
145
|
y: i.y
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
switch (
|
|
148
|
+
switch (et(e)) {
|
|
149
149
|
case "start":
|
|
150
|
-
|
|
150
|
+
f[r] -= h * (n && c ? -1 : 1);
|
|
151
151
|
break;
|
|
152
152
|
case "end":
|
|
153
|
-
|
|
153
|
+
f[r] += h * (n && c ? -1 : 1);
|
|
154
154
|
break;
|
|
155
155
|
}
|
|
156
|
-
return
|
|
156
|
+
return f;
|
|
157
157
|
}
|
|
158
|
-
async function
|
|
158
|
+
async function ie(t, e) {
|
|
159
159
|
var n;
|
|
160
160
|
e === void 0 && (e = {});
|
|
161
161
|
const {
|
|
@@ -164,19 +164,19 @@ async function Qt(t, e) {
|
|
|
164
164
|
platform: s,
|
|
165
165
|
rects: r,
|
|
166
166
|
elements: l,
|
|
167
|
-
strategy:
|
|
167
|
+
strategy: a
|
|
168
168
|
} = t, {
|
|
169
|
-
boundary:
|
|
169
|
+
boundary: c = "clippingAncestors",
|
|
170
170
|
rootBoundary: d = "viewport",
|
|
171
|
-
elementContext:
|
|
171
|
+
elementContext: u = "floating",
|
|
172
172
|
altBoundary: h = !1,
|
|
173
|
-
padding:
|
|
174
|
-
} =
|
|
173
|
+
padding: f = 0
|
|
174
|
+
} = tt(e, t), p = Lt(f), m = l[h ? u === "floating" ? "reference" : "floating" : u], y = lt(await s.getClippingRect({
|
|
175
175
|
element: (n = await (s.isElement == null ? void 0 : s.isElement(m))) == null || n ? m : m.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
|
|
176
|
-
boundary:
|
|
176
|
+
boundary: c,
|
|
177
177
|
rootBoundary: d,
|
|
178
|
-
strategy:
|
|
179
|
-
})), w =
|
|
178
|
+
strategy: a
|
|
179
|
+
})), w = u === "floating" ? {
|
|
180
180
|
x: i,
|
|
181
181
|
y: o,
|
|
182
182
|
width: r.floating.width,
|
|
@@ -187,11 +187,11 @@ async function Qt(t, e) {
|
|
|
187
187
|
} : {
|
|
188
188
|
x: 1,
|
|
189
189
|
y: 1
|
|
190
|
-
}, E =
|
|
190
|
+
}, E = lt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
191
191
|
elements: l,
|
|
192
192
|
rect: w,
|
|
193
193
|
offsetParent: x,
|
|
194
|
-
strategy:
|
|
194
|
+
strategy: a
|
|
195
195
|
}) : w);
|
|
196
196
|
return {
|
|
197
197
|
top: (y.top - E.top + p.top) / v.y,
|
|
@@ -200,21 +200,21 @@ async function Qt(t, e) {
|
|
|
200
200
|
right: (E.right - y.right + p.right) / v.x
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
const
|
|
203
|
+
const ne = async (t, e, n) => {
|
|
204
204
|
const {
|
|
205
205
|
placement: i = "bottom",
|
|
206
206
|
strategy: o = "absolute",
|
|
207
207
|
middleware: s = [],
|
|
208
208
|
platform: r
|
|
209
|
-
} = n, l = s.filter(Boolean),
|
|
210
|
-
let
|
|
209
|
+
} = n, l = s.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(e));
|
|
210
|
+
let c = await r.getElementRects({
|
|
211
211
|
reference: t,
|
|
212
212
|
floating: e,
|
|
213
213
|
strategy: o
|
|
214
214
|
}), {
|
|
215
215
|
x: d,
|
|
216
|
-
y:
|
|
217
|
-
} =
|
|
216
|
+
y: u
|
|
217
|
+
} = Ct(c, i, a), h = i, f = {}, p = 0;
|
|
218
218
|
for (let m = 0; m < l.length; m++) {
|
|
219
219
|
var g;
|
|
220
220
|
const {
|
|
@@ -227,44 +227,44 @@ const Zt = async (t, e, n) => {
|
|
|
227
227
|
reset: A
|
|
228
228
|
} = await w({
|
|
229
229
|
x: d,
|
|
230
|
-
y:
|
|
230
|
+
y: u,
|
|
231
231
|
initialPlacement: i,
|
|
232
232
|
placement: h,
|
|
233
233
|
strategy: o,
|
|
234
|
-
middlewareData:
|
|
235
|
-
rects:
|
|
234
|
+
middlewareData: f,
|
|
235
|
+
rects: c,
|
|
236
236
|
platform: {
|
|
237
237
|
...r,
|
|
238
|
-
detectOverflow: (g = r.detectOverflow) != null ? g :
|
|
238
|
+
detectOverflow: (g = r.detectOverflow) != null ? g : ie
|
|
239
239
|
},
|
|
240
240
|
elements: {
|
|
241
241
|
reference: t,
|
|
242
242
|
floating: e
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
|
-
d = x ?? d,
|
|
246
|
-
...
|
|
245
|
+
d = x ?? d, u = v ?? u, f = {
|
|
246
|
+
...f,
|
|
247
247
|
[y]: {
|
|
248
|
-
...
|
|
248
|
+
...f[y],
|
|
249
249
|
...E
|
|
250
250
|
}
|
|
251
|
-
}, A && p <= 50 && (p++, typeof A == "object" && (A.placement && (h = A.placement), A.rects && (
|
|
251
|
+
}, A && p <= 50 && (p++, typeof A == "object" && (A.placement && (h = A.placement), A.rects && (c = A.rects === !0 ? await r.getElementRects({
|
|
252
252
|
reference: t,
|
|
253
253
|
floating: e,
|
|
254
254
|
strategy: o
|
|
255
255
|
}) : A.rects), {
|
|
256
256
|
x: d,
|
|
257
|
-
y:
|
|
258
|
-
} =
|
|
257
|
+
y: u
|
|
258
|
+
} = Ct(c, h, a)), m = -1);
|
|
259
259
|
}
|
|
260
260
|
return {
|
|
261
261
|
x: d,
|
|
262
|
-
y:
|
|
262
|
+
y: u,
|
|
263
263
|
placement: h,
|
|
264
264
|
strategy: o,
|
|
265
|
-
middlewareData:
|
|
265
|
+
middlewareData: f
|
|
266
266
|
};
|
|
267
|
-
},
|
|
267
|
+
}, oe = (t) => ({
|
|
268
268
|
name: "arrow",
|
|
269
269
|
options: t,
|
|
270
270
|
async fn(e) {
|
|
@@ -275,33 +275,33 @@ const Zt = async (t, e, n) => {
|
|
|
275
275
|
rects: s,
|
|
276
276
|
platform: r,
|
|
277
277
|
elements: l,
|
|
278
|
-
middlewareData:
|
|
278
|
+
middlewareData: a
|
|
279
279
|
} = e, {
|
|
280
|
-
element:
|
|
280
|
+
element: c,
|
|
281
281
|
padding: d = 0
|
|
282
|
-
} =
|
|
283
|
-
if (
|
|
282
|
+
} = tt(t, e) || {};
|
|
283
|
+
if (c == null)
|
|
284
284
|
return {};
|
|
285
|
-
const
|
|
285
|
+
const u = Lt(d), h = {
|
|
286
286
|
x: n,
|
|
287
287
|
y: i
|
|
288
|
-
},
|
|
288
|
+
}, f = xt(o), p = wt(f), g = await r.getDimensions(c), m = f === "y", y = m ? "top" : "left", w = m ? "bottom" : "right", x = m ? "clientHeight" : "clientWidth", v = s.reference[p] + s.reference[f] - h[f] - s.floating[p], E = h[f] - s.reference[f], A = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
|
|
289
289
|
let M = A ? A[x] : 0;
|
|
290
290
|
(!M || !await (r.isElement == null ? void 0 : r.isElement(A))) && (M = l.floating[x] || s.floating[p]);
|
|
291
|
-
const
|
|
291
|
+
const G = v / 2 - E / 2, N = M / 2 - g[p] / 2 - 1, P = Q(u[y], N), J = Q(u[w], N), V = P, U = M - g[p] - J, S = M / 2 - g[p] / 2 + G, W = gt(V, S, U), F = !a.arrow && et(o) != null && S !== W && s.reference[p] / 2 - (S < V ? P : J) - g[p] / 2 < 0, I = F ? S < V ? S - V : S - U : 0;
|
|
292
292
|
return {
|
|
293
|
-
[
|
|
293
|
+
[f]: h[f] + I,
|
|
294
294
|
data: {
|
|
295
|
-
[
|
|
296
|
-
centerOffset: S - W -
|
|
297
|
-
...
|
|
298
|
-
alignmentOffset:
|
|
295
|
+
[f]: W,
|
|
296
|
+
centerOffset: S - W - I,
|
|
297
|
+
...F && {
|
|
298
|
+
alignmentOffset: I
|
|
299
299
|
}
|
|
300
300
|
},
|
|
301
|
-
reset:
|
|
301
|
+
reset: F
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
|
-
}),
|
|
304
|
+
}), se = function(t) {
|
|
305
305
|
return t === void 0 && (t = {}), {
|
|
306
306
|
name: "flip",
|
|
307
307
|
options: t,
|
|
@@ -312,36 +312,36 @@ const Zt = async (t, e, n) => {
|
|
|
312
312
|
middlewareData: s,
|
|
313
313
|
rects: r,
|
|
314
314
|
initialPlacement: l,
|
|
315
|
-
platform:
|
|
316
|
-
elements:
|
|
315
|
+
platform: a,
|
|
316
|
+
elements: c
|
|
317
317
|
} = e, {
|
|
318
318
|
mainAxis: d = !0,
|
|
319
|
-
crossAxis:
|
|
319
|
+
crossAxis: u = !0,
|
|
320
320
|
fallbackPlacements: h,
|
|
321
|
-
fallbackStrategy:
|
|
321
|
+
fallbackStrategy: f = "bestFit",
|
|
322
322
|
fallbackAxisSideDirection: p = "none",
|
|
323
323
|
flipAlignment: g = !0,
|
|
324
324
|
...m
|
|
325
|
-
} =
|
|
325
|
+
} = tt(t, e);
|
|
326
326
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
327
327
|
return {};
|
|
328
|
-
const y =
|
|
329
|
-
!h && A && E.push(...
|
|
330
|
-
const M = [l, ...E],
|
|
328
|
+
const y = X(o), w = _(l), x = X(l) === l, v = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), E = h || (x || !g ? [rt(l)] : Jt(l)), A = p !== "none";
|
|
329
|
+
!h && A && E.push(...te(l, g, p, v));
|
|
330
|
+
const M = [l, ...E], G = await a.detectOverflow(e, m), N = [];
|
|
331
331
|
let P = ((i = s.flip) == null ? void 0 : i.overflows) || [];
|
|
332
|
-
if (d && N.push(
|
|
333
|
-
const S =
|
|
334
|
-
N.push(
|
|
332
|
+
if (d && N.push(G[y]), u) {
|
|
333
|
+
const S = Gt(o, r, v);
|
|
334
|
+
N.push(G[S[0]], G[S[1]]);
|
|
335
335
|
}
|
|
336
336
|
if (P = [...P, {
|
|
337
337
|
placement: o,
|
|
338
338
|
overflows: N
|
|
339
339
|
}], !N.every((S) => S <= 0)) {
|
|
340
|
-
var
|
|
341
|
-
const S = (((
|
|
342
|
-
if (W && (!(
|
|
340
|
+
var J, V;
|
|
341
|
+
const S = (((J = s.flip) == null ? void 0 : J.index) || 0) + 1, W = M[S];
|
|
342
|
+
if (W && (!(u === "alignment" ? w !== _(W) : !1) || // We leave the current main axis only if every placement on that axis
|
|
343
343
|
// overflows the main axis.
|
|
344
|
-
P.every((
|
|
344
|
+
P.every((k) => _(k.placement) === w ? k.overflows[0] > 0 : !0)))
|
|
345
345
|
return {
|
|
346
346
|
data: {
|
|
347
347
|
index: S,
|
|
@@ -351,66 +351,66 @@ const Zt = async (t, e, n) => {
|
|
|
351
351
|
placement: W
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
let
|
|
355
|
-
if (!
|
|
356
|
-
switch (
|
|
354
|
+
let F = (V = P.filter((I) => I.overflows[0] <= 0).sort((I, k) => I.overflows[1] - k.overflows[1])[0]) == null ? void 0 : V.placement;
|
|
355
|
+
if (!F)
|
|
356
|
+
switch (f) {
|
|
357
357
|
case "bestFit": {
|
|
358
|
-
var
|
|
359
|
-
const
|
|
358
|
+
var U;
|
|
359
|
+
const I = (U = P.filter((k) => {
|
|
360
360
|
if (A) {
|
|
361
|
-
const B = _(
|
|
361
|
+
const B = _(k.placement);
|
|
362
362
|
return B === w || // Create a bias to the `y` side axis due to horizontal
|
|
363
363
|
// reading directions favoring greater width.
|
|
364
364
|
B === "y";
|
|
365
365
|
}
|
|
366
366
|
return !0;
|
|
367
|
-
}).map((
|
|
368
|
-
|
|
367
|
+
}).map((k) => [k.placement, k.overflows.filter((B) => B > 0).reduce((B, Ht) => B + Ht, 0)]).sort((k, B) => k[1] - B[1])[0]) == null ? void 0 : U[0];
|
|
368
|
+
I && (F = I);
|
|
369
369
|
break;
|
|
370
370
|
}
|
|
371
371
|
case "initialPlacement":
|
|
372
|
-
|
|
372
|
+
F = l;
|
|
373
373
|
break;
|
|
374
374
|
}
|
|
375
|
-
if (o !==
|
|
375
|
+
if (o !== F)
|
|
376
376
|
return {
|
|
377
377
|
reset: {
|
|
378
|
-
placement:
|
|
378
|
+
placement: F
|
|
379
379
|
}
|
|
380
380
|
};
|
|
381
381
|
}
|
|
382
382
|
return {};
|
|
383
383
|
}
|
|
384
384
|
};
|
|
385
|
-
},
|
|
386
|
-
async function
|
|
385
|
+
}, re = /* @__PURE__ */ new Set(["left", "top"]);
|
|
386
|
+
async function le(t, e) {
|
|
387
387
|
const {
|
|
388
388
|
placement: n,
|
|
389
389
|
platform: i,
|
|
390
390
|
elements: o
|
|
391
|
-
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), r =
|
|
391
|
+
} = t, s = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), r = X(n), l = et(n), a = _(n) === "y", c = re.has(r) ? -1 : 1, d = s && a ? -1 : 1, u = tt(e, t);
|
|
392
392
|
let {
|
|
393
393
|
mainAxis: h,
|
|
394
|
-
crossAxis:
|
|
394
|
+
crossAxis: f,
|
|
395
395
|
alignmentAxis: p
|
|
396
|
-
} = typeof
|
|
397
|
-
mainAxis:
|
|
396
|
+
} = typeof u == "number" ? {
|
|
397
|
+
mainAxis: u,
|
|
398
398
|
crossAxis: 0,
|
|
399
399
|
alignmentAxis: null
|
|
400
400
|
} : {
|
|
401
|
-
mainAxis:
|
|
402
|
-
crossAxis:
|
|
403
|
-
alignmentAxis:
|
|
401
|
+
mainAxis: u.mainAxis || 0,
|
|
402
|
+
crossAxis: u.crossAxis || 0,
|
|
403
|
+
alignmentAxis: u.alignmentAxis
|
|
404
404
|
};
|
|
405
|
-
return l && typeof p == "number" && (
|
|
406
|
-
x:
|
|
407
|
-
y: h *
|
|
405
|
+
return l && typeof p == "number" && (f = l === "end" ? p * -1 : p), a ? {
|
|
406
|
+
x: f * d,
|
|
407
|
+
y: h * c
|
|
408
408
|
} : {
|
|
409
|
-
x: h *
|
|
410
|
-
y:
|
|
409
|
+
x: h * c,
|
|
410
|
+
y: f * d
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
|
-
const
|
|
413
|
+
const ce = function(t) {
|
|
414
414
|
return t === void 0 && (t = 0), {
|
|
415
415
|
name: "offset",
|
|
416
416
|
options: t,
|
|
@@ -421,18 +421,18 @@ const oe = function(t) {
|
|
|
421
421
|
y: s,
|
|
422
422
|
placement: r,
|
|
423
423
|
middlewareData: l
|
|
424
|
-
} = e,
|
|
424
|
+
} = e, a = await le(e, t);
|
|
425
425
|
return r === ((n = l.offset) == null ? void 0 : n.placement) && (i = l.arrow) != null && i.alignmentOffset ? {} : {
|
|
426
|
-
x: o +
|
|
427
|
-
y: s +
|
|
426
|
+
x: o + a.x,
|
|
427
|
+
y: s + a.y,
|
|
428
428
|
data: {
|
|
429
|
-
...
|
|
429
|
+
...a,
|
|
430
430
|
placement: r
|
|
431
431
|
}
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
|
-
},
|
|
435
|
+
}, ae = function(t) {
|
|
436
436
|
return t === void 0 && (t = {}), {
|
|
437
437
|
name: "shift",
|
|
438
438
|
options: t,
|
|
@@ -445,7 +445,7 @@ const oe = function(t) {
|
|
|
445
445
|
} = e, {
|
|
446
446
|
mainAxis: r = !0,
|
|
447
447
|
crossAxis: l = !1,
|
|
448
|
-
limiter:
|
|
448
|
+
limiter: a = {
|
|
449
449
|
fn: (y) => {
|
|
450
450
|
let {
|
|
451
451
|
x: w,
|
|
@@ -457,23 +457,23 @@ const oe = function(t) {
|
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
},
|
|
460
|
-
...
|
|
461
|
-
} =
|
|
460
|
+
...c
|
|
461
|
+
} = tt(t, e), d = {
|
|
462
462
|
x: n,
|
|
463
463
|
y: i
|
|
464
|
-
},
|
|
465
|
-
let p = d[
|
|
464
|
+
}, u = await s.detectOverflow(e, c), h = _(X(o)), f = $t(h);
|
|
465
|
+
let p = d[f], g = d[h];
|
|
466
466
|
if (r) {
|
|
467
|
-
const y =
|
|
468
|
-
p =
|
|
467
|
+
const y = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", x = p + u[y], v = p - u[w];
|
|
468
|
+
p = gt(x, p, v);
|
|
469
469
|
}
|
|
470
470
|
if (l) {
|
|
471
|
-
const y = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", x = g +
|
|
472
|
-
g =
|
|
471
|
+
const y = h === "y" ? "top" : "left", w = h === "y" ? "bottom" : "right", x = g + u[y], v = g - u[w];
|
|
472
|
+
g = gt(x, g, v);
|
|
473
473
|
}
|
|
474
|
-
const m =
|
|
474
|
+
const m = a.fn({
|
|
475
475
|
...e,
|
|
476
|
-
[
|
|
476
|
+
[f]: p,
|
|
477
477
|
[h]: g
|
|
478
478
|
});
|
|
479
479
|
return {
|
|
@@ -482,7 +482,7 @@ const oe = function(t) {
|
|
|
482
482
|
x: m.x - n,
|
|
483
483
|
y: m.y - i,
|
|
484
484
|
enabled: {
|
|
485
|
-
[
|
|
485
|
+
[f]: r,
|
|
486
486
|
[h]: l
|
|
487
487
|
}
|
|
488
488
|
}
|
|
@@ -490,49 +490,49 @@ const oe = function(t) {
|
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
492
|
};
|
|
493
|
-
function
|
|
493
|
+
function ct() {
|
|
494
494
|
return typeof window < "u";
|
|
495
495
|
}
|
|
496
|
-
function
|
|
497
|
-
return
|
|
496
|
+
function K(t) {
|
|
497
|
+
return Rt(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function T(t) {
|
|
500
500
|
var e;
|
|
501
501
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function D(t) {
|
|
504
504
|
var e;
|
|
505
|
-
return (e = (
|
|
505
|
+
return (e = (Rt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
507
|
+
function Rt(t) {
|
|
508
|
+
return ct() ? t instanceof Node || t instanceof T(t).Node : !1;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
return
|
|
510
|
+
function O(t) {
|
|
511
|
+
return ct() ? t instanceof Element || t instanceof T(t).Element : !1;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
return
|
|
513
|
+
function R(t) {
|
|
514
|
+
return ct() ? t instanceof HTMLElement || t instanceof T(t).HTMLElement : !1;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
517
|
-
return !
|
|
516
|
+
function Et(t) {
|
|
517
|
+
return !ct() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof T(t).ShadowRoot;
|
|
518
518
|
}
|
|
519
|
-
const
|
|
520
|
-
function
|
|
519
|
+
const ue = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
520
|
+
function it(t) {
|
|
521
521
|
const {
|
|
522
522
|
overflow: e,
|
|
523
523
|
overflowX: n,
|
|
524
524
|
overflowY: i,
|
|
525
525
|
display: o
|
|
526
526
|
} = $(t);
|
|
527
|
-
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !
|
|
527
|
+
return /auto|scroll|overlay|hidden|clip/.test(e + i + n) && !ue.has(o);
|
|
528
528
|
}
|
|
529
|
-
const
|
|
530
|
-
function
|
|
531
|
-
return
|
|
529
|
+
const fe = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
530
|
+
function de(t) {
|
|
531
|
+
return fe.has(K(t));
|
|
532
532
|
}
|
|
533
|
-
const
|
|
534
|
-
function
|
|
535
|
-
return
|
|
533
|
+
const he = [":popover-open", ":modal"];
|
|
534
|
+
function at(t) {
|
|
535
|
+
return he.some((e) => {
|
|
536
536
|
try {
|
|
537
537
|
return t.matches(e);
|
|
538
538
|
} catch {
|
|
@@ -540,34 +540,34 @@ function lt(t) {
|
|
|
540
540
|
}
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
const
|
|
544
|
-
function
|
|
545
|
-
const e =
|
|
546
|
-
return
|
|
543
|
+
const pe = ["transform", "translate", "scale", "rotate", "perspective"], ge = ["transform", "translate", "scale", "rotate", "perspective", "filter"], me = ["paint", "layout", "strict", "content"];
|
|
544
|
+
function bt(t) {
|
|
545
|
+
const e = vt(), n = O(t) ? $(t) : t;
|
|
546
|
+
return pe.some((i) => n[i] ? n[i] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ge.some((i) => (n.willChange || "").includes(i)) || me.some((i) => (n.contain || "").includes(i));
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function ye(t) {
|
|
549
549
|
let e = q(t);
|
|
550
|
-
for (;
|
|
551
|
-
if (
|
|
550
|
+
for (; R(e) && !Y(e); ) {
|
|
551
|
+
if (bt(e))
|
|
552
552
|
return e;
|
|
553
|
-
if (
|
|
553
|
+
if (at(e))
|
|
554
554
|
return null;
|
|
555
555
|
e = q(e);
|
|
556
556
|
}
|
|
557
557
|
return null;
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function vt() {
|
|
560
560
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
561
561
|
}
|
|
562
|
-
const
|
|
563
|
-
function
|
|
564
|
-
return
|
|
562
|
+
const we = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
563
|
+
function Y(t) {
|
|
564
|
+
return we.has(K(t));
|
|
565
565
|
}
|
|
566
566
|
function $(t) {
|
|
567
|
-
return
|
|
567
|
+
return T(t).getComputedStyle(t);
|
|
568
568
|
}
|
|
569
|
-
function
|
|
570
|
-
return
|
|
569
|
+
function ut(t) {
|
|
570
|
+
return O(t) ? {
|
|
571
571
|
scrollLeft: t.scrollLeft,
|
|
572
572
|
scrollTop: t.scrollTop
|
|
573
573
|
} : {
|
|
@@ -576,135 +576,135 @@ function ct(t) {
|
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
578
|
function q(t) {
|
|
579
|
-
if (
|
|
579
|
+
if (K(t) === "html")
|
|
580
580
|
return t;
|
|
581
581
|
const e = (
|
|
582
582
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
583
583
|
t.assignedSlot || // DOM Element detected.
|
|
584
584
|
t.parentNode || // ShadowRoot detected.
|
|
585
|
-
|
|
586
|
-
|
|
585
|
+
Et(t) && t.host || // Fallback.
|
|
586
|
+
D(t)
|
|
587
587
|
);
|
|
588
|
-
return
|
|
588
|
+
return Et(e) ? e.host : e;
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function Pt(t) {
|
|
591
591
|
const e = q(t);
|
|
592
|
-
return
|
|
592
|
+
return Y(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : R(e) && it(e) ? e : Pt(e);
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function Ft(t, e, n) {
|
|
595
595
|
var i;
|
|
596
596
|
e === void 0 && (e = []);
|
|
597
|
-
const o =
|
|
598
|
-
return s ? (
|
|
597
|
+
const o = Pt(t), s = o === ((i = t.ownerDocument) == null ? void 0 : i.body), r = T(o);
|
|
598
|
+
return s ? (yt(r), e.concat(r, r.visualViewport || [], it(o) ? o : [], [])) : e.concat(o, Ft(o, []));
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function yt(t) {
|
|
601
601
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function Dt(t) {
|
|
604
604
|
const e = $(t);
|
|
605
605
|
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
606
|
-
const o =
|
|
606
|
+
const o = R(t), s = o ? t.offsetWidth : n, r = o ? t.offsetHeight : i, l = st(n) !== s || st(i) !== r;
|
|
607
607
|
return l && (n = s, i = r), {
|
|
608
608
|
width: n,
|
|
609
609
|
height: i,
|
|
610
610
|
$: l
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
return
|
|
613
|
+
function Bt(t) {
|
|
614
|
+
return O(t) ? t : t.contextElement;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
const e =
|
|
618
|
-
if (!
|
|
619
|
-
return
|
|
616
|
+
function j(t) {
|
|
617
|
+
const e = Bt(t);
|
|
618
|
+
if (!R(e))
|
|
619
|
+
return L(1);
|
|
620
620
|
const n = e.getBoundingClientRect(), {
|
|
621
621
|
width: i,
|
|
622
622
|
height: o,
|
|
623
623
|
$: s
|
|
624
|
-
} =
|
|
625
|
-
let r = (s ?
|
|
624
|
+
} = Dt(e);
|
|
625
|
+
let r = (s ? st(n.width) : n.width) / i, l = (s ? st(n.height) : n.height) / o;
|
|
626
626
|
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
627
627
|
x: r,
|
|
628
628
|
y: l
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
|
-
const
|
|
632
|
-
function
|
|
633
|
-
const e =
|
|
634
|
-
return !
|
|
631
|
+
const xe = /* @__PURE__ */ L(0);
|
|
632
|
+
function _t(t) {
|
|
633
|
+
const e = T(t);
|
|
634
|
+
return !vt() || !e.visualViewport ? xe : {
|
|
635
635
|
x: e.visualViewport.offsetLeft,
|
|
636
636
|
y: e.visualViewport.offsetTop
|
|
637
637
|
};
|
|
638
638
|
}
|
|
639
|
-
function
|
|
640
|
-
return e === void 0 && (e = !1), !n || e && n !==
|
|
639
|
+
function be(t, e, n) {
|
|
640
|
+
return e === void 0 && (e = !1), !n || e && n !== T(t) ? !1 : e;
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function Z(t, e, n, i) {
|
|
643
643
|
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
644
|
-
const o = t.getBoundingClientRect(), s =
|
|
645
|
-
let r =
|
|
646
|
-
e && (i ?
|
|
647
|
-
const l =
|
|
648
|
-
let
|
|
644
|
+
const o = t.getBoundingClientRect(), s = Bt(t);
|
|
645
|
+
let r = L(1);
|
|
646
|
+
e && (i ? O(i) && (r = j(i)) : r = j(t));
|
|
647
|
+
const l = be(s, n, i) ? _t(s) : L(0);
|
|
648
|
+
let a = (o.left + l.x) / r.x, c = (o.top + l.y) / r.y, d = o.width / r.x, u = o.height / r.y;
|
|
649
649
|
if (s) {
|
|
650
|
-
const h =
|
|
651
|
-
let p = h, g =
|
|
652
|
-
for (; g && i &&
|
|
653
|
-
const m =
|
|
654
|
-
|
|
650
|
+
const h = T(s), f = i && O(i) ? T(i) : i;
|
|
651
|
+
let p = h, g = yt(p);
|
|
652
|
+
for (; g && i && f !== p; ) {
|
|
653
|
+
const m = j(g), y = g.getBoundingClientRect(), w = $(g), x = y.left + (g.clientLeft + parseFloat(w.paddingLeft)) * m.x, v = y.top + (g.clientTop + parseFloat(w.paddingTop)) * m.y;
|
|
654
|
+
a *= m.x, c *= m.y, d *= m.x, u *= m.y, a += x, c += v, p = T(g), g = yt(p);
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
|
-
return
|
|
657
|
+
return lt({
|
|
658
658
|
width: d,
|
|
659
|
-
height:
|
|
660
|
-
x:
|
|
661
|
-
y:
|
|
659
|
+
height: u,
|
|
660
|
+
x: a,
|
|
661
|
+
y: c
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
|
-
function
|
|
665
|
-
const n =
|
|
666
|
-
return e ? e.left + n :
|
|
664
|
+
function ft(t, e) {
|
|
665
|
+
const n = ut(t).scrollLeft;
|
|
666
|
+
return e ? e.left + n : Z(D(t)).left + n;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft -
|
|
668
|
+
function qt(t, e) {
|
|
669
|
+
const n = t.getBoundingClientRect(), i = n.left + e.scrollLeft - ft(t, n), o = n.top + e.scrollTop;
|
|
670
670
|
return {
|
|
671
671
|
x: i,
|
|
672
672
|
y: o
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function ve(t) {
|
|
676
676
|
let {
|
|
677
677
|
elements: e,
|
|
678
678
|
rect: n,
|
|
679
679
|
offsetParent: i,
|
|
680
680
|
strategy: o
|
|
681
681
|
} = t;
|
|
682
|
-
const s = o === "fixed", r =
|
|
682
|
+
const s = o === "fixed", r = D(i), l = e ? at(e.floating) : !1;
|
|
683
683
|
if (i === r || l && s)
|
|
684
684
|
return n;
|
|
685
|
-
let
|
|
685
|
+
let a = {
|
|
686
686
|
scrollLeft: 0,
|
|
687
687
|
scrollTop: 0
|
|
688
|
-
},
|
|
689
|
-
const d =
|
|
690
|
-
if ((
|
|
691
|
-
const
|
|
692
|
-
|
|
688
|
+
}, c = L(1);
|
|
689
|
+
const d = L(0), u = R(i);
|
|
690
|
+
if ((u || !u && !s) && ((K(i) !== "body" || it(r)) && (a = ut(i)), R(i))) {
|
|
691
|
+
const f = Z(i);
|
|
692
|
+
c = j(i), d.x = f.x + i.clientLeft, d.y = f.y + i.clientTop;
|
|
693
693
|
}
|
|
694
|
-
const h = r && !
|
|
694
|
+
const h = r && !u && !s ? qt(r, a) : L(0);
|
|
695
695
|
return {
|
|
696
|
-
width: n.width *
|
|
697
|
-
height: n.height *
|
|
698
|
-
x: n.x *
|
|
699
|
-
y: n.y *
|
|
696
|
+
width: n.width * c.x,
|
|
697
|
+
height: n.height * c.y,
|
|
698
|
+
x: n.x * c.x - a.scrollLeft * c.x + d.x + h.x,
|
|
699
|
+
y: n.y * c.y - a.scrollTop * c.y + d.y + h.y
|
|
700
700
|
};
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function Se(t) {
|
|
703
703
|
return Array.from(t.getClientRects());
|
|
704
704
|
}
|
|
705
|
-
function
|
|
706
|
-
const e =
|
|
707
|
-
let r = -n.scrollLeft +
|
|
705
|
+
function Ae(t) {
|
|
706
|
+
const e = D(t), n = ut(t), i = t.ownerDocument.body, o = z(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = z(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
707
|
+
let r = -n.scrollLeft + ft(t);
|
|
708
708
|
const l = -n.scrollTop;
|
|
709
709
|
return $(i).direction === "rtl" && (r += z(e.clientWidth, i.clientWidth) - o), {
|
|
710
710
|
width: o,
|
|
@@ -713,47 +713,47 @@ function xe(t) {
|
|
|
713
713
|
y: l
|
|
714
714
|
};
|
|
715
715
|
}
|
|
716
|
-
const
|
|
717
|
-
function
|
|
718
|
-
const n =
|
|
719
|
-
let s = i.clientWidth, r = i.clientHeight, l = 0,
|
|
716
|
+
const It = 25;
|
|
717
|
+
function Te(t, e) {
|
|
718
|
+
const n = T(t), i = D(t), o = n.visualViewport;
|
|
719
|
+
let s = i.clientWidth, r = i.clientHeight, l = 0, a = 0;
|
|
720
720
|
if (o) {
|
|
721
721
|
s = o.width, r = o.height;
|
|
722
|
-
const d =
|
|
723
|
-
(!d || d && e === "fixed") && (l = o.offsetLeft,
|
|
722
|
+
const d = vt();
|
|
723
|
+
(!d || d && e === "fixed") && (l = o.offsetLeft, a = o.offsetTop);
|
|
724
724
|
}
|
|
725
|
-
const
|
|
726
|
-
if (
|
|
727
|
-
const d = i.ownerDocument,
|
|
728
|
-
p <=
|
|
729
|
-
} else
|
|
725
|
+
const c = ft(i);
|
|
726
|
+
if (c <= 0) {
|
|
727
|
+
const d = i.ownerDocument, u = d.body, h = getComputedStyle(u), f = d.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, p = Math.abs(i.clientWidth - u.clientWidth - f);
|
|
728
|
+
p <= It && (s -= p);
|
|
729
|
+
} else c <= It && (s += c);
|
|
730
730
|
return {
|
|
731
731
|
width: s,
|
|
732
732
|
height: r,
|
|
733
733
|
x: l,
|
|
734
|
-
y:
|
|
734
|
+
y: a
|
|
735
735
|
};
|
|
736
736
|
}
|
|
737
|
-
const
|
|
738
|
-
function
|
|
739
|
-
const n =
|
|
737
|
+
const Ce = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
738
|
+
function Ee(t, e) {
|
|
739
|
+
const n = Z(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, s = R(t) ? j(t) : L(1), r = t.clientWidth * s.x, l = t.clientHeight * s.y, a = o * s.x, c = i * s.y;
|
|
740
740
|
return {
|
|
741
741
|
width: r,
|
|
742
742
|
height: l,
|
|
743
|
-
x:
|
|
744
|
-
y:
|
|
743
|
+
x: a,
|
|
744
|
+
y: c
|
|
745
745
|
};
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function kt(t, e, n) {
|
|
748
748
|
let i;
|
|
749
749
|
if (e === "viewport")
|
|
750
|
-
i =
|
|
750
|
+
i = Te(t, n);
|
|
751
751
|
else if (e === "document")
|
|
752
|
-
i =
|
|
753
|
-
else if (
|
|
754
|
-
i =
|
|
752
|
+
i = Ae(D(t));
|
|
753
|
+
else if (O(e))
|
|
754
|
+
i = Ee(e, n);
|
|
755
755
|
else {
|
|
756
|
-
const o =
|
|
756
|
+
const o = _t(t);
|
|
757
757
|
i = {
|
|
758
758
|
x: e.x - o.x,
|
|
759
759
|
y: e.y - o.y,
|
|
@@ -761,110 +761,110 @@ function Ct(t, e, n) {
|
|
|
761
761
|
height: e.height
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
|
-
return
|
|
764
|
+
return lt(i);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
766
|
+
function Mt(t, e) {
|
|
767
767
|
const n = q(t);
|
|
768
|
-
return n === e || !
|
|
768
|
+
return n === e || !O(n) || Y(n) ? !1 : $(n).position === "fixed" || Mt(n, e);
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function Ie(t, e) {
|
|
771
771
|
const n = e.get(t);
|
|
772
772
|
if (n)
|
|
773
773
|
return n;
|
|
774
|
-
let i =
|
|
774
|
+
let i = Ft(t, []).filter((l) => O(l) && K(l) !== "body"), o = null;
|
|
775
775
|
const s = $(t).position === "fixed";
|
|
776
776
|
let r = s ? q(t) : t;
|
|
777
|
-
for (;
|
|
778
|
-
const l = $(r),
|
|
779
|
-
!
|
|
777
|
+
for (; O(r) && !Y(r); ) {
|
|
778
|
+
const l = $(r), a = bt(r);
|
|
779
|
+
!a && l.position === "fixed" && (o = null), (s ? !a && !o : !a && l.position === "static" && !!o && Ce.has(o.position) || it(r) && !a && Mt(t, r)) ? i = i.filter((d) => d !== r) : o = l, r = q(r);
|
|
780
780
|
}
|
|
781
781
|
return e.set(t, i), i;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function ke(t) {
|
|
784
784
|
let {
|
|
785
785
|
element: e,
|
|
786
786
|
boundary: n,
|
|
787
787
|
rootBoundary: i,
|
|
788
788
|
strategy: o
|
|
789
789
|
} = t;
|
|
790
|
-
const r = [...n === "clippingAncestors" ?
|
|
791
|
-
const
|
|
792
|
-
return
|
|
793
|
-
},
|
|
790
|
+
const r = [...n === "clippingAncestors" ? at(e) ? [] : Ie(e, this._c) : [].concat(n), i], l = r[0], a = r.reduce((c, d) => {
|
|
791
|
+
const u = kt(e, d, o);
|
|
792
|
+
return c.top = z(u.top, c.top), c.right = Q(u.right, c.right), c.bottom = Q(u.bottom, c.bottom), c.left = z(u.left, c.left), c;
|
|
793
|
+
}, kt(e, l, o));
|
|
794
794
|
return {
|
|
795
|
-
width:
|
|
796
|
-
height:
|
|
797
|
-
x:
|
|
798
|
-
y:
|
|
795
|
+
width: a.right - a.left,
|
|
796
|
+
height: a.bottom - a.top,
|
|
797
|
+
x: a.left,
|
|
798
|
+
y: a.top
|
|
799
799
|
};
|
|
800
800
|
}
|
|
801
|
-
function
|
|
801
|
+
function Oe(t) {
|
|
802
802
|
const {
|
|
803
803
|
width: e,
|
|
804
804
|
height: n
|
|
805
|
-
} =
|
|
805
|
+
} = Dt(t);
|
|
806
806
|
return {
|
|
807
807
|
width: e,
|
|
808
808
|
height: n
|
|
809
809
|
};
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
const i =
|
|
811
|
+
function $e(t, e, n) {
|
|
812
|
+
const i = R(e), o = D(e), s = n === "fixed", r = Z(t, !0, s, e);
|
|
813
813
|
let l = {
|
|
814
814
|
scrollLeft: 0,
|
|
815
815
|
scrollTop: 0
|
|
816
816
|
};
|
|
817
|
-
const
|
|
818
|
-
function
|
|
819
|
-
|
|
817
|
+
const a = L(0);
|
|
818
|
+
function c() {
|
|
819
|
+
a.x = ft(o);
|
|
820
820
|
}
|
|
821
821
|
if (i || !i && !s)
|
|
822
|
-
if ((
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
} else o &&
|
|
826
|
-
s && !i && o &&
|
|
827
|
-
const d = o && !i && !s ?
|
|
822
|
+
if ((K(e) !== "body" || it(o)) && (l = ut(e)), i) {
|
|
823
|
+
const f = Z(e, !0, s, e);
|
|
824
|
+
a.x = f.x + e.clientLeft, a.y = f.y + e.clientTop;
|
|
825
|
+
} else o && c();
|
|
826
|
+
s && !i && o && c();
|
|
827
|
+
const d = o && !i && !s ? qt(o, l) : L(0), u = r.left + l.scrollLeft - a.x - d.x, h = r.top + l.scrollTop - a.y - d.y;
|
|
828
828
|
return {
|
|
829
|
-
x:
|
|
829
|
+
x: u,
|
|
830
830
|
y: h,
|
|
831
831
|
width: r.width,
|
|
832
832
|
height: r.height
|
|
833
833
|
};
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function dt(t) {
|
|
836
836
|
return $(t).position === "static";
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
if (!
|
|
838
|
+
function Ot(t, e) {
|
|
839
|
+
if (!R(t) || $(t).position === "fixed")
|
|
840
840
|
return null;
|
|
841
841
|
if (e)
|
|
842
842
|
return e(t);
|
|
843
843
|
let n = t.offsetParent;
|
|
844
|
-
return
|
|
844
|
+
return D(t) === n && (n = n.ownerDocument.body), n;
|
|
845
845
|
}
|
|
846
|
-
function
|
|
847
|
-
const n =
|
|
848
|
-
if (
|
|
846
|
+
function Nt(t, e) {
|
|
847
|
+
const n = T(t);
|
|
848
|
+
if (at(t))
|
|
849
849
|
return n;
|
|
850
|
-
if (!
|
|
850
|
+
if (!R(t)) {
|
|
851
851
|
let o = q(t);
|
|
852
|
-
for (; o && !
|
|
853
|
-
if (
|
|
852
|
+
for (; o && !Y(o); ) {
|
|
853
|
+
if (O(o) && !dt(o))
|
|
854
854
|
return o;
|
|
855
855
|
o = q(o);
|
|
856
856
|
}
|
|
857
857
|
return n;
|
|
858
858
|
}
|
|
859
|
-
let i =
|
|
860
|
-
for (; i &&
|
|
861
|
-
i =
|
|
862
|
-
return i &&
|
|
859
|
+
let i = Ot(t, e);
|
|
860
|
+
for (; i && de(i) && dt(i); )
|
|
861
|
+
i = Ot(i, e);
|
|
862
|
+
return i && Y(i) && dt(i) && !bt(i) ? n : i || ye(t) || n;
|
|
863
863
|
}
|
|
864
|
-
const
|
|
865
|
-
const e = this.getOffsetParent ||
|
|
864
|
+
const Le = async function(t) {
|
|
865
|
+
const e = this.getOffsetParent || Nt, n = this.getDimensions, i = await n(t.floating);
|
|
866
866
|
return {
|
|
867
|
-
reference:
|
|
867
|
+
reference: $e(t.reference, await e(t.floating), t.strategy),
|
|
868
868
|
floating: {
|
|
869
869
|
x: 0,
|
|
870
870
|
y: 0,
|
|
@@ -873,72 +873,72 @@ const Oe = async function(t) {
|
|
|
873
873
|
}
|
|
874
874
|
};
|
|
875
875
|
};
|
|
876
|
-
function
|
|
876
|
+
function Re(t) {
|
|
877
877
|
return $(t).direction === "rtl";
|
|
878
878
|
}
|
|
879
|
-
const
|
|
880
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
881
|
-
getDocumentElement:
|
|
882
|
-
getClippingRect:
|
|
883
|
-
getOffsetParent:
|
|
884
|
-
getElementRects:
|
|
885
|
-
getClientRects:
|
|
886
|
-
getDimensions:
|
|
887
|
-
getScale:
|
|
888
|
-
isElement:
|
|
889
|
-
isRTL:
|
|
890
|
-
},
|
|
879
|
+
const Pe = {
|
|
880
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ve,
|
|
881
|
+
getDocumentElement: D,
|
|
882
|
+
getClippingRect: ke,
|
|
883
|
+
getOffsetParent: Nt,
|
|
884
|
+
getElementRects: Le,
|
|
885
|
+
getClientRects: Se,
|
|
886
|
+
getDimensions: Oe,
|
|
887
|
+
getScale: j,
|
|
888
|
+
isElement: O,
|
|
889
|
+
isRTL: Re
|
|
890
|
+
}, Fe = ce, De = ae, Be = se, _e = oe, qe = (t, e, n) => {
|
|
891
891
|
const i = /* @__PURE__ */ new Map(), o = {
|
|
892
|
-
platform:
|
|
892
|
+
platform: Pe,
|
|
893
893
|
...n
|
|
894
894
|
}, s = {
|
|
895
895
|
...o.platform,
|
|
896
896
|
_c: i
|
|
897
897
|
};
|
|
898
|
-
return
|
|
898
|
+
return ne(t, e, {
|
|
899
899
|
...o,
|
|
900
900
|
platform: s
|
|
901
901
|
});
|
|
902
902
|
};
|
|
903
|
-
function
|
|
903
|
+
function Vt(t) {
|
|
904
904
|
try {
|
|
905
905
|
return document.querySelector(t);
|
|
906
906
|
} catch {
|
|
907
907
|
return console.warn(`[Trailguide] Invalid selector: ${t}`), null;
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
|
-
function
|
|
910
|
+
function Wt(t) {
|
|
911
911
|
const e = t.getBoundingClientRect(), n = window.getComputedStyle(t);
|
|
912
912
|
return e.width > 0 && e.height > 0 && n.visibility !== "hidden" && n.display !== "none" && n.opacity !== "0";
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function Me(t) {
|
|
915
915
|
t.scrollIntoView({
|
|
916
|
-
behavior: "
|
|
916
|
+
behavior: "instant",
|
|
917
917
|
block: "center",
|
|
918
|
-
inline: "
|
|
918
|
+
inline: "nearest"
|
|
919
919
|
});
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function Ne(t) {
|
|
922
922
|
const e = document.createElement("div");
|
|
923
923
|
return e.textContent = t, e.innerHTML;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
925
|
+
function nt(t, e, n) {
|
|
926
926
|
const i = document.createElement(t);
|
|
927
927
|
return e && (i.className = e), n && n.appendChild(i), i;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function Ve() {
|
|
930
930
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
931
931
|
}
|
|
932
|
-
let
|
|
933
|
-
function
|
|
934
|
-
return
|
|
932
|
+
let ht = null;
|
|
933
|
+
function We() {
|
|
934
|
+
return ht || (ht = Ve()), ht;
|
|
935
935
|
}
|
|
936
|
-
async function
|
|
936
|
+
async function He(t, e) {
|
|
937
937
|
if (!t.endpoint) return;
|
|
938
938
|
const n = {
|
|
939
939
|
...e,
|
|
940
940
|
user_id: t.userId,
|
|
941
|
-
session_id:
|
|
941
|
+
session_id: We(),
|
|
942
942
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
943
943
|
};
|
|
944
944
|
try {
|
|
@@ -952,27 +952,30 @@ async function Me(t, e) {
|
|
|
952
952
|
t.debug && console.error("[Trailguide Analytics] Failed:", i);
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
|
-
class
|
|
955
|
+
class Xe {
|
|
956
956
|
constructor(e = {}) {
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
957
|
+
C(this, "trail", null);
|
|
958
|
+
C(this, "currentStepIndex", 0);
|
|
959
|
+
C(this, "isActive", !1);
|
|
960
|
+
C(this, "options", {});
|
|
961
961
|
// DOM elements
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
962
|
+
C(this, "overlay", null);
|
|
963
|
+
C(this, "tooltip", null);
|
|
964
|
+
C(this, "arrowEl", null);
|
|
965
965
|
// Cleanup functions
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
966
|
+
C(this, "cleanupFns", []);
|
|
967
|
+
C(this, "stepCleanupFns", []);
|
|
968
|
+
C(this, "instanceId", `trailguide-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`);
|
|
969
|
+
// Bug fix: cancel pending step transition timers to prevent stale callbacks
|
|
970
|
+
C(this, "stepTimerId", null);
|
|
969
971
|
this.options = e;
|
|
970
972
|
}
|
|
971
973
|
start(e) {
|
|
972
974
|
this.trail = e, this.currentStepIndex = 0, this.isActive = !0, this.createOverlay(), this.showStep(), this.bindKeyboard(), this.emitAnalytics("trail_started");
|
|
973
975
|
}
|
|
974
976
|
stop() {
|
|
975
|
-
|
|
977
|
+
var e, n;
|
|
978
|
+
this.isActive ? (this.emitAnalytics("trail_abandoned"), this.isActive = !1, this.cleanup(), (n = (e = this.options).onAbandoned) == null || n.call(e)) : this.cleanup();
|
|
976
979
|
}
|
|
977
980
|
next() {
|
|
978
981
|
!this.trail || !this.isActive || (this.emitAnalytics("step_completed"), this.currentStepIndex < this.trail.steps.length - 1 ? (this.currentStepIndex++, this.showStep()) : this.complete());
|
|
@@ -993,8 +996,8 @@ class Ne {
|
|
|
993
996
|
}
|
|
994
997
|
createOverlay() {
|
|
995
998
|
var i, o, s;
|
|
996
|
-
this.overlay =
|
|
997
|
-
const e =
|
|
999
|
+
this.overlay = nt("div", "trailguide-overlay"), document.body.appendChild(this.overlay);
|
|
1000
|
+
const e = nt("div", "trailguide-spotlight", this.overlay), n = `${this.instanceId}-mask`;
|
|
998
1001
|
e.innerHTML = `
|
|
999
1002
|
<svg width="100%" height="100%">
|
|
1000
1003
|
<defs>
|
|
@@ -1005,7 +1008,7 @@ class Ne {
|
|
|
1005
1008
|
</defs>
|
|
1006
1009
|
<rect x="0" y="0" width="100%" height="100%" mask="url(#${n})" />
|
|
1007
1010
|
</svg>
|
|
1008
|
-
`,
|
|
1011
|
+
`, nt("div", "trailguide-highlight", this.overlay), this.tooltip = nt("div", "trailguide-tooltip"), this.tooltip.innerHTML = `
|
|
1009
1012
|
<div class="trailguide-tooltip-content">
|
|
1010
1013
|
<div class="trailguide-tooltip-header">
|
|
1011
1014
|
<h3 class="trailguide-tooltip-title"></h3>
|
|
@@ -1024,33 +1027,39 @@ class Ne {
|
|
|
1024
1027
|
`, document.body.appendChild(this.tooltip), this.arrowEl = this.tooltip.querySelector(".trailguide-tooltip-arrow"), (i = this.tooltip.querySelector(".trailguide-tooltip-close")) == null || i.addEventListener("click", () => this.skip()), (o = this.tooltip.querySelector(".trailguide-btn-prev")) == null || o.addEventListener("click", () => this.prev()), (s = this.tooltip.querySelector(".trailguide-btn-next")) == null || s.addEventListener("click", () => this.next());
|
|
1025
1028
|
}
|
|
1026
1029
|
showStep() {
|
|
1030
|
+
var l, a;
|
|
1027
1031
|
if (!this.trail || !this.overlay || !this.tooltip) return;
|
|
1028
|
-
this.stepCleanupFns.forEach((
|
|
1032
|
+
this.stepTimerId !== null && (clearTimeout(this.stepTimerId), this.stepTimerId = null), this.stepCleanupFns.forEach((c) => c()), this.stepCleanupFns = [], this.tooltip.style.transform = "";
|
|
1029
1033
|
const e = this.overlay.querySelector(".trailguide-spotlight"), n = this.overlay.querySelector(".trailguide-highlight");
|
|
1030
1034
|
e && (e.style.display = ""), n && (n.style.display = "");
|
|
1031
1035
|
const i = this.trail.steps[this.currentStepIndex];
|
|
1032
1036
|
if (!i) return;
|
|
1033
1037
|
this.emitAnalytics("step_viewed");
|
|
1034
|
-
const o =
|
|
1035
|
-
if (
|
|
1036
|
-
|
|
1038
|
+
const o = Vt(i.target), s = !o, r = o ? !Wt(o) : !1;
|
|
1039
|
+
if (s || r) {
|
|
1040
|
+
if (i.optional) {
|
|
1041
|
+
this.currentStepIndex < this.trail.steps.length - 1 ? (this.currentStepIndex++, this.showStep()) : this.complete();
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
const c = s ? "element_not_found" : "element_not_visible";
|
|
1045
|
+
(a = (l = this.options).onError) == null || a.call(l, i, c), console.warn(`[Trailguide] Target not found or not visible: ${i.target}`), this.showErrorState(i);
|
|
1037
1046
|
return;
|
|
1038
1047
|
}
|
|
1039
|
-
|
|
1040
|
-
var
|
|
1041
|
-
this.updateSpotlight(o), this.updateTooltip(i, o), (
|
|
1048
|
+
Me(o), this.stepTimerId = setTimeout(() => {
|
|
1049
|
+
var c, d;
|
|
1050
|
+
this.stepTimerId = null, this.isActive && (this.updateSpotlight(o), this.updateTooltip(i, o), (d = (c = this.options).onStepChange) == null || d.call(c, i, this.currentStepIndex));
|
|
1042
1051
|
}, 100);
|
|
1043
1052
|
}
|
|
1044
1053
|
showErrorState(e) {
|
|
1045
|
-
var
|
|
1054
|
+
var u, h;
|
|
1046
1055
|
if (!this.tooltip || !this.trail) return;
|
|
1047
|
-
const n = (
|
|
1056
|
+
const n = (u = this.overlay) == null ? void 0 : u.querySelector(".trailguide-spotlight"), i = (h = this.overlay) == null ? void 0 : h.querySelector(".trailguide-highlight");
|
|
1048
1057
|
n && (n.style.display = "none"), i && (i.style.display = "none");
|
|
1049
|
-
const o = this.tooltip.querySelector(".trailguide-tooltip-title"), s = this.tooltip.querySelector(".trailguide-tooltip-body"), r = this.tooltip.querySelector(".trailguide-tooltip-progress"), l = this.tooltip.querySelector(".trailguide-btn-prev"),
|
|
1058
|
+
const o = this.tooltip.querySelector(".trailguide-tooltip-title"), s = this.tooltip.querySelector(".trailguide-tooltip-body"), r = this.tooltip.querySelector(".trailguide-tooltip-progress"), l = this.tooltip.querySelector(".trailguide-btn-prev"), a = this.tooltip.querySelector(".trailguide-btn-next"), c = this.currentStepIndex === 0, d = this.currentStepIndex === this.trail.steps.length - 1;
|
|
1050
1059
|
o && (o.textContent = "Element Not Found"), s && (s.innerHTML = `
|
|
1051
|
-
<p style="color: #ef4444; margin: 0 0 8px 0;">Could not find: <code style="background: #fee2e2; padding: 2px 6px; border-radius: 4px; font-size: 12px;">${
|
|
1060
|
+
<p style="color: #ef4444; margin: 0 0 8px 0;">Could not find: <code style="background: #fee2e2; padding: 2px 6px; border-radius: 4px; font-size: 12px;">${Ne(e.target)}</code></p>
|
|
1052
1061
|
<p style="margin: 0; font-size: 13px; color: #6b7280;">The target element doesn't exist on this page. Press <kbd style="background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 11px;">Esc</kbd> to close or skip to the next step.</p>
|
|
1053
|
-
`), r && (r.textContent = `${this.currentStepIndex + 1} of ${this.trail.steps.length}`), l && (l.style.display =
|
|
1062
|
+
`), r && (r.textContent = `${this.currentStepIndex + 1} of ${this.trail.steps.length}`), l && (l.style.display = c ? "none" : "block"), a && (a.textContent = d ? "Close" : "Skip Step"), this.tooltip.style.left = "50%", this.tooltip.style.top = "50%", this.tooltip.style.transform = "translate(-50%, -50%)";
|
|
1054
1063
|
}
|
|
1055
1064
|
updateSpotlight(e) {
|
|
1056
1065
|
if (!this.overlay) return;
|
|
@@ -1069,19 +1078,19 @@ class Ne {
|
|
|
1069
1078
|
}
|
|
1070
1079
|
async updateTooltip(e, n) {
|
|
1071
1080
|
if (!this.tooltip || !this.trail || !this.arrowEl) return;
|
|
1072
|
-
const i = this.currentStepIndex === 0, o = this.currentStepIndex === this.trail.steps.length - 1, s = this.tooltip.querySelector(".trailguide-tooltip-title"), r = this.tooltip.querySelector(".trailguide-tooltip-body"), l = this.tooltip.querySelector(".trailguide-tooltip-progress"),
|
|
1073
|
-
s && (s.textContent = e.title), r && (r.textContent = e.content), l && (l.textContent = `${this.currentStepIndex + 1} of ${this.trail.steps.length}`),
|
|
1074
|
-
const { x: d, y:
|
|
1081
|
+
const i = this.currentStepIndex === 0, o = this.currentStepIndex === this.trail.steps.length - 1, s = this.tooltip.querySelector(".trailguide-tooltip-title"), r = this.tooltip.querySelector(".trailguide-tooltip-body"), l = this.tooltip.querySelector(".trailguide-tooltip-progress"), a = this.tooltip.querySelector(".trailguide-btn-prev"), c = this.tooltip.querySelector(".trailguide-btn-next");
|
|
1082
|
+
s && (s.textContent = e.title), r && (r.textContent = e.content), l && (l.textContent = `${this.currentStepIndex + 1} of ${this.trail.steps.length}`), a && (a.style.display = i ? "none" : "block"), c && (c.textContent = o ? "Finish" : "Next");
|
|
1083
|
+
const { x: d, y: u, placement: h, middlewareData: f } = await qe(n, this.tooltip, {
|
|
1075
1084
|
placement: e.placement,
|
|
1076
1085
|
middleware: [
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1086
|
+
Fe(12),
|
|
1087
|
+
Be(),
|
|
1088
|
+
De({ padding: 8 }),
|
|
1089
|
+
_e({ element: this.arrowEl })
|
|
1081
1090
|
]
|
|
1082
1091
|
});
|
|
1083
|
-
if (this.tooltip.style.left = `${d}px`, this.tooltip.style.top = `${
|
|
1084
|
-
const { x: p, y: g } =
|
|
1092
|
+
if (!(!this.tooltip || !this.isActive) && (this.tooltip.style.left = `${d}px`, this.tooltip.style.top = `${u}px`, this.tooltip.dataset.placement = h, f.arrow && this.arrowEl)) {
|
|
1093
|
+
const { x: p, y: g } = f.arrow;
|
|
1085
1094
|
this.arrowEl.style.left = p != null ? `${p}px` : "", this.arrowEl.style.top = g != null ? `${g}px` : "";
|
|
1086
1095
|
}
|
|
1087
1096
|
}
|
|
@@ -1105,12 +1114,12 @@ class Ne {
|
|
|
1105
1114
|
}
|
|
1106
1115
|
cleanup() {
|
|
1107
1116
|
var e, n;
|
|
1108
|
-
this.stepCleanupFns.forEach((i) => i()), this.stepCleanupFns = [], this.cleanupFns.forEach((i) => i()), this.cleanupFns = [], (e = this.overlay) == null || e.remove(), (n = this.tooltip) == null || n.remove(), this.overlay = null, this.tooltip = null, this.arrowEl = null;
|
|
1117
|
+
this.stepTimerId !== null && (clearTimeout(this.stepTimerId), this.stepTimerId = null), this.stepCleanupFns.forEach((i) => i()), this.stepCleanupFns = [], this.cleanupFns.forEach((i) => i()), this.cleanupFns = [], (e = this.overlay) == null || e.remove(), (n = this.tooltip) == null || n.remove(), this.overlay = null, this.tooltip = null, this.arrowEl = null;
|
|
1109
1118
|
}
|
|
1110
1119
|
emitAnalytics(e) {
|
|
1111
1120
|
if (!this.options.analytics || !this.trail) return;
|
|
1112
1121
|
const n = this.trail.steps[this.currentStepIndex], i = this.options.analytics.trailId || this.trail.id;
|
|
1113
|
-
|
|
1122
|
+
He(this.options.analytics, {
|
|
1114
1123
|
event_type: e,
|
|
1115
1124
|
trail_id: i,
|
|
1116
1125
|
step_id: n == null ? void 0 : n.id,
|
|
@@ -1119,22 +1128,22 @@ class Ne {
|
|
|
1119
1128
|
}
|
|
1120
1129
|
}
|
|
1121
1130
|
let b = null;
|
|
1122
|
-
function
|
|
1123
|
-
return b && b.stop(), b = new
|
|
1131
|
+
function Ye(t, e) {
|
|
1132
|
+
return b && b.stop(), b = new Xe(e), b.start(t), b;
|
|
1124
1133
|
}
|
|
1125
|
-
function
|
|
1134
|
+
function Ke() {
|
|
1126
1135
|
b == null || b.stop(), b = null;
|
|
1127
1136
|
}
|
|
1128
|
-
function
|
|
1137
|
+
function Ge() {
|
|
1129
1138
|
b == null || b.next();
|
|
1130
1139
|
}
|
|
1131
|
-
function
|
|
1140
|
+
function Je() {
|
|
1132
1141
|
b == null || b.prev();
|
|
1133
1142
|
}
|
|
1134
|
-
function
|
|
1143
|
+
function Ue() {
|
|
1135
1144
|
b == null || b.skip(), b = null;
|
|
1136
1145
|
}
|
|
1137
|
-
const
|
|
1146
|
+
const Qe = {
|
|
1138
1147
|
// Backgrounds
|
|
1139
1148
|
bgBase: "#0f172a",
|
|
1140
1149
|
bgCard: "#1e293b",
|
|
@@ -1175,7 +1184,7 @@ const Ke = {
|
|
|
1175
1184
|
shadowMedium: "0 4px 20px rgba(0,0,0,0.4)",
|
|
1176
1185
|
shadowOverlay: "rgba(0,0,0,0.3)"
|
|
1177
1186
|
};
|
|
1178
|
-
function
|
|
1187
|
+
function Ze(t) {
|
|
1179
1188
|
const e = [], n = [];
|
|
1180
1189
|
return t.id || e.push({
|
|
1181
1190
|
stepId: "",
|
|
@@ -1202,8 +1211,8 @@ function Ge(t) {
|
|
|
1202
1211
|
});
|
|
1203
1212
|
return;
|
|
1204
1213
|
}
|
|
1205
|
-
const s =
|
|
1206
|
-
s ?
|
|
1214
|
+
const s = Vt(i.target);
|
|
1215
|
+
s ? Wt(s) || n.push({
|
|
1207
1216
|
stepId: i.id,
|
|
1208
1217
|
stepIndex: o,
|
|
1209
1218
|
type: "hidden_target",
|
|
@@ -1215,7 +1224,7 @@ function Ge(t) {
|
|
|
1215
1224
|
type: "missing_target",
|
|
1216
1225
|
message: `Step ${o + 1} ("${i.title}"): Target element not found`,
|
|
1217
1226
|
selector: i.target
|
|
1218
|
-
}), i.target &&
|
|
1227
|
+
}), i.target && ze(i.target) && n.push({
|
|
1219
1228
|
stepId: i.id,
|
|
1220
1229
|
stepIndex: o,
|
|
1221
1230
|
type: "unstable_selector",
|
|
@@ -1228,10 +1237,10 @@ function Ge(t) {
|
|
|
1228
1237
|
warnings: n
|
|
1229
1238
|
});
|
|
1230
1239
|
}
|
|
1231
|
-
function
|
|
1240
|
+
function ze(t) {
|
|
1232
1241
|
return t.startsWith("#") || t.includes("[data-") ? !1 : !!(t.includes(":nth-child") || t.includes(":nth-of-type") || /^\.[a-z]+-[a-z0-9]+$/i.test(t));
|
|
1233
1242
|
}
|
|
1234
|
-
function
|
|
1243
|
+
function ti(t) {
|
|
1235
1244
|
if (t.valid && t.warnings.length === 0) {
|
|
1236
1245
|
console.log("%c✓ Trail validation passed", "color: green; font-weight: bold");
|
|
1237
1246
|
return;
|
|
@@ -1242,17 +1251,78 @@ function Je(t) {
|
|
|
1242
1251
|
console.warn(`Step ${e.stepIndex + 1}: ${e.message}`), e.selector && console.warn(` Selector: ${e.selector}`);
|
|
1243
1252
|
}), console.groupEnd());
|
|
1244
1253
|
}
|
|
1254
|
+
const St = "trailguide:";
|
|
1255
|
+
function pt(t) {
|
|
1256
|
+
return `${St}completed:${t}`;
|
|
1257
|
+
}
|
|
1258
|
+
function ot(t) {
|
|
1259
|
+
return `${St}progress:${t}`;
|
|
1260
|
+
}
|
|
1261
|
+
function H() {
|
|
1262
|
+
try {
|
|
1263
|
+
return typeof window < "u" ? window.localStorage : null;
|
|
1264
|
+
} catch {
|
|
1265
|
+
return null;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
const ei = {
|
|
1269
|
+
/** Returns true if the user has completed or skipped this tour */
|
|
1270
|
+
hasCompleted(t) {
|
|
1271
|
+
var e;
|
|
1272
|
+
return ((e = H()) == null ? void 0 : e.getItem(pt(t))) === "true";
|
|
1273
|
+
},
|
|
1274
|
+
/** Marks the tour as completed so it won't auto-show again */
|
|
1275
|
+
markCompleted(t) {
|
|
1276
|
+
var e;
|
|
1277
|
+
(e = H()) == null || e.setItem(pt(t), "true");
|
|
1278
|
+
},
|
|
1279
|
+
/** Returns the last step index the user reached, or null if no progress saved */
|
|
1280
|
+
getProgress(t) {
|
|
1281
|
+
var i;
|
|
1282
|
+
const e = (i = H()) == null ? void 0 : i.getItem(ot(t));
|
|
1283
|
+
if (e == null) return null;
|
|
1284
|
+
const n = parseInt(e, 10);
|
|
1285
|
+
return isNaN(n) ? null : n;
|
|
1286
|
+
},
|
|
1287
|
+
/** Saves the user's current step so they can resume later */
|
|
1288
|
+
saveProgress(t, e) {
|
|
1289
|
+
var n;
|
|
1290
|
+
(n = H()) == null || n.setItem(ot(t), String(e));
|
|
1291
|
+
},
|
|
1292
|
+
/** Clears saved progress (but keeps the completion flag) */
|
|
1293
|
+
clearProgress(t) {
|
|
1294
|
+
var e;
|
|
1295
|
+
(e = H()) == null || e.removeItem(ot(t));
|
|
1296
|
+
},
|
|
1297
|
+
/** Clears both completion and progress state for this tour */
|
|
1298
|
+
reset(t) {
|
|
1299
|
+
const e = H();
|
|
1300
|
+
e == null || e.removeItem(pt(t)), e == null || e.removeItem(ot(t));
|
|
1301
|
+
},
|
|
1302
|
+
/** Clears all Trailguide state from localStorage */
|
|
1303
|
+
resetAll() {
|
|
1304
|
+
const t = H();
|
|
1305
|
+
if (!t) return;
|
|
1306
|
+
const e = [];
|
|
1307
|
+
for (let n = 0; n < t.length; n++) {
|
|
1308
|
+
const i = t.key(n);
|
|
1309
|
+
i != null && i.startsWith(St) && e.push(i);
|
|
1310
|
+
}
|
|
1311
|
+
e.forEach((n) => t.removeItem(n));
|
|
1312
|
+
}
|
|
1313
|
+
};
|
|
1245
1314
|
export {
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1315
|
+
Xe as Trailguide,
|
|
1316
|
+
Vt as findElement,
|
|
1317
|
+
Wt as isElementVisible,
|
|
1318
|
+
ti as logValidationResults,
|
|
1319
|
+
Ge as next,
|
|
1320
|
+
Je as prev,
|
|
1321
|
+
Me as scrollToElement,
|
|
1322
|
+
Ue as skip,
|
|
1323
|
+
Ye as start,
|
|
1324
|
+
Ke as stop,
|
|
1325
|
+
Qe as theme,
|
|
1326
|
+
ei as tourStorage,
|
|
1327
|
+
Ze as validateTrail
|
|
1258
1328
|
};
|