@sprig-technologies/sprig-browser 2.41.1 → 2.41.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- import { a as z, h as Z, u as e, c as O, b as re, f as Me, F as he, g as ye, e as ge, _ as te, T as ke, A as ir, p as ne, i as ar, q as lr, r as or, M as de, s as Ze, t as dr, j as cr, n as ur, v as pr, k as Ae, l as mr, m as gr, x as hr, o as Qe } from "./view-Bvmj0wxW.js";
2
- import { t as le } from "./metricsReporter-CJzT7qY-.js";
3
- import { a as qe, D as Ee, g as We, A as br } from "./core-DE_-33ff.js";
4
- import { c as ie, a as ae, H as _e, M as pe, Q as ue, O as Se, B as ee, L as Ie, b as Te, S as vr, u as yr, g as fr, P as Sr, p as xr, v as kr, R as se, d as Ir, s as _r, e as Tr } from "./getAttributedUrl-DBTn-NUH.js";
1
+ import { a as Y, h as Z, u as e, c as O, b as re, f as Me, F as he, g as ye, e as ge, _ as te, T as ke, A as ir, p as ne, i as ar, q as lr, r as or, M as de, s as Ze, t as dr, j as cr, n as ur, v as pr, k as Ae, l as mr, m as gr, x as hr, o as Qe } from "./view-BsxrS7-j.js";
2
+ import { t as le } from "./metricsReporter-CJIq-5XV.js";
3
+ import { a as qe, D as Ee, g as We, A as br } from "./core-BAftYDJ4.js";
4
+ import { c as ie, a as ae, H as _e, M as pe, Q as ue, O as Se, B as ee, L as Ie, b as Te, S as vr, u as yr, g as fr, P as Sr, p as xr, v as kr, R as se, d as Ir, s as _r, e as Tr } from "./getAttributedUrl-D8A6-Xpc.js";
5
5
  const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, type: a }) => {
6
- const { useMobileStyling: m, border: y, isLongFormSurvey: d, focusedQuestionId: g } = z((v) => ({ useMobileStyling: v.useMobileStyling, border: v.border, isLongFormSurvey: le(v.studyType), focusedQuestionId: v.focusedQuestionId })), [c, f] = Z(!1), [i, S] = Z(""), [p, h] = Z(!1), b = d && g === t, x = r == null ? void 0 : r.collectName, _ = (r == null ? void 0 : r.nameLabelText) || "Full Name", k = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", U = (r == null ? void 0 : r.submitButtonText) || "Submit", P = !!i.trim(), M = c && (!x || P), D = (v, w = !1) => {
6
+ const { useMobileStyling: m, border: y, isLongFormSurvey: d, focusedQuestionId: g } = Y((v) => ({ useMobileStyling: v.useMobileStyling, border: v.border, isLongFormSurvey: le(v.studyType), focusedQuestionId: v.focusedQuestionId })), [c, f] = Z(!1), [i, S] = Z(""), [p, h] = Z(!1), b = d && g === t, x = r == null ? void 0 : r.collectName, _ = (r == null ? void 0 : r.nameLabelText) || "Full Name", k = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", U = (r == null ? void 0 : r.submitButtonText) || "Submit", P = !!i.trim(), M = c && (!x || P), D = (v, w = !1) => {
7
7
  v.preventDefault(), v.stopPropagation();
8
8
  let B = null;
9
9
  if (!w) {
@@ -22,7 +22,7 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
22
22
  v.preventDefault(), v.stopPropagation(), S(v.currentTarget.value);
23
23
  }, placeholder: _, style: p && !P ? { borderColor: qe } : {}, tabIndex: 0, value: i })] }), e("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [e(ee, { className: M ? "" : "sprig-button-disabled", onClick: D, children: U }), r.required === !1 && !d && e("button", { className: "ul-card-skip__button", onClick: (v) => D(v, !0), children: Me(r) })] })] }) })] }, t);
24
24
  }, Nr = ({ activeValue: n, border: s, icon: o, isPressed: r, onSubmit: t, range: a, scaleLabelType: m, selectedValue: y, setSelectedValue: d, setActiveValue: g, setIsPressed: c, useMobileStyling: f, value: i, viewDocument: S }) => {
25
- const { isLongFormSurvey: p, enableCspTrustedTypes: h } = z((w) => ({ isLongFormSurvey: le(w.studyType), enableCspTrustedTypes: w.enableCspTrustedTypes })), b = `option-${i}`, x = m === "number", _ = m === "star", k = m === "smiley", U = x && i === n || i === y, [P, M] = (() => {
25
+ const { isLongFormSurvey: p, enableCspTrustedTypes: h } = Y((w) => ({ isLongFormSurvey: le(w.studyType), enableCspTrustedTypes: w.enableCspTrustedTypes })), b = `option-${i}`, x = m === "number", _ = m === "star", k = m === "smiley", U = x && i === n || i === y, [P, M] = (() => {
26
26
  const w = _ && y !== null && i <= y;
27
27
  return _ && i <= n || k && i === n || w || i === n || i === y ? [s, r || w || i === y ? 1 : 0.3] : ["", 1];
28
28
  })(), D = he(() => {
@@ -54,7 +54,7 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
54
54
  g(-1), c(!1);
55
55
  }, style: D, tabIndex: 0 });
56
56
  }, wr = ({ className: n, labels: s, message: o, next: r, properties: t, questionId: a, type: m }) => {
57
- const { border: y, useMobileStyling: d, viewDocument: g, isLongFormSurvey: c, focusedQuestionId: f } = z((T) => ({ border: T.border, useMobileStyling: T.useMobileStyling, viewDocument: T.viewDocument, isLongFormSurvey: le(T.studyType), focusedQuestionId: T.focusedQuestionId })), [i, S] = Z(-1), [p, h] = Z(!1), [b, x] = Z(null), _ = c && f === a, k = s && s.left, U = s && s.right;
57
+ const { border: y, useMobileStyling: d, viewDocument: g, isLongFormSurvey: c, focusedQuestionId: f } = Y((T) => ({ border: T.border, useMobileStyling: T.useMobileStyling, viewDocument: T.viewDocument, isLongFormSurvey: le(T.studyType), focusedQuestionId: T.focusedQuestionId })), [i, S] = Z(-1), [p, h] = Z(!1), [b, x] = Z(null), _ = c && f === a, k = s && s.left, U = s && s.right;
58
58
  let P;
59
59
  const { range: M, scaleLabelType: D, ratingIcons: v } = t;
60
60
  M && (P = Number(M));
@@ -80,7 +80,7 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
80
80
  const s = getComputedStyle(n);
81
81
  return parseFloat(s.marginTop) + parseFloat(s.marginBottom) + (parseFloat(s.borderTopWidth) + parseFloat(s.borderBottomWidth));
82
82
  }, Lr = ({ columns: n, onSelect: s, options: o, selectedOptions: r }) => {
83
- const t = te([]), { border: a, useMobileStyling: m } = z((i) => ({ border: i.border, useMobileStyling: i.useMobileStyling })), y = o.findIndex((i) => r[i.id] === null), [d, g] = Z(y), c = ke((i, S) => {
83
+ const t = te([]), { border: a, useMobileStyling: m } = Y((i) => ({ border: i.border, useMobileStyling: i.useMobileStyling })), y = o.findIndex((i) => r[i.id] === null), [d, g] = Z(y), c = ke((i, S) => {
84
84
  s(i, S);
85
85
  const p = d + 1, h = o[p];
86
86
  if (h && r[h.id] === null) {
@@ -102,7 +102,7 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
102
102
  }, [a, n, d, c, r, m]);
103
103
  return e("div", { children: o.map((i, S) => f(S, i)) });
104
104
  }, Pr = ({ columns: n, onSelect: s, options: o, selectedOptions: r }) => {
105
- const { border: t, useMobileStyling: a, isLongFormSurvey: m } = z((p) => ({ border: p.border, useMobileStyling: p.useMobileStyling, isLongFormSurvey: le(p.studyType) })), y = o.length, d = n.length, g = te(null), [c, f] = Z(!1), [i, S] = Z(!1);
105
+ const { border: t, useMobileStyling: a, isLongFormSurvey: m } = Y((p) => ({ border: p.border, useMobileStyling: p.useMobileStyling, isLongFormSurvey: le(p.studyType) })), y = o.length, d = n.length, g = te(null), [c, f] = Z(!1), [i, S] = Z(!1);
106
106
  return ne(() => {
107
107
  const p = g.current, h = new ResizeObserver((b) => {
108
108
  window.requestAnimationFrame(() => {
@@ -133,7 +133,7 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
133
133
  }
134
134
  }, children: e(i && !c ? Rr : Dr, {}) })] });
135
135
  }, Rr = () => e("svg", { fill: "currentColor", height: "32", transform: "matrix(-1,0,0,1,0,0)", version: "1.1", viewBox: "0 0 256 256", width: "32", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" }) }), Dr = () => e("svg", { fill: "currentColor", height: "32", viewBox: "0 0 256 256", width: "32", xmlns: "http://www.w3.org/2000/svg", children: e("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" }) }), Mr = ({ className: n, message: s, next: o, options: r, properties: t, questionId: a, type: m, showIndividualSubmit: y = !1, onSubmitButtonClick: d }) => {
136
- const { useMobileStyling: g, isLongFormSurvey: c, focusedQuestionId: f, setFocusedQuestionId: i } = z((D) => ({ useMobileStyling: D.useMobileStyling, isLongFormSurvey: le(D.studyType), focusedQuestionId: D.focusedQuestionId, setFocusedQuestionId: D.setFocusedQuestionId })), S = t.matrixColumn, p = t.required, h = c && f === a, b = (D) => {
136
+ const { useMobileStyling: g, isLongFormSurvey: c, focusedQuestionId: f, setFocusedQuestionId: i } = Y((D) => ({ useMobileStyling: D.useMobileStyling, isLongFormSurvey: le(D.studyType), focusedQuestionId: D.focusedQuestionId, setFocusedQuestionId: D.setFocusedQuestionId })), S = t.matrixColumn, p = t.required, h = c && f === a, b = (D) => {
137
137
  D.preventDefault(), D.stopPropagation(), o({ value: _, questionId: a, type: m }, !0), d && d();
138
138
  }, x = r.reduce((D, v) => (D[v.id] = null, D), {}), [_, k] = Z(x), U = (D) => p && Object.values(D).every((v) => v == null), P = (D, v) => {
139
139
  c && o({ value: { ..._, [D]: v }, questionId: a, type: m }, !U({ ..._, [D]: v })), k((w) => ({ ...w, [D]: v }));
@@ -142,41 +142,41 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
142
142
  h && i(a);
143
143
  }, onSubmit: b, children: [e(ie, { isRequired: c && (t == null ? void 0 : t.required), message: s, properties: t }), e(pe, { properties: t, children: [e(ae, { children: [e(M ? Lr : Pr, { columns: S, onSelect: P, options: r, selectedOptions: _ }), y && e(Ie, { handleSubmit: b, isSubmitDisabled: U(_) })] }), !c && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: U(_), children: ge(t) }) }) })] })] }, a);
