@sprig-technologies/sprig-browser 2.44.0 → 2.45.0

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.
@@ -1,52 +1,52 @@
1
- import { a as $, u as e, h as O, c as R, b as j, e as X, f as Se, p as te, F as ce, _ as ee, T as oe, A as ze, M as pe, g as he, i as Ke, P as Xe, j as We, k as Pe, l as Je, m as et, D as fe, w as Ee, n as tt } from "./view-MpYHLeMt.js";
2
- import { v as rt, R as Z, B as W, M as J, Q as re, O as Te, a as ne, S as nt, L as at, u as st, H as de, b as _e, g as it, p as ot, c as lt, s as ct, d as dt } from "./videoPlayer-ChSRlzGk.js";
3
- import { b as be, D as Ne, A as Ie, g as ut } from "./core-CWHAsU-S.js";
4
- import { t as Ae } from "./metricsReporter-Bg5aC8mO.js";
5
- const pt = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
1
+ import { a as $, u as e, h as O, c as R, b as j, e as X, f as Se, p as te, F as ce, _ as ee, T as oe, A as Ye, M as pe, g as he, i as ze, P as Ke, j as Xe, k as We, l as Je, m as et, D as fe, w as Ue, n as tt, t as rt } from "./view-CDrJuRMn.js";
2
+ import { v as nt, R as Z, B as W, M as J, Q as re, O as Te, a as ne, S as at, L as st, u as it, H as de, b as _e, g as ot, p as lt, c as ct, s as dt, d as ut } from "./videoPlayer-HNloD0SJ.js";
3
+ import { b as be, D as Ne, A as Ie, g as pt } from "./core-YTxB8B8q.js";
4
+ import { t as Ee } from "./metricsReporter-0HbKrvkx.js";
5
+ const mt = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
6
6
  const n = `ul-card-video__question_player-q${r}`, { apiURL: s, viewDocument: i } = $((l) => ({ apiURL: l.apiURL, viewDocument: l.viewDocument }));
7
7
  return e("div", { id: n, ref: (l) => {
8
8
  if (l && l.children.length === 0 && !t.properties.hideRecordedPrompt) {
9
- const u = rt(n, { src: a, type: "application/x-mpegURL" }, void 0, t.properties.mediaType === Z.MEDIA_TYPE_AUDIO, s, i);
9
+ const u = nt(n, { src: a, type: "application/x-mpegURL" }, void 0, t.properties.mediaType === Z.MEDIA_TYPE_AUDIO, s, i);
10
10
  l.appendChild(u);
11
11
  }
12
12
  } });
