@firstlook-uat/sdk 0.3.3 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/firstlook.es.js +231 -169
- package/dist/firstlook.es.js.map +1 -1
- package/dist/firstlook.umd.js +50 -3
- package/dist/firstlook.umd.js.map +1 -1
- package/package.json +14 -13
package/dist/firstlook.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const I = [
|
|
2
2
|
'input[type="password"]',
|
|
3
3
|
"[data-sensitive]",
|
|
4
4
|
"[data-mask]",
|
|
5
5
|
".uat-mask"
|
|
6
6
|
];
|
|
7
|
-
function
|
|
8
|
-
var t, e, s, i, n, o, l, c,
|
|
7
|
+
function M(a) {
|
|
8
|
+
var t, e, s, i, n, o, l, c, h, d;
|
|
9
9
|
if (!a.endpoint)
|
|
10
10
|
throw new Error("[FirstLook] 'endpoint' is required. Set your Supabase ingest-session URL.");
|
|
11
11
|
return {
|
|
@@ -18,23 +18,22 @@ function C(a) {
|
|
|
18
18
|
triggers: {
|
|
19
19
|
tapCount: ((t = a.triggers) == null ? void 0 : t.tapCount) ?? 5,
|
|
20
20
|
deepLink: ((e = a.triggers) == null ? void 0 : e.deepLink) ?? !0,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
customCheck: (n = a.triggers) == null ? void 0 : n.customCheck
|
|
21
|
+
keyboard: ((s = a.triggers) == null ? void 0 : s.keyboard) ?? !0,
|
|
22
|
+
customCheck: (i = a.triggers) == null ? void 0 : i.customCheck
|
|
24
23
|
},
|
|
25
24
|
security: {
|
|
26
|
-
watermark: ((
|
|
27
|
-
maskSelectors: ((
|
|
25
|
+
watermark: ((n = a.security) == null ? void 0 : n.watermark) ?? !0,
|
|
26
|
+
maskSelectors: ((o = a.security) == null ? void 0 : o.maskSelectors) ?? I
|
|
28
27
|
},
|
|
29
28
|
recording: {
|
|
30
|
-
domSnapshot: ((
|
|
31
|
-
voice: ((
|
|
29
|
+
domSnapshot: ((l = a.recording) == null ? void 0 : l.domSnapshot) ?? !0,
|
|
30
|
+
voice: ((c = a.recording) == null ? void 0 : c.voice) ?? !0,
|
|
32
31
|
maxDuration: ((h = a.recording) == null ? void 0 : h.maxDuration) ?? 600,
|
|
33
|
-
snapshotInterval: ((
|
|
32
|
+
snapshotInterval: ((d = a.recording) == null ? void 0 : d.snapshotInterval) ?? 1e3
|
|
34
33
|
}
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
|
-
function
|
|
36
|
+
function y() {
|
|
38
37
|
return {
|
|
39
38
|
userAgent: navigator.userAgent,
|
|
40
39
|
platform: navigator.platform,
|
|
@@ -45,7 +44,7 @@ function w() {
|
|
|
45
44
|
touchSupport: "ontouchstart" in window || navigator.maxTouchPoints > 0
|
|
46
45
|
};
|
|
47
46
|
}
|
|
48
|
-
class
|
|
47
|
+
class E {
|
|
49
48
|
constructor() {
|
|
50
49
|
this.listeners = /* @__PURE__ */ new Map();
|
|
51
50
|
}
|
|
@@ -76,7 +75,7 @@ class q {
|
|
|
76
75
|
this.listeners.clear();
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
|
-
class
|
|
78
|
+
class R {
|
|
80
79
|
constructor(t) {
|
|
81
80
|
this.events = t, this.quests = [], this.results = [], this.currentIndex = -1, this.sessionStartTime = 0, this.blocked = !1, this.pendingFeedbacks = [];
|
|
82
81
|
}
|
|
@@ -117,15 +116,16 @@ class I {
|
|
|
117
116
|
logs: t,
|
|
118
117
|
comment: e == null ? void 0 : e.comment,
|
|
119
118
|
concern: (e == null ? void 0 : e.concern) ?? !1,
|
|
120
|
-
feedbacks: this.drainFeedbacks()
|
|
119
|
+
feedbacks: this.drainFeedbacks(),
|
|
120
|
+
checklist: e == null ? void 0 : e.checklist
|
|
121
121
|
};
|
|
122
122
|
return this.results.push(i), this.events.emit({ type: "quest:completed", questId: s.id }), this.advance(), i;
|
|
123
123
|
}
|
|
124
|
-
failCurrentQuest(t, e, s) {
|
|
125
|
-
const
|
|
126
|
-
if (!
|
|
127
|
-
const
|
|
128
|
-
questId:
|
|
124
|
+
failCurrentQuest(t, e, s, i) {
|
|
125
|
+
const n = this.getCurrentQuest();
|
|
126
|
+
if (!n) return null;
|
|
127
|
+
const o = {
|
|
128
|
+
questId: n.id,
|
|
129
129
|
status: "FAILED",
|
|
130
130
|
timestamp: Date.now(),
|
|
131
131
|
relativeTime: Date.now() - this.sessionStartTime,
|
|
@@ -133,9 +133,10 @@ class I {
|
|
|
133
133
|
logs: t,
|
|
134
134
|
comment: e,
|
|
135
135
|
concern: !1,
|
|
136
|
-
feedbacks: this.drainFeedbacks()
|
|
136
|
+
feedbacks: this.drainFeedbacks(),
|
|
137
|
+
checklist: i
|
|
137
138
|
};
|
|
138
|
-
return this.results.push(
|
|
139
|
+
return this.results.push(o), this.events.emit({ type: "quest:failed", questId: n.id }), n.blocking ? (this.blocked = !0, this.events.emit({ type: "quest:blocked", questId: n.id })) : this.advance(), o;
|
|
139
140
|
}
|
|
140
141
|
addFeedback(t) {
|
|
141
142
|
this.pendingFeedbacks.push(t);
|
|
@@ -161,16 +162,34 @@ function r(a, t, e) {
|
|
|
161
162
|
typeof i == "string" ? s.appendChild(document.createTextNode(i)) : s.appendChild(i);
|
|
162
163
|
return s;
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
+
function L() {
|
|
165
166
|
return `fl_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
+
function A(a) {
|
|
168
169
|
const t = Math.floor(a / 60), e = a % 60;
|
|
169
170
|
return `${t.toString().padStart(2, "0")}:${e.toString().padStart(2, "0")}`;
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
+
function D(a) {
|
|
173
|
+
const t = a.split(`
|
|
174
|
+
`), e = [], s = [];
|
|
175
|
+
let i = !1;
|
|
176
|
+
for (const n of t) {
|
|
177
|
+
const o = n.trim(), l = o.match(/^(?:(\d+)[\.\)]\s+|[-*]\s+)(.+)$/);
|
|
178
|
+
l ? (i = !0, s.push({
|
|
179
|
+
index: s.length,
|
|
180
|
+
text: l[2],
|
|
181
|
+
checked: !1
|
|
182
|
+
})) : !i && o && e.push(o);
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
preamble: e.join(`
|
|
186
|
+
`),
|
|
187
|
+
items: s
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
class N {
|
|
172
191
|
constructor(t, e) {
|
|
173
|
-
this.shadowRoot = t, this.callbacks = e, this.minimized = !1, this.timerInterval = null, this.startTime = 0, this.root = document.createElement("div"), this.root.className = "fl-quest-overlay", this.root.style.pointerEvents = "auto";
|
|
192
|
+
this.shadowRoot = t, this.callbacks = e, this.minimized = !1, this.timerInterval = null, this.startTime = 0, this.checklist = [], this.root = document.createElement("div"), this.root.className = "fl-quest-overlay", this.root.style.pointerEvents = "auto";
|
|
174
193
|
for (const s of ["click", "mousedown", "mouseup", "pointerdown", "pointerup", "touchstart", "touchend"])
|
|
175
194
|
this.root.addEventListener(s, (i) => i.stopPropagation());
|
|
176
195
|
this.shadowRoot.appendChild(this.root);
|
|
@@ -186,23 +205,40 @@ class R {
|
|
|
186
205
|
]);
|
|
187
206
|
this.root.appendChild(n);
|
|
188
207
|
const o = r("div", { className: "fl-quest-content" }), l = r("div", { className: "fl-quest-progress" });
|
|
189
|
-
for (const
|
|
190
|
-
const
|
|
191
|
-
l.appendChild(r("div", { className: `fl-quest-progress-dot ${
|
|
208
|
+
for (const f of e) {
|
|
209
|
+
const p = f === "COMPLETED" ? "fl-completed" : f === "FAILED" ? "fl-failed" : f === "ACTIVE" ? "fl-active" : "";
|
|
210
|
+
l.appendChild(r("div", { className: `fl-quest-progress-dot ${p}` }));
|
|
192
211
|
}
|
|
193
|
-
const c =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
212
|
+
const c = D(t.description);
|
|
213
|
+
this.checklist = c.items;
|
|
214
|
+
const h = r("div", { className: "fl-quest-body" });
|
|
215
|
+
if (h.appendChild(l), c.items.length > 0) {
|
|
216
|
+
const f = r("div", { className: "fl-checklist-counter" }), p = () => {
|
|
217
|
+
const b = this.checklist.filter((k) => k.checked).length;
|
|
218
|
+
f.textContent = `✓ ${b}/${this.checklist.length} 確認済み`;
|
|
219
|
+
};
|
|
220
|
+
p(), h.appendChild(f), c.preamble && h.appendChild(r("p", { className: "fl-quest-description" }, [c.preamble]));
|
|
221
|
+
const m = r("ul", { className: "fl-checklist" });
|
|
222
|
+
for (const b of this.checklist) {
|
|
223
|
+
const k = r("li", { className: "fl-checklist-item" }), v = document.createElement("input");
|
|
224
|
+
v.type = "checkbox", v.className = "fl-checklist-checkbox", v.checked = b.checked;
|
|
225
|
+
const T = r("span", { className: "fl-checklist-text" }, [b.text]);
|
|
226
|
+
v.onchange = () => {
|
|
227
|
+
b.checked = v.checked, k.classList.toggle("fl-checked", b.checked), p();
|
|
228
|
+
}, k.onclick = (q) => {
|
|
229
|
+
q.target !== v && (v.checked = !v.checked, b.checked = v.checked, k.classList.toggle("fl-checked", b.checked), p());
|
|
230
|
+
}, k.appendChild(v), k.appendChild(T), m.appendChild(k);
|
|
231
|
+
}
|
|
232
|
+
h.appendChild(m);
|
|
233
|
+
} else
|
|
234
|
+
h.appendChild(r("p", { className: "fl-quest-description" }, [t.description]));
|
|
235
|
+
h.appendChild(r("div", { className: "fl-quest-memo-row" }, [
|
|
236
|
+
this.createButton("fl-btn fl-btn-memo", "📝 メモを残す", () => this.renderFeedbackModal(t.title))
|
|
237
|
+
])), h.appendChild(r("div", { className: "fl-quest-actions" }, [
|
|
238
|
+
this.createButton("fl-btn fl-btn-ok", "✓ OK", () => this.renderFeedbackModal(t.title, "ok")),
|
|
239
|
+
this.createButton("fl-btn fl-btn-concern", "⚠ 気になる", () => this.renderFeedbackModal(t.title, "concern")),
|
|
240
|
+
this.createButton("fl-btn fl-btn-ng", "✗ NG", this.callbacks.onNg)
|
|
241
|
+
])), o.appendChild(h), s && o.appendChild(
|
|
206
242
|
r("div", { className: "fl-voice-indicator" }, [
|
|
207
243
|
r("span", { className: "fl-voice-dot" }),
|
|
208
244
|
"Recording..."
|
|
@@ -215,9 +251,9 @@ class R {
|
|
|
215
251
|
"REC"
|
|
216
252
|
])
|
|
217
253
|
);
|
|
218
|
-
const
|
|
219
|
-
d.appendChild(
|
|
220
|
-
this.minimized && (this.minimized = !1, this.root.className = "fl-quest-overlay", this.root.innerHTML = "", this.root.appendChild(n), this.root.appendChild(o), this.startTimer(
|
|
254
|
+
const g = r("span", { className: "fl-status-timer" }, ["00:00"]);
|
|
255
|
+
d.appendChild(g), o.appendChild(d), this.root.appendChild(o), this.startTimer(g), this.root.onclick = () => {
|
|
256
|
+
this.minimized && (this.minimized = !1, this.root.className = "fl-quest-overlay", this.root.innerHTML = "", this.root.appendChild(n), this.root.appendChild(o), this.startTimer(g));
|
|
221
257
|
};
|
|
222
258
|
}
|
|
223
259
|
renderFeedbackModal(t, e = "memo") {
|
|
@@ -243,19 +279,19 @@ class R {
|
|
|
243
279
|
])
|
|
244
280
|
]);
|
|
245
281
|
s.appendChild(l);
|
|
246
|
-
const c = r("div", { className: "fl-quest-content" }),
|
|
282
|
+
const c = r("div", { className: "fl-quest-content" }), h = {
|
|
247
283
|
ng: "何がうまくいかなかったか教えてください...",
|
|
248
284
|
ok: "コメント(任意)",
|
|
249
285
|
concern: "気になった点を教えてください...",
|
|
250
286
|
memo: "気づいたことをメモ...📝"
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
this.createButton("fl-btn fl-btn-skip",
|
|
287
|
+
}, d = document.createElement("textarea");
|
|
288
|
+
d.className = "fl-feedback-textarea fl-feedback-textarea-modal", d.placeholder = h[e], d.rows = 3, c.appendChild(d);
|
|
289
|
+
const g = "送信", f = e === "ok" ? "スキップ" : "キャンセル", p = r("div", { className: "fl-quest-actions fl-feedback-modal-actions" }, [
|
|
290
|
+
this.createButton("fl-btn fl-btn-skip", f, () => {
|
|
255
291
|
e === "ng" ? this.callbacks.onNgWithFeedback("") : e === "ok" && this.callbacks.onOkWithFeedback(""), s.remove();
|
|
256
292
|
}),
|
|
257
|
-
this.createButton("fl-btn fl-btn-finish",
|
|
258
|
-
const m =
|
|
293
|
+
this.createButton("fl-btn fl-btn-finish", g, () => {
|
|
294
|
+
const m = d.value.trim();
|
|
259
295
|
if (e === "ng")
|
|
260
296
|
this.callbacks.onNgWithFeedback(m);
|
|
261
297
|
else if (e === "ok")
|
|
@@ -273,7 +309,7 @@ class R {
|
|
|
273
309
|
s.remove();
|
|
274
310
|
})
|
|
275
311
|
]);
|
|
276
|
-
c.appendChild(
|
|
312
|
+
c.appendChild(p), s.appendChild(c), this.root.appendChild(s), d.focus();
|
|
277
313
|
}
|
|
278
314
|
renderSummary(t, e, s) {
|
|
279
315
|
this.stopTimer(), this.root.className = "fl-quest-overlay", this.root.innerHTML = "";
|
|
@@ -305,6 +341,9 @@ class R {
|
|
|
305
341
|
]);
|
|
306
342
|
this.root.appendChild(e);
|
|
307
343
|
}
|
|
344
|
+
getChecklist() {
|
|
345
|
+
return this.checklist.length > 0 ? [...this.checklist] : void 0;
|
|
346
|
+
}
|
|
308
347
|
destroy() {
|
|
309
348
|
this.stopTimer(), this.root.remove();
|
|
310
349
|
}
|
|
@@ -331,15 +370,15 @@ class R {
|
|
|
331
370
|
startTimer(t) {
|
|
332
371
|
this.stopTimer(), this.startTime || (this.startTime = Date.now()), this.timerInterval = setInterval(() => {
|
|
333
372
|
const e = Math.floor((Date.now() - this.startTime) / 1e3);
|
|
334
|
-
t.textContent =
|
|
373
|
+
t.textContent = A(e);
|
|
335
374
|
}, 1e3);
|
|
336
375
|
}
|
|
337
376
|
stopTimer() {
|
|
338
377
|
this.timerInterval && (clearInterval(this.timerInterval), this.timerInterval = null);
|
|
339
378
|
}
|
|
340
379
|
}
|
|
341
|
-
const
|
|
342
|
-
class
|
|
380
|
+
const F = 100, P = 2 * 1024 * 1024;
|
|
381
|
+
class z {
|
|
343
382
|
constructor(t, e, s) {
|
|
344
383
|
this.config = t, this.events = e, this.maskSelector = s, this.actionLogs = [], this.snapshots = [], this.snapshotTimer = null, this.startTime = 0, this.running = !1, this.handleClick = this.onClick.bind(this), this.handleScroll = this.throttle(this.onScroll.bind(this), 500), this.handleInput = this.onInput.bind(this);
|
|
345
384
|
}
|
|
@@ -371,7 +410,7 @@ class D {
|
|
|
371
410
|
const e = t.target;
|
|
372
411
|
this.addLog({
|
|
373
412
|
type: "click",
|
|
374
|
-
target:
|
|
413
|
+
target: x(e)
|
|
375
414
|
});
|
|
376
415
|
}
|
|
377
416
|
onScroll() {
|
|
@@ -383,12 +422,12 @@ class D {
|
|
|
383
422
|
onInput(t) {
|
|
384
423
|
const e = t.target;
|
|
385
424
|
if (e.hasAttribute("data-fl-masked"))
|
|
386
|
-
this.addLog({ type: "input", target:
|
|
425
|
+
this.addLog({ type: "input", target: x(e), value: "[MASKED]" });
|
|
387
426
|
else {
|
|
388
427
|
const s = e.value;
|
|
389
428
|
this.addLog({
|
|
390
429
|
type: "input",
|
|
391
|
-
target:
|
|
430
|
+
target: x(e),
|
|
392
431
|
value: s == null ? void 0 : s.slice(0, 100)
|
|
393
432
|
});
|
|
394
433
|
}
|
|
@@ -406,8 +445,8 @@ class D {
|
|
|
406
445
|
const s = t.querySelector("#firstlook-sdk-root");
|
|
407
446
|
s == null || s.remove();
|
|
408
447
|
const i = t.outerHTML;
|
|
409
|
-
if (i.length >
|
|
410
|
-
this.snapshots.length >=
|
|
448
|
+
if (i.length > P) return;
|
|
449
|
+
this.snapshots.length >= F && this.snapshots.shift(), this.snapshots.push({
|
|
411
450
|
type: "dom-snapshot",
|
|
412
451
|
timestamp: Date.now() - this.startTime,
|
|
413
452
|
data: i
|
|
@@ -423,12 +462,12 @@ class D {
|
|
|
423
462
|
};
|
|
424
463
|
}
|
|
425
464
|
}
|
|
426
|
-
function
|
|
465
|
+
function x(a) {
|
|
427
466
|
var n;
|
|
428
467
|
const t = a.tagName.toLowerCase(), e = a.id ? `#${a.id}` : "", s = a.className && typeof a.className == "string" ? `.${a.className.trim().split(/\s+/).slice(0, 2).join(".")}` : "", i = ((n = a.textContent) == null ? void 0 : n.trim().slice(0, 30)) || "";
|
|
429
468
|
return `${t}${e}${s}${i ? ` "${i}"` : ""}`;
|
|
430
469
|
}
|
|
431
|
-
class
|
|
470
|
+
class O {
|
|
432
471
|
constructor(t) {
|
|
433
472
|
this.events = t, this.mediaRecorder = null, this.stream = null, this.chunks = [], this._recording = !1;
|
|
434
473
|
}
|
|
@@ -487,7 +526,7 @@ class N {
|
|
|
487
526
|
return "";
|
|
488
527
|
}
|
|
489
528
|
}
|
|
490
|
-
class
|
|
529
|
+
class Q {
|
|
491
530
|
constructor(t, e) {
|
|
492
531
|
this.shadowRoot = t, this.config = e, this.container = null, this.refreshInterval = null, this.cachedIp = null;
|
|
493
532
|
}
|
|
@@ -511,13 +550,13 @@ class F {
|
|
|
511
550
|
this.container.innerHTML = "";
|
|
512
551
|
const t = this.cachedIp ?? "", e = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19), s = t ? `${this.config.userId} | ${e} | ${t}` : `${this.config.userId} | ${e}`, i = 320, n = 80, o = Math.ceil(window.innerWidth / i) + 1, l = Math.ceil(window.innerHeight / n) + 1;
|
|
513
552
|
for (let c = 0; c < l; c++)
|
|
514
|
-
for (let
|
|
515
|
-
const
|
|
516
|
-
|
|
553
|
+
for (let h = 0; h < o; h++) {
|
|
554
|
+
const d = document.createElement("span");
|
|
555
|
+
d.className = "fl-watermark-tile", d.textContent = s, d.style.left = `${h * i}px`, d.style.top = `${c * n}px`, this.container.appendChild(d);
|
|
517
556
|
}
|
|
518
557
|
}
|
|
519
558
|
}
|
|
520
|
-
class
|
|
559
|
+
class B {
|
|
521
560
|
constructor(t) {
|
|
522
561
|
this.selectors = t, this.observer = null, this.maskedElements = /* @__PURE__ */ new Set();
|
|
523
562
|
}
|
|
@@ -555,20 +594,20 @@ class P {
|
|
|
555
594
|
}
|
|
556
595
|
}
|
|
557
596
|
}
|
|
558
|
-
const
|
|
597
|
+
const $ = "firstlook_uat", U = 1, u = {
|
|
559
598
|
sessions: "sessions",
|
|
560
599
|
recordings: "recordings",
|
|
561
600
|
annotations: "annotations",
|
|
562
601
|
uploadQueue: "upload_queue"
|
|
563
602
|
};
|
|
564
|
-
class
|
|
603
|
+
class j {
|
|
565
604
|
constructor() {
|
|
566
605
|
this.db = null;
|
|
567
606
|
}
|
|
568
607
|
async open() {
|
|
569
608
|
if (!this.db)
|
|
570
609
|
return new Promise((t, e) => {
|
|
571
|
-
const s = indexedDB.open(
|
|
610
|
+
const s = indexedDB.open($, U);
|
|
572
611
|
s.onupgradeneeded = () => {
|
|
573
612
|
const i = s.result;
|
|
574
613
|
i.objectStoreNames.contains(u.sessions) || i.createObjectStore(u.sessions, { keyPath: "sessionId" }), i.objectStoreNames.contains(u.recordings) || i.createObjectStore(u.recordings, { autoIncrement: !0 }).createIndex("sessionId", "sessionId", { unique: !1 }), i.objectStoreNames.contains(u.annotations) || i.createObjectStore(u.annotations, { autoIncrement: !0 }).createIndex("sessionId", "sessionId", { unique: !1 }), i.objectStoreNames.contains(u.uploadQueue) || i.createObjectStore(u.uploadQueue, { autoIncrement: !0 });
|
|
@@ -673,15 +712,15 @@ class Q {
|
|
|
673
712
|
async getAllByIndex(t, e, s) {
|
|
674
713
|
const i = this.ensureDb();
|
|
675
714
|
return new Promise((n, o) => {
|
|
676
|
-
const
|
|
677
|
-
|
|
715
|
+
const h = i.transaction(t, "readonly").objectStore(t).index(e).getAll(s);
|
|
716
|
+
h.onsuccess = () => n(h.result), h.onerror = () => o(h.error);
|
|
678
717
|
});
|
|
679
718
|
}
|
|
680
719
|
}
|
|
681
|
-
const
|
|
682
|
-
class
|
|
720
|
+
const S = ["#e17055", "#6c5ce7", "#00b894", "#fdcb6e", "#ffffff"];
|
|
721
|
+
class K {
|
|
683
722
|
constructor(t) {
|
|
684
|
-
this.shadowRoot = t, this.overlay = null, this.canvas = null, this.ctx = null, this.drawing = !1, this.currentPath = [], this.paths = [], this.selectedColor =
|
|
723
|
+
this.shadowRoot = t, this.overlay = null, this.canvas = null, this.ctx = null, this.drawing = !1, this.currentPath = [], this.paths = [], this.selectedColor = S[0], this.screenshotDataUrl = "";
|
|
685
724
|
}
|
|
686
725
|
async open() {
|
|
687
726
|
return this.screenshotDataUrl = await this.captureScreenshot(), new Promise((t) => {
|
|
@@ -693,11 +732,11 @@ class B {
|
|
|
693
732
|
type: "text",
|
|
694
733
|
placeholder: "Add a comment..."
|
|
695
734
|
}), i = r("div", { className: "fl-color-picker" });
|
|
696
|
-
for (const c of
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
this.selectedColor = c, i.querySelectorAll(".fl-color-swatch").forEach((
|
|
700
|
-
}, i.appendChild(
|
|
735
|
+
for (const c of S) {
|
|
736
|
+
const h = r("div", { className: `fl-color-swatch ${c === this.selectedColor ? "fl-selected" : ""}` });
|
|
737
|
+
h.style.background = c, h.onclick = () => {
|
|
738
|
+
this.selectedColor = c, i.querySelectorAll(".fl-color-swatch").forEach((d) => d.classList.remove("fl-selected")), h.classList.add("fl-selected");
|
|
739
|
+
}, i.appendChild(h);
|
|
701
740
|
}
|
|
702
741
|
const n = r("button", { className: "fl-btn fl-btn-ok" }, ["Submit"]);
|
|
703
742
|
n.onclick = () => {
|
|
@@ -731,28 +770,28 @@ class B {
|
|
|
731
770
|
const t = window.innerWidth, e = window.innerHeight, s = document.documentElement.cloneNode(!0), i = s.querySelector("#firstlook-sdk-root");
|
|
732
771
|
i == null || i.remove();
|
|
733
772
|
const n = s.querySelectorAll('[data-fl-masked], input[type="password"]');
|
|
734
|
-
for (const
|
|
735
|
-
(
|
|
736
|
-
for (const
|
|
773
|
+
for (const p of n)
|
|
774
|
+
(p instanceof HTMLInputElement || p instanceof HTMLTextAreaElement) && (p.value = "[MASKED]"), p.textContent = "[MASKED]";
|
|
775
|
+
for (const p of s.querySelectorAll("script")) p.remove();
|
|
737
776
|
const o = s.querySelector("body");
|
|
738
777
|
if (o) {
|
|
739
|
-
const
|
|
740
|
-
o.style.backgroundColor =
|
|
778
|
+
const p = window.getComputedStyle(document.body);
|
|
779
|
+
o.style.backgroundColor = p.backgroundColor, o.style.color = p.color, o.style.fontFamily = p.fontFamily, o.style.margin = "0", o.style.overflow = "hidden";
|
|
741
780
|
}
|
|
742
781
|
const l = new XMLSerializer().serializeToString(s), c = `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${e}">
|
|
743
782
|
<foreignObject width="100%" height="100%">
|
|
744
783
|
${l}
|
|
745
784
|
</foreignObject>
|
|
746
|
-
</svg>`,
|
|
747
|
-
|
|
748
|
-
const
|
|
749
|
-
return
|
|
785
|
+
</svg>`, h = new Blob([c], { type: "image/svg+xml;charset=utf-8" }), d = URL.createObjectURL(h), g = document.createElement("canvas");
|
|
786
|
+
g.width = t * window.devicePixelRatio, g.height = e * window.devicePixelRatio;
|
|
787
|
+
const f = g.getContext("2d");
|
|
788
|
+
return f.scale(window.devicePixelRatio, window.devicePixelRatio), new Promise((p) => {
|
|
750
789
|
const m = new Image();
|
|
751
790
|
m.onload = () => {
|
|
752
|
-
|
|
791
|
+
f.drawImage(m, 0, 0, t, e), URL.revokeObjectURL(d), p(g.toDataURL("image/png"));
|
|
753
792
|
}, m.onerror = () => {
|
|
754
|
-
URL.revokeObjectURL(
|
|
755
|
-
}, m.src =
|
|
793
|
+
URL.revokeObjectURL(d), p(this.captureScreenshotFallback(t, e));
|
|
794
|
+
}, m.src = d;
|
|
756
795
|
});
|
|
757
796
|
} catch {
|
|
758
797
|
return this.captureScreenshotFallback(window.innerWidth, window.innerHeight);
|
|
@@ -797,44 +836,17 @@ class B {
|
|
|
797
836
|
return ((t = this.canvas) == null ? void 0 : t.toDataURL("image/png")) || this.screenshotDataUrl;
|
|
798
837
|
}
|
|
799
838
|
}
|
|
800
|
-
class
|
|
801
|
-
constructor(t) {
|
|
802
|
-
this.onShake = t, this.lastX = 0, this.lastY = 0, this.lastZ = 0, this.shakeCount = 0, this.lastShakeTime = 0, this.handler = null, this.THRESHOLD = 15, this.SHAKE_INTERVAL = 400, this.REQUIRED_SHAKES = 2;
|
|
803
|
-
}
|
|
804
|
-
async start() {
|
|
805
|
-
if (typeof DeviceMotionEvent.requestPermission == "function")
|
|
806
|
-
try {
|
|
807
|
-
if (await DeviceMotionEvent.requestPermission() !== "granted") return;
|
|
808
|
-
} catch {
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
811
|
-
this.handler = this.onMotion.bind(this), window.addEventListener("devicemotion", this.handler, { passive: !0 });
|
|
812
|
-
}
|
|
813
|
-
stop() {
|
|
814
|
-
this.handler && (window.removeEventListener("devicemotion", this.handler), this.handler = null);
|
|
815
|
-
}
|
|
816
|
-
onMotion(t) {
|
|
817
|
-
const e = t.accelerationIncludingGravity;
|
|
818
|
-
if (!e || e.x == null || e.y == null || e.z == null) return;
|
|
819
|
-
const s = Math.abs(e.x - this.lastX), i = Math.abs(e.y - this.lastY), n = Math.abs(e.z - this.lastZ);
|
|
820
|
-
if (s + i + n > this.THRESHOLD) {
|
|
821
|
-
const o = Date.now();
|
|
822
|
-
o - this.lastShakeTime < this.SHAKE_INTERVAL ? (this.shakeCount++, this.shakeCount >= this.REQUIRED_SHAKES && (this.shakeCount = 0, this.onShake())) : this.shakeCount = 1, this.lastShakeTime = o;
|
|
823
|
-
}
|
|
824
|
-
this.lastX = e.x, this.lastY = e.y, this.lastZ = e.z;
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
class j {
|
|
839
|
+
class H {
|
|
828
840
|
constructor(t, e) {
|
|
829
841
|
this.shadowRoot = t, this.events = e, this.annotations = [], this.active = !1, this.onKeydown = (s) => {
|
|
830
842
|
s.ctrlKey && s.shiftKey && s.key === "R" && (s.preventDefault(), this.trigger());
|
|
831
|
-
}, this.annotationCanvas = new
|
|
843
|
+
}, this.annotationCanvas = new K(t);
|
|
832
844
|
}
|
|
833
|
-
|
|
834
|
-
|
|
845
|
+
start() {
|
|
846
|
+
document.addEventListener("keydown", this.onKeydown);
|
|
835
847
|
}
|
|
836
848
|
stop() {
|
|
837
|
-
|
|
849
|
+
document.removeEventListener("keydown", this.onKeydown);
|
|
838
850
|
}
|
|
839
851
|
getAnnotations() {
|
|
840
852
|
return [...this.annotations];
|
|
@@ -851,7 +863,7 @@ class j {
|
|
|
851
863
|
}
|
|
852
864
|
}
|
|
853
865
|
}
|
|
854
|
-
class
|
|
866
|
+
class _ {
|
|
855
867
|
constructor(t, e) {
|
|
856
868
|
this.requiredTaps = t, this.onActivate = e, this.tapCount = 0, this.tapTimer = null, this.handler = null;
|
|
857
869
|
}
|
|
@@ -868,8 +880,8 @@ class $ {
|
|
|
868
880
|
this.tapCount = 0, this.tapTimer && (clearTimeout(this.tapTimer), this.tapTimer = null);
|
|
869
881
|
}
|
|
870
882
|
}
|
|
871
|
-
const
|
|
872
|
-
class
|
|
883
|
+
const w = "firstlook:uat-active";
|
|
884
|
+
class C {
|
|
873
885
|
constructor(t) {
|
|
874
886
|
this.onActivate = t, this.handlers = [];
|
|
875
887
|
}
|
|
@@ -894,7 +906,7 @@ class S {
|
|
|
894
906
|
}
|
|
895
907
|
static clearPersisted() {
|
|
896
908
|
try {
|
|
897
|
-
sessionStorage.removeItem(
|
|
909
|
+
sessionStorage.removeItem(w);
|
|
898
910
|
} catch {
|
|
899
911
|
}
|
|
900
912
|
}
|
|
@@ -912,19 +924,19 @@ class S {
|
|
|
912
924
|
}
|
|
913
925
|
persist() {
|
|
914
926
|
try {
|
|
915
|
-
sessionStorage.setItem(
|
|
927
|
+
sessionStorage.setItem(w, "1");
|
|
916
928
|
} catch {
|
|
917
929
|
}
|
|
918
930
|
}
|
|
919
931
|
hasPersisted() {
|
|
920
932
|
try {
|
|
921
|
-
return sessionStorage.getItem(
|
|
933
|
+
return sessionStorage.getItem(w) === "1";
|
|
922
934
|
} catch {
|
|
923
935
|
return !1;
|
|
924
936
|
}
|
|
925
937
|
}
|
|
926
938
|
}
|
|
927
|
-
class
|
|
939
|
+
class W {
|
|
928
940
|
constructor(t) {
|
|
929
941
|
this.onActivate = t, this.handler = null;
|
|
930
942
|
}
|
|
@@ -937,7 +949,7 @@ class K {
|
|
|
937
949
|
this.handler && (window.removeEventListener("keydown", this.handler), this.handler = null);
|
|
938
950
|
}
|
|
939
951
|
}
|
|
940
|
-
class
|
|
952
|
+
class V {
|
|
941
953
|
constructor(t, e) {
|
|
942
954
|
this.shadowRoot = t, this.callbacks = e, this.root = null, this.outsideClickHandler = null;
|
|
943
955
|
}
|
|
@@ -974,7 +986,7 @@ class H {
|
|
|
974
986
|
return this.root !== null;
|
|
975
987
|
}
|
|
976
988
|
}
|
|
977
|
-
const
|
|
989
|
+
const X = (
|
|
978
990
|
/* css */
|
|
979
991
|
`
|
|
980
992
|
:host {
|
|
@@ -1185,6 +1197,51 @@ const _ = (
|
|
|
1185
1197
|
50% { opacity: 0.3; }
|
|
1186
1198
|
}
|
|
1187
1199
|
|
|
1200
|
+
/* === Checklist === */
|
|
1201
|
+
.fl-checklist-counter {
|
|
1202
|
+
font-size: 13px;
|
|
1203
|
+
font-weight: 600;
|
|
1204
|
+
color: #6c5ce7;
|
|
1205
|
+
margin-bottom: 8px;
|
|
1206
|
+
}
|
|
1207
|
+
.fl-checklist {
|
|
1208
|
+
list-style: none;
|
|
1209
|
+
padding: 0;
|
|
1210
|
+
margin: 0 0 12px;
|
|
1211
|
+
max-height: 240px;
|
|
1212
|
+
overflow-y: auto;
|
|
1213
|
+
-webkit-overflow-scrolling: touch;
|
|
1214
|
+
}
|
|
1215
|
+
.fl-checklist-item {
|
|
1216
|
+
display: flex;
|
|
1217
|
+
align-items: flex-start;
|
|
1218
|
+
gap: 8px;
|
|
1219
|
+
padding: 8px 4px;
|
|
1220
|
+
border-bottom: 1px solid rgba(0,0,0,.06);
|
|
1221
|
+
font-size: 13px;
|
|
1222
|
+
color: #4a4a5a;
|
|
1223
|
+
cursor: pointer;
|
|
1224
|
+
min-height: 40px;
|
|
1225
|
+
transition: background .2s;
|
|
1226
|
+
}
|
|
1227
|
+
.fl-checklist-item:last-child { border-bottom: none; }
|
|
1228
|
+
.fl-checklist-item:active { background: rgba(108,92,231,.05); }
|
|
1229
|
+
.fl-checklist-item.fl-checked { color: #aaa; }
|
|
1230
|
+
.fl-checklist-item.fl-checked .fl-checklist-text { text-decoration: line-through; }
|
|
1231
|
+
.fl-checklist-checkbox {
|
|
1232
|
+
margin-top: 2px;
|
|
1233
|
+
width: 18px;
|
|
1234
|
+
height: 18px;
|
|
1235
|
+
accent-color: #6c5ce7;
|
|
1236
|
+
flex-shrink: 0;
|
|
1237
|
+
cursor: pointer;
|
|
1238
|
+
}
|
|
1239
|
+
.fl-checklist-text {
|
|
1240
|
+
flex: 1;
|
|
1241
|
+
line-height: 1.4;
|
|
1242
|
+
word-break: break-word;
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1188
1245
|
/* === Annotation overlay === */
|
|
1189
1246
|
.fl-annotation-overlay {
|
|
1190
1247
|
position: fixed;
|
|
@@ -1430,10 +1487,10 @@ const _ = (
|
|
|
1430
1487
|
}
|
|
1431
1488
|
.fl-feedback-modal-actions { padding: 0 16px 16px; }
|
|
1432
1489
|
`
|
|
1433
|
-
),
|
|
1434
|
-
class
|
|
1490
|
+
), Y = 5;
|
|
1491
|
+
class G {
|
|
1435
1492
|
constructor() {
|
|
1436
|
-
this.config = null, this.events = new
|
|
1493
|
+
this.config = null, this.events = new E(), this.state = "idle", this.hostElement = null, this.shadowRoot = null, this.questManager = null, this.questOverlay = null, this.sessionRecorder = null, this.voiceRecorder = null, this.watermark = null, this.fieldMasker = null, this.storage = null, this.issueReporter = null, this.debugMenu = null, this.tapTrigger = null, this.deepLinkTrigger = null, this.keyboardTrigger = null, this.sessionId = null, this.sessionStartTime = 0, this.maxDurationTimer = null, this.backupTimer = null, this.isFlushing = !1;
|
|
1437
1494
|
}
|
|
1438
1495
|
// ----------------------------------------------------------------
|
|
1439
1496
|
// Public API
|
|
@@ -1447,7 +1504,7 @@ class X {
|
|
|
1447
1504
|
console.warn("[FirstLook] SDK already initialized.");
|
|
1448
1505
|
return;
|
|
1449
1506
|
}
|
|
1450
|
-
this.config =
|
|
1507
|
+
this.config = M(t), this.storage = new j(), await this.storage.open(), this.createShadowHost(), this.setupTriggers(), this.fieldMasker = new B(this.config.security.maskSelectors), this.state = "initialized", this.events.emit({ type: "sdk:initialized" }), this.flushUploadQueue(!0);
|
|
1451
1508
|
}
|
|
1452
1509
|
/**
|
|
1453
1510
|
* Manually activate the SDK UI (bypassing triggers).
|
|
@@ -1466,11 +1523,11 @@ class X {
|
|
|
1466
1523
|
var s;
|
|
1467
1524
|
if (this.state !== "active")
|
|
1468
1525
|
throw new Error("[FirstLook] Cannot start session: SDK not active. Call activate() first.");
|
|
1469
|
-
(s = this.debugMenu) == null || s.hide(), this.sessionId =
|
|
1526
|
+
(s = this.debugMenu) == null || s.hide(), this.sessionId = L(), this.sessionStartTime = Date.now(), this.questManager = new R(this.events), this.questManager.loadQuests(t), this.sessionRecorder = new z(
|
|
1470
1527
|
this.config,
|
|
1471
1528
|
this.events,
|
|
1472
1529
|
this.fieldMasker.getCombinedSelector()
|
|
1473
|
-
), this.voiceRecorder = new
|
|
1530
|
+
), this.voiceRecorder = new O(this.events), this.issueReporter = new H(this.shadowRoot, this.events), this.issueReporter.start(), this.sessionRecorder.start(), this.fieldMasker.start(), this.config.recording.voice && await this.voiceRecorder.start(), this.config.security.watermark && (this.watermark = new Q(this.shadowRoot, this.config), this.watermark.show()), this.questOverlay = new N(this.shadowRoot, {
|
|
1474
1531
|
onOkWithFeedback: (i) => this.handleQuestOk(i),
|
|
1475
1532
|
onConcern: (i) => this.handleConcern(i),
|
|
1476
1533
|
onNg: () => this.handleQuestNg(),
|
|
@@ -1503,9 +1560,9 @@ class X {
|
|
|
1503
1560
|
* End the current session, persist data, and trigger upload.
|
|
1504
1561
|
*/
|
|
1505
1562
|
async endSession() {
|
|
1506
|
-
var i, n, o, l, c,
|
|
1563
|
+
var i, n, o, l, c, h, d, g, f, p, m;
|
|
1507
1564
|
if (this.state !== "recording" || !this.sessionId) return null;
|
|
1508
|
-
this.maxDurationTimer && (clearTimeout(this.maxDurationTimer), this.maxDurationTimer = null), this.backupTimer && (clearInterval(this.backupTimer), this.backupTimer = null), (i = this.sessionRecorder) == null || i.stop(), await ((n = this.voiceRecorder) == null ? void 0 : n.stopAsync()), (o = this.
|
|
1565
|
+
this.maxDurationTimer && (clearTimeout(this.maxDurationTimer), this.maxDurationTimer = null), this.backupTimer && (clearInterval(this.backupTimer), this.backupTimer = null), (i = this.sessionRecorder) == null || i.stop(), await ((n = this.voiceRecorder) == null ? void 0 : n.stopAsync()), (o = this.issueReporter) == null || o.stop(), (l = this.fieldMasker) == null || l.stop(), (c = this.watermark) == null || c.hide();
|
|
1509
1566
|
const t = this.questManager.getResults();
|
|
1510
1567
|
await Promise.allSettled(
|
|
1511
1568
|
t.map(async (b) => {
|
|
@@ -1517,13 +1574,13 @@ class X {
|
|
|
1517
1574
|
delete b.voiceMemoBlob;
|
|
1518
1575
|
}
|
|
1519
1576
|
await Promise.allSettled(
|
|
1520
|
-
b.feedbacks.map(async (
|
|
1521
|
-
if (
|
|
1577
|
+
b.feedbacks.map(async (k) => {
|
|
1578
|
+
if (k.voiceMemoBlob) {
|
|
1522
1579
|
try {
|
|
1523
|
-
|
|
1580
|
+
k.voiceMemoBase64 = await this.blobToBase64(k.voiceMemoBlob);
|
|
1524
1581
|
} catch {
|
|
1525
1582
|
}
|
|
1526
|
-
delete
|
|
1583
|
+
delete k.voiceMemoBlob;
|
|
1527
1584
|
}
|
|
1528
1585
|
})
|
|
1529
1586
|
);
|
|
@@ -1534,18 +1591,18 @@ class X {
|
|
|
1534
1591
|
projectId: this.config.projectId,
|
|
1535
1592
|
userId: this.config.userId,
|
|
1536
1593
|
role: this.config.role,
|
|
1537
|
-
deviceInfo:
|
|
1594
|
+
deviceInfo: y(),
|
|
1538
1595
|
startedAt: new Date(this.sessionStartTime).toISOString(),
|
|
1539
1596
|
endedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1540
1597
|
duration: Math.floor((Date.now() - this.sessionStartTime) / 1e3),
|
|
1541
1598
|
quests: t,
|
|
1542
|
-
recordings: ((
|
|
1599
|
+
recordings: ((h = this.sessionRecorder) == null ? void 0 : h.getSnapshots()) ?? []
|
|
1543
1600
|
};
|
|
1544
|
-
await ((
|
|
1545
|
-
const s = ((
|
|
1601
|
+
await ((d = this.storage) == null ? void 0 : d.saveSession(e));
|
|
1602
|
+
const s = ((g = this.issueReporter) == null ? void 0 : g.getAnnotations()) ?? [];
|
|
1546
1603
|
for (const b of s)
|
|
1547
|
-
await ((
|
|
1548
|
-
return await ((
|
|
1604
|
+
await ((f = this.storage) == null ? void 0 : f.saveAnnotation(this.sessionId, b));
|
|
1605
|
+
return await ((p = this.storage) == null ? void 0 : p.enqueueUpload({ session: e, annotations: s })), (m = this.questOverlay) == null || m.destroy(), this.questOverlay = null, this.state = "finished", this.events.emit({ type: "session:ended", sessionId: this.sessionId }), this.flushUploadQueue(!1), e;
|
|
1549
1606
|
}
|
|
1550
1607
|
/**
|
|
1551
1608
|
* Subscribe to SDK events.
|
|
@@ -1563,9 +1620,9 @@ class X {
|
|
|
1563
1620
|
* Completely destroy the SDK instance and clean up all resources.
|
|
1564
1621
|
*/
|
|
1565
1622
|
destroy() {
|
|
1566
|
-
var t, e, s, i, n, o, l, c,
|
|
1567
|
-
this.maxDurationTimer && (clearTimeout(this.maxDurationTimer), this.maxDurationTimer = null), this.backupTimer && (clearInterval(this.backupTimer), this.backupTimer = null), (t = this.tapTrigger) == null || t.stop(), (e = this.deepLinkTrigger) == null || e.stop(), (s = this.keyboardTrigger) == null || s.stop(),
|
|
1568
|
-
}), (o = this.
|
|
1623
|
+
var t, e, s, i, n, o, l, c, h, d, g, f;
|
|
1624
|
+
this.maxDurationTimer && (clearTimeout(this.maxDurationTimer), this.maxDurationTimer = null), this.backupTimer && (clearInterval(this.backupTimer), this.backupTimer = null), (t = this.tapTrigger) == null || t.stop(), (e = this.deepLinkTrigger) == null || e.stop(), (s = this.keyboardTrigger) == null || s.stop(), C.clearPersisted(), (i = this.sessionRecorder) == null || i.stop(), (n = this.voiceRecorder) == null || n.stopAsync().catch(() => {
|
|
1625
|
+
}), (o = this.issueReporter) == null || o.stop(), (l = this.fieldMasker) == null || l.stop(), (c = this.watermark) == null || c.hide(), (h = this.questOverlay) == null || h.destroy(), (d = this.debugMenu) == null || d.hide(), (g = this.hostElement) == null || g.remove(), (f = this.storage) == null || f.close(), this.events.removeAll(), this.config = null, this.questManager = null, this.questOverlay = null, this.sessionRecorder = null, this.voiceRecorder = null, this.issueReporter = null, this.fieldMasker = null, this.debugMenu = null, this.tapTrigger = null, this.deepLinkTrigger = null, this.keyboardTrigger = null, this.storage = null, this.hostElement = null, this.shadowRoot = null, this.sessionId = null, this.state = "idle";
|
|
1569
1626
|
}
|
|
1570
1627
|
// ----------------------------------------------------------------
|
|
1571
1628
|
// Private methods
|
|
@@ -1574,21 +1631,21 @@ class X {
|
|
|
1574
1631
|
var e;
|
|
1575
1632
|
(e = document.getElementById("firstlook-sdk-root")) == null || e.remove(), this.hostElement = document.createElement("div"), this.hostElement.id = "firstlook-sdk-root", this.hostElement.style.cssText = "position:fixed;inset:0;z-index:2147483647;pointer-events:none;", document.body.appendChild(this.hostElement), this.shadowRoot = this.hostElement.attachShadow({ mode: "closed" });
|
|
1576
1633
|
const t = document.createElement("style");
|
|
1577
|
-
t.textContent =
|
|
1634
|
+
t.textContent = X, this.shadowRoot.appendChild(t);
|
|
1578
1635
|
}
|
|
1579
1636
|
setupTriggers() {
|
|
1580
1637
|
const t = this.config.triggers;
|
|
1581
|
-
this.tapTrigger = new
|
|
1638
|
+
this.tapTrigger = new _(t.tapCount, () => this.onActivate()), this.tapTrigger.start(), t.deepLink && (this.deepLinkTrigger = new C(() => this.onActivate()), this.deepLinkTrigger.start()), t.keyboard && (this.keyboardTrigger = new W(() => this.onActivate()), this.keyboardTrigger.start()), t.customCheck && t.customCheck() && this.onActivate();
|
|
1582
1639
|
}
|
|
1583
1640
|
onActivate() {
|
|
1584
1641
|
var t, e, s;
|
|
1585
|
-
this.state === "initialized" && (this.state = "active", (t = this.tapTrigger) == null || t.stop(), (e = this.deepLinkTrigger) == null || e.stop(), (s = this.keyboardTrigger) == null || s.stop(), this.events.emit({ type: "sdk:activated" }), this.debugMenu = new
|
|
1642
|
+
this.state === "initialized" && (this.state = "active", (t = this.tapTrigger) == null || t.stop(), (e = this.deepLinkTrigger) == null || e.stop(), (s = this.keyboardTrigger) == null || s.stop(), this.events.emit({ type: "sdk:activated" }), this.debugMenu = new V(this.shadowRoot, {
|
|
1586
1643
|
onStartSession: () => {
|
|
1587
1644
|
this.events.emit({ type: "sdk:activated" });
|
|
1588
1645
|
},
|
|
1589
1646
|
onReportIssue: () => {
|
|
1590
|
-
var i
|
|
1591
|
-
(
|
|
1647
|
+
var i;
|
|
1648
|
+
(i = this.issueReporter) == null || i.trigger();
|
|
1592
1649
|
},
|
|
1593
1650
|
onClose: () => {
|
|
1594
1651
|
this.destroy();
|
|
@@ -1596,18 +1653,22 @@ class X {
|
|
|
1596
1653
|
}), this.debugMenu.show());
|
|
1597
1654
|
}
|
|
1598
1655
|
handleQuestOk(t) {
|
|
1656
|
+
var i;
|
|
1599
1657
|
if (!this.questManager || !this.sessionRecorder) return;
|
|
1600
|
-
const e = this.sessionRecorder.getActionLogs();
|
|
1658
|
+
const e = this.sessionRecorder.getActionLogs(), s = (i = this.questOverlay) == null ? void 0 : i.getChecklist();
|
|
1601
1659
|
this.questManager.completeCurrentQuest(e, {
|
|
1602
|
-
comment: t || void 0
|
|
1660
|
+
comment: t || void 0,
|
|
1661
|
+
checklist: s
|
|
1603
1662
|
}), this.renderCurrentQuest();
|
|
1604
1663
|
}
|
|
1605
1664
|
handleConcern(t) {
|
|
1665
|
+
var i;
|
|
1606
1666
|
if (!this.questManager || !this.sessionRecorder) return;
|
|
1607
|
-
const e = this.sessionRecorder.getActionLogs();
|
|
1667
|
+
const e = this.sessionRecorder.getActionLogs(), s = (i = this.questOverlay) == null ? void 0 : i.getChecklist();
|
|
1608
1668
|
this.questManager.completeCurrentQuest(e, {
|
|
1609
1669
|
comment: t,
|
|
1610
|
-
concern: !0
|
|
1670
|
+
concern: !0,
|
|
1671
|
+
checklist: s
|
|
1611
1672
|
}), this.renderCurrentQuest();
|
|
1612
1673
|
}
|
|
1613
1674
|
handleQuestNg() {
|
|
@@ -1616,9 +1677,10 @@ class X {
|
|
|
1616
1677
|
t && this.questOverlay.renderFeedbackModal(t.title, "ng");
|
|
1617
1678
|
}
|
|
1618
1679
|
handleNgFeedbackSubmit(t) {
|
|
1680
|
+
var i;
|
|
1619
1681
|
if (!this.questManager || !this.sessionRecorder) return;
|
|
1620
|
-
const e = this.sessionRecorder.getActionLogs();
|
|
1621
|
-
this.questManager.failCurrentQuest(e, t || void 0), this.renderCurrentQuest();
|
|
1682
|
+
const e = this.sessionRecorder.getActionLogs(), s = (i = this.questOverlay) == null ? void 0 : i.getChecklist();
|
|
1683
|
+
this.questManager.failCurrentQuest(e, t || void 0, void 0, s), this.renderCurrentQuest();
|
|
1622
1684
|
}
|
|
1623
1685
|
handleMemo(t) {
|
|
1624
1686
|
if (!this.questManager || !t) return;
|
|
@@ -1660,7 +1722,7 @@ class X {
|
|
|
1660
1722
|
}
|
|
1661
1723
|
const e = await this.storage.getPendingUploads();
|
|
1662
1724
|
for (const s of e) {
|
|
1663
|
-
if (s.attempts >=
|
|
1725
|
+
if (s.attempts >= Y) {
|
|
1664
1726
|
await this.storage.removeFromQueue(s.key);
|
|
1665
1727
|
continue;
|
|
1666
1728
|
}
|
|
@@ -1696,7 +1758,7 @@ class X {
|
|
|
1696
1758
|
projectId: this.config.projectId,
|
|
1697
1759
|
userId: this.config.userId,
|
|
1698
1760
|
role: this.config.role,
|
|
1699
|
-
deviceInfo:
|
|
1761
|
+
deviceInfo: y(),
|
|
1700
1762
|
startedAt: new Date(this.sessionStartTime).toISOString(),
|
|
1701
1763
|
duration: Math.floor((Date.now() - this.sessionStartTime) / 1e3),
|
|
1702
1764
|
quests: ((t = this.questManager) == null ? void 0 : t.getResults()) ?? [],
|
|
@@ -1714,6 +1776,6 @@ class X {
|
|
|
1714
1776
|
}
|
|
1715
1777
|
}
|
|
1716
1778
|
export {
|
|
1717
|
-
|
|
1779
|
+
G as FirstLookSDK
|
|
1718
1780
|
};
|
|
1719
1781
|
//# sourceMappingURL=firstlook.es.js.map
|