@qaiddev/thumbs-embed 1.0.9 → 1.0.10
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/index.d.ts +14 -0
- package/dist/qaid.js +163 -141
- package/dist/qaid.js.map +1 -1
- package/dist/qaid.umd.cjs +5 -5
- package/dist/qaid.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/qaid.js
CHANGED
|
@@ -16,12 +16,12 @@ const et = "button.qaid-btn{width:var(--qaid-btn-size);height:var(--qaid-btn-siz
|
|
|
16
16
|
large: 32
|
|
17
17
|
};
|
|
18
18
|
function nt(e, t, i) {
|
|
19
|
-
const [o, n,
|
|
20
|
-
return 0.2126 * o + 0.7152 * n + 0.0722 *
|
|
19
|
+
const [o, n, s] = [e, t, i].map((r) => (r = r / 255, r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4)));
|
|
20
|
+
return 0.2126 * o + 0.7152 * n + 0.0722 * s;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function st(e) {
|
|
23
23
|
if (e.startsWith("#")) {
|
|
24
|
-
const i = e.slice(1), o = i.length === 3 ? i.split("").map((
|
|
24
|
+
const i = e.slice(1), o = i.length === 3 ? i.split("").map((s) => s + s).join("") : i, n = parseInt(o, 16);
|
|
25
25
|
return {
|
|
26
26
|
r: n >> 16 & 255,
|
|
27
27
|
g: n >> 8 & 255,
|
|
@@ -35,8 +35,8 @@ function at(e) {
|
|
|
35
35
|
b: parseInt(t[3])
|
|
36
36
|
} : null;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const t =
|
|
38
|
+
function at(e) {
|
|
39
|
+
const t = st(e);
|
|
40
40
|
return t && nt(t.r, t.g, t.b) > 0.4 ? "black" : "white";
|
|
41
41
|
}
|
|
42
42
|
function rt(e = {}) {
|
|
@@ -45,19 +45,19 @@ function rt(e = {}) {
|
|
|
45
45
|
negativeColor: i = "rgb(255, 0, 0)",
|
|
46
46
|
markerColor: o = "#6366f1",
|
|
47
47
|
buttonSize: n = "medium",
|
|
48
|
-
modalWidth:
|
|
48
|
+
modalWidth: s = 400,
|
|
49
49
|
backdropOpacity: r = 0.3,
|
|
50
50
|
fontFamily: l = "system-ui, -apple-system, sans-serif",
|
|
51
51
|
fontSize: d = 16
|
|
52
|
-
} = e,
|
|
52
|
+
} = e, a = it[n], c = ot[n], h = at(o);
|
|
53
53
|
return {
|
|
54
54
|
"--qaid-positive": t,
|
|
55
55
|
"--qaid-negative": i,
|
|
56
56
|
"--qaid-marker": o,
|
|
57
57
|
"--qaid-marker-text": h,
|
|
58
|
-
"--qaid-btn-size": `${
|
|
58
|
+
"--qaid-btn-size": `${a}px`,
|
|
59
59
|
"--qaid-icon-size": `${c}px`,
|
|
60
|
-
"--qaid-modal-width": `${
|
|
60
|
+
"--qaid-modal-width": `${s}px`,
|
|
61
61
|
"--qaid-backdrop-opacity": String(r),
|
|
62
62
|
"--qaid-font-family": l,
|
|
63
63
|
"--qaid-font-size": `${d}px`
|
|
@@ -67,7 +67,7 @@ function dt(e, t) {
|
|
|
67
67
|
for (const [i, o] of Object.entries(t))
|
|
68
68
|
e.style.setProperty(i, o);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function B() {
|
|
71
71
|
return Q + et;
|
|
72
72
|
}
|
|
73
73
|
function ct() {
|
|
@@ -116,13 +116,13 @@ function mt(e) {
|
|
|
116
116
|
function ft(e) {
|
|
117
117
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function bt(e) {
|
|
120
120
|
const t = V(e);
|
|
121
121
|
return t ? `[${t}]` : e.id ? `#${ft(e.id)}` : mt(e);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function gt(e) {
|
|
124
124
|
const t = ut(e), i = V(e);
|
|
125
|
-
return { selector:
|
|
125
|
+
return { selector: bt(e), text: t, dataAttr: i };
|
|
126
126
|
}
|
|
127
127
|
const U = {
|
|
128
128
|
width: 400,
|
|
@@ -132,18 +132,18 @@ const U = {
|
|
|
132
132
|
viewportPadding: 16
|
|
133
133
|
};
|
|
134
134
|
function vt(e, t, i, o, n) {
|
|
135
|
-
const
|
|
135
|
+
const s = e.y, r = t - (e.y + e.height);
|
|
136
136
|
if (r >= i + o)
|
|
137
137
|
return {
|
|
138
138
|
top: e.y + e.height + o,
|
|
139
139
|
position: "below"
|
|
140
140
|
};
|
|
141
|
-
if (
|
|
141
|
+
if (s >= i + o)
|
|
142
142
|
return {
|
|
143
143
|
top: e.y - i - o,
|
|
144
144
|
position: "above"
|
|
145
145
|
};
|
|
146
|
-
const l = r >
|
|
146
|
+
const l = r > s ? "below" : "above";
|
|
147
147
|
let d;
|
|
148
148
|
return l === "below" ? d = Math.min(
|
|
149
149
|
e.y + e.height + o,
|
|
@@ -151,15 +151,15 @@ function vt(e, t, i, o, n) {
|
|
|
151
151
|
) : d = Math.max(n, e.y - i - o), { top: d, position: l };
|
|
152
152
|
}
|
|
153
153
|
function yt(e, t, i, o) {
|
|
154
|
-
let
|
|
155
|
-
return
|
|
154
|
+
let s = e.x + e.width / 2 - i / 2;
|
|
155
|
+
return s = Math.max(o, Math.min(s, t - i - o)), s;
|
|
156
156
|
}
|
|
157
157
|
function wt(e, t, i, o = 24, n = 24) {
|
|
158
158
|
const r = e.clickX - t - n / 2;
|
|
159
159
|
return Math.max(o, Math.min(r, i - o - n / 2));
|
|
160
160
|
}
|
|
161
161
|
function xt(e, t, i, o = U) {
|
|
162
|
-
const n = o.height + o.arrowHeight,
|
|
162
|
+
const n = o.height + o.arrowHeight, s = vt(
|
|
163
163
|
e,
|
|
164
164
|
i,
|
|
165
165
|
n,
|
|
@@ -172,38 +172,38 @@ function xt(e, t, i, o = U) {
|
|
|
172
172
|
o.viewportPadding
|
|
173
173
|
);
|
|
174
174
|
return {
|
|
175
|
-
top:
|
|
175
|
+
top: s.top,
|
|
176
176
|
left: r,
|
|
177
|
-
position:
|
|
177
|
+
position: s.position
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
function qt(e, t, i, o = U) {
|
|
181
|
-
const n = xt(e, t, i, o),
|
|
181
|
+
const n = xt(e, t, i, o), s = wt(
|
|
182
182
|
e,
|
|
183
183
|
n.left,
|
|
184
184
|
o.width
|
|
185
185
|
);
|
|
186
186
|
return {
|
|
187
187
|
modal: n,
|
|
188
|
-
arrow: { left:
|
|
188
|
+
arrow: { left: s }
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
191
|
const kt = 20;
|
|
192
192
|
function Ct(e) {
|
|
193
|
-
const t = [], i = console.error, o = console.warn, n = console.log,
|
|
193
|
+
const t = [], i = console.error, o = console.warn, n = console.log, s = (r, l) => {
|
|
194
194
|
const d = {
|
|
195
|
-
message: l.map((
|
|
195
|
+
message: l.map((a) => String(a)).join(" "),
|
|
196
196
|
timestamp: Date.now(),
|
|
197
197
|
level: r
|
|
198
198
|
};
|
|
199
199
|
t.length >= kt && t.shift(), t.push(d), e && e(d);
|
|
200
200
|
};
|
|
201
201
|
return console.error = function(...r) {
|
|
202
|
-
|
|
202
|
+
s("error", r), i.apply(console, r);
|
|
203
203
|
}, console.warn = function(...r) {
|
|
204
|
-
|
|
204
|
+
s("warn", r), o.apply(console, r);
|
|
205
205
|
}, console.log = function(...r) {
|
|
206
|
-
|
|
206
|
+
s("log", r), n.apply(console, r);
|
|
207
207
|
}, {
|
|
208
208
|
errors: t,
|
|
209
209
|
restore: () => {
|
|
@@ -211,13 +211,13 @@ function Ct(e) {
|
|
|
211
211
|
}
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
|
-
const St = 20,
|
|
214
|
+
const St = 20, z = 4096;
|
|
215
215
|
function q(e) {
|
|
216
216
|
if (e == null) return;
|
|
217
217
|
const t = typeof e == "string" ? e : JSON.stringify(e);
|
|
218
|
-
return t.length >
|
|
218
|
+
return t.length > z ? t.slice(0, z) + "…[truncated]" : t;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function O(e, t) {
|
|
221
221
|
e.length >= St && e.shift(), e.push(t);
|
|
222
222
|
}
|
|
223
223
|
async function Et(e) {
|
|
@@ -230,38 +230,38 @@ async function Et(e) {
|
|
|
230
230
|
}
|
|
231
231
|
function Tt() {
|
|
232
232
|
const e = [], t = window.fetch;
|
|
233
|
-
window.fetch = async function(n,
|
|
234
|
-
const r = typeof n == "string" ? n : n instanceof URL ? n.toString() : n.url, l =
|
|
233
|
+
window.fetch = async function(n, s) {
|
|
234
|
+
const r = typeof n == "string" ? n : n instanceof URL ? n.toString() : n.url, l = s?.method ?? (typeof n == "object" && "method" in n ? n.method : "GET");
|
|
235
235
|
let d;
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
if (
|
|
239
|
-
const c = await Et(
|
|
240
|
-
|
|
236
|
+
s?.body && (d = q(s.body));
|
|
237
|
+
const a = await t.apply(window, [n, s]);
|
|
238
|
+
if (a.status >= 400) {
|
|
239
|
+
const c = await Et(a);
|
|
240
|
+
O(e, {
|
|
241
241
|
url: r,
|
|
242
242
|
method: l.toUpperCase(),
|
|
243
|
-
status:
|
|
244
|
-
statusText:
|
|
243
|
+
status: a.status,
|
|
244
|
+
statusText: a.statusText,
|
|
245
245
|
requestBody: d,
|
|
246
246
|
responseBody: c,
|
|
247
247
|
timestamp: Date.now()
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
return
|
|
250
|
+
return a;
|
|
251
251
|
};
|
|
252
252
|
const i = XMLHttpRequest.prototype.open, o = XMLHttpRequest.prototype.send;
|
|
253
|
-
return XMLHttpRequest.prototype.open = function(n,
|
|
254
|
-
return this._qaid_method = n, this._qaid_url = typeof
|
|
253
|
+
return XMLHttpRequest.prototype.open = function(n, s, ...r) {
|
|
254
|
+
return this._qaid_method = n, this._qaid_url = typeof s == "string" ? s : s.toString(), i.apply(this, [n, s, ...r]);
|
|
255
255
|
}, XMLHttpRequest.prototype.send = function(n) {
|
|
256
|
-
const
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
url:
|
|
260
|
-
method:
|
|
261
|
-
status:
|
|
262
|
-
statusText:
|
|
256
|
+
const s = this, r = n ? q(n) : void 0;
|
|
257
|
+
return s.addEventListener("load", function() {
|
|
258
|
+
s.status >= 400 && O(e, {
|
|
259
|
+
url: s._qaid_url,
|
|
260
|
+
method: s._qaid_method.toUpperCase(),
|
|
261
|
+
status: s.status,
|
|
262
|
+
statusText: s.statusText,
|
|
263
263
|
requestBody: r,
|
|
264
|
-
responseBody: q(
|
|
264
|
+
responseBody: q(s.responseText),
|
|
265
265
|
timestamp: Date.now()
|
|
266
266
|
});
|
|
267
267
|
}), o.apply(this, [n]);
|
|
@@ -290,16 +290,16 @@ function Lt() {
|
|
|
290
290
|
}
|
|
291
291
|
function Rt(e = {}) {
|
|
292
292
|
const t = e.maxDuration ?? 15, i = e.videoBitsPerSecond ?? 8e5;
|
|
293
|
-
let o = null, n = null,
|
|
294
|
-
function
|
|
295
|
-
d !== null && (clearInterval(d), d = null), p !== null && (clearTimeout(p), p = null), o && (o.getTracks().forEach((m) => m.stop()), o = null), n = null,
|
|
293
|
+
let o = null, n = null, s = [], r = null, l = null, d = null, a = 0, c = null, h = null, u = !1, p = null;
|
|
294
|
+
function g() {
|
|
295
|
+
d !== null && (clearInterval(d), d = null), p !== null && (clearTimeout(p), p = null), o && (o.getTracks().forEach((m) => m.stop()), o = null), n = null, s = [], r = null, l = null, c = null, h = null;
|
|
296
296
|
}
|
|
297
297
|
function f() {
|
|
298
298
|
u || (u = !0, n && n.state !== "inactive" && n.stop());
|
|
299
299
|
}
|
|
300
300
|
return {
|
|
301
301
|
async start() {
|
|
302
|
-
u = !1,
|
|
302
|
+
u = !1, s = [];
|
|
303
303
|
const m = Lt();
|
|
304
304
|
if (!m)
|
|
305
305
|
throw new Error("No supported video MIME type found");
|
|
@@ -317,16 +317,16 @@ function Rt(e = {}) {
|
|
|
317
317
|
}), n = new MediaRecorder(o, {
|
|
318
318
|
mimeType: m,
|
|
319
319
|
videoBitsPerSecond: i
|
|
320
|
-
}), n.ondataavailable = (
|
|
321
|
-
|
|
320
|
+
}), n.ondataavailable = (b) => {
|
|
321
|
+
b.data.size > 0 && s.push(b.data);
|
|
322
322
|
}, n.onstop = () => {
|
|
323
|
-
const
|
|
324
|
-
c && c(
|
|
323
|
+
const b = new Blob(s, { type: m });
|
|
324
|
+
c && c(b), l && l(b), o && o.getTracks().forEach((x) => x.stop());
|
|
325
325
|
}, n.onerror = () => {
|
|
326
326
|
h && h(new Error("MediaRecorder error"));
|
|
327
|
-
}, n.start(1e3),
|
|
328
|
-
const
|
|
329
|
-
r && r(
|
|
327
|
+
}, n.start(1e3), a = Date.now(), d = setInterval(() => {
|
|
328
|
+
const b = Math.floor((Date.now() - a) / 1e3);
|
|
329
|
+
r && r(b);
|
|
330
330
|
}, 1e3), p = setTimeout(() => {
|
|
331
331
|
f();
|
|
332
332
|
}, t * 1e3);
|
|
@@ -343,23 +343,23 @@ function Rt(e = {}) {
|
|
|
343
343
|
l = m;
|
|
344
344
|
},
|
|
345
345
|
destroy() {
|
|
346
|
-
f(),
|
|
346
|
+
f(), g();
|
|
347
347
|
}
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function Ht(e = 640) {
|
|
351
351
|
return typeof window < "u" && window.innerWidth < e;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
const o = i.map((
|
|
355
|
-
i.forEach((
|
|
353
|
+
function P(e, t, i) {
|
|
354
|
+
const o = i.map((s) => s.style.visibility);
|
|
355
|
+
i.forEach((s) => s.style.visibility = "hidden");
|
|
356
356
|
const n = document.elementFromPoint(e, t);
|
|
357
|
-
return i.forEach((
|
|
357
|
+
return i.forEach((s, r) => s.style.visibility = o[r]), n;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function A(e) {
|
|
360
360
|
return e ? e.hasAttribute("data-qaid-embed") || e.hasAttribute("data-qaid-embed-overlay") ? !0 : !!e.closest("[data-qaid-embed], [data-qaid-embed-overlay]") : !1;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Mt(e, t = 0) {
|
|
363
363
|
const i = e.getBoundingClientRect();
|
|
364
364
|
return {
|
|
365
365
|
x: i.left - t,
|
|
@@ -368,7 +368,7 @@ function Dt(e, t = 0) {
|
|
|
368
368
|
height: i.height + t * 2
|
|
369
369
|
};
|
|
370
370
|
}
|
|
371
|
-
async function
|
|
371
|
+
async function Dt(e = {}) {
|
|
372
372
|
const { quality: t = 1, maxWidth: i = 1280, maxHeight: o = 800 } = e;
|
|
373
373
|
try {
|
|
374
374
|
if (!navigator.mediaDevices?.getDisplayMedia)
|
|
@@ -378,7 +378,7 @@ async function Ht(e = {}) {
|
|
|
378
378
|
video: {
|
|
379
379
|
displaySurface: "browser"
|
|
380
380
|
}
|
|
381
|
-
}),
|
|
381
|
+
}), s = n.getVideoTracks()[0], r = s.getSettings(), l = document.createElement("video");
|
|
382
382
|
l.srcObject = n, l.muted = !0, await new Promise((f) => {
|
|
383
383
|
l.onloadedmetadata = () => {
|
|
384
384
|
l.play(), f();
|
|
@@ -389,15 +389,15 @@ async function Ht(e = {}) {
|
|
|
389
389
|
};
|
|
390
390
|
m();
|
|
391
391
|
}), await new Promise((f) => setTimeout(f, 100));
|
|
392
|
-
const d = r.width || l.videoWidth,
|
|
392
|
+
const d = r.width || l.videoWidth, a = r.height || l.videoHeight, c = Math.min(i / d, o / a, 1), h = Math.round(d * c), u = Math.round(a * c), p = document.createElement("canvas");
|
|
393
393
|
p.width = h, p.height = u;
|
|
394
|
-
const
|
|
395
|
-
return
|
|
394
|
+
const g = p.getContext("2d");
|
|
395
|
+
return g ? (g.drawImage(l, 0, 0, h, u), s.stop(), p.toDataURL("image/webp", t)) : (s.stop(), null);
|
|
396
396
|
} catch (n) {
|
|
397
397
|
return console.warn("Screenshot capture failed:", n), null;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
const $ = "https://qaid.dev/lib/html2canvas.min.js",
|
|
400
|
+
const $ = "https://qaid.dev/lib/html2canvas.min.js", Bt = 1e4, zt = 50;
|
|
401
401
|
let y = null;
|
|
402
402
|
function Ut() {
|
|
403
403
|
if (typeof document > "u" || typeof window > "u")
|
|
@@ -405,7 +405,7 @@ function Ut() {
|
|
|
405
405
|
const e = document.createElement("canvas");
|
|
406
406
|
return typeof e.getContext == "function" && !!e.getContext("2d");
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Ot() {
|
|
409
409
|
return window.html2canvas ? Promise.resolve(!0) : y || (y = new Promise((e) => {
|
|
410
410
|
if (!document.querySelector(
|
|
411
411
|
`script[src="${$}"]`
|
|
@@ -418,21 +418,21 @@ function Pt() {
|
|
|
418
418
|
e(!0);
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
421
|
-
if (Date.now() - i >
|
|
421
|
+
if (Date.now() - i > Bt) {
|
|
422
422
|
y = null, e(!1);
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
425
|
-
setTimeout(o,
|
|
425
|
+
setTimeout(o, zt);
|
|
426
426
|
};
|
|
427
427
|
o();
|
|
428
428
|
}), y);
|
|
429
429
|
}
|
|
430
|
-
async function
|
|
430
|
+
async function Pt(e = {}) {
|
|
431
431
|
const { quality: t = 0.8, maxWidth: i = 1280, maxHeight: o = 800 } = e;
|
|
432
432
|
try {
|
|
433
|
-
if (!await
|
|
433
|
+
if (!await Ot() || !window.html2canvas)
|
|
434
434
|
return console.warn("html2canvas failed to load"), null;
|
|
435
|
-
const
|
|
435
|
+
const s = await window.html2canvas(document.body, {
|
|
436
436
|
useCORS: !0,
|
|
437
437
|
allowTaint: !1,
|
|
438
438
|
logging: !1,
|
|
@@ -442,21 +442,21 @@ async function At(e = {}) {
|
|
|
442
442
|
height: document.documentElement.clientHeight,
|
|
443
443
|
x: window.scrollX,
|
|
444
444
|
y: window.scrollY,
|
|
445
|
-
ignoreElements: (
|
|
446
|
-
}), r =
|
|
445
|
+
ignoreElements: (a) => a instanceof HTMLElement ? a.classList.contains("qaid-buttons") || a.classList.contains("qaid-targeting-overlay") || a.classList.contains("qaid-modal-container") || a.classList.contains("qaid-bottom-sheet") || a.classList.contains("qaid-backdrop") || a.classList.contains("qaid-selected-marker") || a.classList.contains("qaid-tooltip-text") || a.classList.contains("qaid-recording-indicator") || a.classList.contains("qaid-video-preview") || a.className?.toString().startsWith?.("qaid-") : !1
|
|
446
|
+
}), r = s.width, l = s.height, d = Math.min(i / r, o / l, 1);
|
|
447
447
|
if (d < 1) {
|
|
448
|
-
const
|
|
449
|
-
h.width =
|
|
448
|
+
const a = Math.round(r * d), c = Math.round(l * d), h = document.createElement("canvas");
|
|
449
|
+
h.width = a, h.height = c;
|
|
450
450
|
const u = h.getContext("2d");
|
|
451
|
-
return u ? (u.drawImage(
|
|
451
|
+
return u ? (u.drawImage(s, 0, 0, a, c), h.toDataURL("image/webp", t)) : null;
|
|
452
452
|
}
|
|
453
|
-
return
|
|
453
|
+
return s.toDataURL("image/webp", t);
|
|
454
454
|
} catch (n) {
|
|
455
455
|
return console.warn("DOM screenshot capture failed:", n), null;
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
const N = "qaid_visitor_id";
|
|
459
|
-
function
|
|
459
|
+
function At() {
|
|
460
460
|
try {
|
|
461
461
|
let e = localStorage.getItem(N);
|
|
462
462
|
return e || (e = crypto.randomUUID(), localStorage.setItem(N, e)), e;
|
|
@@ -521,6 +521,10 @@ class $t {
|
|
|
521
521
|
boundMouseMove;
|
|
522
522
|
boundClick;
|
|
523
523
|
boundResize;
|
|
524
|
+
// DOM persistence (survives framework client-side navigation)
|
|
525
|
+
destroyed = !1;
|
|
526
|
+
domObserver = null;
|
|
527
|
+
boundBeforeSwap = null;
|
|
524
528
|
constructor(t) {
|
|
525
529
|
this.config = {
|
|
526
530
|
endpoint: t.endpoint,
|
|
@@ -570,7 +574,7 @@ class $t {
|
|
|
570
574
|
maxDuration: t.videoOptions?.maxDuration ?? 15
|
|
571
575
|
},
|
|
572
576
|
recordIcon: t.recordIcon ?? ""
|
|
573
|
-
}, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundMouseMove = this.handleMouseMove.bind(this), this.boundClick = this.handleClick.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId =
|
|
577
|
+
}, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundMouseMove = this.handleMouseMove.bind(this), this.boundClick = this.handleClick.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = At(), this.init();
|
|
574
578
|
}
|
|
575
579
|
applyVars(t) {
|
|
576
580
|
dt(t, this.cssVars);
|
|
@@ -587,10 +591,28 @@ class $t {
|
|
|
587
591
|
fontSize: this.config.fontSize
|
|
588
592
|
}), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = Ct((t) => {
|
|
589
593
|
this.feedbackData.consoleErrors = this.consoleCapture?.errors ?? [];
|
|
590
|
-
}), this.feedbackData.consoleErrors = this.consoleCapture.errors;
|
|
594
|
+
}), this.feedbackData.consoleErrors = this.consoleCapture.errors, this.observeDom();
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Watch for the shadow hosts being removed from the DOM by framework
|
|
598
|
+
* client-side navigation (e.g. Astro View Transitions swapping <body>
|
|
599
|
+
* contents, or any SPA router that replaces DOM subtrees). If the host
|
|
600
|
+
* is disconnected and destroy() wasn't called, re-append it.
|
|
601
|
+
*
|
|
602
|
+
* Also hooks into Astro's `astro:before-swap` when available, which
|
|
603
|
+
* lets us carry elements into the new document before the swap happens
|
|
604
|
+
* (avoids a flash of the widget disappearing and reappearing).
|
|
605
|
+
*/
|
|
606
|
+
observeDom() {
|
|
607
|
+
this.boundBeforeSwap = (t) => {
|
|
608
|
+
const i = t.newDocument;
|
|
609
|
+
!i || this.destroyed || (this.shadowHost && i.body.appendChild(this.shadowHost), this.overlayShadowHost && i.body.appendChild(this.overlayShadowHost));
|
|
610
|
+
}, document.addEventListener("astro:before-swap", this.boundBeforeSwap), this.domObserver = new MutationObserver(() => {
|
|
611
|
+
this.destroyed || (this.shadowHost && !this.shadowHost.isConnected && document.body.appendChild(this.shadowHost), this.overlayShadowHost && !this.overlayShadowHost.isConnected && document.body.appendChild(this.overlayShadowHost));
|
|
612
|
+
}), this.domObserver.observe(document.body, { childList: !0 });
|
|
591
613
|
}
|
|
592
614
|
checkMobile() {
|
|
593
|
-
this.isMobile =
|
|
615
|
+
this.isMobile = Ht();
|
|
594
616
|
}
|
|
595
617
|
handleResize() {
|
|
596
618
|
this.checkMobile();
|
|
@@ -600,35 +622,35 @@ class $t {
|
|
|
600
622
|
let t = null;
|
|
601
623
|
this.config.container && (t = document.querySelector(this.config.container)), t ? (t.appendChild(this.shadowHost), this.isUserProvidedContainer = !0) : (this.shadowHost.style.position = "fixed", this.shadowHost.style.display = "block", this.shadowHost.style.inset = "0", this.shadowHost.style.pointerEvents = "none", this.shadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.shadowHost)), this.shadowRoot = this.shadowHost.attachShadow({ mode: "open" });
|
|
602
624
|
const i = document.createElement("style");
|
|
603
|
-
if (i.textContent =
|
|
604
|
-
const
|
|
605
|
-
|
|
625
|
+
if (i.textContent = B(), this.shadowRoot.appendChild(i), this.config.css) {
|
|
626
|
+
const a = document.createElement("style");
|
|
627
|
+
a.textContent = this.config.css, this.shadowRoot.appendChild(a);
|
|
606
628
|
}
|
|
607
629
|
const o = this.config.direction === "vertical" ? "qaid-vertical" : "";
|
|
608
630
|
if (this.isUserProvidedContainer)
|
|
609
631
|
this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-${this.config.position} ${o}`.trim(), this.config.incognito && this.buttonsContainer.classList.add("qaid-incognito");
|
|
610
632
|
else {
|
|
611
633
|
this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-auto-container qaid-${this.config.position} ${o}${this.config.incognito ? " qaid-incognito" : ""}`.trim(), this.buttonsContainer.style.pointerEvents = "auto";
|
|
612
|
-
const { x:
|
|
613
|
-
this.config.position.includes("right") ? this.buttonsContainer.style.right = `${
|
|
634
|
+
const { x: a, y: c } = this.config.offset;
|
|
635
|
+
this.config.position.includes("right") ? this.buttonsContainer.style.right = `${a}px` : this.buttonsContainer.style.left = `${a}px`, this.config.position.includes("bottom") ? this.buttonsContainer.style.bottom = `${c}px` : this.buttonsContainer.style.top = `${c}px`;
|
|
614
636
|
}
|
|
615
637
|
this.applyVars(this.buttonsContainer), this.shadowRoot.appendChild(this.buttonsContainer);
|
|
616
|
-
const n = !!this.config.buttonClass,
|
|
638
|
+
const n = !!this.config.buttonClass, s = n ? `qaid-btn-structural ${this.config.buttonClass}` : "qaid-btn", l = this.config.text.tooltip || "Feedback for us?", d = document.createElement("div");
|
|
617
639
|
if (d.className = "qaid-tooltip-text", d.textContent = l, this.applyVars(d), this.shadowRoot.appendChild(d), this.tooltipElement = d, !this.config.hideThumbs) {
|
|
618
|
-
const
|
|
619
|
-
|
|
640
|
+
const a = document.createElement("div");
|
|
641
|
+
a.className = "qaid-tooltip-wrapper";
|
|
620
642
|
const c = document.createElement("button");
|
|
621
|
-
c.type = "button", c.className = n ? `${
|
|
643
|
+
c.type = "button", c.className = n ? `${s} qaid-btn-up` : "qaid-btn qaid-btn-up", c.innerHTML = this.config.positiveIcon || E, c.addEventListener("click", (p) => this.handleThumbClick("up", p.currentTarget, p)), c.addEventListener("mouseenter", () => this.showTooltip(c)), c.addEventListener("mouseleave", () => this.hideTooltip()), a.appendChild(c);
|
|
622
644
|
const h = document.createElement("div");
|
|
623
645
|
h.className = "qaid-tooltip-wrapper";
|
|
624
646
|
const u = document.createElement("button");
|
|
625
|
-
u.type = "button", u.className = n ? `${
|
|
647
|
+
u.type = "button", u.className = n ? `${s} qaid-btn-down` : "qaid-btn qaid-btn-down", u.innerHTML = this.config.negativeIcon || T, u.addEventListener("click", (p) => this.handleThumbClick("down", p.currentTarget, p)), u.addEventListener("mouseenter", () => this.showTooltip(u)), u.addEventListener("mouseleave", () => this.hideTooltip()), h.appendChild(u), this.buttonsContainer.appendChild(a), this.buttonsContainer.appendChild(h);
|
|
626
648
|
}
|
|
627
649
|
if (this.config.captureVideo && It()) {
|
|
628
|
-
const
|
|
629
|
-
|
|
650
|
+
const a = document.createElement("div");
|
|
651
|
+
a.className = "qaid-tooltip-wrapper";
|
|
630
652
|
const c = document.createElement("button");
|
|
631
|
-
c.type = "button", c.className = n ? `${
|
|
653
|
+
c.type = "button", c.className = n ? `${s} qaid-btn-record` : "qaid-btn qaid-btn-record", c.innerHTML = this.config.recordIcon || Z, c.addEventListener("click", () => this.startRecording()), c.addEventListener("mouseenter", () => this.showTooltip(c)), c.addEventListener("mouseleave", () => this.hideTooltip()), a.appendChild(c), this.buttonsContainer.appendChild(a);
|
|
632
654
|
}
|
|
633
655
|
}
|
|
634
656
|
/**
|
|
@@ -641,7 +663,7 @@ class $t {
|
|
|
641
663
|
if (this.overlayShadowRoot) return this.overlayShadowRoot;
|
|
642
664
|
this.overlayShadowHost = document.createElement("div"), this.overlayShadowHost.setAttribute("data-qaid-embed-overlay", ""), this.overlayShadowHost.style.position = "fixed", this.overlayShadowHost.style.inset = "0", this.overlayShadowHost.style.pointerEvents = "none", this.overlayShadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.overlayShadowHost), this.overlayShadowRoot = this.overlayShadowHost.attachShadow({ mode: "open" });
|
|
643
665
|
const t = document.createElement("style");
|
|
644
|
-
if (t.textContent =
|
|
666
|
+
if (t.textContent = B(), this.overlayShadowRoot.appendChild(t), this.config.css) {
|
|
645
667
|
const i = document.createElement("style");
|
|
646
668
|
i.textContent = this.config.css, this.overlayShadowRoot.appendChild(i);
|
|
647
669
|
}
|
|
@@ -652,9 +674,9 @@ class $t {
|
|
|
652
674
|
if (!this.tooltipElement) return;
|
|
653
675
|
const i = this.tooltipElement, o = 8;
|
|
654
676
|
i.style.visibility = "hidden", i.classList.add("qaid-tooltip-visible");
|
|
655
|
-
const n = t.getBoundingClientRect(),
|
|
656
|
-
let d,
|
|
657
|
-
d = n.bottom + o, d +
|
|
677
|
+
const n = t.getBoundingClientRect(), s = i.getBoundingClientRect(), r = window.innerWidth, l = window.innerHeight;
|
|
678
|
+
let d, a;
|
|
679
|
+
d = n.bottom + o, d + s.height > l - o && (d = n.top - s.height - o), a = n.left, a < o ? a = o : a + s.width > r - o && (a = r - s.width - o), d < o ? d = o : d + s.height > l - o && (d = l - s.height - o), i.style.top = `${d}px`, i.style.left = `${a}px`, i.style.visibility = "visible";
|
|
658
680
|
}
|
|
659
681
|
hideTooltip() {
|
|
660
682
|
this.tooltipElement && this.tooltipElement.classList.remove("qaid-tooltip-visible");
|
|
@@ -693,12 +715,12 @@ class $t {
|
|
|
693
715
|
}
|
|
694
716
|
handleMouseMove(t) {
|
|
695
717
|
if (this.mousePos.x = t.clientX, this.mousePos.y = t.clientY, this.crosshairH && (this.crosshairH.style.top = `${t.clientY}px`), this.crosshairV && (this.crosshairV.style.left = `${t.clientX}px`), this.scope && (this.scope.style.left = `${t.clientX}px`, this.scope.style.top = `${t.clientY}px`), this.captureLayer && this.shadowHost) {
|
|
696
|
-
const i = [this.shadowHost, this.overlayShadowHost].filter(Boolean), o =
|
|
718
|
+
const i = [this.shadowHost, this.overlayShadowHost].filter(Boolean), o = P(
|
|
697
719
|
t.clientX,
|
|
698
720
|
t.clientY,
|
|
699
721
|
i
|
|
700
722
|
);
|
|
701
|
-
if (o && !
|
|
723
|
+
if (o && !A(o)) {
|
|
702
724
|
if (this.highlightBox) {
|
|
703
725
|
const n = o.getBoundingClientRect();
|
|
704
726
|
this.highlightBox.style.transform = `translate(${n.left}px, ${n.top}px)`, this.highlightBox.style.width = `${n.width}px`, this.highlightBox.style.height = `${n.height}px`, this.highlightBox.style.display = "block";
|
|
@@ -710,22 +732,22 @@ class $t {
|
|
|
710
732
|
handleClick(t) {
|
|
711
733
|
if (this.state !== "TARGETING" || !this.shadowHost) return;
|
|
712
734
|
t.preventDefault(), t.stopPropagation();
|
|
713
|
-
const i = [this.shadowHost, this.overlayShadowHost].filter(Boolean), o =
|
|
735
|
+
const i = [this.shadowHost, this.overlayShadowHost].filter(Boolean), o = P(
|
|
714
736
|
t.clientX,
|
|
715
737
|
t.clientY,
|
|
716
738
|
i
|
|
717
739
|
);
|
|
718
|
-
if (!o ||
|
|
740
|
+
if (!o || A(o))
|
|
719
741
|
return;
|
|
720
|
-
const n =
|
|
742
|
+
const n = Mt(o, 8);
|
|
721
743
|
this.selectedBounds = {
|
|
722
744
|
...n,
|
|
723
745
|
clickX: t.clientX,
|
|
724
746
|
clickY: t.clientY,
|
|
725
747
|
visible: !0
|
|
726
748
|
};
|
|
727
|
-
const { selector:
|
|
728
|
-
this.feedbackData.elementSelector =
|
|
749
|
+
const { selector: s, text: r } = gt(o);
|
|
750
|
+
this.feedbackData.elementSelector = s, this.feedbackData.elementText = r, this.removeTargetingOverlay(), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("click", this.boundClick, !0), document.removeEventListener("keydown", this.boundKeyDown), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.state = "SELECTED", this.showSelectedMarker(), this.submitFeedback();
|
|
729
751
|
}
|
|
730
752
|
cancelTargeting() {
|
|
731
753
|
this.removeTargetingOverlay(), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("click", this.boundClick, !0), document.removeEventListener("keydown", this.boundKeyDown), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.state = "IDLE", this.feedbackData.feedbackType = null, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1;
|
|
@@ -744,7 +766,7 @@ class $t {
|
|
|
744
766
|
async submitFeedback() {
|
|
745
767
|
if (!this.feedbackData.feedbackType) return;
|
|
746
768
|
let t = null;
|
|
747
|
-
this.config.captureScreenshot && (this.config.screenshotMethod === "dom" ? t = await
|
|
769
|
+
this.config.captureScreenshot && (this.config.screenshotMethod === "dom" ? t = await Pt(this.config.screenshotOptions) : t = await Dt(this.config.screenshotOptions));
|
|
748
770
|
const i = this.feedbackData.elementSelector ? {
|
|
749
771
|
x: this.selectedBounds.x,
|
|
750
772
|
y: this.selectedBounds.y,
|
|
@@ -776,8 +798,8 @@ class $t {
|
|
|
776
798
|
body: JSON.stringify(o)
|
|
777
799
|
});
|
|
778
800
|
if (n.ok) {
|
|
779
|
-
const
|
|
780
|
-
this.feedbackId =
|
|
801
|
+
const s = await n.json();
|
|
802
|
+
this.feedbackId = s.id;
|
|
781
803
|
}
|
|
782
804
|
} catch (n) {
|
|
783
805
|
console.error("Failed to submit feedback:", n);
|
|
@@ -813,8 +835,8 @@ class $t {
|
|
|
813
835
|
this.modalContainer = document.createElement("div"), this.modalContainer.className = `qaid-modal-container qaid-${i.position}`, this.modalContainer.style.top = `${i.top}px`, this.modalContainer.style.left = `${i.left}px`, this.modalContainer.style.zIndex = String(this.config.zIndex + 3);
|
|
814
836
|
const n = document.createElement("div");
|
|
815
837
|
n.className = "qaid-modal-arrow", n.style.left = `${o.left}px`;
|
|
816
|
-
const
|
|
817
|
-
|
|
838
|
+
const s = document.createElement("div");
|
|
839
|
+
s.className = "qaid-modal-box", s.innerHTML = this.getModalContent(), this.modalContainer.appendChild(n), this.modalContainer.appendChild(s), this.applyVars(this.modalContainer), t.appendChild(this.modalContainer), this.setupModalInteractions();
|
|
818
840
|
}
|
|
819
841
|
getModalContent() {
|
|
820
842
|
const t = this.feedbackData.feedbackType === "up", i = this.config.positiveIcon || E, o = this.config.negativeIcon || T;
|
|
@@ -847,8 +869,8 @@ class $t {
|
|
|
847
869
|
o && o.addEventListener("click", () => {
|
|
848
870
|
const n = this.feedbackData.feedbackType === "up" ? "down" : "up";
|
|
849
871
|
this.feedbackData.feedbackType = n, this.config.buttonClass ? (o.classList.toggle("qaid-btn-up", n === "up"), o.classList.toggle("qaid-btn-down", n === "down")) : (o.classList.toggle("qaid-type-up", n === "up"), o.classList.toggle("qaid-type-down", n === "down"));
|
|
850
|
-
const
|
|
851
|
-
o.innerHTML = n === "up" ?
|
|
872
|
+
const s = this.config.positiveIcon || E, r = this.config.negativeIcon || T;
|
|
873
|
+
o.innerHTML = n === "up" ? s : r, this.feedbackId && fetch(`${this.config.endpoint}/${this.feedbackId}`, {
|
|
852
874
|
method: "PATCH",
|
|
853
875
|
headers: { "Content-Type": "application/json" },
|
|
854
876
|
body: JSON.stringify({ feedbackType: n })
|
|
@@ -935,23 +957,23 @@ class $t {
|
|
|
935
957
|
o.className = "qaid-video-preview-box";
|
|
936
958
|
const n = document.createElement("h3");
|
|
937
959
|
n.textContent = "Review your recording";
|
|
938
|
-
const
|
|
939
|
-
|
|
960
|
+
const s = document.createElement("video");
|
|
961
|
+
s.src = i, s.controls = !0, s.autoplay = !0, s.muted = !0;
|
|
940
962
|
const r = document.createElement("textarea");
|
|
941
963
|
r.placeholder = "Optional: Describe the issue you recorded...";
|
|
942
964
|
const l = document.createElement("div");
|
|
943
965
|
l.className = "qaid-video-preview-actions";
|
|
944
966
|
const d = document.createElement("button");
|
|
945
967
|
d.type = "button", d.className = "qaid-video-btn qaid-video-btn-cancel", d.textContent = "Cancel", d.addEventListener("click", () => this.cancelRecordingPreview());
|
|
946
|
-
const
|
|
947
|
-
|
|
968
|
+
const a = document.createElement("button");
|
|
969
|
+
a.type = "button", a.className = "qaid-video-btn qaid-video-btn-rerecord", a.textContent = "Re-record", a.addEventListener("click", () => {
|
|
948
970
|
this.cancelRecordingPreview(), this.startRecording();
|
|
949
971
|
});
|
|
950
972
|
const c = document.createElement("button");
|
|
951
973
|
c.type = "button", c.className = "qaid-video-btn qaid-video-btn-send", c.textContent = "Send", c.addEventListener("click", () => {
|
|
952
974
|
const h = r.value.trim() || null;
|
|
953
975
|
this.submitVideoFeedback(h, c);
|
|
954
|
-
}), l.appendChild(d), l.appendChild(
|
|
976
|
+
}), l.appendChild(d), l.appendChild(a), l.appendChild(c), o.appendChild(n), o.appendChild(s), o.appendChild(r), o.appendChild(l), this.videoPreview.appendChild(o), this.applyVars(this.videoPreview), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "auto"), t.appendChild(this.videoPreview), document.addEventListener("keydown", this.boundKeyDown);
|
|
955
977
|
}
|
|
956
978
|
cancelRecordingPreview() {
|
|
957
979
|
this.removeVideoPreview(), this.cleanupRecording();
|
|
@@ -992,7 +1014,7 @@ class $t {
|
|
|
992
1014
|
* Destroy the embed and clean up all resources
|
|
993
1015
|
*/
|
|
994
1016
|
destroy() {
|
|
995
|
-
this.cleanupRecording(), this.removeVideoPreview(), this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("click", this.boundClick, !0), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.shadowHost && (this.shadowHost.remove(), this.shadowHost = null, this.shadowRoot = null), this.overlayShadowHost && (this.overlayShadowHost.remove(), this.overlayShadowHost = null, this.overlayShadowRoot = null), this.buttonsContainer = null, this.overlayContainer = null, this.captureLayer = null, this.crosshairH = null, this.crosshairV = null, this.scope = null, this.marker = null, this.modalContainer = null, this.backdrop = null, this.tooltipElement = null, lt();
|
|
1017
|
+
this.destroyed = !0, this.domObserver && (this.domObserver.disconnect(), this.domObserver = null), this.boundBeforeSwap && (document.removeEventListener("astro:before-swap", this.boundBeforeSwap), this.boundBeforeSwap = null), this.cleanupRecording(), this.removeVideoPreview(), this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("click", this.boundClick, !0), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.shadowHost && (this.shadowHost.remove(), this.shadowHost = null, this.shadowRoot = null), this.overlayShadowHost && (this.overlayShadowHost.remove(), this.overlayShadowHost = null, this.overlayShadowRoot = null), this.buttonsContainer = null, this.overlayContainer = null, this.captureLayer = null, this.crosshairH = null, this.crosshairV = null, this.scope = null, this.marker = null, this.modalContainer = null, this.backdrop = null, this.tooltipElement = null, lt();
|
|
996
1018
|
}
|
|
997
1019
|
}
|
|
998
1020
|
function _(e) {
|
|
@@ -1015,10 +1037,10 @@ function Nt() {
|
|
|
1015
1037
|
function Vt(e) {
|
|
1016
1038
|
const t = e.getAttribute("data-endpoint");
|
|
1017
1039
|
if (!t) return null;
|
|
1018
|
-
const i = e.getAttribute("data-position"), o = e.getAttribute("data-zindex"), n = e.getAttribute("data-positive-color"),
|
|
1040
|
+
const i = e.getAttribute("data-position"), o = e.getAttribute("data-zindex"), n = e.getAttribute("data-positive-color"), s = e.getAttribute("data-negative-color"), r = e.getAttribute("data-marker-color"), l = e.getAttribute("data-container"), d = e.getAttribute("data-button-class"), a = e.getAttribute("data-skip-targeting"), c = e.getAttribute("data-incognito"), h = e.getAttribute("data-button-size"), u = e.getAttribute("data-offset-x"), p = e.getAttribute("data-offset-y"), g = e.getAttribute("data-modal-width"), f = e.getAttribute("data-backdrop-opacity"), m = e.getAttribute("data-font-family"), v = e.getAttribute("data-font-size"), b = e.getAttribute("data-tooltip"), x = e.getAttribute("data-modal-title"), I = e.getAttribute("data-modal-subtitle"), L = e.getAttribute("data-placeholder"), R = e.getAttribute("data-submit-button"), H = e.getAttribute("data-skip-button"), F = e.getAttribute("data-positive-icon"), W = e.getAttribute("data-negative-icon"), X = e.getAttribute("data-api-key"), j = e.getAttribute("data-capture-screenshot"), k = e.getAttribute("data-screenshot-quality"), C = e.getAttribute("data-screenshot-max-width"), S = e.getAttribute("data-screenshot-max-height"), K = e.getAttribute("data-capture-video"), Y = e.getAttribute("data-hide-thumbs"), M = e.getAttribute("data-video-max-duration"), J = e.getAttribute("data-screenshot-method"), G = e.getAttribute("data-direction"), D = e.getAttribute("data-css-selector");
|
|
1019
1041
|
return {
|
|
1020
1042
|
endpoint: t,
|
|
1021
|
-
css:
|
|
1043
|
+
css: D ? _(D) : void 0,
|
|
1022
1044
|
apiKey: X ?? void 0,
|
|
1023
1045
|
captureScreenshot: j === "true" ? !0 : void 0,
|
|
1024
1046
|
screenshotOptions: k || C || S ? {
|
|
@@ -1031,37 +1053,37 @@ function Vt(e) {
|
|
|
1031
1053
|
direction: G ?? void 0,
|
|
1032
1054
|
position: i ?? void 0,
|
|
1033
1055
|
zIndex: o ? parseInt(o, 10) : void 0,
|
|
1034
|
-
skipTargeting:
|
|
1056
|
+
skipTargeting: a === "true" ? !0 : void 0,
|
|
1035
1057
|
incognito: c === "true" ? !0 : void 0,
|
|
1036
1058
|
buttonSize: h ?? void 0,
|
|
1037
1059
|
offset: u || p ? {
|
|
1038
1060
|
x: u ? parseInt(u, 10) : void 0,
|
|
1039
1061
|
y: p ? parseInt(p, 10) : void 0
|
|
1040
1062
|
} : void 0,
|
|
1041
|
-
modalWidth:
|
|
1063
|
+
modalWidth: g ? parseInt(g, 10) : void 0,
|
|
1042
1064
|
backdropOpacity: f ? parseFloat(f) : void 0,
|
|
1043
1065
|
fontFamily: m ?? void 0,
|
|
1044
1066
|
fontSize: v ? parseInt(v, 10) : void 0,
|
|
1045
1067
|
colors: {
|
|
1046
1068
|
positive: n ?? void 0,
|
|
1047
|
-
negative:
|
|
1069
|
+
negative: s ?? void 0,
|
|
1048
1070
|
marker: r ?? void 0
|
|
1049
1071
|
},
|
|
1050
|
-
text:
|
|
1051
|
-
tooltip:
|
|
1072
|
+
text: b || x || I || L || R || H ? {
|
|
1073
|
+
tooltip: b ?? void 0,
|
|
1052
1074
|
modalTitle: x ?? void 0,
|
|
1053
1075
|
modalSubtitle: I ?? void 0,
|
|
1054
1076
|
placeholder: L ?? void 0,
|
|
1055
1077
|
submitButton: R ?? void 0,
|
|
1056
|
-
skipButton:
|
|
1078
|
+
skipButton: H ?? void 0
|
|
1057
1079
|
} : void 0,
|
|
1058
1080
|
positiveIcon: F ?? void 0,
|
|
1059
1081
|
negativeIcon: W ?? void 0,
|
|
1060
1082
|
screenshotMethod: J ?? void 0,
|
|
1061
1083
|
captureVideo: K === "true" ? !0 : void 0,
|
|
1062
1084
|
hideThumbs: Y === "true" ? !0 : void 0,
|
|
1063
|
-
videoOptions:
|
|
1064
|
-
maxDuration: parseInt(
|
|
1085
|
+
videoOptions: M ? {
|
|
1086
|
+
maxDuration: parseInt(M, 10)
|
|
1065
1087
|
} : void 0
|
|
1066
1088
|
};
|
|
1067
1089
|
}
|
|
@@ -1074,7 +1096,7 @@ if (typeof document < "u") {
|
|
|
1074
1096
|
}
|
|
1075
1097
|
export {
|
|
1076
1098
|
$t as QaidFeedback,
|
|
1077
|
-
|
|
1099
|
+
Pt as captureDomScreenshot,
|
|
1078
1100
|
Tt as captureNetworkErrors,
|
|
1079
1101
|
Rt as createVideoRecorder,
|
|
1080
1102
|
Lt as getSupportedMimeType,
|