@sprig-technologies/sprig-browser 2.36.1 → 2.37.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/{core-BVtQnihE.js → core-5yxtCXox.js} +251 -250
- package/dist/{core-Bzv2KQOu.cjs → core-vSY7cMHx.cjs} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +8 -0
- package/dist/core.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +2 -2
- package/dist/{metricsReporter-M_tu1Yrx.js → metricsReporter-B4HDmJo8.js} +1 -1
- package/dist/{metricsReporter-DbEyJSwA.cjs → metricsReporter-C6eDfwgS.cjs} +1 -1
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +64 -62
- package/dist/view-B_tKmqLg.cjs +669 -0
- package/dist/{view-DJdeN4-t.js → view-CGdqoFSw.js} +1218 -1204
- package/package.json +1 -1
- package/dist/view-qqhfcMHd.cjs +0 -669
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var It = Object.defineProperty;
|
|
2
|
-
var kt = (
|
|
3
|
-
var W = (
|
|
4
|
-
import { l as x, g as P, s as et, e as y, S as w, v as tt, m as S, b as q, h as rt, E as re, D as M, c as Et, r as $, i as _t, j as Rt, k as xt, n as He, o as Ve, d as Dt, a as At, p as it, q as nt } from "./metricsReporter-
|
|
2
|
+
var kt = (t, r, n) => r in t ? It(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n;
|
|
3
|
+
var W = (t, r, n) => kt(t, typeof r != "symbol" ? r + "" : r, n);
|
|
4
|
+
import { l as x, g as P, s as et, e as y, S as w, v as tt, m as S, b as q, h as rt, E as re, D as M, c as Et, r as $, i as _t, j as Rt, k as xt, n as He, o as Ve, d as Dt, a as At, p as it, q as nt } from "./metricsReporter-B4HDmJo8.js";
|
|
5
5
|
const nr = 360, or = "ul-app", sr = "#e6e6e6", ar = "#bd282a", dr = 1030, We = () => {
|
|
6
6
|
try {
|
|
7
7
|
return window.parent.Intercom;
|
|
@@ -9,26 +9,26 @@ const nr = 360, or = "ul-app", sr = "#e6e6e6", ar = "#bd282a", dr = 1030, We = (
|
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
11
|
}, Be = [Object.freeze(Object.defineProperty({ __proto__: null, disable: () => {
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const t = We();
|
|
13
|
+
t && (t.ul_wasVisible = !!document.querySelector("iframe.intercom-launcher-frame"), t.ul_wasVisible && t("update", { hide_default_launcher: !0 }));
|
|
14
14
|
}, enable: () => {
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const t = We();
|
|
16
|
+
t && (t.ul_wasVisible && t("update", { hide_default_launcher: !1 }), delete t.ul_wasVisible);
|
|
17
17
|
} }, Symbol.toStringTag, { value: "Module" }))];
|
|
18
18
|
class Ot {
|
|
19
19
|
static disable() {
|
|
20
|
-
Be.forEach((
|
|
20
|
+
Be.forEach((r) => r.disable());
|
|
21
21
|
}
|
|
22
22
|
static enable() {
|
|
23
|
-
Be.forEach((
|
|
23
|
+
Be.forEach((r) => r.enable());
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
const Ne = "ul-view-sdk-script", Ct = ["ios", "android"], F = "visitors", z = "environments";
|
|
27
|
-
async function O(
|
|
26
|
+
const Ne = "ul-view-sdk-script", Ct = /* @__PURE__ */ new Set(["ios", "android"]), F = "visitors", z = "environments";
|
|
27
|
+
async function O(t, r) {
|
|
28
28
|
var i, o, a;
|
|
29
|
-
const { shouldDropOnRateLimit: n, ...s } =
|
|
29
|
+
const { shouldDropOnRateLimit: n, ...s } = r;
|
|
30
30
|
s.headers = Object.assign(P(window.UserLeap), s.headers);
|
|
31
|
-
const e = await et(
|
|
31
|
+
const e = await et(t, { ...s, shouldDropOnRateLimit: n });
|
|
32
32
|
if (e.ok) {
|
|
33
33
|
const l = (i = e.headers) == null ? void 0 : i.get("Authorization"), p = l ? l.split(" ") : void 0, d = p && p.length === 2 ? p[1] : void 0, c = (o = e.headers) == null ? void 0 : o.get("x-ul-visitor-id");
|
|
34
34
|
if (window.UserLeap.userId && c === window.UserLeap.visitorId) {
|
|
@@ -39,23 +39,23 @@ async function O(r, t) {
|
|
|
39
39
|
}
|
|
40
40
|
return (a = e.json) != null && a.logMessage && console.warn(`[Sprig] ${e.json.logMessage}`), e;
|
|
41
41
|
}
|
|
42
|
-
function R(
|
|
42
|
+
function R(t, r) {
|
|
43
43
|
const n = x.getItemObject("userleap.ids");
|
|
44
44
|
let s = n[window.UserLeap.envId];
|
|
45
|
-
s ? s[
|
|
45
|
+
s ? s[t] = r : s = { [t]: r }, n[window.UserLeap.envId] = s, x.setItemObject("userleap.ids", n);
|
|
46
46
|
}
|
|
47
47
|
function xe() {
|
|
48
48
|
return window.previewMode ? "0" : window.UserLeap.visitorId ?? "";
|
|
49
49
|
}
|
|
50
|
-
function A(
|
|
51
|
-
const s = [window.UserLeap._API_URL, "sdk",
|
|
52
|
-
return
|
|
50
|
+
function A(t, r, n) {
|
|
51
|
+
const s = [window.UserLeap._API_URL, "sdk", t];
|
|
52
|
+
return r && r.forEach((e) => {
|
|
53
53
|
s.push(e), e === z ? s.push(window.UserLeap.envId) : e === F && s.push(xe());
|
|
54
54
|
}), n && s.push(n), s.join("/");
|
|
55
55
|
}
|
|
56
|
-
const X = async (
|
|
56
|
+
const X = async (t, r, n) => {
|
|
57
57
|
var Me, qe, Fe;
|
|
58
|
-
const { context: s, delay: e, forceBrandedLogo: i, endCard: o, isFeedback: a = !1, heatmap: l, locale: p, previewMode: d, productConfig: c, questions: g, responseGroupUid: m, surveyId: u, uuid: E, vid: f, sessionReplay: v, studyType: L } =
|
|
58
|
+
const { context: s, delay: e, forceBrandedLogo: i, endCard: o, isFeedback: a = !1, heatmap: l, locale: p, previewMode: d, productConfig: c, questions: g, responseGroupUid: m, surveyId: u, uuid: E, vid: f, sessionReplay: v, studyType: L } = t, b = P(window.UserLeap), _ = ie(b), T = ge(b);
|
|
59
59
|
if (v) if (_) y.emit(w.ReplayCapture, { responseGroupUid: m, hasQuestions: !!(g != null && g.length), surveyId: u, uploadId: v.uploadId, replayType: v.replayDurationType ?? "before", seconds: v.replayDurationSeconds, generateVideoUploadUrlPayload: { mediaRecordingUid: tt(), mediaType: "screen", questionId: 1, responseGroupUid: m, surveyId: u, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), visitorId: window.UserLeap.visitorId, isReplay: !0 } });
|
|
60
60
|
else {
|
|
61
61
|
if (!S.replay) return window.UserLeap.reportError("displayQuestions", new Error("Replay module not registered")), { success: !1, message: "Replay module not registered", surveyState: "no survey" };
|
|
@@ -91,7 +91,7 @@ const X = async (r, t, n) => {
|
|
|
91
91
|
})() && (ot(u, a), V.id = U, window.UserLeap.container.appendChild(V), at(), y.emit(w.SurveyLifeCycle, { state: "presented" }), y.emit(w.SurveyPresented, { name: w.SurveyPresented, "survey.id": u }))) : { frameId: U, contentWinDocHead: D, contentWindow: k, hasOverlay: H, iframe: V } = Tt({ productConfig: c, useMobileStyling: T, surveyId: u, isFeedback: a }), window.UserLeap.frameId = U;
|
|
92
92
|
const G = { apiURL: window.UserLeap._API_URL, cards: g, configureExitOnOverlayClick: (I) => {
|
|
93
93
|
y.once(w.CloseSurveyOnOverlayClick, I);
|
|
94
|
-
}, context: s, endCard: o, envId: window.UserLeap.envId, eventEmitFn: y.emit.bind(y), fontFamily: window.UserLeap.fontFamily, fontFamilyURL: window.UserLeap.fontFamilyURL, forceBrandedLogo: i, frame: V, headers: b, locale: p, mobileSDKVersion: window.UserLeap.mobileSDKVersion, previewKey: x.getItem("sprig.previewKey"), previewMode: d, productConfig: { framePosition: c == null ? void 0 : c.framePosition, desktopDisplay: c == null ? void 0 : c.desktopDisplay, placement: c == null ? void 0 : c.placement }, responseGroupUid: m, startingQuestionIdx: (qe = window.UserLeap.config) == null ? void 0 : qe.startingQuestionIdx, studyType: L, styleNonce: window.UserLeap.styleNonce, surveyId: u, tabTitle: document.title, trackPageViewUrl:
|
|
94
|
+
}, context: s, endCard: o, envId: window.UserLeap.envId, eventEmitFn: y.emit.bind(y), fontFamily: window.UserLeap.fontFamily, fontFamilyURL: window.UserLeap.fontFamilyURL, forceBrandedLogo: i, frame: V, headers: b, locale: p, mobileSDKVersion: window.UserLeap.mobileSDKVersion, previewKey: x.getItem("sprig.previewKey"), previewMode: d, productConfig: { framePosition: c == null ? void 0 : c.framePosition, desktopDisplay: c == null ? void 0 : c.desktopDisplay, placement: c == null ? void 0 : c.placement }, responseGroupUid: m, startingQuestionIdx: (qe = window.UserLeap.config) == null ? void 0 : qe.startingQuestionIdx, studyType: L, styleNonce: window.UserLeap.styleNonce, surveyId: u, tabTitle: document.title, trackPageViewUrl: r, ulEvents: re, upchunkLibraryURL: window.UserLeap.upchunkLibraryURL, useMobileStyling: T, userId: E, viewDocument: k == null ? void 0 : k.document, viewWindow: k, visitorAttributes: { externalUserId: window.UserLeap.userId, email: window.UserLeap.email }, ...window.UserLeap._config };
|
|
95
95
|
(Fe = window.UserLeap._config) != null && Fe.startingQuestionIdx && (window.UserLeap._config = { ...window.UserLeap._config, startingQuestionIdx: null });
|
|
96
96
|
const St = (a ? window.UserLeap.feedbackCustomStyles : window.UserLeap.customStyles) ?? c.customStyles;
|
|
97
97
|
G.customStyles = St, k && (k.__cfg = G);
|
|
@@ -104,7 +104,7 @@ const X = async (r, t, n) => {
|
|
|
104
104
|
window.UserLeap.container && Object.assign(window.UserLeap.container.style, { display: "flex" });
|
|
105
105
|
};
|
|
106
106
|
if (G.installationMethod === "web-npm" || G.installationMethod === "web-npm-bundled") {
|
|
107
|
-
const { default: I } = await import("./view-
|
|
107
|
+
const { default: I } = await import("./view-CGdqoFSw.js");
|
|
108
108
|
I.configure(G), H && window.UserLeap.container && Te();
|
|
109
109
|
} else ye && (me.src = ye, H && me.addEventListener("load", () => {
|
|
110
110
|
window.UserLeap.container && Te();
|
|
@@ -115,37 +115,37 @@ const X = async (r, t, n) => {
|
|
|
115
115
|
const je = { success: !0, surveyState: "ready", surveyId: u, responseGroupUid: m };
|
|
116
116
|
return window.UserLeap.isMobileSDK && e && (je.delay = e), je;
|
|
117
117
|
};
|
|
118
|
-
function ge(
|
|
118
|
+
function ge(t) {
|
|
119
119
|
var n;
|
|
120
120
|
if (window.UserLeap.useMobileStyling !== void 0) return window.UserLeap.useMobileStyling;
|
|
121
|
-
const
|
|
122
|
-
return ie(
|
|
121
|
+
const r = ((n = window.UserLeap.windowDimensions) == null ? void 0 : n.width) ?? document.body.clientWidth;
|
|
122
|
+
return ie(t) || r > 10 && r < 500;
|
|
123
123
|
}
|
|
124
|
-
function ie(
|
|
125
|
-
return Ct.
|
|
124
|
+
function ie(t) {
|
|
125
|
+
return Ct.has(t["userleap-platform"]);
|
|
126
126
|
}
|
|
127
|
-
const De = "ul-frame";
|
|
127
|
+
const lr = (t) => t["userleap-platform"] === "ios", De = "ul-frame";
|
|
128
128
|
window.UserLeap && window.Sprig && (window.Sprig._gtm ? window.Sprig = window.UserLeap : window.UserLeap = window.Sprig), window.UserLeap || (window.UserLeap = window.Sprig), window.Sprig || (window.Sprig = window.UserLeap);
|
|
129
|
-
const he = "0px", ot = (
|
|
130
|
-
window.UserLeap.container = document.createElement("div"), window.UserLeap.container.className = "ul-container" + (
|
|
129
|
+
const he = "0px", ot = (t, r, n) => {
|
|
130
|
+
window.UserLeap.container = document.createElement("div"), window.UserLeap.container.className = "ul-container" + (r ? " ul-container-feedback" : ""), t && (window.UserLeap.container.dataset.studyId = t.toString());
|
|
131
131
|
const s = lt();
|
|
132
132
|
n && s && !window.UserLeap.useMobileStyling ? s.appendChild(window.UserLeap.container) : document.body.appendChild(window.UserLeap.container);
|
|
133
|
-
}, st = (
|
|
133
|
+
}, st = (t, r) => {
|
|
134
134
|
var s;
|
|
135
135
|
Mt();
|
|
136
136
|
const n = window.UserLeap.container;
|
|
137
137
|
if (n) try {
|
|
138
|
-
(s = n.parentNode) == null || s.removeChild(n), window.UserLeap.container = null, R("trackStartUrl", null), y.emit(w.SurveyLifeCycle, { state: "dismissed" }), y.emit(w.SurveyClosed, { name: w.SurveyClosed, initiator:
|
|
138
|
+
(s = n.parentNode) == null || s.removeChild(n), window.UserLeap.container = null, R("trackStartUrl", null), y.emit(w.SurveyLifeCycle, { state: "dismissed" }), y.emit(w.SurveyClosed, { name: w.SurveyClosed, initiator: t, "survey.id": parseInt(n.dataset.studyId), ...r && { studyType: r } });
|
|
139
139
|
} catch (e) {
|
|
140
|
-
console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${
|
|
140
|
+
console.warn(`[Sprig] (ERR-412) Error removing UserLeap container by ${t} ` + n), e instanceof Error && window.UserLeap.reportError("dismissActiveSurvey", e);
|
|
141
141
|
}
|
|
142
142
|
}, at = () => {
|
|
143
|
-
y.once(w.SurveyWillClose, ({ initiator:
|
|
144
|
-
y.removeAllListeners(w.CloseSurveyOnOverlayClick), st(
|
|
143
|
+
y.once(w.SurveyWillClose, ({ initiator: t, studyType: r }) => {
|
|
144
|
+
y.removeAllListeners(w.CloseSurveyOnOverlayClick), st(t, r);
|
|
145
145
|
});
|
|
146
|
-
}, Pt = (
|
|
146
|
+
}, Pt = (t, r, n, s) => {
|
|
147
147
|
var d, c;
|
|
148
|
-
const e = { position: "fixed", bottom: "0px", right: he, border: 0, backgroundColor: "rgba(0,0,0,0)", zIndex: 2147483646, transition: "height 0.2s ease-in-out", maxWidth: "100%" }, i = Object.assign({},
|
|
148
|
+
const e = { position: "fixed", bottom: "0px", right: he, border: 0, backgroundColor: "rgba(0,0,0,0)", zIndex: 2147483646, transition: "height 0.2s ease-in-out", maxWidth: "100%" }, i = Object.assign({}, r, window.UserLeap), { desktopDisplay: o } = r || {}, a = o === "center-modal";
|
|
149
149
|
let l;
|
|
150
150
|
a && (i.framePosition = "center");
|
|
151
151
|
let p = !1;
|
|
@@ -173,14 +173,14 @@ const he = "0px", ot = (r, t, n) => {
|
|
|
173
173
|
return p && ((g, m) => {
|
|
174
174
|
const u = { position: "fixed", overflow: "auto", top: "0px", left: "0px", display: "none", height: "100%", width: "100%", transition: "background-color 0.3s ease-out", zIndex: 2147483646 }, E = m ? g.overlayStyleMobile : g.overlayStyle;
|
|
175
175
|
u["background-color"] = E === "light" ? "rgba(255,255,255, 0.95)" : "rgba(0,0,0,0.9)", m || (u.margin = "auto"), window.UserLeap.container && Object.assign(window.UserLeap.container.style, u);
|
|
176
|
-
})(i, n), Object.assign(
|
|
177
|
-
}, Tt = ({ productConfig:
|
|
176
|
+
})(i, n), Object.assign(t.style, e, l), p;
|
|
177
|
+
}, Tt = ({ productConfig: t, useMobileStyling: r, surveyId: n, isFeedback: s }) => {
|
|
178
178
|
var g, m;
|
|
179
|
-
const e = De, i = s &&
|
|
179
|
+
const e = De, i = s && t.desktopDisplay === "slider";
|
|
180
180
|
ot(n, s, i), jt();
|
|
181
181
|
const o = document.createElement("iframe");
|
|
182
182
|
o.id = e, o.setAttribute("title", "Sprig User Feedback Dialog");
|
|
183
|
-
const a = Pt(o,
|
|
183
|
+
const a = Pt(o, t, r, s);
|
|
184
184
|
at();
|
|
185
185
|
let l = !1;
|
|
186
186
|
o.setHeight = (u) => {
|
|
@@ -189,11 +189,11 @@ const he = "0px", ot = (r, t, n) => {
|
|
|
189
189
|
let p = !1;
|
|
190
190
|
o.setWidth = (u) => {
|
|
191
191
|
parseInt(o.style.width) == u && p || (p = !0, o.style.width = `${u}px`, y.emit(w.SurveyWidth, { name: w.SurveyWidth, contentFrameWidth: u, "survey.id": n }));
|
|
192
|
-
}, (g = window.UserLeap.container) == null || g.appendChild(o),
|
|
192
|
+
}, (g = window.UserLeap.container) == null || g.appendChild(o), t && (r ? t.exitOnOverlayClickMobile : t.exitOnOverlayClick) && window.UserLeap.container && (window.UserLeap.container.onclick = () => {
|
|
193
193
|
y.emit(w.CloseSurveyOnOverlayClick);
|
|
194
194
|
}), y.emit(w.SurveyLifeCycle, { state: "presented" }), y.emit(w.SurveyPresented, { name: w.SurveyPresented, "survey.id": n });
|
|
195
195
|
const d = (m = o.contentWindow) == null ? void 0 : m.document;
|
|
196
|
-
if (d && (d.open("text/html", "replace"), d.write("<!doctype html><head></head><body></body></html>"), d.close(), !
|
|
196
|
+
if (d && (d.open("text/html", "replace"), d.write("<!doctype html><head></head><body></body></html>"), d.close(), !r)) {
|
|
197
197
|
const u = d.body;
|
|
198
198
|
u.style.display = "flex", u.style.alignItems = "center";
|
|
199
199
|
}
|
|
@@ -202,99 +202,99 @@ const he = "0px", ot = (r, t, n) => {
|
|
|
202
202
|
}, dt = { [w.SurveyFadingOut]: () => {
|
|
203
203
|
window.UserLeap.container && Object.assign(window.UserLeap.container.style, { "background-color": "rgba(0,0,0,0)" });
|
|
204
204
|
} }, jt = () => {
|
|
205
|
-
Object.entries(dt).forEach(([
|
|
206
|
-
y.on(
|
|
205
|
+
Object.entries(dt).forEach(([t, r]) => {
|
|
206
|
+
y.on(t, r);
|
|
207
207
|
});
|
|
208
208
|
}, Mt = () => {
|
|
209
|
-
Object.entries(dt).forEach(([
|
|
210
|
-
y.off(
|
|
209
|
+
Object.entries(dt).forEach(([t, r]) => {
|
|
210
|
+
y.off(t, r);
|
|
211
211
|
});
|
|
212
|
-
}, j = (
|
|
213
|
-
const e =
|
|
212
|
+
}, j = (t) => !!t && t.nodeType === Node.ELEMENT_NODE, $e = (t) => t instanceof HTMLElement || t instanceof SVGElement, se = ({ document: t, elementId: r, styleString: n, nonce: s }) => {
|
|
213
|
+
const e = t.getElementById(r);
|
|
214
214
|
if (e) return void (e.textContent = n);
|
|
215
|
-
const i =
|
|
216
|
-
s && (i.nonce = s), i.textContent = n, i.id =
|
|
217
|
-
}, qt = (
|
|
218
|
-
const n =
|
|
219
|
-
if (!j(n)) return
|
|
215
|
+
const i = t.createElement("style");
|
|
216
|
+
s && (i.nonce = s), i.textContent = n, i.id = r, t.head.appendChild(i);
|
|
217
|
+
}, qt = (t, r) => {
|
|
218
|
+
const n = r.querySelector(".sprig-question-body");
|
|
219
|
+
if (!j(n)) return t;
|
|
220
220
|
const s = n.scrollHeight;
|
|
221
|
-
return s < 100 ?
|
|
222
|
-
}, Ge = (
|
|
223
|
-
const n =
|
|
221
|
+
return s < 100 ? t : t - (s - 100);
|
|
222
|
+
}, Ge = (t, r) => {
|
|
223
|
+
const n = r.querySelector(t);
|
|
224
224
|
if (!j(n)) return 0;
|
|
225
225
|
const s = getComputedStyle(n);
|
|
226
226
|
return parseFloat(s.paddingLeft) + parseFloat(s.paddingRight) + (parseFloat(s.marginLeft) + parseFloat(s.marginRight)) + (parseFloat(s.borderLeftWidth) + parseFloat(s.borderRightWidth));
|
|
227
|
-
}, Ft = (
|
|
228
|
-
const s =
|
|
227
|
+
}, Ft = (t, r, n) => {
|
|
228
|
+
const s = t.querySelector(".ul-card__container"), e = t.querySelector(".ul-app");
|
|
229
229
|
let i = 600, o = 360, a = 0;
|
|
230
230
|
if (j(s) && j(e)) {
|
|
231
|
-
const l = s.querySelector(".ul-card--matrix_grid"), p = !l &&
|
|
231
|
+
const l = s.querySelector(".ul-card--matrix_grid"), p = !l && r && n;
|
|
232
232
|
try {
|
|
233
233
|
p && (e.style.width = "360px"), i = s.clientHeight, i += ((g) => {
|
|
234
234
|
const m = g.querySelector(".sprig-question-body"), u = g.querySelector(".ul-card"), E = g.querySelector(".ul-card-main-content"), f = g.querySelector(".ul-footer"), v = g.querySelector(".sprig-container");
|
|
235
235
|
let L = 0;
|
|
236
236
|
return j(u) && (L += u.scrollHeight - u.clientHeight), j(E) && (L += E.scrollHeight - E.clientHeight), j(m) && (L += m.scrollHeight - m.clientHeight), j(f) && j(v) && v.clientHeight === 0 && (L += f.clientHeight), L;
|
|
237
|
-
})(
|
|
237
|
+
})(t);
|
|
238
238
|
const d = getComputedStyle(s);
|
|
239
239
|
a = i;
|
|
240
240
|
const c = parseFloat(d.marginTop) + parseFloat(d.marginBottom);
|
|
241
|
-
i += c + (parseFloat(d.borderTopWidth) + parseFloat(d.borderBottomWidth)), l && (o = l.scrollWidth, o += Ge(".ul-card__container",
|
|
241
|
+
i += c + (parseFloat(d.borderTopWidth) + parseFloat(d.borderBottomWidth)), l && (o = l.scrollWidth, o += Ge(".ul-card__container", t), o += Ge(".sprig-question-body", t));
|
|
242
242
|
} finally {
|
|
243
243
|
p && e.style.removeProperty("width");
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
return [i + 1, o, qt(a,
|
|
247
|
-
},
|
|
248
|
-
const
|
|
249
|
-
|
|
246
|
+
return [i + 1, o, qt(a, t)];
|
|
247
|
+
}, cr = (t) => {
|
|
248
|
+
const r = t.querySelector(".ul-card__container");
|
|
249
|
+
r && (r.scrollTop = 0);
|
|
250
250
|
}, lt = () => h, K = () => document.getElementById("sprig-feedback-container"), Se = () => document.getElementById("sprig-feedback-loading-animation"), ct = () => !!document.getElementById(De);
|
|
251
251
|
let Ke = !1, h = null, C = null, Ae = !1, Z = null, B = null;
|
|
252
252
|
const zt = ["bottom-left", "bottom-right", "center-left", "center-right"], ae = () => {
|
|
253
|
-
var
|
|
254
|
-
const
|
|
255
|
-
return ((
|
|
253
|
+
var r;
|
|
254
|
+
const t = window.UserLeap.container;
|
|
255
|
+
return ((r = t == null ? void 0 : t.parentElement) == null ? void 0 : r.id) === "sprig-feedback-loading-container";
|
|
256
256
|
}, pt = () => document.getElementById("sprig-feedback-error-container"), ut = () => {
|
|
257
257
|
if (!h) return 0;
|
|
258
|
-
const
|
|
259
|
-
return
|
|
260
|
-
}, de = (
|
|
261
|
-
const
|
|
262
|
-
|
|
258
|
+
const t = h == null ? void 0 : h.clientWidth, r = window.getComputedStyle(h);
|
|
259
|
+
return t + parseInt(r.borderRightWidth || "0") + parseInt(r.borderLeftWidth || "0");
|
|
260
|
+
}, de = (t) => {
|
|
261
|
+
const r = K();
|
|
262
|
+
r && (B != null && B.endsWith("right") ? r.style.right = `${t}px` : B != null && B.endsWith("left") && (r.style.left = `${t}px`));
|
|
263
263
|
}, be = () => {
|
|
264
264
|
if (h && (ae() || pt())) {
|
|
265
265
|
y.off(w.SurveyAppeared, Y), Ie();
|
|
266
|
-
const
|
|
267
|
-
return de(-
|
|
266
|
+
const t = ut();
|
|
267
|
+
return de(-t), !0;
|
|
268
268
|
}
|
|
269
269
|
return !1;
|
|
270
270
|
}, Y = () => {
|
|
271
271
|
if (!h || !C) return;
|
|
272
|
-
const
|
|
273
|
-
|
|
272
|
+
const t = Se();
|
|
273
|
+
t && t.remove(), h.style.height = "auto", h.style.width = "auto", C.disabled = !1, Ae = !1;
|
|
274
274
|
}, Ie = () => {
|
|
275
275
|
if (h && !Se()) {
|
|
276
|
-
const
|
|
276
|
+
const t = (() => {
|
|
277
277
|
if (Se()) return;
|
|
278
|
-
const
|
|
279
|
-
return
|
|
278
|
+
const r = document.createElement("div");
|
|
279
|
+
return r.className = "ul-loading-spinner-container", r.id = "sprig-feedback-loading-animation", r.role = "progressbar", r.setAttribute("aria-live", "polite"), r.setAttribute("aria-busy", "true"), r.setAttribute("aria-label", "Processing..."), r.innerHTML = `
|
|
280
280
|
<div class="ul-loading-spinner">
|
|
281
281
|
<div class="first"></div>
|
|
282
282
|
<div class="second"></div>
|
|
283
283
|
<div class="third"></div>
|
|
284
284
|
<div class="fourth"></div>
|
|
285
285
|
</div>
|
|
286
|
-
`,
|
|
286
|
+
`, r;
|
|
287
287
|
})();
|
|
288
|
-
|
|
288
|
+
t && (h.style.height = "300px", h.style.width = "360px", h.appendChild(t));
|
|
289
289
|
}
|
|
290
290
|
}, Je = () => {
|
|
291
291
|
h && C && (de(0), C.disabled = !0, Ae = !0);
|
|
292
|
-
}, wt = async (
|
|
293
|
-
const { buttonTheme: s, customStyles: e, eventId: i, placement: o, desktopDisplay: a, feedbackLabel: l, surveyUuid: p, surveyId: d } =
|
|
292
|
+
}, wt = async (t, r, n) => {
|
|
293
|
+
const { buttonTheme: s, customStyles: e, eventId: i, placement: o, desktopDisplay: a, feedbackLabel: l, surveyUuid: p, surveyId: d } = t;
|
|
294
294
|
window.UserLeap.feedbackCustomStyles = void 0;
|
|
295
295
|
let c = K();
|
|
296
296
|
if (c) {
|
|
297
|
-
if (!
|
|
297
|
+
if (!r && i === Z) return;
|
|
298
298
|
c.remove(), y.off(re.SURVEY_FADING_OUT, be);
|
|
299
299
|
}
|
|
300
300
|
Z = i, se({ document, elementId: "sprig-feedback-style", styleString: '.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}#sprig-feedback-button{border-left:0;border-radius:0 8px 8px 0;display:grid;padding:8px;text-align:center;transition:all ease-in-out 1s;z-index:inherit}#sprig-feedback-button:hover{cursor:pointer}.sprig-feedback-button-label{writing-mode:vertical-lr;text-orientation:sideways}.sprig-feedback-button-right{transform:rotate(180deg)}.sprig-feedback-button-bottom{align-self:flex-end;margin-bottom:20px}.sprig-feedback-button-light{background:#efefee;color:#000;border:1px solid #e2e3e1}.sprig-feedback-button-dark{background:#000;color:#fff;border:1px solid #000000}#sprig-feedback-container{display:flex;align-items:center;position:fixed;transition:right .2s linear,left .2s linear;z-index:2147483646}.sprig-feedback-container-left{flex-flow:row-reverse}.sprig-feedback-container-center{top:50%;transform:translateY(-50%)}.sprig-feedback-container-bottom{bottom:0%;margin-bottom:15px}.sprig-feedback-loading-container{align-items:center;background-color:#fff;border:2px solid var(--feedback-border);display:flex;max-height:90vh;max-width:90vw;min-width:0px}.sprig-feedback-loading-container-left{border-left:none;border-radius:0 8px 8px 0}.sprig-feedback-loading-container-right{border-right:none;border-radius:8px 0 0 8px}#sprig-feedback-error-container{margin:auto;text-align:center;width:360px}.sprig-feedback-error-text{font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol}#sprig-feedback-loading-container .ul-container{position:relative;max-height:inherit}#sprig-feedback-loading-animation{position:absolute}.sprig-feedback-loading-container-previews iframe{max-height:inherit!important}', nonce: window.UserLeap.styleNonce }), se({ document, elementId: "ul-custom-style", styleString: e ?? "", nonce: window.UserLeap.styleNonce }), Ke = a === "center-modal", B = o;
|
|
@@ -315,7 +315,7 @@ const zt = ["bottom-left", "bottom-right", "center-left", "center-right"], ae =
|
|
|
315
315
|
}
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
|
-
if (ge(P(window.UserLeap)) || Ae || Je(),
|
|
318
|
+
if (ge(P(window.UserLeap)) || Ae || Je(), r) return h && h.classList.add("sprig-feedback-loading-container-previews"), await X(r), void Y();
|
|
319
319
|
const L = await (async (b) => {
|
|
320
320
|
const _ = await O(A("1", [F], "startFeedbackStudy"), { body: JSON.stringify({ surveyUuid: b }), method: "POST" });
|
|
321
321
|
return _.ok ? _.json : null;
|
|
@@ -334,16 +334,16 @@ const zt = ["bottom-left", "bottom-right", "center-left", "center-right"], ae =
|
|
|
334
334
|
const L = ut();
|
|
335
335
|
de(-L);
|
|
336
336
|
}
|
|
337
|
-
window.UserLeap._config.isOnQuestionsTab &&
|
|
337
|
+
window.UserLeap._config.isOnQuestionsTab && r && !ae() && h && (Je(), Ie(), h && h.classList.add("sprig-feedback-loading-container-previews"), X(r), Y());
|
|
338
338
|
}, Ht = () => {
|
|
339
|
-
const
|
|
340
|
-
|
|
339
|
+
const t = document.createElement("div");
|
|
340
|
+
t.id = "sprig-feedback-error-container", t.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
|
|
341
341
|
<circle cx="20" cy="20" r="14.5" stroke="#B0B5B7" stroke-width="3"/>
|
|
342
342
|
<path d="M20 12L20 21.6" stroke="#B0B5B7" stroke-width="3" stroke-linecap="round"/>
|
|
343
343
|
<circle cx="19.9984" cy="27.6" r="1.6" fill="#B0B5B7"/>
|
|
344
344
|
</svg>`;
|
|
345
|
-
const
|
|
346
|
-
return
|
|
345
|
+
const r = document.createElement("h3");
|
|
346
|
+
return r.className = "sprig-feedback-error-text", r.innerText = "There was an error while loading the survey", t.appendChild(r), t;
|
|
347
347
|
}, ke = new class {
|
|
348
348
|
constructor() {
|
|
349
349
|
W(this, "_ldData", {});
|
|
@@ -351,13 +351,13 @@ const zt = ["bottom-left", "bottom-right", "center-left", "center-right"], ae =
|
|
|
351
351
|
getAllLaunchDarklyVariations() {
|
|
352
352
|
return this._ldData;
|
|
353
353
|
}
|
|
354
|
-
setLDFlagsVariations(
|
|
354
|
+
setLDFlagsVariations(t) {
|
|
355
355
|
try {
|
|
356
|
-
return !(!
|
|
357
|
-
delete this._ldData[
|
|
358
|
-
}), Object.keys(
|
|
359
|
-
} catch (
|
|
360
|
-
return
|
|
356
|
+
return !(!t || typeof t != "object" || Array.isArray(t)) && (Object.keys(this._ldData).forEach((r) => {
|
|
357
|
+
delete this._ldData[r];
|
|
358
|
+
}), Object.keys(t).forEach((r) => this._ldData[`!launch_darkly_${r}`] = (t[r] ?? 0) + 1), !0);
|
|
359
|
+
} catch (r) {
|
|
360
|
+
return r instanceof Error && window.UserLeap.reportError("setAllLDFlagsVariations", r), console.warn("[Sprig] An issue had occured when setting LaunchDarkly flags and variations."), !1;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
}();
|
|
@@ -366,11 +366,11 @@ const oe = new class {
|
|
|
366
366
|
constructor() {
|
|
367
367
|
W(this, "_optimizelyData", {});
|
|
368
368
|
}
|
|
369
|
-
setOptimizelyExperiment(
|
|
370
|
-
if (!
|
|
371
|
-
const { experiments: n } =
|
|
369
|
+
setOptimizelyExperiment(t, r = !0) {
|
|
370
|
+
if (!t || typeof t != "object") return !1;
|
|
371
|
+
const { experiments: n } = t;
|
|
372
372
|
try {
|
|
373
|
-
return
|
|
373
|
+
return r && Object.keys(this._optimizelyData).map((s) => {
|
|
374
374
|
delete this._optimizelyData[s];
|
|
375
375
|
}), n && n.map((s) => {
|
|
376
376
|
const { id: e, variation: i } = s, o = this.transformExperimentId(e);
|
|
@@ -383,43 +383,43 @@ const oe = new class {
|
|
|
383
383
|
getAllOptimizelyExperiments() {
|
|
384
384
|
return this._optimizelyData;
|
|
385
385
|
}
|
|
386
|
-
getOptimizelyVariationName(
|
|
387
|
-
return this._optimizelyData[this.transformExperimentId(
|
|
386
|
+
getOptimizelyVariationName(t) {
|
|
387
|
+
return this._optimizelyData[this.transformExperimentId(t)];
|
|
388
388
|
}
|
|
389
|
-
transformExperimentId(
|
|
390
|
-
return "!optimizely_experiments_" +
|
|
389
|
+
transformExperimentId(t) {
|
|
390
|
+
return "!optimizely_experiments_" + t;
|
|
391
391
|
}
|
|
392
392
|
getAndSetWebOptimizelyExperiments() {
|
|
393
|
-
var
|
|
393
|
+
var t;
|
|
394
394
|
try {
|
|
395
395
|
if (window && window.optimizely && typeof window.optimizely.get == "function") {
|
|
396
|
-
const
|
|
397
|
-
if (
|
|
398
|
-
const n = Object.keys(
|
|
396
|
+
const r = (t = window.optimizely.get("state")) == null ? void 0 : t.getExperimentStates({ isActive: !0 });
|
|
397
|
+
if (r) {
|
|
398
|
+
const n = Object.keys(r).map((s) => {
|
|
399
399
|
var e, i;
|
|
400
|
-
return (e =
|
|
400
|
+
return (e = r[s].variation) != null && e.name ? { id: s, variation: (i = r[s].variation) == null ? void 0 : i.name } : { id: s, variation: "Original" };
|
|
401
401
|
});
|
|
402
402
|
return this.setOptimizelyExperiment({ experiments: n }, !1), !0;
|
|
403
403
|
}
|
|
404
404
|
return !1;
|
|
405
405
|
}
|
|
406
406
|
return !1;
|
|
407
|
-
} catch (
|
|
408
|
-
return
|
|
407
|
+
} catch (r) {
|
|
408
|
+
return r instanceof Error && window.UserLeap.reportError("getAndSetWebOptimizely", r), !1;
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
}();
|
|
412
412
|
Object.freeze(oe);
|
|
413
413
|
class Vt {
|
|
414
|
-
constructor(
|
|
414
|
+
constructor(r, n) {
|
|
415
415
|
W(this, "paused");
|
|
416
416
|
W(this, "queue");
|
|
417
417
|
W(this, "ul");
|
|
418
|
-
this.ul =
|
|
418
|
+
this.ul = r, this.paused = !1, this.queue = [], this.flush(n);
|
|
419
419
|
}
|
|
420
|
-
flush(
|
|
421
|
-
const n =
|
|
422
|
-
if (n) for (let s = 0; s < n; s++) this.push(
|
|
420
|
+
flush(r) {
|
|
421
|
+
const n = r.length;
|
|
422
|
+
if (n) for (let s = 0; s < n; s++) this.push(r[s]);
|
|
423
423
|
}
|
|
424
424
|
isPaused() {
|
|
425
425
|
return this.paused;
|
|
@@ -429,83 +429,83 @@ class Vt {
|
|
|
429
429
|
}
|
|
430
430
|
unpause() {
|
|
431
431
|
this.paused = !1;
|
|
432
|
-
const
|
|
433
|
-
this.empty(), this.flush(
|
|
432
|
+
const r = this.queue.slice();
|
|
433
|
+
this.empty(), this.flush(r);
|
|
434
434
|
}
|
|
435
|
-
push(
|
|
436
|
-
if (this.paused) this.queue.push(
|
|
437
|
-
else if (
|
|
435
|
+
push(r) {
|
|
436
|
+
if (this.paused) this.queue.push(r);
|
|
437
|
+
else if (r instanceof Function) r();
|
|
438
438
|
else {
|
|
439
|
-
const n = Array.prototype.slice.call(
|
|
439
|
+
const n = Array.prototype.slice.call(r, 1), s = r[0], e = this.ul[s];
|
|
440
440
|
e instanceof Function ? e.apply(this.ul, n) : s && console.warn("[Sprig] (ERR-100) No valid UserLeap action called", s);
|
|
441
441
|
}
|
|
442
442
|
}
|
|
443
|
-
perform(
|
|
443
|
+
perform(r) {
|
|
444
444
|
if (this.paused) {
|
|
445
445
|
let n = () => {
|
|
446
446
|
};
|
|
447
447
|
const s = new Promise(function(e) {
|
|
448
448
|
n = function() {
|
|
449
|
-
e(
|
|
449
|
+
e(r());
|
|
450
450
|
};
|
|
451
451
|
});
|
|
452
452
|
return this.queue.push(n), s;
|
|
453
453
|
}
|
|
454
|
-
return
|
|
454
|
+
return r();
|
|
455
455
|
}
|
|
456
456
|
empty() {
|
|
457
457
|
this.queue.length = 0;
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
let gt, yt;
|
|
461
|
-
const Ee = (
|
|
462
|
-
let
|
|
463
|
-
for (; n; )
|
|
464
|
-
return
|
|
461
|
+
const Ee = (t) => {
|
|
462
|
+
let r = 0, n = t.firstElementChild;
|
|
463
|
+
for (; n; ) r += Ee(n), n.shadowRoot && (r += Ee(n.shadowRoot)), n = n.nextElementSibling, r++;
|
|
464
|
+
return r;
|
|
465
465
|
}, Qe = () => {
|
|
466
466
|
gt.report(Ee(document.body)), yt.report(document.documentElement.innerHTML.length);
|
|
467
|
-
}, _e = (
|
|
467
|
+
}, _e = (t, r) => {
|
|
468
468
|
const n = performance.now();
|
|
469
|
-
document.hidden ? setTimeout(() => _e(
|
|
469
|
+
document.hidden ? setTimeout(() => _e(t, r), t) : setTimeout(() => {
|
|
470
470
|
const s = performance.now() - n;
|
|
471
|
-
|
|
471
|
+
r.report(s / 1e3), setTimeout(() => _e(t, r), t);
|
|
472
472
|
}, 0);
|
|
473
473
|
};
|
|
474
474
|
let le, ce, pe, ue, Ye, N = {};
|
|
475
|
-
const ne = (
|
|
476
|
-
const { name: n } =
|
|
477
|
-
N[n] = (N[n] || 0) +
|
|
478
|
-
}, mt = (
|
|
479
|
-
let
|
|
480
|
-
return
|
|
481
|
-
|
|
482
|
-
}),
|
|
483
|
-
}, Xe = (
|
|
484
|
-
let
|
|
485
|
-
return
|
|
486
|
-
|
|
487
|
-
}),
|
|
488
|
-
}, Wt = (
|
|
489
|
-
switch (
|
|
475
|
+
const ne = (t, r = 1) => {
|
|
476
|
+
const { name: n } = t;
|
|
477
|
+
N[n] = (N[n] || 0) + r;
|
|
478
|
+
}, mt = (t) => {
|
|
479
|
+
let r = 1;
|
|
480
|
+
return t.childNodes.forEach((n) => {
|
|
481
|
+
r += mt(n);
|
|
482
|
+
}), r;
|
|
483
|
+
}, Xe = (t) => {
|
|
484
|
+
let r = 0;
|
|
485
|
+
return t.forEach((n) => {
|
|
486
|
+
r += mt(n);
|
|
487
|
+
}), r;
|
|
488
|
+
}, Wt = (t) => {
|
|
489
|
+
switch (t.type) {
|
|
490
490
|
case "childList":
|
|
491
|
-
return ne(le, Xe(
|
|
491
|
+
return ne(le, Xe(t.addedNodes)), void ne(ce, Xe(t.removedNodes));
|
|
492
492
|
case "attributes":
|
|
493
493
|
return void ne(pe);
|
|
494
494
|
case "characterData":
|
|
495
495
|
return void ne(ue);
|
|
496
496
|
}
|
|
497
|
-
}, Bt = (
|
|
497
|
+
}, Bt = (t) => t.forEach(Wt), Nt = () => {
|
|
498
498
|
le.report(N[le.name] || 0), ce.report(N[ce.name] || 0), pe.report(N[pe.name] || 0), ue.report(N[ue.name] || 0), N = {};
|
|
499
|
-
}, $t = (
|
|
500
|
-
le = $("sdk_mutations_nodes_added"), ce = $("sdk_mutations_nodes_removed"), pe = $("sdk_mutations_attributes_changed"), ue = $("sdk_mutations_character_data"), Ye = new MutationObserver(Bt), Ye.observe(document, { attributes: !0, attributeOldValue: !0, characterData: !0, characterDataOldValue: !0, childList: !0, subtree: !0 }), setInterval(Nt,
|
|
501
|
-
}, Gt = ({ isWeb:
|
|
499
|
+
}, $t = (t = 1e3) => {
|
|
500
|
+
le = $("sdk_mutations_nodes_added"), ce = $("sdk_mutations_nodes_removed"), pe = $("sdk_mutations_attributes_changed"), ue = $("sdk_mutations_character_data"), Ye = new MutationObserver(Bt), Ye.observe(document, { attributes: !0, attributeOldValue: !0, characterData: !0, characterDataOldValue: !0, childList: !0, subtree: !0 }), setInterval(Nt, t);
|
|
501
|
+
}, Gt = ({ isWeb: t, reportingIntervalSeconds: r, thresholds: n, postMetrics: s }) => {
|
|
502
502
|
_t(n, (e, i) => {
|
|
503
503
|
var o, a;
|
|
504
504
|
if ((o = S.replay) != null && o.isReplayRecording()) {
|
|
505
505
|
const l = `Value: ${e} on ${i.metric} violated threshold of ${i.type} ${i.value}`;
|
|
506
506
|
(a = S.replay) == null || a.disableRecording("Threshold violated", new Error(l), { reportError: !1 }), window.UserLeap.reportError("Sdk Performance Metric threshold violated", new Error("Sdk Performance Metric threshold violated"), { metricName: i.metric, type: i.type, value: i.value }, { metricName: i.metric }), xt();
|
|
507
507
|
}
|
|
508
|
-
}), Rt({ reportingIntervalSeconds:
|
|
508
|
+
}), Rt({ reportingIntervalSeconds: r, postMetrics: s }), t && (((e = 1e3) => {
|
|
509
509
|
const i = $("sdk_event_queue_latency_seconds");
|
|
510
510
|
_e(e, i);
|
|
511
511
|
})(), ((e = 1e4) => {
|
|
@@ -515,23 +515,23 @@ const ne = (r, t = 1) => {
|
|
|
515
515
|
let Oe, ee;
|
|
516
516
|
const we = {}, Q = "!email", ft = "pageUrl";
|
|
517
517
|
let Le = window.location.href;
|
|
518
|
-
function te(
|
|
518
|
+
function te(t) {
|
|
519
519
|
var a, l;
|
|
520
|
-
const { pageUrlEvents:
|
|
520
|
+
const { pageUrlEvents: r, interactiveEvents: n, dismissOnPageChange: s, platform: e } = window.UserLeap._config;
|
|
521
521
|
if (e && e !== "web") return;
|
|
522
522
|
Le !== window.location.href && q.navigation("LocationChange", { from: Le, to: window.location.href }), Le = window.location.href;
|
|
523
523
|
const i = bt().trackStartUrl, o = i ? String(i) : null;
|
|
524
|
-
|
|
524
|
+
r && Ut(window.location.href), n && (ht(), Qt()), lt() && (() => {
|
|
525
525
|
if (ae()) return;
|
|
526
526
|
const p = K();
|
|
527
527
|
p && (Et(Z) || (p.remove(), Z = null, h = null));
|
|
528
528
|
})(), At.getItem("sprig.isCapturingHeatmap") && ((l = (a = S.replay) == null ? void 0 : a.checkPendingHeatmapsUrl()) == null || l.then((p) => {
|
|
529
529
|
var d;
|
|
530
530
|
p && ((d = S.replay) == null || d.uploadReadyPendingCaptures(!0));
|
|
531
|
-
})), !ae() && s && o && o !== window.location.href &&
|
|
531
|
+
})), !ae() && s && o && o !== window.location.href && t && Jt.includes(t.type) && window.UserLeap("dismissActiveSurvey", M.PageChange);
|
|
532
532
|
}
|
|
533
533
|
const vt = { capture: !0 }, Qt = () => {
|
|
534
|
-
const
|
|
534
|
+
const t = window.UserLeap._config.interactiveEvents.filter((n) => it(n, window.location.href)).map((n) => {
|
|
535
535
|
const { name: s, properties: e } = n, { selector: i, innerText: o } = e;
|
|
536
536
|
return i ? (a) => {
|
|
537
537
|
if ($e(a.target)) try {
|
|
@@ -540,69 +540,69 @@ const vt = { capture: !0 }, Qt = () => {
|
|
|
540
540
|
}
|
|
541
541
|
return !1;
|
|
542
542
|
} : (a) => ($e(a.target) && a.target.innerText === o && window.UserLeap("track", s), !1);
|
|
543
|
-
}),
|
|
544
|
-
window.UserLeap._config.interactiveEventsHandler =
|
|
543
|
+
}), r = (n) => t.forEach((s) => s(n));
|
|
544
|
+
window.UserLeap._config.interactiveEventsHandler = r, window.addEventListener("click", r, vt);
|
|
545
545
|
}, ht = () => {
|
|
546
546
|
window.UserLeap._config.interactiveEventsHandler && window.removeEventListener("click", window.UserLeap._config.interactiveEventsHandler, vt), delete window.UserLeap._config.interactiveEventsHandler;
|
|
547
547
|
};
|
|
548
548
|
function bt() {
|
|
549
|
-
const
|
|
550
|
-
return
|
|
549
|
+
const t = x.getItemObject("userleap.ids");
|
|
550
|
+
return t && t[window.UserLeap.envId] || {};
|
|
551
551
|
}
|
|
552
552
|
function Lt() {
|
|
553
553
|
if (window.previewMode) return;
|
|
554
|
-
const
|
|
555
|
-
window.UserLeap.visitorId =
|
|
554
|
+
const t = x.getItemObject("sprig.anon.env.vid.map") || {}, r = t[window.UserLeap.envId];
|
|
555
|
+
window.UserLeap.visitorId = r || tt(), q.info("NewVid", { vid: window.UserLeap.visitorId }), R("vid", window.UserLeap.visitorId), r || (t[window.UserLeap.envId] = window.UserLeap.visitorId, x.setItemObject("sprig.anon.env.vid.map", t)), y.emit(w.VisitorIDUpdated, { visitorId: window.UserLeap.visitorId });
|
|
556
556
|
}
|
|
557
|
-
function Ut(
|
|
557
|
+
function Ut(t, r, n, s) {
|
|
558
558
|
var e, i;
|
|
559
559
|
try {
|
|
560
|
-
if (
|
|
561
|
-
q.info("PageView", { url:
|
|
560
|
+
if (t.endsWith("mock_snippet.html")) return;
|
|
561
|
+
q.info("PageView", { url: t });
|
|
562
562
|
const o = (e = document == null ? void 0 : document.querySelector('meta[name="description"]')) == null ? void 0 : e.getAttribute("content");
|
|
563
|
-
(i = S.replay) == null || i.RecordPageView({ ...o && { description: o }, url:
|
|
563
|
+
(i = S.replay) == null || i.RecordPageView({ ...o && { description: o }, url: t, referrer: document.referrer, pageTitle: document.title });
|
|
564
564
|
const a = window.UserLeap._config.pageUrlEvents;
|
|
565
565
|
let l = !1;
|
|
566
|
-
if (a && a.length) for (let d = 0; d < a.length && (l = it(a[d],
|
|
566
|
+
if (a && a.length) for (let d = 0; d < a.length && (l = it(a[d], t), !l); d++) ;
|
|
567
567
|
if (!l) return;
|
|
568
|
-
window.UserLeap.debugMode && console.info("[DEBUG] Sprig trackPageView",
|
|
569
|
-
const p = { url:
|
|
570
|
-
s && (p.trackPageView = !0), window.UserLeap._queue.push(["track", ft,
|
|
568
|
+
window.UserLeap.debugMode && console.info("[DEBUG] Sprig trackPageView", t);
|
|
569
|
+
const p = { url: t };
|
|
570
|
+
s && (p.trackPageView = !0), window.UserLeap._queue.push(["track", ft, r, p, n]);
|
|
571
571
|
} catch (o) {
|
|
572
|
-
o instanceof Error && (o.stack =
|
|
572
|
+
o instanceof Error && (o.stack = t, window.UserLeap.reportError("trackPageView", o)), console.warn("[Sprig] (ERR-428) Failed to track page view", o);
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
function Yt() {
|
|
576
|
-
const
|
|
577
|
-
"pushState" in
|
|
578
|
-
const s =
|
|
576
|
+
const t = "Backbone" in window && window.Backbone && window.Backbone.history ? window.Backbone.history : window.history;
|
|
577
|
+
"pushState" in t && (t.pushState = /* @__PURE__ */ ((r) => function(...n) {
|
|
578
|
+
const s = r.apply(this, n), e = new Event("pushState");
|
|
579
579
|
return window.dispatchEvent(e), te(e), s;
|
|
580
|
-
})(
|
|
581
|
-
const s =
|
|
580
|
+
})(t.pushState)), "replaceState" in t && (t.replaceState = /* @__PURE__ */ ((r) => function(...n) {
|
|
581
|
+
const s = r.apply(this, n), e = new Event("replaceState");
|
|
582
582
|
return window.dispatchEvent(e), te(e), s;
|
|
583
|
-
})(
|
|
583
|
+
})(t.replaceState)), ["hashchange", "popstate"].forEach((r) => window.addEventListener(r, te, !0));
|
|
584
584
|
}
|
|
585
|
-
async function Ue(
|
|
585
|
+
async function Ue(t, r) {
|
|
586
586
|
const n = xe();
|
|
587
|
-
|
|
587
|
+
t && !r && (window.UserLeap._config.mode = Kt);
|
|
588
588
|
const s = ge(P(window.UserLeap)), e = await O(function(i) {
|
|
589
589
|
const o = new URL(A("1", [z], "questions"));
|
|
590
590
|
return Object.entries(i || {}).forEach(([a, l]) => {
|
|
591
591
|
l && o.searchParams.append(a, String(l));
|
|
592
592
|
}), o.toString();
|
|
593
|
-
}({ desktopDisplay: window.UserLeap._config.desktopDisplay, isMobile: s, previewLanguage: window.UserLeap._config.previewLanguage, surveyid:
|
|
593
|
+
}({ desktopDisplay: window.UserLeap._config.desktopDisplay, isMobile: s, previewLanguage: window.UserLeap._config.previewLanguage, surveyid: t == null ? void 0 : t.surveyId, surveytemplateid: t == null ? void 0 : t.surveyTemplateId, vid: n }), { shouldDropOnRateLimit: !0 });
|
|
594
594
|
if (!e.ok) return e.reportError && e.error && (console.warn("[Sprig] (ERR-414) Failed to request questions from the server", e.error), window.UserLeap.reportError("getQuestions", e.error)), { success: !1, surveyState: "no survey" };
|
|
595
595
|
if (e.json.delay && await nt(e.json.delay), !e.json.isFeedback) return X(e.json, ee, Oe);
|
|
596
596
|
{
|
|
597
597
|
const { feedbackLabel: i, productConfig: o, surveyUuid: a, feedbackCustomStyles: l } = e.json, { buttonTheme: p, placement: d, desktopDisplay: c } = o;
|
|
598
|
-
wt({ customStyles: l, buttonTheme: p, desktopDisplay: c, eventId: 0, feedbackLabel: i, placement: d, surveyUuid: a, surveyId:
|
|
598
|
+
wt({ customStyles: l, buttonTheme: p, desktopDisplay: c, eventId: 0, feedbackLabel: i, placement: d, surveyUuid: a, surveyId: t == null ? void 0 : t.surveyId }, e.json);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
function Xt(
|
|
602
|
-
if (!
|
|
603
|
-
window.UserLeap._config =
|
|
604
|
-
const { interactiveEvents:
|
|
605
|
-
|
|
601
|
+
function Xt(t) {
|
|
602
|
+
if (!t) return;
|
|
603
|
+
window.UserLeap._config = t, t.mute && window.UserLeap._queue.pause();
|
|
604
|
+
const { interactiveEvents: r, pageUrlEvents: n, dismissOnPageChange: s } = t;
|
|
605
|
+
r && function(e) {
|
|
606
606
|
let i = e.length;
|
|
607
607
|
for (; i; ) {
|
|
608
608
|
const o = Math.floor(Math.random() * i);
|
|
@@ -610,17 +610,17 @@ function Xt(r) {
|
|
|
610
610
|
const a = e[i];
|
|
611
611
|
e[i] = e[o], e[o] = a;
|
|
612
612
|
}
|
|
613
|
-
}(
|
|
613
|
+
}(r), (r || n || s) && (Yt(), te());
|
|
614
614
|
}
|
|
615
|
-
const Zt = function(
|
|
615
|
+
const Zt = function(t) {
|
|
616
616
|
if (!window.UserLeap) return;
|
|
617
|
-
const
|
|
617
|
+
const r = async (e = {}) => {
|
|
618
618
|
var v, L, b, _, T;
|
|
619
619
|
const { userId: i, anonymousId: o, metadata: a = {}, properties: l, showSurveyCallback: p } = e;
|
|
620
620
|
let { eventName: d } = e;
|
|
621
|
-
if (window.UserLeap.debugMode && d !== ft && console.info("[DEBUG] Sprig track", e),
|
|
621
|
+
if (window.UserLeap.debugMode && d !== ft && console.info("[DEBUG] Sprig track", e), t.mode === "test") return;
|
|
622
622
|
const c = x.getItem("sprig.previewKey") ?? void 0;
|
|
623
|
-
if (
|
|
623
|
+
if (t.requireUserIdForTracking && !window.UserLeap.userId && !i) {
|
|
624
624
|
const U = "[Sprig] - Skipping tracking without userId";
|
|
625
625
|
return console.warn(U), { success: !1, message: U, surveyState: "no survey" };
|
|
626
626
|
}
|
|
@@ -682,13 +682,13 @@ const Zt = function(r) {
|
|
|
682
682
|
}
|
|
683
683
|
return this.identifyAndSetAttributes({ attributes: e });
|
|
684
684
|
}, async identifyAndSetAttributes(e) {
|
|
685
|
-
if (window.UserLeap.debugMode && console.info("[DEBUG] Sprig identifyAndSetAttributes", e),
|
|
685
|
+
if (window.UserLeap.debugMode && console.info("[DEBUG] Sprig identifyAndSetAttributes", e), t.mode === "test") return;
|
|
686
686
|
if (e === null || typeof e != "object" || !(e.userId || e.anonymousId || e.attributes)) {
|
|
687
687
|
const d = "[Sprig] - Disregarding empty payload provided";
|
|
688
688
|
return console.warn(d), { success: !1, message: d };
|
|
689
689
|
}
|
|
690
690
|
const { userId: i, anonymousId: o, attributes: a } = e;
|
|
691
|
-
if (
|
|
691
|
+
if (t.requireUserIdForTracking && !window.UserLeap.userId && !i) {
|
|
692
692
|
const d = "[Sprig] - Skipping tracking without userId";
|
|
693
693
|
return console.warn(d), { success: !1, message: d };
|
|
694
694
|
}
|
|
@@ -702,12 +702,12 @@ const Zt = function(r) {
|
|
|
702
702
|
let p;
|
|
703
703
|
return i && (l.userId = window.UserLeap.userId = i), o && (l.partnerAnonymousId = window.UserLeap.partnerAnonymousId = o), a && Object.keys(a).length > 0 ? (p = await O(A("1", [z, F], "attributes"), { body: JSON.stringify(a), method: "PUT" }), p.ok ? Object.assign(we, a) : p.reportError && (console.warn("[Sprig] (ERR-432) identifyAndSetAttributes failed", p.error), p.error && window.UserLeap.reportError("identifyAndSetAttributes", p.error))) : p = await O(A("1", [z, F]), { body: JSON.stringify(l), method: "PUT" }), a && a[Q] && (window.UserLeap.email = a[Q]), p.ok && (i && R("uid", i), o && R("aid", o)), { success: !!p.ok };
|
|
704
704
|
}, async removeAttributes(e) {
|
|
705
|
-
if (window.UserLeap.debugMode && console.info("[DEBUG] Sprig removeAttributes", e),
|
|
705
|
+
if (window.UserLeap.debugMode && console.info("[DEBUG] Sprig removeAttributes", e), t.mode === "test") return;
|
|
706
706
|
if (e == null || e.length === 0) {
|
|
707
707
|
const o = "[Sprig] - Disregarding empty attributes provided";
|
|
708
708
|
return console.warn(o), { success: !1, message: o };
|
|
709
709
|
}
|
|
710
|
-
if (
|
|
710
|
+
if (t.requireUserIdForTracking && !window.UserLeap.userId) {
|
|
711
711
|
const o = "[Sprig] - Skipping tracking without userId";
|
|
712
712
|
return console.warn(o), { success: !1, message: o };
|
|
713
713
|
}
|
|
@@ -731,7 +731,7 @@ const Zt = function(r) {
|
|
|
731
731
|
const l = `[Sprig] - Invalid userId ${e}`;
|
|
732
732
|
return console.warn(l), { success: !1, message: l };
|
|
733
733
|
}
|
|
734
|
-
if (
|
|
734
|
+
if (t.mode === "test" || e === window.UserLeap.userId) return;
|
|
735
735
|
window.UserLeap.userId = e;
|
|
736
736
|
const i = window.UserLeap.visitorId, o = await O(A("1", [z, F]), { body: JSON.stringify({ userId: e }), method: "PUT" });
|
|
737
737
|
o.ok ? (i !== window.UserLeap.visitorId && ((a = S.replay) == null || a.clearUserReplayData()), R("uid", e)) : o.reportError && (console.warn("[Sprig] (ERR-420) Failed to set user id", o.error), o.error && window.UserLeap.reportError("setUserId", o.error));
|
|
@@ -741,7 +741,7 @@ const Zt = function(r) {
|
|
|
741
741
|
return console.warn(i), { success: !1, message: i };
|
|
742
742
|
}
|
|
743
743
|
return window.UserLeap.partnerAnonymousId = e, R("aid", e), { success: !0 };
|
|
744
|
-
}, track: async (e, i, o = {}, a = void 0) =>
|
|
744
|
+
}, track: async (e, i, o = {}, a = void 0) => r({ eventName: e, properties: i, metadata: o, showSurveyCallback: a }), identifyAndTrack: async (e) => await r(e), trackPageView(e, i = void 0, o = void 0, a = !0) {
|
|
745
745
|
ee = e, Ut(e, i, o, a);
|
|
746
746
|
}, applyFeedbackStyles({ button: e = "", view: i = "" }) {
|
|
747
747
|
window.UserLeap.feedbackCustomStyles = i, document.getElementById("sprig-feedback-style") && se({ document, elementId: "ul-custom-style", styleString: e, nonce: window.UserLeap.styleNonce }), n(document.querySelector(".ul-container-feedback"), i);
|
|
@@ -807,19 +807,19 @@ const Zt = function(r) {
|
|
|
807
807
|
} };
|
|
808
808
|
Object.assign(window.UserLeap, s);
|
|
809
809
|
};
|
|
810
|
-
async function er(
|
|
811
|
-
const e = window.__cfg && window.__cfg.mode, i = xe(), o = window.UserLeap.envId, a = window.document.documentElement, l = { mode: e, screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: a.clientWidth, clientHeight: a.clientHeight, location: ee ?? window.location.href, language: window.navigator.language, ...n }, p = { action:
|
|
812
|
-
(await O(A("1", null, "errors"), { method: "POST", headers: { "x-ul-error": window.btoa(`userleap-${Date.now()}-error`) }, body: JSON.stringify(p), shouldDropOnRateLimit: !0 })).ok || console.warn("[Sprig] (ERR-444) Failed to report error to API",
|
|
810
|
+
async function er(t, r, n = {}, s = {}) {
|
|
811
|
+
const e = window.__cfg && window.__cfg.mode, i = xe(), o = window.UserLeap.envId, a = window.document.documentElement, l = { mode: e, screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: a.clientWidth, clientHeight: a.clientHeight, location: ee ?? window.location.href, language: window.navigator.language, ...n }, p = { action: t, breadcrumbs: q.breadcrumbs, err: { message: `${r == null ? void 0 : r.name} - ${r == null ? void 0 : r.message}`, stack: r == null ? void 0 : r.stack }, meta: l, vid: i, envId: o, ...s };
|
|
812
|
+
(await O(A("1", null, "errors"), { method: "POST", headers: { "x-ul-error": window.btoa(`userleap-${Date.now()}-error`) }, body: JSON.stringify(p), shouldDropOnRateLimit: !0 })).ok || console.warn("[Sprig] (ERR-444) Failed to report error to API", r);
|
|
813
813
|
}
|
|
814
|
-
function tr(
|
|
814
|
+
function tr(t = {}) {
|
|
815
815
|
var s;
|
|
816
816
|
(s = window.SprigLoggerCallback) == null || s.call(window, "Initializing Sprig");
|
|
817
|
-
const
|
|
817
|
+
const r = new URLSearchParams(window.location.search).get("sprigPreviewKey") ?? "";
|
|
818
818
|
async function n() {
|
|
819
819
|
var c, g, m, u, E;
|
|
820
820
|
if (window.UserLeap.loaded) return;
|
|
821
|
-
if ((c = window.SprigLoggerCallback) == null || c.call(window, "Loading Sprig"), window.UserLeap.reportError = er, window.UserLeap.loaded = !0, window.UserLeap._config = Object.assign({},
|
|
822
|
-
if (window.Sprig.outstandingTransactionLimit !== void 0 && (
|
|
821
|
+
if ((c = window.SprigLoggerCallback) == null || c.call(window, "Loading Sprig"), window.UserLeap.reportError = er, window.UserLeap.loaded = !0, window.UserLeap._config = Object.assign({}, t, window.UserLeap.config), window.UserLeap.delayingSurvey = !1, window.UserLeap._config && typeof window.UserLeap._config == "object") for (const f in window.UserLeap._config) window.UserLeap[f] = window.UserLeap._config[f];
|
|
822
|
+
if (window.Sprig.outstandingTransactionLimit !== void 0 && (t.outstandingTransactionLimit = window.Sprig.outstandingTransactionLimit), !window.UserLeap.envId) {
|
|
823
823
|
if (!window.UserLeap.appId) throw new Error("Missing Environment id");
|
|
824
824
|
window.UserLeap.envId = window.UserLeap.appId;
|
|
825
825
|
}
|
|
@@ -845,19 +845,19 @@ function tr(r = {}) {
|
|
|
845
845
|
if (document.removeEventListener("securitypolicyviolation", He), !L.ok) return (_ = window.SprigLoggerCallback) == null || _.call(window, "Sprig config fetch failed"), L.reportError && (console.warn("[Sprig] (ERR-422) Failed to load configuration", L.error), L.error && window.UserLeap.reportError("applyRemoteConfig", L.error)), Ve("Disabled: failed to fetch configuration"), f;
|
|
846
846
|
const b = L.json;
|
|
847
847
|
return b != null && b.disabled ? ((T = window.SprigLoggerCallback) == null || T.call(window, "Sprig config fetch disabled"), Ve(`Disabled: ${b.disabled}`), { disabled: b.disabled }) : Object.assign({}, b, f);
|
|
848
|
-
}(
|
|
848
|
+
}(t);
|
|
849
849
|
if ((m = window.SprigLoggerCallback) == null || m.call(window, "Sprig fetched config"), Gt({ isWeb: !p, reportingIntervalSeconds: d.metricsReportingEnabled || d.mobileMetricsReportingEnabled ? d.metricsReportingIntervalSeconds : 0, thresholds: d.metricThresholds, postMetrics: async (f) => {
|
|
850
850
|
var v;
|
|
851
851
|
await O(A("1", [z], "metrics"), { body: f, method: "POST", headers: { "x-ul-replay-enabled": `${!!((v = S.replay) != null && v.isReplayRecording())}` }, shouldDropOnRateLimit: !0 });
|
|
852
852
|
} }), !p) {
|
|
853
|
-
const f = d.alwaysOnReplay ? { userAgent: window.navigator.userAgent, surveyId: d.alwaysOnReplay.surveyId, responseGroupUuid: d.alwaysOnReplay.responseGroupUuid, sdkVersion: "2.
|
|
853
|
+
const f = d.alwaysOnReplay ? { userAgent: window.navigator.userAgent, surveyId: d.alwaysOnReplay.surveyId, responseGroupUuid: d.alwaysOnReplay.responseGroupUuid, sdkVersion: "2.37.1", maxDurationSeconds: d.alwaysOnReplay.maxDurationSeconds } : void 0;
|
|
854
854
|
await ((u = S.replay) == null ? void 0 : u.initializeReplay({ maxReplayDurationSeconds: d.maxReplayDurationSeconds, maxInflightRequests: window.UserLeap.maxInflightReplayRequests ?? 2, replaySettings: d.replaySettings, apiUrl: window.UserLeap._API_URL, alwaysOnConfig: f })), Oe = d.replaySettings;
|
|
855
855
|
}
|
|
856
856
|
Zt(d), await Xt(d), window.UserLeap._queue.unpause(), (E = window.SprigLoggerCallback) == null || E.call(window, "SdkReady"), y.emit(w.SDKReady, { mobileMetricsReportingEnabled: !!d.mobileMetricsReportingEnabled, metricsReportingInterval: d.metricsReportingIntervalSeconds || 0, metricsThresholds: d.metricThresholds || [], maxMobileReplayDurationSeconds: d.maxMobileReplayDurationSeconds, mobileReplaySettings: d.mobileReplaySettings }), y.emit(w.VisitorIDUpdated, { visitorId: window.UserLeap.visitorId }), y.on(w.VisitorIDUpdated, () => {
|
|
857
857
|
for (const f in we) delete we[f];
|
|
858
858
|
});
|
|
859
859
|
}
|
|
860
|
-
window.UserLeap.UPDATES = re, window.UserLeap("setPreviewKey",
|
|
860
|
+
window.UserLeap.UPDATES = re, window.UserLeap("setPreviewKey", r), document.readyState === "complete" ? n() : window.attachEvent ? window.attachEvent("onload", n) : window.addEventListener("load", () => {
|
|
861
861
|
n();
|
|
862
862
|
}, !1);
|
|
863
863
|
}
|
|
@@ -865,8 +865,8 @@ class Re {
|
|
|
865
865
|
constructor() {
|
|
866
866
|
W(this, "UPDATES", re);
|
|
867
867
|
}
|
|
868
|
-
displaySurvey(
|
|
869
|
-
window.Sprig("displaySurvey",
|
|
868
|
+
displaySurvey(r) {
|
|
869
|
+
window.Sprig("displaySurvey", r);
|
|
870
870
|
}
|
|
871
871
|
mute() {
|
|
872
872
|
window.Sprig("mute");
|
|
@@ -877,50 +877,50 @@ class Re {
|
|
|
877
877
|
dismissActiveSurvey() {
|
|
878
878
|
window.Sprig("dismissActiveSurvey");
|
|
879
879
|
}
|
|
880
|
-
setAttribute(
|
|
881
|
-
window.Sprig("setAttribute",
|
|
880
|
+
setAttribute(r, n) {
|
|
881
|
+
window.Sprig("setAttribute", r, n);
|
|
882
882
|
}
|
|
883
|
-
setAttributes(
|
|
884
|
-
window.Sprig("setAttributes",
|
|
883
|
+
setAttributes(r) {
|
|
884
|
+
window.Sprig("setAttributes", r);
|
|
885
885
|
}
|
|
886
|
-
identifyAndSetAttributes(
|
|
887
|
-
window.Sprig("identifyAndSetAttributes",
|
|
886
|
+
identifyAndSetAttributes(r) {
|
|
887
|
+
window.Sprig("identifyAndSetAttributes", r);
|
|
888
888
|
}
|
|
889
|
-
removeAttributes(
|
|
890
|
-
window.Sprig("removeAttributes",
|
|
889
|
+
removeAttributes(r) {
|
|
890
|
+
window.Sprig("removeAttributes", r);
|
|
891
891
|
}
|
|
892
|
-
addListener(
|
|
893
|
-
window.Sprig("addListener",
|
|
892
|
+
addListener(r, n) {
|
|
893
|
+
window.Sprig("addListener", r, n);
|
|
894
894
|
}
|
|
895
|
-
removeListener(
|
|
896
|
-
window.Sprig("removeListener",
|
|
895
|
+
removeListener(r, n) {
|
|
896
|
+
window.Sprig("removeListener", r, n);
|
|
897
897
|
}
|
|
898
898
|
removeAllListeners() {
|
|
899
899
|
window.Sprig("removeAllListeners");
|
|
900
900
|
}
|
|
901
|
-
setEmail(
|
|
902
|
-
window.Sprig("setAttribute", "!email",
|
|
901
|
+
setEmail(r) {
|
|
902
|
+
window.Sprig("setAttribute", "!email", r);
|
|
903
903
|
}
|
|
904
|
-
setUserId(
|
|
905
|
-
window.Sprig("setUserId",
|
|
904
|
+
setUserId(r) {
|
|
905
|
+
window.Sprig("setUserId", r);
|
|
906
906
|
}
|
|
907
|
-
setPartnerAnonymousId(
|
|
908
|
-
window.Sprig("setPartnerAnonymousId",
|
|
907
|
+
setPartnerAnonymousId(r) {
|
|
908
|
+
window.Sprig("setPartnerAnonymousId", r);
|
|
909
909
|
}
|
|
910
|
-
track(
|
|
911
|
-
window.Sprig("track",
|
|
910
|
+
track(r, n = {}, s = {}) {
|
|
911
|
+
window.Sprig("track", r, n, s);
|
|
912
912
|
}
|
|
913
|
-
identifyAndTrack(
|
|
914
|
-
window.Sprig("identifyAndTrack",
|
|
913
|
+
identifyAndTrack(r) {
|
|
914
|
+
window.Sprig("identifyAndTrack", r);
|
|
915
915
|
}
|
|
916
|
-
trackPageView(
|
|
917
|
-
window.Sprig("trackPageView",
|
|
916
|
+
trackPageView(r, n, s) {
|
|
917
|
+
window.Sprig("trackPageView", r, n, s);
|
|
918
918
|
}
|
|
919
|
-
applyStyles(
|
|
920
|
-
window.Sprig("applyStyles",
|
|
919
|
+
applyStyles(r) {
|
|
920
|
+
window.Sprig("applyStyles", r);
|
|
921
921
|
}
|
|
922
|
-
setWindowDimensions(
|
|
923
|
-
window.Sprig("setWindowDimensions",
|
|
922
|
+
setWindowDimensions(r, n) {
|
|
923
|
+
window.Sprig("setWindowDimensions", r, n);
|
|
924
924
|
}
|
|
925
925
|
logoutUser() {
|
|
926
926
|
window.Sprig("logoutUser");
|
|
@@ -935,17 +935,17 @@ class Re {
|
|
|
935
935
|
window.Sprig("resumeReplayRecording");
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
|
-
const Ze = { configure: (
|
|
939
|
-
if (!
|
|
940
|
-
if (
|
|
938
|
+
const Ze = { configure: (t) => {
|
|
939
|
+
if (!t.envId && !t.environmentId) throw new Error("Initialization Error: Sprig configure requires an environmentId");
|
|
940
|
+
if (t.envId || (t.envId = t.environmentId ?? ""), t.installationMethod = "web-npm", window.Sprig) return window.Sprig;
|
|
941
941
|
window.Sprig = function() {
|
|
942
942
|
window.Sprig._queue.push(arguments);
|
|
943
943
|
}, Object.getOwnPropertyNames(Re.prototype).map((n) => {
|
|
944
944
|
n !== "constructor" && (window.Sprig[n] = Re.prototype[n]);
|
|
945
945
|
});
|
|
946
|
-
const
|
|
947
|
-
return
|
|
948
|
-
} },
|
|
946
|
+
const r = window.Sprig;
|
|
947
|
+
return r.appId = t.envId, r._queue = [], window.UserLeap = r, tr(t), window.Sprig;
|
|
948
|
+
} }, pr = { sprig: Ze, SprigAPI: Re, configure: Ze.configure };
|
|
949
949
|
export {
|
|
950
950
|
or as A,
|
|
951
951
|
Ot as C,
|
|
@@ -954,10 +954,11 @@ export {
|
|
|
954
954
|
Re as S,
|
|
955
955
|
Ft as a,
|
|
956
956
|
ar as b,
|
|
957
|
-
|
|
957
|
+
pr as c,
|
|
958
958
|
sr as d,
|
|
959
|
-
|
|
959
|
+
lr as e,
|
|
960
|
+
se as f,
|
|
960
961
|
j as i,
|
|
961
|
-
|
|
962
|
+
cr as r,
|
|
962
963
|
Ze as s
|
|
963
964
|
};
|