@sprig-technologies/sprig-bundled 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,6 +1,6 @@
1
- import { u as G, a as e, h as Q, c as O, g as K, b as re, d as Be, p as ue, F as fe, _ as se, T as be, A as Cn, e as Ee, f as xn, i as kn, j as ze, k as wn, l as En, S as jn, w as nn, m as In } from "./view-CocVngjw.js";
2
- import { v as Tn, E as Te, h as qe, A as Ue, j as _n, i as tn } from "./index-Dm5Q2JaO.js";
3
- import { B as oe, M as ie, Q as le, O as Oe, a as de, b as Ce, S as Dn, L as Sn, u as Pn, H as ye, c as Ae, g as Ln, P as Rn } from "./getAttributedUrl-BCuq8noY.js";
1
+ import { u as G, a as e, h as Q, c as O, g as K, b as re, d as Be, p as ue, F as fe, _ as se, T as be, A as Cn, e as Ee, f as xn, i as kn, j as ze, k as wn, l as En, S as jn, w as nn, m as In } from "./view-E1bmiI1s.js";
2
+ import { v as Tn, E as Te, h as qe, A as Ue, j as _n, i as tn } from "./index-BiIngDfi.js";
3
+ import { B as oe, M as ie, Q as le, O as Oe, a as de, b as Ce, S as Dn, L as Sn, u as Pn, H as ye, c as Ae, g as Ln, P as Rn } from "./getAttributedUrl-DxNZ8ZsR.js";
4
4
  const pe = "https://cdn.sprig.com", I = { document: void 0, videojs: void 0 }, $e = (n) => n + "-loading-spiner", W = "hidden", Ge = ".m3u8", _e = "questionId", De = "ul-video-recorder-camera-off-button", Se = "ul-recording-in-session", Nn = [{ type: "link", content: `${pe}/dependencies/videojs-record-4.5.0.min.css` }, { type: "script", content: `${pe}/dependencies/RecordRTC-5.6.2.js` }, { type: "script", content: `${pe}/dependencies/adapter.8.0.0.min.js` }, { type: "script", content: `${pe}/dependencies/videojs-record-4.5.0.min.js` }, { type: "script", content: `${pe}/userleap-web-upchunk-v2.2.2.js` }], rn = [{ type: "link", content: `${pe}/dependencies/video-js-7.18.0.min.css` }, { type: "script", content: `${pe}/dependencies/video-js-7.18.0.min.js` }, { type: "style", content: `/* progress control styles */
5
5
  .video-js .vjs-control {
6
6
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
@@ -732,8 +732,8 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
732
732
  const g = (l) => {
733
733
  const p = De, x = De + "-audio-only";
734
734
  We(a.uploadProgressLabel, "none"), ne && ne.startTime >= Ye && ne.abort();
735
- const P = I.document.getElementById("ul-camera-button");
736
- l ? (a.children()[0].classList.add("vjs-hidden"), M.removeClass(p), M.addClass(x), P.innerHTML = ee.TurnOnCamera, a.audioPlayerPlaceholder.removeClass("vjs-hidden"), C == null || C.getTracks().forEach((j) => {
735
+ const D = I.document.getElementById("ul-camera-button");
736
+ l ? (a.children()[0].classList.add("vjs-hidden"), M.removeClass(p), M.addClass(x), D.innerHTML = ee.TurnOnCamera, a.audioPlayerPlaceholder.removeClass("vjs-hidden"), C == null || C.getTracks().forEach((j) => {
737
737
  j.stop();
738
738
  }), window.navigator.mediaDevices.getUserMedia({ video: !0, audio: !0 }).then((j) => {
739
739
  C = j, j.getVideoTracks().forEach((B) => {
@@ -741,7 +741,7 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
741
741
  }), a.record().onDeviceReady(j);
742
742
  }).catch(a.record().onDeviceError.bind(a.record()))) : (C == null || C.getVideoTracks().forEach((j) => {
743
743
  j.enabled = !0;
744
- }), a.children()[0].classList.remove("vjs-hidden"), a.record().getDevice(), M.removeClass(x), M.addClass(p), P.innerHTML = ee.TurnOffCamera, a.audioPlayerPlaceholder.addClass("vjs-hidden"));
744
+ }), a.children()[0].classList.remove("vjs-hidden"), a.record().getDevice(), M.removeClass(x), M.addClass(p), D.innerHTML = ee.TurnOffCamera, a.audioPlayerPlaceholder.addClass("vjs-hidden"));
745
745
  }, f = new (I.videojs.getComponent("Button"))(a, { clickHandler: () => {
746
746
  f.hasClass(W) || (ce({ event: "Video Delete Button Clicked", apiBase: r, headers: d, visitorId: h, envId: k, metadata: { questionId: y, responseGroupUid: c, surveyId: v } }), g(a.cameraOff), i(N.DELETE, {}), M.removeClass(W), f.addClass(W));
747
747
  } });
@@ -777,20 +777,20 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
777
777
  T.hide(), b.show(), m.show(), f.removeClass(W);
778
778
  }), a.on("deviceReady", () => {
779
779
  T.show(), b.hide(), f.addClass(W);
780
- }), ((l, p, x, P, j) => {
780
+ }), ((l, p, x, D, j) => {
781
781
  const { surveyId: B, responseGroupUid: Y, visitorId: L, envId: R } = l.payload;
782
782
  l.on("deviceError", function() {
783
783
  console.warn("device error: ", l.deviceErrorCode), l.deviceErrorCode.message === "Permission denied" ? (l.deviceButton.addClass("permission-denied"), x && x(N.ERROR, { type: N.PERMISSION_DENIED }), ce({ event: "Video Permission Denied", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { questionId: Pe(l, _e), responseGroupUid: Y, surveyId: B } })) : (x && x(N.ERROR, { type: N.OTHER }), ae(new Error(l.deviceErrorCode.message), "recorderDeviceError", p, j, L, R));
784
784
  }), l.on("error", function(F, Z) {
785
785
  ae(Z || l.error(), "recorderError", p, j, L, R);
786
786
  }), l.on("startRecord", function(F, Z) {
787
- P(l.uploadProgressLabel, "none"), ce({ event: "Video Record Start", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { questionId: Pe(l, _e), responseGroupUid: Y, surveyId: B } });
787
+ D(l.uploadProgressLabel, "none"), ce({ event: "Video Record Start", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { questionId: Pe(l, _e), responseGroupUid: Y, surveyId: B } });
788
788
  }), l.on("finishRecord", async function() {
789
- P(l.uploadProgressLabel, "start", 0);
789
+ D(l.uploadProgressLabel, "start", 0);
790
790
  const F = Pe(l, _e);
791
791
  if (!B) {
792
- const D = "internal error: missing fields in payload";
793
- return x && x(N.ERROR, { type: N.OTHER }), ae(new Error(D), "finishRecord", p, j, L, R), null;
792
+ const S = "internal error: missing fields in payload";
793
+ return x && x(N.ERROR, { type: N.OTHER }), ae(new Error(S), "finishRecord", p, j, L, R), null;
794
794
  }
795
795
  l.record().stopDevice();
796
796
  const Z = l.cameraOff ? N.MEDIA_TYPE_AUDIO : N.MEDIA_TYPE_VIDEO, J = Tn();
@@ -798,19 +798,19 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
798
798
  const me = { surveyId: B, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), mediaType: Z, mediaRecordingUid: J };
799
799
  F && (me.questionId = F), Y && (me.responseGroupUid = Y), L && (me.visitorId = L);
800
800
  const E = await (async () => {
801
- const D = await fetch(`${p}/2/environments/integrations/upload`, { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify(me) });
802
- if (D.ok) {
803
- const U = await D.json();
801
+ const S = await fetch(`${p}/2/environments/integrations/upload`, { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify(me) });
802
+ if (S.ok) {
803
+ const U = await S.json();
804
804
  return x && x(N.UPLOAD_STARTED, { [N.UPLOAD_ID]: U.upload.id, [N.MEDIA_TYPE]: Z, [N.MEDIA_RECORDING_UID]: J }), U.upload.url;
805
805
  }
806
- return x && x(N.ERROR, { type: N.OTHER, response: D }), ae(new Error("failed to get upload response with url"), "finishRecord", p, j, L, R), null;
806
+ return x && x(N.ERROR, { type: N.OTHER, response: S }), ae(new Error("failed to get upload response with url"), "finishRecord", p, j, L, R), null;
807
807
  })();
808
- E && (ne = I.document.defaultView.UpChunk.createUpload({ endpoint: E, file: new I.document.defaultView.File([l.recordedData], `recording ${Z} ${Date.now()}`), chunkSize: 5120 }), ne.startTime = Date.now(), ce({ event: "Video Upload Start", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { mediaRecordingUid: J, questionId: F, responseGroupUid: Y, surveyId: B, mediaType: Z, url: E } }), ne.on("error", (D) => {
809
- P(l.uploadProgressLabel, "none"), x && x(N.UPLOAD_FINISHED, { [N.MEDIA_RECORDING_UID]: J }), ae(D, "finishRecord", p, j, L, R);
810
- }), ne.on("progress", (D) => {
811
- x && x(N.UPLOAD_PROGRESS, { [N.MEDIA_RECORDING_UID]: J, [N.UPLOAD_PROGRESS_PCT]: D.detail }), P(l.uploadProgressLabel, "progress", D.detail);
808
+ E && (ne = I.document.defaultView.UpChunk.createUpload({ endpoint: E, file: new I.document.defaultView.File([l.recordedData], `recording ${Z} ${Date.now()}`), chunkSize: 5120 }), ne.startTime = Date.now(), ce({ event: "Video Upload Start", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { mediaRecordingUid: J, questionId: F, responseGroupUid: Y, surveyId: B, mediaType: Z, url: E } }), ne.on("error", (S) => {
809
+ D(l.uploadProgressLabel, "none"), x && x(N.UPLOAD_FINISHED, { [N.MEDIA_RECORDING_UID]: J }), ae(S, "finishRecord", p, j, L, R);
810
+ }), ne.on("progress", (S) => {
811
+ x && x(N.UPLOAD_PROGRESS, { [N.MEDIA_RECORDING_UID]: J, [N.UPLOAD_PROGRESS_PCT]: S.detail }), D(l.uploadProgressLabel, "progress", S.detail);
812
812
  }), ne.on("success", () => {
813
- P(l.uploadProgressLabel, "success"), x && x(N.UPLOAD_FINISHED, { [N.MEDIA_RECORDING_UID]: J }), ce({ event: "Video Upload Success", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { mediaRecordingUid: J, questionId: F, responseGroupUid: Y, surveyId: B, mediaType: Z, url: E, elapsedMs: ne.startTime && Date.now() - ne.startTime } });
813
+ D(l.uploadProgressLabel, "success"), x && x(N.UPLOAD_FINISHED, { [N.MEDIA_RECORDING_UID]: J }), ce({ event: "Video Upload Success", apiBase: p, headers: j, visitorId: L, envId: R, metadata: { mediaRecordingUid: J, questionId: F, responseGroupUid: Y, surveyId: B, mediaType: Z, url: E, elapsedMs: ne.startTime && Date.now() - ne.startTime } });
814
814
  }));
815
815
  });
816
816
  })(a, r, i, We, d);
@@ -989,21 +989,21 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
989
989
  return (p = l.optionProperties) == null ? void 0 : p.noneOfTheAbove;
990
990
  }), f = (l) => Object.entries(l).some(([p, x]) => {
991
991
  var B;
992
- const P = t.find((Y) => `${Y.id}` === p), j = x.userText === void 0 || x.userText.trim() === "";
993
- return ((B = P == null ? void 0 : P.optionProperties) == null ? void 0 : B.allowsTextEntry) && j && x.isSelected;
992
+ const D = t.find((Y) => `${Y.id}` === p), j = x.userText === void 0 || x.userText.trim() === "";
993
+ return ((B = D == null ? void 0 : D.optionProperties) == null ? void 0 : B.allowsTextEntry) && j && x.isSelected;
994
994
  }), _ = (l) => Object.values(l).filter((p) => p.isSelected).length, q = r.minSelect && r.minSelect > 0 && r.maxSelectMode === Ce.Range && _(c) < r.minSelect && (C || _(c) > 0), M = (l) => f(l) || C && !_(l) || !((p) => {
995
- const { minSelect: x = 0, maxSelect: P = 1 / 0, maxSelectMode: j } = r, B = _(p);
995
+ const { minSelect: x = 0, maxSelect: D = 1 / 0, maxSelectMode: j } = r, B = _(p);
996
996
  switch (j) {
997
997
  case Ce.Maximum:
998
- return B <= P;
998
+ return B <= D;
999
999
  case Ce.Range:
1000
1000
  return B === 0 || B >= x;
1001
1001
  default:
1002
1002
  return !0;
1003
1003
  }
1004
1004
  })(l), T = Object.entries(c).some(([l, p]) => {
1005
- var x, P;
1006
- return p.isSelected && ((P = (x = t.find((j) => `${j.id}` === l)) == null ? void 0 : x.optionProperties) == null ? void 0 : P.allowsTextEntry);
1005
+ var x, D;
1006
+ return p.isSelected && ((D = (x = t.find((j) => `${j.id}` === l)) == null ? void 0 : x.optionProperties) == null ? void 0 : D.allowsTextEntry);
1007
1007
  }), $ = d && (!k || T), A = (l) => {
1008
1008
  w(l.id, l.selected, l.userText, l.noneOfTheAbove);
1009
1009
  }, m = (l) => {
@@ -1011,20 +1011,20 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
1011
1011
  return (r == null ? void 0 : r.maxSelectMode) !== Ce.Unlimited && _(c) === (r == null ? void 0 : r.maxSelect) && !((p = c[l]) != null && p.isSelected);
1012
1012
  }, b = () => {
1013
1013
  o(c, !0), u && u();
1014
- }, w = (l, p, x, P) => {
1014
+ }, w = (l, p, x, D) => {
1015
1015
  const j = Object.assign({}, c);
1016
- if ((k || P) && p) for (const B of Object.values(j)) B.isSelected = !1, delete B.userText;
1017
- else g && !P && c[g.id].isSelected && (j[g.id].isSelected = !1);
1016
+ if ((k || D) && p) for (const B of Object.values(j)) B.isSelected = !1, delete B.userText;
1017
+ else g && !D && c[g.id].isSelected && (j[g.id].isSelected = !1);
1018
1018
  j[l] = { isSelected: p, userText: x }, h(j);
1019
1019
  };
1020
1020
  return e("form", { className: O(n, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: b, children: e(ie, { properties: r, children: [e(de, { children: [r.isDropdown ? e(Dn, { disabledOptions: t.filter((l) => m(l.id)), dropdownFooter: q ? e("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [_(c), "/", r.minSelect] }) : void 0, isMultiSelect: !k, multiselectText: r.dropdownMultiselectedText ?? "choices selected", onChange: (l) => {
1021
1021
  const p = { ...c };
1022
1022
  for (const x of t) l.includes(x) ? p[x.id].isSelected = !0 : p[x.id].isSelected = !1;
1023
1023
  h(p);
1024
- }, options: t, placeholderText: r.dropdownPlaceholderText ?? (k ? "Select choice" : "Select choice(s)"), value: t.filter((l) => c[l.id].isSelected) }) : e("div", { className: O(K("ul-card__choices", v)), role: k ? "radiogroup" : "group", children: [t.map(({ id: l, label: p, value: x, optionProperties: P }) => {
1024
+ }, options: t, placeholderText: r.dropdownPlaceholderText ?? (k ? "Select choice" : "Select choice(s)"), value: t.filter((l) => c[l.id].isSelected) }) : e("div", { className: O(K("ul-card__choices", v)), role: k ? "radiogroup" : "group", children: [t.map(({ id: l, label: p, value: x, optionProperties: D }) => {
1025
1025
  var R, F;
1026
- const j = `${l}`, { allowsTextEntry: B, noneOfTheAbove: Y } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...P };
1027
- return e(Oe, { allowTextEntry: B, border: a, disabled: m(j), error: (L = c, f(L)), id: j, isRadio: k, isSelected: !!((R = c[j]) != null && R.isSelected), label: p, noneOfTheAbove: Y, onUserInputChanged: A, promptText: "Please specify", text: (F = c[l]) == null ? void 0 : F.userText, useMobileStyling: v, value: x }, j);
1026
+ const j = `${l}`, { allowsTextEntry: B, noneOfTheAbove: Y } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...D };
1027
+ return e(Oe, { allowTextEntry: B, border: a, disabled: m(j), error: (L = c, f(L)), id: j, isRadio: k, isSelected: !!((R = c[j]) != null && R.isSelected), label: p, noneOfTheAbove: Y, onUserInputChanged: A, promptText: (D == null ? void 0 : D.otherOptionPlaceholder) || "Please specify", text: (F = c[l]) == null ? void 0 : F.userText, useMobileStyling: v, value: x }, j);
1028
1028
  var L;
1029
1029
  }), !!q && e("div", { className: "ul-card__min-select-counter", children: [_(c), "/", r.minSelect] })] }), $ && e(Sn, { handleSubmit: b, isSubmitDisabled: M(c) })] }), e(le, { children: e(ve, { isDisabled: M(c), onClick: b, children: re(r) }) })] }) }, i);
1030
1030
  }, Zn = (n) => {
@@ -1071,62 +1071,62 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
1071
1071
  o({ value: v, questionId: r, type: i }, _), s && s();
1072
1072
  }, children: re(t) }) })] }) }) }, r);
1073
1073
  }, Kn = ({ className: n, labels: o, next: t, properties: r, questionId: i, type: s, onSubmitButtonClick: d, options: u }) => {
1074
- const a = se(null), v = se(0), y = se(0), c = se(null), h = se(!1), k = se([]), [C, g] = Q(() => (r == null ? void 0 : r.required) === !0), [f, _] = Q(() => u.map((E) => ({ ...E, rank: null }))), q = fe(() => Array.from({ length: u.length }, (E, D) => D + 1), [u.length]), { useMobileStyling: M, isPreview: T, headers: $ } = G((E) => ({ useMobileStyling: E.useMobileStyling, isPreview: E.isPreview, headers: E.headers })), A = ($ == null ? void 0 : $["userleap-platform"]) === "android", m = M && !T && !A, b = !m && !A, w = (E, D) => {
1074
+ const a = se(null), v = se(0), y = se(0), c = se(null), h = se(!1), k = se([]), [C, g] = Q(() => (r == null ? void 0 : r.required) === !0), [f, _] = Q(() => u.map((E) => ({ ...E, rank: null }))), q = fe(() => Array.from({ length: u.length }, (E, S) => S + 1), [u.length]), { useMobileStyling: M, isPreview: T, headers: $ } = G((E) => ({ useMobileStyling: E.useMobileStyling, isPreview: E.isPreview, headers: E.headers })), A = ($ == null ? void 0 : $["userleap-platform"]) === "android", m = M && !T && !A, b = !m && !A, w = (E, S) => {
1075
1075
  _((U) => {
1076
- const S = parseInt(D), V = U.map((H) => ({ ...H }));
1076
+ const P = parseInt(S), V = U.map((H) => ({ ...H }));
1077
1077
  V.some((H) => H.rank == null) && V.forEach((H, he) => H.rank = he + 1);
1078
1078
  const X = V.findIndex((H) => H.id === E);
1079
1079
  if (X === -1) return U;
1080
1080
  const z = V[X].rank;
1081
- return S < z ? V.forEach((H) => {
1082
- H.id !== E && H.rank >= S && H.rank < z && (H.rank = H.rank + 1);
1083
- }) : S > z && V.forEach((H) => {
1084
- H.id !== E && H.rank > z && H.rank <= S && (H.rank = H.rank - 1);
1085
- }), V[X].rank = S, V.sort((H, he) => H.rank - he.rank), Y(), V;
1081
+ return P < z ? V.forEach((H) => {
1082
+ H.id !== E && H.rank >= P && H.rank < z && (H.rank = H.rank + 1);
1083
+ }) : P > z && V.forEach((H) => {
1084
+ H.id !== E && H.rank > z && H.rank <= P && (H.rank = H.rank - 1);
1085
+ }), V[X].rank = P, V.sort((H, he) => H.rank - he.rank), Y(), V;
1086
1086
  });
1087
- }, l = (E, D) => {
1087
+ }, l = (E, S) => {
1088
1088
  for (let U = 0; U < k.current.length; U++) {
1089
- const S = k.current[U];
1090
- if (!S || S === c.current) continue;
1091
- const V = S.getBoundingClientRect();
1092
- if (E >= V.left && E <= V.right && D >= V.top && D <= V.bottom) return { element: S, index: U };
1089
+ const P = k.current[U];
1090
+ if (!P || P === c.current) continue;
1091
+ const V = P.getBoundingClientRect();
1092
+ if (E >= V.left && E <= V.right && S >= V.top && S <= V.bottom) return { element: P, index: U };
1093
1093
  }
1094
1094
  return null;
1095
- }, p = (E) => (D) => {
1095
+ }, p = (E) => (S) => {
1096
1096
  if (!m) return;
1097
- D.preventDefault(), D.stopPropagation(), h.current = !0, a.current = E;
1098
- const U = D.touches[0];
1097
+ S.preventDefault(), S.stopPropagation(), h.current = !0, a.current = E;
1098
+ const U = S.touches[0];
1099
1099
  v.current = U.clientY, y.current = U.clientY;
1100
- const S = D.currentTarget.closest(".ul-card-rank__option");
1101
- S && (c.current = S, S.classList.add("is-dragging"));
1100
+ const P = S.currentTarget.closest(".ul-card-rank__option");
1101
+ P && (c.current = P, P.classList.add("is-dragging"));
1102
1102
  }, x = (E) => {
1103
1103
  if (!m || !h.current || a.current === null) return;
1104
1104
  E.preventDefault(), E.stopPropagation();
1105
- const D = E.touches[0];
1106
- y.current = D.clientY;
1105
+ const S = E.touches[0];
1106
+ y.current = S.clientY;
1107
1107
  const U = y.current - v.current;
1108
1108
  c.current && (c.current.style.transform = `translateY(${U}px)`, c.current.style.zIndex = "1000"), k.current.forEach((V) => {
1109
1109
  V && V !== c.current && V.classList.remove("is-drop-target");
1110
1110
  });
1111
- const S = l(D.clientX, D.clientY);
1112
- S && S.element.classList.add("is-drop-target");
1113
- }, P = (E) => {
1111
+ const P = l(S.clientX, S.clientY);
1112
+ P && P.element.classList.add("is-drop-target");
1113
+ }, D = (E) => {
1114
1114
  if (!m || !h.current || a.current === null) return;
1115
1115
  E.preventDefault(), E.stopPropagation();
1116
- const D = E.changedTouches[0], U = l(D.clientX, D.clientY);
1117
- c.current && (c.current.style.transform = "", c.current.style.zIndex = "", c.current.classList.remove("is-dragging")), k.current.forEach((S) => {
1118
- S && S.classList.remove("is-drop-target");
1116
+ const S = E.changedTouches[0], U = l(S.clientX, S.clientY);
1117
+ c.current && (c.current.style.transform = "", c.current.style.zIndex = "", c.current.classList.remove("is-dragging")), k.current.forEach((P) => {
1118
+ P && P.classList.remove("is-drop-target");
1119
1119
  }), U && U.index !== a.current && j(a.current, U.index), a.current = null, c.current = null, h.current = !1;
1120
- }, j = (E, D) => {
1120
+ }, j = (E, S) => {
1121
1121
  _((U) => {
1122
- const S = U.map((X) => ({ ...X })), [V] = S.splice(E, 1);
1123
- return S.splice(D, 0, V), S.forEach((X, z) => {
1122
+ const P = U.map((X) => ({ ...X })), [V] = P.splice(E, 1);
1123
+ return P.splice(S, 0, V), P.forEach((X, z) => {
1124
1124
  X.rank = z + 1;
1125
- }), Y(), S;
1125
+ }), Y(), P;
1126
1126
  });
1127
1127
  }, B = (E) => {
1128
- const D = {};
1129
- E.reduce((U, S) => (U[S.id] = S.rank, U), D), t({ value: D, questionId: i, type: s }, !0);
1128
+ const S = {};
1129
+ E.reduce((U, P) => (U[P.id] = P.rank, U), S), t({ value: S, questionId: i, type: s }, !0);
1130
1130
  }, Y = () => {
1131
1131
  g(!1);
1132
1132
  }, { left: L, right: R } = o, F = u.length, Z = (E) => {
@@ -1138,17 +1138,17 @@ const ce = async ({ event: n, apiBase: o, headers: t, visitorId: r, envId: i, me
1138
1138
  };
1139
1139
  return e("form", { className: O(n, "ul-card-rank", "fade-in-transition"), onSubmit: (E) => {
1140
1140
  E.preventDefault(), B(f), d && d();
1141
- }, children: e(ie, { properties: r, children: e(Ee, A ? { children: [e(de, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", L] }) }), e("ol", { className: "ul-card-rank__list", children: f.map(({ id: E, label: D, rank: U }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${D}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (S) => w(E, S.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), q.map((S) => e("option", { className: "ul-card-rank__select-option", value: S, children: S }, `${S}-${i}`))] }), e("span", { children: D })] }, E)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [F, " - ", R] }) })] }) }), e(le, { children: e("div", { className: "ul-card__button-wrapper", children: e(oe, { disabled: C, children: re(r) }) }) })] } : { children: [e(de, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", L] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: A ? void 0 : (E) => {
1141
+ }, children: e(ie, { properties: r, children: e(Ee, A ? { children: [e(de, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", L] }) }), e("ol", { className: "ul-card-rank__list", children: f.map(({ id: E, label: S, rank: U }) => e("li", { className: "ul-card-rank__option", children: [e("select", { "aria-label": `Rank for ${S}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (P) => w(E, P.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), q.map((P) => e("option", { className: "ul-card-rank__select-option", value: P, children: P }, `${P}-${i}`))] }), e("span", { children: S })] }, E)) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [F, " - ", R] }) })] }) }), e(le, { children: e("div", { className: "ul-card__button-wrapper", children: e(oe, { disabled: C, children: re(r) }) }) })] } : { children: [e(de, { children: e("div", { className: "ul-card--rank__question-inner-container", children: [e("div", { className: "ul-card-rank__labels", children: e("span", { children: ["1 - ", L] }) }), e("ol", { className: "ul-card-rank__list", onDragOver: A ? void 0 : (E) => {
1142
1142
  E.preventDefault(), E.dataTransfer && (E.dataTransfer.dropEffect = "move");
1143
- }, children: f.map(({ id: E, label: D, rank: U }, S) => {
1144
- return e("li", { className: "ul-card-rank__option", draggable: !!b || void 0, onDragEnd: b ? me : void 0, onDragEnter: b ? Z : void 0, onDragLeave: b ? J : void 0, onDragStart: b ? (X = S, (z) => {
1143
+ }, children: f.map(({ id: E, label: S, rank: U }, P) => {
1144
+ return e("li", { className: "ul-card-rank__option", draggable: !!b || void 0, onDragEnd: b ? me : void 0, onDragEnter: b ? Z : void 0, onDragLeave: b ? J : void 0, onDragStart: b ? (X = P, (z) => {
1145
1145
  a.current = X, z.dataTransfer && (z.dataTransfer.effectAllowed = "move", z.dataTransfer.setData("text/plain", String(X)), z.currentTarget.classList.add("is-dragging"));
1146
- }) : void 0, onDrop: b ? (V = S, (z) => {
1146
+ }) : void 0, onDrop: b ? (V = P, (z) => {
1147
1147
  var he, Fe;
1148
1148
  z.preventDefault(), z.currentTarget.classList.remove("is-drop-target");
1149
1149
  const H = a.current;
1150
1150
  a.current = null, (Fe = (he = z.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : he.querySelector(".is-dragging")) == null || Fe.classList.remove("is-dragging"), H != null && H !== V && j(H, V);
1151
- }) : void 0, ref: (z) => k.current[S] = z, children: [e("select", { "aria-label": `Rank for ${D}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (z) => w(E, z.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), q.map((z) => e("option", { className: "ul-card-rank__select-option", value: z, children: z }, z))] }), e("span", { children: D }), !A && e("button", { "aria-label": `Drag ${D} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: m ? P : void 0, onTouchMove: m ? x : void 0, onTouchStart: m ? p(S) : 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" }) }) })] }, E);
1151
+ }) : void 0, ref: (z) => k.current[P] = z, children: [e("select", { "aria-label": `Rank for ${S}`, className: O("ul-card-rank__select", U == null && "ul-card-rank__select--placeholder"), name: `rank[${E}]`, onChange: (z) => w(E, z.currentTarget.value), value: U ?? "", children: [U == null && e("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), q.map((z) => e("option", { className: "ul-card-rank__select-option", value: z, children: z }, z))] }), e("span", { children: S }), !A && e("button", { "aria-label": `Drag ${S} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: m ? D : void 0, onTouchMove: m ? x : void 0, onTouchStart: m ? p(P) : 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" }) }) })] }, E);
1152
1152
  var V, X;
1153
1153
  }) }), e("div", { className: "ul-card-rank__labels", children: e("span", { children: [F, " - ", R] }) })] }) }), e(le, { children: e("div", { className: "ul-card__button-wrapper", children: e(oe, { disabled: C, children: re(r) }) }) })] }) }) }, i);
