@guidelytech/guide-runtime 0.14.0 → 0.16.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/dist/capture.cjs +5 -0
- package/dist/capture.cjs.map +1 -1
- package/dist/capture.js +2 -2
- package/dist/{chunk-H3CROHPR.js → chunk-KEQ2VEEC.js} +2 -2
- package/dist/{chunk-VJSQM23R.js → chunk-KQGSHCNW.js} +6 -1
- package/dist/chunk-KQGSHCNW.js.map +1 -0
- package/dist/{chunk-VQJ7MZ2K.js → chunk-YU6SKJK4.js} +2 -2
- package/dist/index.cjs +100 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +76 -5
- package/dist/index.js.map +1 -1
- package/dist/messenger.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-4FKYF6OB.js +0 -466
- package/dist/chunk-4FKYF6OB.js.map +0 -1
- package/dist/chunk-4UW6YF44.js +0 -464
- package/dist/chunk-4UW6YF44.js.map +0 -1
- package/dist/chunk-7DOGZKWD.js +0 -322
- package/dist/chunk-7DOGZKWD.js.map +0 -1
- package/dist/chunk-GUH2PQJ7.js +0 -462
- package/dist/chunk-GUH2PQJ7.js.map +0 -1
- package/dist/chunk-GUSKGNNR.js +0 -301
- package/dist/chunk-GUSKGNNR.js.map +0 -1
- package/dist/chunk-KJRXCITD.js +0 -515
- package/dist/chunk-KJRXCITD.js.map +0 -1
- package/dist/chunk-PG7CMBHD.js +0 -330
- package/dist/chunk-PG7CMBHD.js.map +0 -1
- package/dist/chunk-VJSQM23R.js.map +0 -1
- package/dist/chunk-VNJPNGZ4.js +0 -301
- package/dist/chunk-VNJPNGZ4.js.map +0 -1
- /package/dist/{chunk-H3CROHPR.js.map → chunk-KEQ2VEEC.js.map} +0 -0
- /package/dist/{chunk-VQJ7MZ2K.js.map → chunk-YU6SKJK4.js.map} +0 -0
package/dist/chunk-VNJPNGZ4.js
DELETED
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__publicField
|
|
3
|
-
} from "./chunk-PG7CMBHD.js";
|
|
4
|
-
|
|
5
|
-
// src/selectors.ts
|
|
6
|
-
import { matchUrlPattern } from "@guidelytech/shared/runtime";
|
|
7
|
-
function urlMatches(pattern, url) {
|
|
8
|
-
if (!pattern) return true;
|
|
9
|
-
if (matchUrlPattern(pattern, url)) return true;
|
|
10
|
-
try {
|
|
11
|
-
const u = new URL(url, "http://localhost");
|
|
12
|
-
if (!pattern.includes("?") && !pattern.includes("#")) return matchUrlPattern(pattern, u.pathname) || matchUrlPattern(pattern, u.origin + u.pathname);
|
|
13
|
-
} catch {
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
var TEXT_CANDIDATES = "button, a, [role='button'], [role='link'], [role='tab'], [role='menuitem'], h1, h2, h3, h4, h5, h6, label, summary";
|
|
18
|
-
var HOST_ID = "guidely-root";
|
|
19
|
-
function docOf(root) {
|
|
20
|
-
return root.nodeType === 9 ? root : root.ownerDocument;
|
|
21
|
-
}
|
|
22
|
-
function hasLayout(doc) {
|
|
23
|
-
const de = doc.documentElement;
|
|
24
|
-
if (!de) return false;
|
|
25
|
-
const r = de.getBoundingClientRect();
|
|
26
|
-
return r.width > 0 || r.height > 0;
|
|
27
|
-
}
|
|
28
|
-
function normalizeText(text) {
|
|
29
|
-
return (text || "").replace(/\s+/g, " ").trim();
|
|
30
|
-
}
|
|
31
|
-
function isVisible(el) {
|
|
32
|
-
if (!el.isConnected) return false;
|
|
33
|
-
const doc = el.ownerDocument;
|
|
34
|
-
const win = doc.defaultView;
|
|
35
|
-
let cur = el;
|
|
36
|
-
while (cur && cur !== doc.documentElement) {
|
|
37
|
-
if (cur.hidden) return false;
|
|
38
|
-
if (win) {
|
|
39
|
-
const cs = win.getComputedStyle(cur);
|
|
40
|
-
if (cs.display === "none" || cs.visibility === "hidden") return false;
|
|
41
|
-
}
|
|
42
|
-
cur = cur.parentElement ?? cur.getRootNode().host ?? null;
|
|
43
|
-
}
|
|
44
|
-
if (hasLayout(doc)) {
|
|
45
|
-
const r = el.getBoundingClientRect();
|
|
46
|
-
if (r.width === 0 && r.height === 0) return false;
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
function isGuidelyElement(el) {
|
|
51
|
-
if (!el) return false;
|
|
52
|
-
const root = el.getRootNode();
|
|
53
|
-
if (root instanceof ShadowRoot && root.host.id === HOST_ID) return true;
|
|
54
|
-
return el.id === HOST_ID || !!el.closest?.(`#${HOST_ID}`);
|
|
55
|
-
}
|
|
56
|
-
function safeQueryAll(root, selector) {
|
|
57
|
-
try {
|
|
58
|
-
return Array.from(root.querySelectorAll(selector));
|
|
59
|
-
} catch {
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function escapeCss(value) {
|
|
64
|
-
const g = globalThis;
|
|
65
|
-
if (g.CSS && typeof g.CSS.escape === "function") return g.CSS.escape(value);
|
|
66
|
-
return value.replace(/["\\]/g, "\\$&");
|
|
67
|
-
}
|
|
68
|
-
function queryXPath(root, expr) {
|
|
69
|
-
const doc = docOf(root);
|
|
70
|
-
const d = doc;
|
|
71
|
-
if (typeof d.evaluate !== "function") return [];
|
|
72
|
-
try {
|
|
73
|
-
const result = d.evaluate(expr, root, null, 7, null);
|
|
74
|
-
const out = [];
|
|
75
|
-
for (let i = 0; i < result.snapshotLength; i++) {
|
|
76
|
-
const n = result.snapshotItem(i);
|
|
77
|
-
if (n && n.nodeType === 1) out.push(n);
|
|
78
|
-
}
|
|
79
|
-
return out;
|
|
80
|
-
} catch {
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function queryText(root, text) {
|
|
85
|
-
const needle = normalizeText(text).toLowerCase();
|
|
86
|
-
if (!needle) return [];
|
|
87
|
-
const candidates = safeQueryAll(root, TEXT_CANDIDATES);
|
|
88
|
-
const exact = candidates.filter((c) => normalizeText(c.textContent).toLowerCase() === needle);
|
|
89
|
-
if (exact.length) return exact;
|
|
90
|
-
return candidates.filter((c) => normalizeText(c.textContent).toLowerCase().includes(needle));
|
|
91
|
-
}
|
|
92
|
-
function querySelectorStrategy(strategy, root) {
|
|
93
|
-
const value = strategy.value.trim();
|
|
94
|
-
if (!value) return [];
|
|
95
|
-
switch (strategy.kind) {
|
|
96
|
-
case "id": {
|
|
97
|
-
const id = value.startsWith("#") ? value.slice(1) : value;
|
|
98
|
-
return safeQueryAll(root, `#${escapeCss(id)}`);
|
|
99
|
-
}
|
|
100
|
-
case "guidely-id": {
|
|
101
|
-
const id = value.startsWith("#") ? value.slice(1) : value;
|
|
102
|
-
return safeQueryAll(root, attrSelector("data-guidely-id", id));
|
|
103
|
-
}
|
|
104
|
-
case "data-attr":
|
|
105
|
-
case "aria":
|
|
106
|
-
case "css":
|
|
107
|
-
return safeQueryAll(root, value.startsWith("[") || /^[a-z*#.[]/i.test(value) ? value : `[${value}]`);
|
|
108
|
-
case "text":
|
|
109
|
-
return queryText(root, value);
|
|
110
|
-
case "xpath":
|
|
111
|
-
return queryXPath(root, value);
|
|
112
|
-
default:
|
|
113
|
-
return [];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function resolveTarget(target, root = document) {
|
|
117
|
-
const selectors = Array.isArray(target) ? target : target.selectors;
|
|
118
|
-
for (const strategy of selectors) {
|
|
119
|
-
const matches = querySelectorStrategy(strategy, root).filter((el) => !isGuidelyElement(el) && isVisible(el));
|
|
120
|
-
if (matches.length === 1) return matches[0];
|
|
121
|
-
}
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
var TargetTimeoutError = class extends Error {
|
|
125
|
-
constructor(message = "Target element not found before timeout") {
|
|
126
|
-
super(message);
|
|
127
|
-
__publicField(this, "name", "TargetTimeoutError");
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
function waitForTarget(target, options = {}) {
|
|
131
|
-
const timeoutMs = options.timeoutMs ?? 5e3;
|
|
132
|
-
const root = options.root ?? document;
|
|
133
|
-
const pollMs = Math.min(250, Math.max(16, options.pollMs ?? 250));
|
|
134
|
-
return new Promise((resolve, reject) => {
|
|
135
|
-
const immediate = resolveTarget(target, root);
|
|
136
|
-
if (immediate) return resolve(immediate);
|
|
137
|
-
if (options.signal?.aborted) return reject(new DOMException("Aborted", "AbortError"));
|
|
138
|
-
let done = false;
|
|
139
|
-
let observer = null;
|
|
140
|
-
let timer = null;
|
|
141
|
-
let timeout = null;
|
|
142
|
-
const cleanup = () => {
|
|
143
|
-
done = true;
|
|
144
|
-
observer?.disconnect();
|
|
145
|
-
if (timer) clearInterval(timer);
|
|
146
|
-
if (timeout) clearTimeout(timeout);
|
|
147
|
-
options.signal?.removeEventListener("abort", onAbort);
|
|
148
|
-
};
|
|
149
|
-
const check = () => {
|
|
150
|
-
if (done) return;
|
|
151
|
-
const el = resolveTarget(target, root);
|
|
152
|
-
if (el) {
|
|
153
|
-
cleanup();
|
|
154
|
-
resolve(el);
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
const onAbort = () => {
|
|
158
|
-
cleanup();
|
|
159
|
-
reject(new DOMException("Aborted", "AbortError"));
|
|
160
|
-
};
|
|
161
|
-
options.signal?.addEventListener("abort", onAbort);
|
|
162
|
-
const observeRoot = root.nodeType === 9 ? root.documentElement : root;
|
|
163
|
-
if (typeof MutationObserver !== "undefined" && observeRoot) {
|
|
164
|
-
observer = new MutationObserver(check);
|
|
165
|
-
observer.observe(observeRoot, { childList: true, subtree: true, attributes: true, attributeFilter: ["class", "style", "hidden", "id", "data-tour", "data-guidely-id", "aria-label"] });
|
|
166
|
-
}
|
|
167
|
-
timer = setInterval(check, pollMs);
|
|
168
|
-
if (timeoutMs > 0) {
|
|
169
|
-
timeout = setTimeout(() => {
|
|
170
|
-
cleanup();
|
|
171
|
-
reject(new TargetTimeoutError());
|
|
172
|
-
}, timeoutMs);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
var GENERATED_ID = /(\d{4,}|:r[0-9a-z]+:|^radix-|^headlessui-|^mui-|^ember\d|^react-|^\w*-\d+$|__|^[a-f0-9]{8,}$|^svelte-)/i;
|
|
177
|
-
var GENERATED_CLASS = /(^css-|^sc-|^jss\d|^svelte-|^emotion-|^chakra-|^Mui|^_|[0-9a-f]{6,}|^\w{1,2}$|^[a-z]+-\d+$|[:[\]/])/;
|
|
178
|
-
var PREFERRED_DATA_ATTRS = ["data-testid", "data-tour", "data-test", "data-test-id", "data-cy", "data-qa", "data-id", "data-name", "data-guidely"];
|
|
179
|
-
var IGNORED_DATA_ATTRS = /^data-(guidely-id|state|v-|reactid|react|radix|headlessui|svelte|hydrated|orientation|highlighted|focus|key|index|rbd|dnd|rk-|sveltekit)/i;
|
|
180
|
-
function isStableId(id) {
|
|
181
|
-
return !!id && /^[A-Za-z][\w-]*$/.test(id) && !GENERATED_ID.test(id);
|
|
182
|
-
}
|
|
183
|
-
function isStableClass(cls) {
|
|
184
|
-
return !!cls && !GENERATED_CLASS.test(cls) && cls.length <= 40;
|
|
185
|
-
}
|
|
186
|
-
function uniqueIn(doc, selector, el) {
|
|
187
|
-
const all = safeQueryAll(doc, selector);
|
|
188
|
-
return all.length === 1 && all[0] === el;
|
|
189
|
-
}
|
|
190
|
-
function attrSelector(name, value) {
|
|
191
|
-
return `[${name}='${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}']`;
|
|
192
|
-
}
|
|
193
|
-
function cssPath(el, doc) {
|
|
194
|
-
const segments = [];
|
|
195
|
-
let cur = el;
|
|
196
|
-
while (cur && cur.nodeType === 1 && cur !== doc.body && cur !== doc.documentElement) {
|
|
197
|
-
const tag = cur.tagName.toLowerCase();
|
|
198
|
-
if (isStableId(cur.id)) {
|
|
199
|
-
segments.unshift(`#${cur.id}`);
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
let seg = tag;
|
|
203
|
-
const parent = cur.parentElement;
|
|
204
|
-
if (parent) {
|
|
205
|
-
const sameTag = Array.from(parent.children).filter((c) => c.tagName === cur.tagName);
|
|
206
|
-
if (sameTag.length > 1) {
|
|
207
|
-
const stableCls = Array.from(cur.classList).find((c) => isStableClass(c) && sameTag.filter((s) => s.classList.contains(c)).length === 1);
|
|
208
|
-
seg += stableCls ? `.${escapeCss(stableCls)}` : `:nth-of-type(${sameTag.indexOf(cur) + 1})`;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
segments.unshift(seg);
|
|
212
|
-
const candidate = segments.join(" > ");
|
|
213
|
-
if (uniqueIn(doc, candidate, el)) return candidate;
|
|
214
|
-
cur = parent;
|
|
215
|
-
}
|
|
216
|
-
const full = segments.join(" > ");
|
|
217
|
-
return uniqueIn(doc, full, el) ? full : null;
|
|
218
|
-
}
|
|
219
|
-
function textSnapshotOf(el) {
|
|
220
|
-
const he = el;
|
|
221
|
-
const own = normalizeText(he.innerText ?? el.textContent);
|
|
222
|
-
const alt = normalizeText(el.getAttribute("aria-label") || el.getAttribute("title") || el.getAttribute("placeholder") || el.getAttribute("alt") || el.value);
|
|
223
|
-
return (own || alt).slice(0, 200);
|
|
224
|
-
}
|
|
225
|
-
function generateSelectors(el) {
|
|
226
|
-
const doc = el.ownerDocument;
|
|
227
|
-
const out = [];
|
|
228
|
-
const seen = /* @__PURE__ */ new Set();
|
|
229
|
-
const push = (s) => {
|
|
230
|
-
const k = `${s.kind}:${s.value}`;
|
|
231
|
-
if (!seen.has(k)) {
|
|
232
|
-
seen.add(k);
|
|
233
|
-
out.push(s);
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
const tag = el.tagName.toLowerCase();
|
|
237
|
-
const guidelyId = el.getAttribute("data-guidely-id");
|
|
238
|
-
if (guidelyId && uniqueIn(doc, attrSelector("data-guidely-id", guidelyId), el)) push({ kind: "guidely-id", value: guidelyId, label: `Guidely id ${guidelyId}` });
|
|
239
|
-
if (isStableId(el.id) && uniqueIn(doc, `#${escapeCss(el.id)}`, el)) push({ kind: "id", value: `#${el.id}`, label: `id ${el.id}` });
|
|
240
|
-
const dataAttrs = Array.from(el.attributes).filter((a) => a.name.startsWith("data-") && !IGNORED_DATA_ATTRS.test(a.name) && a.value && a.value.length <= 120 && !/\d{5,}/.test(a.value));
|
|
241
|
-
dataAttrs.sort((a, b) => {
|
|
242
|
-
const ia = PREFERRED_DATA_ATTRS.indexOf(a.name);
|
|
243
|
-
const ib = PREFERRED_DATA_ATTRS.indexOf(b.name);
|
|
244
|
-
return (ia === -1 ? 99 : ia) - (ib === -1 ? 99 : ib);
|
|
245
|
-
});
|
|
246
|
-
for (const a of dataAttrs) {
|
|
247
|
-
const sel = attrSelector(a.name, a.value);
|
|
248
|
-
if (uniqueIn(doc, sel, el)) push({ kind: "data-attr", value: sel, label: `${a.name}=${a.value}` });
|
|
249
|
-
else if (uniqueIn(doc, tag + sel, el)) push({ kind: "data-attr", value: tag + sel, label: `${a.name}=${a.value}` });
|
|
250
|
-
}
|
|
251
|
-
const aria = el.getAttribute("aria-label");
|
|
252
|
-
if (aria && aria.length <= 120) {
|
|
253
|
-
const sel = attrSelector("aria-label", aria);
|
|
254
|
-
if (uniqueIn(doc, sel, el)) push({ kind: "aria", value: sel, label: aria });
|
|
255
|
-
else if (uniqueIn(doc, tag + sel, el)) push({ kind: "aria", value: tag + sel, label: aria });
|
|
256
|
-
}
|
|
257
|
-
const name = el.getAttribute("name");
|
|
258
|
-
if (name && uniqueIn(doc, tag + attrSelector("name", name), el)) push({ kind: "css", value: tag + attrSelector("name", name), label: `${tag} name=${name}` });
|
|
259
|
-
const role = el.getAttribute("role");
|
|
260
|
-
if (role) {
|
|
261
|
-
const title = el.getAttribute("title") || el.getAttribute("aria-labelledby");
|
|
262
|
-
const sel = title ? `[role='${role}']${attrSelector(el.getAttribute("title") ? "title" : "aria-labelledby", title)}` : `[role='${role}']`;
|
|
263
|
-
if (uniqueIn(doc, sel, el)) push({ kind: "css", value: sel, label: `role ${role}` });
|
|
264
|
-
}
|
|
265
|
-
if (tag === "a") {
|
|
266
|
-
const href = el.getAttribute("href");
|
|
267
|
-
if (href && href.length <= 200 && uniqueIn(doc, `a${attrSelector("href", href)}`, el)) push({ kind: "css", value: `a${attrSelector("href", href)}`, label: `link ${href}` });
|
|
268
|
-
}
|
|
269
|
-
const path = cssPath(el, doc);
|
|
270
|
-
if (path) push({ kind: "css", value: path, label: "css path" });
|
|
271
|
-
if (/^(button|a|h[1-6]|label|summary)$/.test(tag) || role === "button" || role === "link" || role === "tab" || role === "menuitem") {
|
|
272
|
-
const text = normalizeText(el.innerText ?? el.textContent);
|
|
273
|
-
if (text && text.length <= 80) push({ kind: "text", value: text, label: `text "${text}"` });
|
|
274
|
-
}
|
|
275
|
-
return out.slice(0, 10);
|
|
276
|
-
}
|
|
277
|
-
function describeElement(el) {
|
|
278
|
-
const r = el.getBoundingClientRect();
|
|
279
|
-
return {
|
|
280
|
-
selectors: generateSelectors(el),
|
|
281
|
-
textSnapshot: textSnapshotOf(el),
|
|
282
|
-
rect: { x: r.x, y: r.y, width: r.width, height: r.height },
|
|
283
|
-
tag: el.tagName.toLowerCase()
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export {
|
|
288
|
-
urlMatches,
|
|
289
|
-
normalizeText,
|
|
290
|
-
isVisible,
|
|
291
|
-
isGuidelyElement,
|
|
292
|
-
querySelectorStrategy,
|
|
293
|
-
resolveTarget,
|
|
294
|
-
TargetTimeoutError,
|
|
295
|
-
waitForTarget,
|
|
296
|
-
isStableId,
|
|
297
|
-
textSnapshotOf,
|
|
298
|
-
generateSelectors,
|
|
299
|
-
describeElement
|
|
300
|
-
};
|
|
301
|
-
//# sourceMappingURL=chunk-VNJPNGZ4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/selectors.ts"],"sourcesContent":["import { matchUrlPattern } from \"@guidelytech/shared/runtime\";\nimport type { SelectorStrategy, StepTarget } from \"@guidelytech/shared\";\n\n/**\n * URL matching used for `step.url`, `urlPatterns` and `trigger.urlPattern`: a pattern matches the\n * full URL, the path+query+hash, or the bare path (so `/deals` also matches `/deals?x=1`).\n */\nexport function urlMatches(pattern: string | undefined | null, url: string): boolean {\n if (!pattern) return true;\n if (matchUrlPattern(pattern, url)) return true;\n try {\n const u = new URL(url, \"http://localhost\");\n if (!pattern.includes(\"?\") && !pattern.includes(\"#\")) return matchUrlPattern(pattern, u.pathname) || matchUrlPattern(pattern, u.origin + u.pathname);\n } catch {\n /* ignore */\n }\n return false;\n}\n\nexport type QueryRoot = Document | DocumentFragment | Element;\n\nconst TEXT_CANDIDATES =\n \"button, a, [role='button'], [role='link'], [role='tab'], [role='menuitem'], h1, h2, h3, h4, h5, h6, label, summary\";\n\nconst HOST_ID = \"guidely-root\";\n\nfunction docOf(root: QueryRoot): Document {\n return root.nodeType === 9 ? (root as Document) : (root.ownerDocument as Document);\n}\n\n/** True when the environment has a layout engine (real browsers). happy-dom/jsdom report zero sizes. */\nfunction hasLayout(doc: Document): boolean {\n const de = doc.documentElement;\n if (!de) return false;\n const r = de.getBoundingClientRect();\n return r.width > 0 || r.height > 0;\n}\n\n/** Normalises whitespace in a text snippet. */\nexport function normalizeText(text: string | null | undefined): string {\n return (text || \"\").replace(/\\s+/g, \" \").trim();\n}\n\n/** Is the element rendered (not hidden by `hidden`, `display:none`, `visibility:hidden`, or zero size)? */\nexport function isVisible(el: Element): boolean {\n if (!el.isConnected) return false;\n const doc = el.ownerDocument;\n const win = doc.defaultView;\n let cur: Element | null = el;\n while (cur && cur !== doc.documentElement) {\n if ((cur as HTMLElement).hidden) return false;\n if (win) {\n const cs = win.getComputedStyle(cur);\n if (cs.display === \"none\" || cs.visibility === \"hidden\") return false;\n }\n cur = cur.parentElement ?? ((cur.getRootNode() as ShadowRoot).host as Element | undefined) ?? null;\n }\n if (hasLayout(doc)) {\n const r = el.getBoundingClientRect();\n if (r.width === 0 && r.height === 0) return false;\n }\n return true;\n}\n\n/** Elements that belong to Guidely's own UI are never valid targets. */\nexport function isGuidelyElement(el: Element | null): boolean {\n if (!el) return false;\n const root = el.getRootNode();\n if (root instanceof ShadowRoot && root.host.id === HOST_ID) return true;\n return el.id === HOST_ID || !!el.closest?.(`#${HOST_ID}`);\n}\n\nfunction safeQueryAll(root: QueryRoot, selector: string): Element[] {\n try {\n return Array.from(root.querySelectorAll(selector));\n } catch {\n return [];\n }\n}\n\nfunction escapeCss(value: string): string {\n const g = globalThis as { CSS?: { escape?: (v: string) => string } };\n if (g.CSS && typeof g.CSS.escape === \"function\") return g.CSS.escape(value);\n return value.replace(/[\"\\\\]/g, \"\\\\$&\");\n}\n\nfunction queryXPath(root: QueryRoot, expr: string): Element[] {\n const doc = docOf(root);\n const d = doc as Document & { evaluate?: Document[\"evaluate\"] };\n if (typeof d.evaluate !== \"function\") return [];\n try {\n const result = d.evaluate(expr, root, null, 7 /* ORDERED_NODE_SNAPSHOT_TYPE */, null);\n const out: Element[] = [];\n for (let i = 0; i < result.snapshotLength; i++) {\n const n = result.snapshotItem(i);\n if (n && n.nodeType === 1) out.push(n as Element);\n }\n return out;\n } catch {\n return [];\n }\n}\n\nfunction queryText(root: QueryRoot, text: string): Element[] {\n const needle = normalizeText(text).toLowerCase();\n if (!needle) return [];\n const candidates = safeQueryAll(root, TEXT_CANDIDATES);\n const exact = candidates.filter((c) => normalizeText(c.textContent).toLowerCase() === needle);\n if (exact.length) return exact;\n return candidates.filter((c) => normalizeText(c.textContent).toLowerCase().includes(needle));\n}\n\n/** Resolves every element matching one strategy (visible or not). */\nexport function querySelectorStrategy(strategy: SelectorStrategy, root: QueryRoot): Element[] {\n const value = strategy.value.trim();\n if (!value) return [];\n switch (strategy.kind) {\n case \"id\": {\n const id = value.startsWith(\"#\") ? value.slice(1) : value;\n return safeQueryAll(root, `#${escapeCss(id)}`);\n }\n case \"guidely-id\": {\n const id = value.startsWith(\"#\") ? value.slice(1) : value;\n return safeQueryAll(root, attrSelector(\"data-guidely-id\", id));\n }\n case \"data-attr\":\n case \"aria\":\n case \"css\":\n return safeQueryAll(root, value.startsWith(\"[\") || /^[a-z*#.[]/i.test(value) ? value : `[${value}]`);\n case \"text\":\n return queryText(root, value);\n case \"xpath\":\n return queryXPath(root, value);\n default:\n return [];\n }\n}\n\n/**\n * Resolves a step target by trying each strategy in order. A strategy wins only when it\n * resolves to exactly one *visible* element; otherwise the next strategy is tried.\n */\nexport function resolveTarget(target: Pick<StepTarget, \"selectors\"> | SelectorStrategy[], root: QueryRoot = document): Element | null {\n const selectors = Array.isArray(target) ? target : target.selectors;\n for (const strategy of selectors) {\n const matches = querySelectorStrategy(strategy, root).filter((el) => !isGuidelyElement(el) && isVisible(el));\n if (matches.length === 1) return matches[0] as Element;\n }\n return null;\n}\n\nexport interface WaitForTargetOptions {\n /** Give up after this many milliseconds (default 5000). */\n timeoutMs?: number;\n /** Abort early. */\n signal?: AbortSignal;\n root?: QueryRoot;\n /** Polling fallback interval (default 250ms, which is also the maximum). */\n pollMs?: number;\n}\n\nexport class TargetTimeoutError extends Error {\n override name = \"TargetTimeoutError\";\n constructor(message = \"Target element not found before timeout\") {\n super(message);\n }\n}\n\n/**\n * Waits until `resolveTarget` finds an element. Uses a MutationObserver plus a polling fallback\n * (at most every 250ms) so visibility changes without DOM mutations are also detected.\n */\nexport function waitForTarget(target: Pick<StepTarget, \"selectors\"> | SelectorStrategy[], options: WaitForTargetOptions = {}): Promise<Element> {\n const timeoutMs = options.timeoutMs ?? 5000;\n const root = options.root ?? document;\n const pollMs = Math.min(250, Math.max(16, options.pollMs ?? 250));\n return new Promise<Element>((resolve, reject) => {\n const immediate = resolveTarget(target, root);\n if (immediate) return resolve(immediate);\n if (options.signal?.aborted) return reject(new DOMException(\"Aborted\", \"AbortError\"));\n let done = false;\n let observer: MutationObserver | null = null;\n let timer: ReturnType<typeof setInterval> | null = null;\n let timeout: ReturnType<typeof setTimeout> | null = null;\n const cleanup = () => {\n done = true;\n observer?.disconnect();\n if (timer) clearInterval(timer);\n if (timeout) clearTimeout(timeout);\n options.signal?.removeEventListener(\"abort\", onAbort);\n };\n const check = () => {\n if (done) return;\n const el = resolveTarget(target, root);\n if (el) {\n cleanup();\n resolve(el);\n }\n };\n const onAbort = () => {\n cleanup();\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n };\n options.signal?.addEventListener(\"abort\", onAbort);\n const observeRoot = root.nodeType === 9 ? (root as Document).documentElement : (root as Element);\n if (typeof MutationObserver !== \"undefined\" && observeRoot) {\n observer = new MutationObserver(check);\n observer.observe(observeRoot, { childList: true, subtree: true, attributes: true, attributeFilter: [\"class\", \"style\", \"hidden\", \"id\", \"data-tour\", \"data-guidely-id\", \"aria-label\"] });\n }\n timer = setInterval(check, pollMs);\n if (timeoutMs > 0) {\n timeout = setTimeout(() => {\n cleanup();\n reject(new TargetTimeoutError());\n }, timeoutMs);\n }\n });\n}\n\n// ---------------------------------------------------------------------------\n// Selector generation (used by the element picker)\n// ---------------------------------------------------------------------------\n\nconst GENERATED_ID = /(\\d{4,}|:r[0-9a-z]+:|^radix-|^headlessui-|^mui-|^ember\\d|^react-|^\\w*-\\d+$|__|^[a-f0-9]{8,}$|^svelte-)/i;\nconst GENERATED_CLASS = /(^css-|^sc-|^jss\\d|^svelte-|^emotion-|^chakra-|^Mui|^_|[0-9a-f]{6,}|^\\w{1,2}$|^[a-z]+-\\d+$|[:[\\]/])/;\nconst PREFERRED_DATA_ATTRS = [\"data-testid\", \"data-tour\", \"data-test\", \"data-test-id\", \"data-cy\", \"data-qa\", \"data-id\", \"data-name\", \"data-guidely\"];\nconst IGNORED_DATA_ATTRS = /^data-(guidely-id|state|v-|reactid|react|radix|headlessui|svelte|hydrated|orientation|highlighted|focus|key|index|rbd|dnd|rk-|sveltekit)/i;\n\n/** Is this id stable enough to be used as a selector (not generated by a framework)? */\nexport function isStableId(id: string): boolean {\n return !!id && /^[A-Za-z][\\w-]*$/.test(id) && !GENERATED_ID.test(id);\n}\n\nfunction isStableClass(cls: string): boolean {\n return !!cls && !GENERATED_CLASS.test(cls) && cls.length <= 40;\n}\n\nfunction uniqueIn(doc: Document, selector: string, el: Element): boolean {\n const all = safeQueryAll(doc, selector);\n return all.length === 1 && all[0] === el;\n}\n\nfunction attrSelector(name: string, value: string): string {\n return `[${name}='${value.replace(/\\\\/g, \"\\\\\\\\\").replace(/'/g, \"\\\\'\")}']`;\n}\n\nfunction cssPath(el: Element, doc: Document): string | null {\n const segments: string[] = [];\n let cur: Element | null = el;\n while (cur && cur.nodeType === 1 && cur !== doc.body && cur !== doc.documentElement) {\n const tag = cur.tagName.toLowerCase();\n if (isStableId(cur.id)) {\n segments.unshift(`#${cur.id}`);\n break;\n }\n let seg = tag;\n const parent: Element | null = cur.parentElement;\n if (parent) {\n const sameTag = Array.from(parent.children).filter((c) => c.tagName === cur!.tagName);\n if (sameTag.length > 1) {\n const stableCls = Array.from(cur.classList).find((c) => isStableClass(c) && sameTag.filter((s) => s.classList.contains(c)).length === 1);\n seg += stableCls ? `.${escapeCss(stableCls)}` : `:nth-of-type(${sameTag.indexOf(cur) + 1})`;\n }\n }\n segments.unshift(seg);\n const candidate = segments.join(\" > \");\n if (uniqueIn(doc, candidate, el)) return candidate;\n cur = parent;\n }\n const full = segments.join(\" > \");\n return uniqueIn(doc, full, el) ? full : null;\n}\n\n/** Short human-readable text for an element, trimmed to 200 characters. */\nexport function textSnapshotOf(el: Element): string {\n const he = el as HTMLElement;\n const own = normalizeText(he.innerText ?? el.textContent);\n const alt = normalizeText(el.getAttribute(\"aria-label\") || el.getAttribute(\"title\") || el.getAttribute(\"placeholder\") || el.getAttribute(\"alt\") || (el as HTMLInputElement).value);\n return (own || alt).slice(0, 200);\n}\n\n/**\n * Generates an ordered list of selector strategies for an element, most robust first:\n * stable id → data-* attributes → aria-label → role/name → short unique CSS path → visible text.\n */\nexport function generateSelectors(el: Element): SelectorStrategy[] {\n const doc = el.ownerDocument;\n const out: SelectorStrategy[] = [];\n const seen = new Set<string>();\n const push = (s: SelectorStrategy) => {\n const k = `${s.kind}:${s.value}`;\n if (!seen.has(k)) {\n seen.add(k);\n out.push(s);\n }\n };\n const tag = el.tagName.toLowerCase();\n\n // A Guidely id is shared with the mobile apps, so it is the most portable target there is.\n const guidelyId = el.getAttribute(\"data-guidely-id\");\n if (guidelyId && uniqueIn(doc, attrSelector(\"data-guidely-id\", guidelyId), el)) push({ kind: \"guidely-id\", value: guidelyId, label: `Guidely id ${guidelyId}` });\n if (isStableId(el.id) && uniqueIn(doc, `#${escapeCss(el.id)}`, el)) push({ kind: \"id\", value: `#${el.id}`, label: `id ${el.id}` });\n\n const dataAttrs = Array.from(el.attributes).filter((a) => a.name.startsWith(\"data-\") && !IGNORED_DATA_ATTRS.test(a.name) && a.value && a.value.length <= 120 && !/\\d{5,}/.test(a.value));\n dataAttrs.sort((a, b) => {\n const ia = PREFERRED_DATA_ATTRS.indexOf(a.name);\n const ib = PREFERRED_DATA_ATTRS.indexOf(b.name);\n return (ia === -1 ? 99 : ia) - (ib === -1 ? 99 : ib);\n });\n for (const a of dataAttrs) {\n const sel = attrSelector(a.name, a.value);\n if (uniqueIn(doc, sel, el)) push({ kind: \"data-attr\", value: sel, label: `${a.name}=${a.value}` });\n else if (uniqueIn(doc, tag + sel, el)) push({ kind: \"data-attr\", value: tag + sel, label: `${a.name}=${a.value}` });\n }\n\n const aria = el.getAttribute(\"aria-label\");\n if (aria && aria.length <= 120) {\n const sel = attrSelector(\"aria-label\", aria);\n if (uniqueIn(doc, sel, el)) push({ kind: \"aria\", value: sel, label: aria });\n else if (uniqueIn(doc, tag + sel, el)) push({ kind: \"aria\", value: tag + sel, label: aria });\n }\n\n const name = el.getAttribute(\"name\");\n if (name && uniqueIn(doc, tag + attrSelector(\"name\", name), el)) push({ kind: \"css\", value: tag + attrSelector(\"name\", name), label: `${tag} name=${name}` });\n const role = el.getAttribute(\"role\");\n if (role) {\n const title = el.getAttribute(\"title\") || el.getAttribute(\"aria-labelledby\");\n const sel = title ? `[role='${role}']${attrSelector(el.getAttribute(\"title\") ? \"title\" : \"aria-labelledby\", title)}` : `[role='${role}']`;\n if (uniqueIn(doc, sel, el)) push({ kind: \"css\", value: sel, label: `role ${role}` });\n }\n if (tag === \"a\") {\n const href = el.getAttribute(\"href\");\n if (href && href.length <= 200 && uniqueIn(doc, `a${attrSelector(\"href\", href)}`, el)) push({ kind: \"css\", value: `a${attrSelector(\"href\", href)}`, label: `link ${href}` });\n }\n\n const path = cssPath(el, doc);\n if (path) push({ kind: \"css\", value: path, label: \"css path\" });\n\n if (/^(button|a|h[1-6]|label|summary)$/.test(tag) || role === \"button\" || role === \"link\" || role === \"tab\" || role === \"menuitem\") {\n const text = normalizeText((el as HTMLElement).innerText ?? el.textContent);\n if (text && text.length <= 80) push({ kind: \"text\", value: text, label: `text \"${text}\"` });\n }\n return out.slice(0, 10);\n}\n\nexport interface ElementDescription {\n selectors: SelectorStrategy[];\n textSnapshot: string;\n rect: { x: number; y: number; width: number; height: number };\n tag: string;\n}\n\n/** Everything the authoring picker needs for one element. */\nexport function describeElement(el: Element): ElementDescription {\n const r = el.getBoundingClientRect();\n return {\n selectors: generateSelectors(el),\n textSnapshot: textSnapshotOf(el),\n rect: { x: r.x, y: r.y, width: r.width, height: r.height },\n tag: el.tagName.toLowerCase(),\n };\n}\n"],"mappings":";;;;;AAAA,SAAS,uBAAuB;AAOzB,SAAS,WAAW,SAAoC,KAAsB;AACnF,MAAI,CAAC,QAAS,QAAO;AACrB,MAAI,gBAAgB,SAAS,GAAG,EAAG,QAAO;AAC1C,MAAI;AACF,UAAM,IAAI,IAAI,IAAI,KAAK,kBAAkB;AACzC,QAAI,CAAC,QAAQ,SAAS,GAAG,KAAK,CAAC,QAAQ,SAAS,GAAG,EAAG,QAAO,gBAAgB,SAAS,EAAE,QAAQ,KAAK,gBAAgB,SAAS,EAAE,SAAS,EAAE,QAAQ;AAAA,EACrJ,QAAQ;AAAA,EAER;AACA,SAAO;AACT;AAIA,IAAM,kBACJ;AAEF,IAAM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