@steppy/player 0.0.0-stage → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +9 -0
- package/README.md +190 -2
- package/THIRD_PARTY_LICENSES.txt +158 -0
- package/dist/steppy-cursor-legacy.js +2 -0
- package/dist/steppy-cursor-legacy.js.map +1 -0
- package/dist/steppy-player.js +5419 -0
- package/dist/steppy-player.js.map +1 -0
- package/dist/steppy-tour.js +2164 -0
- package/dist/steppy-tour.js.map +1 -0
- package/dist/steppy-video.js +472 -0
- package/dist/steppy-video.js.map +1 -0
- package/dist/types/cursor/animator.d.ts +135 -0
- package/dist/types/cursor/types.d.ts +61 -0
- package/dist/types/i18n/ui-strings.d.ts +48 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/interaction/positioning.d.ts +22 -0
- package/dist/types/manifest/content.d.ts +24 -0
- package/dist/types/manifest/index.d.ts +3 -0
- package/dist/types/manifest/parse.d.ts +23 -0
- package/dist/types/manifest/schema.d.ts +2895 -0
- package/dist/types/steppy-guide.d.ts +195 -0
- package/dist/types/templates/base-styles.d.ts +15 -0
- package/dist/types/templates/controls.d.ts +17 -0
- package/dist/types/templates/index.d.ts +23 -0
- package/dist/types/templates/inline.d.ts +10 -0
- package/dist/types/templates/overlay.d.ts +10 -0
- package/dist/types/templates/sidebar.d.ts +19 -0
- package/dist/types/templates/types.d.ts +76 -0
- package/dist/types/tour/api.d.ts +54 -0
- package/dist/types/tour/contract.d.ts +54 -0
- package/dist/types/tour/dom.d.ts +43 -0
- package/dist/types/tour/engine.d.ts +157 -0
- package/dist/types/tour/events.d.ts +42 -0
- package/dist/types/tour/host.d.ts +153 -0
- package/dist/types/tour/index.d.ts +15 -0
- package/dist/types/tour/layer.d.ts +16 -0
- package/dist/types/tour/loader.d.ts +70 -0
- package/dist/types/tour/resolver.d.ts +30 -0
- package/dist/types/tour/routes.d.ts +40 -0
- package/dist/types/tour/signature.d.ts +16 -0
- package/dist/types/tour/storage.d.ts +28 -0
- package/dist/types/tour/strings.d.ts +42 -0
- package/dist/types/tour/styles.d.ts +13 -0
- package/dist/types/tour/templates.d.ts +47 -0
- package/dist/types/tour/tracker.d.ts +45 -0
- package/dist/types/tour/triggers.d.ts +52 -0
- package/dist/types/tour/validate.d.ts +82 -0
- package/dist/types/ui/markdown.d.ts +58 -0
- package/dist/types/ui/names.d.ts +18 -0
- package/dist/types/ui/placement.d.ts +59 -0
- package/dist/types/ui/strings.d.ts +31 -0
- package/dist/types/ui/tokens.d.ts +57 -0
- package/package.json +70 -4
- package/schema/README.md +19 -0
- package/schema/guide.schema.json +427 -0
|
@@ -0,0 +1,2164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const de = globalThis, Me = de.ShadowRoot && (de.ShadyCSS === void 0 || de.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ce = Symbol(), Be = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
let kt = class {
|
|
8
|
+
constructor(e, n, s) {
|
|
9
|
+
if (this._$cssResult$ = !0, s !== Ce) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
|
+
this.cssText = e, this.t = n;
|
|
11
|
+
}
|
|
12
|
+
get styleSheet() {
|
|
13
|
+
let e = this.o;
|
|
14
|
+
const n = this.t;
|
|
15
|
+
if (Me && e === void 0) {
|
|
16
|
+
const s = n !== void 0 && n.length === 1;
|
|
17
|
+
s && (e = Be.get(n)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), s && Be.set(n, e));
|
|
18
|
+
}
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
21
|
+
toString() {
|
|
22
|
+
return this.cssText;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const St = (t) => new kt(typeof t == "string" ? t : t + "", void 0, Ce), zt = (t, ...e) => {
|
|
26
|
+
const n = t.length === 1 ? t[0] : e.reduce((s, i, r) => s + ((o) => {
|
|
27
|
+
if (o._$cssResult$ === !0) return o.cssText;
|
|
28
|
+
if (typeof o == "number") return o;
|
|
29
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
30
|
+
})(i) + t[r + 1], t[0]);
|
|
31
|
+
return new kt(n, t, Ce);
|
|
32
|
+
}, Ht = (t, e) => {
|
|
33
|
+
if (Me) t.adoptedStyleSheets = e.map((n) => n instanceof CSSStyleSheet ? n : n.styleSheet);
|
|
34
|
+
else for (const n of e) {
|
|
35
|
+
const s = document.createElement("style"), i = de.litNonce;
|
|
36
|
+
i !== void 0 && s.setAttribute("nonce", i), s.textContent = n.cssText, t.appendChild(s);
|
|
37
|
+
}
|
|
38
|
+
}, Ve = Me ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((e) => {
|
|
39
|
+
let n = "";
|
|
40
|
+
for (const s of e.cssRules) n += s.cssText;
|
|
41
|
+
return St(n);
|
|
42
|
+
})(t) : t;
|
|
43
|
+
/**
|
|
44
|
+
* @license
|
|
45
|
+
* Copyright 2017 Google LLC
|
|
46
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
+
*/
|
|
48
|
+
const { is: Ft, defineProperty: jt, getOwnPropertyDescriptor: Bt, getOwnPropertyNames: Vt, getOwnPropertySymbols: Gt, getPrototypeOf: Kt } = Object, _e = globalThis, Ge = _e.trustedTypes, Wt = Ge ? Ge.emptyScript : "", qt = _e.reactiveElementPolyfillSupport, te = (t, e) => t, ke = { toAttribute(t, e) {
|
|
49
|
+
switch (e) {
|
|
50
|
+
case Boolean:
|
|
51
|
+
t = t ? Wt : null;
|
|
52
|
+
break;
|
|
53
|
+
case Object:
|
|
54
|
+
case Array:
|
|
55
|
+
t = t == null ? t : JSON.stringify(t);
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
}, fromAttribute(t, e) {
|
|
59
|
+
let n = t;
|
|
60
|
+
switch (e) {
|
|
61
|
+
case Boolean:
|
|
62
|
+
n = t !== null;
|
|
63
|
+
break;
|
|
64
|
+
case Number:
|
|
65
|
+
n = t === null ? null : Number(t);
|
|
66
|
+
break;
|
|
67
|
+
case Object:
|
|
68
|
+
case Array:
|
|
69
|
+
try {
|
|
70
|
+
n = JSON.parse(t);
|
|
71
|
+
} catch {
|
|
72
|
+
n = null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return n;
|
|
76
|
+
} }, xt = (t, e) => !Ft(t, e), Ke = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: xt };
|
|
77
|
+
Symbol.metadata ??= Symbol("metadata"), _e.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
78
|
+
let F = class extends HTMLElement {
|
|
79
|
+
static addInitializer(e) {
|
|
80
|
+
this._$Ei(), (this.l ??= []).push(e);
|
|
81
|
+
}
|
|
82
|
+
static get observedAttributes() {
|
|
83
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
|
+
}
|
|
85
|
+
static createProperty(e, n = Ke) {
|
|
86
|
+
if (n.state && (n.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((n = Object.create(n)).wrapped = !0), this.elementProperties.set(e, n), !n.noAccessor) {
|
|
87
|
+
const s = Symbol(), i = this.getPropertyDescriptor(e, s, n);
|
|
88
|
+
i !== void 0 && jt(this.prototype, e, i);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
static getPropertyDescriptor(e, n, s) {
|
|
92
|
+
const { get: i, set: r } = Bt(this.prototype, e) ?? { get() {
|
|
93
|
+
return this[n];
|
|
94
|
+
}, set(o) {
|
|
95
|
+
this[n] = o;
|
|
96
|
+
} };
|
|
97
|
+
return { get: i, set(o) {
|
|
98
|
+
const l = i?.call(this);
|
|
99
|
+
r?.call(this, o), this.requestUpdate(e, l, s);
|
|
100
|
+
}, configurable: !0, enumerable: !0 };
|
|
101
|
+
}
|
|
102
|
+
static getPropertyOptions(e) {
|
|
103
|
+
return this.elementProperties.get(e) ?? Ke;
|
|
104
|
+
}
|
|
105
|
+
static _$Ei() {
|
|
106
|
+
if (this.hasOwnProperty(te("elementProperties"))) return;
|
|
107
|
+
const e = Kt(this);
|
|
108
|
+
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
109
|
+
}
|
|
110
|
+
static finalize() {
|
|
111
|
+
if (this.hasOwnProperty(te("finalized"))) return;
|
|
112
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(te("properties"))) {
|
|
113
|
+
const n = this.properties, s = [...Vt(n), ...Gt(n)];
|
|
114
|
+
for (const i of s) this.createProperty(i, n[i]);
|
|
115
|
+
}
|
|
116
|
+
const e = this[Symbol.metadata];
|
|
117
|
+
if (e !== null) {
|
|
118
|
+
const n = litPropertyMetadata.get(e);
|
|
119
|
+
if (n !== void 0) for (const [s, i] of n) this.elementProperties.set(s, i);
|
|
120
|
+
}
|
|
121
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
122
|
+
for (const [n, s] of this.elementProperties) {
|
|
123
|
+
const i = this._$Eu(n, s);
|
|
124
|
+
i !== void 0 && this._$Eh.set(i, n);
|
|
125
|
+
}
|
|
126
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
127
|
+
}
|
|
128
|
+
static finalizeStyles(e) {
|
|
129
|
+
const n = [];
|
|
130
|
+
if (Array.isArray(e)) {
|
|
131
|
+
const s = new Set(e.flat(1 / 0).reverse());
|
|
132
|
+
for (const i of s) n.unshift(Ve(i));
|
|
133
|
+
} else e !== void 0 && n.push(Ve(e));
|
|
134
|
+
return n;
|
|
135
|
+
}
|
|
136
|
+
static _$Eu(e, n) {
|
|
137
|
+
const s = n.attribute;
|
|
138
|
+
return s === !1 ? void 0 : typeof s == "string" ? s : typeof e == "string" ? e.toLowerCase() : void 0;
|
|
139
|
+
}
|
|
140
|
+
constructor() {
|
|
141
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
142
|
+
}
|
|
143
|
+
_$Ev() {
|
|
144
|
+
this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((e) => e(this));
|
|
145
|
+
}
|
|
146
|
+
addController(e) {
|
|
147
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.();
|
|
148
|
+
}
|
|
149
|
+
removeController(e) {
|
|
150
|
+
this._$EO?.delete(e);
|
|
151
|
+
}
|
|
152
|
+
_$E_() {
|
|
153
|
+
const e = /* @__PURE__ */ new Map(), n = this.constructor.elementProperties;
|
|
154
|
+
for (const s of n.keys()) this.hasOwnProperty(s) && (e.set(s, this[s]), delete this[s]);
|
|
155
|
+
e.size > 0 && (this._$Ep = e);
|
|
156
|
+
}
|
|
157
|
+
createRenderRoot() {
|
|
158
|
+
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
159
|
+
return Ht(e, this.constructor.elementStyles), e;
|
|
160
|
+
}
|
|
161
|
+
connectedCallback() {
|
|
162
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((e) => e.hostConnected?.());
|
|
163
|
+
}
|
|
164
|
+
enableUpdating(e) {
|
|
165
|
+
}
|
|
166
|
+
disconnectedCallback() {
|
|
167
|
+
this._$EO?.forEach((e) => e.hostDisconnected?.());
|
|
168
|
+
}
|
|
169
|
+
attributeChangedCallback(e, n, s) {
|
|
170
|
+
this._$AK(e, s);
|
|
171
|
+
}
|
|
172
|
+
_$ET(e, n) {
|
|
173
|
+
const s = this.constructor.elementProperties.get(e), i = this.constructor._$Eu(e, s);
|
|
174
|
+
if (i !== void 0 && s.reflect === !0) {
|
|
175
|
+
const r = (s.converter?.toAttribute !== void 0 ? s.converter : ke).toAttribute(n, s.type);
|
|
176
|
+
this._$Em = e, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
_$AK(e, n) {
|
|
180
|
+
const s = this.constructor, i = s._$Eh.get(e);
|
|
181
|
+
if (i !== void 0 && this._$Em !== i) {
|
|
182
|
+
const r = s.getPropertyOptions(i), o = typeof r.converter == "function" ? { fromAttribute: r.converter } : r.converter?.fromAttribute !== void 0 ? r.converter : ke;
|
|
183
|
+
this._$Em = i;
|
|
184
|
+
const l = o.fromAttribute(n, r.type);
|
|
185
|
+
this[i] = l ?? this._$Ej?.get(i) ?? l, this._$Em = null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
requestUpdate(e, n, s, i = !1, r) {
|
|
189
|
+
if (e !== void 0) {
|
|
190
|
+
const o = this.constructor;
|
|
191
|
+
if (i === !1 && (r = this[e]), s ??= o.getPropertyOptions(e), !((s.hasChanged ?? xt)(r, n) || s.useDefault && s.reflect && r === this._$Ej?.get(e) && !this.hasAttribute(o._$Eu(e, s)))) return;
|
|
192
|
+
this.C(e, n, s);
|
|
193
|
+
}
|
|
194
|
+
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
195
|
+
}
|
|
196
|
+
C(e, n, { useDefault: s, reflect: i, wrapped: r }, o) {
|
|
197
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(e) && (this._$Ej.set(e, o ?? n ?? this[e]), r !== !0 || o !== void 0) || (this._$AL.has(e) || (this.hasUpdated || s || (n = void 0), this._$AL.set(e, n)), i === !0 && this._$Em !== e && (this._$Eq ??= /* @__PURE__ */ new Set()).add(e));
|
|
198
|
+
}
|
|
199
|
+
async _$EP() {
|
|
200
|
+
this.isUpdatePending = !0;
|
|
201
|
+
try {
|
|
202
|
+
await this._$ES;
|
|
203
|
+
} catch (n) {
|
|
204
|
+
Promise.reject(n);
|
|
205
|
+
}
|
|
206
|
+
const e = this.scheduleUpdate();
|
|
207
|
+
return e != null && await e, !this.isUpdatePending;
|
|
208
|
+
}
|
|
209
|
+
scheduleUpdate() {
|
|
210
|
+
return this.performUpdate();
|
|
211
|
+
}
|
|
212
|
+
performUpdate() {
|
|
213
|
+
if (!this.isUpdatePending) return;
|
|
214
|
+
if (!this.hasUpdated) {
|
|
215
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
216
|
+
for (const [i, r] of this._$Ep) this[i] = r;
|
|
217
|
+
this._$Ep = void 0;
|
|
218
|
+
}
|
|
219
|
+
const s = this.constructor.elementProperties;
|
|
220
|
+
if (s.size > 0) for (const [i, r] of s) {
|
|
221
|
+
const { wrapped: o } = r, l = this[i];
|
|
222
|
+
o !== !0 || this._$AL.has(i) || l === void 0 || this.C(i, void 0, r, l);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
let e = !1;
|
|
226
|
+
const n = this._$AL;
|
|
227
|
+
try {
|
|
228
|
+
e = this.shouldUpdate(n), e ? (this.willUpdate(n), this._$EO?.forEach((s) => s.hostUpdate?.()), this.update(n)) : this._$EM();
|
|
229
|
+
} catch (s) {
|
|
230
|
+
throw e = !1, this._$EM(), s;
|
|
231
|
+
}
|
|
232
|
+
e && this._$AE(n);
|
|
233
|
+
}
|
|
234
|
+
willUpdate(e) {
|
|
235
|
+
}
|
|
236
|
+
_$AE(e) {
|
|
237
|
+
this._$EO?.forEach((n) => n.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e);
|
|
238
|
+
}
|
|
239
|
+
_$EM() {
|
|
240
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
241
|
+
}
|
|
242
|
+
get updateComplete() {
|
|
243
|
+
return this.getUpdateComplete();
|
|
244
|
+
}
|
|
245
|
+
getUpdateComplete() {
|
|
246
|
+
return this._$ES;
|
|
247
|
+
}
|
|
248
|
+
shouldUpdate(e) {
|
|
249
|
+
return !0;
|
|
250
|
+
}
|
|
251
|
+
update(e) {
|
|
252
|
+
this._$Eq &&= this._$Eq.forEach((n) => this._$ET(n, this[n])), this._$EM();
|
|
253
|
+
}
|
|
254
|
+
updated(e) {
|
|
255
|
+
}
|
|
256
|
+
firstUpdated(e) {
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
F.elementStyles = [], F.shadowRootOptions = { mode: "open" }, F[te("elementProperties")] = /* @__PURE__ */ new Map(), F[te("finalized")] = /* @__PURE__ */ new Map(), qt?.({ ReactiveElement: F }), (_e.reactiveElementVersions ??= []).push("2.1.2");
|
|
260
|
+
/**
|
|
261
|
+
* @license
|
|
262
|
+
* Copyright 2017 Google LLC
|
|
263
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
264
|
+
*/
|
|
265
|
+
const Pe = globalThis, We = (t) => t, pe = Pe.trustedTypes, qe = pe ? pe.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, Tt = "$lit$", C = `lit$${Math.random().toFixed(9).slice(2)}$`, It = "?" + C, Zt = `<${It}>`, H = document, se = () => H.createComment(""), ie = (t) => t === null || typeof t != "object" && typeof t != "function", Ue = Array.isArray, Xt = (t) => Ue(t) || typeof t?.[Symbol.iterator] == "function", we = `[
|
|
266
|
+
\f\r]`, W = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Ze = /-->/g, Xe = />/g, U = RegExp(`>|${we}(?:([^\\s"'>=/]+)(${we}*=${we}*(?:[^
|
|
267
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Ye = /'/g, Je = /"/g, Rt = /^(?:script|style|textarea|title)$/i, Yt = (t) => (e, ...n) => ({ _$litType$: t, strings: e, values: n }), I = Yt(1), V = Symbol.for("lit-noChange"), A = Symbol.for("lit-nothing"), Qe = /* @__PURE__ */ new WeakMap(), D = H.createTreeWalker(H, 129);
|
|
268
|
+
function Ot(t, e) {
|
|
269
|
+
if (!Ue(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
270
|
+
return qe !== void 0 ? qe.createHTML(e) : e;
|
|
271
|
+
}
|
|
272
|
+
const Jt = (t, e) => {
|
|
273
|
+
const n = t.length - 1, s = [];
|
|
274
|
+
let i, r = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", o = W;
|
|
275
|
+
for (let l = 0; l < n; l++) {
|
|
276
|
+
const a = t[l];
|
|
277
|
+
let f, h, c = -1, b = 0;
|
|
278
|
+
for (; b < a.length && (o.lastIndex = b, h = o.exec(a), h !== null); ) b = o.lastIndex, o === W ? h[1] === "!--" ? o = Ze : h[1] !== void 0 ? o = Xe : h[2] !== void 0 ? (Rt.test(h[2]) && (i = RegExp("</" + h[2], "g")), o = U) : h[3] !== void 0 && (o = U) : o === U ? h[0] === ">" ? (o = i ?? W, c = -1) : h[1] === void 0 ? c = -2 : (c = o.lastIndex - h[2].length, f = h[1], o = h[3] === void 0 ? U : h[3] === '"' ? Je : Ye) : o === Je || o === Ye ? o = U : o === Ze || o === Xe ? o = W : (o = U, i = void 0);
|
|
279
|
+
const _ = o === U && t[l + 1].startsWith("/>") ? " " : "";
|
|
280
|
+
r += o === W ? a + Zt : c >= 0 ? (s.push(f), a.slice(0, c) + Tt + a.slice(c) + C + _) : a + C + (c === -2 ? l : _);
|
|
281
|
+
}
|
|
282
|
+
return [Ot(t, r + (t[n] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), s];
|
|
283
|
+
};
|
|
284
|
+
class re {
|
|
285
|
+
constructor({ strings: e, _$litType$: n }, s) {
|
|
286
|
+
let i;
|
|
287
|
+
this.parts = [];
|
|
288
|
+
let r = 0, o = 0;
|
|
289
|
+
const l = e.length - 1, a = this.parts, [f, h] = Jt(e, n);
|
|
290
|
+
if (this.el = re.createElement(f, s), D.currentNode = this.el.content, n === 2 || n === 3) {
|
|
291
|
+
const c = this.el.content.firstChild;
|
|
292
|
+
c.replaceWith(...c.childNodes);
|
|
293
|
+
}
|
|
294
|
+
for (; (i = D.nextNode()) !== null && a.length < l; ) {
|
|
295
|
+
if (i.nodeType === 1) {
|
|
296
|
+
if (i.hasAttributes()) for (const c of i.getAttributeNames()) if (c.endsWith(Tt)) {
|
|
297
|
+
const b = h[o++], _ = i.getAttribute(c).split(C), m = /([.?@])?(.*)/.exec(b);
|
|
298
|
+
a.push({ type: 1, index: r, name: m[2], strings: _, ctor: m[1] === "." ? en : m[1] === "?" ? tn : m[1] === "@" ? nn : ye }), i.removeAttribute(c);
|
|
299
|
+
} else c.startsWith(C) && (a.push({ type: 6, index: r }), i.removeAttribute(c));
|
|
300
|
+
if (Rt.test(i.tagName)) {
|
|
301
|
+
const c = i.textContent.split(C), b = c.length - 1;
|
|
302
|
+
if (b > 0) {
|
|
303
|
+
i.textContent = pe ? pe.emptyScript : "";
|
|
304
|
+
for (let _ = 0; _ < b; _++) i.append(c[_], se()), D.nextNode(), a.push({ type: 2, index: ++r });
|
|
305
|
+
i.append(c[b], se());
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
} else if (i.nodeType === 8) if (i.data === It) a.push({ type: 2, index: r });
|
|
309
|
+
else {
|
|
310
|
+
let c = -1;
|
|
311
|
+
for (; (c = i.data.indexOf(C, c + 1)) !== -1; ) a.push({ type: 7, index: r }), c += C.length - 1;
|
|
312
|
+
}
|
|
313
|
+
r++;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
static createElement(e, n) {
|
|
317
|
+
const s = H.createElement("template");
|
|
318
|
+
return s.innerHTML = e, s;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function G(t, e, n = t, s) {
|
|
322
|
+
if (e === V) return e;
|
|
323
|
+
let i = s !== void 0 ? n._$Co?.[s] : n._$Cl;
|
|
324
|
+
const r = ie(e) ? void 0 : e._$litDirective$;
|
|
325
|
+
return i?.constructor !== r && (i?._$AO?.(!1), r === void 0 ? i = void 0 : (i = new r(t), i._$AT(t, n, s)), s !== void 0 ? (n._$Co ??= [])[s] = i : n._$Cl = i), i !== void 0 && (e = G(t, i._$AS(t, e.values), i, s)), e;
|
|
326
|
+
}
|
|
327
|
+
class Qt {
|
|
328
|
+
constructor(e, n) {
|
|
329
|
+
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = n;
|
|
330
|
+
}
|
|
331
|
+
get parentNode() {
|
|
332
|
+
return this._$AM.parentNode;
|
|
333
|
+
}
|
|
334
|
+
get _$AU() {
|
|
335
|
+
return this._$AM._$AU;
|
|
336
|
+
}
|
|
337
|
+
u(e) {
|
|
338
|
+
const { el: { content: n }, parts: s } = this._$AD, i = (e?.creationScope ?? H).importNode(n, !0);
|
|
339
|
+
D.currentNode = i;
|
|
340
|
+
let r = D.nextNode(), o = 0, l = 0, a = s[0];
|
|
341
|
+
for (; a !== void 0; ) {
|
|
342
|
+
if (o === a.index) {
|
|
343
|
+
let f;
|
|
344
|
+
a.type === 2 ? f = new ae(r, r.nextSibling, this, e) : a.type === 1 ? f = new a.ctor(r, a.name, a.strings, this, e) : a.type === 6 && (f = new sn(r, this, e)), this._$AV.push(f), a = s[++l];
|
|
345
|
+
}
|
|
346
|
+
o !== a?.index && (r = D.nextNode(), o++);
|
|
347
|
+
}
|
|
348
|
+
return D.currentNode = H, i;
|
|
349
|
+
}
|
|
350
|
+
p(e) {
|
|
351
|
+
let n = 0;
|
|
352
|
+
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(e, s, n), n += s.strings.length - 2) : s._$AI(e[n])), n++;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
class ae {
|
|
356
|
+
get _$AU() {
|
|
357
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
358
|
+
}
|
|
359
|
+
constructor(e, n, s, i) {
|
|
360
|
+
this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = e, this._$AB = n, this._$AM = s, this.options = i, this._$Cv = i?.isConnected ?? !0;
|
|
361
|
+
}
|
|
362
|
+
get parentNode() {
|
|
363
|
+
let e = this._$AA.parentNode;
|
|
364
|
+
const n = this._$AM;
|
|
365
|
+
return n !== void 0 && e?.nodeType === 11 && (e = n.parentNode), e;
|
|
366
|
+
}
|
|
367
|
+
get startNode() {
|
|
368
|
+
return this._$AA;
|
|
369
|
+
}
|
|
370
|
+
get endNode() {
|
|
371
|
+
return this._$AB;
|
|
372
|
+
}
|
|
373
|
+
_$AI(e, n = this) {
|
|
374
|
+
e = G(this, e, n), ie(e) ? e === A || e == null || e === "" ? (this._$AH !== A && this._$AR(), this._$AH = A) : e !== this._$AH && e !== V && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Xt(e) ? this.k(e) : this._(e);
|
|
375
|
+
}
|
|
376
|
+
O(e) {
|
|
377
|
+
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
378
|
+
}
|
|
379
|
+
T(e) {
|
|
380
|
+
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
381
|
+
}
|
|
382
|
+
_(e) {
|
|
383
|
+
this._$AH !== A && ie(this._$AH) ? this._$AA.nextSibling.data = e : this.T(H.createTextNode(e)), this._$AH = e;
|
|
384
|
+
}
|
|
385
|
+
$(e) {
|
|
386
|
+
const { values: n, _$litType$: s } = e, i = typeof s == "number" ? this._$AC(e) : (s.el === void 0 && (s.el = re.createElement(Ot(s.h, s.h[0]), this.options)), s);
|
|
387
|
+
if (this._$AH?._$AD === i) this._$AH.p(n);
|
|
388
|
+
else {
|
|
389
|
+
const r = new Qt(i, this), o = r.u(this.options);
|
|
390
|
+
r.p(n), this.T(o), this._$AH = r;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
_$AC(e) {
|
|
394
|
+
let n = Qe.get(e.strings);
|
|
395
|
+
return n === void 0 && Qe.set(e.strings, n = new re(e)), n;
|
|
396
|
+
}
|
|
397
|
+
k(e) {
|
|
398
|
+
Ue(this._$AH) || (this._$AH = [], this._$AR());
|
|
399
|
+
const n = this._$AH;
|
|
400
|
+
let s, i = 0;
|
|
401
|
+
for (const r of e) i === n.length ? n.push(s = new ae(this.O(se()), this.O(se()), this, this.options)) : s = n[i], s._$AI(r), i++;
|
|
402
|
+
i < n.length && (this._$AR(s && s._$AB.nextSibling, i), n.length = i);
|
|
403
|
+
}
|
|
404
|
+
_$AR(e = this._$AA.nextSibling, n) {
|
|
405
|
+
for (this._$AP?.(!1, !0, n); e !== this._$AB; ) {
|
|
406
|
+
const s = We(e).nextSibling;
|
|
407
|
+
We(e).remove(), e = s;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
setConnected(e) {
|
|
411
|
+
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
class ye {
|
|
415
|
+
get tagName() {
|
|
416
|
+
return this.element.tagName;
|
|
417
|
+
}
|
|
418
|
+
get _$AU() {
|
|
419
|
+
return this._$AM._$AU;
|
|
420
|
+
}
|
|
421
|
+
constructor(e, n, s, i, r) {
|
|
422
|
+
this.type = 1, this._$AH = A, this._$AN = void 0, this.element = e, this.name = n, this._$AM = i, this.options = r, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = A;
|
|
423
|
+
}
|
|
424
|
+
_$AI(e, n = this, s, i) {
|
|
425
|
+
const r = this.strings;
|
|
426
|
+
let o = !1;
|
|
427
|
+
if (r === void 0) e = G(this, e, n, 0), o = !ie(e) || e !== this._$AH && e !== V, o && (this._$AH = e);
|
|
428
|
+
else {
|
|
429
|
+
const l = e;
|
|
430
|
+
let a, f;
|
|
431
|
+
for (e = r[0], a = 0; a < r.length - 1; a++) f = G(this, l[s + a], n, a), f === V && (f = this._$AH[a]), o ||= !ie(f) || f !== this._$AH[a], f === A ? e = A : e !== A && (e += (f ?? "") + r[a + 1]), this._$AH[a] = f;
|
|
432
|
+
}
|
|
433
|
+
o && !i && this.j(e);
|
|
434
|
+
}
|
|
435
|
+
j(e) {
|
|
436
|
+
e === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
class en extends ye {
|
|
440
|
+
constructor() {
|
|
441
|
+
super(...arguments), this.type = 3;
|
|
442
|
+
}
|
|
443
|
+
j(e) {
|
|
444
|
+
this.element[this.name] = e === A ? void 0 : e;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
class tn extends ye {
|
|
448
|
+
constructor() {
|
|
449
|
+
super(...arguments), this.type = 4;
|
|
450
|
+
}
|
|
451
|
+
j(e) {
|
|
452
|
+
this.element.toggleAttribute(this.name, !!e && e !== A);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
class nn extends ye {
|
|
456
|
+
constructor(e, n, s, i, r) {
|
|
457
|
+
super(e, n, s, i, r), this.type = 5;
|
|
458
|
+
}
|
|
459
|
+
_$AI(e, n = this) {
|
|
460
|
+
if ((e = G(this, e, n, 0) ?? A) === V) return;
|
|
461
|
+
const s = this._$AH, i = e === A && s !== A || e.capture !== s.capture || e.once !== s.once || e.passive !== s.passive, r = e !== A && (s === A || i);
|
|
462
|
+
i && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
463
|
+
}
|
|
464
|
+
handleEvent(e) {
|
|
465
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
class sn {
|
|
469
|
+
constructor(e, n, s) {
|
|
470
|
+
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = n, this.options = s;
|
|
471
|
+
}
|
|
472
|
+
get _$AU() {
|
|
473
|
+
return this._$AM._$AU;
|
|
474
|
+
}
|
|
475
|
+
_$AI(e) {
|
|
476
|
+
G(this, e);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
const rn = Pe.litHtmlPolyfillSupport;
|
|
480
|
+
rn?.(re, ae), (Pe.litHtmlVersions ??= []).push("3.3.3");
|
|
481
|
+
const on = (t, e, n) => {
|
|
482
|
+
const s = n?.renderBefore ?? e;
|
|
483
|
+
let i = s._$litPart$;
|
|
484
|
+
if (i === void 0) {
|
|
485
|
+
const r = n?.renderBefore ?? null;
|
|
486
|
+
s._$litPart$ = i = new ae(e.insertBefore(se(), r), r, void 0, n ?? {});
|
|
487
|
+
}
|
|
488
|
+
return i._$AI(t), i;
|
|
489
|
+
};
|
|
490
|
+
/**
|
|
491
|
+
* @license
|
|
492
|
+
* Copyright 2017 Google LLC
|
|
493
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
494
|
+
*/
|
|
495
|
+
const Ne = globalThis;
|
|
496
|
+
class ne extends F {
|
|
497
|
+
constructor() {
|
|
498
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
499
|
+
}
|
|
500
|
+
createRenderRoot() {
|
|
501
|
+
const e = super.createRenderRoot();
|
|
502
|
+
return this.renderOptions.renderBefore ??= e.firstChild, e;
|
|
503
|
+
}
|
|
504
|
+
update(e) {
|
|
505
|
+
const n = this.render();
|
|
506
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = on(n, this.renderRoot, this.renderOptions);
|
|
507
|
+
}
|
|
508
|
+
connectedCallback() {
|
|
509
|
+
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
510
|
+
}
|
|
511
|
+
disconnectedCallback() {
|
|
512
|
+
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
513
|
+
}
|
|
514
|
+
render() {
|
|
515
|
+
return V;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
ne._$litElement$ = !0, ne.finalized = !0, Ne.litElementHydrateSupport?.({ LitElement: ne });
|
|
519
|
+
const an = Ne.litElementPolyfillSupport;
|
|
520
|
+
an?.({ LitElement: ne });
|
|
521
|
+
(Ne.litElementVersions ??= []).push("4.2.2");
|
|
522
|
+
const ve = "steppy-tour-host", ln = "steppy-tours-manifest", cn = "steppy-tour", un = "__STEPPY_TOURS_DISABLED__", De = "steppy:tour", dn = "steppy.tour.active", et = 1, hn = ["click", "input", "change", "visible", "manual"], pn = ["click", "input", "change", "visible"], fn = ["top", "bottom", "left", "right", "auto"], zs = ["tour-start", "tour-step", "tour-complete", "tour-dismiss", "tour-offpath", "tour-error"], Hs = ["target-timeout", "entry-params", "load-failed", "schema-unsupported", "invalid-data"], Fs = ["layer", "spotlight", "bubble", "title", "body", "progress", "button", "primary", "secondary", "next", "close", "skip", "end", "resume", "pill", "guide-link"], gn = "^[A-Za-z0-9_.:/-]{1,128}$", mn = "^[A-Za-z0-9_.:/-]{1,128}$", _n = "^data-[a-z0-9-]+$", yn = "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$", bn = "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$", wn = "^[A-Za-z0-9_-]{1,64}$", vn = "^[A-Za-z]{2,3}(?:[-_][A-Za-z0-9]{1,8}){0,5}$", $n = "^sha384-[A-Za-z0-9+/]{64}$", En = "^/$|^(?:/(?::[A-Za-z_][A-Za-z0-9_]{0,63}|[A-Za-z0-9._~%!$&()*+,;=@-]{1,128})){1,32}$", An = "^[A-Za-z0-9 :().,<>=/_-]{1,256}$", kn = "^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,62}[A-Za-z0-9])?$", tt = 500, Lt = 100, nt = 32, fe = 16, Se = 200, Sn = 2e3, xn = 512, Tn = 2048, In = 256, $e = 262144, Rn = 1048576, st = 8e3, On = 2147483e3, it = { top: "bottom", bottom: "top", left: "right", right: "left" };
|
|
523
|
+
function Ln(t, e, n, s = 8, i) {
|
|
524
|
+
return i === void 0 ? Mn(t, e, n, s) : Cn(t, e, n, s, i);
|
|
525
|
+
}
|
|
526
|
+
function Mn(t, e, n, s) {
|
|
527
|
+
const i = t.y, r = n.height - (t.y + t.height), o = t.x, l = n.width - (t.x + t.width), a = e.height + s, f = e.width + s, h = r >= i ? { side: "bottom", room: r } : { side: "top", room: i };
|
|
528
|
+
let c;
|
|
529
|
+
if (h.room >= a)
|
|
530
|
+
c = h.side;
|
|
531
|
+
else {
|
|
532
|
+
const p = l >= o ? { side: "right", room: l } : { side: "left", room: o };
|
|
533
|
+
c = p.room >= f ? p.side : h.side;
|
|
534
|
+
}
|
|
535
|
+
const b = t.x + t.width / 2, _ = t.y + t.height / 2;
|
|
536
|
+
let m = 0, u = 0;
|
|
537
|
+
return c === "bottom" ? (m = P(b - e.width / 2, 0, n.width - e.width), u = Math.min(t.y + t.height + s, n.height - e.height)) : c === "top" ? (m = P(b - e.width / 2, 0, n.width - e.width), u = Math.max(0, t.y - e.height - s)) : c === "right" ? (m = Math.min(t.x + t.width + s, n.width - e.width), u = P(_ - e.height / 2, 0, n.height - e.height)) : (m = Math.max(0, t.x - e.width - s), u = P(_ - e.height / 2, 0, n.height - e.height)), { side: c, x: m, y: u };
|
|
538
|
+
}
|
|
539
|
+
function Cn(t, e, n, s, i) {
|
|
540
|
+
const r = i.margin, o = {
|
|
541
|
+
top: t.y - r,
|
|
542
|
+
bottom: n.height - (t.y + t.height) - r,
|
|
543
|
+
left: t.x - r,
|
|
544
|
+
right: n.width - (t.x + t.width) - r
|
|
545
|
+
}, l = Pn(o, i.preferred ?? "auto"), a = (d) => {
|
|
546
|
+
const w = d === "top" || d === "bottom", y = w ? e.height : e.width, $ = w ? e.width : e.height, E = w ? n.width : n.height;
|
|
547
|
+
return o[d] >= y + s && $ <= E - 2 * r;
|
|
548
|
+
}, f = (d) => {
|
|
549
|
+
const w = t.x + t.width / 2, y = t.y + t.height / 2, $ = P(w - e.width / 2, r, n.width - e.width - r), E = P(y - e.height / 2, r, n.height - e.height - r);
|
|
550
|
+
return d === "bottom" ? { side: d, x: $, y: t.y + t.height + s } : d === "top" ? { side: d, x: $, y: t.y - s - e.height } : d === "right" ? { side: d, x: t.x + t.width + s, y: E } : { side: d, x: t.x - s - e.width, y: E };
|
|
551
|
+
}, h = i.avoid ?? [], c = (d) => h.some((w) => xe({ x: d.x, y: d.y, width: e.width, height: e.height }, w)), b = l.filter(a).map(f), m = b.filter((d) => !c(d))[0] ?? b[0];
|
|
552
|
+
if (m) return { ...m, overlaps: !1 };
|
|
553
|
+
const u = f(l[0]), p = P(u.x, r, n.width - e.width - r), v = P(u.y, r, n.height - e.height - r), g = xe({ x: p, y: v, width: e.width, height: e.height }, t);
|
|
554
|
+
return { side: u.side, x: p, y: v, overlaps: g };
|
|
555
|
+
}
|
|
556
|
+
function Pn(t, e) {
|
|
557
|
+
if (e === "auto") {
|
|
558
|
+
const s = t.bottom >= t.top ? ["bottom", "top"] : ["top", "bottom"], i = t.right >= t.left ? ["right", "left"] : ["left", "right"];
|
|
559
|
+
return [...s, ...i];
|
|
560
|
+
}
|
|
561
|
+
const n = ["top", "bottom", "left", "right"].filter((s) => s !== e && s !== it[e]).sort((s, i) => t[i] - t[s]);
|
|
562
|
+
return [e, it[e], ...n];
|
|
563
|
+
}
|
|
564
|
+
function P(t, e, n) {
|
|
565
|
+
return Math.max(e, Math.min(n, t));
|
|
566
|
+
}
|
|
567
|
+
function xe(t, e) {
|
|
568
|
+
return t.x < e.x + e.width && e.x < t.x + t.width && t.y < e.y + e.height && e.y < t.y + t.height;
|
|
569
|
+
}
|
|
570
|
+
function rt(t, e) {
|
|
571
|
+
const n = Math.max(t.x, e.x), s = Math.max(t.y, e.y), i = Math.min(t.x + t.width, e.x + e.width), r = Math.min(t.y + t.height, e.y + e.height);
|
|
572
|
+
return i > n && r > s ? { x: n, y: s, width: i - n, height: r - s } : null;
|
|
573
|
+
}
|
|
574
|
+
function Un(t, e) {
|
|
575
|
+
const n = Math.min(t.x, e.x), s = Math.min(t.y, e.y);
|
|
576
|
+
return {
|
|
577
|
+
x: n,
|
|
578
|
+
y: s,
|
|
579
|
+
width: Math.max(t.x + t.width, e.x + e.width) - n,
|
|
580
|
+
height: Math.max(t.y + t.height, e.y + e.height) - s
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
function ot(t, e) {
|
|
584
|
+
return { x: t.x - e, y: t.y - e, width: t.width + 2 * e, height: t.height + 2 * e };
|
|
585
|
+
}
|
|
586
|
+
const Nn = 'button,input,select,textarea,a[href],[role=button],[role=combobox],[tabindex]:not([tabindex="-1"])';
|
|
587
|
+
function at(t) {
|
|
588
|
+
const e = t.getBoundingClientRect();
|
|
589
|
+
return e.width > 0 && e.height > 0 ? { x: e.left, y: e.top, width: e.width, height: e.height } : null;
|
|
590
|
+
}
|
|
591
|
+
function Te(t, e = 0) {
|
|
592
|
+
const n = getComputedStyle(t);
|
|
593
|
+
if (n.visibility === "hidden") return null;
|
|
594
|
+
if (n.display === "contents" && e < 3) {
|
|
595
|
+
let i = null;
|
|
596
|
+
for (const r of t.children) {
|
|
597
|
+
const o = Te(r, e + 1);
|
|
598
|
+
o && (i = i ? Un(i, o) : o);
|
|
599
|
+
}
|
|
600
|
+
return i;
|
|
601
|
+
}
|
|
602
|
+
const s = at(t);
|
|
603
|
+
if (s || e >= 3) return s;
|
|
604
|
+
for (const i of t.querySelectorAll(Nn)) {
|
|
605
|
+
const r = at(i);
|
|
606
|
+
if (r && getComputedStyle(i).visibility !== "hidden") return r;
|
|
607
|
+
}
|
|
608
|
+
return null;
|
|
609
|
+
}
|
|
610
|
+
const Dn = {
|
|
611
|
+
now: () => performance.now(),
|
|
612
|
+
raf: (t) => requestAnimationFrame(t),
|
|
613
|
+
cancelRaf: (t) => cancelAnimationFrame(t),
|
|
614
|
+
setTimeout: (t, e) => window.setTimeout(t, e),
|
|
615
|
+
clearTimeout: (t) => window.clearTimeout(t),
|
|
616
|
+
setInterval: (t, e) => window.setInterval(t, e),
|
|
617
|
+
clearInterval: (t) => window.clearInterval(t)
|
|
618
|
+
}, Mt = {
|
|
619
|
+
scheduler: Dn,
|
|
620
|
+
rect: (t) => Te(t),
|
|
621
|
+
isVisible: (t) => Te(t) !== null,
|
|
622
|
+
viewport: () => {
|
|
623
|
+
const t = window.visualViewport;
|
|
624
|
+
return t ? { x: t.offsetLeft, y: t.offsetTop, width: t.width, height: t.height } : { x: 0, y: 0, width: window.innerWidth, height: window.innerHeight };
|
|
625
|
+
},
|
|
626
|
+
matchMedia: (t) => {
|
|
627
|
+
try {
|
|
628
|
+
return window.matchMedia(t).matches;
|
|
629
|
+
} catch {
|
|
630
|
+
return !1;
|
|
631
|
+
}
|
|
632
|
+
},
|
|
633
|
+
reducedMotion: () => Mt.matchMedia("(prefers-reduced-motion: reduce)"),
|
|
634
|
+
scrollIntoView: (t, e) => t.scrollIntoView({ block: "center", inline: "nearest", behavior: e ? "instant" : "smooth" }),
|
|
635
|
+
supportsPopover: () => typeof HTMLElement.prototype.showPopover == "function"
|
|
636
|
+
};
|
|
637
|
+
function z() {
|
|
638
|
+
return { phase: "idle", token: 0, loaded: null, index: 0, reason: "start", fieldNonEmpty: !1 };
|
|
639
|
+
}
|
|
640
|
+
const J = (t) => t.phase !== "idle" && t.phase !== "loading";
|
|
641
|
+
function oe(t, e = t.index) {
|
|
642
|
+
const n = t.loaded?.applicable ?? [];
|
|
643
|
+
return { index: n.slice(0, e).filter(Boolean).length, total: n.filter(Boolean).length };
|
|
644
|
+
}
|
|
645
|
+
function ge(t) {
|
|
646
|
+
const e = t.loaded.tour;
|
|
647
|
+
return { tourId: e.id, buildId: e.buildId, locale: e.locale };
|
|
648
|
+
}
|
|
649
|
+
function q(t) {
|
|
650
|
+
const e = t.loaded.tour.steps[t.index];
|
|
651
|
+
return { ...ge(t), stepId: e.id, ...oe(t) };
|
|
652
|
+
}
|
|
653
|
+
const L = (t, e) => ({ type: "emit", name: t, detail: e });
|
|
654
|
+
function Q(t, e, n) {
|
|
655
|
+
const s = { ...t, phase: "resolving", index: e, reason: n, token: t.token + 1, fieldNonEmpty: !1 };
|
|
656
|
+
return { state: s, effects: [{ type: "persist", index: e }, { type: "wait", mode: "resolve", index: e, token: s.token }] };
|
|
657
|
+
}
|
|
658
|
+
function Z(t, e, n) {
|
|
659
|
+
const i = t.loaded.applicable.findIndex((r, o) => r && o > e);
|
|
660
|
+
return i === -1 ? {
|
|
661
|
+
state: { ...z(), token: t.token + 1 },
|
|
662
|
+
effects: [L("tour-complete", { ...ge(t), total: oe(t).total }), { type: "clearPersist" }, { type: "teardown" }]
|
|
663
|
+
} : Q(t, i, n);
|
|
664
|
+
}
|
|
665
|
+
function X(t) {
|
|
666
|
+
return t.loaded.tour.steps[t.index];
|
|
667
|
+
}
|
|
668
|
+
const zn = {
|
|
669
|
+
click: "click",
|
|
670
|
+
"input-commit": "input",
|
|
671
|
+
change: "change",
|
|
672
|
+
visible: "visible"
|
|
673
|
+
};
|
|
674
|
+
function Hn(t, e) {
|
|
675
|
+
const n = { state: t, effects: [] };
|
|
676
|
+
if ("token" in e && e.token !== void 0 && e.token !== t.token) return n;
|
|
677
|
+
switch (e.type) {
|
|
678
|
+
case "REQUEST":
|
|
679
|
+
return { state: { ...z(), phase: "loading", token: t.token + 1 }, effects: [{ type: "load" }] };
|
|
680
|
+
case "LOAD_FAILED":
|
|
681
|
+
return t.phase !== "loading" ? n : {
|
|
682
|
+
state: { ...z(), token: t.token + 1 },
|
|
683
|
+
effects: [L("tour-error", e.error), { type: "clearPersist" }, { type: "teardown" }]
|
|
684
|
+
};
|
|
685
|
+
case "LOADED": {
|
|
686
|
+
if (t.phase !== "loading") return n;
|
|
687
|
+
const s = e.loaded, i = { ...t, loaded: s, index: s.start }, r = L("tour-start", {
|
|
688
|
+
...ge(i),
|
|
689
|
+
total: oe(i).total,
|
|
690
|
+
source: s.source,
|
|
691
|
+
resumed: s.resumed,
|
|
692
|
+
entryNavigated: s.navigate
|
|
693
|
+
}), o = s.resumed ? "resume" : "start";
|
|
694
|
+
if (s.navigate) {
|
|
695
|
+
const a = { ...i, phase: "entering", reason: o, token: t.token + 1 };
|
|
696
|
+
return { state: a, effects: [r, { type: "persist", index: s.start }, { type: "navigate", token: a.token }] };
|
|
697
|
+
}
|
|
698
|
+
const l = Q(i, s.start, o);
|
|
699
|
+
return { state: l.state, effects: [r, ...l.effects] };
|
|
700
|
+
}
|
|
701
|
+
case "ENTER_DONE":
|
|
702
|
+
return t.phase === "entering" ? Q(t, t.index, t.reason) : n;
|
|
703
|
+
case "ENTER_FAILED":
|
|
704
|
+
return t.phase !== "entering" ? n : {
|
|
705
|
+
state: { ...z(), token: t.token + 1 },
|
|
706
|
+
effects: [
|
|
707
|
+
L("tour-error", { reason: "entry-params", fatal: !0, message: e.message, ...ge(t) }),
|
|
708
|
+
{ type: "clearPersist" },
|
|
709
|
+
{ type: "teardown" }
|
|
710
|
+
]
|
|
711
|
+
};
|
|
712
|
+
case "RESOLVED": {
|
|
713
|
+
if (t.phase !== "resolving" && t.phase !== "fallback") return n;
|
|
714
|
+
const s = t.phase === "fallback" ? "recovered" : t.reason, i = { ...t, phase: "showing", reason: s, token: t.token + 1, fieldNonEmpty: e.fieldNonEmpty ?? !1 }, r = X(i), o = [L("tour-step", { ...q(i), advance: r.advance, reason: s })];
|
|
715
|
+
return r.advance === "manual" && o.push({ type: "focus" }), r.advance === "visible" && o.push({ type: "wait", mode: "visible", index: t.index, token: i.token }), { state: i, effects: o };
|
|
716
|
+
}
|
|
717
|
+
case "RESOLVE_TIMEOUT": {
|
|
718
|
+
const s = t.phase === "showing" && X(t).advance === "visible";
|
|
719
|
+
if (t.phase !== "resolving" && !s) return n;
|
|
720
|
+
const i = { ...t, phase: "fallback", token: t.token + 1 }, r = { ...q(i), reason: "target-timeout", fatal: !1, message: "the target did not appear in time" };
|
|
721
|
+
return {
|
|
722
|
+
state: i,
|
|
723
|
+
effects: [
|
|
724
|
+
L("tour-error", { ...r, ...e.testId ? { testId: e.testId } : {}, kind: e.kind }),
|
|
725
|
+
{ type: "wait", mode: "fallback", index: t.index, token: i.token },
|
|
726
|
+
{ type: "focus" }
|
|
727
|
+
]
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
case "TRIGGER":
|
|
731
|
+
return t.phase !== "showing" || X(t).advance !== zn[e.kind] ? n : Z(t, t.index, "advance");
|
|
732
|
+
case "NEXT": {
|
|
733
|
+
const s = e.token === void 0;
|
|
734
|
+
return t.phase === "fallback" && s ? Z(t, t.index, "skip") : t.phase !== "showing" || !s && X(t).advance === "input" && !t.fieldNonEmpty ? n : Z(t, t.index, "advance");
|
|
735
|
+
}
|
|
736
|
+
case "SKIP":
|
|
737
|
+
return t.phase === "fallback" ? Z(t, t.index, "skip") : n;
|
|
738
|
+
case "FIELD":
|
|
739
|
+
return t.phase === "showing" && t.fieldNonEmpty !== e.nonEmpty ? { state: { ...t, fieldNonEmpty: e.nonEmpty }, effects: [] } : n;
|
|
740
|
+
case "JUMP":
|
|
741
|
+
return !(t.phase === "showing" || t.phase === "lost" || t.phase === "paused" || t.phase === "fallback") || e.to <= t.index || !t.loaded.applicable[e.to] ? n : e.performed ? Z(t, e.to, "jump") : Q(t, e.to, "jump");
|
|
742
|
+
case "TARGET_LOST":
|
|
743
|
+
return t.phase !== "showing" ? n : Fn(t);
|
|
744
|
+
case "TARGET_BACK": {
|
|
745
|
+
if (t.phase !== "lost" && t.phase !== "paused") return n;
|
|
746
|
+
const s = { ...t, phase: "showing", token: t.token + 1 };
|
|
747
|
+
return t.phase === "lost" ? { state: s, effects: [] } : {
|
|
748
|
+
state: { ...s, reason: "resume" },
|
|
749
|
+
effects: [L("tour-step", { ...q(s), advance: X(s).advance, reason: "resume" })]
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
case "LOST_TIMEOUT": {
|
|
753
|
+
if (t.phase !== "lost") return n;
|
|
754
|
+
const s = { ...t, phase: "paused", token: t.token + 1 };
|
|
755
|
+
return {
|
|
756
|
+
state: s,
|
|
757
|
+
effects: [
|
|
758
|
+
L("tour-offpath", { ...q(s), reason: "target-lost" }),
|
|
759
|
+
{ type: "wait", mode: "paused", index: t.index, token: s.token }
|
|
760
|
+
]
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
case "RESUME":
|
|
764
|
+
return t.phase === "paused" ? Q(t, t.index, "resume") : n;
|
|
765
|
+
case "DISMISS": {
|
|
766
|
+
if (t.phase === "idle") return n;
|
|
767
|
+
const s = [];
|
|
768
|
+
return t.loaded && t.phase !== "loading" && s.push(L("tour-dismiss", { ...q(t), via: e.via, ...e.reason ? { reason: e.reason } : {} })), s.push({ type: "clearPersist" }, { type: "teardown" }), { state: { ...z(), token: t.token + 1 }, effects: s };
|
|
769
|
+
}
|
|
770
|
+
case "LOCALE": {
|
|
771
|
+
if (!J(t)) return n;
|
|
772
|
+
const s = t.loaded.tour.steps;
|
|
773
|
+
return e.tour.steps.length === s.length && e.tour.steps.every((r, o) => r.id === s[o].id && r.target === s[o].target && r.advance === s[o].advance) ? { state: { ...t, loaded: { ...t.loaded, tour: e.tour } }, effects: [] } : n;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
function Fn(t) {
|
|
778
|
+
const e = { ...t, phase: "lost", token: t.token + 1 };
|
|
779
|
+
return { state: e, effects: [{ type: "wait", mode: "lost", index: t.index, token: e.token }] };
|
|
780
|
+
}
|
|
781
|
+
function jn(t, e, n) {
|
|
782
|
+
t.dispatchEvent(new CustomEvent(e, { detail: n, bubbles: !0, composed: !0 }));
|
|
783
|
+
}
|
|
784
|
+
function lt() {
|
|
785
|
+
let t = document.activeElement;
|
|
786
|
+
for (; t?.shadowRoot?.activeElement; ) t = t.shadowRoot.activeElement;
|
|
787
|
+
return t;
|
|
788
|
+
}
|
|
789
|
+
function Ct(t) {
|
|
790
|
+
try {
|
|
791
|
+
return t.matches(":popover-open");
|
|
792
|
+
} catch {
|
|
793
|
+
return !1;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
function Bn(t, e) {
|
|
797
|
+
if (!(!e.supportsPopover() || Ct(t)))
|
|
798
|
+
try {
|
|
799
|
+
t.showPopover();
|
|
800
|
+
} catch {
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
function Vn(t, e) {
|
|
804
|
+
if (!e.supportsPopover()) return;
|
|
805
|
+
const n = lt();
|
|
806
|
+
try {
|
|
807
|
+
Ct(t) && t.hidePopover(), t.showPopover();
|
|
808
|
+
} catch {
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
n instanceof HTMLElement && n.isConnected && lt() !== n && n.focus({ preventScroll: !0 });
|
|
812
|
+
}
|
|
813
|
+
function Gn(t, e) {
|
|
814
|
+
return t.replace(/\{(\w+)\}/g, (n, s) => s in e ? String(e[s]) : `{${s}}`);
|
|
815
|
+
}
|
|
816
|
+
function Kn(t) {
|
|
817
|
+
return t.replace(/_/g, "-").split("-", 1)[0].toLowerCase();
|
|
818
|
+
}
|
|
819
|
+
function Ie(t, e) {
|
|
820
|
+
if (!e) return null;
|
|
821
|
+
const n = (l) => l.replace(/_/g, "-").toLowerCase(), s = [...t], i = n(e), r = s.find((l) => n(l) === i);
|
|
822
|
+
if (r !== void 0) return r;
|
|
823
|
+
const o = Kn(e);
|
|
824
|
+
return s.find((l) => n(l) === o) ?? null;
|
|
825
|
+
}
|
|
826
|
+
function Wn(t, e, n, s = "en") {
|
|
827
|
+
const i = Ie(Object.keys(t), e), r = (i !== null ? t[i] : void 0) ?? t[s], o = n ? Ie(Object.keys(n), e) : null, l = o !== null ? n[o] : void 0;
|
|
828
|
+
return l ? { ...r, ...l } : r;
|
|
829
|
+
}
|
|
830
|
+
const ce = {
|
|
831
|
+
en: { next: "Next", progress: "Step {current} of {total}" },
|
|
832
|
+
fr: { next: "Suivant", progress: "Étape {current} sur {total}" },
|
|
833
|
+
nl: { next: "Volgende", progress: "Stap {current} van {total}" },
|
|
834
|
+
de: { next: "Weiter", progress: "Schritt {current} von {total}" }
|
|
835
|
+
}, qn = 20, R = {
|
|
836
|
+
testId: new RegExp(gn),
|
|
837
|
+
stepId: new RegExp(mn),
|
|
838
|
+
tourId: new RegExp(yn),
|
|
839
|
+
attr: new RegExp(_n),
|
|
840
|
+
locale: new RegExp(vn),
|
|
841
|
+
layout: new RegExp(bn),
|
|
842
|
+
role: new RegExp(wn),
|
|
843
|
+
route: new RegExp(En),
|
|
844
|
+
media: new RegExp(An),
|
|
845
|
+
sri: new RegExp($n),
|
|
846
|
+
buildId: new RegExp(kn)
|
|
847
|
+
}, Zn = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])$/i, Xn = /%(?![0-9A-Fa-f]{2})/;
|
|
848
|
+
function Yn(t) {
|
|
849
|
+
return typeof t == "string" && t.length <= xn && R.route.test(t) && !Xn.test(t) && t.split("/").slice(1).every((e) => !/^\.\.?$/.test(e.replace(/%2e/gi, ".")));
|
|
850
|
+
}
|
|
851
|
+
function Pt(t) {
|
|
852
|
+
return typeof t == "string" && R.buildId.test(t) && !Zn.test(t.split(".")[0]);
|
|
853
|
+
}
|
|
854
|
+
function be(t) {
|
|
855
|
+
let e;
|
|
856
|
+
try {
|
|
857
|
+
e = new URL(t);
|
|
858
|
+
} catch {
|
|
859
|
+
return null;
|
|
860
|
+
}
|
|
861
|
+
return e.protocol !== "https:" && e.protocol !== "http:" || e.username || e.password ? null : e.origin;
|
|
862
|
+
}
|
|
863
|
+
class ze {
|
|
864
|
+
constructor() {
|
|
865
|
+
this.issues = [];
|
|
866
|
+
}
|
|
867
|
+
fail(e, n) {
|
|
868
|
+
this.issues.length < qn && this.issues.push({ path: e, message: n });
|
|
869
|
+
}
|
|
870
|
+
get ok() {
|
|
871
|
+
return this.issues.length === 0;
|
|
872
|
+
}
|
|
873
|
+
obj(e, n) {
|
|
874
|
+
return e !== null && typeof e == "object" && !Array.isArray(e) ? e : (this.fail(n, "must be an object"), null);
|
|
875
|
+
}
|
|
876
|
+
str(e, n, s) {
|
|
877
|
+
return typeof e != "string" ? (this.fail(n, "must be a string"), null) : s && !s.test(e) ? (this.fail(n, `does not match ${s.source}`), null) : e;
|
|
878
|
+
}
|
|
879
|
+
optStr(e, n, s) {
|
|
880
|
+
return e == null ? null : this.str(e, n, s);
|
|
881
|
+
}
|
|
882
|
+
text(e, n, s, i) {
|
|
883
|
+
if (i && e == null) return null;
|
|
884
|
+
const r = this.str(e, n);
|
|
885
|
+
return r === null ? null : (r.trim() ? [...r].length > s && this.fail(n, `is longer than ${s} characters`) : this.fail(n, "must not be empty"), r);
|
|
886
|
+
}
|
|
887
|
+
int(e, n, s, i) {
|
|
888
|
+
return typeof e == "number" && Number.isInteger(e) && e >= s && e <= i ? e : (this.fail(n, `must be an integer in ${s}..${i}`), null);
|
|
889
|
+
}
|
|
890
|
+
oneOf(e, n, s) {
|
|
891
|
+
return typeof e == "string" && s.includes(e) ? e : (this.fail(n, `must be one of ${s.join(", ")}`), null);
|
|
892
|
+
}
|
|
893
|
+
entry(e, n) {
|
|
894
|
+
if (e === null) return null;
|
|
895
|
+
const s = this.obj(e, n);
|
|
896
|
+
return s ? Yn(s.route) ? Object.freeze({ route: s.route }) : (this.fail(`${n}.route`, "is not a same-origin, base-relative route pattern"), null) : null;
|
|
897
|
+
}
|
|
898
|
+
stringMap(e, n, s) {
|
|
899
|
+
const i = {}, r = this.obj(e, n);
|
|
900
|
+
if (!r) return i;
|
|
901
|
+
for (const [o, l] of Object.entries(r)) {
|
|
902
|
+
const a = s(o, l, `${n}.${o}`);
|
|
903
|
+
a !== null && (i[o] = a);
|
|
904
|
+
}
|
|
905
|
+
return Object.freeze(i);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
function Ut(t, e, n) {
|
|
909
|
+
return e.kind !== n && t.fail("kind", `must be "${n}"`), t.ok;
|
|
910
|
+
}
|
|
911
|
+
function Ee(t) {
|
|
912
|
+
if (/^\s*</.test(t))
|
|
913
|
+
return { ok: !1, reason: "load-failed", issues: [{ path: "", message: "received HTML (missing file or SPA fallback?)" }] };
|
|
914
|
+
try {
|
|
915
|
+
return { ok: !0, value: JSON.parse(t) };
|
|
916
|
+
} catch (e) {
|
|
917
|
+
return { ok: !1, reason: "invalid-data", issues: [{ path: "", message: `not JSON: ${String(e)}` }] };
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
function Nt(t) {
|
|
921
|
+
const e = new ze(), n = e.obj(t, "");
|
|
922
|
+
if (!n) return { ok: !1, reason: "invalid-data", issues: e.issues };
|
|
923
|
+
const s = n.schema;
|
|
924
|
+
return typeof s != "number" || !Number.isInteger(s) ? { ok: !1, reason: "invalid-data", issues: [{ path: "schema", message: "must be an integer" }] } : s !== et ? {
|
|
925
|
+
ok: !1,
|
|
926
|
+
reason: "schema-unsupported",
|
|
927
|
+
issues: [{ path: "schema", message: `schema ${s} is not supported (this overlay reads ${et})` }]
|
|
928
|
+
} : { ok: !0, value: n };
|
|
929
|
+
}
|
|
930
|
+
function Jn(t) {
|
|
931
|
+
const e = Nt(t);
|
|
932
|
+
if (!e.ok) return e;
|
|
933
|
+
const n = e.value, s = new ze();
|
|
934
|
+
if (!Ut(s, n, ln)) return { ok: !1, reason: "invalid-data", issues: s.issues };
|
|
935
|
+
const i = Pt(n.buildId) ? n.buildId : (s.fail("buildId", "is not a build id"), ""), r = s.str(n.testIdAttribute, "testIdAttribute", R.attr) ?? "", o = [], l = (_) => _.replace(/_/g, "-").toLowerCase();
|
|
936
|
+
!Array.isArray(n.locales) || n.locales.length < 1 || n.locales.length > nt ? s.fail("locales", `must list 1..${nt} locales`) : n.locales.forEach((_, m) => {
|
|
937
|
+
const u = s.str(_, `locales.${m}`, R.locale);
|
|
938
|
+
u !== null && (o.some((p) => l(p) === l(u)) ? s.fail(`locales.${m}`, "is listed twice") : o.push(u));
|
|
939
|
+
});
|
|
940
|
+
const a = s.str(n.defaultLocale, "defaultLocale", R.locale) ?? "";
|
|
941
|
+
a && !o.includes(a) && s.fail("defaultLocale", "must be one of locales");
|
|
942
|
+
let f = null;
|
|
943
|
+
if (n.guideOrigin !== void 0 && n.guideOrigin !== null) {
|
|
944
|
+
const _ = s.str(n.guideOrigin, "guideOrigin");
|
|
945
|
+
_ !== null && be(_) !== _ ? s.fail("guideOrigin", "must be an origin only (scheme://host[:port])") : f = _;
|
|
946
|
+
}
|
|
947
|
+
let h = null;
|
|
948
|
+
if (n.layouts !== void 0 && n.layouts !== null) {
|
|
949
|
+
h = s.stringMap(n.layouts, "layouts", (m, u, p) => R.layout.test(m) ? typeof u != "string" || u.length > In || !R.media.test(u) ? (s.fail(p, "is not a media query"), null) : u : (s.fail(p, "is not a layout name"), null));
|
|
950
|
+
const _ = Object.keys(h).length;
|
|
951
|
+
(_ < 1 || _ > fe) && s.fail("layouts", `must map 1..${fe} layouts`);
|
|
952
|
+
}
|
|
953
|
+
const c = [], b = /* @__PURE__ */ new Set();
|
|
954
|
+
return !Array.isArray(n.tours) || n.tours.length > tt ? s.fail("tours", `must be a list of at most ${tt} tours`) : n.tours.forEach((_, m) => {
|
|
955
|
+
const u = `tours.${m}`, p = s.obj(_, u);
|
|
956
|
+
if (!p) return;
|
|
957
|
+
const v = s.str(p.id, `${u}.id`, R.tourId);
|
|
958
|
+
v !== null && (b.has(v.toLowerCase()) && s.fail(`${u}.id`, "is not unique"), b.add(v.toLowerCase()));
|
|
959
|
+
const g = (E, k) => o.includes(E) || (s.fail(k, "is not one of locales"), !1), d = s.stringMap(
|
|
960
|
+
p.files,
|
|
961
|
+
`${u}.files`,
|
|
962
|
+
(E, k, S) => g(E, S) ? k !== `${v}.${E}.json` ? (s.fail(S, `must be "${v}.${E}.json"`), null) : k : null
|
|
963
|
+
);
|
|
964
|
+
a && !Object.hasOwn(d, a) && s.fail(`${u}.files`, "has no file for the default locale");
|
|
965
|
+
const w = s.stringMap(p.title, `${u}.title`, (E, k, S) => g(E, S) ? s.text(k, S, Se, !1) : null), y = s.stringMap(
|
|
966
|
+
p.integrity,
|
|
967
|
+
`${u}.integrity`,
|
|
968
|
+
(E, k, S) => Object.hasOwn(d, E) ? s.str(k, S, R.sri) : (s.fail(S, "has no matching file"), null)
|
|
969
|
+
);
|
|
970
|
+
for (const E in d) Object.hasOwn(y, E) || s.fail(`${u}.integrity`, `has no hash for "${E}"`);
|
|
971
|
+
const $ = Object.freeze({
|
|
972
|
+
id: v ?? "",
|
|
973
|
+
role: s.str(p.role, `${u}.role`, R.role) ?? "",
|
|
974
|
+
title: w,
|
|
975
|
+
entry: s.entry(p.entry, `${u}.entry`),
|
|
976
|
+
steps: s.int(p.steps, `${u}.steps`, 1, Lt) ?? 0,
|
|
977
|
+
files: d,
|
|
978
|
+
integrity: y
|
|
979
|
+
});
|
|
980
|
+
c.push($);
|
|
981
|
+
}), s.ok ? {
|
|
982
|
+
ok: !0,
|
|
983
|
+
value: Object.freeze({
|
|
984
|
+
buildId: i,
|
|
985
|
+
defaultLocale: a,
|
|
986
|
+
locales: Object.freeze(o),
|
|
987
|
+
testIdAttribute: r,
|
|
988
|
+
guideOrigin: f,
|
|
989
|
+
layouts: h,
|
|
990
|
+
tours: Object.freeze(c)
|
|
991
|
+
})
|
|
992
|
+
} : { ok: !1, reason: "invalid-data", issues: s.issues };
|
|
993
|
+
}
|
|
994
|
+
function Qn(t, e) {
|
|
995
|
+
const n = Nt(t);
|
|
996
|
+
if (!n.ok) return n;
|
|
997
|
+
const s = n.value, i = new ze();
|
|
998
|
+
if (!Ut(i, s, cn)) return { ok: !1, reason: "invalid-data", issues: i.issues };
|
|
999
|
+
const { manifest: r, entry: o } = e;
|
|
1000
|
+
s.id !== o.id && i.fail("id", `must be "${o.id}"`), (!Pt(s.buildId) || s.buildId !== r.buildId) && i.fail("buildId", `must be the manifest's "${r.buildId}"`), s.locale !== e.locale && i.fail("locale", `must be "${e.locale}"`);
|
|
1001
|
+
const l = i.text(s.title, "title", Se, !1) ?? "";
|
|
1002
|
+
let a = null;
|
|
1003
|
+
if (s.guideUrl !== void 0 && s.guideUrl !== null) {
|
|
1004
|
+
const _ = i.str(s.guideUrl, "guideUrl");
|
|
1005
|
+
if (_ !== null) {
|
|
1006
|
+
const m = _.length <= Tn ? be(_) : null;
|
|
1007
|
+
m === null || e.guideOrigin === null || m !== e.guideOrigin ? i.fail("guideUrl", "must be an http(s) URL on the trusted guide origin") : a = _;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
const f = s.entry === void 0 ? (i.fail("entry", "is required (null for none)"), null) : i.entry(s.entry, "entry");
|
|
1011
|
+
(f?.route ?? null) !== (o.entry?.route ?? null) && i.fail("entry", "must equal the manifest's entry");
|
|
1012
|
+
const h = [], c = /* @__PURE__ */ new Set(), b = Object.keys(r.layouts ?? {});
|
|
1013
|
+
return !Array.isArray(s.steps) || s.steps.length !== o.steps || s.steps.length > Lt ? i.fail("steps", `must be a list of exactly ${o.steps} steps`) : s.steps.forEach((_, m) => {
|
|
1014
|
+
const u = `steps.${m}`, p = i.obj(_, u);
|
|
1015
|
+
if (!p) return;
|
|
1016
|
+
const v = i.str(p.id, `${u}.id`, R.stepId) ?? "";
|
|
1017
|
+
c.has(v) && i.fail(`${u}.id`, "is not unique"), c.add(v);
|
|
1018
|
+
const g = p.target === null ? null : i.str(p.target, `${u}.target`, R.testId), d = i.obj(p.advance, `${u}.advance`), w = d ? i.oneOf(d.on, `${u}.advance.on`, hn) : null;
|
|
1019
|
+
w && pn.includes(w) && g === null && i.fail(`${u}.target`, `is required for advance "${w}"`);
|
|
1020
|
+
let y = null;
|
|
1021
|
+
p.layouts !== void 0 && p.layouts !== null && (!Array.isArray(p.layouts) || p.layouts.length < 1 || p.layouts.length > fe ? i.fail(`${u}.layouts`, `must list 1..${fe} layouts`) : (y = p.layouts.filter(($) => typeof $ == "string" && b.includes($)), y.length !== p.layouts.length && i.fail(`${u}.layouts`, "must name the manifest's layouts"))), h.push(
|
|
1022
|
+
Object.freeze({
|
|
1023
|
+
id: v,
|
|
1024
|
+
target: g,
|
|
1025
|
+
advance: w ?? "manual",
|
|
1026
|
+
waitFor: i.optStr(p.waitFor, `${u}.waitFor`, R.testId),
|
|
1027
|
+
title: i.text(p.title, `${u}.title`, Se, !0),
|
|
1028
|
+
text: i.text(p.text, `${u}.text`, Sn, !0),
|
|
1029
|
+
placement: p.placement === void 0 || p.placement === null ? null : i.oneOf(p.placement, `${u}.placement`, fn),
|
|
1030
|
+
layouts: y && Object.freeze(y)
|
|
1031
|
+
})
|
|
1032
|
+
);
|
|
1033
|
+
}), i.ok ? {
|
|
1034
|
+
ok: !0,
|
|
1035
|
+
value: Object.freeze({
|
|
1036
|
+
id: o.id,
|
|
1037
|
+
buildId: r.buildId,
|
|
1038
|
+
locale: e.locale,
|
|
1039
|
+
title: l,
|
|
1040
|
+
guideUrl: a,
|
|
1041
|
+
entry: f,
|
|
1042
|
+
steps: Object.freeze(h)
|
|
1043
|
+
})
|
|
1044
|
+
} : { ok: !1, reason: "invalid-data", issues: i.issues };
|
|
1045
|
+
}
|
|
1046
|
+
const ct = { "load-failed": 0, "invalid-data": 1, "schema-unsupported": 2 };
|
|
1047
|
+
class O extends Error {
|
|
1048
|
+
constructor(e, n) {
|
|
1049
|
+
super(n), this.reason = e;
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
function es(t, e, n) {
|
|
1053
|
+
return Ie(t, e) ?? (t.includes(n) ? n : t[0]);
|
|
1054
|
+
}
|
|
1055
|
+
async function ut(t, e) {
|
|
1056
|
+
if (!t.ok) throw new O("load-failed", `HTTP ${t.status}`);
|
|
1057
|
+
if (Number(t.headers.get("content-length") ?? NaN) > e) throw new O("invalid-data", `the file is larger than ${e} bytes`);
|
|
1058
|
+
const s = new TextDecoder("utf-8", { fatal: !0 }), i = (h) => {
|
|
1059
|
+
try {
|
|
1060
|
+
return s.decode(h);
|
|
1061
|
+
} catch {
|
|
1062
|
+
throw new O("invalid-data", "the file is not valid UTF-8");
|
|
1063
|
+
}
|
|
1064
|
+
};
|
|
1065
|
+
if (!t.body) {
|
|
1066
|
+
const h = new Uint8Array(await t.arrayBuffer());
|
|
1067
|
+
if (h.byteLength > e) throw new O("invalid-data", `the file is larger than ${e} bytes`);
|
|
1068
|
+
return i(h);
|
|
1069
|
+
}
|
|
1070
|
+
const r = t.body.getReader(), o = [];
|
|
1071
|
+
let l = 0;
|
|
1072
|
+
for (; ; ) {
|
|
1073
|
+
const { done: h, value: c } = await r.read();
|
|
1074
|
+
if (h) break;
|
|
1075
|
+
if (l += c.byteLength, l > e)
|
|
1076
|
+
throw r.cancel(), new O("invalid-data", `the file is larger than ${e} bytes`);
|
|
1077
|
+
o.push(c);
|
|
1078
|
+
}
|
|
1079
|
+
const a = new Uint8Array(l);
|
|
1080
|
+
let f = 0;
|
|
1081
|
+
for (const h of o)
|
|
1082
|
+
a.set(h, f), f += h.byteLength;
|
|
1083
|
+
return i(a);
|
|
1084
|
+
}
|
|
1085
|
+
async function dt(t, e) {
|
|
1086
|
+
const n = t.origin ?? location.origin, s = t.baseURI ?? document.baseURI, i = t.fetch ?? globalThis.fetch.bind(globalThis), r = t.cache ?? /* @__PURE__ */ new Map(), o = (g) => new URL(g, s), l = (g) => o(g).origin !== n, a = t.timeoutMs ?? 1e4;
|
|
1087
|
+
async function f(g, d, w) {
|
|
1088
|
+
const y = l(g), $ = new AbortController(), E = setTimeout(() => $.abort(), a);
|
|
1089
|
+
try {
|
|
1090
|
+
const k = {
|
|
1091
|
+
credentials: y ? "omit" : "same-origin",
|
|
1092
|
+
mode: y ? "cors" : "same-origin",
|
|
1093
|
+
redirect: y ? "error" : "follow",
|
|
1094
|
+
cache: d === "manifest" || !y ? "no-cache" : "default",
|
|
1095
|
+
signal: $.signal
|
|
1096
|
+
};
|
|
1097
|
+
w && (k.integrity = w);
|
|
1098
|
+
let S;
|
|
1099
|
+
try {
|
|
1100
|
+
S = await i(o(g).href, k);
|
|
1101
|
+
} catch (x) {
|
|
1102
|
+
throw new O("load-failed", `could not fetch ${g}: ${String(x)}`);
|
|
1103
|
+
}
|
|
1104
|
+
return await ut(S, d === "manifest" ? Rn : $e);
|
|
1105
|
+
} finally {
|
|
1106
|
+
clearTimeout(E);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
function h(g) {
|
|
1110
|
+
const d = o(g).href;
|
|
1111
|
+
let w = r.get(d);
|
|
1112
|
+
return w || (w = (async () => {
|
|
1113
|
+
try {
|
|
1114
|
+
const y = Ee(await f(g, "manifest"));
|
|
1115
|
+
return { ...y.ok ? Jn(y.value) : y, url: d };
|
|
1116
|
+
} catch (y) {
|
|
1117
|
+
const $ = y instanceof O ? y : new O("load-failed", String(y));
|
|
1118
|
+
return $.reason === "load-failed" && r.delete(d), { ok: !1, reason: $.reason, message: $.message, url: d };
|
|
1119
|
+
}
|
|
1120
|
+
})(), r.set(d, w)), w;
|
|
1121
|
+
}
|
|
1122
|
+
const c = [], b = (g, d) => c.push({ ok: !1, reason: g.reason, message: g.message ?? `${d}: ${g.issues?.[0]?.path ?? ""} ${g.issues?.[0]?.message ?? ""}`.trim(), issues: g.issues });
|
|
1123
|
+
let _ = null;
|
|
1124
|
+
if (t.fallbackManifest)
|
|
1125
|
+
if (l(t.fallbackManifest))
|
|
1126
|
+
c.push({ ok: !1, reason: "load-failed", message: "fallbackManifest must be same-origin" });
|
|
1127
|
+
else {
|
|
1128
|
+
const g = await h(t.fallbackManifest);
|
|
1129
|
+
g.ok ? _ = { ...g.value, url: g.url } : b(g, "bundled manifest");
|
|
1130
|
+
}
|
|
1131
|
+
const m = t.buildId || _?.buildId || "";
|
|
1132
|
+
let u = null;
|
|
1133
|
+
if (t.manifest)
|
|
1134
|
+
if (t.manifest.includes("{buildId}") && !m)
|
|
1135
|
+
c.push({ ok: !1, reason: "load-failed", message: "the manifest URL needs a build id ({buildId}) and none is known" });
|
|
1136
|
+
else {
|
|
1137
|
+
const g = await h(t.manifest.split("{buildId}").join(encodeURIComponent(m)));
|
|
1138
|
+
g.ok ? m && g.value.buildId !== m ? c.push({ ok: !1, reason: "invalid-data", message: `the manifest is for build "${g.value.buildId}", expected "${m}"` }) : u = { ...g.value, url: g.url } : b(g, "manifest"), !g.ok && _ && console.warn(`[steppy-tour] remote manifest unavailable, using the bundled copy: ${c.at(-1)?.message}`);
|
|
1139
|
+
}
|
|
1140
|
+
if (!t.manifest && !t.fallbackManifest)
|
|
1141
|
+
return { ok: !1, reason: "load-failed", message: "no manifest is configured (set manifest or fallback-manifest)" };
|
|
1142
|
+
const p = u ? new URL(u.url).origin : null, v = t.guideOrigin && (be(t.guideOrigin) ?? t.guideOrigin) || _?.guideOrigin || (u && (!l(u.url) || u.guideOrigin === p) ? u.guideOrigin : null);
|
|
1143
|
+
for (const g of [u, _]) {
|
|
1144
|
+
if (!g) continue;
|
|
1145
|
+
const d = g !== _ && _?.buildId === g.buildId ? _ : g, w = d.tours.find((y) => y.id === e);
|
|
1146
|
+
if (!w)
|
|
1147
|
+
c.push({ ok: !1, reason: "load-failed", message: `no tour "${e}" in ${d.url}` });
|
|
1148
|
+
else {
|
|
1149
|
+
const y = es(Object.keys(w.files), t.locale, d.defaultLocale), $ = l(g.url), E = d !== g || $ ? w.integrity[y] : void 0;
|
|
1150
|
+
try {
|
|
1151
|
+
let k;
|
|
1152
|
+
if (t.source) {
|
|
1153
|
+
const x = await t.source(e, y, { buildId: g.buildId, manifestUrl: g.url });
|
|
1154
|
+
if (typeof x == "string" || x instanceof Response) {
|
|
1155
|
+
const K = typeof x == "string" ? x : await ut(x, $e);
|
|
1156
|
+
if (new TextEncoder().encode(K).byteLength > $e) throw new O("invalid-data", "the tour file is too large");
|
|
1157
|
+
const le = Ee(K);
|
|
1158
|
+
if (!le.ok) throw new O(le.reason, le.issues[0]?.message ?? "");
|
|
1159
|
+
k = le.value;
|
|
1160
|
+
} else k = x;
|
|
1161
|
+
} else {
|
|
1162
|
+
const x = Ee(await f(new URL(w.files[y], g.url).href, "tour", E));
|
|
1163
|
+
if (!x.ok) throw new O(x.reason, x.issues[0]?.message ?? "");
|
|
1164
|
+
k = x.value;
|
|
1165
|
+
}
|
|
1166
|
+
const S = Qn(k, { manifest: d, entry: w, locale: y, guideOrigin: v });
|
|
1167
|
+
if (S.ok)
|
|
1168
|
+
return {
|
|
1169
|
+
ok: !0,
|
|
1170
|
+
manifest: d,
|
|
1171
|
+
manifestUrl: g.url,
|
|
1172
|
+
tour: S.value,
|
|
1173
|
+
locale: y,
|
|
1174
|
+
source: t.source ? "custom" : g === u && $ ? "remote" : "bundled",
|
|
1175
|
+
testIdAttribute: _?.testIdAttribute ?? g.testIdAttribute,
|
|
1176
|
+
guideOrigin: v
|
|
1177
|
+
};
|
|
1178
|
+
b(S, `tour ${e} (${y})`);
|
|
1179
|
+
} catch (k) {
|
|
1180
|
+
const S = k instanceof O ? k : new O("load-failed", String(k));
|
|
1181
|
+
c.push({ ok: !1, reason: S.reason, message: S.message });
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
g === u && _ && console.warn(`[steppy-tour] remote tour rejected, trying the bundled copy: ${c.at(-1)?.message}`);
|
|
1185
|
+
}
|
|
1186
|
+
return c.reduce((g, d) => ct[d.reason] > ct[g.reason] ? d : g, c[0] ?? {
|
|
1187
|
+
ok: !1,
|
|
1188
|
+
reason: "load-failed",
|
|
1189
|
+
message: `tour "${e}" could not be loaded`
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
const ts = 250, ns = 500;
|
|
1193
|
+
function ss(t) {
|
|
1194
|
+
const { attr: e, host: n, dom: s } = t, i = s.scheduler;
|
|
1195
|
+
function r(l) {
|
|
1196
|
+
const a = `[${e}="${CSS.escape(l)}"]`, f = document.querySelectorAll(a);
|
|
1197
|
+
for (let h = 0; h < f.length && h < ns; h++) {
|
|
1198
|
+
const c = f[h];
|
|
1199
|
+
if (!(c === n || n.contains(c)) && s.isVisible(c))
|
|
1200
|
+
return c;
|
|
1201
|
+
}
|
|
1202
|
+
return null;
|
|
1203
|
+
}
|
|
1204
|
+
function o(l) {
|
|
1205
|
+
let a = !1, f = 0, h = document.hidden ? i.now() : null, c = 0;
|
|
1206
|
+
const b = i.now(), _ = [e, "class", "style", "hidden", "open", "aria-hidden", "aria-expanded"], m = () => {
|
|
1207
|
+
if (f = 0, a) return !0;
|
|
1208
|
+
const w = /* @__PURE__ */ new Map();
|
|
1209
|
+
let y = null;
|
|
1210
|
+
for (const $ of l.ids) {
|
|
1211
|
+
const E = r($);
|
|
1212
|
+
E ? w.set($, E) : y === null && (y = $);
|
|
1213
|
+
}
|
|
1214
|
+
if (y === null)
|
|
1215
|
+
return d(), l.onFound(w), !0;
|
|
1216
|
+
if (l.timeoutMs !== null) {
|
|
1217
|
+
const $ = h !== null ? i.now() - h : 0;
|
|
1218
|
+
if (h === null && i.now() - b - c - $ >= l.timeoutMs)
|
|
1219
|
+
return d(), l.onTimeout(y), !0;
|
|
1220
|
+
}
|
|
1221
|
+
return !1;
|
|
1222
|
+
}, u = () => {
|
|
1223
|
+
!f && !a && (f = i.raf(m));
|
|
1224
|
+
}, p = () => {
|
|
1225
|
+
document.hidden ? h ??= i.now() : h !== null && (c += i.now() - h, h = null);
|
|
1226
|
+
}, v = new MutationObserver(u), g = i.setInterval(() => m(), ts);
|
|
1227
|
+
function d() {
|
|
1228
|
+
a = !0, v.disconnect(), i.clearInterval(g), f && i.cancelRaf(f), document.removeEventListener("visibilitychange", p);
|
|
1229
|
+
}
|
|
1230
|
+
return m() || (v.observe(document.documentElement, { childList: !0, subtree: !0, attributes: !0, attributeFilter: _ }), document.addEventListener("visibilitychange", p)), d;
|
|
1231
|
+
}
|
|
1232
|
+
return { find: r, wait: o };
|
|
1233
|
+
}
|
|
1234
|
+
const He = /^:([A-Za-z_][A-Za-z0-9_]{0,63})$/;
|
|
1235
|
+
function me(t) {
|
|
1236
|
+
const e = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
1237
|
+
return e === "/" ? [] : e.split("/").slice(1);
|
|
1238
|
+
}
|
|
1239
|
+
function ht(t, e) {
|
|
1240
|
+
const n = me(t), s = me(e);
|
|
1241
|
+
if (n.length !== s.length) return null;
|
|
1242
|
+
const i = {};
|
|
1243
|
+
for (let r = 0; r < n.length; r++) {
|
|
1244
|
+
const o = He.exec(n[r]);
|
|
1245
|
+
if (!o) {
|
|
1246
|
+
if (n[r] !== s[r]) return null;
|
|
1247
|
+
continue;
|
|
1248
|
+
}
|
|
1249
|
+
if (!s[r]) return null;
|
|
1250
|
+
try {
|
|
1251
|
+
i[o[1]] = decodeURIComponent(s[r]);
|
|
1252
|
+
} catch {
|
|
1253
|
+
return null;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
return i;
|
|
1257
|
+
}
|
|
1258
|
+
function is(t) {
|
|
1259
|
+
return me(t).flatMap((e) => {
|
|
1260
|
+
const n = He.exec(e);
|
|
1261
|
+
return n ? [n[1]] : [];
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
function rs(t, e) {
|
|
1265
|
+
const n = is(t).filter((i) => e[i] === void 0 || e[i] === null || String(e[i]) === "");
|
|
1266
|
+
return n.length ? { missing: n } : { path: `/${me(t).map((i) => {
|
|
1267
|
+
const r = He.exec(i);
|
|
1268
|
+
return r ? encodeURIComponent(String(e[r[1]])) : i;
|
|
1269
|
+
}).join("/")}` };
|
|
1270
|
+
}
|
|
1271
|
+
function pt(t, e) {
|
|
1272
|
+
try {
|
|
1273
|
+
const n = new URL(t);
|
|
1274
|
+
return n.origin !== e ? "/" : (n.pathname.endsWith("/") ? n.pathname : n.pathname.replace(/[^/]*$/, "")) || "/";
|
|
1275
|
+
} catch {
|
|
1276
|
+
return "/";
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
function Ae(t, e) {
|
|
1280
|
+
if (e === "/" || !t.startsWith(e.slice(0, -1))) return t;
|
|
1281
|
+
const n = t.slice(e.length - 1);
|
|
1282
|
+
return n !== "" && !n.startsWith("/") ? t : n || "/";
|
|
1283
|
+
}
|
|
1284
|
+
function Dt(t, e) {
|
|
1285
|
+
return e === "/" ? t : e.slice(0, -1) + t;
|
|
1286
|
+
}
|
|
1287
|
+
function ft(t) {
|
|
1288
|
+
return /^\/(?![/\\])/.test(t) && !/[\\\s\u0000-\u001f\u007f]/.test(t);
|
|
1289
|
+
}
|
|
1290
|
+
function os(t, e, n) {
|
|
1291
|
+
if (!ft(t)) return null;
|
|
1292
|
+
try {
|
|
1293
|
+
const s = new URL(t, n), i = Dt(s.pathname, e) + s.search + s.hash;
|
|
1294
|
+
return ft(i) && new URL(i, n).origin === n ? i : null;
|
|
1295
|
+
} catch {
|
|
1296
|
+
return null;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
const Re = "input,select,textarea", gt = "[aria-checked],[aria-pressed],[aria-selected]", mt = 50;
|
|
1300
|
+
function as(t) {
|
|
1301
|
+
return t instanceof HTMLInputElement ? t.type === "checkbox" || t.type === "radio" ? `c:${t.checked}` : t.type === "file" ? `f:${t.files?.length ?? 0}` : `v:${t.value}` : t instanceof HTMLSelectElement ? `s:${t.multiple ? [...t.options].filter((e) => e.selected).map((e) => e.value).join("|") : t.value}` : t instanceof HTMLTextAreaElement ? `v:${t.value}` : "";
|
|
1302
|
+
}
|
|
1303
|
+
function ls(t) {
|
|
1304
|
+
const e = [...t.matches(Re) ? [t] : [], ...[...t.querySelectorAll(Re)].slice(0, mt)], n = [...t.matches(gt) ? [t] : [], ...[...t.querySelectorAll(gt)].slice(0, mt)].map(
|
|
1305
|
+
(i) => `a:${i.getAttribute("aria-checked") ?? ""}${i.getAttribute("aria-pressed") ?? ""}${i.getAttribute("aria-selected") ?? ""}`
|
|
1306
|
+
), s = `t:${(t.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 500)}`;
|
|
1307
|
+
return [...e.map(as), ...n, s].join("");
|
|
1308
|
+
}
|
|
1309
|
+
function Fe(t) {
|
|
1310
|
+
return t.matches('[aria-expanded="true"]') || t.querySelector('[aria-expanded="true"]') !== null;
|
|
1311
|
+
}
|
|
1312
|
+
function _t(t) {
|
|
1313
|
+
if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) return t.value;
|
|
1314
|
+
const e = t.getAttribute("contenteditable");
|
|
1315
|
+
return t instanceof HTMLElement && (t.isContentEditable || e !== null && e !== "false") ? t.textContent ?? "" : null;
|
|
1316
|
+
}
|
|
1317
|
+
function Oe(t) {
|
|
1318
|
+
const e = _t(t);
|
|
1319
|
+
if (e !== null) return e;
|
|
1320
|
+
const n = t.querySelector(`${Re},[contenteditable]:not([contenteditable="false"])`);
|
|
1321
|
+
return (n && _t(n)) ?? "";
|
|
1322
|
+
}
|
|
1323
|
+
function cs(t) {
|
|
1324
|
+
const e = 'select,[role=combobox],[aria-haspopup]:not([aria-haspopup="false"])';
|
|
1325
|
+
return t.matches(e) || t.querySelector(e) !== null;
|
|
1326
|
+
}
|
|
1327
|
+
const us = 30 * 60 * 1e3;
|
|
1328
|
+
function je() {
|
|
1329
|
+
try {
|
|
1330
|
+
return globalThis.sessionStorage ?? null;
|
|
1331
|
+
} catch {
|
|
1332
|
+
return null;
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
function ds(t) {
|
|
1336
|
+
try {
|
|
1337
|
+
je()?.setItem(De, JSON.stringify(t));
|
|
1338
|
+
} catch {
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
function he() {
|
|
1342
|
+
try {
|
|
1343
|
+
je()?.removeItem(De);
|
|
1344
|
+
} catch {
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
function hs(t, e) {
|
|
1348
|
+
let n = null;
|
|
1349
|
+
try {
|
|
1350
|
+
n = je()?.getItem(De) ?? null;
|
|
1351
|
+
} catch {
|
|
1352
|
+
return null;
|
|
1353
|
+
}
|
|
1354
|
+
if (!n) return null;
|
|
1355
|
+
let s = null;
|
|
1356
|
+
try {
|
|
1357
|
+
s = JSON.parse(n);
|
|
1358
|
+
} catch {
|
|
1359
|
+
}
|
|
1360
|
+
const i = typeof s?.savedAt == "number" && e - s.savedAt >= 0 && e - s.savedAt < us;
|
|
1361
|
+
return !(s !== null && typeof s == "object" && s.v === 1 && typeof s.tourId == "string" && typeof s.stepId == "string" && typeof s.locale == "string" && typeof s.buildId == "string" && s.params !== null && typeof s.params == "object" && Object.values(s.params).every((o) => typeof o == "string")) || !i ? (he(), null) : s.manifestKey === t ? s : null;
|
|
1362
|
+
}
|
|
1363
|
+
const ps = {
|
|
1364
|
+
en: {
|
|
1365
|
+
...ce.en,
|
|
1366
|
+
done: "Done",
|
|
1367
|
+
close: "Close the tour",
|
|
1368
|
+
skipStep: "Skip this step",
|
|
1369
|
+
endTour: "End the tour",
|
|
1370
|
+
resume: "Resume tour",
|
|
1371
|
+
paused: "Tour paused",
|
|
1372
|
+
dialogLabel: "Guided tour",
|
|
1373
|
+
openGuide: "Open the full guide",
|
|
1374
|
+
notFoundTitle: "Can't find this element",
|
|
1375
|
+
notFoundBody: "The page may have changed. Skip this step or end the tour.",
|
|
1376
|
+
instructionClick: "Click the highlighted element.",
|
|
1377
|
+
instructionInput: "Fill in the highlighted field.",
|
|
1378
|
+
instructionChange: "Choose a value in the highlighted field.",
|
|
1379
|
+
instructionVisible: "Wait for the highlighted element to appear.",
|
|
1380
|
+
instructionManual: "Select Next to continue."
|
|
1381
|
+
},
|
|
1382
|
+
fr: {
|
|
1383
|
+
...ce.fr,
|
|
1384
|
+
done: "Terminer",
|
|
1385
|
+
close: "Fermer la visite",
|
|
1386
|
+
skipStep: "Passer cette étape",
|
|
1387
|
+
endTour: "Terminer la visite",
|
|
1388
|
+
resume: "Reprendre la visite",
|
|
1389
|
+
paused: "Visite en pause",
|
|
1390
|
+
dialogLabel: "Visite guidée",
|
|
1391
|
+
openGuide: "Ouvrir le guide complet",
|
|
1392
|
+
notFoundTitle: "Élément introuvable",
|
|
1393
|
+
notFoundBody: "La page a peut-être changé. Passez cette étape ou terminez la visite.",
|
|
1394
|
+
instructionClick: "Cliquez sur l'élément mis en évidence.",
|
|
1395
|
+
instructionInput: "Remplissez le champ mis en évidence.",
|
|
1396
|
+
instructionChange: "Choisissez une valeur dans le champ mis en évidence.",
|
|
1397
|
+
instructionVisible: "Attendez que l'élément mis en évidence apparaisse.",
|
|
1398
|
+
instructionManual: "Sélectionnez Suivant pour continuer."
|
|
1399
|
+
},
|
|
1400
|
+
nl: {
|
|
1401
|
+
...ce.nl,
|
|
1402
|
+
done: "Klaar",
|
|
1403
|
+
close: "Rondleiding sluiten",
|
|
1404
|
+
skipStep: "Deze stap overslaan",
|
|
1405
|
+
endTour: "Rondleiding beëindigen",
|
|
1406
|
+
resume: "Rondleiding hervatten",
|
|
1407
|
+
paused: "Rondleiding gepauzeerd",
|
|
1408
|
+
dialogLabel: "Rondleiding",
|
|
1409
|
+
openGuide: "Volledige gids openen",
|
|
1410
|
+
notFoundTitle: "Dit element is niet gevonden",
|
|
1411
|
+
notFoundBody: "De pagina is mogelijk gewijzigd. Sla deze stap over of beëindig de rondleiding.",
|
|
1412
|
+
instructionClick: "Klik op het gemarkeerde element.",
|
|
1413
|
+
instructionInput: "Vul het gemarkeerde veld in.",
|
|
1414
|
+
instructionChange: "Kies een waarde in het gemarkeerde veld.",
|
|
1415
|
+
instructionVisible: "Wacht tot het gemarkeerde element verschijnt.",
|
|
1416
|
+
instructionManual: "Kies Volgende om verder te gaan."
|
|
1417
|
+
},
|
|
1418
|
+
de: {
|
|
1419
|
+
...ce.de,
|
|
1420
|
+
done: "Fertig",
|
|
1421
|
+
close: "Tour schließen",
|
|
1422
|
+
skipStep: "Diesen Schritt überspringen",
|
|
1423
|
+
endTour: "Tour beenden",
|
|
1424
|
+
resume: "Tour fortsetzen",
|
|
1425
|
+
paused: "Tour pausiert",
|
|
1426
|
+
dialogLabel: "Geführte Tour",
|
|
1427
|
+
openGuide: "Vollständige Anleitung öffnen",
|
|
1428
|
+
notFoundTitle: "Element nicht gefunden",
|
|
1429
|
+
notFoundBody: "Die Seite hat sich möglicherweise geändert. Überspringen Sie diesen Schritt oder beenden Sie die Tour.",
|
|
1430
|
+
instructionClick: "Klicken Sie auf das hervorgehobene Element.",
|
|
1431
|
+
instructionInput: "Füllen Sie das hervorgehobene Feld aus.",
|
|
1432
|
+
instructionChange: "Wählen Sie im hervorgehobenen Feld einen Wert aus.",
|
|
1433
|
+
instructionVisible: "Warten Sie, bis das hervorgehobene Element erscheint.",
|
|
1434
|
+
instructionManual: "Wählen Sie Weiter, um fortzufahren."
|
|
1435
|
+
}
|
|
1436
|
+
};
|
|
1437
|
+
function yt(t, e) {
|
|
1438
|
+
return Wn(ps, t, e, "en");
|
|
1439
|
+
}
|
|
1440
|
+
function fs(t) {
|
|
1441
|
+
const [e, n = ""] = t.toLowerCase().split(/[-_]/);
|
|
1442
|
+
return (/^[a-z]{4}$/.test(n) ? /^(arab|hebr|thaa|syrc|nkoo|adlm|rohg)$/.test(n) : /^(ar|he|iw|fa|ur|ps|sd|ug|yi|ckb|dv)$/.test(e)) ? "rtl" : "ltr";
|
|
1443
|
+
}
|
|
1444
|
+
const gs = {
|
|
1445
|
+
click: "instructionClick",
|
|
1446
|
+
input: "instructionInput",
|
|
1447
|
+
change: "instructionChange",
|
|
1448
|
+
visible: "instructionVisible",
|
|
1449
|
+
manual: "instructionManual"
|
|
1450
|
+
};
|
|
1451
|
+
function ms(t, e) {
|
|
1452
|
+
return e[gs[t]];
|
|
1453
|
+
}
|
|
1454
|
+
const bt = {
|
|
1455
|
+
surface: "#fbf9f4",
|
|
1456
|
+
fg: "#1f1d1a"
|
|
1457
|
+
}, N = {
|
|
1458
|
+
padding: "8px 12px",
|
|
1459
|
+
radius: "6px",
|
|
1460
|
+
fontSize: "14px",
|
|
1461
|
+
lineHeight: "1.4",
|
|
1462
|
+
shadow: "0 4px 12px rgba(0, 0, 0, 0.2)"
|
|
1463
|
+
}, wt = {
|
|
1464
|
+
radius: "4px",
|
|
1465
|
+
padding: "4px 10px"
|
|
1466
|
+
}, M = {
|
|
1467
|
+
bubbleBg: bt.fg,
|
|
1468
|
+
bubbleFg: bt.surface,
|
|
1469
|
+
muted: "#c9c5bd",
|
|
1470
|
+
accent: "#a8410e",
|
|
1471
|
+
accentFg: "#ffffff",
|
|
1472
|
+
focus: "#f09a6a",
|
|
1473
|
+
scrim: "rgba(31, 29, 26, 0.45)",
|
|
1474
|
+
radius: N.radius
|
|
1475
|
+
}, T = (t) => St(t), _s = zt` :host{display:contents;--_pw-bg:var(--steppy-tour-bubble-bg,var(--steppy-tooltip-bg,${T(M.bubbleBg)}));--_pw-fg:var(--steppy-tour-bubble-fg,var(--steppy-tooltip-fg,${T(M.bubbleFg)}));--_pw-muted:var(--steppy-tour-muted,${T(M.muted)});--_pw-accent:var(--steppy-tour-accent,${T(M.accent)});--_pw-accent-fg:var(--steppy-tour-accent-fg,${T(M.accentFg)});--_pw-focus:var(--steppy-tour-focus,${T(M.focus)});--_pw-scrim:var(--steppy-tour-scrim,${T(M.scrim)});--_pw-radius:var(--steppy-tour-radius,${T(M.radius)})}.layer{position:fixed;inset:0;width:auto;height:auto;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:inherit;overflow:visible;pointer-events:none;z-index:var(--_pw-z,2147483000)}.layer::backdrop{pointer-events:none;background:transparent}.spotlight{position:absolute;left:var(--_pw-sx,0);top:var(--_pw-sy,0);width:var(--_pw-sw,0);height:var(--_pw-sh,0);border-radius:var(--_pw-radius);box-shadow:0 0 0 2px var(--_pw-accent),0 0 0 max(100vw,100vh) var(--_pw-scrim);pointer-events:none;transition:left 0.15s ease,top 0.15s ease,width 0.15s ease,height 0.15s ease}.bubble{position:absolute;box-sizing:border-box;width:min(320px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;padding:${T(N.padding)};border-radius:var(--_pw-radius);background:var(--_pw-bg);color:var(--_pw-fg);box-shadow:${T(N.shadow)};font-family:var(--steppy-font-family,inherit);font-size:${T(N.fontSize)};line-height:${T(N.lineHeight)};pointer-events:auto;visibility:hidden;outline:none}.bubble[data-placed]{visibility:visible}.bubble[data-mode='anchored']{left:var(--_pw-x,0);top:var(--_pw-y,0)}.bubble[data-mode='centered']{left:50%;top:50%;transform:translate(-50%,-50%)}.bubble[data-mode='sheet-bottom'],.bubble[data-mode='sheet-top']{left:50%;transform:translateX(-50%)}.bubble[data-mode='sheet-bottom']{bottom:calc(8px + var(--_pw-kb,0px))}.bubble[data-mode='sheet-top']{top:8px}.bubble[data-yield]{pointer-events:none;opacity:0.15}.layer[data-offscreen] .spotlight{display:none}header{display:flex;align-items:flex-start;gap:8px}h2{flex:1;margin:0 0 4px;font-size:1em;font-weight:600}.body{margin:0;overflow-wrap:anywhere}.body a,.guide{color:var(--_pw-fg);text-decoration:underline}.guide{display:inline-block;margin-top:6px}code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:0.92em}footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.progress{margin-inline-end:auto;color:var(--_pw-muted);font-variant-numeric:tabular-nums}button{font:inherit;cursor:pointer;border-radius:${T(wt.radius)};padding:${T(wt.padding)};border:1px solid transparent}button:focus-visible,a:focus-visible{outline:2px solid var(--_pw-focus);outline-offset:2px}button:disabled{opacity:0.5;cursor:not-allowed}.primary{background:var(--_pw-accent);color:var(--_pw-accent-fg)}.secondary{background:transparent;color:var(--_pw-fg);border-color:var(--_pw-muted)}.close{margin-inline-start:auto;padding:0 6px;background:transparent;color:var(--_pw-fg);font-size:1.25em;line-height:1}.pill{position:absolute;inset-inline-end:16px;bottom:16px;display:flex;gap:4px;padding:4px;border-radius:999px;background:var(--_pw-bg);color:var(--_pw-fg);box-shadow:${T(N.shadow)};font-family:var(--steppy-font-family,inherit);font-size:${T(N.fontSize)};pointer-events:auto}.pill .primary{border-radius:999px}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}@media (prefers-reduced-motion:reduce){.spotlight{transition:none}}@media (forced-colors:active){.spotlight{outline:3px solid Highlight;box-shadow:none}.bubble,.pill{border:1px solid CanvasText}}@media print{.layer{display:none}}`, ys = /^(?:https?:\/\/[^\s)]+|mailto:[^\s)]+|\/(?![/\\])[^\s)]*|#[^\s)]*)$/, bs = {
|
|
1476
|
+
autolink: !0,
|
|
1477
|
+
link: (t) => ys.test(t) ? { kind: "external", href: t } : null
|
|
1478
|
+
}, ws = "`([^`]+)`|\\[([^\\]]+)\\]\\(([^\\s)]+)\\)|(\\*\\*|__)(\\S(?:.*?\\S)?)\\4|(\\*|_)([^*_\\s](?:[^*_]*?[^*_\\s])?)\\6|(https?:\\/\\/[^\\s<>()]+|www\\.[^\\s<>()]+)|([\\w.+-]+@[\\w-]+\\.[\\w.-]+\\w)";
|
|
1479
|
+
function ee(t, e = bs) {
|
|
1480
|
+
const n = [], s = (l) => l.split(`
|
|
1481
|
+
`).forEach((a, f) => {
|
|
1482
|
+
f > 0 && n.push(I`<br />`), a && n.push(a);
|
|
1483
|
+
}), i = new RegExp(ws, "g");
|
|
1484
|
+
let r = 0, o;
|
|
1485
|
+
for (; o = i.exec(t); ) {
|
|
1486
|
+
if (o[2] != null) {
|
|
1487
|
+
const l = e.link(o[3]);
|
|
1488
|
+
if (!l) {
|
|
1489
|
+
i.lastIndex = o.index + 1;
|
|
1490
|
+
continue;
|
|
1491
|
+
}
|
|
1492
|
+
o.index > r && s(t.slice(r, o.index)), n.push(
|
|
1493
|
+
l.kind === "external" ? I`<a href=${l.href} target="_blank" rel="noopener noreferrer"
|
|
1494
|
+
>${ee(o[2], e)}</a
|
|
1495
|
+
>` : I`<a href=${l.href} @click=${l.onActivate}>${ee(o[2], e)}</a>`
|
|
1496
|
+
), r = o.index + o[0].length;
|
|
1497
|
+
continue;
|
|
1498
|
+
}
|
|
1499
|
+
if (!((o[8] != null || o[9] != null) && !e.autolink)) {
|
|
1500
|
+
if (o.index > r && s(t.slice(r, o.index)), o[1] != null)
|
|
1501
|
+
n.push(I`<code>${o[1]}</code>`);
|
|
1502
|
+
else if (o[4] != null)
|
|
1503
|
+
n.push(I`<strong>${ee(o[5], e)}</strong>`);
|
|
1504
|
+
else if (o[6] != null)
|
|
1505
|
+
n.push(I`<em>${ee(o[7], e)}</em>`);
|
|
1506
|
+
else if (o[8] != null) {
|
|
1507
|
+
const l = o[8], a = (l.match(/[.,;:!?]+$/) ?? [""])[0], f = a ? l.slice(0, -a.length) : l, h = f.startsWith("www.") ? `https://${f}` : f;
|
|
1508
|
+
n.push(I`<a href=${h} target="_blank" rel="noopener noreferrer">${f}</a>`), a && s(a);
|
|
1509
|
+
} else o[9] != null && n.push(I`<a href=${`mailto:${o[9]}`}>${o[9]}</a>`);
|
|
1510
|
+
r = o.index + o[0].length;
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
return r < t.length && s(t.slice(r)), n;
|
|
1514
|
+
}
|
|
1515
|
+
const B = (t) => t.stopPropagation();
|
|
1516
|
+
function vs(t, e) {
|
|
1517
|
+
const n = t.step.advance;
|
|
1518
|
+
if (n === "click" || n === "visible") return A;
|
|
1519
|
+
const s = t.last && n === "manual" ? t.strings.done : t.strings.next, i = n === "change" ? "secondary" : "primary";
|
|
1520
|
+
return I`<button
|
|
1521
|
+
part="button next ${i}"
|
|
1522
|
+
class=${i}
|
|
1523
|
+
?disabled=${!t.nextEnabled}
|
|
1524
|
+
@pointerdown=${e.press}
|
|
1525
|
+
@mousedown=${e.press}
|
|
1526
|
+
@click=${e.next}
|
|
1527
|
+
>
|
|
1528
|
+
${s}
|
|
1529
|
+
</button>`;
|
|
1530
|
+
}
|
|
1531
|
+
function $s(t, e) {
|
|
1532
|
+
const n = t.strings, s = t.state === "fallback", i = s ? n.notFoundTitle : t.step.title, r = s ? n.notFoundBody : t.step.text ?? ms(t.step.advance, n), o = t.guideUrl !== null && (s || t.last);
|
|
1533
|
+
return I`<section
|
|
1534
|
+
part="bubble"
|
|
1535
|
+
class="bubble"
|
|
1536
|
+
role="dialog"
|
|
1537
|
+
aria-modal="false"
|
|
1538
|
+
aria-labelledby=${i ? "pw-title" : A}
|
|
1539
|
+
aria-label=${i ? A : n.dialogLabel}
|
|
1540
|
+
aria-describedby="pw-body"
|
|
1541
|
+
tabindex="-1"
|
|
1542
|
+
data-tour-id=${t.tourId}
|
|
1543
|
+
data-step-id=${t.step.id}
|
|
1544
|
+
data-state=${t.state}
|
|
1545
|
+
data-advance=${t.step.advance}
|
|
1546
|
+
@pointerdown=${B}
|
|
1547
|
+
@mousedown=${B}
|
|
1548
|
+
@click=${B}
|
|
1549
|
+
>
|
|
1550
|
+
<header>
|
|
1551
|
+
${i ? I`<h2 part="title" id="pw-title">${i}</h2>` : A}
|
|
1552
|
+
<button part="button close" class="close" aria-label=${n.close} @pointerdown=${e.press} @mousedown=${e.press} @click=${e.close}>
|
|
1553
|
+
×
|
|
1554
|
+
</button>
|
|
1555
|
+
</header>
|
|
1556
|
+
<p part="body" class="body" id="pw-body">${s ? r : ee(r, t.policy)}</p>
|
|
1557
|
+
${o ? I`<a part="guide-link" class="guide" href=${t.guideUrl} target="_blank" rel="noopener noreferrer">${n.openGuide}</a>` : A}
|
|
1558
|
+
<footer>
|
|
1559
|
+
<span part="progress" class="progress">${Gn(n.progress, { current: t.position.index + 1, total: t.position.total })}</span>
|
|
1560
|
+
${s ? I`<button part="button skip" class="secondary" @pointerdown=${e.press} @mousedown=${e.press} @click=${e.skip}>
|
|
1561
|
+
${n.skipStep}
|
|
1562
|
+
</button>
|
|
1563
|
+
<button part="button end primary" class="primary" @pointerdown=${e.press} @mousedown=${e.press} @click=${e.end}>
|
|
1564
|
+
${n.endTour}
|
|
1565
|
+
</button>` : vs(t, e)}
|
|
1566
|
+
</footer>
|
|
1567
|
+
</section>`;
|
|
1568
|
+
}
|
|
1569
|
+
function Es(t, e) {
|
|
1570
|
+
const n = t.strings;
|
|
1571
|
+
return I`<div part="pill" class="pill" role="group" aria-label=${n.paused} @pointerdown=${B} @mousedown=${B} @click=${B}>
|
|
1572
|
+
<button part="button resume primary" class="primary" @pointerdown=${e.press} @mousedown=${e.press} @click=${e.resume}>
|
|
1573
|
+
${n.resume}
|
|
1574
|
+
</button>
|
|
1575
|
+
<button part="button close" class="close" aria-label=${n.close} @pointerdown=${e.press} @mousedown=${e.press} @click=${e.close}>
|
|
1576
|
+
×
|
|
1577
|
+
</button>
|
|
1578
|
+
</div>`;
|
|
1579
|
+
}
|
|
1580
|
+
function As(t, e) {
|
|
1581
|
+
return I`<div part="layer" class="layer" lang=${t.lang} dir=${t.dir} popover=${t.popover ? "manual" : A}>
|
|
1582
|
+
${t.mode === "bubble" && t.anchored && t.state === "shown" ? I`<div part="spotlight" class="spotlight"></div>` : A}
|
|
1583
|
+
${t.mode === "bubble" ? $s(t, e) : t.mode === "pill" ? Es(t, e) : A}
|
|
1584
|
+
<div class="sr-only" role="status" aria-live="polite" aria-atomic="true"></div>
|
|
1585
|
+
</div>`;
|
|
1586
|
+
}
|
|
1587
|
+
const vt = 6, ks = 10, Ss = 8, xs = 640, Ts = 250, $t = /^(?:hidden|auto|scroll|clip)$/;
|
|
1588
|
+
function Is(t) {
|
|
1589
|
+
const e = [];
|
|
1590
|
+
for (let n = t.parentElement; n && n !== document.body && n !== document.documentElement; n = n.parentElement) {
|
|
1591
|
+
const s = getComputedStyle(n);
|
|
1592
|
+
($t.test(s.overflowX) || $t.test(s.overflowY)) && e.push(n);
|
|
1593
|
+
}
|
|
1594
|
+
return e;
|
|
1595
|
+
}
|
|
1596
|
+
function Rs(t) {
|
|
1597
|
+
const e = t.dom.scheduler;
|
|
1598
|
+
let n = !1, s = 0, i = 0, r = [], o = null, l = null;
|
|
1599
|
+
const a = (m) => `${Math.round(m * 100) / 100}px`;
|
|
1600
|
+
function f() {
|
|
1601
|
+
if (s = 0, !n) return;
|
|
1602
|
+
const m = t.layer(), u = t.bubble();
|
|
1603
|
+
if (!m || !u) return;
|
|
1604
|
+
const p = t.dom.viewport();
|
|
1605
|
+
let v = t.target();
|
|
1606
|
+
const g = v !== null;
|
|
1607
|
+
if (v && (!v.isConnected || !t.dom.isVisible(v)) && (v = t.refind()), g && !v) {
|
|
1608
|
+
n = !1, t.onLost();
|
|
1609
|
+
return;
|
|
1610
|
+
}
|
|
1611
|
+
if (u.removeAttribute("data-offscreen"), m.removeAttribute("data-offscreen"), m.style.setProperty("--_pw-kb", a(Math.max(0, window.innerHeight - (p.y + p.height)))), !v) return h(u, p);
|
|
1612
|
+
o !== v && (r = Is(v), o = v, l?.disconnect(), l?.observe(v), l?.observe(u));
|
|
1613
|
+
let d = ot(t.dom.rect(v) ?? { x: 0, y: 0, width: 0, height: 0 }, vt);
|
|
1614
|
+
for (const x of r) {
|
|
1615
|
+
const K = t.dom.rect(x);
|
|
1616
|
+
K && d && (d = rt(d, ot(K, vt)));
|
|
1617
|
+
}
|
|
1618
|
+
if (d = d && rt(d, { x: p.x, y: p.y, width: p.width, height: p.height }), !d)
|
|
1619
|
+
return u.setAttribute("data-offscreen", ""), m.setAttribute("data-offscreen", ""), h(u, p);
|
|
1620
|
+
m.style.setProperty("--_pw-sx", a(d.x)), m.style.setProperty("--_pw-sy", a(d.y)), m.style.setProperty("--_pw-sw", a(d.width)), m.style.setProperty("--_pw-sh", a(d.height)), u.toggleAttribute("data-yield", Fe(v));
|
|
1621
|
+
const w = d.y + d.height / 2, y = () => c(u, w > p.y + p.height / 2 ? "sheet-top" : "sheet-bottom", null);
|
|
1622
|
+
if (p.width <= xs) return y();
|
|
1623
|
+
const $ = t.dom.rect(u) ?? { width: 320, height: 120 }, E = t.avoid(), k = (x) => ({ x: x.x - p.x, y: x.y - p.y, width: x.width, height: x.height }), S = Ln(k(d), $, p, ks, {
|
|
1624
|
+
preferred: t.preferred(),
|
|
1625
|
+
margin: Ss,
|
|
1626
|
+
avoid: E ? [k(E)] : []
|
|
1627
|
+
});
|
|
1628
|
+
if (S.overlaps) return y();
|
|
1629
|
+
m.style.setProperty("--_pw-x", a(S.x + p.x)), m.style.setProperty("--_pw-y", a(S.y + p.y)), c(u, "anchored", S.side);
|
|
1630
|
+
}
|
|
1631
|
+
function h(m, u) {
|
|
1632
|
+
const p = t.dom.rect(m) ?? { width: 320, height: 120 }, v = {
|
|
1633
|
+
x: u.x + (u.width - p.width) / 2,
|
|
1634
|
+
y: u.y + (u.height - p.height) / 2,
|
|
1635
|
+
width: p.width,
|
|
1636
|
+
height: p.height
|
|
1637
|
+
}, g = (t.dialogs?.() ?? []).filter((y) => xe(y, v));
|
|
1638
|
+
if (!g.length) return c(m, "centered", null);
|
|
1639
|
+
const d = Math.min(...g.map((y) => y.y)) - u.y, w = u.y + u.height - Math.max(...g.map((y) => y.y + y.height));
|
|
1640
|
+
c(m, d >= w ? "sheet-top" : "sheet-bottom", null);
|
|
1641
|
+
}
|
|
1642
|
+
function c(m, u, p) {
|
|
1643
|
+
m.setAttribute("data-mode", u), p ? m.setAttribute("data-side", p) : m.removeAttribute("data-side"), m.setAttribute("data-placed", ""), t.onPlaced?.();
|
|
1644
|
+
}
|
|
1645
|
+
function b() {
|
|
1646
|
+
n && !s && (s = e.raf(f));
|
|
1647
|
+
}
|
|
1648
|
+
const _ = () => b();
|
|
1649
|
+
return {
|
|
1650
|
+
start() {
|
|
1651
|
+
if (n) return b();
|
|
1652
|
+
n = !0, o = null, document.addEventListener("scroll", _, { capture: !0, passive: !0 }), window.addEventListener("resize", _, { passive: !0 }), window.visualViewport?.addEventListener("resize", _, { passive: !0 }), window.visualViewport?.addEventListener("scroll", _, { passive: !0 }), l = typeof ResizeObserver == "function" ? new ResizeObserver(_) : null, i = e.setInterval(b, Ts), b();
|
|
1653
|
+
},
|
|
1654
|
+
stop() {
|
|
1655
|
+
n = !1, s && e.cancelRaf(s), s = 0, e.clearInterval(i), l?.disconnect(), l = null, o = null, document.removeEventListener("scroll", _, { capture: !0 }), window.removeEventListener("resize", _), window.visualViewport?.removeEventListener("resize", _), window.visualViewport?.removeEventListener("scroll", _);
|
|
1656
|
+
},
|
|
1657
|
+
notify: b
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
const Le = 'dialog,[role=dialog],[role=alertdialog],[aria-modal="true"]';
|
|
1661
|
+
function ue(t, e) {
|
|
1662
|
+
const n = t.composedPath().slice(0, 64);
|
|
1663
|
+
return n.includes(e) ? null : n.filter((s) => s instanceof Element);
|
|
1664
|
+
}
|
|
1665
|
+
function Os(t) {
|
|
1666
|
+
const { host: e, attr: n } = t, s = () => {
|
|
1667
|
+
const c = t.state();
|
|
1668
|
+
return !c.loaded || c.phase === "idle" || c.phase === "loading" || c.phase === "entering" ? null : { s: c, step: c.loaded.tour.steps[c.index] };
|
|
1669
|
+
}, i = (c) => {
|
|
1670
|
+
const b = ue(c, e);
|
|
1671
|
+
if (!b) return;
|
|
1672
|
+
t.interacted(), t.tick();
|
|
1673
|
+
const _ = s();
|
|
1674
|
+
if (!_) return;
|
|
1675
|
+
const { s: m, step: u } = _, p = new Set(b.map((y) => y.getAttribute(n)).filter((y) => y !== null)), v = m.token;
|
|
1676
|
+
if (m.phase === "showing" && u.advance === "click" && u.target !== null && p.has(u.target)) {
|
|
1677
|
+
t.persistAhead(m.index), t.defer(() => t.dispatch({ type: "TRIGGER", token: v, kind: "click" }));
|
|
1678
|
+
return;
|
|
1679
|
+
}
|
|
1680
|
+
const g = m.loaded.tour.steps, d = g.findIndex((y, $) => $ > m.index && m.loaded.applicable[$] && y.target !== null && p.has(y.target));
|
|
1681
|
+
if (d === -1) return;
|
|
1682
|
+
const w = g[d].advance === "click";
|
|
1683
|
+
w && t.persistAhead(d), t.defer(() => t.dispatch({ type: "JUMP", token: v, to: d, performed: w }));
|
|
1684
|
+
}, r = (c) => {
|
|
1685
|
+
const b = t.target();
|
|
1686
|
+
return b !== null && c.composedPath().includes(b);
|
|
1687
|
+
}, o = (c) => {
|
|
1688
|
+
if (!ue(c, e)) return;
|
|
1689
|
+
t.interacted();
|
|
1690
|
+
const b = s();
|
|
1691
|
+
b?.s.phase === "showing" && b.step.advance === "input" && r(c) && t.dispatch({ type: "FIELD", token: b.s.token, nonEmpty: Oe(t.target()).trim() !== "" });
|
|
1692
|
+
}, l = (c) => {
|
|
1693
|
+
if (!ue(c, e)) return;
|
|
1694
|
+
t.interacted(), t.tick();
|
|
1695
|
+
const b = s();
|
|
1696
|
+
if (b?.s.phase === "showing" && b.step.advance === "input" && r(c)) {
|
|
1697
|
+
const _ = b.s.token;
|
|
1698
|
+
Oe(t.target()).trim() !== "" && t.defer(() => t.dispatch({ type: "TRIGGER", token: _, kind: "input-commit" }));
|
|
1699
|
+
}
|
|
1700
|
+
}, a = (c) => {
|
|
1701
|
+
ue(c, e) && t.interacted();
|
|
1702
|
+
}, f = (c) => {
|
|
1703
|
+
const b = c;
|
|
1704
|
+
if (b.key !== "Escape" || b.defaultPrevented || b.isComposing || !s()) return;
|
|
1705
|
+
const m = b.composedPath(), u = m.indexOf(e);
|
|
1706
|
+
if ((u === -1 ? m : m.slice(u + 1)).filter((g) => g instanceof Element).some((g) => g.matches(`${Le},[aria-expanded="true"]`))) return;
|
|
1707
|
+
const v = t.target();
|
|
1708
|
+
v?.isConnected && (v.closest(Le) || Fe(v)) || t.dispatch({ type: "DISMISS", via: "escape" });
|
|
1709
|
+
}, h = { capture: !0 };
|
|
1710
|
+
return document.addEventListener("click", i, h), document.addEventListener("input", o, h), document.addEventListener("change", l, h), document.addEventListener("pointerdown", a, h), document.addEventListener("mousedown", a, h), document.addEventListener("keydown", a, h), window.addEventListener("keydown", f), () => {
|
|
1711
|
+
document.removeEventListener("click", i, h), document.removeEventListener("input", o, h), document.removeEventListener("change", l, h), document.removeEventListener("pointerdown", a, h), document.removeEventListener("mousedown", a, h), document.removeEventListener("keydown", a, h), window.removeEventListener("keydown", f);
|
|
1712
|
+
};
|
|
1713
|
+
}
|
|
1714
|
+
function Ls(t, e, n, s) {
|
|
1715
|
+
let i = e(t), r = !1, o = !1, l = !1;
|
|
1716
|
+
const a = () => {
|
|
1717
|
+
if (l = !1, o || Fe(t)) return;
|
|
1718
|
+
const _ = e(t);
|
|
1719
|
+
if (!r) {
|
|
1720
|
+
i = _;
|
|
1721
|
+
return;
|
|
1722
|
+
}
|
|
1723
|
+
_ !== i && (o = !0, b(), n());
|
|
1724
|
+
}, f = () => {
|
|
1725
|
+
!l && !o && (l = !0, s.raf(a));
|
|
1726
|
+
}, h = new MutationObserver(f);
|
|
1727
|
+
h.observe(t, { attributes: !0, characterData: !0, childList: !0, subtree: !0 });
|
|
1728
|
+
const c = s.setInterval(a, 300), b = () => {
|
|
1729
|
+
h.disconnect(), s.clearInterval(c);
|
|
1730
|
+
};
|
|
1731
|
+
return {
|
|
1732
|
+
arm() {
|
|
1733
|
+
r = !0;
|
|
1734
|
+
},
|
|
1735
|
+
tick: f,
|
|
1736
|
+
stop() {
|
|
1737
|
+
o = !0, b();
|
|
1738
|
+
}
|
|
1739
|
+
};
|
|
1740
|
+
}
|
|
1741
|
+
const Y = Symbol.for(dn), Ms = 300, Cs = 500, Ps = 12e4, j = globalThis, Et = () => j[un] === !0;
|
|
1742
|
+
class At extends ne {
|
|
1743
|
+
constructor() {
|
|
1744
|
+
super(...arguments), this.manifest = "", this.fallbackManifest = "", this.buildId = "", this.locale = "", this.guideOrigin = "", this.baseZIndex = On, this.targetTimeout = st, this.disabled = !1, this.source = null, this.navigate = null, this.strings = void 0, this._s = z(), this._queue = [], this._dispatching = !1, this._run = null, this._cache = /* @__PURE__ */ new Map(), this._resolver = null, this._cancelWait = null, this._target = null, this._tracker = null, this._detach = null, this._change = null, this._shownKey = "", this._shownAt = 0, this._pressToken = -1, this._focusPending = !1, this._appFocus = null, this._swapSeq = 0, this._lang = new MutationObserver(() => {
|
|
1745
|
+
this.locale || this._swapLocale();
|
|
1746
|
+
}), this._policy = { autolink: !1, link: (e) => this._link(e) }, this._handlers = {
|
|
1747
|
+
press: () => {
|
|
1748
|
+
this._pressToken = this._s.token;
|
|
1749
|
+
},
|
|
1750
|
+
next: (e) => this._guarded(e, () => this._dispatch({ type: "NEXT", token: this._s.token })),
|
|
1751
|
+
skip: (e) => this._guarded(e, () => this._dispatch({ type: "SKIP", token: this._s.token })),
|
|
1752
|
+
end: (e) => this._guarded(e, () => this._dispatch({ type: "DISMISS", via: "end" })),
|
|
1753
|
+
close: (e) => this._guarded(e, () => this._dispatch({ type: "DISMISS", via: "close" })),
|
|
1754
|
+
resume: (e) => this._guarded(e, () => this._dispatch({ type: "RESUME", token: this._s.token }))
|
|
1755
|
+
}, this._onFocusIn = (e) => {
|
|
1756
|
+
e.composedPath().includes(this) || (this._appFocus = e.composedPath()[0]);
|
|
1757
|
+
};
|
|
1758
|
+
}
|
|
1759
|
+
static {
|
|
1760
|
+
this.styles = _s;
|
|
1761
|
+
}
|
|
1762
|
+
static {
|
|
1763
|
+
this.properties = {
|
|
1764
|
+
manifest: { type: String },
|
|
1765
|
+
fallbackManifest: { type: String, attribute: "fallback-manifest" },
|
|
1766
|
+
buildId: { type: String, attribute: "build-id" },
|
|
1767
|
+
locale: { type: String },
|
|
1768
|
+
guideOrigin: { type: String, attribute: "guide-origin" },
|
|
1769
|
+
baseZIndex: { type: Number, attribute: "base-z-index" },
|
|
1770
|
+
targetTimeout: { type: Number, attribute: "target-timeout" },
|
|
1771
|
+
disabled: { type: Boolean, reflect: !0 },
|
|
1772
|
+
source: { attribute: !1 },
|
|
1773
|
+
navigate: { attribute: !1 },
|
|
1774
|
+
strings: { attribute: !1 }
|
|
1775
|
+
};
|
|
1776
|
+
}
|
|
1777
|
+
static {
|
|
1778
|
+
this.dom = Mt;
|
|
1779
|
+
}
|
|
1780
|
+
get _dom() {
|
|
1781
|
+
return this.constructor.dom;
|
|
1782
|
+
}
|
|
1783
|
+
// ── Public API ──────────────────────────────────────────────────────────
|
|
1784
|
+
get isActive() {
|
|
1785
|
+
return J(this._s);
|
|
1786
|
+
}
|
|
1787
|
+
get current() {
|
|
1788
|
+
if (!J(this._s) || !this._s.loaded) return null;
|
|
1789
|
+
const e = this._s.loaded.tour.steps[this._s.index];
|
|
1790
|
+
return { tourId: this._s.loaded.tour.id, stepId: e.id, ...oe(this._s) };
|
|
1791
|
+
}
|
|
1792
|
+
async start(e, n = {}) {
|
|
1793
|
+
return this._start(e, n, !1);
|
|
1794
|
+
}
|
|
1795
|
+
stop(e) {
|
|
1796
|
+
this._dispatch({ type: "DISMISS", via: "api", reason: e });
|
|
1797
|
+
}
|
|
1798
|
+
next() {
|
|
1799
|
+
this._dispatch({ type: "NEXT" });
|
|
1800
|
+
}
|
|
1801
|
+
// ── Lifecycle ───────────────────────────────────────────────────────────
|
|
1802
|
+
connectedCallback() {
|
|
1803
|
+
super.connectedCallback(), this.style.setProperty("--_pw-z", String(this.baseZIndex));
|
|
1804
|
+
}
|
|
1805
|
+
disconnectedCallback() {
|
|
1806
|
+
super.disconnectedCallback(), queueMicrotask(() => {
|
|
1807
|
+
this.isConnected || this._teardown(!1);
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1810
|
+
willUpdate(e) {
|
|
1811
|
+
(e.has("manifest") || e.has("fallbackManifest") || e.has("buildId")) && this._cache.clear(), e.has("baseZIndex") && this.style.setProperty("--_pw-z", String(this.baseZIndex)), e.has("disabled") && this.disabled && this._s.phase !== "idle" && this._dispatch({ type: "DISMISS", via: "disabled" });
|
|
1812
|
+
}
|
|
1813
|
+
updated(e) {
|
|
1814
|
+
e.has("locale") && this.isActive && this._swapLocale(), (e.has("manifest") || e.has("fallbackManifest")) && this.hasUpdated && this._tryResume(), this._afterRender();
|
|
1815
|
+
}
|
|
1816
|
+
firstUpdated() {
|
|
1817
|
+
this._tryResume();
|
|
1818
|
+
}
|
|
1819
|
+
render() {
|
|
1820
|
+
const e = this._s;
|
|
1821
|
+
if (!this._run || !e.loaded || !J(e)) return A;
|
|
1822
|
+
const n = e.loaded.tour.steps[e.index], s = e.phase === "showing" || e.phase === "fallback" ? "bubble" : e.phase === "paused" ? "pill" : "none", i = oe(e);
|
|
1823
|
+
return As(
|
|
1824
|
+
{
|
|
1825
|
+
mode: s,
|
|
1826
|
+
lang: e.loaded.tour.locale.replace(/_/g, "-"),
|
|
1827
|
+
dir: fs(e.loaded.tour.locale),
|
|
1828
|
+
tourId: e.loaded.tour.id,
|
|
1829
|
+
step: n,
|
|
1830
|
+
state: e.phase === "fallback" ? "fallback" : "shown",
|
|
1831
|
+
anchored: e.phase === "showing" && this._target !== null,
|
|
1832
|
+
position: i,
|
|
1833
|
+
last: i.index === i.total - 1,
|
|
1834
|
+
nextEnabled: n.advance !== "input" || e.fieldNonEmpty,
|
|
1835
|
+
guideUrl: e.loaded.tour.guideUrl,
|
|
1836
|
+
strings: yt(e.loaded.tour.locale, this.strings),
|
|
1837
|
+
policy: this._policy,
|
|
1838
|
+
popover: this._dom.supportsPopover()
|
|
1839
|
+
},
|
|
1840
|
+
this._handlers
|
|
1841
|
+
);
|
|
1842
|
+
}
|
|
1843
|
+
// ── Starting ────────────────────────────────────────────────────────────
|
|
1844
|
+
async _start(e, n, s) {
|
|
1845
|
+
try {
|
|
1846
|
+
if (Et() || this.disabled)
|
|
1847
|
+
return console.info(`[steppy-tour] "${e}" not started: tours are disabled on this page`), !1;
|
|
1848
|
+
const i = j[Y];
|
|
1849
|
+
i && i !== this && i._dispatch({ type: "DISMISS", via: "replaced" }), this._s.phase !== "idle" && this._dispatch({ type: "DISMISS", via: "replaced" }), this._dispatch({ type: "REQUEST" });
|
|
1850
|
+
const r = this._s.token, o = Object.fromEntries(Object.entries(n.params ?? {}).map(([d, w]) => [d, String(w)])), l = this._preferredLocale(), a = await dt(this._cfg(l), e);
|
|
1851
|
+
if (this._s.token !== r) return !1;
|
|
1852
|
+
if (!a.ok) return this._fail({ reason: a.reason, fatal: !0, message: a.message, tourId: e, issues: a.issues });
|
|
1853
|
+
const { tour: f, manifest: h } = a, c = this._dom, b = h.layouts ?? {}, _ = f.steps.map((d) => !d.layouts || d.layouts.some((w) => c.matchMedia(b[w]))), m = { tourId: e, buildId: f.buildId, locale: f.locale };
|
|
1854
|
+
if (!_.some(Boolean)) return this._fail({ reason: "load-failed", fatal: !0, message: "no steps apply to this layout", ...m });
|
|
1855
|
+
let u = _.indexOf(!0);
|
|
1856
|
+
if (n.step !== void 0) {
|
|
1857
|
+
const d = f.steps.findIndex((w) => w.id === n.step);
|
|
1858
|
+
if (d >= 0 && _[d]) u = d;
|
|
1859
|
+
else if (s)
|
|
1860
|
+
return he(), this._fail(null);
|
|
1861
|
+
}
|
|
1862
|
+
const p = pt(document.baseURI, location.origin);
|
|
1863
|
+
let v = null, g = o;
|
|
1864
|
+
if (f.entry && !s) {
|
|
1865
|
+
const d = f.entry.route, w = ht(d, Ae(location.pathname, p)) ?? ht(d, location.pathname);
|
|
1866
|
+
if (g = { ...w ?? {}, ...o }, !w || Object.entries(o).some(([y, $]) => w[y] !== $)) {
|
|
1867
|
+
const y = rs(d, g);
|
|
1868
|
+
if ("missing" in y)
|
|
1869
|
+
return this._fail({
|
|
1870
|
+
reason: "entry-params",
|
|
1871
|
+
fatal: !0,
|
|
1872
|
+
message: `route ${d} needs ${y.missing.join(", ")}`,
|
|
1873
|
+
missing: y.missing,
|
|
1874
|
+
...m
|
|
1875
|
+
});
|
|
1876
|
+
v = Dt(y.path, p);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
return this._run = { tourId: e, params: g, load: a, entryPath: v, base: p }, this._resolver = ss({ attr: a.testIdAttribute, host: this, dom: c }), j[Y] = this, this._dispatch({
|
|
1880
|
+
type: "LOADED",
|
|
1881
|
+
loaded: { tour: f, source: a.source, applicable: _, start: u, resumed: s, navigate: v !== null }
|
|
1882
|
+
}), this._lang.observe(document.documentElement, { attributeFilter: ["lang"] }), this._preferredLocale() !== l && this._swapLocale(), !0;
|
|
1883
|
+
} catch (i) {
|
|
1884
|
+
return console.error("[steppy-tour] start failed", i), this._fail({ reason: "load-failed", fatal: !0, message: String(i), tourId: e }), !1;
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
_fail(e) {
|
|
1888
|
+
return e ? this._dispatch({ type: "LOAD_FAILED", error: e }) : this._dispatch({ type: "DISMISS", via: "api" }), !1;
|
|
1889
|
+
}
|
|
1890
|
+
_tryResume() {
|
|
1891
|
+
if (this.disabled || Et() || this._s.phase !== "idle" || j[Y]) return;
|
|
1892
|
+
const e = this._manifestKey(), n = e ? hs(e, Date.now()) : null;
|
|
1893
|
+
n && this._start(n.tourId, { params: n.params, step: n.stepId }, !0);
|
|
1894
|
+
}
|
|
1895
|
+
_manifestKey() {
|
|
1896
|
+
return [this.manifest, this.fallbackManifest].filter(Boolean).join(" ");
|
|
1897
|
+
}
|
|
1898
|
+
/** The host's ``locale``, else the page's ``<html lang>``. */
|
|
1899
|
+
_preferredLocale() {
|
|
1900
|
+
return this.locale || document.documentElement.lang;
|
|
1901
|
+
}
|
|
1902
|
+
_cfg(e) {
|
|
1903
|
+
const { manifest: n, fallbackManifest: s, buildId: i, guideOrigin: r, source: o } = this;
|
|
1904
|
+
return { manifest: n, fallbackManifest: s, buildId: i, locale: e, guideOrigin: r, source: o, cache: this._cache };
|
|
1905
|
+
}
|
|
1906
|
+
/** Reload the running tour in the preferred locale; the last request wins. */
|
|
1907
|
+
async _swapLocale() {
|
|
1908
|
+
const e = this._run;
|
|
1909
|
+
if (!e) return;
|
|
1910
|
+
const n = ++this._swapSeq, s = this._preferredLocale(), i = await dt(this._cfg(s), e.tourId);
|
|
1911
|
+
if (!(n !== this._swapSeq || this._run !== e)) {
|
|
1912
|
+
if (i.ok && i.tour.buildId === e.load.tour.buildId) {
|
|
1913
|
+
if (i.tour.locale === e.load.tour.locale) return;
|
|
1914
|
+
if (this._dispatch({ type: "LOCALE", tour: i.tour }), this._s.loaded?.tour === i.tour) {
|
|
1915
|
+
e.load = i, this._announce();
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
console.warn(`[steppy-tour] locale "${s}" not applied: ${i.ok ? "the tour differs" : i.message}`);
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
// ── The engine loop ─────────────────────────────────────────────────────
|
|
1923
|
+
_dispatch(e) {
|
|
1924
|
+
if (this._queue.push(e), this._dispatching) return;
|
|
1925
|
+
this._dispatching = !0;
|
|
1926
|
+
const n = this._s;
|
|
1927
|
+
try {
|
|
1928
|
+
for (; this._queue.length; ) {
|
|
1929
|
+
const s = Hn(this._s, this._queue.shift());
|
|
1930
|
+
this._s = s.state;
|
|
1931
|
+
for (const i of s.effects) this._effect(i);
|
|
1932
|
+
}
|
|
1933
|
+
} finally {
|
|
1934
|
+
this._dispatching = !1;
|
|
1935
|
+
}
|
|
1936
|
+
this._s !== n && this.requestUpdate();
|
|
1937
|
+
}
|
|
1938
|
+
_effect(e) {
|
|
1939
|
+
const n = this._run;
|
|
1940
|
+
switch (e.type) {
|
|
1941
|
+
case "emit":
|
|
1942
|
+
jn(this, e.name, e.detail);
|
|
1943
|
+
break;
|
|
1944
|
+
case "persist":
|
|
1945
|
+
n && this._persist(e.index);
|
|
1946
|
+
break;
|
|
1947
|
+
case "clearPersist":
|
|
1948
|
+
he();
|
|
1949
|
+
break;
|
|
1950
|
+
case "navigate":
|
|
1951
|
+
this._enter(e.token);
|
|
1952
|
+
break;
|
|
1953
|
+
case "wait":
|
|
1954
|
+
this._wait(e.mode, e.index, e.token);
|
|
1955
|
+
break;
|
|
1956
|
+
case "focus":
|
|
1957
|
+
this._focusPending = !0;
|
|
1958
|
+
break;
|
|
1959
|
+
case "teardown":
|
|
1960
|
+
this._teardown(!0);
|
|
1961
|
+
break;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
_persist(e) {
|
|
1965
|
+
const n = this._run, s = n.load.tour;
|
|
1966
|
+
ds({
|
|
1967
|
+
v: 1,
|
|
1968
|
+
tourId: s.id,
|
|
1969
|
+
stepId: s.steps[e].id,
|
|
1970
|
+
locale: s.locale,
|
|
1971
|
+
params: n.params,
|
|
1972
|
+
buildId: s.buildId,
|
|
1973
|
+
manifestKey: this._manifestKey(),
|
|
1974
|
+
savedAt: Date.now()
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
async _enter(e) {
|
|
1978
|
+
const n = this._run, s = n.entryPath, i = { appPath: Ae(s, n.base), tourId: n.tourId };
|
|
1979
|
+
try {
|
|
1980
|
+
const r = this.navigate ?? ((o) => location.assign(o));
|
|
1981
|
+
await Promise.race([
|
|
1982
|
+
Promise.resolve(r(s, i)),
|
|
1983
|
+
new Promise((o) => this._dom.scheduler.setTimeout(() => o(void 0), this._timeout()))
|
|
1984
|
+
]), this._dispatch({ type: "ENTER_DONE", token: e });
|
|
1985
|
+
} catch (r) {
|
|
1986
|
+
this._dispatch({ type: "ENTER_FAILED", token: e, message: `navigation failed: ${String(r)}` });
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
_timeout() {
|
|
1990
|
+
const e = Number(this.targetTimeout);
|
|
1991
|
+
return Number.isFinite(e) ? Math.min(Ps, Math.max(Cs, e)) : st;
|
|
1992
|
+
}
|
|
1993
|
+
_wait(e, n, s) {
|
|
1994
|
+
this._cancelWait?.();
|
|
1995
|
+
const i = this._s.loaded.tour.steps[n], r = this._resolver, o = e === "resolve" || e === "fallback" ? [i.advance === "visible" ? null : i.target, i.waitFor].filter((a) => a !== null) : [i.target], l = e === "resolve" || e === "lost" || e === "visible" ? this._timeout() : null;
|
|
1996
|
+
this._cancelWait = r.wait({
|
|
1997
|
+
ids: o,
|
|
1998
|
+
timeoutMs: l,
|
|
1999
|
+
onFound: (a) => {
|
|
2000
|
+
this._cancelWait = null, this._target = i.target ? a.get(i.target) ?? r.find(i.target) : null;
|
|
2001
|
+
const f = i.advance === "input" && this._target !== null && Oe(this._target).trim() !== "", h = e === "resolve" || e === "fallback" ? { type: "RESOLVED", token: s, fieldNonEmpty: f } : e === "visible" ? { type: "TRIGGER", token: s, kind: "visible" } : { type: "TARGET_BACK", token: s };
|
|
2002
|
+
this._dispatch(h);
|
|
2003
|
+
},
|
|
2004
|
+
onTimeout: (a) => {
|
|
2005
|
+
if (this._cancelWait = null, e === "lost") return this._dispatch({ type: "LOST_TIMEOUT", token: s });
|
|
2006
|
+
const f = a === i.waitFor && a !== i.target ? "waitFor" : "target";
|
|
2007
|
+
this._dispatch({ type: "RESOLVE_TIMEOUT", token: s, testId: a, kind: f });
|
|
2008
|
+
}
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
// ── Showing ─────────────────────────────────────────────────────────────
|
|
2012
|
+
_layer() {
|
|
2013
|
+
return this.renderRoot.querySelector('[part~="layer"]');
|
|
2014
|
+
}
|
|
2015
|
+
_bubble() {
|
|
2016
|
+
return this.renderRoot.querySelector('[part~="bubble"]');
|
|
2017
|
+
}
|
|
2018
|
+
_afterRender() {
|
|
2019
|
+
const e = this._s, n = this._layer(), s = e.phase === "showing" || e.phase === "fallback" || e.phase === "paused";
|
|
2020
|
+
if (!n || !s || !e.loaded) {
|
|
2021
|
+
this._tracker?.stop(), this._change?.stop(), this._change = null, J(e) || (this._shownKey = "");
|
|
2022
|
+
return;
|
|
2023
|
+
}
|
|
2024
|
+
Bn(n, this._dom), this._ensureTriggers();
|
|
2025
|
+
const i = e.loaded.tour.steps[e.index], r = `${e.loaded.tour.id}/${e.index}/${e.phase}`;
|
|
2026
|
+
r !== this._shownKey && (this._shownKey = r, this._shownAt = this._dom.scheduler.now(), Vn(n, this._dom), e.phase === "showing" && this._onStepShown(i), this._announce()), e.phase === "showing" || e.phase === "fallback" ? (this._tracker || (this._tracker = this._makeTracker()), this._tracker.start(), this._tracker.notify()) : this._tracker?.stop();
|
|
2027
|
+
}
|
|
2028
|
+
/** Manual and fallback steps take focus — once placed: a hidden bubble cannot be focused. */
|
|
2029
|
+
_applyPendingFocus() {
|
|
2030
|
+
const e = this._focusPending ? this.renderRoot.querySelector('[part~="primary"]') : null;
|
|
2031
|
+
e && (this._focusPending = !1, e.focus({ preventScroll: !0 }));
|
|
2032
|
+
}
|
|
2033
|
+
_onStepShown(e) {
|
|
2034
|
+
const n = this._target;
|
|
2035
|
+
if (this._change?.stop(), this._change = null, n && e.advance === "change") {
|
|
2036
|
+
const i = this._s.token;
|
|
2037
|
+
this._change = Ls(n, ls, () => this._dispatch({ type: "TRIGGER", token: i, kind: "change" }), this._dom.scheduler);
|
|
2038
|
+
}
|
|
2039
|
+
if (n) {
|
|
2040
|
+
const i = this._dom.rect(n), r = this._dom.viewport();
|
|
2041
|
+
i && i.x >= r.x && i.y >= r.y && i.x + i.width <= r.x + r.width && i.y + i.height <= r.y + r.height || this._dom.scrollIntoView(n, this._dom.reducedMotion());
|
|
2042
|
+
}
|
|
2043
|
+
const s = this._deepActive();
|
|
2044
|
+
s && this.renderRoot.contains(s) && e.advance !== "manual" && (n instanceof HTMLElement ? n : this._appFocus)?.focus?.({ preventScroll: !0 });
|
|
2045
|
+
}
|
|
2046
|
+
_announce() {
|
|
2047
|
+
this._dom.scheduler.raf(() => {
|
|
2048
|
+
const e = this.renderRoot.querySelector('[role="status"]'), n = this._bubble();
|
|
2049
|
+
if (e) {
|
|
2050
|
+
if (e.textContent = "", this._s.phase === "paused") e.textContent = yt(this._s.loaded?.tour.locale ?? "en", this.strings).paused;
|
|
2051
|
+
else if (n) {
|
|
2052
|
+
const s = (i) => n.querySelector(`[part~="${i}"]`)?.textContent?.trim() ?? "";
|
|
2053
|
+
e.textContent = [s("title"), s("body"), s("progress")].filter(Boolean).join(" ");
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
});
|
|
2057
|
+
}
|
|
2058
|
+
_makeTracker() {
|
|
2059
|
+
return Rs({
|
|
2060
|
+
dom: this._dom,
|
|
2061
|
+
layer: () => this._layer(),
|
|
2062
|
+
bubble: () => this._bubble(),
|
|
2063
|
+
target: () => this._s.phase === "showing" ? this._target : null,
|
|
2064
|
+
refind: () => {
|
|
2065
|
+
const e = this._s.loaded?.tour.steps[this._s.index]?.target, n = e && this._resolver ? this._resolver.find(e) : null;
|
|
2066
|
+
return n && (this._target = n), n;
|
|
2067
|
+
},
|
|
2068
|
+
preferred: () => this._preferredSide(),
|
|
2069
|
+
avoid: () => this._nextTargetRect(),
|
|
2070
|
+
dialogs: () => this._openDialogs(),
|
|
2071
|
+
onPlaced: () => this._applyPendingFocus(),
|
|
2072
|
+
onLost: () => {
|
|
2073
|
+
const e = this._s.token;
|
|
2074
|
+
this._dom.scheduler.setTimeout(() => this._dispatch({ type: "TARGET_LOST", token: e }), 0);
|
|
2075
|
+
}
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
2078
|
+
_preferredSide() {
|
|
2079
|
+
const e = this._s.loaded?.tour.steps[this._s.index];
|
|
2080
|
+
return e?.placement && e.placement !== "auto" ? e.placement : e?.advance === "change" && this._target && cs(this._target) ? "top" : "auto";
|
|
2081
|
+
}
|
|
2082
|
+
_nextTargetRect() {
|
|
2083
|
+
const e = this._s, s = (e.loaded?.tour.steps ?? []).find((r, o) => o > e.index && e.loaded.applicable[o]), i = s?.target && this._resolver ? this._resolver.find(s.target) : null;
|
|
2084
|
+
return i ? this._dom.rect(i) : null;
|
|
2085
|
+
}
|
|
2086
|
+
/** The app's open dialogs (the overlay's own bubble is in the shadow root, so never one of them). */
|
|
2087
|
+
_openDialogs() {
|
|
2088
|
+
const e = [];
|
|
2089
|
+
for (const n of document.querySelectorAll(Le)) {
|
|
2090
|
+
const s = this._dom.rect(n);
|
|
2091
|
+
s && e.push(s);
|
|
2092
|
+
}
|
|
2093
|
+
return e;
|
|
2094
|
+
}
|
|
2095
|
+
_ensureTriggers() {
|
|
2096
|
+
this._detach || !this._run || (this._detach = Os({
|
|
2097
|
+
host: this,
|
|
2098
|
+
attr: this._run.load.testIdAttribute,
|
|
2099
|
+
state: () => this._s,
|
|
2100
|
+
dispatch: (e) => this._dispatch(e),
|
|
2101
|
+
target: () => this._target,
|
|
2102
|
+
persistAhead: (e) => {
|
|
2103
|
+
const s = this._s.loaded.applicable.findIndex((i, r) => i && r > e);
|
|
2104
|
+
s === -1 ? he() : this._persist(s);
|
|
2105
|
+
},
|
|
2106
|
+
interacted: () => this._change?.arm(),
|
|
2107
|
+
tick: () => this._change?.tick(),
|
|
2108
|
+
defer: (e) => this._dom.scheduler.setTimeout(e, 0)
|
|
2109
|
+
}), document.addEventListener("focusin", this._onFocusIn, !0));
|
|
2110
|
+
}
|
|
2111
|
+
/** Our buttons: a click counts only if it was pressed on this step (or, by keyboard, after a short grace). */
|
|
2112
|
+
_guarded(e, n) {
|
|
2113
|
+
e.stopPropagation(), !(e.detail === 0 ? this._dom.scheduler.now() - this._shownAt < Ms : this._pressToken !== this._s.token) && n();
|
|
2114
|
+
}
|
|
2115
|
+
_deepActive() {
|
|
2116
|
+
let e = document.activeElement;
|
|
2117
|
+
for (; e?.shadowRoot?.activeElement; ) e = e.shadowRoot.activeElement;
|
|
2118
|
+
return e;
|
|
2119
|
+
}
|
|
2120
|
+
_teardown(e) {
|
|
2121
|
+
this._cancelWait?.(), this._cancelWait = null, this._tracker?.stop(), this._tracker = null, this._change?.stop(), this._change = null, this._detach?.(), this._detach = null, document.removeEventListener("focusin", this._onFocusIn, !0), this._lang.disconnect();
|
|
2122
|
+
const n = this._deepActive();
|
|
2123
|
+
e && n && this.renderRoot.contains(n) && this._appFocus instanceof HTMLElement && this._appFocus.focus({ preventScroll: !0 }), this._target = null, this._run = null, this._resolver = null, this._shownKey = "", j[Y] === this && (j[Y] = null), !e && this._s.phase !== "idle" && (this._s = { ...z(), token: this._s.token + 1 });
|
|
2124
|
+
}
|
|
2125
|
+
// ── Links in step text ──────────────────────────────────────────────────
|
|
2126
|
+
_link(e) {
|
|
2127
|
+
const n = this._run, s = n?.base ?? pt(document.baseURI, location.origin), i = os(e, s, location.origin);
|
|
2128
|
+
if (i !== null)
|
|
2129
|
+
return {
|
|
2130
|
+
kind: "internal",
|
|
2131
|
+
href: i,
|
|
2132
|
+
onActivate: (l) => {
|
|
2133
|
+
if (l.defaultPrevented || l.button !== 0 || l.metaKey || l.ctrlKey || l.shiftKey || l.altKey) return;
|
|
2134
|
+
l.preventDefault();
|
|
2135
|
+
const a = this.navigate ?? ((f) => location.assign(f));
|
|
2136
|
+
Promise.resolve(a(i, { appPath: Ae(i, s), tourId: n?.tourId ?? "" })).catch(() => {
|
|
2137
|
+
});
|
|
2138
|
+
}
|
|
2139
|
+
};
|
|
2140
|
+
const r = be(e), o = n?.load.guideOrigin ?? null;
|
|
2141
|
+
return r && o && r === o ? { kind: "external", href: e } : null;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
function Us() {
|
|
2145
|
+
const t = customElements.get(ve);
|
|
2146
|
+
t ? t !== At && console.warn(`[steppy-tour] <${ve}> is already defined by another copy of the overlay; keeping that one`) : customElements.define(ve, At);
|
|
2147
|
+
}
|
|
2148
|
+
Us();
|
|
2149
|
+
export {
|
|
2150
|
+
hn as ADVANCE_KINDS,
|
|
2151
|
+
ps as DEFAULT_TOUR_STRINGS,
|
|
2152
|
+
fn as PLACEMENTS,
|
|
2153
|
+
At as SteppyTourHost,
|
|
2154
|
+
un as TOURS_KILL_SWITCH_GLOBAL,
|
|
2155
|
+
Hs as TOUR_ERROR_REASONS,
|
|
2156
|
+
zs as TOUR_EVENTS,
|
|
2157
|
+
ve as TOUR_HOST_TAG,
|
|
2158
|
+
Fs as TOUR_PARTS,
|
|
2159
|
+
et as TOUR_SCHEMA_VERSION,
|
|
2160
|
+
Us as defineTourHost,
|
|
2161
|
+
Jn as validateManifest,
|
|
2162
|
+
Qn as validateTour
|
|
2163
|
+
};
|
|
2164
|
+
//# sourceMappingURL=steppy-tour.js.map
|