13
- }, ae = ({ 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"] }), mt = ({ className: t, next: a, properties: r, questionId: n, type: s }) => {
14
- const { useMobileStyling: i, border: l } = $((_) => ({ useMobileStyling: _.useMobileStyling, border: _.border })), [u, d] = O(!1), [b, y] = O(""), [o, h] = O(!1), x = r == null ? void 0 : r.collectName, k = (r == null ? void 0 : r.nameLabelText) || "Full Name", g = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", S = (r == null ? void 0 : r.submitButtonText) || "Submit", N = !!b.trim(), P = u && (!x || N), E = (_, Q = !1) => {
13
+ }, ae = ({ 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"] }), ht = ({ className: t, next: a, properties: r, questionId: n, type: s }) => {
14
+ const { useMobileStyling: i, border: l } = $((_) => ({ useMobileStyling: _.useMobileStyling, border: _.border })), [u, d] = O(!1), [v, y] = O(""), [o, h] = O(!1), x = r == null ? void 0 : r.collectName, f = (r == null ? void 0 : r.nameLabelText) || "Full Name", g = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", S = (r == null ? void 0 : r.submitButtonText) || "Submit", N = !!v.trim(), q = u && (!x || N), E = (_, Q = !1) => {
15
15
  _.preventDefault(), _.stopPropagation();
16
16
  let A = null;
17
17
  if (!Q) {
18
- if (!P) return void h(!0);
19
- A = { submitted: !0 }, x && (A.name = b);
18
+ if (!q) return void h(!0);
19
+ A = { submitted: !0 }, x && (A.name = v);
20
20
  }
21
- a({ value: A, questionId: n, type: s }, !!Q || P);
21
+ a({ value: A, questionId: n, type: s }, !!Q || q);
22
22
  };
23
23
  return e("div", { className: R(t, "ul-card__consent-legal", "fade-in-transition"), children: e(J, { embeddedType: "pdf", properties: r, children: e(re, { children: [e("div", { className: "sprig-stretch", children: [e(Te, { allowTextEntry: !1, border: l, error: o && !u, id: "consent", isRadio: !1, isSelected: u, label: g, onUserInputChanged: ({ selected: _ }) => {
24
24
  _ !== u && d(!u);
25
- }, useMobileStyling: i }), x && e("input", { "aria-label": k, "aria-placeholder": k, className: R(j("ul-consent-legal__name-input", i)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: (_) => {
25
+ }, useMobileStyling: i }), x && 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 : Ne;
27
27
  }, onFocus: (_) => {
28
28
  _.currentTarget.style.borderColor = o && !N ? be : l;
29
29
  }, onInput: (_) => {
30
30
  _.preventDefault(), _.stopPropagation(), y(_.currentTarget.value);
31
- }, placeholder: k, style: o && !N ? { borderColor: be } : {}, tabIndex: 0, value: b })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(ae, { 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: Se(r) })] })] }) }) }, n);
32
- }, ht = () => {
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(ae, { isDisabled: !q, 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: Se(r) })] })] }) }) }, n);
32
+ }, gt = () => {
33
33
  const { destroy: t, forceBrandedLogo: a } = $((r) => ({ destroy: r.destroy, forceBrandedLogo: r.forceBrandedLogo }));
34
34
  return te(() => {
35
35
  setTimeout(() => {
36
36
  t(Ie);
37
37
  }, a ? 4e3 : 2e3);
38
38
  }, [t, a]), e("div", { className: "end-of-survey-text", children: "End of survey" });
39
- }, gt = ({ activeValue: t, border: a, icon: r, enableCspTrustedTypes: n, isPressed: s, range: i, scaleLabelType: l, selectedValue: u, setSelectedValue: d, setActiveValue: b, setIsPressed: y, useMobileStyling: o, value: h, viewDocument: x }) => {
40
- const k = `option-${h}`, g = l === "number", S = l === "star", N = l === "smiley", P = g && h === t || h === u, [E, _] = (() => {
39
+ }, vt = ({ activeValue: t, border: a, icon: r, enableCspTrustedTypes: n, isPressed: s, range: i, scaleLabelType: l, selectedValue: u, setSelectedValue: d, setActiveValue: v, setIsPressed: y, useMobileStyling: o, value: h, viewDocument: x }) => {
40
+ const f = `option-${h}`, g = l === "number", S = l === "star", N = l === "smiley", q = g && h === t || h === u, [E, _] = (() => {
41
41
  const c = S && u !== null && h <= u;
42
42
  return S && h <= t || N && h === t || c || h === t || h === u ? [a, s || c || h === u ? 1 : 0.3] : ["", 1];
43
43
  })(), Q = ce(() => {
44
- const c = { borderColor: P ? E : "", fillOpacity: P ? "" : _, zIndex: P ? 3 : "auto", color: u === h ? "#fff" : "" };
44
+ const c = { borderColor: q ? E : "", fillOpacity: q ? "" : _, zIndex: q ? 3 : "auto", color: u === h ? "#fff" : "" };
45
45
  return g ? { ...c, backgroundColor: u === h ? E : "" } : { ...c, color: S || N || u === h ? E : "" };
46
- }, [P, E, _, u, h, g, S, N]), A = ce(() => ut((({ icon: c, scaleLabelType: p, value: f, selectedValue: m }) => {
47
- if (p === "smiley" && f === m) {
48
- let v = 0;
49
- return c.replace(/black/g, () => ++v == 1 ? "black" : "white");
46
+ }, [q, E, _, u, h, g, S, N]), A = ce(() => pt((({ icon: c, scaleLabelType: p, value: k, selectedValue: m }) => {
47
+ if (p === "smiley" && k === m) {
48
+ let b = 0;
49
+ return c.replace(/black/g, () => ++b == 1 ? "black" : "white");
50
50
  }
51
51
  return c;
52
52
  })({ icon: r, scaleLabelType: l, value: h, selectedValue: u }), n), [n, r, l, u, h]);
@@ -59,229 +59,229 @@ const pt = ({ properties: t, surveyVideoUrl: a, questionId: r }) => {
59
59
  default:
60
60
  return h === i ? R(j("likert-number", o), j(`likert-number-${h}`, o), j("likert-last-option", o)) : R(j("likert-number", o), j(`likert-number-${h}`, o));
61
61
  }
62
- })(), dangerouslySetInnerHTML: { __html: A }, id: k, onClick: (c) => {
62
+ })(), dangerouslySetInnerHTML: { __html: A }, id: f, onClick: (c) => {
63
63
  c.preventDefault(), c.stopPropagation(), d(h);
64
64
  }, onKeyDown: (c) => {
65
- var m, v;
66
- const p = x.querySelectorAll(`.likert-${l ?? "number"}`), f = h - 1;
67
- c.key === "ArrowRight" ? (m = p[f + 1]) == null || m.focus() : c.key === "ArrowLeft" ? (v = p[f - 1]) == null || v.focus() : c.key !== "Enter" && c.key !== " " || (c.preventDefault(), c.stopPropagation(), d(h));
68
- }, onPointerDown: () => y(!0), onPointerEnter: () => b(h), onPointerLeave: () => {
69
- b(-1), y(!1);
65
+ var m, b;
66
+ const p = x.querySelectorAll(`.likert-${l ?? "number"}`), k = h - 1;
67
+ c.key === "ArrowRight" ? (m = p[k + 1]) == null || m.focus() : c.key === "ArrowLeft" ? (b = p[k - 1]) == null || b.focus() : c.key !== "Enter" && c.key !== " " || (c.preventDefault(), c.stopPropagation(), d(h));
68
+ }, onPointerDown: () => y(!0), onPointerEnter: () => v(h), onPointerLeave: () => {
69
+ v(-1), y(!1);
70
70
  }, style: Q, tabIndex: 0 });
71
- }, vt = ({ className: t, labels: a, next: r, properties: n, questionId: s, type: i }) => {
72
- const { border: l, useMobileStyling: u, viewDocument: d, enableCspTrustedTypes: b } = $((p) => ({ border: p.border, useMobileStyling: p.useMobileStyling, viewDocument: p.viewDocument, enableCspTrustedTypes: p.enableCspTrustedTypes })), [y, o] = O(-1), [h, x] = O(!1), [k, g] = O(null), S = a && a.left, N = a && a.right;
73
- let P;
71
+ }, bt = ({ className: t, labels: a, next: r, properties: n, questionId: s, type: i }) => {
72
+ const { border: l, useMobileStyling: u, viewDocument: d, enableCspTrustedTypes: v } = $((p) => ({ border: p.border, useMobileStyling: p.useMobileStyling, viewDocument: p.viewDocument, enableCspTrustedTypes: p.enableCspTrustedTypes })), [y, o] = O(-1), [h, x] = O(!1), [f, g] = O(null), S = a && a.left, N = a && a.right;
73
+ let q;
74
74
  const { range: E, scaleLabelType: _, ratingIcons: Q } = n;
75
- E && (P = Number(E));
76
- const A = P || 5, c = (p) => {
77
- var f, m;
75
+ E && (q = Number(E));
76
+ const A = q || 5, c = (p) => {
77
+ var k, m;
78
78
  switch (_) {
79
79
  case "star":
80
- return (f = Q[0]) == null ? void 0 : f.svg;
80
+ return (k = Q[0]) == null ? void 0 : k.svg;
81
81
  case "smiley":
82
82
  return (m = Q[p]) == null ? void 0 : m.svg;
83
83
  default:
84
84
  return String(p + 1);
85
85
  }
86
86
  };
87
- return e("form", { className: R(t, "ul-card--likert", "fade-in-transition"), children: e(J, { properties: n, children: [e(ne, { children: [e("div", { "aria-label": `Rating (1 - ${A})`, className: "ul-card--likert__numbers", role: "radiogroup", children: [...Array(A)].map((p, f) => {
88
- const m = f + 1;
89
- return e(gt, { activeValue: y, border: l, enableCspTrustedTypes: b, icon: c(f), isPressed: h, range: A, scaleLabelType: _, selectedValue: k, setActiveValue: o, setIsPressed: x, setSelectedValue: g, useMobileStyling: u, value: m, viewDocument: d }, f);
90
- }) }), e("div", { className: "ul-card--likert__labels", children: [e("span", { children: S }), e("span", { children: N })] })] }), e(re, { children: e(ae, { isDisabled: k === null && n.required, onClick: () => r({ value: k, questionId: s, type: i }, !0), children: X(n) }) })] }) }, s);
91
- }, bt = ({ columns: t, onSelect: a, options: r, selectedOptions: n }) => {
92
- const s = ee([]), { border: i, useMobileStyling: l } = $((h) => ({ border: h.border, useMobileStyling: h.useMobileStyling })), u = r.findIndex((h) => n[h.id] === null), [d, b] = O(u), y = oe((h, x) => {
87
+ return e("form", { className: R(t, "ul-card--likert", "fade-in-transition"), children: e(J, { properties: n, children: [e(ne, { children: [e("div", { "aria-label": `Rating (1 - ${A})`, className: "ul-card--likert__numbers", role: "radiogroup", children: [...Array(A)].map((p, k) => {
88
+ const m = k + 1;
89
+ return e(vt, { activeValue: y, border: l, enableCspTrustedTypes: v, icon: c(k), isPressed: h, range: A, scaleLabelType: _, selectedValue: f, setActiveValue: o, setIsPressed: x, setSelectedValue: g, useMobileStyling: u, value: m, viewDocument: d }, k);
90
+ }) }), e("div", { className: "ul-card--likert__labels", children: [e("span", { children: S }), e("span", { children: N })] })] }), e(re, { children: e(ae, { isDisabled: f === null && n.required, onClick: () => r({ value: f, questionId: s, type: i }, !0), children: X(n) }) })] }) }, s);
91
+ }, yt = ({ columns: t, onSelect: a, options: r, selectedOptions: n }) => {
92
+ const s = ee([]), { border: i, useMobileStyling: l } = $((h) => ({ border: h.border, useMobileStyling: h.useMobileStyling })), u = r.findIndex((h) => n[h.id] === null), [d, v] = O(u), y = oe((h, x) => {
93
93
  a(h, x);
94
- const k = d + 1, g = r[k];
95
- g && n[g.id] === null && b(k);
94
+ const f = d + 1, g = r[f];
95
+ g && n[g.id] === null && v(f);
96
96
  }, [a, r, n, d]), o = oe((h, x) => {
97
- const k = d === h;
98
- return e(ze, { animate: !0, header: x.label, isOpen: k, onClick: () => {
97
+ const f = d === h;
98
+ return e(Ye, { animate: !0, header: x.label, isOpen: f, onClick: () => {
99
99
  var g;
100
- return b(k && !((g = window.UserLeap) != null && g.isMobileSDK) ? -1 : h);
100
+ return v(f && !((g = window.UserLeap) != null && g.isMobileSDK) ? -1 : h);
101
101
  }, ref: (g) => {
102
102
  g && (s.current[h] = g);
103
103
  }, showHeaderCheck: n[x.id] !== null, children: e("div", { style: { paddingTop: "12px" }, children: t.map((g) => e(Te, { allowTextEntry: !1, ariaLabel: `${x.label}-${g.label}`, border: i, error: !1, id: `${x.id}-${g.value}`, isRadio: !0, isSelected: n[x.id] === g.value, label: g.label, onUserInputChanged: () => y(x.id, g.value), useMobileStyling: l }, g.label)) }) }, x.id);
104
104
  }, [i, t, d, y, n, l]);
105
105
  return e("div", { children: r.map((h, x) => o(x, h)) });
106
- }, yt = ({ className: t, next: a, options: r, properties: n, questionId: s, type: i, onSubmitButtonClick: l }) => {
107
- const u = n.matrixColumn, d = n.required, b = (k) => {
108
- k.preventDefault(), k.stopPropagation(), a({ value: o, questionId: s, type: i }, !0), l && l();
109
- }, y = r.reduce((k, g) => (k[g.id] = null, k), {}), [o, h] = O(y);
110
- return e("form", { className: R(t, "ul-card__matrix", "fade-in-transition"), id: "text-form", onSubmit: b, children: e(J, { properties: n, children: [e(ne, { children: e(bt, { columns: u, onSelect: (k, g) => {
111
- h((S) => ({ ...S, [k]: g }));
112
- }, options: r, selectedOptions: o }) }), e(re, { children: e(ae, { isDisabled: (x = o, d && Object.values(x).every((k) => k == null)), onClick: () => b(new SubmitEvent("submit")), children: X(n) }) })] }) }, s);
106
+ }, ft = ({ className: t, next: a, options: r, properties: n, questionId: s, type: i, onSubmitButtonClick: l }) => {
107
+ const u = n.matrixColumn, d = n.required, v = (f) => {
108
+ f.preventDefault(), f.stopPropagation(), a({ value: o, questionId: s, type: i }, !0), l && l();
109
+ }, y = r.reduce((f, g) => (f[g.id] = null, f), {}), [o, h] = O(y);
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(ne, { children: e(yt, { columns: u, onSelect: (f, g) => {
111
+ h((S) => ({ ...S, [f]: g }));
112
+ }, options: r, selectedOptions: o }) }), e(re, { children: e(ae, { isDisabled: (x = o, d && Object.values(x).every((f) => f == null)), onClick: () => v(new SubmitEvent("submit")), children: X(n) }) })] }) }, s);
113
113
  var x;
114
- }, Be = ({ className: t, onSubmit: a, options: r = [], properties: n, questionId: s, type: i, showIndividualSubmit: l = !1, onSubmitButtonClick: u }) => {
115
- const { border: d, useMobileStyling: b } = $((m) => ({ border: m.border, useMobileStyling: m.useMobileStyling })), y = r.reduce((m, v) => (m[v.id] = { isSelected: !1 }, m), {}), [o, h] = O(y), x = i === "multiplechoice", k = n.required, g = r.find((m) => {
116
- var v;
117
- return (v = m.optionProperties) == null ? void 0 : v.noneOfTheAbove;
118
- }), S = (m) => Object.entries(m).some(([v, I]) => {
114
+ }, Ae = ({ className: t, onSubmit: a, options: r = [], properties: n, questionId: s, type: i, showIndividualSubmit: l = !1, onSubmitButtonClick: u }) => {
115
+ const { border: d, useMobileStyling: v } = $((m) => ({ border: m.border, useMobileStyling: m.useMobileStyling })), y = r.reduce((m, b) => (m[b.id] = { isSelected: !1 }, m), {}), [o, h] = O(y), x = i === "multiplechoice", f = n.required, g = r.find((m) => {
116
+ var b;
117
+ return (b = m.optionProperties) == null ? void 0 : b.noneOfTheAbove;
118
+ }), S = (m) => Object.entries(m).some(([b, I]) => {
119
119
  var H;
120
- const w = r.find((V) => `${V.id}` === v), L = I.userText === void 0 || I.userText.trim() === "";
121
- return ((H = w == null ? void 0 : w.optionProperties) == null ? void 0 : H.allowsTextEntry) && L && I.isSelected;
122
- }), N = (m) => Object.values(m).filter((v) => v.isSelected).length, P = n.minSelect && n.minSelect > 0 && n.maxSelectMode === pe.Range && N(o) < n.minSelect && (k || N(o) > 0), E = (m) => S(m) || k && !N(m) || !((v) => {
123
- const { minSelect: I = 0, maxSelect: w = 1 / 0, maxSelectMode: L } = n, H = N(v);
120
+ const P = r.find((F) => `${F.id}` === b), L = I.userText === void 0 || I.userText.trim() === "";
121
+ return ((H = P == null ? void 0 : P.optionProperties) == null ? void 0 : H.allowsTextEntry) && L && I.isSelected;
122
+ }), N = (m) => Object.values(m).filter((b) => b.isSelected).length, q = n.minSelect && n.minSelect > 0 && n.maxSelectMode === pe.Range && N(o) < n.minSelect && (f || N(o) > 0), E = (m) => S(m) || f && !N(m) || !((b) => {
123
+ const { minSelect: I = 0, maxSelect: P = 1 / 0, maxSelectMode: L } = n, H = N(b);
124
124
  switch (L) {
125
125
  case pe.Maximum:
126
- return H <= w;
126
+ return H <= P;
127
127
  case pe.Range:
128
128
  return H === 0 || H >= I;
129
129
  default:
130
130
  return !0;
131
131
  }
132
- })(m), _ = Object.entries(o).some(([m, v]) => {
133
- var I, w;
134
- return v.isSelected && ((w = (I = r.find((L) => `${L.id}` === m)) == null ? void 0 : I.optionProperties) == null ? void 0 : w.allowsTextEntry);
132
+ })(m), _ = Object.entries(o).some(([m, b]) => {
133
+ var I, P;
134
+ return b.isSelected && ((P = (I = r.find((L) => `${L.id}` === m)) == null ? void 0 : I.optionProperties) == null ? void 0 : P.allowsTextEntry);
135
135
  }), Q = l && (!x || _), A = (m) => {
136
- f(m.id, m.selected, m.userText, m.noneOfTheAbove);
136
+ k(m.id, m.selected, m.userText, m.noneOfTheAbove);
137
137
  }, c = (m) => {
138
- var v;
139
- return (n == null ? void 0 : n.maxSelectMode) !== pe.Unlimited && N(o) === (n == null ? void 0 : n.maxSelect) && !((v = o[m]) != null && v.isSelected);
138
+ var b;
139
+ return (n == null ? void 0 : n.maxSelectMode) !== pe.Unlimited && N(o) === (n == null ? void 0 : n.maxSelect) && !((b = o[m]) != null && b.isSelected);
140
140
  }, p = () => {
141
141
  a(o, !0), u && u();
142
- }, f = (m, v, I, w) => {
142
+ }, k = (m, b, I, P) => {
143
143
  const L = Object.assign({}, o);
144
- if ((x || w) && v) for (const H of Object.values(L)) H.isSelected = !1, delete H.userText;
145
- else g && !w && o[g.id].isSelected && (L[g.id].isSelected = !1);
146
- L[m] = { isSelected: v, userText: I }, h(L);
144
+ if ((x || P) && b) for (const H of Object.values(L)) H.isSelected = !1, delete H.userText;
145
+ else g && !P && o[g.id].isSelected && (L[g.id].isSelected = !1);
146
+ L[m] = { isSelected: b, userText: I }, h(L);
147
147
  };
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(ne, { children: [n.isDropdown ? e(nt, { disabledOptions: r.filter((m) => c(m.id)), dropdownFooter: P ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [N(o), "/", n.minSelect] }) : void 0, isMultiSelect: !x, multiselectText: n.dropdownMultiselectedText ?? "choices selected", onChange: (m) => {
149
- const v = { ...o };
150
- for (const I of r) m.includes(I) ? v[I.id].isSelected = !0 : v[I.id].isSelected = !1;
151
- h(v);
152
- }, options: r, placeholderText: n.dropdownPlaceholderText ?? (x ? "Select choice" : "Select choice(s)"), value: r.filter((m) => o[m.id].isSelected) }) : e("div", { className: R(j("ul-card__choices", b)), role: x ? "radiogroup" : "group", children: [r.map(({ id: m, label: v, value: I, optionProperties: w }) => {
153
- var G, z;
154
- const L = `${m}`, { allowsTextEntry: H, noneOfTheAbove: V } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...w };
155
- return e(Te, { allowTextEntry: H, border: d, disabled: c(L), error: (F = o, S(F)), id: L, isRadio: x, isSelected: !!((G = o[L]) != null && G.isSelected), label: v, noneOfTheAbove: V, onUserInputChanged: A, promptText: (w == null ? void 0 : w.otherOptionPlaceholder) || "Please specify", text: (z = o[m]) == null ? void 0 : z.userText, useMobileStyling: b, value: I }, L);
156
- var F;
157
- }), !!P && e("div", { className: "ul-card__min-select-counter", children: [N(o), "/", n.minSelect] })] }), Q && e(at, { handleSubmit: p, isSubmitDisabled: E(o) })] }), e(re, { children: e(ae, { isDisabled: E(o), onClick: p, children: X(n) }) })] }) }, s);
158
- }, ft = (t) => {
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(ne, { children: [n.isDropdown ? e(at, { disabledOptions: r.filter((m) => c(m.id)), dropdownFooter: q ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [N(o), "/", n.minSelect] }) : void 0, isMultiSelect: !x, multiselectText: n.dropdownMultiselectedText ?? "choices selected", onChange: (m) => {
149
+ const b = { ...o };
150
+ for (const I of r) m.includes(I) ? b[I.id].isSelected = !0 : b[I.id].isSelected = !1;
151
+ h(b);
152
+ }, options: r, placeholderText: n.dropdownPlaceholderText ?? (x ? "Select choice" : "Select choice(s)"), value: r.filter((m) => o[m.id].isSelected) }) : e("div", { className: R(j("ul-card__choices", v)), role: x ? "radiogroup" : "group", children: [r.map(({ id: m, label: b, value: I, optionProperties: P }) => {
153
+ var V, z;
154
+ const L = `${m}`, { allowsTextEntry: H, noneOfTheAbove: F } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...P };
155
+ return e(Te, { allowTextEntry: H, border: d, disabled: c(L), error: (G = o, S(G)), id: L, isRadio: x, isSelected: !!((V = o[L]) != null && V.isSelected), label: b, noneOfTheAbove: F, onUserInputChanged: A, promptText: (P == null ? void 0 : P.otherOptionPlaceholder) || "Please specify", text: (z = o[m]) == null ? void 0 : z.userText, useMobileStyling: v, value: I }, L);
156
+ var G;
157
+ }), !!q && e("div", { className: "ul-card__min-select-counter", children: [N(o), "/", n.minSelect] })] }), Q && e(st, { handleSubmit: p, isSubmitDisabled: E(o) })] }), e(re, { children: e(ae, { isDisabled: E(o), onClick: p, children: X(n) }) })] }) }, s);
158
+ }, kt = (t) => {
159
159
  const { questionId: a, type: r, next: n, options: s } = t;
160
- return e(Be, { ...t, onSubmit: (i, l) => {
161
- const u = Object.entries(i).find(([, h]) => h.isSelected) || [void 0, void 0], [d, b] = u, y = s.find((h) => `${h.id}` === d), o = b != null && b.userText ? { [d]: { userText: b.userText } } : null;
160
+ return e(Ae, { ...t, onSubmit: (i, l) => {
161
+ const u = Object.entries(i).find(([, h]) => h.isSelected) || [void 0, void 0], [d, v] = u, y = s.find((h) => `${h.id}` === d), o = v != null && v.userText ? { [d]: { userText: v.userText } } : null;
162
162
  n({ value: y && d ? { [d]: y.value } : {}, secondaryValue: o, questionId: a, type: r }, l);
163
163
  } });
164
- }, kt = (t) => {
164
+ }, xt = (t) => {
165
165
  const { questionId: a, type: r, next: n } = t;
166
- return e(Be, { ...t, onSubmit: (s, i) => {
167
- const l = Object.entries(s).reduce((d, [b, y]) => (d[b] = y.isSelected, d), {}), u = Object.entries(s).reduce((d, [b, y]) => {
166
+ return e(Ae, { ...t, onSubmit: (s, i) => {
167
+ const l = Object.entries(s).reduce((d, [v, y]) => (d[v] = y.isSelected, d), {}), u = Object.entries(s).reduce((d, [v, y]) => {
168
168
  if (!y.userText) return d;
169
169
  const o = d || {};
170
- return o[b] = { userText: y.userText }, o;
170
+ return o[v] = { userText: y.userText }, o;
171
171
  }, null);
172
172
  n({ value: l, secondaryValue: u, questionId: a, type: r }, i);
173
173
  } });
174
- }, xt = ({ className: t, labels: a, properties: r, next: n, questionId: s, type: i }) => {
175
- const [l, u] = O(null), { border: d, useMobileStyling: b, viewDocument: y } = $((x) => ({ border: x.border, useMobileStyling: x.useMobileStyling, viewDocument: x.viewDocument })), o = a && a.left, h = a && a.right;
176
- return e("form", { className: R(t, "ul-card--nps", "fade-in-transition"), children: e(J, { properties: r, children: [e(ne, { children: [e("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((x, k) => e("button", { className: R(j("nps-number", b), j(`nps-number-${k}`, b)), id: `option-${k}`, onClick: (g) => {
177
- g.preventDefault(), g.stopPropagation(), u(k);
174
+ }, Ct = ({ className: t, labels: a, properties: r, next: n, questionId: s, type: i }) => {
175
+ const [l, u] = O(null), { border: d, useMobileStyling: v, viewDocument: y } = $((x) => ({ border: x.border, useMobileStyling: x.useMobileStyling, viewDocument: x.viewDocument })), o = a && a.left, h = a && a.right;
176
+ return e("form", { className: R(t, "ul-card--nps", "fade-in-transition"), children: e(J, { properties: r, children: [e(ne, { children: [e("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((x, f) => e("button", { className: R(j("nps-number", v), j(`nps-number-${f}`, v)), id: `option-${f}`, onClick: (g) => {
177
+ g.preventDefault(), g.stopPropagation(), u(f);
178
178
  }, onKeyDown: (g) => {
179
- var N, P;
179
+ var N, q;
180
180
  const S = y.querySelectorAll("button.nps-number");
181
- g.key === "ArrowRight" ? (N = S[k + 1]) == null || N.focus() : g.key === "ArrowLeft" ? (P = S[k - 1]) == null || P.focus() : g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), u(k));
181
+ g.key === "ArrowRight" ? (N = S[f + 1]) == null || N.focus() : g.key === "ArrowLeft" ? (q = S[f - 1]) == null || q.focus() : g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), u(f));
182
182
  }, onPointerDown: (g) => {
183
183
  g.currentTarget.style.zIndex = "2", g.currentTarget.style.borderColor = d;
184
184
  }, onPointerLeave: (g) => {
185
185
  g.currentTarget.style.zIndex = "auto", g.currentTarget.style.borderColor = Ne;
186
- }, style: l === k ? { backgroundColor: d, color: "#fff" } : void 0, tabIndex: 0, children: k }, k)) }), e("div", { className: "ul-card--nps__labels", children: [e("span", { children: o }), e("span", { children: h })] })] }), e(re, { children: e(ae, { isDisabled: l === null && r.required, onClick: () => n({ value: l, questionId: s, type: i }, !0), children: X(r) }) })] }) }, s);
187
- }, Ct = ({ className: t, next: a, properties: r, questionId: n, type: s, onSubmitButtonClick: i }) => {
188
- const { border: l, useMobileStyling: u, update: d } = $((S) => ({ border: S.border, useMobileStyling: S.useMobileStyling, update: S.update })), [b, y] = O(""), o = ee(null), h = b.trim(), x = r.required === !0 && !h, k = st(o, () => d()), g = r && r.openTextPlaceholder ? r.openTextPlaceholder : "";
186
+ }, style: l === f ? { backgroundColor: d, color: "#fff" } : void 0, tabIndex: 0, children: f }, f)) }), e("div", { className: "ul-card--nps__labels", children: [e("span", { children: o }), e("span", { children: h })] })] }), e(re, { children: e(ae, { isDisabled: l === null && r.required, onClick: () => n({ value: l, questionId: s, type: i }, !0), children: X(r) }) })] }) }, s);
187
+ }, St = ({ className: t, next: a, properties: r, questionId: n, type: s, onSubmitButtonClick: i }) => {
188
+ const { border: l, useMobileStyling: u, update: d } = $((S) => ({ border: S.border, useMobileStyling: S.useMobileStyling, update: S.update })), [v, y] = O(""), o = ee(null), h = v.trim(), x = r.required === !0 && !h, f = it(o, () => d()), g = r && r.openTextPlaceholder ? r.openTextPlaceholder : "";
189
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(ne, { children: [e("div", { className: "ul-card-text__container", children: e("textarea", { "aria-describedby": "ul-caption", "aria-labelledby": "ul-question", "aria-multiline": "true", "aria-placeholder": g, className: R(j("ul-card-text__input", u)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: (S) => {
190
190
  S.currentTarget.style.borderColor = Ne;
191
191
  }, onChange: (S) => {
192
192
  const { value: N } = S.currentTarget;
193
- k(), S.preventDefault(), S.stopPropagation(), y(N);
193
+ f(), S.preventDefault(), S.stopPropagation(), y(N);
194
194
  }, onFocus: (S) => {
195
195
  S.currentTarget.style.borderColor = l;
196
196
  }, placeholder: g, ref: o, role: "textbox", tabIndex: 0 }) }), r.footerHtml && e(de, { className: "footer", html: r.footerHtml })] }), e(re, { children: e(ae, { isDisabled: x, onClick: (S) => {
197
197
  S.preventDefault(), S.stopPropagation();
198
198
  const N = r.required !== !0 || h.length > 0;
199
- a({ value: b, questionId: n, type: s }, N), i && i();
199
+ a({ value: v, questionId: n, type: s }, N), i && i();
200
200
  }, children: X(r) }) })] }) }) }, n);
