@sprig-technologies/sprig-bundled 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/{index-C8J9g3RV.cjs → index-DUprOrkq.cjs} +2 -2
- package/dist/{index-BmLWLmjC.js → index-gGEvJlcK.js} +26 -23
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/view-DIc4kDKW.js +2259 -0
- package/dist/view-DpdkQw3G.cjs +12 -0
- package/package.json +1 -1
- package/dist/view-CNVa1mke.js +0 -2245
- package/dist/view-Qe_1uCI8.cjs +0 -12
|
@@ -6061,7 +6061,7 @@ const Bf = (e) => e._config && e._config.installationMethod ? e._config.installa
|
|
|
6061
6061
|
su = !0, iu = e;
|
|
6062
6062
|
};
|
|
6063
6063
|
function Ue(e = {}) {
|
|
6064
|
-
const t = { "Content-Type": "application/json", "userleap-platform": "web", "x-ul-sdk-version": "2.
|
|
6064
|
+
const t = { "Content-Type": "application/json", "userleap-platform": "web", "x-ul-sdk-version": "2.37.1", "x-ul-installation-method": Bf(e), "sprig-modules": Nf(), "x-ul-package-version": "2.37.1" };
|
|
6065
6065
|
if (e.envId && (t["x-ul-environment-id"] = e.envId), e.token && (t.Authorization = "Bearer " + e.token), e.userId && (t["x-ul-user-id"] = e.userId), e.visitorId && (t["x-ul-visitor-id"] = e.visitorId), e.partnerAnonymousId && (t["x-ul-anonymous-id"] = e.partnerAnonymousId), e.mobileHeadersJSON) {
|
|
6066
6066
|
const r = JSON.parse(e.mobileHeadersJSON);
|
|
6067
6067
|
Object.assign(t, r);
|
|
@@ -6108,7 +6108,7 @@ const Ha = async ({ shouldDropOnRateLimit: e, ...t }) => {
|
|
|
6108
6108
|
const c = r + 1;
|
|
6109
6109
|
return c > 5 || ou ? { ok: !1, reportError: !1, error: l } : (await bn(1e3 * Math.pow(2, r)), Xe(e, { ...i, retries: c }));
|
|
6110
6110
|
}
|
|
6111
|
-
}, $a = "ul-view-sdk-script", zf = ["ios", "android"], nt = "visitors", st = "environments";
|
|
6111
|
+
}, $a = "ul-view-sdk-script", zf = /* @__PURE__ */ new Set(["ios", "android"]), nt = "visitors", st = "environments";
|
|
6112
6112
|
async function Be(e, t) {
|
|
6113
6113
|
var i, a, o;
|
|
6114
6114
|
const { shouldDropOnRateLimit: r, ...n } = t;
|
|
@@ -6189,7 +6189,7 @@ const Qt = async (e, t, r) => {
|
|
|
6189
6189
|
}();
|
|
6190
6190
|
S.installationMethod === "web-npm" || S.installationMethod;
|
|
6191
6191
|
{
|
|
6192
|
-
const { default: C } = await import("./view-
|
|
6192
|
+
const { default: C } = await import("./view-DIc4kDKW.js");
|
|
6193
6193
|
C.configure(S), E && window.UserLeap.container && window.UserLeap.container && Object.assign(window.UserLeap.container.style, { display: "flex" });
|
|
6194
6194
|
}
|
|
6195
6195
|
U == null || U.appendChild(b);
|
|
@@ -6203,9 +6203,9 @@ function Yn(e) {
|
|
|
6203
6203
|
return pr(e) || t > 10 && t < 500;
|
|
6204
6204
|
}
|
|
6205
6205
|
function pr(e) {
|
|
6206
|
-
return zf.
|
|
6206
|
+
return zf.has(e["userleap-platform"]);
|
|
6207
6207
|
}
|
|
6208
|
-
const jf = (e) => e.some((t) => t.type === "videovoice"), eo = "ul-frame";
|
|
6208
|
+
const sy = (e) => e["userleap-platform"] === "ios", jf = (e) => e.some((t) => t.type === "videovoice"), eo = "ul-frame";
|
|
6209
6209
|
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);
|
|
6210
6210
|
const ms = "0px", au = (e, t, r) => {
|
|
6211
6211
|
window.UserLeap.container = document.createElement("div"), window.UserLeap.container.className = "ul-container" + (t ? " ul-container-feedback" : ""), e && (window.UserLeap.container.dataset.studyId = e.toString());
|
|
@@ -6340,7 +6340,7 @@ const du = (e) => {
|
|
|
6340
6340
|
}
|
|
6341
6341
|
}
|
|
6342
6342
|
return [i + 1, a, $f(o, e)];
|
|
6343
|
-
},
|
|
6343
|
+
}, iy = (e) => {
|
|
6344
6344
|
const t = e.querySelector(".ul-card__container");
|
|
6345
6345
|
t && (t.scrollTop = 0);
|
|
6346
6346
|
}, pu = () => X, xt = () => document.getElementById("sprig-feedback-container"), ui = () => document.getElementById("sprig-feedback-loading-animation"), hu = () => !!document.getElementById(eo);
|
|
@@ -6995,7 +6995,7 @@ function pg(e = {}) {
|
|
|
6995
6995
|
var m;
|
|
6996
6996
|
await Be(Ae("1", [st], "metrics"), { body: k, method: "POST", headers: { "x-ul-replay-enabled": `${!!((m = te.replay) != null && m.isReplayRecording())}` }, shouldDropOnRateLimit: !0 });
|
|
6997
6997
|
} }), !c) {
|
|
6998
|
-
const k = u.alwaysOnReplay ? { userAgent: window.navigator.userAgent, surveyId: u.alwaysOnReplay.surveyId, responseGroupUuid: u.alwaysOnReplay.responseGroupUuid, sdkVersion: "2.
|
|
6998
|
+
const k = u.alwaysOnReplay ? { userAgent: window.navigator.userAgent, surveyId: u.alwaysOnReplay.surveyId, responseGroupUuid: u.alwaysOnReplay.responseGroupUuid, sdkVersion: "2.37.1", maxDurationSeconds: u.alwaysOnReplay.maxDurationSeconds } : void 0;
|
|
6999
6999
|
await ((y = te.replay) == null ? void 0 : y.initializeReplay({ maxReplayDurationSeconds: u.maxReplayDurationSeconds, maxInflightRequests: window.UserLeap.maxInflightReplayRequests ?? 2, replaySettings: u.replaySettings, apiUrl: window.UserLeap._API_URL, alwaysOnConfig: k })), no = u.replaySettings;
|
|
7000
7000
|
}
|
|
7001
7001
|
ug(u), await cg(u), window.UserLeap._queue.unpause(), (h = window.SprigLoggerCallback) == null || h.call(window, "SdkReady"), z.emit(B.SDKReady, { mobileMetricsReportingEnabled: !!u.mobileMetricsReportingEnabled, metricsReportingInterval: u.metricsReportingIntervalSeconds || 0, metricsThresholds: u.metricThresholds || [], maxMobileReplayDurationSeconds: u.maxMobileReplayDurationSeconds, mobileReplaySettings: u.mobileReplaySettings }), z.emit(B.VisitorIDUpdated, { visitorId: window.UserLeap.visitorId }), z.on(B.VisitorIDUpdated, () => {
|
|
@@ -7080,7 +7080,7 @@ class tl {
|
|
|
7080
7080
|
window.Sprig("resumeReplayRecording");
|
|
7081
7081
|
}
|
|
7082
7082
|
}
|
|
7083
|
-
const
|
|
7083
|
+
const oy = { configure: (e) => {
|
|
7084
7084
|
if (!e.envId && !e.environmentId) throw new Error("Initialization Error: Sprig configure requires an environmentId");
|
|
7085
7085
|
if (e.envId || (e.envId = e.environmentId ?? ""), e.installationMethod = "web-npm-bundled", window.Sprig) return window.Sprig;
|
|
7086
7086
|
window.Sprig = function() {
|
|
@@ -7468,14 +7468,16 @@ const Q = new class {
|
|
|
7468
7468
|
await r.done;
|
|
7469
7469
|
}
|
|
7470
7470
|
}(), Ke = [];
|
|
7471
|
-
let wr, ju,
|
|
7472
|
-
const
|
|
7473
|
-
|
|
7471
|
+
let wr, ju, mt = [], Ut = !1, At = 0, pn = !1, Wu = !1;
|
|
7472
|
+
const oo = [];
|
|
7473
|
+
let Un, Vu, hn, Gu, Ss = !1;
|
|
7474
|
+
const Tt = () => pn && !Ut && Date.now() <= Un, Tg = ({ apiUrl: e, config: t, triggerSnapshot: r, forceInit: n = !1 }) => {
|
|
7475
|
+
pn && !n || (ce.isStorageAvailable ? (mt = [], oo.splice(0), Ke.splice(0), At = 0, hn = r, ju = e, wr = { responseGroupUuid: t.responseGroupUuid, surveyId: t.surveyId, userAgent: t.userAgent, sdkVersion: t.sdkVersion }, Vu = t.maxDurationSeconds, Ng(), pn || (Gu = window.setInterval(_g, 500)), pn = !0) : Ut = !0);
|
|
7474
7476
|
}, Dg = [He.Drag, He.Input, He.MediaInteraction, He.MouseInteraction, He.MouseMove, He.Scroll, He.Selection, He.TouchMove], Pg = (e) => e.type === it.Custom || e.type === it.IncrementalSnapshot && Dg.includes(e.data.source), ao = (e) => e.some(Pg), _g = async () => {
|
|
7475
|
-
if (!Tt()) return void window.clearInterval(
|
|
7477
|
+
if (!Tt()) return void window.clearInterval(Gu);
|
|
7476
7478
|
if (Hu(), !ao(Ke)) return;
|
|
7477
7479
|
const e = Ke[0].timestamp;
|
|
7478
|
-
Date.now() - e > 35e3 && (
|
|
7480
|
+
Date.now() - e > 35e3 && (hn == null || hn());
|
|
7479
7481
|
}, Hu = async () => {
|
|
7480
7482
|
if (mt.length || Ss) return;
|
|
7481
7483
|
Ss = !0;
|
|
@@ -7488,7 +7490,7 @@ const Tt = () => hn && !Ut && Date.now() <= Un, Tg = ({ apiUrl: e, config: t, tr
|
|
|
7488
7490
|
_.info("Read stored session state", e);
|
|
7489
7491
|
const t = JSON.parse(e);
|
|
7490
7492
|
Ut = t.disabled, wr = t.metadata, mt = t.uploadUrls, At = t.currentIndex, Un = t.expirationTimestamp, t.pendingEventTimestamp && (_.info(`Uploading with pending timestamp: ${t.pendingEventTimestamp}`), Fg(t.pendingEventTimestamp));
|
|
7491
|
-
} else Un = 1e3 *
|
|
7493
|
+
} else Un = 1e3 * Vu + Date.now();
|
|
7492
7494
|
}, Fg = async (e) => {
|
|
7493
7495
|
const t = Date.now(), r = (await Q.getEventsBetween(e, t)).map((s) => JSON.parse(s.event));
|
|
7494
7496
|
if (!ao(r)) return;
|
|
@@ -7529,7 +7531,7 @@ const Tt = () => hn && !Ut && Date.now() <= Un, Tg = ({ apiUrl: e, config: t, tr
|
|
|
7529
7531
|
const t = e.length ? e[e.length - 1].timestamp : Date.now(), r = At, n = ((i = (s = window.UserLeap) == null ? void 0 : s.config) == null ? void 0 : i.customMetadata) ?? ((a = window.__cfg) == null ? void 0 : a.customMetadata);
|
|
7530
7532
|
At++, e.push({ timestamp: t, type: it.Custom, data: { tag: "Sprig_Meta", payload: { ...wr, index: r, visitorId: window.UserLeap.visitorId ?? "", timestamp: t, customMetadata: n } } });
|
|
7531
7533
|
}, zg = (e, t) => {
|
|
7532
|
-
Tt() && !
|
|
7534
|
+
Tt() && !Wu && (e || Ke.length) && (e && Ke.length && (async () => {
|
|
7533
7535
|
const r = Ke.splice(0);
|
|
7534
7536
|
if (!ao(r)) return;
|
|
7535
7537
|
_.info("Capturing always-on event array to upload"), Ju(r);
|
|
@@ -7538,7 +7540,7 @@ const Tt = () => hn && !Ut && Date.now() <= Un, Tg = ({ apiUrl: e, config: t, tr
|
|
|
7538
7540
|
})(), Ke.push(t));
|
|
7539
7541
|
};
|
|
7540
7542
|
window.addEventListener("beforeunload", async () => {
|
|
7541
|
-
|
|
7543
|
+
Wu = !0, Tt() && (_.info("Always On handle page unload"), (() => {
|
|
7542
7544
|
let e;
|
|
7543
7545
|
Ke.length && (e = Ke[0].timestamp);
|
|
7544
7546
|
const t = { disabled: Ut, metadata: wr, uploadUrls: mt, currentIndex: At, pendingEventTimestamp: e, expirationTimestamp: Un };
|
|
@@ -7765,10 +7767,10 @@ const Oi = async (e = !1) => {
|
|
|
7765
7767
|
_.debug("ReplayInit"), await ke(async () => {
|
|
7766
7768
|
var l;
|
|
7767
7769
|
r != null && r.minDuration && (Xu = r.minDuration), r != null && r.batchDuration && (Ei = r.batchDuration), l = t, Au.setLimit(l), $g(), Vg(o + 35, 1800, o + 35), Gg();
|
|
7768
|
-
const c = window.UserLeap.replayLibraryURL ?? "https://cdn.sprig.com/dependencies/record
|
|
7770
|
+
const c = window.UserLeap.replayLibraryURL ?? "https://cdn.sprig.com/dependencies/record.min.js", u = window.rrwebRecord;
|
|
7769
7771
|
if (!u) return _.error("RecordScriptFailed");
|
|
7770
7772
|
let d = !0, p = 0;
|
|
7771
|
-
const f = { checkoutEveryNms: 3e4, sampling: { input: "last", scroll: 250, media: 800 }, ...r };
|
|
7773
|
+
const f = { checkoutEveryNms: 3e4, sampling: { input: "last", scroll: 250, media: 800 }, ...r, mutationQueueEnabled: r == null ? void 0 : r.enableMutationQueue };
|
|
7772
7774
|
var y, h;
|
|
7773
7775
|
de.stopRecording = u({ emit: (k, m) => {
|
|
7774
7776
|
if (k.type === it.Custom && (xi = Date.now()), Ve() || Mn()) return;
|
|
@@ -7812,11 +7814,12 @@ export {
|
|
|
7812
7814
|
ny as g,
|
|
7813
7815
|
Qg as h,
|
|
7814
7816
|
$e as i,
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7817
|
+
sy as j,
|
|
7818
|
+
ry as k,
|
|
7819
|
+
Sn as l,
|
|
7820
|
+
tl as m,
|
|
7821
|
+
oy as n,
|
|
7822
|
+
iy as r,
|
|
7820
7823
|
ru as s,
|
|
7821
7824
|
Mt as v
|
|
7822
7825
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DUprOrkq.cjs");exports.DismissReason=e.DismissReason,exports.SprigAPI=e.SprigAPI,exports.SprigEvent=e.SprigEvent,exports.sprig=e.sprig;
|
package/dist/index.d.ts
CHANGED
|
@@ -1248,8 +1248,16 @@ interface CommonMultipleChoiceProps {
|
|
|
1248
1248
|
dropdownMultiselectedText?: string;
|
|
1249
1249
|
randomize: Randomize;
|
|
1250
1250
|
required: boolean;
|
|
1251
|
+
minSelect?: number;
|
|
1252
|
+
maxSelect?: number;
|
|
1253
|
+
maxSelectMode?: MaxSelectModes;
|
|
1251
1254
|
};
|
|
1252
1255
|
}
|
|
1256
|
+
declare enum MaxSelectModes {
|
|
1257
|
+
Unlimited = "Unlimited",
|
|
1258
|
+
Maximum = "Maximum",
|
|
1259
|
+
Range = "Range"
|
|
1260
|
+
}
|
|
1253
1261
|
interface MultiChoiceCard<C extends Comparator = DefaultComparator> extends BaseCard {
|
|
1254
1262
|
props: CommonMultipleChoiceProps & {
|
|
1255
1263
|
routingOptions: RoutingOptions<C>;
|
package/dist/index.js
CHANGED