1154
1154
  }, Re = 1, pn = 2, vn = 3, we = (n) => n.type === "av_permission", Ke = (n) => n.type === "screen_permission", mn = (n, o) => n === void 0 ? Re : n ? ((t, r) => !(we(r) ? r.permissionDescriptors : []).includes("camera") || t.getVideoTracks().length > 0)(n, o) ? vn : Re : pn, Je = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
@@ -1258,13 +1258,13 @@ const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O
1258
1258
  c || (c = function({ pages: g, userId: f, responseGroupUid: _, surveyId: q, questionId: M, next: T }) {
1259
1259
  const { updatePage: $ } = te.getState(), { eventEmitFn: A, recorderEventEmitter: m } = G.getState(), b = { questionId: M, surveyId: q, visitorId: f, responseGroupUid: _ };
1260
1260
  let w = 0;
1261
- m.emit("recorded.task.permission.screen"), A("recorded.task.permission.screen"), m.emit("permission.status", { "permission.status.callback": (p, x, P, j) => {
1261
+ m.emit("recorded.task.permission.screen"), A("recorded.task.permission.screen"), m.emit("permission.status", { "permission.status.callback": (p, x, D, j) => {
1262
1262
  const B = g[w], { type: Y } = B, L = ["screen"];
1263
1263
  if (we(B)) {
1264
1264
  const { permissionDescriptors: R } = B, F = R == null ? void 0 : R.includes("microphone"), Z = R == null ? void 0 : R.includes("camera");
1265
1265
  F && L.push("audio"), Z && L.push("video"), (p != null && p.active && !Z || p != null && p.active && x) && w++;
1266
1266
  }
1267
- Ke(g[w]) && P && (w++, m.emit("begin.recording", { "recording.media.types": L, "start.recording.callback": (R) => $({ mediaRecordingUids: R }) })), $({ currentPage: g[w], avStream: p, screenPermissionRequested: P, nextQuestion: T, type: Y, passthroughData: b, recordingMediaTypes: L, captureStream: j });
1267
+ Ke(g[w]) && D && (w++, m.emit("begin.recording", { "recording.media.types": L, "start.recording.callback": (R) => $({ mediaRecordingUids: R }) })), $({ currentPage: g[w], avStream: p, screenPermissionRequested: D, nextQuestion: T, type: Y, passthroughData: b, recordingMediaTypes: L, captureStream: j });
1268
1268
  } });
1269
1269
  const l = g[w];
1270
1270
  return l.type === "av_permission" && Ne({ currentPage: l, pages: g }), l;
@@ -1319,7 +1319,7 @@ const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O
1319
1319
  })(s), $(en);
1320
1320
  } }) }) }), e("div", { style: { display: T === en ? "block" : "none" }, children: e("div", { id: "ul-recorder-player-container", ref: (b) => {
1321
1321
  if (b && b.children.length === 0) {
1322
- const w = ((l, p = {}, x = "https://api.userleap.com", P, j, B, Y = !1, L = document) => {
1322
+ const w = ((l, p = {}, x = "https://api.userleap.com", D, j, B, Y = !1, L = document) => {
1323
1323
  I.document = L;
1324
1324
  const R = l + Qe, F = cn(R);
1325
1325
  return I.document.addEventListener("securitypolicyviolation", (Z) => {
@@ -1327,7 +1327,7 @@ const hn = "ul-permission-graphics-container", gn = "ul-permission-body", bn = O
1327
1327
  }), sn(rn.concat(Nn), () => {
1328
1328
  Le(R, F), I.document.getElementById($e(R)).remove();
1329
1329
  try {
1330
- Bn(F, R, p, x, P, j, B, Y);
1330
+ Bn(F, R, p, x, D, j, B, Y);
1331
1331
  } catch (Z) {
1332
1332
  return void ae(new Error(`Error when creating video recorder player object ${Z}`), "recorderDeviceError", x, B, p.visitorId, p.envId);
1333
1333
  }
@@ -1434,7 +1434,7 @@ const bt = () => {
1434
1434
  const [l, p] = Q(/* @__PURE__ */ new Map());
1435
1435
  return ue(() => {
1436
1436
  if (m.length > 0 && b < m.length) {
1437
- const x = m[b], P = `${x.name}`, j = (L) => L.type === "aidynamicfollowup", B = (L) => {
1437
+ const x = m[b], D = `${x.name}`, j = (L) => L.type === "aidynamicfollowup", B = (L) => {
1438
1438
  var R;
1439
1439
  if (b > 0) {
1440
1440
  const F = m[b - 1];
@@ -1445,15 +1445,15 @@ const bt = () => {
1445
1445
  }
1446
1446
  return L;
1447
1447
  };
1448
- if (b <= (w ?? 0) || yn(x)) return p((L) => B(new Map(L).set(P, !1)));
1448
+ if (b <= (w ?? 0) || yn(x)) return p((L) => B(new Map(L).set(D, !1)));
1449
1449
  p((L) => {
1450
1450
  const R = !j(x) || !!x.props.loading;
1451
- return B(new Map(L).set(P, R));
1451
+ return B(new Map(L).set(D, R));
1452
1452
  });
1453
1453
  const Y = setTimeout(() => {
1454
1454
  p((L) => {
1455
1455
  const R = !!j(x) && !!x.props.loading;
1456
- return B(new Map(L).set(P, R));
1456
+ return B(new Map(L).set(D, R));
1457
1457
  });
1458
1458
  }, 1e3);
1459
1459
  return () => clearTimeout(Y);
@@ -1466,9 +1466,9 @@ const bt = () => {
1466
1466
  }, [m]), ue(() => {
1467
1467
  const p = b ?? 0;
1468
1468
  p > 0 && l((x) => {
1469
- const P = new Set(x);
1470
- for (let j = 0; j <= p; j++) P.add(j);
1471
- return P;
1469
+ const D = new Set(x);
1470
+ for (let j = 0; j <= p; j++) D.add(j);
1471
+ return D;
1472
1472
  });
1473
1473
  }, [b]), w;
1474
1474
  })(s, c), M = fe(() => ({ ...t, ...ze(n.map((m, b) => {
@@ -1490,7 +1490,7 @@ const bt = () => {
1490
1490
  i(l, m);
1491
1491
  const p = { ...m, questionText: In(w) };
1492
1492
  if (w.childId && (p == null ? void 0 : p.value) != null) {
1493
- const x = ze([w].map((P) => ({ ...P, value: (p == null ? void 0 : p.value) ?? null, secondaryValue: (p == null ? void 0 : p.secondaryValue) ?? null })));
1493
+ const x = ze([w].map((D) => ({ ...D, value: (p == null ? void 0 : p.value) ?? null, secondaryValue: (p == null ? void 0 : p.secondaryValue) ?? null })));
1494
1494
  k({ parentQuestionId: w.name, parentResponseConfig: x });
1495
1495
  }
1496
1496
  o([p]);