201
- }, St = ({ className: t, labels: a, next: r, properties: n, questionId: s, type: i, onSubmitButtonClick: l, options: u }) => {
202
- const d = ee(null), b = ee(0), y = ee(0), o = ee(null), h = ee(!1), x = ee([]), [k, g] = O(() => (n == null ? void 0 : n.required) === !0), [S, N] = O(() => u.map((C) => ({ ...C, rank: null }))), P = ce(() => Array.from({ length: u.length }, (C, D) => D + 1), [u.length]), { useMobileStyling: E, isPreview: _, headers: Q } = $((C) => ({ useMobileStyling: C.useMobileStyling, isPreview: C.isPreview, headers: C.headers })), A = (Q == null ? void 0 : Q["userleap-platform"]) === "android", c = E && !_ && !A, p = !c && !A, f = (C, D) => {
203
- N((q) => {
204
- const T = parseInt(D), U = q.map((M) => ({ ...M }));
201
+ }, Tt = ({ className: t, labels: a, next: r, properties: n, questionId: s, type: i, onSubmitButtonClick: l, options: u }) => {
202
+ const d = ee(null), v = ee(0), y = ee(0), o = ee(null), h = ee(!1), x = ee([]), [f, g] = O(() => (n == null ? void 0 : n.required) === !0), [S, N] = O(() => u.map((C) => ({ ...C, rank: null }))), q = ce(() => Array.from({ length: u.length }, (C, w) => w + 1), [u.length]), { useMobileStyling: E, isPreview: _, headers: Q } = $((C) => ({ useMobileStyling: C.useMobileStyling, isPreview: C.isPreview, headers: C.headers })), A = (Q == null ? void 0 : Q["userleap-platform"]) === "android", c = E && !_ && !A, p = !c && !A, k = (C, w) => {
203
+ N((D) => {
204
+ const T = parseInt(w), U = D.map((M) => ({ ...M }));
205
205
  U.some((M) => M.rank == null) && U.forEach((M, se) => M.rank = se + 1);
206
206
  const Y = U.findIndex((M) => M.id === C);
207
- if (Y === -1) return q;
207
+ if (Y === -1) return D;
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);
211
211
  }) : T > B && U.forEach((M) => {
212
212
  M.id !== C && M.rank > B && M.rank <= T && (M.rank = M.rank - 1);
213
- }), U[Y].rank = T, U.sort((M, se) => M.rank - se.rank), V(), U;
213
+ }), U[Y].rank = T, U.sort((M, se) => M.rank - se.rank), F(), U;
214
214
  });
