@sprig-technologies/sprig-bundled 2.47.0 → 2.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{conversational-ui-CXl_8HB_.js → conversational-ui-CoOUaxMV.js} +74 -75
- package/dist/{conversational-ui-CEmVz2Vg.cjs → conversational-ui-D4JFc07q.cjs} +2 -2
- package/dist/{conversational-v2-styles-D5xNLWoE.cjs → conversational-v2-styles-BCsmmSE3.cjs} +1 -1
- package/dist/{conversational-v2-styles-GH9tfuXI.js → conversational-v2-styles-BK9YvF7Q.js} +1 -1
- package/dist/getAttributedUrl-Cy6ZmssZ.js +197 -0
- package/dist/getAttributedUrl-GFl2RKI_.cjs +12 -0
- package/dist/index-Cg785YpL.js +4 -0
- package/dist/index-DDZBH-vP.js +768 -0
- package/dist/index-DYrVxSAM.cjs +1 -0
- package/dist/index-D_IOfB4u.cjs +1 -0
- package/dist/index-Dm2nk1lh.js +4 -0
- package/dist/{index-BNI3IK7K.js → index-Q_m-uWR7.js} +4 -4
- package/dist/{index-BBiYWZkL.cjs → index-pfR5IQvc.cjs} +2 -2
- package/dist/index-rJoqOgIc.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/view-bHnS65wz.js +1834 -0
- package/dist/view-umqtk1IA.cjs +1 -0
- package/package.json +1 -1
- package/dist/getAttributedUrl-D-vLs0_x.js +0 -194
- package/dist/getAttributedUrl-DNR4xoBk.cjs +0 -12
- package/dist/index-B-aCET7A.js +0 -737
- package/dist/index-DD639GNJ.cjs +0 -1
- package/dist/view-B4aVfDPi.cjs +0 -1
- package/dist/view-eRBVyC0l.js +0 -1831
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as F, a as n, h as Q, e as ne, z as fe, c as H, b as J, d as ge, g as He, p as de, F as ke, _ as le, T as Ce, A as wn, M as Ee, i as En, P as jn, o as In, r as Tn, t as _n, S as Dn, D as Me, B as rn, y as Sn, x as Pn } from "./view-
|
|
2
|
-
import { v as Ln, E as De, j as on, A as $e, k as Nn, f as sn } from "./index-
|
|
3
|
-
import { B as se, M as ae, b as ue, O as Fe, Q as pe, S as Rn, L as Mn, u as Bn, a as we, H as Ve, g as qn, c as Un, D as An } from "./getAttributedUrl-
|
|
4
|
-
const he = "https://cdn.sprig.com", S = { document: void 0, videojs: void 0 }, ze = (e) => e + "-loading-spiner",
|
|
1
|
+
import { u as F, a as n, h as Q, e as ne, z as fe, c as H, b as J, d as ge, g as He, p as de, F as ke, _ as le, T as Ce, A as wn, M as Ee, i as En, P as jn, o as In, r as Tn, t as _n, S as Dn, D as Me, B as rn, y as Sn, x as Pn } from "./view-bHnS65wz.js";
|
|
2
|
+
import { v as Ln, E as De, j as on, A as $e, k as Nn, f as sn } from "./index-Q_m-uWR7.js";
|
|
3
|
+
import { B as se, M as ae, b as ue, O as Fe, Q as pe, S as Rn, L as Mn, u as Bn, a as we, H as Ve, g as qn, c as Un, D as An } from "./getAttributedUrl-Cy6ZmssZ.js";
|
|
4
|
+
const he = "https://cdn.sprig.com", S = { document: void 0, videojs: void 0 }, ze = (e) => e + "-loading-spiner", W = "hidden", Ye = ".m3u8", Se = "questionId", Pe = "ul-video-recorder-camera-off-button", Le = "ul-recording-in-session", On = [{ type: "link", content: `${he}/dependencies/videojs-record-4.5.0.min.css` }, { type: "script", content: `${he}/dependencies/RecordRTC-5.6.2.js` }, { type: "script", content: `${he}/dependencies/adapter.8.0.0.min.js` }, { type: "script", content: `${he}/dependencies/videojs-record-4.5.0.min.js` }, { type: "script", content: `${he}/userleap-web-upchunk-v2.2.2.js` }], an = [{ type: "link", content: `${he}/dependencies/video-js-7.18.0.min.css` }, { type: "script", content: `${he}/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;
|
|
7
7
|
}
|
|
@@ -684,8 +684,8 @@ const ve = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
684
684
|
console.log(t + " failed to load");
|
|
685
685
|
});
|
|
686
686
|
}, Je = (e, o, t) => {
|
|
687
|
-
if (o === "start" && (e.style.visibility = "visible"), o === "none") e.style.visibility =
|
|
688
|
-
else if (o === "success") e.style.visibility =
|
|
687
|
+
if (o === "start" && (e.style.visibility = "visible"), o === "none") e.style.visibility = W;
|
|
688
|
+
else if (o === "success") e.style.visibility = W, e.innerHTML = "Upload succeeded!";
|
|
689
689
|
else {
|
|
690
690
|
const r = Math.round(parseFloat(t));
|
|
691
691
|
e.innerHTML = `Uploading <span class="ul-upload-progress-label__time">${r}%</span>`, e.style.background = `linear-gradient(to right, #E0E0EB 0%, #E0E0EB ${r}%, #FCFCFD ${r}%, #FCFCFD 100%)`;
|
|
@@ -736,14 +736,14 @@ const ve = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
736
736
|
h ? (a.children()[0].classList.add("vjs-hidden"), T.removeClass(v), T.addClass(u), I.innerHTML = ee.TurnOnCamera, a.audioPlayerPlaceholder.removeClass("vjs-hidden"), P == null || P.getTracks().forEach((w) => {
|
|
737
737
|
w.stop();
|
|
738
738
|
}), window.navigator.mediaDevices.getUserMedia({ video: !0, audio: !0 }).then((w) => {
|
|
739
|
-
P = w, w.getVideoTracks().forEach((
|
|
740
|
-
|
|
739
|
+
P = w, w.getVideoTracks().forEach((R) => {
|
|
740
|
+
R.enabled = !1;
|
|
741
741
|
}), a.record().onDeviceReady(w);
|
|
742
742
|
}).catch(a.record().onDeviceError.bind(a.record()))) : (P == null || P.getVideoTracks().forEach((w) => {
|
|
743
743
|
w.enabled = !0;
|
|
744
744
|
}), a.children()[0].classList.remove("vjs-hidden"), a.record().getDevice(), T.removeClass(u), T.addClass(v), I.innerHTML = ee.TurnOffCamera, a.audioPlayerPlaceholder.addClass("vjs-hidden"));
|
|
745
745
|
}, C = new (S.videojs.getComponent("Button"))(a, { clickHandler: () => {
|
|
746
|
-
C.hasClass(
|
|
746
|
+
C.hasClass(W) || (ve({ event: "Video Delete Button Clicked", apiBase: r, headers: l, visitorId: m, envId: f, metadata: { questionId: y, responseGroupUid: g, surveyId: p } }), b(a.cameraOff), i(B.DELETE, {}), T.removeClass(W), C.addClass(W));
|
|
747
747
|
} });
|
|
748
748
|
C.addClass("ul-video-recorder-delete-button"), C.el_.appendChild(je(ee.DeleteButton, "ul-delete-button"));
|
|
749
749
|
const D = S.document.getElementById(o), E = () => {
|
|
@@ -751,17 +751,17 @@ const ve = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
751
751
|
};
|
|
752
752
|
E();
|
|
753
753
|
const T = new (S.videojs.getComponent("Button"))(a, { clickHandler: () => {
|
|
754
|
-
a.record().isRecording() || (a.cameraOff = !a.cameraOff, ve({ event: "Video Camera Button Clicked", apiBase: r, headers: l, visitorId: t.visitorId, envId: t.envId, metadata: { questionId: y, responseGroupUid: g, surveyId: p, cameraOff: a.cameraOff } }), b(a.cameraOff), !C.hasClass(
|
|
754
|
+
a.record().isRecording() || (a.cameraOff = !a.cameraOff, ve({ event: "Video Camera Button Clicked", apiBase: r, headers: l, visitorId: t.visitorId, envId: t.envId, metadata: { questionId: y, responseGroupUid: g, surveyId: p, cameraOff: a.cameraOff } }), b(a.cameraOff), !C.hasClass(W) && C.addClass(W), i(B.DELETE, {}), E());
|
|
755
755
|
} });
|
|
756
756
|
T.addClass(Pe), T.el_.appendChild(je(ee.TurnOffCamera, "ul-camera-button"));
|
|
757
757
|
const j = new (S.videojs.getComponent("Button"))(a, { clickHandler: () => {
|
|
758
758
|
const h = S.document.getElementById("ul-recorder-toggle");
|
|
759
|
-
if (a.record().isRecording()) a.record().stop(), h && (h.innerHTML = ee.RecordButton), j.removeClass(Le), C.removeClass(
|
|
759
|
+
if (a.record().isRecording()) a.record().stop(), h && (h.innerHTML = ee.RecordButton), j.removeClass(Le), C.removeClass(W);
|
|
760
760
|
else {
|
|
761
761
|
const v = S.document.getElementById("ul-recording-countdown-screen");
|
|
762
|
-
if (v) v.remove(), h && (h.innerHTML = ee.RecordButton), b(a.cameraOff), i(B.DELETE, {}), T.removeClass(
|
|
762
|
+
if (v) v.remove(), h && (h.innerHTML = ee.RecordButton), b(a.cameraOff), i(B.DELETE, {}), T.removeClass(W), C.addClass(W), j.removeClass(Le), d.show();
|
|
763
763
|
else {
|
|
764
|
-
j.addClass(Le), d.hide(), T.addClass(
|
|
764
|
+
j.addClass(Le), d.hide(), T.addClass(W), C.addClass(W), h && (h.innerHTML = ee.StopButton);
|
|
765
765
|
const u = S.document.createElement("div");
|
|
766
766
|
u.id = "ul-recording-countdown-screen", D.insertBefore(u, D.children[1]), u.style.height = `${D.offsetHeight}px`, pn(a, 3);
|
|
767
767
|
}
|
|
@@ -773,44 +773,44 @@ const ve = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
773
773
|
const V = cn(a, [C, T, "PlayToggle", j, "FullscreenToggle"]), d = V.children().find((h) => h.name_ === "FullscreenToggle");
|
|
774
774
|
d.hasClass("vjs-disabled") && d.hide();
|
|
775
775
|
const k = V.children().find((h) => h.name_ === "PlayToggle");
|
|
776
|
-
k.hide(), C.addClass(
|
|
777
|
-
j.hide(), k.show(), d.show(), C.removeClass(
|
|
776
|
+
k.hide(), C.addClass(W), un(a, V, s, !1, c), a.on("stopRecord", () => {
|
|
777
|
+
j.hide(), k.show(), d.show(), C.removeClass(W);
|
|
778
778
|
}), a.on("deviceReady", () => {
|
|
779
|
-
j.show(), k.hide(), C.addClass(
|
|
779
|
+
j.show(), k.hide(), C.addClass(W);
|
|
780
780
|
}), ((h, v, u, I, w) => {
|
|
781
|
-
const { surveyId:
|
|
781
|
+
const { surveyId: R, responseGroupUid: N, visitorId: L, envId: U } = h.payload;
|
|
782
782
|
h.on("deviceError", function() {
|
|
783
|
-
console.warn("device error: ", h.deviceErrorCode), h.deviceErrorCode.message === "Permission denied" ? (h.deviceButton.addClass("permission-denied"), u && u(B.ERROR, { type: B.PERMISSION_DENIED }), ve({ event: "Video Permission Denied", apiBase: v, headers: w, visitorId: L, envId: U, metadata: { questionId: Ne(h, Se), responseGroupUid:
|
|
783
|
+
console.warn("device error: ", h.deviceErrorCode), h.deviceErrorCode.message === "Permission denied" ? (h.deviceButton.addClass("permission-denied"), u && u(B.ERROR, { type: B.PERMISSION_DENIED }), ve({ event: "Video Permission Denied", apiBase: v, headers: w, visitorId: L, envId: U, metadata: { questionId: Ne(h, Se), responseGroupUid: N, surveyId: R } })) : (u && u(B.ERROR, { type: B.OTHER }), ce(new Error(h.deviceErrorCode.message), "recorderDeviceError", v, w, L, U));
|
|
784
784
|
}), h.on("error", function(Z, Y) {
|
|
785
785
|
ce(Y || h.error(), "recorderError", v, w, L, U);
|
|
786
786
|
}), h.on("startRecord", function(Z, Y) {
|
|
787
|
-
I(h.uploadProgressLabel, "none"), ve({ event: "Video Record Start", apiBase: v, headers: w, visitorId: L, envId: U, metadata: { questionId: Ne(h, Se), responseGroupUid:
|
|
787
|
+
I(h.uploadProgressLabel, "none"), ve({ event: "Video Record Start", apiBase: v, headers: w, visitorId: L, envId: U, metadata: { questionId: Ne(h, Se), responseGroupUid: N, surveyId: R } });
|
|
788
788
|
}), h.on("finishRecord", async function() {
|
|
789
789
|
I(h.uploadProgressLabel, "start", 0);
|
|
790
790
|
const Z = Ne(h, Se);
|
|
791
|
-
if (!
|
|
791
|
+
if (!R) {
|
|
792
792
|
const x = "internal error: missing fields in payload";
|
|
793
793
|
return u && u(B.ERROR, { type: B.OTHER }), ce(new Error(x), "finishRecord", v, w, L, U), null;
|
|
794
794
|
}
|
|
795
795
|
h.record().stopDevice();
|
|
796
|
-
const Y = h.cameraOff ? B.MEDIA_TYPE_AUDIO : B.MEDIA_TYPE_VIDEO,
|
|
797
|
-
ve({ event: "Video Record Finish", apiBase: v, headers: w, visitorId: L, envId: U, metadata: { mediaRecordingUid:
|
|
798
|
-
const te = { surveyId:
|
|
799
|
-
Z && (te.questionId = Z),
|
|
796
|
+
const Y = h.cameraOff ? B.MEDIA_TYPE_AUDIO : B.MEDIA_TYPE_VIDEO, K = Ln();
|
|
797
|
+
ve({ event: "Video Record Finish", apiBase: v, headers: w, visitorId: L, envId: U, metadata: { mediaRecordingUid: K, questionId: Z, responseGroupUid: N, surveyId: R, mediaType: Y } });
|
|
798
|
+
const te = { surveyId: R, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), mediaType: Y, mediaRecordingUid: K };
|
|
799
|
+
Z && (te.questionId = Z), N && (te.responseGroupUid = N), L && (te.visitorId = L);
|
|
800
800
|
const re = await (async () => {
|
|
801
801
|
const x = await fetch(`${v}/2/environments/integrations/upload`, { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify(te) });
|
|
802
802
|
if (x.ok) {
|
|
803
803
|
const A = await x.json();
|
|
804
|
-
return u && u(B.UPLOAD_STARTED, { [B.UPLOAD_ID]: A.upload.id, [B.MEDIA_TYPE]: Y, [B.MEDIA_RECORDING_UID]:
|
|
804
|
+
return u && u(B.UPLOAD_STARTED, { [B.UPLOAD_ID]: A.upload.id, [B.MEDIA_TYPE]: Y, [B.MEDIA_RECORDING_UID]: K }), A.upload.url;
|
|
805
805
|
}
|
|
806
806
|
return u && u(B.ERROR, { type: B.OTHER, response: x }), ce(new Error("failed to get upload response with url"), "finishRecord", v, w, L, U), null;
|
|
807
807
|
})();
|
|
808
|
-
re && (oe = S.document.defaultView.UpChunk.createUpload({ endpoint: re, file: new S.document.defaultView.File([h.recordedData], `recording ${Y} ${Date.now()}`), chunkSize: 5120 }), oe.startTime = Date.now(), ve({ event: "Video Upload Start", apiBase: v, headers: w, visitorId: L, envId: U, metadata: { mediaRecordingUid:
|
|
809
|
-
I(h.uploadProgressLabel, "none"), u && u(B.UPLOAD_FINISHED, { [B.MEDIA_RECORDING_UID]:
|
|
808
|
+
re && (oe = S.document.defaultView.UpChunk.createUpload({ endpoint: re, file: new S.document.defaultView.File([h.recordedData], `recording ${Y} ${Date.now()}`), chunkSize: 5120 }), oe.startTime = Date.now(), ve({ event: "Video Upload Start", apiBase: v, headers: w, visitorId: L, envId: U, metadata: { mediaRecordingUid: K, questionId: Z, responseGroupUid: N, surveyId: R, mediaType: Y, url: re } }), oe.on("error", (x) => {
|
|
809
|
+
I(h.uploadProgressLabel, "none"), u && u(B.UPLOAD_FINISHED, { [B.MEDIA_RECORDING_UID]: K }), ce(x, "finishRecord", v, w, L, U);
|
|
810
810
|
}), oe.on("progress", (x) => {
|
|
811
|
-
u && u(B.UPLOAD_PROGRESS, { [B.MEDIA_RECORDING_UID]:
|
|
811
|
+
u && u(B.UPLOAD_PROGRESS, { [B.MEDIA_RECORDING_UID]: K, [B.UPLOAD_PROGRESS_PCT]: x.detail }), I(h.uploadProgressLabel, "progress", x.detail);
|
|
812
812
|
}), oe.on("success", () => {
|
|
813
|
-
I(h.uploadProgressLabel, "success"), u && u(B.UPLOAD_FINISHED, { [B.MEDIA_RECORDING_UID]:
|
|
813
|
+
I(h.uploadProgressLabel, "success"), u && u(B.UPLOAD_FINISHED, { [B.MEDIA_RECORDING_UID]: K }), ve({ event: "Video Upload Success", apiBase: v, headers: w, visitorId: L, envId: U, metadata: { mediaRecordingUid: K, questionId: Z, responseGroupUid: N, surveyId: R, mediaType: Y, url: re, elapsedMs: oe.startTime && Date.now() - oe.startTime } });
|
|
814
814
|
}));
|
|
815
815
|
});
|
|
816
816
|
})(a, r, i, Je, l);
|
|
@@ -862,7 +862,7 @@ const ve = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
862
862
|
C.addClass(`ul${We}`);
|
|
863
863
|
const T = new (S.videojs.getComponent("Component"))(C);
|
|
864
864
|
D && C.src(D), C.addChild(T), E && E(C);
|
|
865
|
-
})(f, l, c), l || f.addClass(
|
|
865
|
+
})(f, l, c), l || f.addClass(W);
|
|
866
866
|
const P = cn(m, ["PlaybackRateMenuButton", "PlayToggle", "FullscreenToggle"]), b = P.children().find((C) => C.name_ === "FullscreenToggle");
|
|
867
867
|
b.hasClass("vjs-disabled") && b.hide(), un(m, P, o, t, r, f);
|
|
868
868
|
} catch (g) {
|
|
@@ -1004,21 +1004,21 @@ const ve = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1004
1004
|
return (I = u.optionProperties) == null ? void 0 : I.noneOfTheAbove;
|
|
1005
1005
|
}), E = (u) => Object.entries(u).some(([I, w]) => {
|
|
1006
1006
|
var L;
|
|
1007
|
-
const
|
|
1008
|
-
return ((L =
|
|
1007
|
+
const R = t.find((U) => `${U.id}` === I), N = w.userText === void 0 || w.userText.trim() === "";
|
|
1008
|
+
return ((L = R == null ? void 0 : R.optionProperties) == null ? void 0 : L.allowsTextEntry) && N && w.isSelected;
|
|
1009
1009
|
}), T = (u) => Object.values(u).filter((I) => I.isSelected).length, j = r.minSelect && r.minSelect > 0 && r.maxSelectMode === Ee.Range && T(f) < r.minSelect && (C || T(f) > 0), q = (u) => E(u) || C && !T(u) || !((I) => {
|
|
1010
|
-
const { minSelect: w = 0, maxSelect:
|
|
1011
|
-
switch (
|
|
1010
|
+
const { minSelect: w = 0, maxSelect: R = 1 / 0, maxSelectMode: N } = r, L = T(I);
|
|
1011
|
+
switch (N) {
|
|
1012
1012
|
case Ee.Maximum:
|
|
1013
|
-
return L <=
|
|
1013
|
+
return L <= R;
|
|
1014
1014
|
case Ee.Range:
|
|
1015
1015
|
return L === 0 || L >= w;
|
|
1016
1016
|
default:
|
|
1017
1017
|
return !0;
|
|
1018
1018
|
}
|
|
1019
1019
|
})(u), V = Object.entries(f).some(([u, I]) => {
|
|
1020
|
-
var w,
|
|
1021
|
-
return I.isSelected && ((
|
|
1020
|
+
var w, R;
|
|
1021
|
+
return I.isSelected && ((R = (w = t.find((N) => `${N.id}` === u)) == null ? void 0 : w.optionProperties) == null ? void 0 : R.allowsTextEntry);
|
|
1022
1022
|
}), d = l && (!b || V), k = (u) => {
|
|
1023
1023
|
v(u.id, u.selected, u.userText, u.noneOfTheAbove);
|
|
1024
1024
|
}, _ = (u) => {
|
|
@@ -1026,21 +1026,20 @@ const ve = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1026
1026
|
return (r == null ? void 0 : r.maxSelectMode) !== Ee.Unlimited && T(f) === (r == null ? void 0 : r.maxSelect) && !((I = f[u]) != null && I.isSelected);
|
|
1027
1027
|
}, h = () => {
|
|
1028
1028
|
o(f, !0), c && c();
|
|
1029
|
-
}, v = (u, I, w,
|
|
1030
|
-
const
|
|
1031
|
-
if ((b ||
|
|
1032
|
-
else D && !
|
|
1033
|
-
|
|
1029
|
+
}, v = (u, I, w, R) => {
|
|
1030
|
+
const N = Object.assign({}, f);
|
|
1031
|
+
if ((b || R) && I) for (const L of Object.values(N)) L.isSelected = !1, delete L.userText;
|
|
1032
|
+
else D && !R && f[D.id].isSelected && (N[D.id].isSelected = !1);
|
|
1033
|
+
N[u] = { isSelected: I, userText: w }, P(N);
|
|
1034
1034
|
};
|
|
1035
1035
|
return n("form", { className: H(e, "ul-card--multiple", "fade-in-transition"), id: "text-form", onSubmit: h, children: n(ae, { properties: r, children: [n(pe, { children: [r.isDropdown ? n(Rn, { disabledOptions: t.filter((u) => _(u.id)), dropdownFooter: j ? n("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [T(f), "/", r.minSelect] }) : void 0, isMultiSelect: !b, multiselectText: r.dropdownMultiselectedText ?? "choices selected", onChange: (u) => {
|
|
1036
1036
|
const I = { ...f };
|
|
1037
1037
|
for (const w of t) u.includes(w) ? I[w.id].isSelected = !0 : I[w.id].isSelected = !1;
|
|
1038
1038
|
P(I);
|
|
1039
|
-
}, options: t, placeholderText: r.dropdownPlaceholderText ?? (b ? "Select choice" : "Select choice(s)"), value: t.filter((u) => f[u.id].isSelected) }) : n("div", { className: H(J("ul-card__choices", y)), role: b ? "radiogroup" : "group", children: [t.map(({ id: u, label: I, value: w, optionProperties:
|
|
1040
|
-
var
|
|
1041
|
-
const
|
|
1042
|
-
return n(Fe, { allowTextEntry: L, border: p, disabled: _(
|
|
1043
|
-
var Z;
|
|
1039
|
+
}, options: t, placeholderText: r.dropdownPlaceholderText ?? (b ? "Select choice" : "Select choice(s)"), value: t.filter((u) => f[u.id].isSelected) }) : n("div", { className: H(J("ul-card__choices", y)), role: b ? "radiogroup" : "group", children: [t.map(({ id: u, label: I, value: w, optionProperties: R }) => {
|
|
1040
|
+
var Z, Y;
|
|
1041
|
+
const N = `${u}`, { allowsTextEntry: L, noneOfTheAbove: U } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...R };
|
|
1042
|
+
return n(Fe, { allowTextEntry: L, border: p, disabled: _(N), error: E({ [N]: f[N] }), id: N, isRadio: b, isSelected: !!((Z = f[N]) != null && Z.isSelected), label: I, noneOfTheAbove: U, onUserInputChanged: k, promptText: (R == null ? void 0 : R.otherOptionPlaceholder) || "Please specify", text: (Y = f[u]) == null ? void 0 : Y.userText, useMobileStyling: y, value: w }, N);
|
|
1044
1043
|
}), !!j && n("div", { className: "ul-card__min-select-counter", children: [T(f), "/", r.minSelect] })] }), d && n(Mn, { handleSubmit: h, isSubmitDisabled: q(f) })] }), !a && n(ue, { children: n(me, { isDisabled: q(f), onClick: h, showCheckmark: fe(i, g), children: ne(r) }) })] }) }, i);
|
|
1045
1044
|
}, et = (e) => {
|
|
1046
1045
|
const { questionId: o, type: t, next: r, options: i } = e;
|
|
@@ -1133,20 +1132,20 @@ const ve = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1133
1132
|
const A = x.changedTouches[0], O = v(A.clientX, A.clientY);
|
|
1134
1133
|
m.current && (m.current.style.transform = "", m.current.style.zIndex = "", m.current.classList.remove("is-dragging")), P.current.forEach((M) => {
|
|
1135
1134
|
M && M.classList.remove("is-drop-target");
|
|
1136
|
-
}), O && O.index !== p.current &&
|
|
1137
|
-
},
|
|
1135
|
+
}), O && O.index !== p.current && R(p.current, O.index), p.current = null, m.current = null, f.current = !1;
|
|
1136
|
+
}, R = (x, A) => {
|
|
1138
1137
|
E((O) => {
|
|
1139
1138
|
const M = O.map((X) => ({ ...X })), [z] = M.splice(x, 1);
|
|
1140
1139
|
return M.splice(A, 0, z), M.forEach((X, G) => {
|
|
1141
1140
|
X.rank = G + 1;
|
|
1142
1141
|
}), L(), M;
|
|
1143
1142
|
});
|
|
1144
|
-
},
|
|
1143
|
+
}, N = (x) => {
|
|
1145
1144
|
const A = {};
|
|
1146
1145
|
x.reduce((O, M) => (O[M.id] = M.rank, O), A), t({ value: A, questionId: i, type: s }, !0);
|
|
1147
1146
|
}, L = () => {
|
|
1148
1147
|
C(!1);
|
|
1149
|
-
}, { left: U, right: Z } = o, Y = c.length,
|
|
1148
|
+
}, { left: U, right: Z } = o, Y = c.length, K = (x) => {
|
|
1150
1149
|
x.preventDefault(), x.currentTarget.classList.add("is-drop-target");
|
|
1151
1150
|
}, te = (x) => {
|
|
1152
1151
|
x.currentTarget.classList.remove("is-drop-target");
|
|
@@ -1154,17 +1153,17 @@ const ve = async ({ event: e, apiBase: o, headers: t, visitorId: r, envId: i, me
|
|
|
1154
1153
|
p.current = null, x.currentTarget.classList.remove("is-dragging");
|
|
1155
1154
|
};
|
|
1156
1155
|
return n("form", { className: H(e, "ul-card-rank", "fade-in-transition"), onSubmit: (x) => {
|
|
1157
|
-
x.preventDefault(),
|
|
1156
|
+
x.preventDefault(), N(D), l && l();
|
|
1158
1157
|
}, children: n(ae, { properties: r, children: n(ge, d ? { children: [n(pe, { children: n("div", { className: "ul-card--rank__question-inner-container", children: [n("div", { className: "ul-card-rank__labels", children: n("span", { children: ["1 - ", U] }) }), n("ol", { className: "ul-card-rank__list", children: D.map(({ id: x, label: A, rank: O }) => n("li", { className: "ul-card-rank__option", children: [n("select", { "aria-label": `Rank for ${A}`, className: H("ul-card-rank__select", O == null && "ul-card-rank__select--placeholder"), name: `rank[${x}]`, onChange: (M) => h(x, M.currentTarget.value), value: O ?? "", children: [O == null && n("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), T.map((M) => n("option", { className: "ul-card-rank__select-option", value: M, children: M }, `${M}-${i}`))] }), n("span", { children: A })] }, x)) }), n("div", { className: "ul-card-rank__labels", children: n("span", { children: [Y, " - ", Z] }) })] }) }), n(ue, { children: !a && n("div", { className: "ul-card__button-wrapper", children: n(se, { disabled: b, children: ne(r) }) }) })] } : { children: [n(pe, { children: n("div", { className: "ul-card--rank__question-inner-container", children: [n("div", { className: "ul-card-rank__labels", children: n("span", { children: ["1 - ", U] }) }), n("ol", { className: "ul-card-rank__list", onDragOver: d ? void 0 : (x) => {
|
|
1159
1158
|
x.preventDefault(), x.dataTransfer && (x.dataTransfer.dropEffect = "move");
|
|
1160
1159
|
}, children: D.map(({ id: x, label: A, rank: O }, M) => {
|
|
1161
|
-
return n("li", { className: "ul-card-rank__option", draggable: !!_ || void 0, onDragEnd: _ ? re : void 0, onDragEnter: _ ?
|
|
1160
|
+
return n("li", { className: "ul-card-rank__option", draggable: !!_ || void 0, onDragEnd: _ ? re : void 0, onDragEnter: _ ? K : void 0, onDragLeave: _ ? te : void 0, onDragStart: _ ? (X = M, (G) => {
|
|
1162
1161
|
p.current = X, G.dataTransfer && (G.dataTransfer.effectAllowed = "move", G.dataTransfer.setData("text/plain", String(X)), G.currentTarget.classList.add("is-dragging"));
|
|
1163
1162
|
}) : void 0, onDrop: _ ? (z = M, (G) => {
|
|
1164
1163
|
var ye, Ze;
|
|
1165
1164
|
G.preventDefault(), G.currentTarget.classList.remove("is-drop-target");
|
|
1166
1165
|
const $ = p.current;
|
|
1167
|
-
p.current = null, (Ze = (ye = G.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : ye.querySelector(".is-dragging")) == null || Ze.classList.remove("is-dragging"), $ != null && $ !== z &&
|
|
1166
|
+
p.current = null, (Ze = (ye = G.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : ye.querySelector(".is-dragging")) == null || Ze.classList.remove("is-dragging"), $ != null && $ !== z && R($, z);
|
|
1168
1167
|
}) : void 0, ref: (G) => P.current[M] = G, children: [n("select", { "aria-label": `Rank for ${A}`, className: H("ul-card-rank__select", O == null && "ul-card-rank__select--placeholder"), name: `rank[${x}]`, onChange: (G) => h(x, G.currentTarget.value), value: O ?? "", children: [O == null && n("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), T.map((G) => n("option", { className: "ul-card-rank__select-option", value: G, children: G }, G))] }), n("span", { children: A }), !d && n("button", { "aria-label": `Drag ${A} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: k ? w : void 0, onTouchMove: k ? I : void 0, onTouchStart: k ? u(M) : void 0, title: "Drag to reorder", type: "button", children: n("svg", { fill: "none", height: "17", viewBox: "0 0 16 17", width: "16", xmlns: "http://www.w3.org/2000/svg", children: n("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" }) }) })] }, x);
|
|
1169
1168
|
var z, X;
|
|
1170
1169
|
}) }), n("div", { className: "ul-card-rank__labels", children: n("span", { children: [Y, " - ", Z] }) })] }) }), n(ue, { children: !a && n("div", { className: "ul-card__button-wrapper", children: n(se, { disabled: b, children: ne(r) }) }) })] }) }) }, i);
|
|
@@ -1276,12 +1275,12 @@ const fn = "ul-permission-graphics-container", yn = "ul-permission-body", Cn = H
|
|
|
1276
1275
|
const { updatePage: q } = ie.getState(), { eventEmitFn: V, recorderEventEmitter: d } = F.getState(), k = { questionId: T, surveyId: E, visitorId: C, responseGroupUid: D };
|
|
1277
1276
|
let _ = 0;
|
|
1278
1277
|
d.emit("recorded.task.permission.screen"), V("recorded.task.permission.screen"), d.emit("permission.status", { "permission.status.callback": (v, u, I, w) => {
|
|
1279
|
-
const
|
|
1280
|
-
if (Ie(
|
|
1281
|
-
const { permissionDescriptors: U } =
|
|
1278
|
+
const R = b[_], { type: N } = R, L = ["screen"];
|
|
1279
|
+
if (Ie(R)) {
|
|
1280
|
+
const { permissionDescriptors: U } = R, Z = U == null ? void 0 : U.includes("microphone"), Y = U == null ? void 0 : U.includes("camera");
|
|
1282
1281
|
Z && L.push("audio"), Y && L.push("video"), (v != null && v.active && !Y || v != null && v.active && u) && _++;
|
|
1283
1282
|
}
|
|
1284
|
-
en(b[_]) && I && (_++, d.emit("begin.recording", { "recording.media.types": L, "start.recording.callback": (U) => q({ mediaRecordingUids: U }) })), q({ currentPage: b[_], avStream: v, screenPermissionRequested: I, nextQuestion: j, type:
|
|
1283
|
+
en(b[_]) && I && (_++, d.emit("begin.recording", { "recording.media.types": L, "start.recording.callback": (U) => q({ mediaRecordingUids: U }) })), q({ currentPage: b[_], avStream: v, screenPermissionRequested: I, nextQuestion: j, type: N, passthroughData: k, recordingMediaTypes: L, captureStream: w });
|
|
1285
1284
|
} });
|
|
1286
1285
|
const h = b[_];
|
|
1287
1286
|
return h.type === "av_permission" && Ae({ currentPage: h, pages: b }), h;
|
|
@@ -1325,17 +1324,17 @@ const fn = "ul-permission-graphics-container", yn = "ul-permission-body", Cn = H
|
|
|
1325
1324
|
Xe(), o({ value: { uploadId: D, mediaRecordingUid: T }, questionId: r, type: i }, !0);
|
|
1326
1325
|
}, showCheckmark: d, children: V }), n("div", { style: { display: q === ft ? "block" : "none" }, children: n("div", { id: "ul-recorder-player-container", ref: (v) => {
|
|
1327
1326
|
if (v && v.children.length === 0) {
|
|
1328
|
-
const u = ((I, w = {},
|
|
1327
|
+
const u = ((I, w = {}, R = "https://api.userleap.com", N, L, U, Z = !1, Y = document) => {
|
|
1329
1328
|
S.document = Y;
|
|
1330
|
-
const
|
|
1329
|
+
const K = I + ln, te = mn(K);
|
|
1331
1330
|
return S.document.addEventListener("securitypolicyviolation", (re) => {
|
|
1332
|
-
ce(new Error(`Voice & Video feature violates ${re.violatedDirective} web page CSP policies for the recorder player.`), "recorderDeviceError",
|
|
1331
|
+
ce(new Error(`Voice & Video feature violates ${re.violatedDirective} web page CSP policies for the recorder player.`), "recorderDeviceError", R, U, w.visitorId, w.envId);
|
|
1333
1332
|
}), dn(an.concat(On), () => {
|
|
1334
|
-
Be(
|
|
1333
|
+
Be(K, te), S.document.getElementById(ze(K)).remove();
|
|
1335
1334
|
try {
|
|
1336
|
-
$n(te,
|
|
1335
|
+
$n(te, K, w, R, N, L, U, Z);
|
|
1337
1336
|
} catch (re) {
|
|
1338
|
-
return void ce(new Error(`Error when creating video recorder player object ${re}`), "recorderDeviceError",
|
|
1337
|
+
return void ce(new Error(`Error when creating video recorder player object ${re}`), "recorderDeviceError", R, U, w.visitorId, w.envId);
|
|
1339
1338
|
}
|
|
1340
1339
|
}), te;
|
|
1341
1340
|
})(k, { surveyId: g, responseGroupUid: y, questionId: r, visitorId: f, envId: c }, l, _, void 0, { ...p, "x-ul-video-recorder-origin": "sdk" }, t.mediaType === B.MEDIA_TYPE_AUDIO, m);
|
|
@@ -1347,7 +1346,7 @@ const fn = "ul-permission-graphics-container", yn = "ul-permission-body", Cn = H
|
|
|
1347
1346
|
return xe(e) && ((o = e.props) == null ? void 0 : o.loading) === Me.inFlight;
|
|
1348
1347
|
}, kn = (e) => e.type === "thanks" || e.type === "uploading", Ct = ({ card: e, avatars: o, isThinking: t, isCurrentQuestion: r, currentQuestionBubbleRef: i }) => {
|
|
1349
1348
|
const s = ((c) => "properties" in c.props && c.props.properties && "questionHtml" in c.props.properties && c.props.properties.questionHtml ? { content: c.props.properties.questionHtml, image: c.props.properties.image, isHtml: !0 } : "message" in c.props ? "image" in c.props.properties && c.props.properties.image ? { content: c.props.message, image: c.props.properties.image, isHtml: !1 } : { content: c.props.message, isHtml: !1 } : { content: "Question", isHtml: !1 })(e), l = r && !(s != null && s.image) ? i : null;
|
|
1350
|
-
return n(ge, { children: [(s == null ? void 0 : s.image) && n(be, { avatars: o, isLeft: !0, ref: r ? i : null, children: !t && n(An, { image: s.image
|
|
1349
|
+
return n(ge, { children: [(s == null ? void 0 : s.image) && n(be, { avatars: o, isLeft: !0, ref: r ? i : null, children: !t && n(An, { image: s.image }) }), n(be, { avatars: o, isLeft: !0, message: { id: `question-${e.name}`, type: "question", content: s.content }, ref: l, children: t ? n(gt, {}) : n(ge, { children: [s.isHtml ? n(we, { className: "chat-message-text", html: s.content }) : n("div", { className: "chat-message-text", children: s.content }), e.type === "videovoice" && n(Gn, { properties: e.props, questionId: e.name, surveyVideoUrl: e.props.properties.videoUrl })] }) })] });
|
|
1351
1350
|
}, xt = ({ card: e, avatars: o }) => {
|
|
1352
1351
|
const t = ((r) => {
|
|
1353
1352
|
if (!("properties" in r.props) || !r.props.properties || typeof r.props.properties != "object") return null;
|
|
@@ -1447,28 +1446,28 @@ const It = () => {
|
|
|
1447
1446
|
const [h, v] = Q(/* @__PURE__ */ new Map());
|
|
1448
1447
|
return de(() => {
|
|
1449
1448
|
if (d.length > 0 && k < d.length) {
|
|
1450
|
-
const u = d[k], I = `${u.name}`, w = (
|
|
1449
|
+
const u = d[k], I = `${u.name}`, w = (N) => {
|
|
1451
1450
|
if (k > 0) {
|
|
1452
1451
|
const L = d[k - 1];
|
|
1453
1452
|
if (xe(L)) {
|
|
1454
1453
|
const U = `${L.name}`, Z = Re(L);
|
|
1455
|
-
if (
|
|
1454
|
+
if (N.get(U) !== Z) return new Map(N).set(U, Z);
|
|
1456
1455
|
}
|
|
1457
1456
|
}
|
|
1458
|
-
return
|
|
1457
|
+
return N;
|
|
1459
1458
|
};
|
|
1460
|
-
if ((k <= (_ ?? 0) || kn(u)) && (u == null ? void 0 : u.type) !== "aidynamicstandalone") return v((
|
|
1461
|
-
v((
|
|
1459
|
+
if ((k <= (_ ?? 0) || kn(u)) && (u == null ? void 0 : u.type) !== "aidynamicstandalone") return v((N) => w(new Map(N).set(I, !1)));
|
|
1460
|
+
v((N) => {
|
|
1462
1461
|
const L = !xe(u) || Re(u);
|
|
1463
|
-
return w(new Map(
|
|
1462
|
+
return w(new Map(N).set(I, L));
|
|
1464
1463
|
});
|
|
1465
|
-
const
|
|
1466
|
-
v((
|
|
1464
|
+
const R = setTimeout(() => {
|
|
1465
|
+
v((N) => {
|
|
1467
1466
|
const L = !!xe(u) && Re(u);
|
|
1468
|
-
return w(new Map(
|
|
1467
|
+
return w(new Map(N).set(I, L));
|
|
1469
1468
|
});
|
|
1470
1469
|
}, 1e3);
|
|
1471
|
-
return () => clearTimeout(
|
|
1470
|
+
return () => clearTimeout(R);
|
|
1472
1471
|
}
|
|
1473
1472
|
}, [k, d, _]), h;
|
|
1474
1473
|
})(e, s, g);
|