144
144
  }, Ye = ({ className: n, message: s, onSubmit: o, options: r = [], properties: t, questionId: a, type: m, showIndividualSubmit: y = !1, onSubmitButtonClick: d }) => {
145
- const { border: g, useMobileStyling: c, isLongFormSurvey: f, focusedQuestionId: i, setFocusedQuestionId: S } = z((u) => ({ border: u.border, useMobileStyling: u.useMobileStyling, isLongFormSurvey: le(u.studyType), focusedQuestionId: u.focusedQuestionId, setFocusedQuestionId: u.setFocusedQuestionId })), p = f && i === a, h = r.reduce((u, C) => (u[C.id] = { isSelected: !1 }, u), {}), [b, x] = Z(h), _ = m === "multiplechoice", k = t.required, U = r.find((u) => {
145
+ const { border: g, useMobileStyling: c, isLongFormSurvey: f, focusedQuestionId: i, setFocusedQuestionId: S } = Y((u) => ({ border: u.border, useMobileStyling: u.useMobileStyling, isLongFormSurvey: le(u.studyType), focusedQuestionId: u.focusedQuestionId, setFocusedQuestionId: u.setFocusedQuestionId })), p = f && i === a, h = r.reduce((u, C) => (u[C.id] = { isSelected: !1 }, u), {}), [b, x] = Z(h), _ = m === "multiplechoice", k = t.required, U = r.find((u) => {
146
146
  var C;
147
147
  return (C = u.optionProperties) == null ? void 0 : C.noneOfTheAbove;
148
148
  }), P = (u) => Object.entries(u).some(([C, V]) => {
149
149
  var l;
150
- const J = r.find((I) => `${I.id}` === C), H = V.userText === void 0 || V.userText.trim() === "";
151
- return ((l = J == null ? void 0 : J.optionProperties) == null ? void 0 : l.allowsTextEntry) && H && V.isSelected;
150
+ const W = r.find((I) => `${I.id}` === C), H = V.userText === void 0 || V.userText.trim() === "";
151
+ return ((l = W == null ? void 0 : W.optionProperties) == null ? void 0 : l.allowsTextEntry) && H && V.isSelected;
152
152
  }), M = (u) => Object.values(u).filter((C) => C.isSelected).length, D = t.minSelect && t.minSelect > 0 && t.maxSelectMode === Te.Range && M(b) < t.minSelect && (k || M(b) > 0), v = (u) => P(u) || k && !M(u) || !((C) => {
153
- const { minSelect: V = 0, maxSelect: J = 1 / 0, maxSelectMode: H } = t, l = M(C);
153
+ const { minSelect: V = 0, maxSelect: W = 1 / 0, maxSelectMode: H } = t, l = M(C);
154
154
  switch (H) {
155
155
  case Te.Maximum:
156
- return l <= J;
156
+ return l <= W;
157
157
  case Te.Range:
158
158
  return l === 0 || l >= V;
159
159
  default:
160
160
  return !0;
161
161
  }
162
162
  })(u), w = Object.entries(b).some(([u, C]) => {
163
- var V, J;
164
- return C.isSelected && ((J = (V = r.find((H) => `${H.id}` === u)) == null ? void 0 : V.optionProperties) == null ? void 0 : J.allowsTextEntry);
163
+ var V, W;
164
+ return C.isSelected && ((W = (V = r.find((H) => `${H.id}` === u)) == null ? void 0 : V.optionProperties) == null ? void 0 : W.allowsTextEntry);
165
165
  }), B = y && (!_ || w), T = (u) => {
166
- Y(u.id, u.selected, u.userText, u.noneOfTheAbove), u.selected && f && !_ && !p && S(a);
166
+ K(u.id, u.selected, u.userText, u.noneOfTheAbove), u.selected && f && !_ && !p && S(a);
167
167
  }, L = (u) => {
168
168
  var C;
169
169
  return (t == null ? void 0 : t.maxSelectMode) !== Te.Unlimited && M(b) === (t == null ? void 0 : t.maxSelect) && !((C = b[u]) != null && C.isSelected);
170
170
  }, A = (u) => {
171
171
  u.preventDefault(), u.stopPropagation(), o(b, !0), d && d();
172
- }, Y = (u, C, V, J) => {
172
+ }, K = (u, C, V, W) => {
173
173
  const H = Object.assign({}, b);
174
- if ((_ || J) && C) for (const q of Object.values(H)) q.isSelected = !1, delete q.userText;
175
- else U && !J && b[U.id].isSelected && (H[U.id].isSelected = !1);
174
+ if ((_ || W) && C) for (const q of Object.values(H)) q.isSelected = !1, delete q.userText;
175
+ else U && !W && b[U.id].isSelected && (H[U.id].isSelected = !1);
176
176
  H[u] = { isSelected: C, userText: V };
177
177
  const l = _ && Object.entries(H).some(([q, F]) => {
178
178
  var E, G;
179
- return F.isSelected && ((G = (E = r.find((K) => `${K.id}` === q)) == null ? void 0 : E.optionProperties) == null ? void 0 : G.allowsTextEntry);
179
+ return F.isSelected && ((G = (E = r.find((X) => `${X.id}` === q)) == null ? void 0 : E.optionProperties) == null ? void 0 : G.allowsTextEntry);
180
180
  }), I = !v(H);
181
181
  f && (o(H, I), _ && !l && I && d && d()), x(H);
182
182
  };
@@ -186,14 +186,14 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
186
186
  const C = { ...b };
187
187
  for (const V of r) u.includes(V) ? C[V.id].isSelected = !0 : C[V.id].isSelected = !1;
188
188
  f && o(C, !v(C)), x(C);
189
- }, options: r, placeholderText: t.dropdownPlaceholderText ?? (_ ? "Select choice" : "Select choice(s)"), value: r.filter((u) => b[u.id].isSelected) }) : e("div", { className: O(re("ul-card__choices", c)), role: _ ? "radiogroup" : "group", children: [r.map(({ id: u, label: C, value: V, optionProperties: J }) => {
189
+ }, options: r, placeholderText: t.dropdownPlaceholderText ?? (_ ? "Select choice" : "Select choice(s)"), value: r.filter((u) => b[u.id].isSelected) }) : e("div", { className: O(re("ul-card__choices", c)), role: _ ? "radiogroup" : "group", children: [r.map(({ id: u, label: C, value: V, optionProperties: W }) => {
190
190
  var F, E;
191
- const H = `${u}`, { allowsTextEntry: l, noneOfTheAbove: I } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...J };
192
- return e(Se, { allowTextEntry: l, border: g, disabled: L(H), error: (q = b, P(q)), id: H, isRadio: _, isSelected: !!((F = b[H]) != null && F.isSelected), label: C, noneOfTheAbove: I, onUserInputChanged: T, promptText: "Please specify", text: (E = b[u]) == null ? void 0 : E.userText, useMobileStyling: c, value: V }, H);
191
+ const H = `${u}`, { allowsTextEntry: l, noneOfTheAbove: I } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...W };
192
+ return e(Se, { allowTextEntry: l, border: g, disabled: L(H), error: (q = b, P(q)), id: H, isRadio: _, isSelected: !!((F = b[H]) != null && F.isSelected), label: C, noneOfTheAbove: I, onUserInputChanged: T, promptText: (W == null ? void 0 : W.otherOptionPlaceholder) || "Please specify", text: (E = b[u]) == null ? void 0 : E.userText, useMobileStyling: c, value: V }, H);
193
193
  var q;
194
194
  }), !!D && e("div", { className: "ul-card__min-select-counter", children: [M(b), "/", t.minSelect] })] }), B && e(Ie, { handleSubmit: A, isSubmitDisabled: v(b) })] }), !f && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: v(b), onClick: A, children: ge(t) }) }) })] }) })] }, a);