215
- }, m = (C, D) => {
216
- for (let q = 0; q < x.current.length; q++) {
217
- const T = x.current[q];
215
+ }, m = (C, w) => {
216
+ for (let D = 0; D < x.current.length; D++) {
217
+ const T = x.current[D];
218
218
  if (!T || T === o.current) continue;
219
219
  const U = T.getBoundingClientRect();
220
- if (C >= U.left && C <= U.right && D >= U.top && D <= U.bottom) return { element: T, index: q };
220
+ if (C >= U.left && C <= U.right && w >= U.top && w <= U.bottom) return { element: T, index: D };
221
221
  }
222
222
  return null;
223
- }, v = (C) => (D) => {
223
+ }, b = (C) => (w) => {
224
224
  if (!c) return;
225
- D.preventDefault(), D.stopPropagation(), h.current = !0, d.current = C;
226
- const q = D.touches[0];
227
- b.current = q.clientY, y.current = q.clientY;
228
- const T = D.currentTarget.closest(".ul-card-rank__option");
225
+ w.preventDefault(), w.stopPropagation(), h.current = !0, d.current = C;
226
+ const D = w.touches[0];
227
+ v.current = D.clientY, y.current = D.clientY;
228
+ const T = w.currentTarget.closest(".ul-card-rank__option");
229
229
  T && (o.current = T, T.classList.add("is-dragging"));
230
230
  }, I = (C) => {
231
231
  if (!c || !h.current || d.current === null) return;
232
232
  C.preventDefault(), C.stopPropagation();
233
- const D = C.touches[0];
234
- y.current = D.clientY;
235
- const q = y.current - b.current;
236
- o.current && (o.current.style.transform = `translateY(${q}px)`, o.current.style.zIndex = "1000"), x.current.forEach((U) => {
233
+ const w = C.touches[0];
234
+ y.current = w.clientY;
235
+ const D = y.current - v.current;
236
+ o.current && (o.current.style.transform = `translateY(${D}px)`, o.current.style.zIndex = "1000"), x.current.forEach((U) => {
237
237
  U && U !== o.current && U.classList.remove("is-drop-target");
238
238
  });
239
- const T = m(D.clientX, D.clientY);
239
+ const T = m(w.clientX, w.clientY);
240
240
  T && T.element.classList.add("is-drop-target");
241
- }, w = (C) => {
241
+ }, P = (C) => {
242
242
  if (!c || !h.current || d.current === null) return;
243
243
  C.preventDefault(), C.stopPropagation();
244
- const D = C.changedTouches[0], q = m(D.clientX, D.clientY);
244
+ const w = C.changedTouches[0], D = m(w.clientX, w.clientY);
245
245
  o.current && (o.current.style.transform = "", o.current.style.zIndex = "", o.current.classList.remove("is-dragging")), x.current.forEach((T) => {
246
246
  T && T.classList.remove("is-drop-target");
247
- }), q && q.index !== d.current && L(d.current, q.index), d.current = null, o.current = null, h.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) => {
247
+ }), D && D.index !== d.current && L(d.current, D.index), d.current = null, o.current = null, h.current = !1;
248
+ }, L = (C, w) => {
249
+ N((D) => {
250
+ const T = D.map((Y) => ({ ...Y })), [U] = T.splice(C, 1);
251
+ return T.splice(w, 0, U), T.forEach((Y, B) => {
252
252
  Y.rank = B + 1;
253
- }), V(), T;
253
+ }), F(), T;
254
254
  });
255
255
  }, H = (C) => {
256
- const D = {};
257
- C.reduce((q, T) => (q[T.id] = T.rank, q), D), r({ value: D, questionId: s, type: i }, !0);
258
- }, V = () => {
256
+ const w = {};
257
+ C.reduce((D, T) => (D[T.id] = T.rank, D), w), r({ value: w, questionId: s, type: i }, !0);
258
+ }, F = () => {
259
259
  g(!1);
260
- }, { left: F, right: G } = a, z = u.length, ue = (C) => {
260
+ }, { left: G, right: V } = a, z = u.length, ue = (C) => {
261
261
  C.preventDefault(), C.currentTarget.classList.add("is-drop-target");
262
- }, Ze = (C) => {
262
+ }, je = (C) => {
263
263
  C.currentTarget.classList.remove("is-drop-target");
264
- }, Ye = (C) => {
264
+ }, Ze = (C) => {
265
265
  d.current = null, C.currentTarget.classList.remove("is-dragging");
266
266
  };
