@sailfish-ai/recorder 1.11.0 → 1.11.3
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/README.md +94 -0
- package/dist/chunks/{chunkSerializer-ZzIoYlP2.js → chunkSerializer-CV4nkb5-.js} +1 -1
- package/dist/chunks/chunkSerializer-CV4nkb5-.js.br +0 -0
- package/dist/chunks/chunkSerializer-CV4nkb5-.js.gz +0 -0
- package/dist/chunks/{chunkSerializer-CRDpgzTs.js → chunkSerializer-jzbHv2wf.js} +1 -1
- package/dist/chunks/chunkSerializer-jzbHv2wf.js.br +0 -0
- package/dist/chunks/chunkSerializer-jzbHv2wf.js.gz +0 -0
- package/dist/chunks/{index-BQn1Q-2-.js → index-BP-kNUGS.js} +174 -134
- package/dist/chunks/index-BP-kNUGS.js.br +0 -0
- package/dist/chunks/index-BP-kNUGS.js.gz +0 -0
- package/dist/chunks/{index-Dq_tjmkZ.js → index-BynFTRFv.js} +130 -87
- package/dist/chunks/index-BynFTRFv.js.br +0 -0
- package/dist/chunks/index-BynFTRFv.js.gz +0 -0
- package/dist/chunks/rrweb-plugin-performance-record-BYWkWb25.js +188 -0
- package/dist/chunks/rrweb-plugin-performance-record-BYWkWb25.js.br +0 -0
- package/dist/chunks/rrweb-plugin-performance-record-BYWkWb25.js.gz +0 -0
- package/dist/chunks/rrweb-plugin-performance-record-Dekf6xUi.js +186 -0
- package/dist/chunks/rrweb-plugin-performance-record-Dekf6xUi.js.br +0 -0
- package/dist/chunks/rrweb-plugin-performance-record-Dekf6xUi.js.gz +0 -0
- package/dist/constants.js +1 -0
- package/dist/constants.js.br +0 -0
- package/dist/constants.js.gz +0 -0
- package/dist/inAppReportIssueModal/index.js +15 -14
- package/dist/inAppReportIssueModal/index.js.br +0 -0
- package/dist/inAppReportIssueModal/index.js.gz +0 -0
- package/dist/inAppReportIssueModal/integrations.js +56 -4
- package/dist/inAppReportIssueModal/integrations.js.br +0 -0
- package/dist/inAppReportIssueModal/integrations.js.gz +0 -0
- package/dist/index.js +68 -42
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/recorder.cjs +2 -2
- package/dist/recorder.cjs.br +0 -0
- package/dist/recorder.cjs.gz +0 -0
- package/dist/recorder.js +27 -25
- package/dist/recorder.js.br +0 -0
- package/dist/recorder.js.gz +0 -0
- package/dist/recorder.umd.cjs +4994 -4776
- package/dist/recorder.umd.cjs.br +0 -0
- package/dist/recorder.umd.cjs.gz +0 -0
- package/dist/recording.js +33 -3
- package/dist/recording.js.br +0 -0
- package/dist/recording.js.gz +0 -0
- package/dist/sendSailfishMessages.js +4 -0
- package/dist/sendSailfishMessages.js.br +0 -0
- package/dist/sendSailfishMessages.js.gz +0 -0
- package/dist/snippet-auto-init.js +147 -18
- package/dist/snippet-auto-init.js.br +0 -0
- package/dist/snippet-auto-init.js.gz +0 -0
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/inAppReportIssueModal/integrations.d.ts +7 -0
- package/dist/types/index.d.ts +23 -1
- package/dist/types/recording.d.ts +1 -0
- package/dist/types/sendSailfishMessages.d.ts +4 -0
- package/dist/types/snippet-auto-init.d.ts +30 -0
- package/dist/types/types.d.ts +1 -0
- package/package.json +7 -4
- package/dist/chunks/chunkSerializer-CRDpgzTs.js.br +0 -0
- package/dist/chunks/chunkSerializer-CRDpgzTs.js.gz +0 -0
- package/dist/chunks/chunkSerializer-ZzIoYlP2.js.br +0 -0
- package/dist/chunks/chunkSerializer-ZzIoYlP2.js.gz +0 -0
- package/dist/chunks/index-BQn1Q-2-.js.br +0 -0
- package/dist/chunks/index-BQn1Q-2-.js.gz +0 -0
- package/dist/chunks/index-Dq_tjmkZ.js.br +0 -0
- package/dist/chunks/index-Dq_tjmkZ.js.gz +0 -0
|
@@ -178,8 +178,8 @@ function withAppUrlMetadata(e2) {
|
|
|
178
178
|
return { ...e2 ?? {}, appUrl: (e2 == null ? void 0 : e2.appUrl) ?? ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.href) };
|
|
179
179
|
}
|
|
180
180
|
exports.nowTimestamp = Date.now, /[1-9][0-9]{12}/.test(Date.now().toString()) || (exports.nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime());
|
|
181
|
-
const
|
|
182
|
-
let
|
|
181
|
+
const w = readDebugFlag(), S = "per_session";
|
|
182
|
+
let v = null, k = null, x = false, I = null, T = null, E = "", C = "", $ = false;
|
|
183
183
|
const F = [];
|
|
184
184
|
function onNavigationChange(e2) {
|
|
185
185
|
F.push(e2);
|
|
@@ -222,12 +222,12 @@ function _flushIDBQueue() {
|
|
|
222
222
|
});
|
|
223
223
|
})(L.splice(0));
|
|
224
224
|
}
|
|
225
|
-
let A = false, R = null, D = null,
|
|
226
|
-
const
|
|
225
|
+
let A = false, R = null, D = null, P = false;
|
|
226
|
+
const _ = "sailfish_funcspan_global_state";
|
|
227
227
|
function wsSendPayload(e2) {
|
|
228
228
|
if (!isWebSocketOpen(k)) return false;
|
|
229
|
-
if (
|
|
230
|
-
return
|
|
229
|
+
if (v) try {
|
|
230
|
+
return v.postMessage({ type: "send", payload: e2 }), true;
|
|
231
231
|
} catch {
|
|
232
232
|
return false;
|
|
233
233
|
}
|
|
@@ -239,8 +239,8 @@ function wsSendPayload(e2) {
|
|
|
239
239
|
}
|
|
240
240
|
function wsSendRaw(e2) {
|
|
241
241
|
if (!isWebSocketOpen(k)) return false;
|
|
242
|
-
if (
|
|
243
|
-
return
|
|
242
|
+
if (v) try {
|
|
243
|
+
return v.postMessage({ type: "sendRaw", payload: e2 }), true;
|
|
244
244
|
} catch {
|
|
245
245
|
return false;
|
|
246
246
|
}
|
|
@@ -254,21 +254,21 @@ function saveGlobalFuncSpanState(e2, t2) {
|
|
|
254
254
|
try {
|
|
255
255
|
if ("undefined" == typeof localStorage) return;
|
|
256
256
|
const n2 = { enabled: e2, expirationTimestampMs: t2, savedAt: Date.now() };
|
|
257
|
-
localStorage.setItem(
|
|
257
|
+
localStorage.setItem(_, JSON.stringify(n2)), w && console.log("[Sailfish] Saved funcSpan state to localStorage:", n2);
|
|
258
258
|
} catch (e3) {
|
|
259
|
-
|
|
259
|
+
w && console.warn("[Sailfish] Failed to save funcSpan state to localStorage:", e3);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
function clearGlobalFuncSpanState() {
|
|
263
263
|
try {
|
|
264
264
|
if ("undefined" == typeof localStorage) return;
|
|
265
|
-
localStorage.removeItem(
|
|
265
|
+
localStorage.removeItem(_), w && console.log("[Sailfish] Cleared funcSpan state from localStorage");
|
|
266
266
|
} catch (e2) {
|
|
267
|
-
|
|
267
|
+
w && console.warn("[Sailfish] Failed to clear funcSpan state from localStorage:", e2);
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
function clearStaleFuncSpanState() {
|
|
271
|
-
A = false, D = null,
|
|
271
|
+
A = false, D = null, P = false, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Cleared stale function span tracking state (backend validation failed)");
|
|
272
272
|
}
|
|
273
273
|
let B = false;
|
|
274
274
|
function restoreFuncSpanState() {
|
|
@@ -277,17 +277,17 @@ function restoreFuncSpanState() {
|
|
|
277
277
|
const e2 = (function loadGlobalFuncSpanState() {
|
|
278
278
|
try {
|
|
279
279
|
if ("undefined" == typeof localStorage) return null;
|
|
280
|
-
const e3 = localStorage.getItem(
|
|
280
|
+
const e3 = localStorage.getItem(_);
|
|
281
281
|
if (!e3) return null;
|
|
282
282
|
const t2 = JSON.parse(e3);
|
|
283
|
-
return
|
|
283
|
+
return w && console.log("[Sailfish] Loaded funcSpan state from localStorage:", t2), t2;
|
|
284
284
|
} catch (e3) {
|
|
285
|
-
return
|
|
285
|
+
return w && console.warn("[Sailfish] Failed to load funcSpan state from localStorage:", e3), null;
|
|
286
286
|
}
|
|
287
287
|
})();
|
|
288
|
-
if (e2 && e2.enabled) if (A = true, D = e2.expirationTimestampMs,
|
|
289
|
-
Date.now() >= D ? (A = false, D = null, clearGlobalFuncSpanState(),
|
|
290
|
-
} else
|
|
288
|
+
if (e2 && e2.enabled) if (A = true, D = e2.expirationTimestampMs, P = false, w && console.log("[Sailfish] Restored global function span tracking from localStorage:", { enabled: true, expirationTime: D }), null !== D) {
|
|
289
|
+
Date.now() >= D ? (A = false, D = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Persisted tracking already expired, cleared state")) : w && console.log("[Sailfish] Function span tracking is active and valid (temporary until WebSocket confirms)");
|
|
290
|
+
} else w && console.log("[Sailfish] Function span tracking is active (no expiration, temporary until WebSocket confirms)");
|
|
291
291
|
}
|
|
292
292
|
function isWebSocketOpen(e2) {
|
|
293
293
|
return (e2 == null ? void 0 : e2.readyState) === WebSocket.OPEN;
|
|
@@ -345,7 +345,7 @@ function sendEvent(e2) {
|
|
|
345
345
|
e2.app_url || (e2.app_url = getCachedHref()), !x && isWebSocketOpen(k) && wsSendPayload({ type: "event", event: e2, mapUuid: window.sfMapUuid }) || queueEventForIDB(e2);
|
|
346
346
|
}
|
|
347
347
|
function handleWsOpen() {
|
|
348
|
-
|
|
348
|
+
w && (console.log("[Sailfish] WebSocket connection opened"), console.log("[Sailfish] Function span tracking state: " + (A ? "ENABLED" : "DISABLED"))), (async () => {
|
|
349
349
|
try {
|
|
350
350
|
x = true, await flushNotifyQueue(), await flushBufferedEvents();
|
|
351
351
|
} finally {
|
|
@@ -357,29 +357,29 @@ function handleWsOpen() {
|
|
|
357
357
|
})();
|
|
358
358
|
}
|
|
359
359
|
function handleWsClose() {
|
|
360
|
-
null != T && (clearInterval(T), T = null),
|
|
360
|
+
null != T && (clearInterval(T), T = null), w && console.log("[Sailfish] WebSocket closed");
|
|
361
361
|
}
|
|
362
362
|
function handleWsMessage(e2) {
|
|
363
363
|
try {
|
|
364
364
|
const t2 = JSON.parse(e2);
|
|
365
|
-
if ("funcSpanTrackingControl" === t2.type) if (
|
|
365
|
+
if ("funcSpanTrackingControl" === t2.type) if (w && console.log("[Sailfish] Received funcSpanTrackingControl message:", { enabled: t2.enabled, timeoutSeconds: t2.timeoutSeconds, expirationTimestampMs: t2.expirationTimestampMs }), null !== R && (window.clearTimeout(R), R = null), A = t2.enabled, P = false, w && console.log("[Sailfish] Function span tracking " + (t2.enabled ? "ENABLED (GLOBAL)" : "DISABLED (GLOBAL)")), t2.enabled) {
|
|
366
366
|
if (t2.expirationTimestampMs) {
|
|
367
367
|
D = t2.expirationTimestampMs;
|
|
368
368
|
const e3 = Date.now(), n2 = D - e3;
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}, n2)) : (A = false, D = null, clearGlobalFuncSpanState(),
|
|
369
|
+
w && console.log(`[Sailfish] Server expiration timestamp: ${D}, ms until expiration: ${n2}`), n2 > 0 ? (saveGlobalFuncSpanState(true, D), R = window.setTimeout(() => {
|
|
370
|
+
P || (A = false, D = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] GLOBAL function span tracking auto-disabled at server expiration time"), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), w && console.log("[Sailfish] Notified backend that function span tracking expired"));
|
|
371
|
+
}, n2)) : (A = false, D = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Tracking already expired, not enabling"));
|
|
372
372
|
} else {
|
|
373
373
|
const e3 = t2.timeoutSeconds || 3600;
|
|
374
374
|
e3 > 0 && (D = Date.now() + 1e3 * e3, saveGlobalFuncSpanState(true, D), R = window.setTimeout(() => {
|
|
375
|
-
|
|
375
|
+
P || (A = false, D = null, clearGlobalFuncSpanState(), w && console.log(`[Sailfish] GLOBAL function span tracking auto-disabled after ${e3}s (legacy)`), wsSendPayload({ type: "funcSpanTrackingExpired", sessionId: getOrSetSessionId(), expiredAt: Date.now() }), w && console.log("[Sailfish] Notified backend that function span tracking expired (legacy timeout)"));
|
|
376
376
|
}, 1e3 * e3));
|
|
377
377
|
}
|
|
378
378
|
try {
|
|
379
379
|
const e3 = getOrSetSessionId();
|
|
380
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }),
|
|
380
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: e3, enabled: true, configurationType: "global" }), w && console.log(`[Sailfish] GLOBAL tracking session report sent for session: ${e3}`);
|
|
381
381
|
} catch (e3) {
|
|
382
|
-
|
|
382
|
+
w && console.warn("[Sailfish] Failed to send GLOBAL tracking session report:", e3);
|
|
383
383
|
}
|
|
384
384
|
} else D = null, clearGlobalFuncSpanState();
|
|
385
385
|
} catch (e3) {
|
|
@@ -391,8 +391,8 @@ function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
|
391
391
|
const t3 = new URL(e2);
|
|
392
392
|
return `${t3.hostname}${t3.port ? `:${t3.port}` : ""}`;
|
|
393
393
|
})(t2);
|
|
394
|
-
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${r2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.11.
|
|
395
|
-
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`),
|
|
394
|
+
let a2 = `${"https:" === new URL(t2).protocol ? "wss" : "ws"}://${r2}/ws/notify/?apiKey=${n2}&sessionId=${i2}&sender=JS%2FTS&version=1.11.3`;
|
|
395
|
+
if (o2 && (a2 += `&envValue=${encodeURIComponent(o2)}`), v = s2 ? (function tryCreateWsWorker() {
|
|
396
396
|
if ("undefined" == typeof Worker) return null;
|
|
397
397
|
try {
|
|
398
398
|
const e2 = new Blob(['\nvar ws = null;\nvar wsUrl = "";\nvar reconnectTimer = null;\nvar reconnectDelay = 1000;\nvar MAX_RECONNECT_DELAY = 30000;\nvar CONNECTION_TIMEOUT = 30000;\nvar queue = [];\nvar MAX_QUEUE = 500;\n\nfunction enqueue(str) {\n if (queue.length >= MAX_QUEUE) queue.shift();\n queue.push(str);\n}\n\nfunction drain() {\n while (queue.length > 0) {\n if (!ws || ws.readyState !== 1) break;\n try { ws.send(queue.shift()); } catch (e) { break; }\n }\n}\n\nfunction connect() {\n if (ws && (ws.readyState === 0 || ws.readyState === 1)) return;\n try { ws = new WebSocket(wsUrl); } catch (e) { scheduleReconnect(); return; }\n var tid = setTimeout(function() { if (ws && ws.readyState === 0) ws.close(); }, CONNECTION_TIMEOUT);\n ws.onopen = function() {\n clearTimeout(tid);\n reconnectDelay = 1000;\n drain();\n postMessage({ type: "open" });\n };\n ws.onclose = function() {\n clearTimeout(tid);\n ws = null;\n postMessage({ type: "close" });\n scheduleReconnect();\n };\n ws.onerror = function() {};\n ws.onmessage = function(e) {\n postMessage({ type: "message", data: e.data });\n };\n}\n\nfunction scheduleReconnect() {\n if (reconnectTimer) return;\n reconnectTimer = setTimeout(function() {\n reconnectTimer = null;\n reconnectDelay = Math.min(reconnectDelay * 1.5, MAX_RECONNECT_DELAY);\n connect();\n }, reconnectDelay);\n}\n\nself.onmessage = function(e) {\n var msg = e.data;\n if (msg.type === "init") {\n wsUrl = msg.wsUrl;\n connect();\n } else if (msg.type === "send") {\n try {\n var s = JSON.stringify(msg.payload);\n if (ws && ws.readyState === 1) { ws.send(s); }\n else { enqueue(s); }\n } catch (e) {}\n } else if (msg.type === "sendRaw") {\n if (ws && ws.readyState === 1) {\n try { ws.send(msg.payload); } catch (e) { enqueue(msg.payload); }\n } else { enqueue(msg.payload); }\n } else if (msg.type === "close") {\n if (reconnectTimer) { clearTimeout(reconnectTimer); reconnectTimer = null; }\n if (ws) { ws.close(); ws = null; }\n }\n};\n'], { type: "application/javascript" }), t3 = URL.createObjectURL(e2), n3 = new Worker(t3);
|
|
@@ -400,18 +400,18 @@ function initializeWebSocket(t2, n2, i2, o2, s2 = false) {
|
|
|
400
400
|
} catch {
|
|
401
401
|
return null;
|
|
402
402
|
}
|
|
403
|
-
})() : null,
|
|
404
|
-
const e2 =
|
|
405
|
-
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(),
|
|
403
|
+
})() : null, v) {
|
|
404
|
+
const e2 = v, t3 = { readyState: WebSocket.CONNECTING, close: () => {
|
|
405
|
+
t3.readyState = WebSocket.CLOSED, e2.postMessage({ type: "close" }), e2.terminate(), v = null, null != T && (clearInterval(T), T = null);
|
|
406
406
|
} };
|
|
407
|
-
return k = t3,
|
|
407
|
+
return k = t3, v.onmessage = (e3) => {
|
|
408
408
|
const n3 = e3.data;
|
|
409
409
|
"open" === n3.type ? (t3.readyState = WebSocket.OPEN, handleWsOpen()) : "close" === n3.type ? (t3.readyState = WebSocket.CLOSED, handleWsClose()) : "message" === n3.type && handleWsMessage(n3.data);
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
},
|
|
410
|
+
}, v.onerror = () => {
|
|
411
|
+
w && console.warn("[Sailfish] WebSocket worker error");
|
|
412
|
+
}, v.postMessage({ type: "init", wsUrl: a2 }), w && console.log("[Sailfish] WebSocket running in Web Worker (off main thread)"), t3;
|
|
413
413
|
}
|
|
414
|
-
|
|
414
|
+
w && console.log("[Sailfish] WebSocket running on main thread (Worker unavailable)");
|
|
415
415
|
const l2 = new e(a2, [], { connectionTimeout: 3e4 }), c2 = { get readyState() {
|
|
416
416
|
return l2.readyState;
|
|
417
417
|
}, close: () => {
|
|
@@ -423,50 +423,53 @@ function sendMessage(e2) {
|
|
|
423
423
|
"sessionId" in e2 || (e2.sessionId = getOrSetSessionId()), e2.app_url || (e2.app_url = getCachedHref()), x || !isWebSocketOpen(k) ? saveNotifyMessageToIDB(JSON.stringify(e2)) : wsSendPayload(e2) || saveNotifyMessageToIDB(JSON.stringify(e2));
|
|
424
424
|
}
|
|
425
425
|
function enableFunctionSpanTracking() {
|
|
426
|
-
if (
|
|
427
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType:
|
|
428
|
-
} else
|
|
426
|
+
if (w && console.log("[Sailfish] enableFunctionSpanTracking() called - Report Issue recording started (LOCAL MODE)"), A = true, P = true, D = null, null !== R && (window.clearTimeout(R), R = null), isWebSocketOpen(k)) {
|
|
427
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: true, configurationType: S });
|
|
428
|
+
} else w && console.warn("[Sailfish] WebSocket not open, cannot report LOCAL tracking session");
|
|
429
429
|
}
|
|
430
430
|
function disableFunctionSpanTracking() {
|
|
431
|
-
if (
|
|
432
|
-
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType:
|
|
431
|
+
if (w && console.log("[Sailfish] disableFunctionSpanTracking() called - Report Issue recording stopped"), isWebSocketOpen(k)) {
|
|
432
|
+
wsSendPayload({ type: "funcSpanTrackingSessionReport", sessionId: getOrSetSessionId(), enabled: false, configurationType: S });
|
|
433
433
|
} else console.warn("[FUNCSPAN STOP] ✗ WebSocket not open, cannot notify tracking end");
|
|
434
|
-
|
|
434
|
+
P && (A = false, P = false, D = null, w && console.log("[Sailfish] LOCAL tracking mode disabled")), null !== R && (window.clearTimeout(R), R = null);
|
|
435
435
|
}
|
|
436
436
|
function isFunctionSpanTrackingEnabled() {
|
|
437
437
|
return A;
|
|
438
438
|
}
|
|
439
439
|
function initializeFunctionSpanTrackingFromApi(e2) {
|
|
440
|
-
e2 && !A ? (A = true,
|
|
440
|
+
e2 && !A ? (A = true, P = false, D = null, w && console.log("[Sailfish] Function span tracking initialized as ENABLED from API check")) : !e2 && A && (A = false, P = false, D = null, w && console.log("[Sailfish] Function span tracking initialized as DISABLED from API check"));
|
|
441
441
|
}
|
|
442
442
|
function getFuncSpanHeader() {
|
|
443
443
|
if (!A) return null;
|
|
444
444
|
if (null !== D) {
|
|
445
|
-
if (Date.now() >= D) return A = false, D = null, clearGlobalFuncSpanState(),
|
|
445
|
+
if (Date.now() >= D) return A = false, D = null, clearGlobalFuncSpanState(), w && console.log("[Sailfish] Function span tracking expired on header check - disabling now"), null;
|
|
446
446
|
}
|
|
447
447
|
return { name: "X-Sf3-FunctionSpanCaptureOverride", value: "1-1-10-10-1-1.0-1-0-0" };
|
|
448
448
|
}
|
|
449
449
|
const j = Object.freeze(Object.defineProperty({ __proto__: null, clearStaleFuncSpanState, disableFunctionSpanTracking, enableFunctionSpanTracking, ensureHrefCache, flushBufferedEvents, getCachedHref, getCachedHrefNoQuery, getFuncSpanHeader, initializeFunctionSpanTrackingFromApi, initializeWebSocket, isFunctionSpanTrackingEnabled, onNavigationChange, restoreFuncSpanState, sendEvent, sendMessage }, Symbol.toStringTag, { value: "Module" }));
|
|
450
|
-
let O = null,
|
|
451
|
-
|
|
452
|
-
|
|
450
|
+
let O = null, U = null;
|
|
451
|
+
function getIdentifiedUser() {
|
|
452
|
+
return O;
|
|
453
|
+
}
|
|
454
|
+
let z = null;
|
|
455
|
+
const N = ["https://api.ipify.org?format=json", "https://api.ip.sb/jsonip", "https://api4.my-ip.io/ip.json"];
|
|
453
456
|
function fetchAndSendIp(e2) {
|
|
454
|
-
|
|
455
|
-
for (const e3 of
|
|
457
|
+
z !== e2 && (z = e2, (async () => {
|
|
458
|
+
for (const e3 of N) try {
|
|
456
459
|
const t2 = new AbortController(), n2 = setTimeout(() => t2.abort(), 5e3), i2 = await fetch(e3, { signal: t2.signal });
|
|
457
460
|
if (clearTimeout(n2), !i2.ok) continue;
|
|
458
461
|
const o2 = await i2.json(), s2 = o2.ip || o2.origin || null;
|
|
459
462
|
if (s2 && "string" == typeof s2 && s2.length <= 45) return void sendMessage({ type: "visitorIp", ip: s2, timestamp: exports.nowTimestamp() });
|
|
460
463
|
} catch {
|
|
461
464
|
}
|
|
462
|
-
|
|
465
|
+
z = null;
|
|
463
466
|
})().catch(() => {
|
|
464
|
-
|
|
467
|
+
z = null;
|
|
465
468
|
}));
|
|
466
469
|
}
|
|
467
|
-
let
|
|
470
|
+
let H = null;
|
|
468
471
|
async function getSourceMapModule() {
|
|
469
|
-
return
|
|
472
|
+
return H || (H = await import("source-map-js")), H;
|
|
470
473
|
}
|
|
471
474
|
const q = /* @__PURE__ */ new Map(), W = /(?:\(|\s|^)(https?:\/\/[^)\s]+|\/[^)\s]+|[^)\s]+)?\/?([^/]+\.js)(?:\?[^:)]*)?:(\d+):(\d+)/;
|
|
472
475
|
async function getConsumerFor(e2, t2) {
|
|
@@ -668,6 +671,20 @@ function initializeDomContentEvents(e2) {
|
|
|
668
671
|
sendEvent({ type: 24, data: { source: r }, timestamp: Date.now(), sessionId: e2, ...getUrlAndStoredUuids() });
|
|
669
672
|
});
|
|
670
673
|
}
|
|
674
|
+
async function initializePerformancePlugin(e2) {
|
|
675
|
+
var _a;
|
|
676
|
+
try {
|
|
677
|
+
const { getRecordPerformancePlugin: t2 } = await Promise.resolve().then(() => require("./rrweb-plugin-performance-record-Dekf6xUi.js"));
|
|
678
|
+
await yieldToMain();
|
|
679
|
+
const n2 = t2({ getPageVisitUuid: () => sessionStorage.getItem("pageVisitUUID") });
|
|
680
|
+
(_a = n2.observer) == null ? void 0 : _a.call(n2, (t3) => {
|
|
681
|
+
const i2 = t3;
|
|
682
|
+
sendEvent({ type: 28, timestamp: i2.timestamp, sessionId: e2, data: { plugin: n2.name, payload: i2 }, ...getUrlAndStoredUuids() });
|
|
683
|
+
}, window, n2.options);
|
|
684
|
+
} catch (e3) {
|
|
685
|
+
console.warn("[Sailfish] Performance plugin failed to initialize:", e3);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
671
688
|
async function initializeConsolePlugin(e2, n2) {
|
|
672
689
|
const { getRecordConsolePlugin: i2 } = await import("@sailfish-rrweb/rrweb-plugin-console-record");
|
|
673
690
|
await yieldToMain();
|
|
@@ -711,12 +728,12 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
711
728
|
}
|
|
712
729
|
const { record: n4 } = await import("@sailfish-rrweb/rrweb-record-only");
|
|
713
730
|
if (Q = n4, await yieldToMain(), l2) {
|
|
714
|
-
const { chunkedSnapshot: i3 } = await Promise.resolve().then(() => require("./chunkSerializer-
|
|
731
|
+
const { chunkedSnapshot: i3 } = await Promise.resolve().then(() => require("./chunkSerializer-jzbHv2wf.js")), o3 = n4.mirror;
|
|
715
732
|
let s3 = true;
|
|
716
733
|
const r3 = [];
|
|
717
734
|
n4({ emit(e3) {
|
|
718
735
|
s3 ? r3.push(e3) : emitWithContext(e3);
|
|
719
|
-
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass: J,
|
|
736
|
+
}, maskInputOptions: { text: true }, maskInputFn, ...e2, maskTextClass: e2.maskTextClass ?? J, recordDOM: false });
|
|
720
737
|
const a3 = Date.now(), l3 = await i3(document, o3, { chunkSize: 500, maxChunkMs: 16, blockClass: e2.blockClass, blockSelector: e2.blockSelector, maskTextClass: e2.maskTextClass ?? J, maskTextSelector: e2.maskTextSelector });
|
|
721
738
|
if (l3) {
|
|
722
739
|
emitWithContext({ type: t.EventType.Meta, data: { href: window.location.href, width: document.documentElement.clientWidth || document.body.clientWidth, height: document.documentElement.clientHeight || document.body.clientHeight }, timestamp: a3 }), emitWithContext({ type: t.EventType.FullSnapshot, data: { node: l3, initialOffset: { left: void 0 !== window.pageXOffset ? window.pageXOffset : document.documentElement.scrollLeft, top: void 0 !== window.pageYOffset ? window.pageYOffset : document.documentElement.scrollTop } }, timestamp: a3 });
|
|
@@ -725,7 +742,7 @@ async function initializeRecording(e2, n2, i2, o2, s2, r2 = true, a2 = false, l2
|
|
|
725
742
|
} else console.warn("[Sailfish] chunkSnapshot serialization failed; session continues without initial DOM snapshot"), s3 = false;
|
|
726
743
|
} else n4({ emit(e3) {
|
|
727
744
|
emitWithContext(e3);
|
|
728
|
-
}, maskInputOptions: { text: true }, maskInputFn, maskTextClass: J
|
|
745
|
+
}, maskInputOptions: { text: true }, maskInputFn, ...e2, maskTextClass: e2.maskTextClass ?? J });
|
|
729
746
|
};
|
|
730
747
|
if (r2) {
|
|
731
748
|
let e3 = false;
|
|
@@ -940,12 +957,26 @@ function updateIssueTypeOptions(e2, t2) {
|
|
|
940
957
|
}
|
|
941
958
|
function getFieldsForProject(e2, t2) {
|
|
942
959
|
if (!(re == null ? void 0 : re.fieldConfigurations) || !e2) return [];
|
|
943
|
-
const n2 = Array.isArray(re.fieldConfigurations) ? re.fieldConfigurations.find((n3) => n3.project_key
|
|
960
|
+
const n2 = Array.isArray(re.fieldConfigurations) ? re.fieldConfigurations.find((n3) => !(n3.project_key !== e2 && String(n3.project_id) !== String(e2) || t2 && String(n3.issue_type_id) !== String(t2))) : re.fieldConfigurations[e2];
|
|
944
961
|
return n2 && n2.fields ? n2.fields : [];
|
|
945
962
|
}
|
|
946
963
|
function getUsers() {
|
|
947
964
|
return (re == null ? void 0 : re.users) ? re.users : [];
|
|
948
965
|
}
|
|
966
|
+
function getDefaultReporterAccountId() {
|
|
967
|
+
const e2 = getUsers(), t2 = getIdentifiedUser();
|
|
968
|
+
if (!e2.length || !t2) return null;
|
|
969
|
+
const n2 = t2.traits || {}, i2 = (n2.email || t2.userId || "").toLowerCase().trim(), o2 = (n2.name || n2.displayName || n2.fullName || n2.full_name || (n2.firstName || n2.first_name ? `${n2.firstName || n2.first_name} ${n2.lastName || n2.last_name || ""}`.trim() : "") || "").toLowerCase().trim(), findUnique = (t3) => {
|
|
970
|
+
const n3 = e2.filter(t3);
|
|
971
|
+
return 1 === n3.length ? n3[0] : null;
|
|
972
|
+
};
|
|
973
|
+
let s2 = i2 ? findUnique((e3) => (e3.email || e3.emailAddress || "").toLowerCase().trim() === i2) : null;
|
|
974
|
+
if (!s2 && o2 && (s2 = findUnique((e3) => (e3.name || e3.displayName || "").toLowerCase().trim() === o2)), !s2 && i2) {
|
|
975
|
+
const e3 = i2.split("@")[0];
|
|
976
|
+
e3.length >= 3 && (s2 = findUnique((t3) => (t3.name || t3.displayName || "").toLowerCase().trim().includes(e3)));
|
|
977
|
+
}
|
|
978
|
+
return s2 && (s2.id || s2.accountId) || null;
|
|
979
|
+
}
|
|
949
980
|
function getProjectsForTeam(e2) {
|
|
950
981
|
if (!re) return [];
|
|
951
982
|
const t2 = re.teams && Array.isArray(re.teams) && re.teams.length > 0;
|
|
@@ -978,7 +1009,7 @@ const le = Object.freeze(Object.defineProperty({ __proto__: null, fetchIntegrati
|
|
|
978
1009
|
} catch (e3) {
|
|
979
1010
|
console.error("Error fetching integration data:", e3), re = null;
|
|
980
1011
|
}
|
|
981
|
-
}, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })), ce = "sf-create-issue-preference", de = "sf-create-eng-ticket-preference";
|
|
1012
|
+
}, getDefaultReporterAccountId, getFieldsForProject, getIntegrationData, getProjectsForTeam, getSprintFieldId, getUsers, hasValidIntegration, populatePriorityOptions, populateSelectOptions, populateSprintOptions, refreshIntegrationData, updateFormWithIntegrationData, updateIssueTypeOptions }, Symbol.toStringTag, { value: "Module" })), ce = "sf-create-issue-preference", de = "sf-create-eng-ticket-preference";
|
|
982
1013
|
function getInitialState() {
|
|
983
1014
|
const e2 = (function loadUserPreferences() {
|
|
984
1015
|
return { createIssue: f && "true" === localStorage.getItem(ce), createEngTicket: f && "true" === localStorage.getItem(de) };
|
|
@@ -1027,7 +1058,7 @@ function renderCustomMultiSelect(e2, t2, n2, i2, o2 = false) {
|
|
|
1027
1058
|
}
|
|
1028
1059
|
const he = { enabled: false, openModalExistingMode: { key: "e", requireCmdCtrl: false }, openModalCaptureNewMode: { key: "n", requireCmdCtrl: false }, closeModal: { key: "escape", requireCmdCtrl: false }, submitReport: { key: "enter", requireCmdCtrl: true }, startRecording: { key: "r", requireCmdCtrl: false }, stopRecording: { key: "escape", requireCmdCtrl: true } }, ye = { shortcuts: { ...he }, resolveSessionId: null, apiKey: null, backendApi: null, triageBaseUrl: "https://app.sailfishqa.com", deactivateIsolation: () => {
|
|
1029
1060
|
}, integrationData: null, showEngTicketFieldsDefault: false };
|
|
1030
|
-
let be = null,
|
|
1061
|
+
let be = null, we = false;
|
|
1031
1062
|
function setupCustomMultiSelectListeners(e2, t2) {
|
|
1032
1063
|
const n2 = document.getElementById(`${e2}-container`), i2 = document.getElementById(`${e2}-dropdown`);
|
|
1033
1064
|
if (!n2 || !i2) return;
|
|
@@ -1276,7 +1307,7 @@ function getSessionIdSafely() {
|
|
|
1276
1307
|
return ye.resolveSessionId();
|
|
1277
1308
|
}
|
|
1278
1309
|
function openReportIssueModal(e2) {
|
|
1279
|
-
me ? stopRecording() : (
|
|
1310
|
+
me ? stopRecording() : (we = (e2 == null ? void 0 : e2.showEngTicketFields) ?? ye.showEngTicketFieldsDefault, injectModalHTML(), be && document.body.appendChild(be));
|
|
1280
1311
|
}
|
|
1281
1312
|
function closeModal() {
|
|
1282
1313
|
ye.deactivateIsolation(), document.activeElement instanceof HTMLElement && document.activeElement.blur(), (be == null ? void 0 : be.parentNode) && be.parentNode.removeChild(be), be = null, me || (function resetState() {
|
|
@@ -1468,7 +1499,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1468
1499
|
Create an Issue
|
|
1469
1500
|
</label>
|
|
1470
1501
|
|
|
1471
|
-
<label id="sf-create-eng-ticket-label" style="display:${ye.integrationData &&
|
|
1502
|
+
<label id="sf-create-eng-ticket-label" style="display:${ye.integrationData && we ? "flex" : "none"}; align-items:center; gap:8px; font-size:14px; font-weight:500; cursor:pointer;">
|
|
1472
1503
|
<input type="checkbox" id="sf-create-eng-ticket-checkbox" ${ue.createEngTicket ? "checked" : ""}
|
|
1473
1504
|
style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;">
|
|
1474
1505
|
Create an Eng Ticket
|
|
@@ -1568,8 +1599,11 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1568
1599
|
if (!hasValidIntegration()) return l2.checked = false, ue.createEngTicket = false, localStorage.setItem(de, "false"), c2 && (c2.style.display = "none"), void alert("No engineering ticket integration found. Please install and configure an integration (Jira, Linear, or Zendesk) first.");
|
|
1569
1600
|
const e5 = getIntegrationData();
|
|
1570
1601
|
if (e5) {
|
|
1571
|
-
if (!ue.engTicketTeam && e5.defaultTeam && (ue.engTicketTeam = e5.defaultTeam), !ue.engTicketProject && e5.defaultProject && (ue.engTicketProject = e5.defaultProject), !ue.engTicketPriority && e5.defaultPriority && (ue.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(ue), "jira" === ((_a = e5.provider) == null ? void 0 : _a.toLowerCase()) &&
|
|
1572
|
-
getFieldsForProject(ue.engTicketProject, ue.engTicketIssueType).find((e6) => "reporter" === e6.fieldId)
|
|
1602
|
+
if (!ue.engTicketTeam && e5.defaultTeam && (ue.engTicketTeam = e5.defaultTeam), !ue.engTicketProject && e5.defaultProject && (ue.engTicketProject = e5.defaultProject), !ue.engTicketPriority && e5.defaultPriority && (ue.engTicketPriority = e5.defaultPriority), updateFormWithIntegrationData(ue), "jira" === ((_a = e5.provider) == null ? void 0 : _a.toLowerCase()) && ue.engTicketProject && !ue.engTicketCustomFields.reporter) {
|
|
1603
|
+
if (getFieldsForProject(ue.engTicketProject, ue.engTicketIssueType).find((e6) => "reporter" === e6.fieldId)) {
|
|
1604
|
+
const t5 = getDefaultReporterAccountId();
|
|
1605
|
+
ue.engTicketCustomFields.reporter = t5 || e5.jiraReporterAccountId || "";
|
|
1606
|
+
}
|
|
1573
1607
|
}
|
|
1574
1608
|
const t4 = document.getElementById("sf-eng-ticket-project"), n3 = document.getElementById("sf-eng-ticket-type");
|
|
1575
1609
|
t4 && t4.value && renderDynamicFields(t4.value, n3 == null ? void 0 : n3.value);
|
|
@@ -1693,7 +1727,7 @@ function injectModalHTML(e2 = "lookback") {
|
|
|
1693
1727
|
const e4 = generateEngTicketFieldsHTML();
|
|
1694
1728
|
e4 && (t3.innerHTML = e4, initializeEngTicketForm(), bindEngTicketListeners(), updateFormWithIntegrationData(ue), renderDynamicFields(ue.engTicketProject, ue.engTicketIssueType));
|
|
1695
1729
|
}
|
|
1696
|
-
if (
|
|
1730
|
+
if (we) {
|
|
1697
1731
|
const e4 = document.getElementById("sf-create-eng-ticket-label");
|
|
1698
1732
|
e4 && (e4.style.display = "flex");
|
|
1699
1733
|
}
|
|
@@ -1703,8 +1737,11 @@ function initializeEngTicketForm() {
|
|
|
1703
1737
|
var _a;
|
|
1704
1738
|
const e2 = ye.integrationData;
|
|
1705
1739
|
if (e2) {
|
|
1706
|
-
if (!ue.engTicketTeam && e2.defaultTeam && (ue.engTicketTeam = e2.defaultTeam), !ue.engTicketProject && e2.defaultProject && (ue.engTicketProject = e2.defaultProject), !ue.engTicketPriority && e2.defaultPriority && (ue.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(ue), "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase()) &&
|
|
1707
|
-
getFieldsForProject(ue.engTicketProject, ue.engTicketIssueType).find((e3) => "reporter" === e3.fieldId)
|
|
1740
|
+
if (!ue.engTicketTeam && e2.defaultTeam && (ue.engTicketTeam = e2.defaultTeam), !ue.engTicketProject && e2.defaultProject && (ue.engTicketProject = e2.defaultProject), !ue.engTicketPriority && e2.defaultPriority && (ue.engTicketPriority = e2.defaultPriority), updateFormWithIntegrationData(ue), "jira" === ((_a = e2.provider) == null ? void 0 : _a.toLowerCase()) && ue.engTicketProject && !ue.engTicketCustomFields.reporter) {
|
|
1741
|
+
if (getFieldsForProject(ue.engTicketProject, ue.engTicketIssueType).find((e3) => "reporter" === e3.fieldId)) {
|
|
1742
|
+
const t2 = getDefaultReporterAccountId();
|
|
1743
|
+
ue.engTicketCustomFields.reporter = t2 || e2.jiraReporterAccountId || "";
|
|
1744
|
+
}
|
|
1708
1745
|
}
|
|
1709
1746
|
ue.engTicketProject && renderDynamicFields(ue.engTicketProject, ue.engTicketIssueType);
|
|
1710
1747
|
}
|
|
@@ -1742,8 +1779,11 @@ function bindEngTicketListeners() {
|
|
|
1742
1779
|
var _a;
|
|
1743
1780
|
ue.engTicketProject = t2.value, t2.style.color = t2.value ? "" : "#9ca3af", ue.engTicketCustomFields = {};
|
|
1744
1781
|
const e3 = getIntegrationData();
|
|
1745
|
-
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), ue.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) &&
|
|
1746
|
-
getFieldsForProject(t2.value, ue.engTicketIssueType).find((e4) => "reporter" === e4.fieldId)
|
|
1782
|
+
if (e3 && o2 && (updateIssueTypeOptions(o2, t2.value), ue.engTicketIssueType = o2.value), e3 && "jira" === ((_a = e3.provider) == null ? void 0 : _a.toLowerCase()) && t2.value) {
|
|
1783
|
+
if (getFieldsForProject(t2.value, ue.engTicketIssueType).find((e4) => "reporter" === e4.fieldId)) {
|
|
1784
|
+
const t3 = getDefaultReporterAccountId();
|
|
1785
|
+
ue.engTicketCustomFields.reporter = t3 || e3.jiraReporterAccountId || "";
|
|
1786
|
+
}
|
|
1747
1787
|
}
|
|
1748
1788
|
renderDynamicFields(t2.value, ue.engTicketIssueType);
|
|
1749
1789
|
}), s2 && s2.addEventListener("change", () => {
|
|
@@ -1884,7 +1924,7 @@ function showStatusModal(e2, t2, n2) {
|
|
|
1884
1924
|
function fadeCardAndRemove(e2, t2, n2 = 300) {
|
|
1885
1925
|
t2.style.opacity = "0", t2.addEventListener("transitionend", () => e2.remove(), { once: true }), setTimeout(() => e2.remove(), n2 + 100);
|
|
1886
1926
|
}
|
|
1887
|
-
const
|
|
1927
|
+
const Se = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueContext: ye, openReportIssueModal, setupIssueReporting: function setupIssueReporting(e2) {
|
|
1888
1928
|
ye.apiKey = e2.apiKey, ye.backendApi = e2.backendApi, ye.resolveSessionId = e2.getSessionId, ye.integrationData = e2.integrationData || null, ye.showEngTicketFieldsDefault = e2.showEngTicketFieldsInReportIssueModalDefault ?? false, e2.customBaseUrl && (ye.triageBaseUrl = e2.customBaseUrl), ye.shortcuts = (function mergeShortcutsConfig(e3) {
|
|
1889
1929
|
const t3 = { ...he };
|
|
1890
1930
|
if (!e3) return t3;
|
|
@@ -1917,7 +1957,7 @@ const ve = Object.freeze(Object.defineProperty({ __proto__: null, ReportIssueCon
|
|
|
1917
1957
|
return void (t3 && (e3.preventDefault(), t3.click()));
|
|
1918
1958
|
}
|
|
1919
1959
|
});
|
|
1920
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
1960
|
+
} }, Symbol.toStringTag, { value: "Module" })), ve = readDebugFlag(), ke = /* @__PURE__ */ new Map();
|
|
1921
1961
|
function getCachedRegex(e2, t2) {
|
|
1922
1962
|
const n2 = `${e2}|${t2}`;
|
|
1923
1963
|
let i2 = ke.get(n2);
|
|
@@ -1974,7 +2014,7 @@ function handleVisibilityChange() {
|
|
|
1974
2014
|
const e2 = document.visibilityState, t2 = Date.now();
|
|
1975
2015
|
"visible" === e2 && getOrSetSessionId();
|
|
1976
2016
|
try {
|
|
1977
|
-
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }),
|
|
2017
|
+
sendMessage({ type: "visibilityChange", data: { state: e2, url: window.location.href.split("?")[0], timestamp: t2, ...getUrlAndStoredUuids() } }), ve && console.log(`[Sailfish] Tab became ${e2}, sent visibility change event`);
|
|
1978
2018
|
} catch (e3) {
|
|
1979
2019
|
console.warn("[Sailfish] Failed to send visibility change event:", e3);
|
|
1980
2020
|
}
|
|
@@ -1995,35 +2035,25 @@ function _ensureModuleSideEffects() {
|
|
|
1995
2035
|
clearPageVisitDataFromSessionStorage();
|
|
1996
2036
|
}));
|
|
1997
2037
|
}
|
|
1998
|
-
function
|
|
1999
|
-
|
|
2000
|
-
if ("string" == typeof e2 ? n2 = e2 : "undefined" != typeof URL && e2 instanceof URL ? n2 = e2.href : "undefined" != typeof Request && e2 instanceof Request ? n2 = e2.url : null != e2 && "function" == typeof e2.toString && (n2 = e2.toString()), !n2) return false;
|
|
2001
|
-
try {
|
|
2002
|
-
const e3 = "undefined" != typeof window ? window.location.href : "http://localhost/";
|
|
2003
|
-
i2 = new URL(n2, e3);
|
|
2004
|
-
} catch {
|
|
2005
|
-
return false;
|
|
2006
|
-
}
|
|
2007
|
-
const { hostname: o2, pathname: s2, port: r2, protocol: a2 } = i2;
|
|
2008
|
-
if (!/^https?:$/.test(a2)) return false;
|
|
2009
|
-
const l2 = o2.startsWith("www.") ? o2.slice(4).toLowerCase() : o2.toLowerCase();
|
|
2038
|
+
function matchParsedUrlAgainstPatterns(e2, t2) {
|
|
2039
|
+
const { hostname: n2, pathname: i2, port: o2 } = e2, s2 = n2.startsWith("www.") ? n2.slice(4).toLowerCase() : n2.toLowerCase();
|
|
2010
2040
|
return t2.some((e3) => {
|
|
2011
2041
|
const t3 = String(e3 || "").replace(/^[a-zA-Z]+:\/\//, "");
|
|
2012
|
-
let [n3,
|
|
2013
|
-
n3.includes(":") && ([n3,
|
|
2014
|
-
const
|
|
2015
|
-
if (
|
|
2042
|
+
let [n3, r2] = t3.split("/", 2), a2 = "";
|
|
2043
|
+
n3.includes(":") && ([n3, a2] = n3.split(":"));
|
|
2044
|
+
const l2 = getCachedRegex(`^${n3.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`, "i"), c2 = s2.startsWith("www.") ? s2.slice(4) : s2;
|
|
2045
|
+
if (a2 && "*" !== a2 && o2 !== a2) return false;
|
|
2016
2046
|
if (n3.startsWith("*.")) {
|
|
2017
2047
|
const e4 = n3.slice(2).toLowerCase();
|
|
2018
|
-
if (!(
|
|
2019
|
-
if (
|
|
2020
|
-
return getCachedRegex(`^/${
|
|
2048
|
+
if (!(s2 === e4 || c2 === e4 || s2.endsWith("." + e4))) return false;
|
|
2049
|
+
if (r2) {
|
|
2050
|
+
return getCachedRegex(`^/${r2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2021
2051
|
}
|
|
2022
2052
|
return true;
|
|
2023
2053
|
}
|
|
2024
|
-
if (!
|
|
2025
|
-
if (
|
|
2026
|
-
return getCachedRegex(`^/${
|
|
2054
|
+
if (!l2.test(c2) && !l2.test(s2)) return false;
|
|
2055
|
+
if (r2) {
|
|
2056
|
+
return getCachedRegex(`^/${r2.replace(/\*/g, ".*").replace(/\/$/, "")}`, "i").test(i2);
|
|
2027
2057
|
}
|
|
2028
2058
|
return true;
|
|
2029
2059
|
});
|
|
@@ -2038,7 +2068,7 @@ function createSkipHeadersPropagationChecker(e2 = [], t2 = []) {
|
|
|
2038
2068
|
return true;
|
|
2039
2069
|
}
|
|
2040
2070
|
const s2 = o2.pathname.toLowerCase(), r2 = s2.lastIndexOf(".");
|
|
2041
|
-
return !(-1 === r2 || !xe.has(s2.slice(r2))) || (!(!i2 ||
|
|
2071
|
+
return !(-1 === r2 || !xe.has(s2.slice(r2))) || (!(!i2 || matchParsedUrlAgainstPatterns(o2, t2)) || !!matchParsedUrlAgainstPatterns(o2, n2));
|
|
2042
2072
|
};
|
|
2043
2073
|
}
|
|
2044
2074
|
function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i2 = []) {
|
|
@@ -2073,29 +2103,29 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2073
2103
|
h2[e5] = t3;
|
|
2074
2104
|
}) : h2 = { ...r3.headers }), m2 = r3.body;
|
|
2075
2105
|
} catch (e5) {
|
|
2076
|
-
|
|
2106
|
+
ve && console.warn("[Sailfish] Failed to capture request data:", e5);
|
|
2077
2107
|
}
|
|
2078
2108
|
delete h2[n];
|
|
2079
2109
|
const b2 = getFuncSpanHeader();
|
|
2080
2110
|
b2 && delete h2[b2.name];
|
|
2081
|
-
const
|
|
2082
|
-
h2[n] =
|
|
2111
|
+
const w2 = `${c3}/${p2.page_visit_uuid}/${u3}`;
|
|
2112
|
+
h2[n] = w2, b2 && (h2[b2.name] = b2.value);
|
|
2083
2113
|
maskAuthorizationHeader(h2);
|
|
2084
2114
|
try {
|
|
2085
2115
|
let b3 = await (async function injectHeader(e5, t3, i5, o5, s4, r4, a3) {
|
|
2086
2116
|
const l3 = getFuncSpanHeader();
|
|
2087
2117
|
if (i5 instanceof Request) {
|
|
2088
2118
|
const c4 = i5.clone(), d4 = new Headers(c4.headers);
|
|
2089
|
-
d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value),
|
|
2119
|
+
d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), ve && console.log("[Sailfish] Added funcspan header to HTTP Request:", { url: i5.url, header: l3.name }));
|
|
2090
2120
|
const u4 = new Request(c4, { headers: d4 });
|
|
2091
2121
|
return await e5.call(t3, u4, o5);
|
|
2092
2122
|
}
|
|
2093
2123
|
{
|
|
2094
2124
|
const c4 = { ...o5 }, d4 = new Headers(o5.headers || {});
|
|
2095
|
-
return d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value),
|
|
2125
|
+
return d4.set(n, `${s4}/${r4}/${a3}`), l3 && (d4.set(l3.name, l3.value), ve && console.log("[Sailfish] Added funcspan header to HTTP fetch:", { url: "string" == typeof i5 ? i5 : i5.href, header: l3.name })), c4.headers = d4, await e5.call(t3, i5, c4);
|
|
2096
2126
|
}
|
|
2097
|
-
})(e4, i4, s3, r3, c3, p2.page_visit_uuid, u3),
|
|
2098
|
-
Te.includes(b3.status) && (
|
|
2127
|
+
})(e4, i4, s3, r3, c3, p2.page_visit_uuid, u3), w3 = false;
|
|
2128
|
+
Te.includes(b3.status) && (ve && console.log("Perform retry as status was fail:", b3), delete h2[n], b3 = await (async function retryWithoutPropagateHeaders(e5, t3, i5, o5) {
|
|
2099
2129
|
try {
|
|
2100
2130
|
let o6 = i5[0], s4 = i5[1] || {};
|
|
2101
2131
|
if ("string" == typeof o6 || o6 instanceof URL) {
|
|
@@ -2111,19 +2141,19 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2111
2141
|
}
|
|
2112
2142
|
return e5.apply(t3, i5);
|
|
2113
2143
|
} catch (e6) {
|
|
2114
|
-
throw
|
|
2144
|
+
throw ve && console.log(`Retry without ${n} for ${o5} also failed:`, e6), e6;
|
|
2115
2145
|
}
|
|
2116
|
-
})(e4, i4, o4, d3),
|
|
2117
|
-
const
|
|
2146
|
+
})(e4, i4, o4, d3), w3 = true);
|
|
2147
|
+
const S2 = Date.now(), v2 = b3.status, k2 = b3.ok, x2 = k2 ? "" : `Request Error: ${b3.statusText}`;
|
|
2118
2148
|
let I2 = null;
|
|
2119
2149
|
try {
|
|
2120
2150
|
I2 = {}, b3.headers.forEach((e5, t3) => {
|
|
2121
2151
|
I2[t3] = e5;
|
|
2122
2152
|
});
|
|
2123
2153
|
} catch (e5) {
|
|
2124
|
-
|
|
2154
|
+
ve && console.warn("[Sailfish] Failed to capture response headers:", e5), I2 = null;
|
|
2125
2155
|
}
|
|
2126
|
-
const T2 = { type: 27, timestamp:
|
|
2156
|
+
const T2 = { type: 27, timestamp: S2, sessionId: c3, data: { request_id: u3, session_id: c3, timestamp_start: g2, timestamp_end: S2, response_code: v2, success: k2, error: x2, method: f2, url: d3, retry_without_trace_id: w3, request_headers: h2, request_body: m2, response_headers: I2, response_body: null }, ...p2 }, sendEventWithBody = (e5) => {
|
|
2127
2157
|
T2.data.response_body = e5, y2 ? y2.text().then((e6) => {
|
|
2128
2158
|
T2.data.request_body = e6, sendEvent(T2);
|
|
2129
2159
|
}, () => {
|
|
@@ -2211,9 +2241,9 @@ function setupFetchInterceptor(e2 = [], t2 = { captureStreamingResponseBody: tru
|
|
|
2211
2241
|
})(e3, i3, o3, d2, u2, s2, c2);
|
|
2212
2242
|
} });
|
|
2213
2243
|
}
|
|
2214
|
-
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = [], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: r2, gitSha: a2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker: S2 = true,
|
|
2244
|
+
async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-service.sailfishqa.com", domainsToPropagateHeaderTo: i2 = ["*"], domainsToNotPropagateHeaderTo: o2 = [], serviceVersion: s2, serviceIdentifier: r2, gitSha: a2, serviceAdditionalMetadata: l2, enableIpTracking: c2, captureStreamingResponseBody: d2 = true, captureResponseBodyMaxMb: u2 = 10, captureStreamPrefixKb: p2 = 64, captureStreamTimeoutMs: f2 = 1e4, enableFiberTracking: m2 = false, deferRecording: h2, deferRecordingStart: y2, chunkSnapshot: b2, useWsWorker: w2 = true, capturePerformanceMetrics: S2 = true, maskTextClass: v2, library: k2, headlessRecording: x2 = false }) {
|
|
2215
2245
|
var _a, _b;
|
|
2216
|
-
if ((function isHeadlessOrLighthouse() {
|
|
2246
|
+
if (!x2 && (function isHeadlessOrLighthouse() {
|
|
2217
2247
|
try {
|
|
2218
2248
|
if ("undefined" == typeof navigator) return false;
|
|
2219
2249
|
const e3 = navigator;
|
|
@@ -2224,10 +2254,10 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2224
2254
|
return false;
|
|
2225
2255
|
}
|
|
2226
2256
|
})()) return;
|
|
2227
|
-
const
|
|
2228
|
-
if (
|
|
2229
|
-
const
|
|
2230
|
-
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()),
|
|
2257
|
+
const I2 = h2 ?? y2 ?? true, T2 = getOrSetSessionId(), E2 = window.__sailfish_recorder || (window.__sailfish_recorder = {});
|
|
2258
|
+
if (E2.sessionId = T2, E2.apiKey = e2, E2.backendApi = t2, E2.serviceAdditionalMetadata = l2, E2.initialized && E2.sessionId === T2 && E2.ws && 1 === E2.ws.readyState) return void trackDomainChangesOnce();
|
|
2259
|
+
const C2 = { captureStreamingResponseBody: d2, captureResponseBodyMaxMb: u2, captureStreamPrefixKb: p2, captureStreamTimeoutMs: f2 };
|
|
2260
|
+
sessionStorage.getItem("pageVisitUUID") || (sessionStorage.setItem("pageVisitUUID", uuidv4()), invalidateUrlCache()), E2.xhrPatched || (!(function setupXMLHttpRequestInterceptor(e3 = [], t3 = { captureStreamingResponseBody: true, captureResponseBodyMaxMb: 10, captureStreamPrefixKb: 64, captureStreamTimeoutMs: 1e4 }, i3 = []) {
|
|
2231
2261
|
const o3 = XMLHttpRequest.prototype.open, s3 = XMLHttpRequest.prototype.send, r3 = XMLHttpRequest.prototype.setRequestHeader, a3 = getOrSetSessionId(), l3 = createSkipHeadersPropagationChecker(e3, i3);
|
|
2232
2262
|
XMLHttpRequest.prototype.setRequestHeader = function(e4, t4) {
|
|
2233
2263
|
return this._capturedRequestHeaders || (this._capturedRequestHeaders = {}), this._capturedRequestHeaders[e4] = t4, r3.call(this, e4, t4);
|
|
@@ -2245,9 +2275,9 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2245
2275
|
}
|
|
2246
2276
|
const d3 = getFuncSpanHeader();
|
|
2247
2277
|
if (d3) try {
|
|
2248
|
-
this.setRequestHeader(d3.name, d3.value),
|
|
2278
|
+
this.setRequestHeader(d3.name, d3.value), ve && console.log("[Sailfish] Added funcspan header to XMLHttpRequest:", { url: i4, header: d3.name });
|
|
2249
2279
|
} catch (e5) {
|
|
2250
|
-
|
|
2280
|
+
ve && console.warn(`[Sailfish] Could not set funcspan header for ${i4}`, e5);
|
|
2251
2281
|
}
|
|
2252
2282
|
const u3 = Date.now();
|
|
2253
2283
|
let p3 = false;
|
|
@@ -2280,7 +2310,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2280
2310
|
2 === t4.length && (i5[t4[0]] = t4[1]);
|
|
2281
2311
|
});
|
|
2282
2312
|
} catch (e6) {
|
|
2283
|
-
|
|
2313
|
+
ve && console.warn("[Sailfish] Failed to capture XHR response headers:", e6), i5 = null;
|
|
2284
2314
|
}
|
|
2285
2315
|
if (e5 >= 200 && e5 < 300) emitFinished(true, e5, "", n2, i5);
|
|
2286
2316
|
else {
|
|
@@ -2292,22 +2322,22 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2292
2322
|
emitFinished(false, e5, t4);
|
|
2293
2323
|
}, { once: true }), s3.apply(this, e4);
|
|
2294
2324
|
};
|
|
2295
|
-
})(o2,
|
|
2325
|
+
})(o2, C2, i2), E2.xhrPatched = true), E2.fetchPatched || (setupFetchInterceptor(o2, C2, i2), E2.fetchPatched = true), await yieldToMain(), E2.domEventsInit || (initializeDomContentEvents(T2), E2.domEventsInit = true), await yieldToMain(), E2.consoleInit || (initializeConsolePlugin(Le, T2), E2.consoleInit = true), await yieldToMain(), E2.errorInit || (!(function initializeErrorInterceptor() {
|
|
2296
2326
|
window.addEventListener("error", (e3) => {
|
|
2297
2327
|
captureError(e3.error || e3.message);
|
|
2298
2328
|
}), window.addEventListener("unhandledrejection", (e3) => {
|
|
2299
2329
|
captureError(e3.reason, true);
|
|
2300
2330
|
});
|
|
2301
|
-
})(),
|
|
2331
|
+
})(), E2.errorInit = true), await yieldToMain(), !E2.perfInit && S2 && (initializePerformancePlugin(T2), E2.perfInit = true), await yieldToMain(), _ensureModuleSideEffects(), (function storeCredentialsAndConnection({ apiKey: e3, backendApi: t3 }) {
|
|
2302
2332
|
g && (sessionStorage.setItem("sailfishApiKey", e3), sessionStorage.setItem("sailfishBackendApi", t3));
|
|
2303
|
-
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() ||
|
|
2333
|
+
})({ apiKey: e2, backendApi: t2 }), !isFunctionSpanTrackingEnabled() || E2.ws && 1 === E2.ws.readyState || fetchFunctionSpanTrackingEnabled(e2, t2).then((e3) => {
|
|
2304
2334
|
var _a2;
|
|
2305
|
-
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ?
|
|
2335
|
+
((_a2 = e3.data) == null ? void 0 : _a2.isFunctionSpanTrackingEnabledFromApiKey) ?? false ? ve && console.log("[Sailfish] Function span tracking state validated with backend: ACTIVE") : (clearStaleFuncSpanState(), ve && console.log("[Sailfish] Cleared stale function span tracking state - backend validation shows tracking is not active"));
|
|
2306
2336
|
}).catch((e3) => {
|
|
2307
|
-
|
|
2308
|
-
}),
|
|
2337
|
+
ve && console.warn("[Sailfish] Failed to validate function span tracking status with backend:", e3);
|
|
2338
|
+
}), E2.sentDoNotPropagateOnce || (sendDomainsToNotPropagateHeaderTo(e2, [...o2, ...Ie], t2).catch((e3) => console.error("Failed to send domains to not propagate header to:", e3)), E2.sentDoNotPropagateOnce = true), (async function gatherAndCacheDeviceInfo() {
|
|
2309
2339
|
sendMessage({ type: "deviceInfo", data: { deviceInfo: { language: navigator.language, userAgent: navigator.userAgent } } });
|
|
2310
|
-
})(), c2 && fetchAndSendIp(
|
|
2340
|
+
})(), c2 && fetchAndSendIp(T2);
|
|
2311
2341
|
try {
|
|
2312
2342
|
const n2 = a2 ?? (function readGitSha() {
|
|
2313
2343
|
var _a2;
|
|
@@ -2326,7 +2356,7 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2326
2356
|
if ("string" == typeof e3 && e3) return e3;
|
|
2327
2357
|
} catch {
|
|
2328
2358
|
}
|
|
2329
|
-
})(), i3 = r2 ?? "", o3 = s2 ?? "", c3 =
|
|
2359
|
+
})(), i3 = r2 ?? "", o3 = s2 ?? "", c3 = k2 ?? "JS/TS", d3 = (function getMapUuidFromWindow() {
|
|
2330
2360
|
try {
|
|
2331
2361
|
const e3 = window;
|
|
2332
2362
|
if (e3 && "string" == typeof e3.sfMapUuid && e3.sfMapUuid) return e3.sfMapUuid;
|
|
@@ -2346,15 +2376,15 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2346
2376
|
return { framework: i4[0] ?? null, additionalFrameworks: i4.slice(1), serviceRole: "frontend" };
|
|
2347
2377
|
})(), f3 = { ...u3, serviceRole: p3.serviceRole, ...null !== p3.framework && { framework: p3.framework }, ...p3.additionalFrameworks.length > 0 && { additionalFrameworks: p3.additionalFrameworks } };
|
|
2348
2378
|
await yieldToMain();
|
|
2349
|
-
const [g2, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2,
|
|
2350
|
-
if (
|
|
2379
|
+
const [g2, h3] = await Promise.all([fetchCaptureSettings(e2, t2), startRecordingSession(e2, T2, t2, i3, o3, d3, n2, c3, f3)]), y3 = { ...Fe, ...(_a = g2.data) == null ? void 0 : _a.captureSettingsFromApiKey, enableFiberTracking: m2, ...void 0 !== v2 ? { maskTextClass: v2 } : {} };
|
|
2380
|
+
if (E2.ws && 1 === E2.ws.readyState) return;
|
|
2351
2381
|
if ((_b = h3.data) == null ? void 0 : _b.startRecordingSession) {
|
|
2352
2382
|
const n3 = (l2 == null ? void 0 : l2.env) || (l2 == null ? void 0 : l2.environment);
|
|
2353
2383
|
await yieldToMain();
|
|
2354
|
-
const i4 = await initializeRecording(y3, t2, e2,
|
|
2355
|
-
|
|
2384
|
+
const i4 = await initializeRecording(y3, t2, e2, T2, n3, I2, w2, b2 ?? false);
|
|
2385
|
+
E2.ws = i4, E2.initialized = true, trackDomainChangesOnce(), E2.sentMapUuidOnce || (!(function sendMapUuidIfAvailable(e3 = "", t3 = "") {
|
|
2356
2386
|
window.sfMapUuid && sendMessage({ type: "mapUuid", data: { mapUuid: window.sfMapUuid, serviceIdentifier: e3, serviceVersion: t3 } });
|
|
2357
|
-
})(r2, s2),
|
|
2387
|
+
})(r2, s2), E2.sentMapUuidOnce = true);
|
|
2358
2388
|
} else console.error("Failed to start recording session:", h3.errors || h3);
|
|
2359
2389
|
} catch (e3) {
|
|
2360
2390
|
console.error("Error starting recording:", e3);
|
|
@@ -2362,8 +2392,8 @@ async function startRecording({ apiKey: e2, backendApi: t2 = "https://api-servic
|
|
|
2362
2392
|
}
|
|
2363
2393
|
exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTINGS = Le, exports.STORAGE_VERSION = 1, exports.addOrUpdateMetadata = function addOrUpdateMetadata(e2) {
|
|
2364
2394
|
const t2 = { type: "addOrUpdateMetadata", metadata: e2 };
|
|
2365
|
-
|
|
2366
|
-
}, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, exports.createSkipHeadersPropagationChecker = createSkipHeadersPropagationChecker, exports.createTriageAndIssueFromRecorder = createTriageAndIssueFromRecorder, exports.createTriageFromRecorder = createTriageFromRecorder, exports.disableFunctionSpanTracking = disableFunctionSpanTracking, exports.enableFunctionSpanTracking = enableFunctionSpanTracking, exports.ensureHrefCache = ensureHrefCache, exports.eventSize = eventSize, exports.fetchAndSendIp = fetchAndSendIp, exports.fetchCaptureSettings = fetchCaptureSettings, exports.fetchEngineeringTicketPlatformIntegrations = fetchEngineeringTicketPlatformIntegrations, exports.fetchFunctionSpanTrackingEnabled = fetchFunctionSpanTrackingEnabled, exports.flushBufferedEvents = flushBufferedEvents, exports.getCachedHref = getCachedHref, exports.getCachedHrefNoQuery = getCachedHrefNoQuery, exports.getFuncSpanHeader = getFuncSpanHeader, exports.getOrSetSessionId = getOrSetSessionId, exports.getUrlAndStoredUuids = getUrlAndStoredUuids, exports.identify = function identify(e2, t2 = {}, n2 = false) {
|
|
2395
|
+
U && JSON.stringify(U) === JSON.stringify(e2) || (U = e2, sendMessage(t2));
|
|
2396
|
+
}, exports.buildBatches = buildBatches, exports.clearStaleFuncSpanState = clearStaleFuncSpanState, exports.createSkipHeadersPropagationChecker = createSkipHeadersPropagationChecker, exports.createTriageAndIssueFromRecorder = createTriageAndIssueFromRecorder, exports.createTriageFromRecorder = createTriageFromRecorder, exports.disableFunctionSpanTracking = disableFunctionSpanTracking, exports.enableFunctionSpanTracking = enableFunctionSpanTracking, exports.ensureHrefCache = ensureHrefCache, exports.eventSize = eventSize, exports.fetchAndSendIp = fetchAndSendIp, exports.fetchCaptureSettings = fetchCaptureSettings, exports.fetchEngineeringTicketPlatformIntegrations = fetchEngineeringTicketPlatformIntegrations, exports.fetchFunctionSpanTrackingEnabled = fetchFunctionSpanTrackingEnabled, exports.flushBufferedEvents = flushBufferedEvents, exports.getCachedHref = getCachedHref, exports.getCachedHrefNoQuery = getCachedHrefNoQuery, exports.getFuncSpanHeader = getFuncSpanHeader, exports.getIdentifiedUser = getIdentifiedUser, exports.getOrSetSessionId = getOrSetSessionId, exports.getUrlAndStoredUuids = getUrlAndStoredUuids, exports.identify = function identify(e2, t2 = {}, n2 = false) {
|
|
2367
2397
|
const i2 = { type: "identify", userId: e2, traits: t2 };
|
|
2368
2398
|
O && O.userId === e2 && JSON.stringify(O.traits) === JSON.stringify(t2) || (O = { userId: e2, traits: t2, overwrite: n2 }, sendMessage(i2));
|
|
2369
2399
|
}, exports.initRecorder = async (e2) => {
|
|
@@ -2372,7 +2402,7 @@ exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2372
2402
|
return clearPageVisitDataFromSessionStorage(), t2.initialized && t2.sessionId === n2 && t2.ws && 1 === t2.ws.readyState ? void 0 : (t2.initPromise || (t2.initPromise = (async () => {
|
|
2373
2403
|
try {
|
|
2374
2404
|
if (t2.hasLoggedInitOnce || (console.log("Initializing Sailfish Recorder (first run) …"), t2.hasLoggedInitOnce = true), await startRecording(e2), !t2.issueReportingInit) {
|
|
2375
|
-
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() =>
|
|
2405
|
+
const n3 = e2.backendApi ?? "https://api-service.sailfishqa.com", [{ setupIssueReporting: i2 }, { fetchIntegrationData: o2, getIntegrationData: s2 }] = await Promise.all([Promise.resolve().then(() => Se), Promise.resolve().then(() => le)]);
|
|
2376
2406
|
let r2 = null;
|
|
2377
2407
|
try {
|
|
2378
2408
|
await o2(e2.apiKey, n3), r2 = s2();
|
|
@@ -2387,6 +2417,16 @@ exports.DEFAULT_CAPTURE_SETTINGS = Fe, exports.DEFAULT_CONSOLE_RECORDING_SETTING
|
|
|
2387
2417
|
})().finally(() => {
|
|
2388
2418
|
delete t2.initPromise;
|
|
2389
2419
|
})), t2.initPromise);
|
|
2390
|
-
}, exports.initializeConsolePlugin = initializeConsolePlugin, exports.initializeDomContentEvents = initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = initializeFunctionSpanTrackingFromApi, exports.initializeRecording = initializeRecording, exports.initializeWebSocket = initializeWebSocket, exports.invalidateUrlCache = invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = isFunctionSpanTrackingEnabled, exports.matchUrlWithWildcard =
|
|
2420
|
+
}, exports.initializeConsolePlugin = initializeConsolePlugin, exports.initializeDomContentEvents = initializeDomContentEvents, exports.initializeFunctionSpanTrackingFromApi = initializeFunctionSpanTrackingFromApi, exports.initializePerformancePlugin = initializePerformancePlugin, exports.initializeRecording = initializeRecording, exports.initializeWebSocket = initializeWebSocket, exports.invalidateUrlCache = invalidateUrlCache, exports.isFunctionSpanTrackingEnabled = isFunctionSpanTrackingEnabled, exports.matchUrlWithWildcard = function matchUrlWithWildcard(e2, t2) {
|
|
2421
|
+
let n2, i2;
|
|
2422
|
+
if ("string" == typeof e2 ? n2 = e2 : "undefined" != typeof URL && e2 instanceof URL ? n2 = e2.href : "undefined" != typeof Request && e2 instanceof Request ? n2 = e2.url : null != e2 && "function" == typeof e2.toString && (n2 = e2.toString()), !n2) return false;
|
|
2423
|
+
try {
|
|
2424
|
+
const e3 = "undefined" != typeof window ? window.location.href : "http://localhost/";
|
|
2425
|
+
i2 = new URL(n2, e3);
|
|
2426
|
+
} catch {
|
|
2427
|
+
return false;
|
|
2428
|
+
}
|
|
2429
|
+
return matchParsedUrlAgainstPatterns(i2, t2);
|
|
2430
|
+
}, exports.onNavigationChange = onNavigationChange, exports.openReportIssueModal = openReportIssueModal, exports.restoreFuncSpanState = restoreFuncSpanState, exports.sendDomainsToNotPropagateHeaderTo = sendDomainsToNotPropagateHeaderTo, exports.sendEvent = sendEvent, exports.sendGraphQLRequest = sendGraphQLRequest, exports.sendMessage = sendMessage, exports.startRecording = startRecording, exports.startRecordingSession = startRecordingSession, exports.trackingEvent = function trackingEvent(e2) {
|
|
2391
2431
|
sendMessage({ type: "trackingEvent", trackingData: e2, timestamp: exports.nowTimestamp() });
|
|
2392
2432
|
}, exports.withAppUrlMetadata = withAppUrlMetadata, exports.yieldToMain = yieldToMain;
|