@sprig-technologies/sprig-browser 2.41.1 → 2.41.2
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/{conversational-ui-JTauhs_T.js → conversational-ui-BT1EO37i.js} +103 -103
- package/dist/conversational-ui-Bb4m3h6R.cjs +1 -0
- package/dist/{core-DE_-33ff.js → core-BAftYDJ4.js} +259 -259
- package/dist/core-uBBFpb_3.cjs +12 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +1 -0
- package/dist/core.js +2 -2
- package/dist/{getAttributedUrl-DBTn-NUH.js → getAttributedUrl-D8A6-Xpc.js} +3 -3
- package/dist/{getAttributedUrl-BiWFH80z.cjs → getAttributedUrl-r24rJENP.cjs} +1 -1
- package/dist/index-CsOCzF6t.cjs +1 -0
- package/dist/{index-Dx9Ltdmj.js → index-DPlGJqsd.js} +92 -92
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/{metricsReporter-BkgMLm2f.cjs → metricsReporter-BAPwG4KR.cjs} +1 -1
- package/dist/{metricsReporter-CJzT7qY-.js → metricsReporter-CJIq-5XV.js} +1 -1
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +1 -1
- package/dist/{view-Bvmj0wxW.js → view-BsxrS7-j.js} +94 -93
- package/dist/view-b7QfeIQR.cjs +1 -0
- package/package.json +1 -1
- package/dist/conversational-ui-CXaEWDJN.cjs +0 -1
- package/dist/core-C7-zlHSe.cjs +0 -12
- package/dist/index-4EWB-gdl.cjs +0 -1
- package/dist/view-DejEVxKg.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as O, u as e, h as V, c as
|
|
2
|
-
import { v as Je, R as F, B as W, M as J, Q as te, O as Ce, a as re, b as pe, S as et, L as tt, u as rt, H as de, c as Se, g as nt, P as at, p as st, d as it, s as ot } from "./getAttributedUrl-
|
|
3
|
-
import { a as be, D as Te, A as _e, g as lt } from "./core-
|
|
4
|
-
import { t as Ue } from "./metricsReporter-
|
|
1
|
+
import { a as O, u as e, h as V, c as R, b as j, e as X, f as xe, p as ne, F as ce, _ as ee, T as le, A as Fe, g as he, i as Ze, j as Ye, k as De, l as ze, m as Ke, n as Xe, w as Me, o as We } from "./view-BsxrS7-j.js";
|
|
2
|
+
import { v as Je, R as F, B as W, M as J, Q as te, O as Ce, a as re, b as pe, S as et, L as tt, u as rt, H as de, c as Se, g as nt, P as at, p as st, d as it, s as ot } from "./getAttributedUrl-D8A6-Xpc.js";
|
|
3
|
+
import { a as be, D as Te, A as _e, g as lt } from "./core-BAftYDJ4.js";
|
|
4
|
+
import { t as Ue } from "./metricsReporter-CJIq-5XV.js";
|
|
5
5
|
const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
6
6
|
const n = `ul-card-video__question_player-q${r}`, { apiURL: s, viewDocument: i } = O((l) => ({ apiURL: l.apiURL, viewDocument: l.viewDocument }));
|
|
7
7
|
return e("div", { id: n, ref: (l) => {
|
|
@@ -11,24 +11,24 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
11
11
|
}
|
|
12
12
|
} });
|
|
13
13
|
}, se = ({ isDisabled: t, onClick: a, children: r }) => e(W, { className: "ul-card__button-checkmark", disabled: t, onClick: a, type: "button", children: [e("svg", { fill: "none", height: "10", viewBox: "0 0 13 10", width: "13", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M11.5 1.5L4.5 8.5L1 5", stroke: "#ffffff", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }), r || "Ok"] }), dt = ({ className: t, next: a, properties: r, questionId: n, type: s }) => {
|
|
14
|
-
const { useMobileStyling: i, border: l } = O((_) => ({ useMobileStyling: _.useMobileStyling, border: _.border })), [u, c] = V(!1), [v, y] = V(""), [o, m] = V(!1), k = r == null ? void 0 : r.collectName, f = (r == null ? void 0 : r.nameLabelText) || "Full Name", h = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", S = (r == null ? void 0 : r.submitButtonText) || "Submit", N = !!v.trim(),
|
|
14
|
+
const { useMobileStyling: i, border: l } = O((_) => ({ useMobileStyling: _.useMobileStyling, border: _.border })), [u, c] = V(!1), [v, y] = V(""), [o, m] = V(!1), k = r == null ? void 0 : r.collectName, f = (r == null ? void 0 : r.nameLabelText) || "Full Name", h = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", S = (r == null ? void 0 : r.submitButtonText) || "Submit", N = !!v.trim(), P = u && (!k || N), E = (_, G = !1) => {
|
|
15
15
|
_.preventDefault(), _.stopPropagation();
|
|
16
16
|
let A = null;
|
|
17
17
|
if (!G) {
|
|
18
|
-
if (!
|
|
18
|
+
if (!P) return void m(!0);
|
|
19
19
|
A = { submitted: !0 }, k && (A.name = v);
|
|
20
20
|
}
|
|
21
|
-
a({ value: A, questionId: n, type: s }, !!G ||
|
|
21
|
+
a({ value: A, questionId: n, type: s }, !!G || P);
|
|
22
22
|
};
|
|
23
|
-
return e("div", { className:
|
|
23
|
+
return e("div", { className: R(t, "ul-card__consent-legal", "fade-in-transition"), children: e(J, { embeddedType: "pdf", properties: r, children: e(te, { children: [e("div", { className: "sprig-stretch", children: [e(Ce, { allowTextEntry: !1, border: l, error: o && !u, id: "consent", isRadio: !1, isSelected: u, label: h, onUserInputChanged: ({ selected: _ }) => {
|
|
24
24
|
_ !== u && c(!u);
|
|
25
|
-
}, useMobileStyling: i }), k && e("input", { "aria-label": f, "aria-placeholder": f, className:
|
|
25
|
+
}, useMobileStyling: i }), k && e("input", { "aria-label": f, "aria-placeholder": f, className: R(j("ul-consent-legal__name-input", i)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: (_) => {
|
|
26
26
|
_.currentTarget.style.borderColor = o && !N ? be : Te;
|
|
27
27
|
}, onFocus: (_) => {
|
|
28
28
|
_.currentTarget.style.borderColor = o && !N ? be : l;
|
|
29
29
|
}, onInput: (_) => {
|
|
30
30
|
_.preventDefault(), _.stopPropagation(), y(_.currentTarget.value);
|
|
31
|
-
}, placeholder: f, style: o && !N ? { borderColor: be } : {}, tabIndex: 0, value: v })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(se, { isDisabled: !
|
|
31
|
+
}, placeholder: f, style: o && !N ? { borderColor: be } : {}, tabIndex: 0, value: v })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(se, { isDisabled: !P, onClick: (_) => E(new SubmitEvent(_.type)), children: X({ buttonText: S }) }), r.required === !1 && e("button", { className: "ul-card-skip__button", onClick: (_) => E(new SubmitEvent(_.type), !0), children: xe(r) })] })] }) }) }, n);
|
|
32
32
|
}, ut = () => {
|
|
33
33
|
const { destroy: t, forceBrandedLogo: a } = O((r) => ({ destroy: r.destroy, forceBrandedLogo: r.forceBrandedLogo }));
|
|
34
34
|
return ne(() => {
|
|
@@ -37,13 +37,13 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
37
37
|
}, a ? 4e3 : 2e3);
|
|
38
38
|
}, [t, a]), e("div", { className: "end-of-survey-text", children: "End of survey" });
|
|
39
39
|
}, pt = ({ activeValue: t, border: a, icon: r, enableCspTrustedTypes: n, isPressed: s, range: i, scaleLabelType: l, selectedValue: u, setSelectedValue: c, setActiveValue: v, setIsPressed: y, useMobileStyling: o, value: m, viewDocument: k }) => {
|
|
40
|
-
const f = `option-${m}`, h = l === "number", S = l === "star", N = l === "smiley",
|
|
40
|
+
const f = `option-${m}`, h = l === "number", S = l === "star", N = l === "smiley", P = h && m === t || m === u, [E, _] = (() => {
|
|
41
41
|
const d = S && u !== null && m <= u;
|
|
42
42
|
return S && m <= t || N && m === t || d || m === t || m === u ? [a, s || d || m === u ? 1 : 0.3] : ["", 1];
|
|
43
43
|
})(), G = ce(() => {
|
|
44
|
-
const d = { borderColor:
|
|
44
|
+
const d = { borderColor: P ? E : "", fillOpacity: P ? "" : _, zIndex: P ? 3 : "auto", color: u === m ? "#fff" : "" };
|
|
45
45
|
return h ? { ...d, backgroundColor: u === m ? E : "" } : { ...d, color: S || N || u === m ? E : "" };
|
|
46
|
-
}, [
|
|
46
|
+
}, [P, E, _, u, m, h, S, N]), A = ce(() => lt((({ icon: d, scaleLabelType: p, value: x, selectedValue: g }) => {
|
|
47
47
|
if (p === "smiley" && x === g) {
|
|
48
48
|
let b = 0;
|
|
49
49
|
return d.replace(/black/g, () => ++b == 1 ? "black" : "white");
|
|
@@ -53,11 +53,11 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
53
53
|
return e("button", { "aria-label": h ? void 0 : String(m), className: (() => {
|
|
54
54
|
switch (l) {
|
|
55
55
|
case "star":
|
|
56
|
-
return
|
|
56
|
+
return R(j("likert-star", o), j(`likert-star-${m}`, o));
|
|
57
57
|
case "smiley":
|
|
58
|
-
return
|
|
58
|
+
return R(j("likert-smiley", o), j(`likert-smiley-${m}`, o));
|
|
59
59
|
default:
|
|
60
|
-
return m === i ?
|
|
60
|
+
return m === i ? R(j("likert-number", o), j(`likert-number-${m}`, o), j("likert-last-option", o)) : R(j("likert-number", o), j(`likert-number-${m}`, o));
|
|
61
61
|
}
|
|
62
62
|
})(), dangerouslySetInnerHTML: { __html: A }, id: f, onClick: (d) => {
|
|
63
63
|
d.preventDefault(), d.stopPropagation(), c(m);
|
|
@@ -70,10 +70,10 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
70
70
|
}, style: G, tabIndex: 0 });
|
|
71
71
|
}, mt = ({ className: t, labels: a, next: r, properties: n, questionId: s, type: i }) => {
|
|
72
72
|
const { border: l, useMobileStyling: u, viewDocument: c, enableCspTrustedTypes: v } = O((p) => ({ border: p.border, useMobileStyling: p.useMobileStyling, viewDocument: p.viewDocument, enableCspTrustedTypes: p.enableCspTrustedTypes })), [y, o] = V(-1), [m, k] = V(!1), [f, h] = V(null), S = a && a.left, N = a && a.right;
|
|
73
|
-
let
|
|
73
|
+
let P;
|
|
74
74
|
const { range: E, scaleLabelType: _, ratingIcons: G } = n;
|
|
75
|
-
E && (
|
|
76
|
-
const A =
|
|
75
|
+
E && (P = Number(E));
|
|
76
|
+
const A = P || 5, d = (p) => {
|
|
77
77
|
var x, g;
|
|
78
78
|
switch (_) {
|
|
79
79
|
case "star":
|
|
@@ -84,7 +84,7 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
84
84
|
return String(p + 1);
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
return e("form", { className:
|
|
87
|
+
return e("form", { className: R(t, "ul-card--likert", "fade-in-transition"), children: e(J, { properties: n, children: [e(re, { children: [e("div", { "aria-label": `Rating (1 - ${A})`, className: "ul-card--likert__numbers", role: "radiogroup", children: [...Array(A)].map((p, x) => {
|
|
88
88
|
const g = x + 1;
|
|
89
89
|
return e(pt, { activeValue: y, border: l, enableCspTrustedTypes: v, icon: d(x), isPressed: m, range: A, scaleLabelType: _, selectedValue: f, setActiveValue: o, setIsPressed: k, setSelectedValue: h, useMobileStyling: u, value: g, viewDocument: c }, x);
|
|
90
90
|
}) }), e("div", { className: "ul-card--likert__labels", children: [e("span", { children: S }), e("span", { children: N })] })] }), e(te, { children: e(se, { isDisabled: f === null && n.required, onClick: () => r({ value: f, questionId: s, type: i }, !0), children: X(n) }) })] }) }, s);
|
|
@@ -107,7 +107,7 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
107
107
|
const u = n.matrixColumn, c = n.required, v = (f) => {
|
|
108
108
|
f.preventDefault(), f.stopPropagation(), a({ value: o, questionId: s, type: i }, !0), l && l();
|
|
109
109
|
}, y = r.reduce((f, h) => (f[h.id] = null, f), {}), [o, m] = V(y);
|
|
110
|
-
return e("form", { className:
|
|
110
|
+
return e("form", { className: R(t, "ul-card__matrix", "fade-in-transition"), id: "text-form", onSubmit: v, children: e(J, { properties: n, children: [e(re, { children: e(ht, { columns: u, onSelect: (f, h) => {
|
|
111
111
|
m((S) => ({ ...S, [f]: h }));
|
|
112
112
|
}, options: r, selectedOptions: o }) }), e(te, { children: e(se, { isDisabled: (k = o, c && Object.values(k).every((f) => f == null)), onClick: () => v(new SubmitEvent("submit")), children: X(n) }) })] }) }, s);
|
|
113
113
|
var k;
|
|
@@ -117,21 +117,21 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
117
117
|
return (b = g.optionProperties) == null ? void 0 : b.noneOfTheAbove;
|
|
118
118
|
}), S = (g) => Object.entries(g).some(([b, I]) => {
|
|
119
119
|
var Q;
|
|
120
|
-
const
|
|
121
|
-
return ((Q =
|
|
122
|
-
}), N = (g) => Object.values(g).filter((b) => b.isSelected).length,
|
|
123
|
-
const { minSelect: I = 0, maxSelect:
|
|
124
|
-
switch (
|
|
120
|
+
const w = r.find((z) => `${z.id}` === b), L = I.userText === void 0 || I.userText.trim() === "";
|
|
121
|
+
return ((Q = w == null ? void 0 : w.optionProperties) == null ? void 0 : Q.allowsTextEntry) && L && I.isSelected;
|
|
122
|
+
}), N = (g) => Object.values(g).filter((b) => b.isSelected).length, P = n.minSelect && n.minSelect > 0 && n.maxSelectMode === pe.Range && N(o) < n.minSelect && (f || N(o) > 0), E = (g) => S(g) || f && !N(g) || !((b) => {
|
|
123
|
+
const { minSelect: I = 0, maxSelect: w = 1 / 0, maxSelectMode: L } = n, Q = N(b);
|
|
124
|
+
switch (L) {
|
|
125
125
|
case pe.Maximum:
|
|
126
|
-
return Q <=
|
|
126
|
+
return Q <= w;
|
|
127
127
|
case pe.Range:
|
|
128
128
|
return Q === 0 || Q >= I;
|
|
129
129
|
default:
|
|
130
130
|
return !0;
|
|
131
131
|
}
|
|
132
132
|
})(g), _ = Object.entries(o).some(([g, b]) => {
|
|
133
|
-
var I,
|
|
134
|
-
return b.isSelected && ((
|
|
133
|
+
var I, w;
|
|
134
|
+
return b.isSelected && ((w = (I = r.find((L) => `${L.id}` === g)) == null ? void 0 : I.optionProperties) == null ? void 0 : w.allowsTextEntry);
|
|
135
135
|
}), G = l && (!k || _), A = (g) => {
|
|
136
136
|
x(g.id, g.selected, g.userText, g.noneOfTheAbove);
|
|
137
137
|
}, d = (g) => {
|
|
@@ -139,22 +139,22 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
139
139
|
return (n == null ? void 0 : n.maxSelectMode) !== pe.Unlimited && N(o) === (n == null ? void 0 : n.maxSelect) && !((b = o[g]) != null && b.isSelected);
|
|
140
140
|
}, p = () => {
|
|
141
141
|
a(o, !0), u && u();
|
|
142
|
-
}, x = (g, b, I,
|
|
143
|
-
const
|
|
144
|
-
if ((k ||
|
|
145
|
-
else h && !
|
|
146
|
-
|
|
142
|
+
}, x = (g, b, I, w) => {
|
|
143
|
+
const L = Object.assign({}, o);
|
|
144
|
+
if ((k || w) && b) for (const Q of Object.values(L)) Q.isSelected = !1, delete Q.userText;
|
|
145
|
+
else h && !w && o[h.id].isSelected && (L[h.id].isSelected = !1);
|
|
146
|
+
L[g] = { isSelected: b, userText: I }, m(L);
|
|
147
147
|
};
|
|
148
|
-
return e("form", { className:
|
|
148
|
+
return e("form", { className: R(t, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: p, children: e(J, { properties: n, children: [e(re, { children: [n.isDropdown ? e(et, { disabledOptions: r.filter((g) => d(g.id)), dropdownFooter: P ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [N(o), "/", n.minSelect] }) : void 0, isMultiSelect: !k, multiselectText: n.dropdownMultiselectedText ?? "choices selected", onChange: (g) => {
|
|
149
149
|
const b = { ...o };
|
|
150
150
|
for (const I of r) g.includes(I) ? b[I.id].isSelected = !0 : b[I.id].isSelected = !1;
|
|
151
151
|
m(b);
|
|
152
|
-
}, options: r, placeholderText: n.dropdownPlaceholderText ?? (k ? "Select choice" : "Select choice(s)"), value: r.filter((g) => o[g.id].isSelected) }) : e("div", { className:
|
|
152
|
+
}, options: r, placeholderText: n.dropdownPlaceholderText ?? (k ? "Select choice" : "Select choice(s)"), value: r.filter((g) => o[g.id].isSelected) }) : e("div", { className: R(j("ul-card__choices", v)), role: k ? "radiogroup" : "group", children: [r.map(({ id: g, label: b, value: I, optionProperties: w }) => {
|
|
153
153
|
var H, Z;
|
|
154
|
-
const
|
|
155
|
-
return e(Ce, { allowTextEntry: Q, border: c, disabled: d(
|
|
154
|
+
const L = `${g}`, { allowsTextEntry: Q, noneOfTheAbove: z } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...w };
|
|
155
|
+
return e(Ce, { allowTextEntry: Q, border: c, disabled: d(L), error: ($ = o, S($)), id: L, isRadio: k, isSelected: !!((H = o[L]) != null && H.isSelected), label: b, noneOfTheAbove: z, onUserInputChanged: A, promptText: (w == null ? void 0 : w.otherOptionPlaceholder) || "Please specify", text: (Z = o[g]) == null ? void 0 : Z.userText, useMobileStyling: v, value: I }, L);
|
|
156
156
|
var $;
|
|
157
|
-
}), !!
|
|
157
|
+
}), !!P && e("div", { className: "ul-card__min-select-counter", children: [N(o), "/", n.minSelect] })] }), G && e(tt, { handleSubmit: p, isSubmitDisabled: E(o) })] }), e(te, { children: e(se, { isDisabled: E(o), onClick: p, children: X(n) }) })] }) }, s);
|
|
158
158
|
}, vt = (t) => {
|
|
159
159
|
const { questionId: a, type: r, next: n, options: s } = t;
|
|
160
160
|
return e(Ee, { ...t, onSubmit: (i, l) => {
|
|
@@ -173,12 +173,12 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
173
173
|
} });
|
|
174
174
|
}, yt = ({ className: t, labels: a, properties: r, next: n, questionId: s, type: i }) => {
|
|
175
175
|
const [l, u] = V(null), { border: c, useMobileStyling: v, viewDocument: y } = O((k) => ({ border: k.border, useMobileStyling: k.useMobileStyling, viewDocument: k.viewDocument })), o = a && a.left, m = a && a.right;
|
|
176
|
-
return e("form", { className:
|
|
176
|
+
return e("form", { className: R(t, "ul-card--nps", "fade-in-transition"), children: e(J, { properties: r, children: [e(re, { children: [e("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((k, f) => e("button", { className: R(j("nps-number", v), j(`nps-number-${f}`, v)), id: `option-${f}`, onClick: (h) => {
|
|
177
177
|
h.preventDefault(), h.stopPropagation(), u(f);
|
|
178
178
|
}, onKeyDown: (h) => {
|
|
179
|
-
var N,
|
|
179
|
+
var N, P;
|
|
180
180
|
const S = y.querySelectorAll("button.nps-number");
|
|
181
|
-
h.key === "ArrowRight" ? (N = S[f + 1]) == null || N.focus() : h.key === "ArrowLeft" ? (
|
|
181
|
+
h.key === "ArrowRight" ? (N = S[f + 1]) == null || N.focus() : h.key === "ArrowLeft" ? (P = S[f - 1]) == null || P.focus() : h.key !== "Enter" && h.key !== " " || (h.preventDefault(), h.stopPropagation(), u(f));
|
|
182
182
|
}, onPointerDown: (h) => {
|
|
183
183
|
h.currentTarget.style.zIndex = "2", h.currentTarget.style.borderColor = c;
|
|
184
184
|
}, onPointerLeave: (h) => {
|
|
@@ -186,7 +186,7 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
186
186
|
}, style: l === f ? { backgroundColor: c, color: "#fff" } : void 0, tabIndex: 0, children: f }, f)) }), e("div", { className: "ul-card--nps__labels", children: [e("span", { children: o }), e("span", { children: m })] })] }), e(te, { children: e(se, { isDisabled: l === null && r.required, onClick: () => n({ value: l, questionId: s, type: i }, !0), children: X(r) }) })] }) }, s);
|
|
187
187
|
}, ft = ({ className: t, next: a, properties: r, questionId: n, type: s, onSubmitButtonClick: i }) => {
|
|
188
188
|
const { border: l, useMobileStyling: u, update: c } = O((S) => ({ border: S.border, useMobileStyling: S.useMobileStyling, update: S.update })), [v, y] = V(""), o = ee(null), m = v.trim(), k = r.required === !0 && !m, f = rt(o, () => c()), h = r && r.openTextPlaceholder ? r.openTextPlaceholder : "";
|
|
189
|
-
return e("form", { className:
|
|
189
|
+
return e("form", { className: R(t, "ul-card-text", "fade-in-transition"), id: "text-form", children: e(J, { properties: r, children: e("div", { className: "ul-card-text", children: [e(re, { children: [e("div", { className: "ul-card-text__container", children: e("textarea", { "aria-describedby": "ul-caption", "aria-labelledby": "ul-question", "aria-multiline": "true", "aria-placeholder": h, className: R(j("ul-card-text__input", u)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: (S) => {
|
|
190
190
|
S.currentTarget.style.borderColor = Te;
|
|
191
191
|
}, onChange: (S) => {
|
|
192
192
|
const { value: N } = S.currentTarget;
|
|
@@ -199,12 +199,12 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
199
199
|
a({ value: v, questionId: n, type: s }, N), i && i();
|
|
200
200
|
}, children: X(r) }) })] }) }) }, n);
|
|
201
201
|
}, kt = ({ className: t, labels: a, next: r, properties: n, questionId: s, type: i, onSubmitButtonClick: l, options: u }) => {
|
|
202
|
-
const c = ee(null), v = ee(0), y = ee(0), o = ee(null), m = ee(!1), k = ee([]), [f, h] = V(() => (n == null ? void 0 : n.required) === !0), [S, N] = V(() => u.map((C) => ({ ...C, rank: null }))),
|
|
203
|
-
N((
|
|
204
|
-
const T = parseInt(
|
|
202
|
+
const c = ee(null), v = ee(0), y = ee(0), o = ee(null), m = ee(!1), k = ee([]), [f, h] = V(() => (n == null ? void 0 : n.required) === !0), [S, N] = V(() => u.map((C) => ({ ...C, rank: null }))), P = ce(() => Array.from({ length: u.length }, (C, D) => D + 1), [u.length]), { useMobileStyling: E, isPreview: _, headers: G } = O((C) => ({ useMobileStyling: C.useMobileStyling, isPreview: C.isPreview, headers: C.headers })), A = (G == null ? void 0 : G["userleap-platform"]) === "android", d = E && !_ && !A, p = !d && !A, x = (C, D) => {
|
|
203
|
+
N((q) => {
|
|
204
|
+
const T = parseInt(D), U = q.map((M) => ({ ...M }));
|
|
205
205
|
U.some((M) => M.rank == null) && U.forEach((M, ie) => M.rank = ie + 1);
|
|
206
206
|
const Y = U.findIndex((M) => M.id === C);
|
|
207
|
-
if (Y === -1) return
|
|
207
|
+
if (Y === -1) return q;
|
|
208
208
|
const B = U[Y].rank;
|
|
209
209
|
return T < B ? U.forEach((M) => {
|
|
210
210
|
M.id !== C && M.rank >= T && M.rank < B && (M.rank = M.rank + 1);
|
|
@@ -212,49 +212,49 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
212
212
|
M.id !== C && M.rank > B && M.rank <= T && (M.rank = M.rank - 1);
|
|
213
213
|
}), U[Y].rank = T, U.sort((M, ie) => M.rank - ie.rank), z(), U;
|
|
214
214
|
});
|
|
215
|
-
}, g = (C,
|
|
216
|
-
for (let
|
|
217
|
-
const T = k.current[
|
|
215
|
+
}, g = (C, D) => {
|
|
216
|
+
for (let q = 0; q < k.current.length; q++) {
|
|
217
|
+
const T = k.current[q];
|
|
218
218
|
if (!T || T === o.current) continue;
|
|
219
219
|
const U = T.getBoundingClientRect();
|
|
220
|
-
if (C >= U.left && C <= U.right &&
|
|
220
|
+
if (C >= U.left && C <= U.right && D >= U.top && D <= U.bottom) return { element: T, index: q };
|
|
221
221
|
}
|
|
222
222
|
return null;
|
|
223
|
-
}, b = (C) => (
|
|
223
|
+
}, b = (C) => (D) => {
|
|
224
224
|
if (!d) return;
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
v.current =
|
|
228
|
-
const T =
|
|
225
|
+
D.preventDefault(), D.stopPropagation(), m.current = !0, c.current = C;
|
|
226
|
+
const q = D.touches[0];
|
|
227
|
+
v.current = q.clientY, y.current = q.clientY;
|
|
228
|
+
const T = D.currentTarget.closest(".ul-card-rank__option");
|
|
229
229
|
T && (o.current = T, T.classList.add("is-dragging"));
|
|
230
230
|
}, I = (C) => {
|
|
231
231
|
if (!d || !m.current || c.current === null) return;
|
|
232
232
|
C.preventDefault(), C.stopPropagation();
|
|
233
|
-
const
|
|
234
|
-
y.current =
|
|
235
|
-
const
|
|
236
|
-
o.current && (o.current.style.transform = `translateY(${
|
|
233
|
+
const D = C.touches[0];
|
|
234
|
+
y.current = D.clientY;
|
|
235
|
+
const q = y.current - v.current;
|
|
236
|
+
o.current && (o.current.style.transform = `translateY(${q}px)`, o.current.style.zIndex = "1000"), k.current.forEach((U) => {
|
|
237
237
|
U && U !== o.current && U.classList.remove("is-drop-target");
|
|
238
238
|
});
|
|
239
|
-
const T = g(
|
|
239
|
+
const T = g(D.clientX, D.clientY);
|
|
240
240
|
T && T.element.classList.add("is-drop-target");
|
|
241
|
-
},
|
|
241
|
+
}, w = (C) => {
|
|
242
242
|
if (!d || !m.current || c.current === null) return;
|
|
243
243
|
C.preventDefault(), C.stopPropagation();
|
|
244
|
-
const
|
|
244
|
+
const D = C.changedTouches[0], q = g(D.clientX, D.clientY);
|
|
245
245
|
o.current && (o.current.style.transform = "", o.current.style.zIndex = "", o.current.classList.remove("is-dragging")), k.current.forEach((T) => {
|
|
246
246
|
T && T.classList.remove("is-drop-target");
|
|
247
|
-
}),
|
|
248
|
-
},
|
|
249
|
-
N((
|
|
250
|
-
const T =
|
|
251
|
-
return T.splice(
|
|
247
|
+
}), q && q.index !== c.current && L(c.current, q.index), c.current = null, o.current = null, m.current = !1;
|
|
248
|
+
}, L = (C, D) => {
|
|
249
|
+
N((q) => {
|
|
250
|
+
const T = q.map((Y) => ({ ...Y })), [U] = T.splice(C, 1);
|
|
251
|
+
return T.splice(D, 0, U), T.forEach((Y, B) => {
|
|
252
252
|
Y.rank = B + 1;
|
|
253
253
|
}), z(), T;
|
|
254
254
|
});
|
|
255
255
|
}, Q = (C) => {
|
|
256
|
-
const
|
|
257
|
-
C.reduce((
|
|
256
|
+
const D = {};
|
|
257
|
+
C.reduce((q, T) => (q[T.id] = T.rank, q), D), r({ value: D, questionId: s, type: i }, !0);
|
|
258
258
|
}, z = () => {
|
|
259
259
|
h(!1);
|
|
260
260
|
}, { left: $, right: H } = a, Z = u.length, ae = (C) => {
|
|
@@ -264,19 +264,19 @@ const ct = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
|
|
|
264
264
|
}, je = (C) => {
|
|
265
265
|
c.current = null, C.currentTarget.classList.remove("is-dragging");
|
|
266
266
|
};
|
|
267
|
-
return e("form", { className:
|
|
267
|
+
return e("form", { className: R(t, "ul-card-rank", "fade-in-transition"), onSubmit: (C) => {
|
|
268
268
|
C.preventDefault(), Q(S), l && l();
|
|
269
|
-
}, children: e(J, { properties: n, children: e(he, A ? { children: [e(re, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", $] }) }), e("ol", { className: "ul-card-rank__list", children: S.map(({ id: C, label:
|
|
269
|
+
}, children: e(J, { properties: n, children: e(he, A ? { children: [e(re, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", $] }) }), e("ol", { className: "ul-card-rank__list", children: S.map(({ id: C, label: D, rank: q }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${D}`, className: R("ul-card-rank__select", q == null && "ul-card-rank__select--placeholder"), name: `rank[${C}]`, onChange: (T) => x(C, T.currentTarget.value), value: q ?? "", children: [q == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), P.map((T) => e("option", { className: "ul-card-rank__select-option", value: T, children: T }, `${T}-${s}`))] }), e("span", { children: D })] }, C)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [Z, " - ", H] }) })] }) }), e(te, { children: e("div", { className: "ul-card__button-wrapper", children: e(W, { disabled: f, children: X(n) }) }) })] } : { children: [e(re, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", $] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: A ? void 0 : (C) => {
|
|
270
270
|
C.preventDefault(), C.dataTransfer && (C.dataTransfer.dropEffect = "move");
|
|
271
|
-
}, children: S.map(({ id: C, label:
|
|
271
|
+
}, children: S.map(({ id: C, label: D, rank: q }, T) => {
|
|
272
272
|
return e("li", { className: "ul-card-rank__option", draggable: !!p || void 0, onDragEnd: p ? je : void 0, onDragEnter: p ? ae : void 0, onDragLeave: p ? ue : void 0, onDragStart: p ? (Y = T, (B) => {
|
|
273
273
|
c.current = Y, B.dataTransfer && (B.dataTransfer.effectAllowed = "move", B.dataTransfer.setData("text/plain", String(Y)), B.currentTarget.classList.add("is-dragging"));
|
|
274
274
|
}) : void 0, onDrop: p ? (U = T, (B) => {
|
|
275
275
|
var ie, we;
|
|
276
276
|
B.preventDefault(), B.currentTarget.classList.remove("is-drop-target");
|
|
277
277
|
const M = c.current;
|
|
278
|
-
c.current = null, (we = (ie = B.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : ie.querySelector(".is-dragging")) == null || we.classList.remove("is-dragging"), M != null && M !== U &&
|
|
279
|
-
}) : void 0, ref: (B) => k.current[T] = B, children: [e("select", { "aria-label": `Rank for ${
|
|
278
|
+
c.current = null, (we = (ie = B.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : ie.querySelector(".is-dragging")) == null || we.classList.remove("is-dragging"), M != null && M !== U && L(M, U);
|
|
279
|
+
}) : void 0, ref: (B) => k.current[T] = B, children: [e("select", { "aria-label": `Rank for ${D}`, className: R("ul-card-rank__select", q == null && "ul-card-rank__select--placeholder"), name: `rank[${C}]`, onChange: (B) => x(C, B.currentTarget.value), value: q ?? "", children: [q == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), P.map((B) => e("option", { className: "ul-card-rank__select-option", value: B, children: B }, B))] }), e("span", { children: D }), !A && e("button", { "aria-label": `Drag ${D} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: d ? w : void 0, onTouchMove: d ? I : void 0, onTouchStart: d ? b(T) : void 0, title: "Drag to reorder", type: "button", children: e("svg", { fill: "none", height: "17", viewBox: "0 0 16 17", width: "16", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z", fill: "currentColor" }) }) })] }, C);
|
|
280
280
|
var U, Y;
|
|
281
281
|
}) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [Z, " - ", H] }) })] }) }), e(te, { children: e("div", { className: "ul-card__button-wrapper", children: e(W, { disabled: f, children: X(n) }) }) })] }) }) }, s);
|
|
282
282
|
}, ye = 1, Ae = 2, Be = 3, me = (t) => t.type === "av_permission", qe = (t) => t.type === "screen_permission", $e = (t, a) => t === void 0 ? ye : t ? ((r, n) => !(me(n) ? n.permissionDescriptors : []).includes("camera") || r.getVideoTracks().length > 0)(t, a) ? Be : ye : Ae, Pe = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
|
|
@@ -333,7 +333,7 @@ function Ne({ pages: t, setIsRequestingPermission: a }) {
|
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
const Oe = "ul-permission-graphics-container", Qe = "ul-permission-body", He =
|
|
336
|
+
const Oe = "ul-permission-graphics-container", Qe = "ul-permission-body", He = R(Oe, "ul_recorded-task-inset-spacing"), ge = R("ul-horizontal-button-container", "ul-horizontal-button-container-left"), Ve = ({ richTextBody: t }) => e(de, { className: "ul-rich-text-body", html: t, id: "ul-task-detail-container" }), ve = ({ required: t, skipButtonText: a, bottom: r = !1 }) => t ? null : e(W, { className: R(r && "ul-skip-button-below", "ul-button-inactive"), onClick: ke.bind(null, { status: "abandoned" }), children: a || "Skip" }), Ie = (t) => {
|
|
337
337
|
const { avStream: a, captureStream: r, recordingMediaTypes: n, updatePage: s } = K.getState(), i = (n == null ? void 0 : n.includes("audio")) || (n == null ? void 0 : n.includes("video"));
|
|
338
338
|
ne(() => {
|
|
339
339
|
const l = setInterval(() => {
|
|
@@ -346,11 +346,11 @@ const Oe = "ul-permission-graphics-container", Qe = "ul-permission-body", He = L
|
|
|
346
346
|
return Ie(a), e("div", { className: "ul-task-page", children: [i && e(Ve, { richTextBody: i }), e("div", { className: ge, children: [e(W, { onClick: Ne.bind(null, { pages: a }), children: n }), e(ve, { required: r, skipButtonText: s })] })] }, "start-task");
|
|
347
347
|
}, Ct = ({ content: t, pages: a, properties: r }) => {
|
|
348
348
|
const { buttonText: n, skipButtonText: s } = t;
|
|
349
|
-
return Ie(a), e("div", { className: "ul-task-page", children: [t.taskDetail && e(Ve, { richTextBody: t.taskDetail }), e(J, { properties: r, children: e("div", { className: ge, children: [e(W, { className: "ul-complete-task-button", onClick: ke.bind(null, { status: "completed" }), children: n }), e(W, { className:
|
|
349
|
+
return Ie(a), e("div", { className: "ul-task-page", children: [t.taskDetail && e(Ve, { richTextBody: t.taskDetail }), e(J, { properties: r, children: e("div", { className: ge, children: [e(W, { className: "ul-complete-task-button", onClick: ke.bind(null, { status: "completed" }), children: n }), e(W, { className: R("ul-button-inactive"), onClick: ke.bind(null, { status: "given.up" }), children: s })] }) })] }, "complete-task");
|
|
350
350
|
}, St = ({ content: t, pages: a, required: r }) => {
|
|
351
351
|
const { buttonText: n, skipButtonText: s } = t, [i] = O((c) => [c.tabTitle]), [l, u] = V(!1);
|
|
352
352
|
return e("div", { children: [e("div", { className: He, children: [e("p", { style: { marginTop: "auto" }, children: t.selectTabText }), e("div", { className: "ul-select-tab-container", children: e("p", { className: Qe, children: i }) })] }), e("div", { className: r ? "" : ge, children: [e(W, { disabled: l, onClick: Ne.bind(null, { pages: a, setIsRequestingPermission: u }), children: n }), e(ve, { required: r, skipButtonText: s })] })] });
|
|
353
|
-
}, Tt = ({ content: t }) => e(de, { className:
|
|
353
|
+
}, Tt = ({ content: t }) => e(de, { className: R(Oe, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), html: t.svg }, "ul-permission-request-graphic"), _t = ({ content: t, pages: a, required: r }) => {
|
|
354
354
|
const { permissionDeniedHeadline: n, permissionDeniedBody: s, skipButtonText: i, tryAgainButtonText: l } = t, u = me(a[0]) ? a[0] : null;
|
|
355
355
|
return ne(() => {
|
|
356
356
|
const c = setInterval(() => {
|
|
@@ -358,7 +358,7 @@ const Oe = "ul-permission-graphics-container", Qe = "ul-permission-body", He = L
|
|
|
358
358
|
}, 1e3);
|
|
359
359
|
return () => clearInterval(c);
|
|
360
360
|
}, [u, a]), u ? e("div", { children: [e("div", { className: He, children: e("p", { className: "ul-av-permission-denied-paragraph", children: [e("span", { className: "ul-av-permission-denied-headline", children: n }), e("span", { className: Qe, children: s })] }) }), e("div", { className: ge, children: [e(W, { onClick: fe.bind(null, { currentPage: u, pages: a }), children: l }), e(ve, { required: r, skipButtonText: i })] })] }) : null;
|
|
361
|
-
}, Nt = ({ stream: t }) => e("video", { autoPlay: !0, className:
|
|
361
|
+
}, Nt = ({ stream: t }) => e("video", { autoPlay: !0, className: R("ul_recorded-task-inset-spacing"), id: "ul-record-task-video-preview", muted: !0, ref: (a) => {
|
|
362
362
|
a && (a.srcObject = t || null);
|
|
363
363
|
} }), It = ({ content: t, pages: a, required: r }) => {
|
|
364
364
|
const { skipButtonText: n } = t, { avStream: s } = K.getState();
|
|
@@ -383,16 +383,16 @@ const Oe = "ul-permission-graphics-container", Qe = "ul-permission-body", He = L
|
|
|
383
383
|
}, Dt = ({ className: t, properties: a, next: r, questionId: n }) => {
|
|
384
384
|
const s = O(), { surveyId: i, responseGroupUid: l, userId: u } = s, c = K(), { screenPermissionRequested: v } = c, y = K((h) => h.avStream);
|
|
385
385
|
let o = K((h) => h.currentPage);
|
|
386
|
-
o || (o = function({ pages: h, userId: S, responseGroupUid: N, surveyId:
|
|
387
|
-
const { updatePage: G } = K.getState(), { eventEmitFn: A, recorderEventEmitter: d } = O.getState(), p = { questionId: E, surveyId:
|
|
386
|
+
o || (o = function({ pages: h, userId: S, responseGroupUid: N, surveyId: P, questionId: E, next: _ }) {
|
|
387
|
+
const { updatePage: G } = K.getState(), { eventEmitFn: A, recorderEventEmitter: d } = O.getState(), p = { questionId: E, surveyId: P, visitorId: S, responseGroupUid: N };
|
|
388
388
|
let x = 0;
|
|
389
|
-
d.emit("recorded.task.permission.screen"), A("recorded.task.permission.screen"), d.emit("permission.status", { "permission.status.callback": (b, I,
|
|
389
|
+
d.emit("recorded.task.permission.screen"), A("recorded.task.permission.screen"), d.emit("permission.status", { "permission.status.callback": (b, I, w, L) => {
|
|
390
390
|
const Q = h[x], { type: z } = Q, $ = ["screen"];
|
|
391
391
|
if (me(Q)) {
|
|
392
392
|
const { permissionDescriptors: H } = Q, Z = H == null ? void 0 : H.includes("microphone"), ae = H == null ? void 0 : H.includes("camera");
|
|
393
393
|
Z && $.push("audio"), ae && $.push("video"), (b != null && b.active && !ae || b != null && b.active && I) && x++;
|
|
394
394
|
}
|
|
395
|
-
qe(h[x]) &&
|
|
395
|
+
qe(h[x]) && w && (x++, d.emit("begin.recording", { "recording.media.types": $, "start.recording.callback": (H) => G({ mediaRecordingUids: H }) })), G({ currentPage: h[x], avStream: b, screenPermissionRequested: w, nextQuestion: _, type: z, passthroughData: p, recordingMediaTypes: $, captureStream: L });
|
|
396
396
|
} });
|
|
397
397
|
const g = h[x];
|
|
398
398
|
return g.type === "av_permission" && fe({ currentPage: g, pages: h }), g;
|
|
@@ -401,12 +401,12 @@ const Oe = "ul-permission-graphics-container", Qe = "ul-permission-body", He = L
|
|
|
401
401
|
}, pages: a.pages, responseGroupUid: l, userId: u }));
|
|
402
402
|
let m = o.headline, k = o.captionText;
|
|
403
403
|
const f = $e(y, o);
|
|
404
|
-
return qe(o) && v && (m = o.permissionDeniedHeadline, k = o.permissionDeniedCaptionText), me(o) && f === Be && (m = o.permissionGrantedHeadline, k = o.permissionGrantedCaptionText), e("div", { className:
|
|
404
|
+
return qe(o) && v && (m = o.permissionDeniedHeadline, k = o.permissionDeniedCaptionText), me(o) && f === Be && (m = o.permissionGrantedHeadline, k = o.permissionGrantedCaptionText), e("div", { className: R(t, "ul-center-horizontally", "fade-in-transition"), children: [e(Se, { isRequired: a == null ? void 0 : a.required, message: m, properties: { captionText: k } }), e(re, { children: e(wt, { properties: a }) })] });
|
|
405
405
|
}, qt = ({ className: t, next: a, properties: r, questionId: n, type: s }) => {
|
|
406
406
|
const { visitorAttributes: i, isLongFormSurvey: l } = O((y) => ({ visitorAttributes: y.visitorAttributes, isLongFormSurvey: Ue(y.studyType) })), u = (y, o = !1) => {
|
|
407
407
|
a({ value: o ? { skipped: !0 } : void 0, questionId: n, type: s }, !0);
|
|
408
408
|
}, c = nt(r && r.buttonUrl, i), v = l && r.promptActionType === at.NO_BUTTON;
|
|
409
|
-
return e("div", { className:
|
|
409
|
+
return e("div", { className: R(t, "ul-card__text-url-prompt", "fade-in-transition"), children: e(J, { properties: r, children: !v && e("div", { children: e("div", { className: "ul-card-button-group", children: [e("a", { className: "ul-card-text__button ul-card__text-url-prompt-button", href: c, id: "ul-card-text__button", onClick: u, onKeyPress: (y) => {
|
|
410
410
|
y.key !== "Enter" && y.key !== " " || a({ value: void 0, questionId: n, type: s }, !0);
|
|
411
411
|
}, rel: "noreferrer", role: c ? "link" : "button", tabIndex: 0, target: "_blank", children: X(r) }), r.required === !1 && e("button", { className: "ul-card-skip__button", onClick: (y) => u(0, !0), children: xe(r) })] }) }) }) }, n);
|
|
412
412
|
}, Pt = ({ className: t, questionId: a }) => {
|
|
@@ -417,20 +417,20 @@ const Oe = "ul-permission-graphics-container", Qe = "ul-permission-body", He = L
|
|
|
417
417
|
}, i ? 4e3 : 2e3);
|
|
418
418
|
}, [n, i]);
|
|
419
419
|
const l = s && s.subheader ? e("p", { className: "ul-caption", children: s.subheader }) : null, u = s && s.headline ? s.headline : "";
|
|
420
|
-
return e("div", { className:
|
|
420
|
+
return e("div", { className: R(t, "ul-card--thanks", "fade-in-transition"), children: e("div", { children: e("div", { className: "ul-card--thanks-content", children: [e("div", { className: "ul-thanks-check", children: e("svg", { "aria-labelledby": "title", fill: "none", height: "99", viewBox: "0 0 81 99", width: "81", xmlns: "http://www.w3.org/2000/svg", children: [e("path", { clipRule: "evenodd", d: "M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z", fill: r, fillRule: "evenodd" }), e("path", { clipRule: "evenodd", d: "M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z", fill: r, fillRule: "evenodd" }), e("path", { d: "M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z", fill: "black", fillOpacity: "0.2" })] }) }), e(Se, { message: u }), l] }) }) }, a);
|
|
421
421
|
}, Lt = () => e("div", { className: "thinking-dots-container", children: e("div", { className: "thinking-dot" }) }), Rt = ({ className: t }) => {
|
|
422
422
|
const { uploadProgress: a } = O((i) => ({ uploadProgress: i.uploadProgress }));
|
|
423
423
|
let r, n;
|
|
424
424
|
Object.values(a).filter((i) => i.isSubmitted).length > 1 ? (r = "Your responses are processing", n = "Please keep this tab open until your responses are fully processed.") : (r = "Your response is processing", n = "Please keep this tab open until your response is fully processed.");
|
|
425
425
|
const s = Math.round(Math.min(99, ...Object.values(a).filter((i) => i.isSubmitted).map((i) => i.progressPct || 0)));
|
|
426
|
-
return e("div", { className:
|
|
426
|
+
return e("div", { className: R(t, "ul-card--uploading", "fade-in-transition"), children: [e("div", { "aria-busy": "true", "aria-label": "Processing...", "aria-live": "polite", className: "ul-loading-spinner-container", role: "progressbar", children: e("div", { className: "ul-loading-spinner", children: [e("div", { className: "first" }), e("div", { className: "second" }), e("div", { className: "third" }), e("div", { className: "fourth" })] }) }), e(Se, { message: `${r} (${s}% complete)` }), e("p", { className: "ul-caption", children: n })] });
|
|
427
427
|
}, Le = 0, Re = 1, Mt = ({ className: t, next: a, properties: r, questionId: n, type: s }) => {
|
|
428
|
-
const i = `ul-card-video__player_recorder-q${n}`, { apiURL: l, envId: u, handleUploadUpdate: c, headers: v, responseGroupUid: y, surveyId: o, viewDocument: m, visitorId: k } = O((p) => ({ apiURL: p.apiURL, envId: p.envId, handleUploadUpdate: p.handleUploadUpdate, headers: p.headers, responseGroupUid: p.responseGroupUid, surveyId: p.surveyId, viewDocument: p.viewDocument, visitorId: p.userId })), [f, h] = V(!1), [S, N] = V(null), [
|
|
428
|
+
const i = `ul-card-video__player_recorder-q${n}`, { apiURL: l, envId: u, handleUploadUpdate: c, headers: v, responseGroupUid: y, surveyId: o, viewDocument: m, visitorId: k } = O((p) => ({ apiURL: p.apiURL, envId: p.envId, handleUploadUpdate: p.handleUploadUpdate, headers: p.headers, responseGroupUid: p.responseGroupUid, surveyId: p.surveyId, viewDocument: p.viewDocument, visitorId: p.userId })), [f, h] = V(!1), [S, N] = V(null), [P, E] = V(null), [_, G] = V(Le), A = (p, x) => {
|
|
429
429
|
p === F.UPLOAD_STARTED ? (N(x[F.UPLOAD_ID]), E(x[F.MEDIA_RECORDING_UID]), h(!0)) : p === F.DELETE ? (N(null), E(null), h(!1)) : p === F.UPLOAD_PROGRESS ? isNaN(x[F.UPLOAD_PROGRESS_PCT]) ? c({ mediaRecordingUid: x[F.MEDIA_RECORDING_UID], isComplete: !0 }) : c({ mediaRecordingUid: x[F.MEDIA_RECORDING_UID], progressPct: x[F.UPLOAD_PROGRESS_PCT] }) : p === F.UPLOAD_FINISHED && c({ mediaRecordingUid: x[F.MEDIA_RECORDING_UID], isComplete: !0 });
|
|
430
430
|
}, d = (p) => {
|
|
431
|
-
p.preventDefault(), p.stopPropagation(), document.getElementById(i) && ot(i), S &&
|
|
431
|
+
p.preventDefault(), p.stopPropagation(), document.getElementById(i) && ot(i), S && P ? (c({ mediaRecordingUid: P, isSubmitted: !0 }), a({ value: { mediaRecordingUid: P }, questionId: n, type: s }, !0)) : a({ value: null, questionId: n, type: s }, !0);
|
|
432
432
|
};
|
|
433
|
-
return e("form", { className:
|
|
433
|
+
return e("form", { className: R(t, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [e(re, { children: [e("div", { id: "ul-question-player-container", style: { display: _ === Le ? "" : "none" }, children: e(J, { properties: r, children: e("button", { className: "ul-video-btn ul-record-response-btn", onClick: (p) => {
|
|
434
434
|
p.preventDefault(), p.stopPropagation(), document.getElementById(i) && st(i), G(Re);
|
|
435
435
|
} }) }) }), e("div", { style: { display: _ === Re ? "block" : "none" }, children: e("div", { id: "ul-recorder-player-container", ref: (p) => {
|
|
436
436
|
if (p && p.children.length === 0) {
|
|
@@ -536,41 +536,41 @@ const Ot = () => {
|
|
|
536
536
|
const [g, b] = V(/* @__PURE__ */ new Map());
|
|
537
537
|
return ne(() => {
|
|
538
538
|
if (d.length > 0 && p < d.length) {
|
|
539
|
-
const I = d[p],
|
|
539
|
+
const I = d[p], w = `${I.name}`, L = ($) => $.type === "aidynamicfollowup", Q = ($) => {
|
|
540
540
|
var H;
|
|
541
541
|
if (p > 0) {
|
|
542
542
|
const Z = d[p - 1];
|
|
543
|
-
if (
|
|
543
|
+
if (L(Z)) {
|
|
544
544
|
const ae = `${Z.name}`, ue = !!((H = Z.props) != null && H.loading);
|
|
545
545
|
if ($.get(ae) !== ue) return new Map($).set(ae, ue);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
return $;
|
|
549
549
|
};
|
|
550
|
-
if (p <= (x ?? 0) || Ge(I)) return b(($) => Q(new Map($).set(
|
|
550
|
+
if (p <= (x ?? 0) || Ge(I)) return b(($) => Q(new Map($).set(w, !1)));
|
|
551
551
|
b(($) => {
|
|
552
|
-
const H = !
|
|
553
|
-
return Q(new Map($).set(
|
|
552
|
+
const H = !L(I) || !!I.props.loading;
|
|
553
|
+
return Q(new Map($).set(w, H));
|
|
554
554
|
});
|
|
555
555
|
const z = setTimeout(() => {
|
|
556
556
|
b(($) => {
|
|
557
|
-
const H = !!
|
|
558
|
-
return Q(new Map($).set(
|
|
557
|
+
const H = !!L(I) && !!I.props.loading;
|
|
558
|
+
return Q(new Map($).set(w, H));
|
|
559
559
|
});
|
|
560
560
|
}, 1e3);
|
|
561
561
|
return () => clearTimeout(z);
|
|
562
562
|
}
|
|
563
563
|
}, [p, d, x]), g;
|
|
564
|
-
})(t, i, o),
|
|
564
|
+
})(t, i, o), P = ((d, p) => {
|
|
565
565
|
const [x, g] = V(() => /* @__PURE__ */ new Set([d]));
|
|
566
566
|
return ne(() => {
|
|
567
567
|
g((b) => new Set(b).add(d));
|
|
568
568
|
}, [d]), ne(() => {
|
|
569
569
|
const b = p ?? 0;
|
|
570
570
|
b > 0 && g((I) => {
|
|
571
|
-
const
|
|
572
|
-
for (let
|
|
573
|
-
return
|
|
571
|
+
const w = new Set(I);
|
|
572
|
+
for (let L = 0; L <= b; L++) w.add(L);
|
|
573
|
+
return w;
|
|
574
574
|
});
|
|
575
575
|
}, [p]), x;
|
|
576
576
|
})(i, o), E = ce(() => ({ ...r, ...De(t.map((d, p) => {
|
|
@@ -592,11 +592,11 @@ const Ot = () => {
|
|
|
592
592
|
s(g, d);
|
|
593
593
|
const b = { ...d, questionText: We(x) };
|
|
594
594
|
if (x.childId && (b == null ? void 0 : b.value) != null) {
|
|
595
|
-
const I = De([x].map((
|
|
595
|
+
const I = De([x].map((w) => ({ ...w, value: (b == null ? void 0 : b.value) ?? null, secondaryValue: (b == null ? void 0 : b.secondaryValue) ?? null })));
|
|
596
596
|
k({ parentQuestionId: x.name, parentResponseConfig: I });
|
|
597
597
|
}
|
|
598
598
|
a([b]);
|
|
599
|
-
}, [_, i, a, s]), A = _.map((d, p) => ({ card: d, cardIndex: p })).filter(({ cardIndex: d }) =>
|
|
599
|
+
}, [_, i, a, s]), A = _.map((d, p) => ({ card: d, cardIndex: p })).filter(({ cardIndex: d }) => P.has(d));
|
|
600
600
|
return e("div", { className: "conversational-ui ul-conversational-ui", "data-testid": "ui-container", children: [!l && e(Ot, {}), e("div", { className: "chat-container", children: e("div", { className: "chat-messages", children: A.map(({ card: d, cardIndex: p }) => e($t, { avatars: u, card: d, cardIndex: p, cardResponses: n, currentQuestionBubbleRef: h, handleCardResponse: G, index: i, questionThinkingStates: N, startingQuestionIdx: o }, `question-card-${d.name}`)) }) }), l && e("div", { className: "long-form-question-footer-container-logo", children: c && e(Xe, { forceBrandedLogo: v, marketingUrlLink: y }) })] });
|
|
601
601
|
};
|
|
602
602
|
export {
|