195
195
  }, Er = (n) => {
196
- const { questionId: s, type: o, next: r, options: t } = n, { setFocusedQuestionId: a } = z((m) => ({ setFocusedQuestionId: m.setFocusedQuestionId }));
196
+ const { questionId: s, type: o, next: r, options: t } = n, { setFocusedQuestionId: a } = Y((m) => ({ setFocusedQuestionId: m.setFocusedQuestionId }));
197
197
  return e(Ye, { ...n, onSubmit: (m, y) => {
198
198
  var S;
199
199
  const d = Object.entries(m).find(([, p]) => p.isSelected) || [void 0, void 0], [g, c] = d, f = t.find((p) => `${p.id}` === g);
@@ -212,7 +212,7 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
212
212
  r({ value: m, secondaryValue: y, questionId: s, type: o }, a);
213
213
  } });
214
214
  }, Ur = ({ className: n, labels: s, message: o, properties: r, next: t, questionId: a, type: m }) => {
215
- const [y, d] = Z(null), { border: g, useMobileStyling: c, viewDocument: f, isLongFormSurvey: i, focusedQuestionId: S } = z((x) => ({ border: x.border, useMobileStyling: x.useMobileStyling, viewDocument: x.viewDocument, isLongFormSurvey: le(x.studyType), focusedQuestionId: x.focusedQuestionId })), p = i && S === a, h = s && s.left, b = s && s.right;
215
+ const [y, d] = Z(null), { border: g, useMobileStyling: c, viewDocument: f, isLongFormSurvey: i, focusedQuestionId: S } = Y((x) => ({ border: x.border, useMobileStyling: x.useMobileStyling, viewDocument: x.viewDocument, isLongFormSurvey: le(x.studyType), focusedQuestionId: x.focusedQuestionId })), p = i && S === a, h = s && s.left, b = s && s.right;
216
216
  return e("form", { className: O(n, "ul-card--nps", "fade-in-transition", i && !p && "ul-card--unfocused"), children: [e(ie, { isRequired: i && (r == null ? void 0 : r.required), message: o, properties: r }), e(pe, { properties: r, children: [e(ae, { children: [e("div", { className: "ul-card--nps__numbers", children: [...Array(11)].map((x, _) => e("button", { className: O(re("nps-number", c), re(`nps-number-${_}`, c)), id: `option-${_}`, onClick: (k) => {
217
217
  i && (k.preventDefault(), k.stopPropagation(), d(_)), t({ value: _, questionId: a, type: m }, !0);
218
218
  }, onKeyDown: (k) => {
@@ -227,7 +227,7 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
227
227
  x.preventDefault(), x.stopPropagation(), t({ value: null, questionId: a, type: m }, !0);
228
228
  }, children: ge(r) }) }) })] })] }, a);
229
229
  }, Fr = (n) => {
230
- const { className: s, message: o, next: r, properties: t, questionId: a, type: m, showIndividualSubmit: y = !1, onSubmitButtonClick: d } = n, g = m === "aidynamicfollowup" ? n.loading : void 0, { border: c, useMobileStyling: f, update: i, isLongFormSurvey: S, focusedQuestionId: p, setFocusedQuestionId: h, isPreview: b } = z((T) => ({ border: T.border, useMobileStyling: T.useMobileStyling, update: T.update, isLongFormSurvey: le(T.studyType), focusedQuestionId: T.focusedQuestionId, setFocusedQuestionId: T.setFocusedQuestionId, isPreview: T.isPreview })), [x, _] = Z(""), k = te(null), U = S && p === a;
230
+ const { className: s, message: o, next: r, properties: t, questionId: a, type: m, showIndividualSubmit: y = !1, onSubmitButtonClick: d } = n, g = m === "aidynamicfollowup" ? n.loading : void 0, { border: c, useMobileStyling: f, update: i, isLongFormSurvey: S, focusedQuestionId: p, setFocusedQuestionId: h, isPreview: b } = Y((T) => ({ border: T.border, useMobileStyling: T.useMobileStyling, update: T.update, isLongFormSurvey: le(T.studyType), focusedQuestionId: T.focusedQuestionId, setFocusedQuestionId: T.setFocusedQuestionId, isPreview: T.isPreview })), [x, _] = Z(""), k = te(null), U = S && p === a;
231
231
  ne(() => {
232
232
  var T, L;
233
233
  S && !b && (U ? (T = k.current) == null || T.focus() : (L = k.current) == null || L.blur());
@@ -259,7 +259,7 @@ const Cr = ({ className: n, message: s, next: o, properties: r, questionId: t, t
259
259
  n(s);
260
260
  } }));
261
261
  function Re({ currentPage: n, pages: s }) {
262
- const { avStream: o, recordingMediaTypes: r, updatePage: t } = ce.getState(), { recorderEventEmitter: a } = z.getState();
262
+ const { avStream: o, recordingMediaTypes: r, updatePage: t } = ce.getState(), { recorderEventEmitter: a } = Y.getState();
263
263
  a.emit("av.permission", { "permission.descriptors": n.permissionDescriptors, "stream.ready": (m, y) => {
264
264
  if (o === m) return;
265
265
  let d = n;
@@ -271,7 +271,7 @@ function Re({ currentPage: n, pages: s }) {
271
271
  } });
272
272
  }
273
273
  function De({ status: n }) {
274
- const { nextQuestion: s, passthroughData: o, mediaRecordingUids: r, reset: t } = ce.getState(), { recorderEventEmitter: a, handleUploadUpdate: m, index: y } = z.getState(), d = { value: { taskStatus: n }, type: "recordedtask", questionId: (o == null ? void 0 : o.questionId) || 1 };
274
+ const { nextQuestion: s, passthroughData: o, mediaRecordingUids: r, reset: t } = ce.getState(), { recorderEventEmitter: a, handleUploadUpdate: m, index: y } = Y.getState(), d = { value: { taskStatus: n }, type: "recordedtask", questionId: (o == null ? void 0 : o.questionId) || 1 };
275
275
  o && a.emit("finish.task", { "begin.callback": (g) => {
276
276
  m({ mediaRecordingUid: g, isSubmitted: !0, progressPct: 0, isComplete: !1 });
277
277
  }, "progress.callback": (g, c) => {
@@ -283,7 +283,7 @@ function De({ status: n }) {
283
283
  } });
284
284
  }
285
285
  function Be({ pages: n, setIsRequestingPermission: s }) {
286
- const { recorderEventEmitter: o, eventEmitFn: r } = z.getState(), { updatePage: t, currentPage: a, recordingMediaTypes: m, screenPermissionRequested: y } = ce.getState();
286
+ const { recorderEventEmitter: o, eventEmitFn: r } = Y.getState(), { updatePage: t, currentPage: a, recordingMediaTypes: m, screenPermissionRequested: y } = ce.getState();
287
287
  if (!a) return;
288
288
  const d = n.indexOf(a);
289
289
  switch (a.type) {
@@ -321,7 +321,7 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
321
321
  const { buttonText: r, skipButtonText: t } = n;
322
322
  return Ue(s), e("div", { className: "ul-task-page", children: [n.taskDetail && e(nr, { richTextBody: n.taskDetail }), e(pe, { properties: o, children: e("div", { className: Ne, children: [e(ee, { className: "ul-complete-task-button", onClick: De.bind(null, { status: "completed" }), children: r }), e(ee, { className: O("ul-button-inactive"), onClick: De.bind(null, { status: "given.up" }), children: t })] }) })] }, "complete-task");
323
323
  }, Or = ({ content: n, pages: s, required: o }) => {
324
- const { buttonText: r, skipButtonText: t } = n, [a] = z((d) => [d.tabTitle]), [m, y] = Z(!1);
324
+ const { buttonText: r, skipButtonText: t } = n, [a] = Y((d) => [d.tabTitle]), [m, y] = Z(!1);
325
325
  return e("div", { children: [e("div", { className: tr, children: [e("p", { style: { marginTop: "auto" }, children: n.selectTabText }), e("div", { className: "ul-select-tab-container", children: e("p", { className: rr, children: a }) })] }), e("div", { className: o ? "" : Ne, children: [e(ee, { disabled: m, onClick: Be.bind(null, { pages: s, setIsRequestingPermission: y }), children: r }), e(we, { required: o, skipButtonText: t })] })] });
326
326
  }, $r = ({ content: n }) => e(_e, { className: O(er, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), html: n.svg }, "ul-permission-request-graphic"), Hr = ({ content: n, pages: s, required: o }) => {
327
327
  const { permissionDeniedHeadline: r, permissionDeniedBody: t, skipButtonText: a, tryAgainButtonText: m } = n, y = Ce(s[0]) ? s[0] : null;
@@ -354,18 +354,18 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
354
354
  return null;
355
355
  }
356
356
  }, Zr = ({ className: n, properties: s, next: o, questionId: r }) => {
357
- const t = z(), { surveyId: a, responseGroupUid: m, userId: y, update: d } = t, g = ce(), { screenPermissionRequested: c } = g, f = ce((b) => b.avStream);
357
+ const t = Y(), { surveyId: a, responseGroupUid: m, userId: y, update: d } = t, g = ce(), { screenPermissionRequested: c } = g, f = ce((b) => b.avStream);
358
358
  let i = ce((b) => b.currentPage);
359
359
  i || (i = function({ pages: b, userId: x, responseGroupUid: _, surveyId: k, questionId: U, next: P }) {
360
- const { updatePage: M } = ce.getState(), { eventEmitFn: D, recorderEventEmitter: v } = z.getState(), w = { questionId: U, surveyId: k, visitorId: x, responseGroupUid: _ };
360
+ const { updatePage: M } = ce.getState(), { eventEmitFn: D, recorderEventEmitter: v } = Y.getState(), w = { questionId: U, surveyId: k, visitorId: x, responseGroupUid: _ };
361
361
  let B = 0;
362
- v.emit("recorded.task.permission.screen"), D("recorded.task.permission.screen"), v.emit("permission.status", { "permission.status.callback": (L, A, Y, u) => {
363
- const C = b[B], { type: V } = C, J = ["screen"];
362
+ v.emit("recorded.task.permission.screen"), D("recorded.task.permission.screen"), v.emit("permission.status", { "permission.status.callback": (L, A, K, u) => {
363
+ const C = b[B], { type: V } = C, W = ["screen"];
364
364
  if (Ce(C)) {
365
365
  const { permissionDescriptors: H } = C, l = H == null ? void 0 : H.includes("microphone"), I = H == null ? void 0 : H.includes("camera");
366
- l && J.push("audio"), I && J.push("video"), (L != null && L.active && !I || L != null && L.active && A) && B++;
366
+ l && W.push("audio"), I && W.push("video"), (L != null && L.active && !I || L != null && L.active && A) && B++;
367
367
  }
368
- Oe(b[B]) && Y && (B++, v.emit("begin.recording", { "recording.media.types": J, "start.recording.callback": (H) => M({ mediaRecordingUids: H }) })), M({ currentPage: b[B], avStream: L, screenPermissionRequested: Y, nextQuestion: P, type: V, passthroughData: w, recordingMediaTypes: J, captureStream: u });
368
+ Oe(b[B]) && K && (B++, v.emit("begin.recording", { "recording.media.types": W, "start.recording.callback": (H) => M({ mediaRecordingUids: H }) })), M({ currentPage: b[B], avStream: L, screenPermissionRequested: K, nextQuestion: P, type: V, passthroughData: w, recordingMediaTypes: W, captureStream: u });
369
369
  } });
370
370
  const T = b[B];
371
371
  return T.type === "av_permission" && Re({ currentPage: T, pages: b }), T;
@@ -378,14 +378,14 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
378
378
  d();
379
379
  }, [d]), e("div", { className: O(n, "ul-center-horizontally", "fade-in-transition"), children: [e(ie, { isRequired: s == null ? void 0 : s.required, message: S, properties: { captionText: p } }), e(ae, { children: e(jr, { properties: s }) })] });
380
380
  }, Wr = ({ richTextBody: n, plaintextBody: s }) => n ? e(_e, { className: "ul-rich-text-body", html: n, id: "ul-card__text-url-body-container" }) : s ? e("div", { className: "ul-rich-text-body", id: "ul-card__text-url-body-container", children: (s ? s.split(/\n\s*\n/g) : []).map((o, r) => e("p", { children: o }, r)) }) : null, zr = ({ className: n, message: s, next: o, properties: r, questionId: t, type: a }) => {
381
- const { visitorAttributes: m, isLongFormSurvey: y } = z((f) => ({ visitorAttributes: f.visitorAttributes, isLongFormSurvey: le(f.studyType) })), d = (f, i = !1) => {
381
+ const { visitorAttributes: m, isLongFormSurvey: y } = Y((f) => ({ visitorAttributes: f.visitorAttributes, isLongFormSurvey: le(f.studyType) })), d = (f, i = !1) => {
382
382
  o({ value: i ? { skipped: !0 } : void 0, questionId: t, type: a }, !0);
383
383
  }, g = fr(r && r.buttonUrl, m), c = y && r.promptActionType === Sr.NO_BUTTON;
384
384
  return e("div", { className: O(n, "ul-card__text-url-prompt", "fade-in-transition"), children: [e(ie, { isRequired: y && (r == null ? void 0 : r.required), message: s, properties: { questionHtml: r.questionHtml } }), e(ae, { children: e(Wr, { plaintextBody: r == null ? void 0 : r.body, richTextBody: r == null ? void 0 : r.richTextBody }) }), e(pe, { properties: r, children: !c && e(ue, { children: e("div", { className: "ul-card-button-group", children: [e("a", { className: "ul-card-text__button ul-card__text-url-prompt-button", href: g, id: "ul-card-text__button", onClick: d, onKeyPress: (f) => {
385
385
  f.key !== "Enter" && f.key !== " " || o({ value: void 0, questionId: t, type: a }, !0);
386
386
  }, rel: "noreferrer", role: g ? "link" : "button", tabIndex: 0, target: "_blank", children: ge(r) }), r.required === !1 && e("button", { className: "ul-card-skip__button", onClick: (f) => d(0, !0), children: Me(r) })] }) }) })] }, t);
387
387
  }, Yr = ({ className: n, questionId: s }) => {
388
- const { border: o, destroy: r, endCard: t, forceBrandedLogo: a, update: m } = z((g) => ({ border: g.border, destroy: g.destroy, endCard: g.endCard, forceBrandedLogo: g.forceBrandedLogo, update: g.update }));
388
+ const { border: o, destroy: r, endCard: t, forceBrandedLogo: a, update: m } = Y((g) => ({ border: g.border, destroy: g.destroy, endCard: g.endCard, forceBrandedLogo: g.forceBrandedLogo, update: g.update }));
389
389
  ne(() => {
390
390
  setTimeout(() => {
391
391
  r(br);
@@ -396,7 +396,7 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
396
396
  m();
397
397
  }, [m]), e("div", { className: O(n, "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: o, 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: o, 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(ie, { message: d }), y] }) }) }, s);
398
398
  }, ve = "ul-card-video__player_recorder", He = "ul-video-btn", Le = 0, Ve = 1, Kr = ({ className: n, message: s, next: o, properties: r, questionId: t, type: a }) => {
399
- const { apiURL: m, envId: y, handleUploadUpdate: d, headers: g, responseGroupUid: c, surveyId: f, update: i, viewDocument: S, visitorId: p } = z((u) => ({ apiURL: u.apiURL, envId: u.envId, handleUploadUpdate: u.handleUploadUpdate, headers: u.headers, responseGroupUid: u.responseGroupUid, surveyId: u.surveyId, update: u.update, viewDocument: u.viewDocument, visitorId: u.userId })), [h, b] = Z(!1), [x, _] = Z(null), [k, U] = Z(null), [P, M] = Z(Le), [D, v] = Z(null), [w, B] = Z(null), T = r && r.videoUrl, L = ke((u) => {
399
+ const { apiURL: m, envId: y, handleUploadUpdate: d, headers: g, responseGroupUid: c, surveyId: f, update: i, viewDocument: S, visitorId: p } = Y((u) => ({ apiURL: u.apiURL, envId: u.envId, handleUploadUpdate: u.handleUploadUpdate, headers: u.headers, responseGroupUid: u.responseGroupUid, surveyId: u.surveyId, update: u.update, viewDocument: u.viewDocument, visitorId: u.userId })), [h, b] = Z(!1), [x, _] = Z(null), [k, U] = Z(null), [P, M] = Z(Le), [D, v] = Z(null), [w, B] = Z(null), T = r && r.videoUrl, L = ke((u) => {
400
400
  u && v(u);
401
401
  }, [v]);
402
402
  ne(() => {
@@ -409,7 +409,7 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
409
409
  }, [i, w, D]);
410
410
  const A = (u, C) => {
411
411
  u === se.UPLOAD_STARTED ? (_(C[se.UPLOAD_ID]), U(C[se.MEDIA_RECORDING_UID]), b(!0)) : u === se.DELETE ? (_(null), U(null), b(!1)) : u === se.UPLOAD_PROGRESS ? isNaN(C[se.UPLOAD_PROGRESS_PCT]) ? d({ mediaRecordingUid: C[se.MEDIA_RECORDING_UID], isComplete: !0 }) : d({ mediaRecordingUid: C[se.MEDIA_RECORDING_UID], progressPct: C[se.UPLOAD_PROGRESS_PCT] }) : u === se.UPLOAD_FINISHED && d({ mediaRecordingUid: C[se.MEDIA_RECORDING_UID], isComplete: !0 });
412
- }, Y = (u) => {
412
+ }, K = (u) => {
413
413
  u.preventDefault(), u.stopPropagation(), document.getElementById(ve) && _r(ve), x && k ? (d({ mediaRecordingUid: k, isSubmitted: !0 }), o({ value: { mediaRecordingUid: k }, questionId: t, type: a }, !0)) : o({ value: null, questionId: t, type: a }, !0);
414
414
  };
415
415
  return e("form", { className: O(n, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [e(ie, { isRequired: r == null ? void 0 : r.required, message: s, properties: r }), e(ae, { children: [e("div", { id: "ul-question-player-container", ref: L, style: { display: P === Le ? "" : "none" }, children: [e("div", { id: ve, ref: (u) => {
@@ -428,9 +428,9 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
428
428
  const C = Ir(ve, { surveyId: f, responseGroupUid: c, questionId: t, visitorId: p, envId: y }, m, A, void 0, { ...g, "x-ul-video-recorder-origin": "sdk" }, r.mediaType === se.MEDIA_TYPE_AUDIO, S);
429
429
  u.appendChild(C);
430
430
  }
431
- } })] })] }), e(ue, { children: [e(ee, { disabled: !h, onClick: Y, children: ge(r) }), e("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: Y, style: { display: r.required ? "none" : "block", ...h ? { display: "none" } : {} }, children: Me(r) })] })] });
431
+ } })] })] }), e(ue, { children: [e(ee, { disabled: !h, onClick: K, children: ge(r) }), e("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: K, style: { display: r.required ? "none" : "block", ...h ? { display: "none" } : {} }, children: Me(r) })] })] });
432
432
  }, Xr = ({ className: n }) => {
433
- const { uploadProgress: s } = z((a) => ({ uploadProgress: a.uploadProgress }));
433
+ const { uploadProgress: s } = Y((a) => ({ uploadProgress: a.uploadProgress }));
434
434
  let o, r;
435
435
  Object.values(s).filter((a) => a.isSubmitted).length > 1 ? (o = "Your responses are processing", r = "Please keep this tab open until your responses are fully processed.") : (o = "Your response is processing", r = "Please keep this tab open until your response is fully processed.");
436
436
  const t = Math.round(Math.min(99, ...Object.values(s).filter((a) => a.isSubmitted).map((a) => a.progressPct || 0)));
@@ -445,37 +445,37 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
445
445
  ne(() => {
446
446
  const v = d.findIndex((C) => C.isRightLabel), w = d.findIndex((C) => C.isLeftLabel), B = v !== -1 && w !== -1;
447
447
  S(B);
448
- const T = !r.required || r.required && B, L = d.map((C) => ({ id: C.id, option: C.label, selected: et(C) })), A = Math.floor(a), Y = Object.keys(c).filter((C) => C.startsWith(A.toString())).map(Number).sort((C, V) => C - V).at(-1), u = [];
449
- if (typeof Y == "number") {
450
- const C = c[Y], V = JSON.parse(C);
448
+ const T = !r.required || r.required && B, L = d.map((C) => ({ id: C.id, option: C.label, selected: et(C) })), A = Math.floor(a), K = Object.keys(c).filter((C) => C.startsWith(A.toString())).map(Number).sort((C, V) => C - V).at(-1), u = [];
449
+ if (typeof K == "number") {
450
+ const C = c[K], V = JSON.parse(C);
451
451
  u.push(...V);
452
452
  }
453
453
  u.push(L), setTimeout(() => {
454
454
  y({ value: u, questionId: a, type: m }, T, B), S(!1);
455
455
  }, B ? 500 : 0);
456
456
  }, [d]);
457
- const { border: p, useMobileStyling: h, enableCspTrustedTypes: b } = z((v) => ({ border: v.border, useMobileStyling: v.useMobileStyling, enableCspTrustedTypes: v.enableCspTrustedTypes })), x = (v, w) => () => {
458
- i || g((B) => ((T, L, A) => T.map((Y) => Y.id === L ? { ...Y, isRightLabel: A === de.RIGHT, isLeftLabel: A === de.LEFT } : A === de.RIGHT && Y.isRightLabel || A === de.LEFT && Y.isLeftLabel ? { ...Y, isRightLabel: !1, isLeftLabel: !1 } : Y))(B, v, w));
457
+ const { border: p, useMobileStyling: h, enableCspTrustedTypes: b } = Y((v) => ({ border: v.border, useMobileStyling: v.useMobileStyling, enableCspTrustedTypes: v.enableCspTrustedTypes })), x = (v, w) => () => {
458
+ i || g((B) => ((T, L, A) => T.map((K) => K.id === L ? { ...K, isRightLabel: A === de.RIGHT, isLeftLabel: A === de.LEFT } : A === de.RIGHT && K.isRightLabel || A === de.LEFT && K.isLeftLabel ? { ...K, isRightLabel: !1, isLeftLabel: !1 } : K))(B, v, w));
459
459
  }, _ = (U = r.ratingIcons) == null ? void 0 : U[0].svg, k = (P = r.ratingIcons) == null ? void 0 : P[1].svg;
460
460
  return e("form", { className: O(n, "ul-card-maxdiff", "fade-in-transition"), children: [e(ie, { isRequired: r == null ? void 0 : r.required, message: o, properties: r }), e(ae, { children: e("div", { className: "ul-card--maxdiff__question-inner-container", children: [e("div", { className: "ul-card-maxdiff__label", children: (s == null ? void 0 : s.left) || ((M = r == null ? void 0 : r.labels) == null ? void 0 : M.left) || rt }), e("div", { children: " " }), e("div", { className: "ul-card-maxdiff__label", children: (s == null ? void 0 : s.right) || ((D = r == null ? void 0 : r.labels) == null ? void 0 : D.right) || tt }), d.map(({ id: v, label: w, isLeftLabel: B, isRightLabel: T }) => e(ye, { children: [e("div", { className: "ul-card-maxdiff__option-control " + (k ? "smiley" : ""), children: k ? e(Ge, { ariaPressed: B, className: B ? "ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected good" : "ul-card-maxdiff__option-btn", enableCspTrustedTypes: b, html: k, id: `smiley-good-${v}`, onClick: x(v, de.LEFT) }) : e(Se, { allowTextEntry: !1, ariaLabel: `bestLabel-${w}`, border: p, choiceStyle: f, error: !1, id: `${v}`, isRadio: !0, isSelected: B, onUserInputChanged: x(v, de.LEFT), useMobileStyling: h }) }), e("div", { className: "ul-card-maxdiff__option-label", children: w }), e("div", { className: "ul-card-maxdiff__option-control " + (_ ? "smiley" : ""), children: _ ? e(Ge, { ariaPressed: T, className: T ? "ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected bad" : "ul-card-maxdiff__option-btn", enableCspTrustedTypes: b, html: _, id: `smiley-bad-${v}`, onClick: x(v, de.RIGHT) }) : e(Se, { allowTextEntry: !1, ariaLabel: `worstLabel-${w}`, border: p, choiceStyle: f, error: !1, id: `${v}`, isRadio: !0, isSelected: T, onUserInputChanged: x(v, de.RIGHT), useMobileStyling: h }) })] }))] }) })] }, a);
461
461
  }, Ge = ({ enableCspTrustedTypes: n, ariaPressed: s, className: o, html: r, id: t, onClick: a }) => {
462
462
  const m = he(() => We(r, n), [n, r]);
463
463
  return e("span", { "aria-pressed": s, className: o, dangerouslySetInnerHTML: { __html: m }, id: t, onClick: a, tabIndex: 0, type: "button" });
464
464
  }, st = ({ className: n, labels: s, message: o, next: r, properties: t, questionId: a, type: m, onSubmitButtonClick: y, options: d, showIndividualSubmit: g = !1 }) => {
465
- const c = te(null), f = te(0), i = te(0), S = te(null), p = te(!1), h = te([]), [b, x] = Z(() => (t == null ? void 0 : t.required) === !0), [_, k] = Z(() => d.map((N) => ({ ...N, rank: null }))), U = he(() => Array.from({ length: d.length }, (N, Q) => Q + 1), [d.length]), { isLongFormSurvey: P, focusedQuestionId: M, setFocusedQuestionId: D, useMobileStyling: v, isPreview: w, headers: B } = z((N) => ({ useMobileStyling: N.useMobileStyling, isLongFormSurvey: le(N.studyType), focusedQuestionId: N.focusedQuestionId, setFocusedQuestionId: N.setFocusedQuestionId, isPreview: N.isPreview, headers: N.headers })), T = (B == null ? void 0 : B["userleap-platform"]) === "android", L = v && !w && !T, A = !L && !T, Y = P && M === a, u = (N) => {
465
+ const c = te(null), f = te(0), i = te(0), S = te(null), p = te(!1), h = te([]), [b, x] = Z(() => (t == null ? void 0 : t.required) === !0), [_, k] = Z(() => d.map((N) => ({ ...N, rank: null }))), U = he(() => Array.from({ length: d.length }, (N, Q) => Q + 1), [d.length]), { isLongFormSurvey: P, focusedQuestionId: M, setFocusedQuestionId: D, useMobileStyling: v, isPreview: w, headers: B } = Y((N) => ({ useMobileStyling: N.useMobileStyling, isLongFormSurvey: le(N.studyType), focusedQuestionId: N.focusedQuestionId, setFocusedQuestionId: N.setFocusedQuestionId, isPreview: N.isPreview, headers: N.headers })), T = (B == null ? void 0 : B["userleap-platform"]) === "android", L = v && !w && !T, A = !L && !T, K = P && M === a, u = (N) => {
466
466
  N.preventDefault(), q(_), y && y();
467
467
  }, C = (N, Q) => {
468
468
  k(($) => {
469
- const R = parseInt(Q), j = $.map((W) => ({ ...W }));
470
- j.some((W) => W.rank == null) && j.forEach((W, fe) => W.rank = fe + 1);
471
- const oe = j.findIndex((W) => W.id === N);
469
+ const R = parseInt(Q), j = $.map((z) => ({ ...z }));
470
+ j.some((z) => z.rank == null) && j.forEach((z, fe) => z.rank = fe + 1);
471
+ const oe = j.findIndex((z) => z.id === N);
472
472
  if (oe === -1) return $;
473
- const X = j[oe].rank;
474
- return R < X ? j.forEach((W) => {
475
- W.id !== N && W.rank >= R && W.rank < X && (W.rank = W.rank + 1);
476
- }) : R > X && j.forEach((W) => {
477
- W.id !== N && W.rank > X && W.rank <= R && (W.rank = W.rank - 1);
478
- }), j[oe].rank = R, j.sort((W, fe) => W.rank - fe.rank), F(j), j;
473
+ const J = j[oe].rank;
474
+ return R < J ? j.forEach((z) => {
475
+ z.id !== N && z.rank >= R && z.rank < J && (z.rank = z.rank + 1);
476
+ }) : R > J && j.forEach((z) => {
477
+ z.id !== N && z.rank > J && z.rank <= R && (z.rank = z.rank - 1);
478
+ }), j[oe].rank = R, j.sort((z, fe) => z.rank - fe.rank), F(j), j;
479
479
  });
480
480
  }, V = (N, Q) => {
481
481
  for (let $ = 0; $ < h.current.length; $++) {
@@ -485,7 +485,7 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
485
485
  if (N >= j.left && N <= j.right && Q >= j.top && Q <= j.bottom) return { element: R, index: $ };
486
486
  }
487
487
  return null;
488
- }, J = (N) => (Q) => {
488
+ }, W = (N) => (Q) => {
489
489
  if (!L) return;
490
490
  Q.preventDefault(), Q.stopPropagation(), p.current = !0, c.current = N;
491
491
  const $ = Q.touches[0];
@@ -513,8 +513,8 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
513
513
  }, I = (N, Q) => {
514
514
  k(($) => {
515
515
  const R = $.map((oe) => ({ ...oe })), [j] = R.splice(N, 1);
516
- return R.splice(Q, 0, j), R.forEach((oe, X) => {
517
- oe.rank = X + 1;
516
+ return R.splice(Q, 0, j), R.forEach((oe, J) => {
517
+ oe.rank = J + 1;
518
518
  }), F(R), R;
519
519
  });
520
520
  }, q = (N) => {
@@ -522,30 +522,30 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
522
522
  N.reduce(($, R) => ($[R.id] = R.rank, $), Q), r({ value: Q, questionId: a, type: m }, !0);
523
523
  }, F = (N) => {
524
524
  x(!1), P && q(N);
525
- }, { left: E, right: G } = s, K = d.length, me = (N) => {
525
+ }, { left: E, right: G } = s, X = d.length, me = (N) => {
526
526
  N.preventDefault(), N.currentTarget.classList.add("is-drop-target");
527
527
  }, be = (N) => {
528
528
  N.currentTarget.classList.remove("is-drop-target");
529
529
  }, xe = (N) => {
530
530
  c.current = null, N.currentTarget.classList.remove("is-dragging");
531
531
  };
532
- return e("form", { className: O(n, "ul-card-rank", "fade-in-transition", P && !Y && "ul-card--unfocused"), onClick: P ? () => {
532
+ return e("form", { className: O(n, "ul-card-rank", "fade-in-transition", P && !K && "ul-card--unfocused"), onClick: P ? () => {
533
533
  P && M !== a && D(a);
534
- } : void 0, onSubmit: u, children: [e(ie, { isRequired: t == null ? void 0 : t.required, message: o, properties: t }), e(pe, { properties: t, children: e(ye, T ? { children: [e(ae, { children: [e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", E] }) }), e("ol", { className: "ul-card-rank__list", children: _.map(({ id: N, label: Q, rank: $ }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${Q}`, className: O("ul-card-rank__select", $ == null && "ul-card-rank__select--placeholder"), name: `rank[${N}]`, onChange: (R) => C(N, R.currentTarget.value), value: $ ?? "", children: [$ == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), U.map((R) => e("option", { className: "ul-card-rank__select-option", value: R, children: R }, `${R}-${a}`))] }), e("span", { children: Q })] }, N)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [K, " - ", G] }) })] }), g && e(Ie, { handleSubmit: u, isSubmitDisabled: b })] }), !P && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: b, children: ge(t) }) }) })] } : { children: [e(ae, { children: [e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", E] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: T ? void 0 : (N) => {
534
+ } : void 0, onSubmit: u, children: [e(ie, { isRequired: t == null ? void 0 : t.required, message: o, properties: t }), e(pe, { properties: t, children: e(ye, T ? { children: [e(ae, { children: [e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", E] }) }), e("ol", { className: "ul-card-rank__list", children: _.map(({ id: N, label: Q, rank: $ }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${Q}`, className: O("ul-card-rank__select", $ == null && "ul-card-rank__select--placeholder"), name: `rank[${N}]`, onChange: (R) => C(N, R.currentTarget.value), value: $ ?? "", children: [$ == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), U.map((R) => e("option", { className: "ul-card-rank__select-option", value: R, children: R }, `${R}-${a}`))] }), e("span", { children: Q })] }, N)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [X, " - ", G] }) })] }), g && e(Ie, { handleSubmit: u, isSubmitDisabled: b })] }), !P && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: b, children: ge(t) }) }) })] } : { children: [e(ae, { children: [e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", E] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: T ? void 0 : (N) => {
535
535
  N.preventDefault(), N.dataTransfer && (N.dataTransfer.dropEffect = "move");
536
536
  }, children: _.map(({ id: N, label: Q, rank: $ }, R) => {
537
- return e("li", { className: "ul-card-rank__option", draggable: !!A || void 0, onDragEnd: A ? xe : void 0, onDragEnter: A ? me : void 0, onDragLeave: A ? be : void 0, onDragStart: A ? (oe = R, (X) => {
538
- c.current = oe, X.dataTransfer && (X.dataTransfer.effectAllowed = "move", X.dataTransfer.setData("text/plain", String(oe)), X.currentTarget.classList.add("is-dragging"));
539
- }) : void 0, onDrop: A ? (j = R, (X) => {
537
+ return e("li", { className: "ul-card-rank__option", draggable: !!A || void 0, onDragEnd: A ? xe : void 0, onDragEnter: A ? me : void 0, onDragLeave: A ? be : void 0, onDragStart: A ? (oe = R, (J) => {
538
+ c.current = oe, J.dataTransfer && (J.dataTransfer.effectAllowed = "move", J.dataTransfer.setData("text/plain", String(oe)), J.currentTarget.classList.add("is-dragging"));
539
+ }) : void 0, onDrop: A ? (j = R, (J) => {
540
540
  var fe, Fe;
541
- X.preventDefault(), X.currentTarget.classList.remove("is-drop-target");
542
- const W = c.current;
543
- c.current = null, (Fe = (fe = X.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : fe.querySelector(".is-dragging")) == null || Fe.classList.remove("is-dragging"), W != null && W !== j && I(W, j);
544
- }) : void 0, ref: (X) => h.current[R] = X, children: [e("select", { "aria-label": `Rank for ${Q}`, className: O("ul-card-rank__select", $ == null && "ul-card-rank__select--placeholder"), name: `rank[${N}]`, onChange: (X) => C(N, X.currentTarget.value), value: $ ?? "", children: [$ == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), U.map((X) => e("option", { className: "ul-card-rank__select-option", value: X, children: X }, `${X}-${a}`))] }), e("span", { children: Q }), !T && e("button", { "aria-label": `Drag ${Q} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: L ? l : void 0, onTouchMove: L ? H : void 0, onTouchStart: L ? J(R) : 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" }) }) })] }, N);
541
+ J.preventDefault(), J.currentTarget.classList.remove("is-drop-target");
542
+ const z = c.current;
543
+ c.current = null, (Fe = (fe = J.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : fe.querySelector(".is-dragging")) == null || Fe.classList.remove("is-dragging"), z != null && z !== j && I(z, j);
544
+ }) : void 0, ref: (J) => h.current[R] = J, children: [e("select", { "aria-label": `Rank for ${Q}`, className: O("ul-card-rank__select", $ == null && "ul-card-rank__select--placeholder"), name: `rank[${N}]`, onChange: (J) => C(N, J.currentTarget.value), value: $ ?? "", children: [$ == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), U.map((J) => e("option", { className: "ul-card-rank__select-option", value: J, children: J }, `${J}-${a}`))] }), e("span", { children: Q }), !T && e("button", { "aria-label": `Drag ${Q} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: L ? l : void 0, onTouchMove: L ? H : void 0, onTouchStart: L ? W(R) : 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" }) }) })] }, N);
545
545
  var j, oe;
546
- }) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [K, " - ", G] }) })] }), g && e(Ie, { handleSubmit: u, isSubmitDisabled: b })] }), !P && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: b, children: ge(t) }) }) })] }) })] }, a);
546
+ }) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [X, " - ", G] }) })] }), g && e(Ie, { handleSubmit: u, isSubmitDisabled: b })] }), !P && e(ue, { children: e("div", { className: "ul-card__button-wrapper", children: e(ee, { disabled: b, children: ge(t) }) }) })] }) })] }, a);
547
547
  }, it = /* @__PURE__ */ new Set(["aidynamicfollowup", "open", "matrix", "multipleselect", "multiplechoice", "rankorder"]), je = ({ cardInstance: n, moveToNextQuestion: s, showIndividualSubmit: o, submitQuestion: r, updateCardValues: t, allResponsesArray: a }) => {
548
- const { isLongFormSurvey: m, createDynamicQuestion: y, cards: d, surveyVisitorAttributes: g } = z((k) => ({ isLongFormSurvey: le(k.studyType), createDynamicQuestion: k.createDynamicQuestion, cards: k.cards, surveyVisitorAttributes: k.surveyVisitorAttributes }));
548
+ const { isLongFormSurvey: m, createDynamicQuestion: y, cards: d, surveyVisitorAttributes: g } = Y((k) => ({ isLongFormSurvey: le(k.studyType), createDynamicQuestion: k.createDynamicQuestion, cards: k.cards, surveyVisitorAttributes: k.surveyVisitorAttributes }));
549
549
  if (!n) return null;
550
550
  const { name: c, type: f, props: i, childId: S } = n, p = o && it.has(f), h = i == null ? void 0 : i.displayLogic, b = h == null ? void 0 : Ze({ displayLogic: h, allResponses: a, cards: d, surveyVisitorAttributes: g ?? {} });
551
551
  if (h && h.length > 0 && !b) return null;
@@ -591,11 +591,11 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
591
591
  return _ ? m ? e("div", { className: "ul-card-scroll-wrapper", children: _ }, c) : _ : null;
592
592
  }, at = ({ isSubmitDisabled: n = !1, onSubmit: s, buttonText: o }) => {
593
593
  var S;
594
- const { cards: r, forceBrandedLogo: t, index: a, marketingUrl: m, showSurveyBrand: y, slugName: d, surveyId: g, useMobileStyling: c } = z((p) => ({ cards: p.cards, forceBrandedLogo: p.forceBrandedLogo, index: p.index, marketingUrl: p.marketingUrl, showSurveyBrand: p.showSurveyBrand, slugName: p.slugName, surveyId: p.surveyId, useMobileStyling: p.useMobileStyling })), f = ((S = r[a]) == null ? void 0 : S.type) === "thanks", i = cr({ marketingUrl: m, slugName: d, surveyId: g, forceBrandedLogo: t });
594
+ const { cards: r, forceBrandedLogo: t, index: a, marketingUrl: m, showSurveyBrand: y, slugName: d, surveyId: g, useMobileStyling: c } = Y((p) => ({ cards: p.cards, forceBrandedLogo: p.forceBrandedLogo, index: p.index, marketingUrl: p.marketingUrl, showSurveyBrand: p.showSurveyBrand, slugName: p.slugName, surveyId: p.surveyId, useMobileStyling: p.useMobileStyling })), f = ((S = r[a]) == null ? void 0 : S.type) === "thanks", i = cr({ marketingUrl: m, slugName: d, surveyId: g, forceBrandedLogo: t });
595
595
  return e("footer", { className: O("long-form-question-footer-container", c && "long-form-question-footer-container--mobile", f && "long-form-question-footer-container-center"), children: [f && t ? e(dr, { marketingUrlLink: i }) : e("div", { className: "long-form-question-footer-container-logo", children: y ? e(ur, { forceBrandedLogo: t, marketingUrlLink: i }) : null }), !f && e("div", { className: O("ul-card__button-wrapper", "ul-card-vertical__button-wrapper", "long-form-question-footer-container-actions"), children: e(ee, { className: O("long-form-button", n && "sprig-button-disabled"), disabled: n, onClick: s, children: e("span", { className: "long-form-button-text-container", children: o ?? e(pr, { stroke: "white" }) }) }) })] });
596
596
  }, ut = ({ cards: n, next: s, previousResponses: o }) => {
597
597
  var H;
598
- const r = te(null), [t, a] = Z({}), [m, y] = Z({}), { isLongFormSurvey: d, focusedQuestionId: g, setFocusedQuestionId: c, createDynamicQuestion: f, allResponses: i, cardIndexByName: S, surveyVisitorAttributes: p, cards: h } = z((l) => ({ isLongFormSurvey: le(l.studyType), focusedQuestionId: l.focusedQuestionId, setFocusedQuestionId: l.setFocusedQuestionId, createDynamicQuestion: l.createDynamicQuestion, allResponses: l.allResponses, cardIndexByName: l.cardIndexByName, surveyVisitorAttributes: l.surveyVisitorAttributes, cards: l.cards })), b = he(() => ({ ...o, ...Ae(n.map((l) => {
598
+ const r = te(null), [t, a] = Z({}), [m, y] = Z({}), { isLongFormSurvey: d, focusedQuestionId: g, setFocusedQuestionId: c, createDynamicQuestion: f, allResponses: i, cardIndexByName: S, surveyVisitorAttributes: p, cards: h } = Y((l) => ({ isLongFormSurvey: le(l.studyType), focusedQuestionId: l.focusedQuestionId, setFocusedQuestionId: l.setFocusedQuestionId, createDynamicQuestion: l.createDynamicQuestion, allResponses: l.allResponses, cardIndexByName: l.cardIndexByName, surveyVisitorAttributes: l.surveyVisitorAttributes, cards: l.cards })), b = he(() => ({ ...o, ...Ae(n.map((l) => {
599
599
  var I, q;
600
600
  return { ...l, value: ((I = t[l.name]) == null ? void 0 : I.value) ?? null, secondaryValue: ((q = t[l.name]) == null ? void 0 : q.secondaryValue) ?? null };
601
601
  })) }), [o, t, n]);
@@ -623,14 +623,14 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
623
623
  const P = te(null), M = te(!1), D = te(null), v = ke((l) => {
624
624
  var E, G;
625
625
  M.current = !0;
626
- const I = n.findIndex((K) => K.name === l);
626
+ const I = n.findIndex((X) => X.name === l);
627
627
  if (!d || l === null || I === -1) return void (M.current = !1);
628
628
  const q = (E = P.current) == null ? void 0 : E.querySelectorAll(".ul-card-scroll-wrapper")[I], F = (G = P.current) == null ? void 0 : G.closest(".ul-card-main-content");
629
629
  if (q && F) {
630
630
  if (q && F) {
631
- const K = q.getBoundingClientRect(), me = F.getBoundingClientRect(), be = K.top - me.top + F.scrollTop, xe = be + K.height / 2, N = window.innerHeight - 157;
631
+ const X = q.getBoundingClientRect(), me = F.getBoundingClientRect(), be = X.top - me.top + F.scrollTop, xe = be + X.height / 2, N = window.innerHeight - 157;
632
632
  let Q;
633
- K.height >= N ? Q = be : Q = xe - F.clientHeight / 2;
633
+ X.height >= N ? Q = be : Q = xe - F.clientHeight / 2;
634
634
  const $ = F.clientHeight, R = F.scrollHeight - $, j = Math.max(0, Math.min(Q, R));
635
635
  F.scrollTo({ top: j, behavior: "smooth" }), setTimeout(() => {
636
636
  M.current = !1;
@@ -675,8 +675,8 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
675
675
  const Q = xe.getBoundingClientRect(), $ = Q.top + Q.height / 2, R = Math.abs(F - $);
676
676
  R < G && (G = R, E = N);
677
677
  });
678
- const K = n[E];
679
- D.current = K.name, c(K.name);
678
+ const X = n[E];
679
+ D.current = X.name, c(X.name);
680
680
  }, [n, c]);
681
681
  ne(() => {
682
682
  var I;
@@ -689,11 +689,11 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
689
689
  const A = he(() => n.every((l) => {
690
690
  var I;
691
691
  return !k.has(l.name) || !(!(l != null && l.props) || !("properties" in l.props) || ((I = l.props.properties) == null ? void 0 : I.required) !== !1) || m[l.name];
692
- }), [m, n, k]), Y = async (l, I, q) => {
692
+ }), [m, n, k]), K = async (l, I, q) => {
693
693
  return y((E) => ({ ...E, [l]: q })), await (F = (E) => ({ ...E, [l]: I }), new Promise((E) => {
694
694
  a((G) => {
695
- const K = F(G);
696
- return E(K), K;
695
+ const X = F(G);
696
+ return E(X), X;
697
697
  });
698
698
  }));
699
699
  var F;
@@ -705,21 +705,21 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
705
705
  r.current = I;
706
706
  const q = {};
707
707
  if (n.forEach((E) => {
708
- var G, K;
709
- Tr(E) && (E.props.properties.required || (q[E.name] = { value: ((G = t[E.name]) == null ? void 0 : G.value) ?? null, secondaryValue: ((K = t[E.name]) == null ? void 0 : K.secondaryValue) ?? null, questionId: E.name, type: E.type }));
708
+ var G, X;
709
+ Tr(E) && (E.props.properties.required || (q[E.name] = { value: ((G = t[E.name]) == null ? void 0 : G.value) ?? null, secondaryValue: ((X = t[E.name]) == null ? void 0 : X.secondaryValue) ?? null, questionId: E.name, type: E.type }));
710
710
  }), l == null || l !== I) a(q), y({});
711
711
  else {
712
712
  a((G) => ({ ...G, ...q }));
713
- const E = n.reduce((G, K) => {
713
+ const E = n.reduce((G, X) => {
714
714
  var me;
715
- return K.type === "aidynamicfollowup" && ((me = K.props) == null ? void 0 : me.loading) === null && (G[K.name] = !0), G;
715
+ return X.type === "aidynamicfollowup" && ((me = X.props) == null ? void 0 : me.loading) === null && (G[X.name] = !0), G;
716
716
  }, {});
717
717
  y((G) => ({ ...G, ...E }));
718
718
  }
719
719
  }, [n, d]);
720
720
  const u = async (l, I) => {
721
721
  if (d) {
722
- const q = await Y(l.questionId, l, I), F = C(l.type), E = V(l.type);
722
+ const q = await K(l.questionId, l, I), F = C(l.type), E = V(l.type);
723
723
  if (F && T(l.questionId), E && I) {
724
724
  const G = B(n, q);
725
725
  s(G);
@@ -728,15 +728,15 @@ const er = "ul-permission-graphics-container", rr = "ul-permission-body", tr = O
728
728
  const q = x.find((E) => E.name === l.questionId), F = { ...l, questionText: q ? Qe(q) : void 0 };
729
729
  w({ displayCard: q, response: l }), s([F]);
730
730
  }
731
- }, C = (l) => (/* @__PURE__ */ new Set(["nps", "likert", "multiplechoice"])).has(l), V = (l) => (/* @__PURE__ */ new Set(["videovoice", "consentlegal", "texturlprompt", "maxdiff"])).has(l), J = ((H = n[0]) == null ? void 0 : H.type) === "thanks";
732
- return d ? e("div", { className: "ul-card-list-container--longform", "data-testid": "ui-container", ref: P, children: [e(Jr, { value: o, children: x.map((l, I) => e(je, { allResponsesArray: _, cardInstance: l, moveToNextQuestion: T, showIndividualSubmit: d && n.length > 1 && I < n.length - 1, submitQuestion: u, updateCardValues: Y }, (l == null ? void 0 : l.name) || I)) }), !J && e(at, { isSubmitDisabled: !A, onSubmit: function() {
731
+ }, C = (l) => (/* @__PURE__ */ new Set(["nps", "likert", "multiplechoice"])).has(l), V = (l) => (/* @__PURE__ */ new Set(["videovoice", "consentlegal", "texturlprompt", "maxdiff"])).has(l), W = ((H = n[0]) == null ? void 0 : H.type) === "thanks";
732
+ return d ? e("div", { className: "ul-card-list-container--longform", "data-testid": "ui-container", ref: P, children: [e(Jr, { value: o, children: x.map((l, I) => e(je, { allResponsesArray: _, cardInstance: l, moveToNextQuestion: T, showIndividualSubmit: d && n.length > 1 && I < n.length - 1, submitQuestion: u, updateCardValues: K }, (l == null ? void 0 : l.name) || I)) }), !W && e(at, { isSubmitDisabled: !A, onSubmit: function() {
733
733
  const l = B(n, t);
734
734
  if ((x == null ? void 0 : x.length) === 1 && (l == null ? void 0 : l.length) === 1) {
735
735
  const I = x[0], q = l[0];
736
736
  w({ displayCard: I, response: q });
737
737
  }
738
738
  s(l);
739
- } })] }) : e(ye, { children: [e("div", { "data-testid": "ui-container", style: { display: "none" } }), x.map((l, I) => e(je, { allResponsesArray: _, cardInstance: l, moveToNextQuestion: T, showIndividualSubmit: d && n.length > 1 && I < n.length - 1, submitQuestion: u, updateCardValues: Y }, (l == null ? void 0 : l.name) || I))] });
739
+ } })] }) : e(ye, { children: [e("div", { "data-testid": "ui-container", style: { display: "none" } }), x.map((l, I) => e(je, { allResponsesArray: _, cardInstance: l, moveToNextQuestion: T, showIndividualSubmit: d && n.length > 1 && I < n.length - 1, submitQuestion: u, updateCardValues: K }, (l == null ? void 0 : l.name) || I))] });
740
740
  };
741
741
  export {
742
742
  ut as PageCard
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./core-C7-zlHSe.cjs");require("./replay.cjs");const r=require("./metricsReporter-BkgMLm2f.cjs");exports.SprigAPI=e.SprigAPI,exports.default=e.core,exports.sprig=e.sprig,exports.DismissReason=r.DismissReason,exports.SprigEvent=r.SprigEvent;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./core-uBBFpb_3.cjs");require("./replay.cjs");const r=require("./metricsReporter-BAPwG4KR.cjs");exports.SprigAPI=e.SprigAPI,exports.default=e.core,exports.sprig=e.sprig,exports.DismissReason=r.DismissReason,exports.SprigEvent=r.SprigEvent;
package/dist/index.d.ts CHANGED
@@ -1282,6 +1282,7 @@ interface MultipleChoiceOption {
1282
1282
  allowsTextEntry?: boolean;
1283
1283
  noneOfTheAbove?: boolean;
1284
1284
  isPinned?: boolean;
1285
+ otherOptionPlaceholder?: string;
1285
1286
  };
1286
1287
  order: number;
1287
1288
  productId: number;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { S as i, c as o, s as p } from "./core-DE_-33ff.js";
1
+ import { S as i, c as o, s as p } from "./core-BAftYDJ4.js";
2
2
  import "./replay.js";
3
- import { D as t, S as m } from "./metricsReporter-CJzT7qY-.js";
3
+ import { D as t, S as m } from "./metricsReporter-CJIq-5XV.js";
4
4
  export {
5
5
  t as DismissReason,
6
6
  i as SprigAPI,