267
267
  return e("form", { className: R(t, "ul-card-rank", "fade-in-transition"), onSubmit: (C) => {
268
268
  C.preventDefault(), H(S), l && l();
269
- }, children: e(J, { properties: n, children: e(he, A ? { children: [e(ne, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", F] }) }), 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) => f(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, " - ", G] }) })] }) }), e(re, { children: e("div", { className: "ul-card__button-wrapper", children: e(W, { disabled: k, children: X(n) }) }) })] } : { children: [e(ne, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", F] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: A ? void 0 : (C) => {
269
+ }, children: e(J, { properties: n, children: e(he, A ? { children: [e(ne, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", G] }) }), e("ol", { className: "ul-card-rank__list", children: S.map(({ id: C, label: w, rank: D }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${w}`, className: R("ul-card-rank__select", D == null && "ul-card-rank__select--placeholder"), name: `rank[${C}]`, onChange: (T) => k(C, T.currentTarget.value), value: D ?? "", children: [D == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), q.map((T) => e("option", { className: "ul-card-rank__select-option", value: T, children: T }, `${T}-${s}`))] }), e("span", { children: w })] }, C)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [z, " - ", V] }) })] }) }), e(re, { children: e("div", { className: "ul-card__button-wrapper", children: e(W, { disabled: f, children: X(n) }) }) })] } : { children: [e(ne, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", G] }) }), 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: D, rank: q }, T) => {
272
- return e("li", { className: "ul-card-rank__option", draggable: !!p || void 0, onDragEnd: p ? Ye : void 0, onDragEnter: p ? ue : void 0, onDragLeave: p ? Ze : void 0, onDragStart: p ? (Y = T, (B) => {
271
+ }, children: S.map(({ id: C, label: w, rank: D }, T) => {
272
+ return e("li", { className: "ul-card-rank__option", draggable: !!p || void 0, onDragEnd: p ? Ze : void 0, onDragEnter: p ? ue : void 0, onDragLeave: p ? je : void 0, onDragStart: p ? (Y = T, (B) => {
273
273
  d.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 se, qe;
276
276
  B.preventDefault(), B.currentTarget.classList.remove("is-drop-target");
277
277
  const M = d.current;
278
278
  d.current = null, (qe = (se = B.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : se.querySelector(".is-dragging")) == null || qe.classList.remove("is-dragging"), M != null && M !== U && L(M, U);
279
- }) : void 0, ref: (B) => x.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) => f(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: c ? w : void 0, onTouchMove: c ? I : void 0, onTouchStart: c ? v(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);
279
+ }) : void 0, ref: (B) => x.current[T] = B, children: [e("select", { "aria-label": `Rank for ${w}`, className: R("ul-card-rank__select", D == null && "ul-card-rank__select--placeholder"), name: `rank[${C}]`, onChange: (B) => k(C, B.currentTarget.value), value: D ?? "", children: [D == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), q.map((B) => e("option", { className: "ul-card-rank__select-option", value: B, children: B }, B))] }), e("span", { children: w }), !A && e("button", { "aria-label": `Drag ${w} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: c ? P : void 0, onTouchMove: c ? I : void 0, onTouchStart: c ? 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
- }) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [z, " - ", G] }) })] }) }), e(re, { children: e("div", { className: "ul-card__button-wrapper", children: e(W, { disabled: k, children: X(n) }) }) })] }) }) }, s);
282
- }, ke = 1, $e = 2, Oe = 3, me = (t) => t.type === "av_permission", Le = (t) => t.type === "screen_permission", Qe = (t, a) => t === void 0 ? ke : t ? ((r, n) => !(me(n) ? n.permissionDescriptors : []).includes("camera") || r.getVideoTracks().length > 0)(t, a) ? Oe : ke : $e, Re = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
283
- }, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, K = Ke((t) => ({ ...Re, reset: () => {
284
- t(Re);
281
+ }) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [z, " - ", V] }) })] }) }), e(re, { children: e("div", { className: "ul-card__button-wrapper", children: e(W, { disabled: f, children: X(n) }) }) })] }) }) }, s);
282
+ }, ke = 1, Be = 2, $e = 3, me = (t) => t.type === "av_permission", Pe = (t) => t.type === "screen_permission", Oe = (t, a) => t === void 0 ? ke : t ? ((r, n) => !(me(n) ? n.permissionDescriptors : []).includes("camera") || r.getVideoTracks().length > 0)(t, a) ? $e : ke : Be, Le = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
283
+ }, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, K = ze((t) => ({ ...Le, reset: () => {
284
+ t(Le);
285
285
  }, updatePage: (a) => {
286
286
  t(a);
287
287
  } }));
@@ -291,7 +291,7 @@ function xe({ currentPage: t, pages: a }) {
291
291
  if (r === l) return;
292
292
  let d = t;
293
293
  if (l && !t.permissionDescriptors.includes("camera")) {
294
- const b = a.indexOf(t), y = u != null && u.active ? b + 2 : b + 1;
294
+ const v = a.indexOf(t), y = u != null && u.active ? v + 2 : v + 1;
295
295
  u != null && u.active && n && i.emit("begin.recording", { "recording.media.types": n, "start.recording.callback": (o) => s({ mediaRecordingUids: o }) }), d = a[y];
296
296
  }
297
297
  s({ currentPage: d, avStream: l });
@@ -299,14 +299,14 @@ function xe({ currentPage: t, pages: a }) {
299
299
  }
300
300
  function Ce({ status: t }) {
301
301
  const { nextQuestion: a, passthroughData: r, mediaRecordingUids: n, reset: s } = K.getState(), { recorderEventEmitter: i, handleUploadUpdate: l, index: u } = $.getState(), d = { value: { taskStatus: t }, type: "recordedtask", questionId: (r == null ? void 0 : r.questionId) || 1 };
302
- r && i.emit("finish.task", { "begin.callback": (b) => {
303
- l({ mediaRecordingUid: b, isSubmitted: !0, progressPct: 0, isComplete: !1 });
304
- }, "progress.callback": (b, y) => {
305
- l({ mediaRecordingUid: b, progressPct: y.detail, isSubmitted: !1, isComplete: !1 });
306
- }, "upload.callback": (b) => {
307
- b && l({ mediaRecordingUid: b, isComplete: !0, isSubmitted: !0, progressPct: 100 });
308
- }, "passthrough.data": r, "current.index": u, "task.response": d, "task.complete.callback": (b) => {
309
- d.value.taskDurationMillisecond = b, n && (d.value.mediaRecordingUids = n), s(), a(d);
302
+ r && i.emit("finish.task", { "begin.callback": (v) => {
303
+ l({ mediaRecordingUid: v, isSubmitted: !0, progressPct: 0, isComplete: !1 });
304
+ }, "progress.callback": (v, y) => {
305
+ l({ mediaRecordingUid: v, progressPct: y.detail, isSubmitted: !1, isComplete: !1 });
306
+ }, "upload.callback": (v) => {
307
+ v && l({ mediaRecordingUid: v, isComplete: !0, isSubmitted: !0, progressPct: 100 });
308
+ }, "passthrough.data": r, "current.index": u, "task.response": d, "task.complete.callback": (v) => {
309
+ d.value.taskDurationMillisecond = v, n && (d.value.mediaRecordingUids = n), s(), a(d);
310
310
  } });
311
311
  }
312
312
  function we({ pages: t, setIsRequestingPermission: a }) {
@@ -315,13 +315,13 @@ function we({ pages: t, setIsRequestingPermission: a }) {
315
315
  const d = t.indexOf(i);
316
316
  switch (i.type) {
317
317
  case "av_permission": {
318
- const b = u ? d + 2 : d + 1;
318
+ const v = u ? d + 2 : d + 1;
319
319
  return u && l && r.emit("begin.recording", { "recording.media.types": l, "start.recording.callback": (y) => {
320
320
  s({ mediaRecordingUids: y });
321
- } }), void s({ currentPage: t[b] });
321
+ } }), void s({ currentPage: t[v] });
322
322
  }
323
323
  case "screen_permission":
324
- return void r.emit("screen.permission", { "screen.permission.requested": a, "stream.ready.callback": (b, y) => {
324
+ return void r.emit("screen.permission", { "screen.permission.requested": a, "stream.ready.callback": (v, y) => {
325
325
  const o = y ? t[d + 1] : i;
326
326
  y && l && r.emit("begin.recording", { "recording.media.types": l, "start.recording.callback": (h) => {
327
327
  s({ captureStream: y, mediaRecordingUids: h });
@@ -333,7 +333,7 @@ function we({ pages: t, setIsRequestingPermission: a }) {
333
333
  return;
334
334
  }
335
335
  }
336
- const He = "ul-permission-graphics-container", Ve = "ul-permission-body", Fe = R(He, "ul_recorded-task-inset-spacing"), ge = R("ul-horizontal-button-container", "ul-horizontal-button-container-left"), Ge = ({ 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: Ce.bind(null, { status: "abandoned" }), children: a || "Skip" }), De = (t) => {
336
+ const Qe = "ul-permission-graphics-container", He = "ul-permission-body", Fe = R(Qe, "ul_recorded-task-inset-spacing"), ge = R("ul-horizontal-button-container", "ul-horizontal-button-container-left"), Ge = ({ 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: Ce.bind(null, { status: "abandoned" }), children: a || "Skip" }), De = (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
  te(() => {
339
339
  const l = setInterval(() => {
@@ -341,75 +341,75 @@ const He = "ul-permission-graphics-container", Ve = "ul-permission-body", Fe = R
341
341
  }, 1e3);
342
342
  return () => clearInterval(l);
343
343
  }, [a, r, i, t, n, s]);
344
- }, Tt = ({ content: t, pages: a, required: r }) => {
344
+ }, _t = ({ content: t, pages: a, required: r }) => {
345
345
  const { buttonText: n, skipButtonText: s, taskDetail: i } = t;
346
346
  return De(a), e("div", { className: "ul-task-page", children: [i && e(Ge, { richTextBody: i }), e("div", { className: ge, children: [e(W, { onClick: we.bind(null, { pages: a }), children: n }), e(ve, { required: r, skipButtonText: s })] })] }, "start-task");
347
- }, _t = ({ content: t, pages: a, properties: r }) => {
347
+ }, Nt = ({ content: t, pages: a, properties: r }) => {
348
348
  const { buttonText: n, skipButtonText: s } = t;
349
349
  return De(a), e("div", { className: "ul-task-page", children: [t.taskDetail && e(Ge, { richTextBody: t.taskDetail }), e(J, { properties: r, children: e("div", { className: ge, children: [e(W, { className: "ul-complete-task-button", onClick: Ce.bind(null, { status: "completed" }), children: n }), e(W, { className: R("ul-button-inactive"), onClick: Ce.bind(null, { status: "given.up" }), children: s })] }) })] }, "complete-task");
350
- }, Nt = ({ content: t, pages: a, required: r }) => {
350
+ }, It = ({ content: t, pages: a, required: r }) => {
351
351
  const { buttonText: n, skipButtonText: s } = t, [i] = $((d) => [d.tabTitle]), [l, u] = O(!1);
352
- return e("div", { children: [e("div", { className: Fe, children: [e("p", { style: { marginTop: "auto" }, children: t.selectTabText }), e("div", { className: "ul-select-tab-container", children: e("p", { className: Ve, children: i }) })] }), e("div", { className: r ? "" : ge, children: [e(W, { disabled: l, onClick: we.bind(null, { pages: a, setIsRequestingPermission: u }), children: n }), e(ve, { required: r, skipButtonText: s })] })] });
353
- }, It = ({ content: t }) => e(de, { className: R(He, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), html: t.svg }, "ul-permission-request-graphic"), wt = ({ content: t, pages: a, required: r }) => {
352
+ return e("div", { children: [e("div", { className: Fe, children: [e("p", { style: { marginTop: "auto" }, children: t.selectTabText }), e("div", { className: "ul-select-tab-container", children: e("p", { className: He, children: i }) })] }), e("div", { className: r ? "" : ge, children: [e(W, { disabled: l, onClick: we.bind(null, { pages: a, setIsRequestingPermission: u }), children: n }), e(ve, { required: r, skipButtonText: s })] })] });
353
+ }, wt = ({ content: t }) => e(de, { className: R(Qe, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), html: t.svg }, "ul-permission-request-graphic"), Dt = ({ 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 te(() => {
356
356
  const d = setInterval(() => {
357
357
  u !== null && xe({ currentPage: u, pages: a });
358
358
  }, 1e3);
359
359
  return () => clearInterval(d);
360
- }, [u, a]), u ? e("div", { children: [e("div", { className: Fe, children: e("p", { className: "ul-av-permission-denied-paragraph", children: [e("span", { className: "ul-av-permission-denied-headline", children: n }), e("span", { className: Ve, children: s })] }) }), e("div", { className: ge, children: [e(W, { onClick: xe.bind(null, { currentPage: u, pages: a }), children: l }), e(ve, { required: r, skipButtonText: i })] })] }) : null;
361
- }, Dt = ({ stream: t }) => e("video", { autoPlay: !0, className: R("ul_recorded-task-inset-spacing"), id: "ul-record-task-video-preview", muted: !0, ref: (a) => {
360
+ }, [u, a]), u ? e("div", { children: [e("div", { className: Fe, children: e("p", { className: "ul-av-permission-denied-paragraph", children: [e("span", { className: "ul-av-permission-denied-headline", children: n }), e("span", { className: He, children: s })] }) }), e("div", { className: ge, children: [e(W, { onClick: xe.bind(null, { currentPage: u, pages: a }), children: l }), e(ve, { required: r, skipButtonText: i })] })] }) : null;
361
+ }, qt = ({ 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
- } }), qt = ({ content: t, pages: a, required: r }) => {
363
+ } }), Pt = ({ content: t, pages: a, required: r }) => {
364
364
  const { skipButtonText: n } = t, { avStream: s } = K.getState();
365
- return De(a), e("div", { children: [e(Dt, { stream: s }), e("div", { className: "ul-vertical-button-container-center", children: [e(W, { onClick: we.bind(null, { pages: a }), children: t.buttonText }), e(ve, { bottom: !0, required: r, skipButtonText: n })] })] });
366
- }, Pt = ({ properties: t }) => {
365
+ return De(a), e("div", { children: [e(qt, { stream: s }), e("div", { className: "ul-vertical-button-container-center", children: [e(W, { onClick: we.bind(null, { pages: a }), children: t.buttonText }), e(ve, { bottom: !0, required: r, skipButtonText: n })] })] });
366
+ }, Lt = ({ properties: t }) => {
367
367
  const { pages: a, required: r } = t, { avStream: n, currentPage: s } = K.getState();
368
368
  if (s === void 0) return null;
369
369
  switch (s == null ? void 0 : s.type) {
370
370
  case "av_permission": {
371
- const i = Qe(n, s);
372
- return i === ke ? e(It, { content: s }) : e(i === $e ? wt : qt, { content: s, pages: a, required: r });
371
+ const i = Oe(n, s);
372
+ return i === ke ? e(wt, { content: s }) : e(i === Be ? Dt : Pt, { content: s, pages: a, required: r });
373
373
  }
374
374
  case "screen_permission":
375
- return e(Nt, { content: s, pages: a, required: r });
375
+ return e(It, { content: s, pages: a, required: r });
376
376
  case "start_task":
377
- return e(Tt, { content: s, pages: a, required: r });
377
+ return e(_t, { content: s, pages: a, required: r });
378
378
  case "complete_task":
379
- return e(_t, { content: s, pages: a, properties: t });
379
+ return e(Nt, { content: s, pages: a, properties: t });
380
380
  default:
381
381
  return null;
382
382
  }
383
- }, Lt = ({ className: t, properties: a, next: r, questionId: n }) => {
384
- const s = $(), { surveyId: i, responseGroupUid: l, userId: u } = s, d = K(), { screenPermissionRequested: b } = d, y = K((g) => g.avStream);
383
+ }, Rt = ({ className: t, properties: a, next: r, questionId: n }) => {
384
+ const s = $(), { surveyId: i, responseGroupUid: l, userId: u } = s, d = K(), { screenPermissionRequested: v } = d, y = K((g) => g.avStream);
385
385
  let o = K((g) => g.currentPage);
386
- o || (o = function({ pages: g, userId: S, responseGroupUid: N, surveyId: P, questionId: E, next: _ }) {
387
- const { updatePage: Q } = K.getState(), { eventEmitFn: A, recorderEventEmitter: c } = $.getState(), p = { questionId: E, surveyId: P, visitorId: S, responseGroupUid: N };
388
- let f = 0;
389
- c.emit("recorded.task.permission.screen"), A("recorded.task.permission.screen"), c.emit("permission.status", { "permission.status.callback": (v, I, w, L) => {
390
- const H = g[f], { type: V } = H, F = ["screen"];
386
+ o || (o = function({ pages: g, userId: S, responseGroupUid: N, surveyId: q, questionId: E, next: _ }) {
387
+ const { updatePage: Q } = K.getState(), { eventEmitFn: A, recorderEventEmitter: c } = $.getState(), p = { questionId: E, surveyId: q, visitorId: S, responseGroupUid: N };
388
+ let k = 0;
389
+ c.emit("recorded.task.permission.screen"), A("recorded.task.permission.screen"), c.emit("permission.status", { "permission.status.callback": (b, I, P, L) => {
390
+ const H = g[k], { type: F } = H, G = ["screen"];
391
391
  if (me(H)) {
392
- const { permissionDescriptors: G } = H, z = G == null ? void 0 : G.includes("microphone"), ue = G == null ? void 0 : G.includes("camera");
393
- z && F.push("audio"), ue && F.push("video"), (v != null && v.active && !ue || v != null && v.active && I) && f++;
392
+ const { permissionDescriptors: V } = H, z = V == null ? void 0 : V.includes("microphone"), ue = V == null ? void 0 : V.includes("camera");
393
+ z && G.push("audio"), ue && G.push("video"), (b != null && b.active && !ue || b != null && b.active && I) && k++;
394
394
  }
395
- Le(g[f]) && w && (f++, c.emit("begin.recording", { "recording.media.types": F, "start.recording.callback": (G) => Q({ mediaRecordingUids: G }) })), Q({ currentPage: g[f], avStream: v, screenPermissionRequested: w, nextQuestion: _, type: V, passthroughData: p, recordingMediaTypes: F, captureStream: L });
395
+ Pe(g[k]) && P && (k++, c.emit("begin.recording", { "recording.media.types": G, "start.recording.callback": (V) => Q({ mediaRecordingUids: V }) })), Q({ currentPage: g[k], avStream: b, screenPermissionRequested: P, nextQuestion: _, type: F, passthroughData: p, recordingMediaTypes: G, captureStream: L });
396
396
  } });
397
- const m = g[f];
397
+ const m = g[k];
398
398
  return m.type === "av_permission" && xe({ currentPage: m, pages: g }), m;
399
399
  }({ questionId: n, surveyId: i, next: (g) => {
400
400
  r(g, !0);
401
401
  }, pages: a.pages, responseGroupUid: l, userId: u }));
402
402
  let h = o.headline, x = o.captionText;
403
- const k = Qe(y, o);
404
- return Le(o) && b && (h = o.permissionDeniedHeadline, x = o.permissionDeniedCaptionText), me(o) && k === Oe && (h = o.permissionGrantedHeadline, x = o.permissionGrantedCaptionText), e("div", { className: R(t, "ul-center-horizontally", "fade-in-transition"), children: [e(_e, { isRequired: a == null ? void 0 : a.required, message: h, properties: { captionText: x } }), e(ne, { children: e(Pt, { properties: a }) })] });
405
- }, Rt = ({ className: t, next: a, properties: r, questionId: n, type: s }) => {
406
- const { visitorAttributes: i, isLongFormSurvey: l } = $((y) => ({ visitorAttributes: y.visitorAttributes, isLongFormSurvey: Ae(y.studyType) })), u = (y, o = !1) => {
403
+ const f = Oe(y, o);
404
+ return Pe(o) && v && (h = o.permissionDeniedHeadline, x = o.permissionDeniedCaptionText), me(o) && f === $e && (h = o.permissionGrantedHeadline, x = o.permissionGrantedCaptionText), e("div", { className: R(t, "ul-center-horizontally", "fade-in-transition"), children: [e(_e, { isRequired: a == null ? void 0 : a.required, message: h, properties: { captionText: x } }), e(ne, { children: e(Lt, { properties: a }) })] });
405
+ }, Mt = ({ className: t, next: a, properties: r, questionId: n, type: s }) => {
406
+ const { visitorAttributes: i, isLongFormSurvey: l } = $((y) => ({ visitorAttributes: y.visitorAttributes, isLongFormSurvey: Ee(y.studyType) })), u = (y, o = !1) => {
407
407
  a({ value: o ? { skipped: !0 } : void 0, questionId: n, type: s }, !0);
408
- }, d = it(r && r.buttonUrl, i), b = l && r.promptActionType === Xe.NO_BUTTON;
409
- return e("div", { className: R(t, "ul-card__text-url-prompt", "fade-in-transition"), children: e(J, { properties: r, children: !b && 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: d, id: "ul-card-text__button", onClick: u, onKeyPress: (y) => {
408
+ }, d = ot(r && r.buttonUrl, i), v = l && r.promptActionType === Ke.NO_BUTTON;
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: d, 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: d ? "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: Se(r) })] }) }) }) }, n);
412
- }, Mt = ({ className: t, questionId: a }) => {
412
+ }, Ut = ({ className: t, questionId: a }) => {
413
413
  const { border: r, destroy: n, endCard: s, forceBrandedLogo: i } = $((d) => ({ border: d.border, destroy: d.destroy, endCard: d.endCard, forceBrandedLogo: d.forceBrandedLogo }));
414
414
  te(() => {
415
415
  setTimeout(() => {
@@ -418,197 +418,193 @@ const He = "ul-permission-graphics-container", Ve = "ul-permission-body", Fe = R
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
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(_e, { message: u }), l] }) }) }, a);
421
- }, Ut = () => e("div", { className: "thinking-dots-container", children: e("div", { className: "thinking-dot" }) }), Et = ({ className: t }) => {
421
+ }, Et = () => e("div", { className: "thinking-dots-container", children: e("div", { className: "thinking-dot" }) }), At = ({ className: t }) => {
422
422
  const { uploadProgress: a } = $((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
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(_e, { message: `${r} (${s}% complete)` }), e("p", { className: "ul-caption", children: n })] });
427
- }, Me = 0, Ue = 1, At = ({ 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: d, headers: b, responseGroupUid: y, surveyId: o, viewDocument: h, visitorId: x } = $((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 })), [k, g] = O(!1), [S, N] = O(null), [P, E] = O(null), [_, Q] = O(Me), A = (p, f) => {
429
- p === Z.UPLOAD_STARTED ? (N(f[Z.UPLOAD_ID]), E(f[Z.MEDIA_RECORDING_UID]), g(!0)) : p === Z.DELETE ? (N(null), E(null), g(!1)) : p === Z.UPLOAD_PROGRESS ? isNaN(f[Z.UPLOAD_PROGRESS_PCT]) ? d({ mediaRecordingUid: f[Z.MEDIA_RECORDING_UID], isComplete: !0 }) : d({ mediaRecordingUid: f[Z.MEDIA_RECORDING_UID], progressPct: f[Z.UPLOAD_PROGRESS_PCT] }) : p === Z.UPLOAD_FINISHED && d({ mediaRecordingUid: f[Z.MEDIA_RECORDING_UID], isComplete: !0 });
427
+ }, Re = 0, Me = 1, Bt = ({ 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: d, headers: v, responseGroupUid: y, surveyId: o, viewDocument: h, visitorId: x } = $((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, g] = O(!1), [S, N] = O(null), [q, E] = O(null), [_, Q] = O(Re), A = (p, k) => {
429
+ p === Z.UPLOAD_STARTED ? (N(k[Z.UPLOAD_ID]), E(k[Z.MEDIA_RECORDING_UID]), g(!0)) : p === Z.DELETE ? (N(null), E(null), g(!1)) : p === Z.UPLOAD_PROGRESS ? isNaN(k[Z.UPLOAD_PROGRESS_PCT]) ? d({ mediaRecordingUid: k[Z.MEDIA_RECORDING_UID], isComplete: !0 }) : d({ mediaRecordingUid: k[Z.MEDIA_RECORDING_UID], progressPct: k[Z.UPLOAD_PROGRESS_PCT] }) : p === Z.UPLOAD_FINISHED && d({ mediaRecordingUid: k[Z.MEDIA_RECORDING_UID], isComplete: !0 });
430
430
  }, c = (p) => {
431
- p.preventDefault(), p.stopPropagation(), document.getElementById(i) && ct(i), S && P ? (d({ mediaRecordingUid: P, isSubmitted: !0 }), a({ value: { mediaRecordingUid: P }, questionId: n, type: s }, !0)) : a({ value: null, questionId: n, type: s }, !0);
431
+ p.preventDefault(), p.stopPropagation(), document.getElementById(i) && dt(i), S && q ? (d({ mediaRecordingUid: q, isSubmitted: !0 }), a({ value: { mediaRecordingUid: q }, questionId: n, type: s }, !0)) : a({ value: null, questionId: n, type: s }, !0);
432
432
  };
433
- return e("form", { className: R(t, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [e(ne, { children: [e("div", { id: "ul-question-player-container", style: { display: _ === Me ? "" : "none" }, children: e(J, { properties: r, children: e("button", { className: "ul-video-btn ul-record-response-btn", onClick: (p) => {
434
- p.preventDefault(), p.stopPropagation(), document.getElementById(i) && ot(i), Q(Ue);
435
- } }) }) }), e("div", { style: { display: _ === Ue ? "block" : "none" }, children: e("div", { id: "ul-recorder-player-container", ref: (p) => {
433
+ return e("form", { className: R(t, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [e(ne, { children: [e("div", { id: "ul-question-player-container", style: { display: _ === Re ? "" : "none" }, children: e(J, { properties: r, children: e("button", { className: "ul-video-btn ul-record-response-btn", onClick: (p) => {
434
+ p.preventDefault(), p.stopPropagation(), document.getElementById(i) && lt(i), Q(Me);
435
+ } }) }) }), e("div", { style: { display: _ === Me ? "block" : "none" }, children: e("div", { id: "ul-recorder-player-container", ref: (p) => {
436
436
  if (p && p.children.length === 0) {
437
- const f = lt(i, { surveyId: o, responseGroupUid: y, questionId: n, visitorId: x, envId: u }, l, A, void 0, { ...b, "x-ul-video-recorder-origin": "sdk" }, r.mediaType === Z.MEDIA_TYPE_AUDIO, h);
438
- p.appendChild(f);
437
+ const k = ct(i, { surveyId: o, responseGroupUid: y, questionId: n, visitorId: x, envId: u }, l, A, void 0, { ...v, "x-ul-video-recorder-origin": "sdk" }, r.mediaType === Z.MEDIA_TYPE_AUDIO, h);
438
+ p.appendChild(k);
439
439
  }
440
- } }) })] }), e(re, { children: [e(ae, { isDisabled: !!r.required && !k, onClick: c, children: X(r) }), e("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: c, style: { ...r.required ? { display: "none" } : {}, ...k ? { display: "none" } : {} }, children: Se(r) })] })] });
440
+ } }) })] }), e(re, { children: [e(ae, { isDisabled: !!r.required && !f, onClick: c, children: X(r) }), e("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: c, style: { ...r.required ? { display: "none" } : {}, ...f ? { display: "none" } : {} }, children: Se(r) })] })] });
441
441
  }, le = (t) => t.type === "aidynamicfollowup" || t.type === "aidynamicstandalone", ye = (t) => {
442
442
  var a;
443
443
  return le(t) && ((a = t.props) == null ? void 0 : a.loading) === fe.inFlight;
444
- }, je = (t) => t.type === "thanks" || t.type === "uploading", Bt = ({ card: t, avatars: a, isThinking: r, isCurrentQuestion: n, currentQuestionBubbleRef: s }) => {
444
+ }, Ve = (t) => t.type === "thanks" || t.type === "uploading", $t = ({ card: t, avatars: a, isThinking: r, isCurrentQuestion: n, currentQuestionBubbleRef: s }) => {
445
445
  const i = ((l) => "properties" in l.props && l.props.properties && "questionHtml" in l.props.properties && l.props.properties.questionHtml ? { content: l.props.properties.questionHtml, isHtml: !0 } : "message" in l.props ? { content: l.props.message, isHtml: !1 } : { content: "Question", isHtml: !1 })(t);
446
- return e(ie, { avatars: a, isLeft: !0, message: { id: `question-${t.name}`, type: "question", content: i.content }, ref: n ? s : null, children: r ? e(Ut, {}) : e(he, { children: [i.isHtml ? e(de, { className: "chat-message-text", html: i.content }) : e("div", { className: "chat-message-text", children: i.content }), t.type === "videovoice" && e(pt, { properties: t.props, questionId: t.name, surveyVideoUrl: t.props.properties.videoUrl })] }) });
447
- }, $t = ({ card: t, avatars: a }) => {
446
+ return e(ie, { avatars: a, isLeft: !0, message: { id: `question-${t.name}`, type: "question", content: i.content }, ref: n ? s : null, children: r ? e(Et, {}) : e(he, { children: [i.isHtml ? e(de, { className: "chat-message-text", html: i.content }) : e("div", { className: "chat-message-text", children: i.content }), t.type === "videovoice" && e(mt, { properties: t.props, questionId: t.name, surveyVideoUrl: t.props.properties.videoUrl })] }) });
447
+ }, Ot = ({ card: t, avatars: a }) => {
448
448
  const r = ((n) => {
449
449
  if (!("properties" in n.props) || !n.props.properties || typeof n.props.properties != "object") return null;
450
450
  const s = n.props.properties, i = [{ key: "captionHtml", isHtml: !0 }, { key: "captionText", isHtml: !1 }, { key: "richTextBody", isHtml: !0 }, { key: "body", isHtml: !1 }];
451
451
  for (const { key: l, isHtml: u } of i) {
452
452
  const d = s[l];
453
453
  if (typeof d != "string") continue;
454
- const b = d.trim();
455
- if (b) {
456
- if (u && !b.replaceAll(/<[^>]*>/g, "").trim()) continue;
457
- return { content: b, isHtml: u };
454
+ const v = d.trim();
455
+ if (v) {
456
+ if (u && !v.replaceAll(/<[^>]*>/g, "").trim()) continue;
457
+ return { content: v, isHtml: u };
458
458
  }
459
459
  }
460
460
  return null;
461
461
  })(t);
462
462
  return r ? e(ie, { avatars: a, hideAvatar: !0, isLeft: !0, message: { id: `caption-${t.name}`, type: "question", content: r.content }, children: r.isHtml ? e(de, { className: "chat-message-text", html: r.content }) : e("div", { className: "chat-message-text", children: r.content }) }) : null;
463
- }, Ot = ({ card: t, userResponse: a, avatars: r }) => {
463
+ }, Qt = ({ card: t, userResponse: a, avatars: r }) => {
464
464
  const n = ((s, i) => {
465
- if (s.type === "open" && i && typeof i == "object" && "value" in i) return i.value;
465
+ if ((s.type === "open" || s.type === "aidynamicfollowup" || s.type === "aidynamicstandalone") && i && typeof i == "object" && "value" in i) return i.value;
466
466
  })(t, a);
467
467
  return e("div", { className: "chat-bubble-container chat-right", children: [e("div", { className: "chat-bubble chat-bubble-right chat-bubble-text-only", children: e("div", { className: "chat-message-text", children: n || e("div", { className: "chat-message-no-response", children: "No response" }) }) }), e("img", { alt: "User Avatar", className: "chat-avatar chat-avatar-right", srcSet: `${r.respondentAvatar["1x"]} 1x, ${r.respondentAvatar["2x"]} 2x` })] });
468
- }, Qt = ({ card: t, avatars: a, isCurrentQuestion: r, currentQuestionBubbleRef: n }) => {
468
+ }, Ht = ({ card: t, avatars: a, isCurrentQuestion: r, currentQuestionBubbleRef: n }) => {
469
469
  const { endCard: s } = $((i) => ({ endCard: i.endCard }));
470
- return e(he, { children: [e(ie, { avatars: a, isLeft: !0, message: { id: `thanks-${t.name}`, type: "question", content: (s == null ? void 0 : s.headline) ?? "Great! Thank you for your participation." }, ref: r ? n : null }), (s == null ? void 0 : s.subheader) && e(ie, { avatars: a, hideAvatar: !0, isLeft: !0, message: { id: `caption-${t.name}`, type: "question", content: s.subheader } }), e(ht, {})] });
471
- }, Ht = ({ card: t, cardIndex: a, index: r, avatars: n, cardResponses: s, questionThinkingStates: i, startingQuestionIdx: l, currentQuestionBubbleRef: u, handleCardResponse: d }) => {
472
- const b = a === r, y = a < r, o = je(t);
473
- if (o) return e(Qt, { avatars: n, card: t, currentQuestionBubbleRef: u, isCurrentQuestion: b });
474
- const h = `${t.name}`, x = s.get(h), k = t.type === "open", g = i.get(h);
470
+ return e(he, { children: [e(ie, { avatars: a, isLeft: !0, message: { id: `thanks-${t.name}`, type: "question", content: (s == null ? void 0 : s.headline) ?? "Great! Thank you for your participation." }, ref: r ? n : null }), (s == null ? void 0 : s.subheader) && e(ie, { avatars: a, hideAvatar: !0, isLeft: !0, message: { id: `caption-${t.name}`, type: "question", content: s.subheader } }), e(gt, {})] });
471
+ }, Ft = ({ card: t, cardIndex: a, index: r, avatars: n, cardResponses: s, questionThinkingStates: i, startingQuestionIdx: l, currentQuestionBubbleRef: u, handleCardResponse: d }) => {
472
+ const v = a === r, y = a < r, o = Ve(t);
473
+ if (o) return e(Ht, { avatars: n, card: t, currentQuestionBubbleRef: u, isCurrentQuestion: v });
474
+ const h = `${t.name}`, x = s.get(h), f = t.type === "open" || t.type === "aidynamicfollowup" || t.type === "aidynamicstandalone", g = i.get(h);
475
475
  if (t.type === "aidynamicfollowup" && (t.props.loading === fe.failure || t.props.loading === void 0) || t.type === "aidynamicstandalone" && t.props.loading === fe.failure) return e(he, {});
476
476
  const S = (a > (l ?? 0) || le(t)) && t.type !== "thanks" && t.type !== "uploading" && (g === !0 || g === void 0);
477
- return e(Ee.Fragment, { children: [e(Bt, { avatars: n, card: t, currentQuestionBubbleRef: u, isCurrentQuestion: b, isThinking: S }), !S && e($t, { avatars: n, card: t }), y && k ? e(Ot, { avatars: n, card: t, userResponse: x }) : (!y || !k) && !S && e(ie, { avatars: n, isLeft: !1, message: { id: `card-${t.name}`, type: "card", content: "" }, children: e("div", { className: "chat-card-container", children: e(Ft, { card: t, className: o ? "chat-thanks-card" : "chat-card", isAnswered: y, next: b ? d : () => {
477
+ return e(Ue.Fragment, { children: [e($t, { avatars: n, card: t, currentQuestionBubbleRef: u, isCurrentQuestion: v, isThinking: S }), !S && e(Ot, { avatars: n, card: t }), y && f ? e(Qt, { avatars: n, card: t, userResponse: x }) : (!y || !f) && !S && e(ie, { avatars: n, isLeft: !1, message: { id: `card-${t.name}`, type: "card", content: "" }, children: e("div", { className: "chat-card-container", children: e(Vt, { card: t, className: o ? "chat-thanks-card" : "chat-card", isAnswered: y, next: v ? d : () => {
478
478
  } }) }) })] }, `question-card-${t.name}`);
479
- }, ie = Ee.forwardRef(({ message: t, isLeft: a = !1, children: r, avatars: n, hideAvatar: s = !1 }, i) => {
479
+ }, ie = Ue.forwardRef(({ message: t, isLeft: a = !1, children: r, avatars: n, hideAvatar: s = !1 }, i) => {
480
480
  const l = a ? "chat-bubble-left" : "chat-bubble-right";
481
481
  return e("div", { className: `chat-bubble-container ${a ? "chat-left" : "chat-right"}${a && s ? " chat-no-avatar" : ""}`, ref: i, children: [a && !s && e("img", { alt: "AI Avatar", className: "chat-avatar chat-avatar-left", srcSet: `${n.agentAvatar["1x"]} 1x, ${n.agentAvatar["2x"]} 2x` }), e("div", { className: `chat-bubble ${l}`, children: r || e("div", { className: "chat-message-text", children: t.content }) }), !a && !s && e("img", { alt: "User Avatar", className: "chat-avatar chat-avatar-right", srcSet: `${n.respondentAvatar["1x"]} 1x, ${n.respondentAvatar["2x"]} 2x` })] });
482
482
  });
483
483
  ie.displayName = "ChatBubble";
484
- const Vt = () => {
484
+ const Gt = () => {
485
485
  const t = $((r) => r.close), a = ce(() => () => t(Ie), [t]);
486
486
  return e("div", { "aria-label": "Close button", className: "conversational-close-btn", onClick: a, onKeyPress: (r) => {
487
487
  r.key === "Enter" && a();
488
488
  }, role: "button", tabIndex: 0, children: e("svg", { fill: "none", height: "16px", viewBox: "0 0 13 13", width: "16px", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z", fill: "#262136" }) }) });
489
- }, Ft = ({ card: t, next: a, className: r = "", isAnswered: n = !1 }) => {
489
+ }, Vt = ({ card: t, next: a, className: r = "", isAnswered: n = !1 }) => {
490
490
  const s = { className: n ? `${r} answered-card` : r, next: n ? () => {
491
491
  } : a, questionId: t.name, type: t.type, isAnswered: n };
492
492
  switch (t.type) {
493
493
  case "consentlegal":
494
- return e(mt, { ...s, ...t.props });
494
+ return e(ht, { ...s, ...t.props });
495
495
  case "likert":
496
- return e(vt, { ...s, ...t.props });
496
+ return e(bt, { ...s, ...t.props });
497
497
  case "matrix":
498
- return e(yt, { ...s, ...t.props });
499
- case "multiplechoice":
500
498
  return e(ft, { ...s, ...t.props });
501
- case "multipleselect":
499
+ case "multiplechoice":
502
500
  return e(kt, { ...s, ...t.props });
503
- case "nps":
501
+ case "multipleselect":
504
502
  return e(xt, { ...s, ...t.props });
503
+ case "nps":
504
+ return e(Ct, { ...s, ...t.props });
505
505
  case "aidynamicstandalone":
506
506
  case "aidynamicfollowup":
507
507
  case "open":
508
- return e(Ct, { ...s, type: t.type, ...t.props });
508
+ return e(St, { ...s, type: t.type, ...t.props });
509
509
  case "rankorder":
510
- return e(St, { ...s, ...t.props });
510
+ return e(Tt, { ...s, ...t.props });
511
511
  case "recordedtask":
512
- return e(Lt, { ...s, ...t.props });
513
- case "texturlprompt":
514
512
  return e(Rt, { ...s, ...t.props });
515
- case "thanks":
513
+ case "texturlprompt":
516
514
  return e(Mt, { ...s, ...t.props });
515
+ case "thanks":
516
+ return e(Ut, { ...s, ...t.props });
517
517
  case "uploading":
518
- return e(Et, { ...s, ...t.props });
519
- case "videovoice":
520
518
  return e(At, { ...s, ...t.props });
519
+ case "videovoice":
520
+ return e(Bt, { ...s, ...t.props });
521
521
  default:
522
522
  return null;
523
523
  }
524
- }, zt = ({ cards: t, next: a, previousResponses: r }) => {
524
+ }, Kt = ({ cards: t, next: a, previousResponses: r }) => {
525
525
  const { cardResponses: n, setCardResponse: s } = (() => {
526
526
  const [c, p] = O(/* @__PURE__ */ new Map());
527
- return { cardResponses: c, setCardResponse: oe((f, m) => {
528
- p((v) => new Map(v).set(f, m));
527
+ return { cardResponses: c, setCardResponse: oe((k, m) => {
528
+ p((b) => new Map(b).set(k, m));
529
529
  }, []) };
530
- })(), { index: i, isLongFormSurvey: l, avatars: u, showSurveyBrand: d, forceBrandedLogo: b, marketingUrlLink: y, startingQuestionIdx: o, viewDocument: h, createDynamicFollowupQuestion: x, update: k } = $((c) => ({ index: c.index, isLongFormSurvey: Ae(c.studyType), avatars: c.avatars, forceBrandedLogo: c.forceBrandedLogo, startingQuestionIdx: c.startingQuestionIdx, showSurveyBrand: c.showSurveyBrand, marketingUrlLink: We({ marketingUrl: c.marketingUrl, slugName: c.slugName, surveyId: c.surveyId, forceBrandedLogo: c.forceBrandedLogo }), viewDocument: c.viewDocument, createDynamicFollowupQuestion: c.createDynamicFollowupQuestion, update: c.update })), { currentQuestionBubbleRef: g, scrollToCurrentQuestion: S } = (({ viewDocument: c }) => {
531
- const p = ee(null), f = oe(() => {
530
+ })(), { index: i, isLongFormSurvey: l, avatars: u, showSurveyBrand: d, forceBrandedLogo: v, marketingUrlLink: y, startingQuestionIdx: o, viewDocument: h, createDynamicFollowupQuestion: x, update: f } = $((c) => ({ index: c.index, isLongFormSurvey: Ee(c.studyType), avatars: c.avatars, forceBrandedLogo: c.forceBrandedLogo, startingQuestionIdx: c.startingQuestionIdx, showSurveyBrand: c.showSurveyBrand, marketingUrlLink: Xe({ marketingUrl: c.marketingUrl, slugName: c.slugName, surveyId: c.surveyId, forceBrandedLogo: c.forceBrandedLogo }), viewDocument: c.viewDocument, createDynamicFollowupQuestion: c.createDynamicFollowupQuestion, update: c.update })), { currentQuestionBubbleRef: g, scrollToCurrentQuestion: S } = (({ viewDocument: c }) => {
531
+ const p = ee(null), k = oe(() => {
532
532
  const m = c.querySelector(".ul-card-main-content");
533
533
  if (p.current && m && m instanceof HTMLElement) {
534
- const v = p.current.offsetTop - m.offsetTop - 16;
535
- m.scrollTo({ top: Math.max(0, v), behavior: "smooth" });
534
+ const b = p.current.offsetTop - m.offsetTop - 16;
535
+ m.scrollTo({ top: Math.max(0, b), behavior: "smooth" });
536
536
  }
537
537
  }, []);
538
- return { currentQuestionBubbleRef: p, scrollToCurrentQuestion: f };
539
- })({ viewDocument: h }), N = ((c, p, f) => {
540
- const [m, v] = O(/* @__PURE__ */ new Map());
538
+ return { currentQuestionBubbleRef: p, scrollToCurrentQuestion: k };
539
+ })({ viewDocument: h }), N = ((c, p, k) => {
540
+ const [m, b] = O(/* @__PURE__ */ new Map());
541
541
  return te(() => {
542
542
  if (c.length > 0 && p < c.length) {
543
- const I = c[p], w = `${I.name}`, L = (V) => {
543
+ const I = c[p], P = `${I.name}`, L = (F) => {
544
544
  if (p > 0) {
545
- const F = c[p - 1];
546
- if (le(F)) {
547
- const G = `${F.name}`, z = ye(F);
548
- if (V.get(G) !== z) return new Map(V).set(G, z);
545
+ const G = c[p - 1];
546
+ if (le(G)) {
547
+ const V = `${G.name}`, z = ye(G);
548
+ if (F.get(V) !== z) return new Map(F).set(V, z);
549
549
  }
550
550
  }
551
- return V;
551
+ return F;
552
552
  };
553
- if ((p <= (f ?? 0) || je(I)) && (I == null ? void 0 : I.type) !== "aidynamicstandalone") return v((V) => L(new Map(V).set(w, !1)));
554
- v((V) => {
555
- const F = !le(I) || ye(I);
556
- return L(new Map(V).set(w, F));
553
+ if ((p <= (k ?? 0) || Ve(I)) && (I == null ? void 0 : I.type) !== "aidynamicstandalone") return b((F) => L(new Map(F).set(P, !1)));
554
+ b((F) => {
555
+ const G = !le(I) || ye(I);
556
+ return L(new Map(F).set(P, G));
557
557
  });
558
558
  const H = setTimeout(() => {
559
- v((V) => {
560
- const F = !!le(I) && ye(I);
561
- return L(new Map(V).set(w, F));
559
+ b((F) => {
560
+ const G = !!le(I) && ye(I);
561
+ return L(new Map(F).set(P, G));
562
562
  });
563
563
  }, 1e3);
564
564
  return () => clearTimeout(H);
565
565
  }
566
- }, [p, c, f]), m;
566
+ }, [p, c, k]), m;
567
567
  })(t, i, o);
568
568
  ((c, p) => {
569
- const { createDynamicStandaloneQuestion: f } = $((I) => ({ createDynamicStandaloneQuestion: I.createDynamicStandaloneQuestion })), m = c[p], v = (m == null ? void 0 : m.type) === "aidynamicstandalone" && m.props.loading === void 0 ? m.name : null;
569
+ const { createDynamicStandaloneQuestion: k } = $((I) => ({ createDynamicStandaloneQuestion: I.createDynamicStandaloneQuestion })), m = c[p], b = (m == null ? void 0 : m.type) === "aidynamicstandalone" && m.props.loading === void 0 ? m.name : null;
570
570
  te(() => {
571
- v !== null && f({ questionId: v });
572
- }, [v, f]);
571
+ b !== null && k({ questionId: b });
572
+ }, [b, k]);
573
573
  })(t, i);
574
- const P = ((c, p) => {
575
- const [f, m] = O(() => /* @__PURE__ */ new Set([c]));
574
+ const q = ((c, p) => {
575
+ const [k, m] = O(() => /* @__PURE__ */ new Set([c]));
576
576
  return te(() => {
577
- m((v) => new Set(v).add(c));
577
+ m((b) => new Set(b).add(c));
578
578
  }, [c]), te(() => {
579
- const v = p ?? 0;
580
- v > 0 && m((I) => {
581
- const w = new Set(I);
582
- for (let L = 0; L <= v; L++) w.add(L);
583
- return w;
579
+ const b = p ?? 0;
580
+ b > 0 && m((I) => {
581
+ const P = new Set(I);
582
+ for (let L = 0; L <= b; L++) P.add(L);
583
+ return P;
584
584
  });
585
- }, [p]), f;
586
- })(i, o), E = ce(() => ({ ...r, ...Pe(t.map((c, p) => {
587
- var f, m;
588
- return { ...c, value: p < i ? ((f = n.get(`${c.name}`)) == null ? void 0 : f.value) ?? null : null, secondaryValue: p < i ? ((m = n.get(`${c.name}`)) == null ? void 0 : m.secondaryValue) ?? null : null };
585
+ }, [p]), k;
586
+ })(i, o), E = ce(() => ({ ...r, ...We(t.map((c, p) => {
587
+ var k, m;
588
+ return { ...c, value: p < i ? ((k = n.get(`${c.name}`)) == null ? void 0 : k.value) ?? null : null, secondaryValue: p < i ? ((m = n.get(`${c.name}`)) == null ? void 0 : m.secondaryValue) ?? null : null };
589
589
  })) }), [r, n, t, i]);
590
- dt(E);
590
+ ut(E);
591
591
  const _ = Je(t, E);
592
592
  te(() => {
593
593
  requestAnimationFrame(() => {
594
594
  S();
595
- }), k();
596
- }, [i, S, N, k]);
595
+ }), f();
596
+ }, [i, S, N, f]);
597
597
  const Q = oe((c, p) => {
598
598
  if (!p) return;
599
- const f = _[i];
600
- if (!f) return;
601
- const m = `${f.name}`;
599
+ const k = _[i];
600
+ if (!k) return;
601
+ const m = `${k.name}`;
602
602
  s(m, c);
603
- const v = { ...c, questionText: tt(f) };
604
- if (f.childId && (v == null ? void 0 : v.value) != null) {
605
- const I = Pe([f].map((w) => ({ ...w, value: (v == null ? void 0 : v.value) ?? null, secondaryValue: (v == null ? void 0 : v.secondaryValue) ?? null })));
606
- x({ parentQuestionId: f.name, parentResponseConfig: I });
607
- }
608
- a([v]);
609
- }, [_, i, a, s]), A = _.map((c, p) => ({ card: c, cardIndex: p })).filter(({ cardIndex: c }) => P.has(c));
610
- return e("div", { className: "conversational-ui ul-conversational-ui", "data-testid": "ui-container", children: [!l && e(Vt, {}), e("div", { className: "chat-container", children: e("div", { className: "chat-messages", children: A.map(({ card: c, cardIndex: p }) => e(Ht, { avatars: u, card: c, cardIndex: p, cardResponses: n, currentQuestionBubbleRef: g, handleCardResponse: Q, index: i, questionThinkingStates: N, startingQuestionIdx: o }, `question-card-${c.name}`)) }) }), l && e("div", { className: "long-form-question-footer-container-logo", children: d && e(et, { forceBrandedLogo: b, marketingUrlLink: y }) })] });
603
+ const b = { ...c, questionText: tt(k) };
604
+ k.childId && (b == null ? void 0 : b.value) != null && rt({ displayCard: k, response: b, createDynamicFollowupQuestion: x }), a([b]);
605
+ }, [_, i, a, s]), A = _.map((c, p) => ({ card: c, cardIndex: p })).filter(({ cardIndex: c }) => q.has(c));
606
+ return e("div", { className: "conversational-ui ul-conversational-ui", "data-testid": "ui-container", children: [!l && e(Gt, {}), e("div", { className: "chat-container", children: e("div", { className: "chat-messages", children: A.map(({ card: c, cardIndex: p }) => e(Ft, { avatars: u, card: c, cardIndex: p, cardResponses: n, currentQuestionBubbleRef: g, handleCardResponse: Q, index: i, questionThinkingStates: N, startingQuestionIdx: o }, `question-card-${c.name}`)) }) }), l && e("div", { className: "long-form-question-footer-container-logo", children: d && e(et, { forceBrandedLogo: v, marketingUrlLink: y }) })] });
611
607
  };
612
608
  export {
613
- zt as default
609
+ Kt as default
614
610
  };