@sprig-technologies/sprig-browser 2.38.1 → 2.39.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,3164 +0,0 @@
1
- import { A as Ue, D as To, a as Lo, C as ln, i as No, E as Po, b as ze, d as Vt, e as Ro, r as Do, f as dn } from "./core-CjelM0RR.js";
2
- import { e as Qe, h as lt, S as ce, s as Pt, D as cn, b as Mo, t as le, v as Rt, u as Oo } from "./metricsReporter-Snw3vppt.js";
3
- var Ye, M, ar, Pe, un, lr, Dt, dr, Ge = {}, cr = [], Uo = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, mt = Array.isArray;
4
- function we(e, t) {
5
- for (var n in t) e[n] = t[n];
6
- return e;
7
- }
8
- function ur(e) {
9
- var t = e.parentNode;
10
- t && t.removeChild(e);
11
- }
12
- function de(e, t, n) {
13
- var r, o, i, s = {};
14
- for (i in t) i == "key" ? r = t[i] : i == "ref" ? o = t[i] : s[i] = t[i];
15
- if (arguments.length > 2 && (s.children = arguments.length > 3 ? Ye.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (i in e.defaultProps) s[i] === void 0 && (s[i] = e.defaultProps[i]);
16
- return We(e, s, r, o, null);
17
- }
18
- function We(e, t, n, r, o) {
19
- var i = { type: e, props: t, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: o ?? ++ar, __i: -1, __u: 0 };
20
- return o == null && M.vnode != null && M.vnode(i), i;
21
- }
22
- function pr() {
23
- return { current: null };
24
- }
25
- function ne(e) {
26
- return e.children;
27
- }
28
- function fe(e, t) {
29
- this.props = e, this.context = t;
30
- }
31
- function He(e, t) {
32
- if (t == null) return e.__ ? He(e.__, e.__i + 1) : null;
33
- for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
34
- return typeof e.type == "function" ? He(e) : null;
35
- }
36
- function mr(e) {
37
- var t, n;
38
- if ((e = e.__) != null && e.__c != null) {
39
- for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) {
40
- e.__e = e.__c.base = n.__e;
41
- break;
42
- }
43
- return mr(e);
44
- }
45
- }
46
- function Mt(e) {
47
- (!e.__d && (e.__d = !0) && Pe.push(e) && !dt.__r++ || un !== M.debounceRendering) && ((un = M.debounceRendering) || lr)(dt);
48
- }
49
- function dt() {
50
- var e, t, n, r, o, i, s, d, l;
51
- for (Pe.sort(Dt); e = Pe.shift(); ) e.__d && (t = Pe.length, r = void 0, i = (o = (n = e).__v).__e, d = [], l = [], (s = n.__P) && ((r = we({}, o)).__v = o.__v + 1, M.vnode && M.vnode(r), $t(s, r, o, n.__n, s.ownerSVGElement !== void 0, 32 & o.__u ? [i] : null, d, i ?? He(o), !!(32 & o.__u), l), r.__.__k[r.__i] = r, gr(d, r, l), r.__e != i && mr(r)), Pe.length > t && Pe.sort(Dt));
52
- dt.__r = 0;
53
- }
54
- function hr(e, t, n, r, o, i, s, d, l, u, p) {
55
- var c, f, g, m, b, v = r && r.__k || cr, w = t.length;
56
- for (n.__d = l, function(x, I, T) {
57
- var C, E, _, R, L, j = I.length, h = T.length, y = h, k = 0;
58
- for (x.__k = [], C = 0; C < j; C++) (E = x.__k[C] = (E = I[C]) == null || typeof E == "boolean" || typeof E == "function" ? null : typeof E == "string" || typeof E == "number" || typeof E == "bigint" || E.constructor == String ? We(null, E, null, null, E) : mt(E) ? We(ne, { children: E }, null, null, null) : E.constructor === void 0 && E.__b > 0 ? We(E.type, E.props, E.key, E.ref ? E.ref : null, E.__v) : E) != null ? (E.__ = x, E.__b = x.__b + 1, L = Ho(E, T, R = C + k, y), E.__i = L, _ = null, L !== -1 && (y--, (_ = T[L]) && (_.__u |= 131072)), _ == null || _.__v === null ? (L == -1 && k--, typeof E.type != "function" && (E.__u |= 65536)) : L !== R && (L === R + 1 ? k++ : L > R ? y > j - R ? k += L - R : k-- : k = L < R && L == R - 1 ? L - R : 0, L !== C + k && (E.__u |= 65536))) : (_ = T[C]) && _.key == null && _.__e && (_.__e == x.__d && (x.__d = He(_)), Ot(_, _, !1), T[C] = null, y--);
59
- if (y) for (C = 0; C < h; C++) (_ = T[C]) != null && !(131072 & _.__u) && (_.__e == x.__d && (x.__d = He(_)), Ot(_, _));
60
- }(n, t, v), l = n.__d, c = 0; c < w; c++) (g = n.__k[c]) != null && typeof g != "boolean" && typeof g != "function" && (f = g.__i === -1 ? Ge : v[g.__i] || Ge, g.__i = c, $t(e, g, f, o, i, s, d, l, u, p), m = g.__e, g.ref && f.ref != g.ref && (f.ref && zt(f.ref, null, g), p.push(g.ref, g.__c || m, g)), b == null && m != null && (b = m), 65536 & g.__u || f.__k === g.__k ? l = fr(g, l, e) : typeof g.type == "function" && g.__d !== void 0 ? l = g.__d : m && (l = m.nextSibling), g.__d = void 0, g.__u &= -196609);
61
- n.__d = l, n.__e = b;
62
- }
63
- function fr(e, t, n) {
64
- var r, o;
65
- if (typeof e.type == "function") {
66
- for (r = e.__k, o = 0; r && o < r.length; o++) r[o] && (r[o].__ = e, t = fr(r[o], t, n));
67
- return t;
68
- }
69
- return e.__e != t && (n.insertBefore(e.__e, t || null), t = e.__e), t && t.nextSibling;
70
- }
71
- function Ce(e, t) {
72
- return t = t || [], e == null || typeof e == "boolean" || (mt(e) ? e.some(function(n) {
73
- Ce(n, t);
74
- }) : t.push(e)), t;
75
- }
76
- function Ho(e, t, n, r) {
77
- var o = e.key, i = e.type, s = n - 1, d = n + 1, l = t[n];
78
- if (l === null || l && o == l.key && i === l.type) return n;
79
- if (r > (l == null || 131072 & l.__u ? 0 : 1)) for (; s >= 0 || d < t.length; ) {
80
- if (s >= 0) {
81
- if ((l = t[s]) && !(131072 & l.__u) && o == l.key && i === l.type) return s;
82
- s--;
83
- }
84
- if (d < t.length) {
85
- if ((l = t[d]) && !(131072 & l.__u) && o == l.key && i === l.type) return d;
86
- d++;
87
- }
88
- }
89
- return -1;
90
- }
91
- function pn(e, t, n) {
92
- t[0] === "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || Uo.test(t) ? n : n + "px";
93
- }
94
- function nt(e, t, n, r, o) {
95
- var i;
96
- e: if (t === "style") if (typeof n == "string") e.style.cssText = n;
97
- else {
98
- if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || pn(e.style, t, "");
99
- if (n) for (t in n) r && n[t] === r[t] || pn(e.style, t, n[t]);
100
- }
101
- else if (t[0] === "o" && t[1] === "n") i = t !== (t = t.replace(/(PointerCapture)$|Capture$/, "$1")), t = t.toLowerCase() in e ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + i] = n, n ? r ? n.u = r.u : (n.u = Date.now(), e.addEventListener(t, i ? hn : mn, i)) : e.removeEventListener(t, i ? hn : mn, i);
102
- else {
103
- if (o) t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
104
- else if (t !== "width" && t !== "height" && t !== "href" && t !== "list" && t !== "form" && t !== "tabIndex" && t !== "download" && t !== "rowSpan" && t !== "colSpan" && t !== "role" && t in e) try {
105
- e[t] = n ?? "";
106
- break e;
107
- } catch {
108
- }
109
- typeof n == "function" || (n == null || n === !1 && t[4] !== "-" ? e.removeAttribute(t) : e.setAttribute(t, n));
110
- }
111
- }
112
- function mn(e) {
113
- var t = this.l[e.type + !1];
114
- if (e.t) {
115
- if (e.t <= t.u) return;
116
- } else e.t = Date.now();
117
- return t(M.event ? M.event(e) : e);
118
- }
119
- function hn(e) {
120
- return this.l[e.type + !0](M.event ? M.event(e) : e);
121
- }
122
- function $t(e, t, n, r, o, i, s, d, l, u) {
123
- var p, c, f, g, m, b, v, w, x, I, T, C, E, _, R, L = t.type;
124
- if (t.constructor !== void 0) return null;
125
- 128 & n.__u && (l = !!(32 & n.__u), i = [d = t.__e = n.__e]), (p = M.__b) && p(t);
126
- e: if (typeof L == "function") try {
127
- if (w = t.props, x = (p = L.contextType) && r[p.__c], I = p ? x ? x.props.value : p.__ : r, n.__c ? v = (c = t.__c = n.__c).__ = c.__E : ("prototype" in L && L.prototype.render ? t.__c = c = new L(w, I) : (t.__c = c = new fe(w, I), c.constructor = L, c.render = Bo), x && x.sub(c), c.props = w, c.state || (c.state = {}), c.context = I, c.__n = r, f = c.__d = !0, c.__h = [], c._sb = []), c.__s == null && (c.__s = c.state), L.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = we({}, c.__s)), we(c.__s, L.getDerivedStateFromProps(w, c.__s))), g = c.props, m = c.state, c.__v = t, f) L.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), c.componentDidMount != null && c.__h.push(c.componentDidMount);
128
- else {
129
- if (L.getDerivedStateFromProps == null && w !== g && c.componentWillReceiveProps != null && c.componentWillReceiveProps(w, I), !c.__e && (c.shouldComponentUpdate != null && c.shouldComponentUpdate(w, c.__s, I) === !1 || t.__v === n.__v)) {
130
- for (t.__v !== n.__v && (c.props = w, c.state = c.__s, c.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.forEach(function(j) {
131
- j && (j.__ = t);
132
- }), T = 0; T < c._sb.length; T++) c.__h.push(c._sb[T]);
133
- c._sb = [], c.__h.length && s.push(c);
134
- break e;
135
- }
136
- c.componentWillUpdate != null && c.componentWillUpdate(w, c.__s, I), c.componentDidUpdate != null && c.__h.push(function() {
137
- c.componentDidUpdate(g, m, b);
138
- });
139
- }
140
- if (c.context = I, c.props = w, c.__P = e, c.__e = !1, C = M.__r, E = 0, "prototype" in L && L.prototype.render) {
141
- for (c.state = c.__s, c.__d = !1, C && C(t), p = c.render(c.props, c.state, c.context), _ = 0; _ < c._sb.length; _++) c.__h.push(c._sb[_]);
142
- c._sb = [];
143
- } else do
144
- c.__d = !1, C && C(t), p = c.render(c.props, c.state, c.context), c.state = c.__s;
145
- while (c.__d && ++E < 25);
146
- c.state = c.__s, c.getChildContext != null && (r = we(we({}, r), c.getChildContext())), f || c.getSnapshotBeforeUpdate == null || (b = c.getSnapshotBeforeUpdate(g, m)), hr(e, mt(R = p != null && p.type === ne && p.key == null ? p.props.children : p) ? R : [R], t, n, r, o, i, s, d, l, u), c.base = t.__e, t.__u &= -161, c.__h.length && s.push(c), v && (c.__E = c.__ = null);
147
- } catch (j) {
148
- t.__v = null, l || i != null ? (t.__e = d, t.__u |= l ? 160 : 32, i[i.indexOf(d)] = null) : (t.__e = n.__e, t.__k = n.__k), M.__e(j, t, n);
149
- }
150
- else i == null && t.__v === n.__v ? (t.__k = n.__k, t.__e = n.__e) : t.__e = qo(n.__e, t, n, r, o, i, s, l, u);
151
- (p = M.diffed) && p(t);
152
- }
153
- function gr(e, t, n) {
154
- t.__d = void 0;
155
- for (var r = 0; r < n.length; r++) zt(n[r], n[++r], n[++r]);
156
- M.__c && M.__c(t, e), e.some(function(o) {
157
- try {
158
- e = o.__h, o.__h = [], e.some(function(i) {
159
- i.call(o);
160
- });
161
- } catch (i) {
162
- M.__e(i, o.__v);
163
- }
164
- });
165
- }
166
- function qo(e, t, n, r, o, i, s, d, l) {
167
- var u, p, c, f, g, m, b, v = n.props, w = t.props, x = t.type;
168
- if (x === "svg" && (o = !0), i != null) {
169
- for (u = 0; u < i.length; u++) if ((g = i[u]) && "setAttribute" in g == !!x && (x ? g.localName === x : g.nodeType === 3)) {
170
- e = g, i[u] = null;
171
- break;
172
- }
173
- }
174
- if (e == null) {
175
- if (x === null) return document.createTextNode(w);
176
- e = o ? document.createElementNS("http://www.w3.org/2000/svg", x) : document.createElement(x, w.is && w), i = null, d = !1;
177
- }
178
- if (x === null) v === w || d && e.data === w || (e.data = w);
179
- else {
180
- if (i = i && Ye.call(e.childNodes), v = n.props || Ge, !d && i != null) for (v = {}, u = 0; u < e.attributes.length; u++) v[(g = e.attributes[u]).name] = g.value;
181
- for (u in v) g = v[u], u == "children" || (u == "dangerouslySetInnerHTML" ? c = g : u === "key" || u in w || nt(e, u, null, g, o));
182
- for (u in w) g = w[u], u == "children" ? f = g : u == "dangerouslySetInnerHTML" ? p = g : u == "value" ? m = g : u == "checked" ? b = g : u === "key" || d && typeof g != "function" || v[u] === g || nt(e, u, g, v[u], o);
183
- if (p) d || c && (p.__html === c.__html || p.__html === e.innerHTML) || (e.innerHTML = p.__html), t.__k = [];
184
- else if (c && (e.innerHTML = ""), hr(e, mt(f) ? f : [f], t, n, r, o && x !== "foreignObject", i, s, i ? i[0] : n.__k && He(n, 0), d, l), i != null) for (u = i.length; u--; ) i[u] != null && ur(i[u]);
185
- d || (u = "value", m !== void 0 && (m !== e[u] || x === "progress" && !m || x === "option" && m !== v[u]) && nt(e, u, m, v[u], !1), u = "checked", b !== void 0 && b !== e[u] && nt(e, u, b, v[u], !1));
186
- }
187
- return e;
188
- }
189
- function zt(e, t, n) {
190
- try {
191
- typeof e == "function" ? e(t) : e.current = t;
192
- } catch (r) {
193
- M.__e(r, n);
194
- }
195
- }
196
- function Ot(e, t, n) {
197
- var r, o;
198
- if (M.unmount && M.unmount(e), (r = e.ref) && (r.current && r.current !== e.__e || zt(r, null, t)), (r = e.__c) != null) {
199
- if (r.componentWillUnmount) try {
200
- r.componentWillUnmount();
201
- } catch (i) {
202
- M.__e(i, t);
203
- }
204
- r.base = r.__P = null, e.__c = void 0;
205
- }
206
- if (r = e.__k) for (o = 0; o < r.length; o++) r[o] && Ot(r[o], t, n || typeof e.type != "function");
207
- n || e.__e == null || ur(e.__e), e.__ = e.__e = e.__d = void 0;
208
- }
209
- function Bo(e, t, n) {
210
- return this.constructor(e, n);
211
- }
212
- function qe(e, t, n) {
213
- var r, o, i, s;
214
- M.__ && M.__(e, t), o = (r = typeof n == "function") ? null : n && n.__k || t.__k, i = [], s = [], $t(t, e = (!r && n || t).__k = de(ne, null, [e]), o || Ge, Ge, t.ownerSVGElement !== void 0, !r && n ? [n] : o ? null : t.firstChild ? Ye.call(t.childNodes) : null, i, !r && n ? n : o ? o.__e : t.firstChild, r, s), gr(i, e, s);
215
- }
216
- function vr(e, t) {
217
- qe(e, t, vr);
218
- }
219
- function Ao(e, t, n) {
220
- var r, o, i, s, d = we({}, e.props);
221
- for (i in e.type && e.type.defaultProps && (s = e.type.defaultProps), t) i == "key" ? r = t[i] : i == "ref" ? o = t[i] : d[i] = t[i] === void 0 && s !== void 0 ? s[i] : t[i];
222
- return arguments.length > 2 && (d.children = arguments.length > 3 ? Ye.call(arguments, 2) : n), We(e.type, d, r || e.key, o || e.ref, null);
223
- }
224
- function Qt(e, t) {
225
- var n = { __c: t = "__cC" + dr++, __: e, Consumer: function(r, o) {
226
- return r.children(o);
227
- }, Provider: function(r) {
228
- var o, i;
229
- return this.getChildContext || (o = [], (i = {})[t] = this, this.getChildContext = function() {
230
- return i;
231
- }, this.shouldComponentUpdate = function(s) {
232
- this.props.value !== s.value && o.some(function(d) {
233
- d.__e = !0, Mt(d);
234
- });
235
- }, this.sub = function(s) {
236
- o.push(s);
237
- var d = s.componentWillUnmount;
238
- s.componentWillUnmount = function() {
239
- o.splice(o.indexOf(s), 1), d && d.call(s);
240
- };
241
- }), r.children;
242
- } };
243
- return n.Provider.__ = n.Consumer.contextType = n;
244
- }
245
- Ye = cr.slice, M = { __e: function(e, t, n, r) {
246
- for (var o, i, s; t = t.__; ) if ((o = t.__c) && !o.__) try {
247
- if ((i = o.constructor) && i.getDerivedStateFromError != null && (o.setState(i.getDerivedStateFromError(e)), s = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, r || {}), s = o.__d), s) return o.__E = o;
248
- } catch (d) {
249
- e = d;
250
- }
251
- throw e;
252
- } }, ar = 0, fe.prototype.setState = function(e, t) {
253
- var n;
254
- n = this.__s != null && this.__s !== this.state ? this.__s : this.__s = we({}, this.state), typeof e == "function" && (e = e(we({}, n), this.props)), e && we(n, e), e != null && this.__v && (t && this._sb.push(t), Mt(this));
255
- }, fe.prototype.forceUpdate = function(e) {
256
- this.__v && (this.__e = !0, e && this.__h.push(e), Mt(this));
257
- }, fe.prototype.render = ne, Pe = [], lr = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Dt = function(e, t) {
258
- return e.__v.__b - t.__v.__b;
259
- }, dt.__r = 0, dr = 0;
260
- var Fo = 0;
261
- function a(e, t, n, r, o, i) {
262
- var s, d, l = {};
263
- for (d in t) d == "ref" ? s = t[d] : l[d] = t[d];
264
- var u = { type: e, props: l, key: n, ref: s, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --Fo, __i: -1, __u: 0, __source: o, __self: i };
265
- if (typeof e == "function" && (s = e.defaultProps)) for (d in s) l[d] === void 0 && (l[d] = s[d]);
266
- return M.vnode && M.vnode(u), u;
267
- }
268
- var Se, Z, yt, fn, Be = 0, br = [], rt = [], gn = M.__b, vn = M.__r, bn = M.diffed, _n = M.__c, yn = M.unmount;
269
- function Me(e, t) {
270
- M.__h && M.__h(Z, e, Be || t), Be = 0;
271
- var n = Z.__H || (Z.__H = { __: [], __h: [] });
272
- return e >= n.__.length && n.__.push({ __V: rt }), n.__[e];
273
- }
274
- function z(e) {
275
- return Be = 1, Wt(xr, e);
276
- }
277
- function Wt(e, t, n) {
278
- var r = Me(Se++, 2);
279
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : xr(void 0, t), function(d) {
280
- var l = r.__N ? r.__N[0] : r.__[0], u = r.t(l, d);
281
- l !== u && (r.__N = [u, r.__[1]], r.__c.setState({}));
282
- }], r.__c = Z, !Z.u)) {
283
- var o = function(d, l, u) {
284
- if (!r.__c.__H) return !0;
285
- var p = r.__c.__H.__.filter(function(f) {
286
- return f.__c;
287
- });
288
- if (p.every(function(f) {
289
- return !f.__N;
290
- })) return !i || i.call(this, d, l, u);
291
- var c = !1;
292
- return p.forEach(function(f) {
293
- if (f.__N) {
294
- var g = f.__[0];
295
- f.__ = f.__N, f.__N = void 0, g !== f.__[0] && (c = !0);
296
- }
297
- }), !(!c && r.__c.props === d) && (!i || i.call(this, d, l, u));
298
- };
299
- Z.u = !0;
300
- var i = Z.shouldComponentUpdate, s = Z.componentWillUpdate;
301
- Z.componentWillUpdate = function(d, l, u) {
302
- if (this.__e) {
303
- var p = i;
304
- i = void 0, o(d, l, u), i = p;
305
- }
306
- s && s.call(this, d, l, u);
307
- }, Z.shouldComponentUpdate = o;
308
- }
309
- return r.__N || r.__;
310
- }
311
- function Y(e, t) {
312
- var n = Me(Se++, 3);
313
- !M.__s && Yt(n.__H, t) && (n.__ = e, n.i = t, Z.__H.__h.push(n));
314
- }
315
- function Ke(e, t) {
316
- var n = Me(Se++, 4);
317
- !M.__s && Yt(n.__H, t) && (n.__ = e, n.i = t, Z.__h.push(n));
318
- }
319
- function ee(e) {
320
- return Be = 5, ge(function() {
321
- return { current: e };
322
- }, []);
323
- }
324
- function _r(e, t, n) {
325
- Be = 6, Ke(function() {
326
- return typeof e == "function" ? (e(t()), function() {
327
- return e(null);
328
- }) : e ? (e.current = t(), function() {
329
- return e.current = null;
330
- }) : void 0;
331
- }, n == null ? n : n.concat(e));
332
- }
333
- function ge(e, t) {
334
- var n = Me(Se++, 7);
335
- return Yt(n.__H, t) ? (n.__V = e(), n.i = t, n.__h = e, n.__V) : n.__;
336
- }
337
- function De(e, t) {
338
- return Be = 8, ge(function() {
339
- return e;
340
- }, t);
341
- }
342
- function Zt(e) {
343
- var t = Z.context[e.__c], n = Me(Se++, 9);
344
- return n.c = e, t ? (n.__ == null && (n.__ = !0, t.sub(Z)), t.props.value) : e.__;
345
- }
346
- function Gt(e, t) {
347
- M.useDebugValue && M.useDebugValue(t ? t(e) : e);
348
- }
349
- function yr() {
350
- var e = Me(Se++, 11);
351
- if (!e.__) {
352
- for (var t = Z.__v; t !== null && !t.__m && t.__ !== null; ) t = t.__;
353
- var n = t.__m || (t.__m = [0, 0]);
354
- e.__ = "P" + n[0] + "-" + n[1]++;
355
- }
356
- return e.__;
357
- }
358
- function Vo() {
359
- for (var e; e = br.shift(); ) if (e.__P && e.__H) try {
360
- e.__H.__h.forEach(ot), e.__H.__h.forEach(Ut), e.__H.__h = [];
361
- } catch (t) {
362
- e.__H.__h = [], M.__e(t, e.__v);
363
- }
364
- }
365
- M.__b = function(e) {
366
- Z = null, gn && gn(e);
367
- }, M.__r = function(e) {
368
- vn && vn(e), Se = 0;
369
- var t = (Z = e.__c).__H;
370
- t && (yt === Z ? (t.__h = [], Z.__h = [], t.__.forEach(function(n) {
371
- n.__N && (n.__ = n.__N), n.__V = rt, n.__N = n.i = void 0;
372
- })) : (t.__h.forEach(ot), t.__h.forEach(Ut), t.__h = [], Se = 0)), yt = Z;
373
- }, M.diffed = function(e) {
374
- bn && bn(e);
375
- var t = e.__c;
376
- t && t.__H && (t.__H.__h.length && (br.push(t) !== 1 && fn === M.requestAnimationFrame || ((fn = M.requestAnimationFrame) || $o)(Vo)), t.__H.__.forEach(function(n) {
377
- n.i && (n.__H = n.i), n.__V !== rt && (n.__ = n.__V), n.i = void 0, n.__V = rt;
378
- })), yt = Z = null;
379
- }, M.__c = function(e, t) {
380
- t.some(function(n) {
381
- try {
382
- n.__h.forEach(ot), n.__h = n.__h.filter(function(r) {
383
- return !r.__ || Ut(r);
384
- });
385
- } catch (r) {
386
- t.some(function(o) {
387
- o.__h && (o.__h = []);
388
- }), t = [], M.__e(r, n.__v);
389
- }
390
- }), _n && _n(e, t);
391
- }, M.unmount = function(e) {
392
- yn && yn(e);
393
- var t, n = e.__c;
394
- n && n.__H && (n.__H.__.forEach(function(r) {
395
- try {
396
- ot(r);
397
- } catch (o) {
398
- t = o;
399
- }
400
- }), n.__H = void 0, t && M.__e(t, n.__v));
401
- };
402
- var xn = typeof requestAnimationFrame == "function";
403
- function $o(e) {
404
- var t, n = function() {
405
- clearTimeout(r), xn && cancelAnimationFrame(t), setTimeout(e);
406
- }, r = setTimeout(n, 100);
407
- xn && (t = requestAnimationFrame(n));
408
- }
409
- function ot(e) {
410
- var t = Z, n = e.__c;
411
- typeof n == "function" && (e.__c = void 0, n()), Z = t;
412
- }
413
- function Ut(e) {
414
- var t = Z;
415
- e.__c = e.__(), Z = t;
416
- }
417
- function Yt(e, t) {
418
- return !e || e.length !== t.length || t.some(function(n, r) {
419
- return n !== e[r];
420
- });
421
- }
422
- function xr(e, t) {
423
- return typeof t == "function" ? t(e) : t;
424
- }
425
- function kr(e, t) {
426
- for (var n in t) e[n] = t[n];
427
- return e;
428
- }
429
- function Ht(e, t) {
430
- for (var n in e) if (n !== "__source" && !(n in t)) return !0;
431
- for (var r in t) if (r !== "__source" && e[r] !== t[r]) return !0;
432
- return !1;
433
- }
434
- function ct(e) {
435
- this.props = e;
436
- }
437
- function wr(e, t) {
438
- function n(o) {
439
- var i = this.props.ref, s = i == o.ref;
440
- return !s && i && (i.call ? i(null) : i.current = null), t ? !t(this.props, o) || !s : Ht(this.props, o);
441
- }
442
- function r(o) {
443
- return this.shouldComponentUpdate = n, de(e, o);
444
- }
445
- return r.displayName = "Memo(" + (e.displayName || e.name) + ")", r.prototype.isReactComponent = !0, r.__f = !0, r;
446
- }
447
- (ct.prototype = new fe()).isPureReactComponent = !0, ct.prototype.shouldComponentUpdate = function(e, t) {
448
- return Ht(this.props, e) || Ht(this.state, t);
449
- };
450
- var kn = M.__b;
451
- M.__b = function(e) {
452
- e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), kn && kn(e);
453
- };
454
- var zo = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
455
- function Kt(e) {
456
- function t(n) {
457
- var r = kr({}, n);
458
- return delete r.ref, e(r, n.ref || null);
459
- }
460
- return t.$$typeof = zo, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
461
- }
462
- var wn = function(e, t) {
463
- return e == null ? null : Ce(Ce(e).map(t));
464
- }, Cr = { map: wn, forEach: wn, count: function(e) {
465
- return e ? Ce(e).length : 0;
466
- }, only: function(e) {
467
- var t = Ce(e);
468
- if (t.length !== 1) throw "Children.only";
469
- return t[0];
470
- }, toArray: Ce }, Qo = M.__e;
471
- M.__e = function(e, t, n, r) {
472
- if (e.then) {
473
- for (var o, i = t; i = i.__; ) if ((o = i.__c) && o.__c) return t.__e == null && (t.__e = n.__e, t.__k = n.__k), o.__c(e, t);
474
- }
475
- Qo(e, t, n, r);
476
- };
477
- var Cn = M.unmount;
478
- function Sr(e, t, n) {
479
- return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(r) {
480
- typeof r.__c == "function" && r.__c();
481
- }), e.__c.__H = null), (e = kr({}, e)).__c != null && (e.__c.__P === n && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(r) {
482
- return Sr(r, t, n);
483
- })), e;
484
- }
485
- function Er(e, t, n) {
486
- return e && n && (e.__v = null, e.__k = e.__k && e.__k.map(function(r) {
487
- return Er(r, t, n);
488
- }), e.__c && e.__c.__P === t && (e.__e && n.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = n)), e;
489
- }
490
- function Ze() {
491
- this.__u = 0, this.t = null, this.__b = null;
492
- }
493
- function Ir(e) {
494
- var t = e.__.__c;
495
- return t && t.__a && t.__a(e);
496
- }
497
- function jr(e) {
498
- var t, n, r;
499
- function o(i) {
500
- if (t || (t = e()).then(function(s) {
501
- n = s.default || s;
502
- }, function(s) {
503
- r = s;
504
- }), r) throw r;
505
- if (!n) throw t;
506
- return de(n, i);
507
- }
508
- return o.displayName = "Lazy", o.__f = !0, o;
509
- }
510
- function Oe() {
511
- this.u = null, this.o = null;
512
- }
513
- M.unmount = function(e) {
514
- var t = e.__c;
515
- t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), Cn && Cn(e);
516
- }, (Ze.prototype = new fe()).__c = function(e, t) {
517
- var n = t.__c, r = this;
518
- r.t == null && (r.t = []), r.t.push(n);
519
- var o = Ir(r.__v), i = !1, s = function() {
520
- i || (i = !0, n.__R = null, o ? o(d) : d());
521
- };
522
- n.__R = s;
523
- var d = function() {
524
- if (!--r.__u) {
525
- if (r.state.__a) {
526
- var l = r.state.__a;
527
- r.__v.__k[0] = Er(l, l.__c.__P, l.__c.__O);
528
- }
529
- var u;
530
- for (r.setState({ __a: r.__b = null }); u = r.t.pop(); ) u.forceUpdate();
531
- }
532
- };
533
- r.__u++ || 32 & t.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), e.then(s, s);
534
- }, Ze.prototype.componentWillUnmount = function() {
535
- this.t = [];
536
- }, Ze.prototype.render = function(e, t) {
537
- if (this.__b) {
538
- if (this.__v.__k) {
539
- var n = document.createElement("div"), r = this.__v.__k[0].__c;
540
- this.__v.__k[0] = Sr(this.__b, n, r.__O = r.__P);
541
- }
542
- this.__b = null;
543
- }
544
- var o = t.__a && de(ne, null, e.fallback);
545
- return o && (o.__u &= -33), [de(ne, null, t.__a ? null : e.children), o];
546
- };
547
- var Sn = function(e, t, n) {
548
- if (++n[1] === n[0] && e.o.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.o.size)) for (n = e.u; n; ) {
549
- for (; n.length > 3; ) n.pop()();
550
- if (n[1] < n[0]) break;
551
- e.u = n = n[2];
552
- }
553
- };
554
- function Wo(e) {
555
- return this.getChildContext = function() {
556
- return e.context;
557
- }, e.children;
558
- }
559
- function Zo(e) {
560
- var t = this, n = e.i;
561
- t.componentWillUnmount = function() {
562
- qe(null, t.l), t.l = null, t.i = null;
563
- }, t.i && t.i !== n && t.componentWillUnmount(), t.l || (t.i = n, t.l = { nodeType: 1, parentNode: n, childNodes: [], appendChild: function(r) {
564
- this.childNodes.push(r), t.i.appendChild(r);
565
- }, insertBefore: function(r, o) {
566
- this.childNodes.push(r), t.i.appendChild(r);
567
- }, removeChild: function(r) {
568
- this.childNodes.splice(this.childNodes.indexOf(r) >>> 1, 1), t.i.removeChild(r);
569
- } }), qe(de(Wo, { context: t.context }, e.__v), t.l);
570
- }
571
- function Tr(e, t) {
572
- var n = de(Zo, { __v: e, i: t });
573
- return n.containerInfo = t, n;
574
- }
575
- (Oe.prototype = new fe()).__a = function(e) {
576
- var t = this, n = Ir(t.__v), r = t.o.get(e);
577
- return r[0]++, function(o) {
578
- var i = function() {
579
- t.props.revealOrder ? (r.push(o), Sn(t, e, r)) : o();
580
- };
581
- n ? n(i) : i();
582
- };
583
- }, Oe.prototype.render = function(e) {
584
- this.u = null, this.o = /* @__PURE__ */ new Map();
585
- var t = Ce(e.children);
586
- e.revealOrder && e.revealOrder[0] === "b" && t.reverse();
587
- for (var n = t.length; n--; ) this.o.set(t[n], this.u = [1, 0, this.u]);
588
- return e.children;
589
- }, Oe.prototype.componentDidUpdate = Oe.prototype.componentDidMount = function() {
590
- var e = this;
591
- this.o.forEach(function(t, n) {
592
- Sn(e, n, t);
593
- });
594
- };
595
- var Lr = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Go = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Yo = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Ko = /[A-Z0-9]/g, Jo = typeof document < "u", Xo = function(e) {
596
- return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
597
- };
598
- function Nr(e, t, n) {
599
- return t.__k == null && (t.textContent = ""), qe(e, t), typeof n == "function" && n(), e ? e.__c : null;
600
- }
601
- function Pr(e, t, n) {
602
- return vr(e, t), typeof n == "function" && n(), e ? e.__c : null;
603
- }
604
- fe.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
605
- Object.defineProperty(fe.prototype, e, { configurable: !0, get: function() {
606
- return this["UNSAFE_" + e];
607
- }, set: function(t) {
608
- Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
609
- } });
610
- });
611
- var En = M.event;
612
- function ei() {
613
- }
614
- function ti() {
615
- return this.cancelBubble;
616
- }
617
- function ni() {
618
- return this.defaultPrevented;
619
- }
620
- M.event = function(e) {
621
- return En && (e = En(e)), e.persist = ei, e.isPropagationStopped = ti, e.isDefaultPrevented = ni, e.nativeEvent = e;
622
- };
623
- var Jt, ri = { enumerable: !1, configurable: !0, get: function() {
624
- return this.class;
625
- } }, In = M.vnode;
626
- M.vnode = function(e) {
627
- typeof e.type == "string" && function(t) {
628
- var n = t.props, r = t.type, o = {};
629
- for (var i in n) {
630
- var s = n[i];
631
- if (!(i === "value" && "defaultValue" in n && s == null || Jo && i === "children" && r === "noscript" || i === "class" || i === "className")) {
632
- var d = i.toLowerCase();
633
- i === "defaultValue" && "value" in n && n.value == null ? i = "value" : i === "download" && s === !0 ? s = "" : d === "ondoubleclick" ? i = "ondblclick" : d !== "onchange" || r !== "input" && r !== "textarea" || Xo(n.type) ? d === "onfocus" ? i = "onfocusin" : d === "onblur" ? i = "onfocusout" : Yo.test(i) ? i = d : r.indexOf("-") === -1 && Go.test(i) ? i = i.replace(Ko, "-$&").toLowerCase() : s === null && (s = void 0) : d = i = "oninput", d === "oninput" && o[i = d] && (i = "oninputCapture"), o[i] = s;
634
- }
635
- }
636
- r == "select" && o.multiple && Array.isArray(o.value) && (o.value = Ce(n.children).forEach(function(l) {
637
- l.props.selected = o.value.indexOf(l.props.value) != -1;
638
- })), r == "select" && o.defaultValue != null && (o.value = Ce(n.children).forEach(function(l) {
639
- l.props.selected = o.multiple ? o.defaultValue.indexOf(l.props.value) != -1 : o.defaultValue == l.props.value;
640
- })), n.class && !n.className ? (o.class = n.class, Object.defineProperty(o, "className", ri)) : (n.className && !n.class || n.class && n.className) && (o.class = o.className = n.className), t.props = o;
641
- }(e), e.$$typeof = Lr, In && In(e);
642
- };
643
- var jn = M.__r;
644
- M.__r = function(e) {
645
- jn && jn(e), Jt = e.__c;
646
- };
647
- var Tn = M.diffed;
648
- M.diffed = function(e) {
649
- Tn && Tn(e);
650
- var t = e.props, n = e.__e;
651
- n != null && e.type === "textarea" && "value" in t && t.value !== n.value && (n.value = t.value == null ? "" : t.value), Jt = null;
652
- };
653
- var Rr = { ReactCurrentDispatcher: { current: { readContext: function(e) {
654
- return Jt.__n[e.__c].props.value;
655
- } } } };
656
- function Dr(e) {
657
- return de.bind(null, e);
658
- }
659
- function Je(e) {
660
- return !!e && e.$$typeof === Lr;
661
- }
662
- function Mr(e) {
663
- return Je(e) && e.type === ne;
664
- }
665
- function Or(e) {
666
- return Je(e) ? Ao.apply(null, arguments) : e;
667
- }
668
- function Xt(e) {
669
- return !!e.__k && (qe(null, e), !0);
670
- }
671
- function Ur(e) {
672
- return e && (e.base || e.nodeType === 1 && e) || null;
673
- }
674
- var Hr = function(e, t) {
675
- return e(t);
676
- }, qr = function(e, t) {
677
- return e(t);
678
- }, Br = ne;
679
- function en(e) {
680
- e();
681
- }
682
- function Ar(e) {
683
- return e;
684
- }
685
- function Fr() {
686
- return [!1, en];
687
- }
688
- var Vr = Ke, $r = Je;
689
- function zr(e, t) {
690
- var n = t(), r = z({ h: { __: n, v: t } }), o = r[0].h, i = r[1];
691
- return Ke(function() {
692
- o.__ = n, o.v = t, xt(o) && i({ h: o });
693
- }, [e, n, t]), Y(function() {
694
- return xt(o) && i({ h: o }), e(function() {
695
- xt(o) && i({ h: o });
696
- });
697
- }, [e]), n;
698
- }
699
- function xt(e) {
700
- var t, n, r = e.v, o = e.__;
701
- try {
702
- var i = r();
703
- return !((t = o) === (n = i) && (t !== 0 || 1 / t == 1 / n) || t != t && n != n);
704
- } catch {
705
- return !0;
706
- }
707
- }
708
- var oi = { useState: z, useId: yr, useReducer: Wt, useEffect: Y, useLayoutEffect: Ke, useInsertionEffect: Vr, useTransition: Fr, useDeferredValue: Ar, useSyncExternalStore: zr, startTransition: en, useRef: ee, useImperativeHandle: _r, useMemo: ge, useCallback: De, useContext: Zt, useDebugValue: Gt, version: "17.0.2", Children: Cr, render: Nr, hydrate: Pr, unmountComponentAtNode: Xt, createPortal: Tr, createElement: de, createContext: Qt, createFactory: Dr, cloneElement: Or, createRef: pr, Fragment: ne, isValidElement: Je, isElement: $r, isFragment: Mr, findDOMNode: Ur, Component: fe, PureComponent: ct, memo: wr, forwardRef: Kt, flushSync: qr, unstable_batchedUpdates: Hr, StrictMode: Br, Suspense: Ze, SuspenseList: Oe, lazy: jr, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Rr };
709
- const ii = Object.freeze(Object.defineProperty({ __proto__: null, Children: Cr, Component: fe, Fragment: ne, PureComponent: ct, StrictMode: Br, Suspense: Ze, SuspenseList: Oe, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Rr, cloneElement: Or, createContext: Qt, createElement: de, createFactory: Dr, createPortal: Tr, createRef: pr, default: oi, findDOMNode: Ur, flushSync: qr, forwardRef: Kt, hydrate: Pr, isElement: $r, isFragment: Mr, isValidElement: Je, lazy: jr, memo: wr, render: Nr, startTransition: en, unmountComponentAtNode: Xt, unstable_batchedUpdates: Hr, useCallback: De, useContext: Zt, useDebugValue: Gt, useDeferredValue: Ar, useEffect: Y, useErrorBoundary: function(e) {
710
- var t = Me(Se++, 10), n = z();
711
- return t.__ = e, Z.componentDidCatch || (Z.componentDidCatch = function(r, o) {
712
- t.__ && t.__(r, o), n[1](r);
713
- }), [n[0], function() {
714
- n[1](void 0);
715
- }];
716
- }, useId: yr, useImperativeHandle: _r, useInsertionEffect: Vr, useLayoutEffect: Ke, useMemo: ge, useReducer: Wt, useRef: ee, useState: z, useSyncExternalStore: zr, useTransition: Fr, version: "17.0.2" }, Symbol.toStringTag, { value: "Module" })), Ln = (e) => {
717
- let t;
718
- const n = /* @__PURE__ */ new Set(), r = (s, d) => {
719
- const l = typeof s == "function" ? s(t) : s;
720
- if (!Object.is(l, t)) {
721
- const u = t;
722
- t = d ?? typeof l != "object" ? l : Object.assign({}, t, l), n.forEach((p) => p(t, u));
723
- }
724
- }, o = () => t, i = { setState: r, getState: o, subscribe: (s) => (n.add(s), () => n.delete(s)), destroy: () => n.clear() };
725
- return t = e(r, o, i), i;
726
- };
727
- function si(e) {
728
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
729
- }
730
- function ai(e) {
731
- if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
732
- var t = e.default;
733
- if (typeof t == "function") {
734
- var n = function r() {
735
- return this instanceof r ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
736
- };
737
- n.prototype = t.prototype;
738
- } else n = {};
739
- return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
740
- var o = Object.getOwnPropertyDescriptor(e, r);
741
- Object.defineProperty(n, r, o.get ? o : { enumerable: !0, get: function() {
742
- return e[r];
743
- } });
744
- }), n;
745
- }
746
- var Nn = { exports: {} }, kt = {};
747
- const Qr = ai(ii);
748
- var Pn, Rn, Dn, Mn, On = { exports: {} }, wt = {};
749
- function li() {
750
- return Rn || (Rn = 1, On.exports = function() {
751
- if (Pn) return wt;
752
- Pn = 1;
753
- var e = Qr, t = typeof Object.is == "function" ? Object.is : function(l, u) {
754
- return l === u && (l !== 0 || 1 / l == 1 / u) || l != l && u != u;
755
- }, n = e.useState, r = e.useEffect, o = e.useLayoutEffect, i = e.useDebugValue;
756
- function s(l) {
757
- var u = l.getSnapshot;
758
- l = l.value;
759
- try {
760
- var p = u();
761
- return !t(l, p);
762
- } catch {
763
- return !0;
764
- }
765
- }
766
- var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? function(l, u) {
767
- return u();
768
- } : function(l, u) {
769
- var p = u(), c = n({ inst: { value: p, getSnapshot: u } }), f = c[0].inst, g = c[1];
770
- return o(function() {
771
- f.value = p, f.getSnapshot = u, s(f) && g({ inst: f });
772
- }, [l, p, u]), r(function() {
773
- return s(f) && g({ inst: f }), l(function() {
774
- s(f) && g({ inst: f });
775
- });
776
- }, [l]), i(p), p;
777
- };
778
- return wt.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : d, wt;
779
- }()), On.exports;
780
- }
781
- var di = (Mn || (Mn = 1, Nn.exports = function() {
782
- if (Dn) return kt;
783
- Dn = 1;
784
- var e = Qr, t = li(), n = typeof Object.is == "function" ? Object.is : function(l, u) {
785
- return l === u && (l !== 0 || 1 / l == 1 / u) || l != l && u != u;
786
- }, r = t.useSyncExternalStore, o = e.useRef, i = e.useEffect, s = e.useMemo, d = e.useDebugValue;
787
- return kt.useSyncExternalStoreWithSelector = function(l, u, p, c, f) {
788
- var g = o(null);
789
- if (g.current === null) {
790
- var m = { hasValue: !1, value: null };
791
- g.current = m;
792
- } else m = g.current;
793
- g = s(function() {
794
- function v(C) {
795
- if (!I) {
796
- if (I = !0, w = C, C = c(C), f !== void 0 && m.hasValue) {
797
- var E = m.value;
798
- if (f(E, C)) return x = E;
799
- }
800
- return x = C;
801
- }
802
- if (E = x, n(w, C)) return E;
803
- var _ = c(C);
804
- return f !== void 0 && f(E, _) ? E : (w = C, x = _);
805
- }
806
- var w, x, I = !1, T = p === void 0 ? null : p;
807
- return [function() {
808
- return v(u());
809
- }, T === null ? void 0 : function() {
810
- return v(T());
811
- }];
812
- }, [u, p, c, f]);
813
- var b = r(l, g[0], g[1]);
814
- return i(function() {
815
- m.hasValue = !0, m.value = b;
816
- }, [b]), d(b), b;
817
- }, kt;
818
- }()), Nn.exports);
819
- const ci = si(di), { useSyncExternalStoreWithSelector: ui } = ci, Un = (e) => {
820
- const t = typeof e == "function" ? ((r) => r ? Ln(r) : Ln)(e) : e, n = (r, o) => function(i, s = i.getState, d) {
821
- const l = ui(i.subscribe, i.getState, i.getServerState || i.getState, s, d);
822
- return Gt(l), l;
823
- }(t, r, o);
824
- return Object.assign(n, t), n;
825
- }, Wr = (e) => e ? Un(e) : Un;
826
- var me = ((e) => (e.RIGHT = "right", e.LEFT = "left", e))(me || {});
827
- const pi = 1, mi = 2, tn = { eq: (e, t) => e == t, neq(e, t) {
828
- return !this.eq(e, t);
829
- }, gt: (e, t) => e > t, gte: (e, t) => e >= t, lt: (e, t) => e < t, lte: (e, t) => e <= t, list_exact: (e, t) => !(!Array.isArray(e) || !Array.isArray(t)) && e.slice().sort().join(",") === t.slice().sort().join(","), list_all: (e, t) => !(!Array.isArray(e) || !Array.isArray(t)) && !t.some((n) => e.indexOf(n) === -1), list_alo(e, t) {
830
- if (!Array.isArray(t)) return !1;
831
- const n = Array.isArray(e) ? e : [e], r = new Set(n);
832
- return t.some((o) => r.has(o));
833
- }, list_dni(e, t) {
834
- if (!Array.isArray(t)) return !1;
835
- const n = Array.isArray(e) ? e : [e], r = new Set(n);
836
- return t.every((o) => !r.has(o));
837
- }, contains(e, t) {
838
- const n = e.toLowerCase(), r = t.toLowerCase();
839
- return n.includes(r);
840
- }, notcontains(e, t) {
841
- return !this.contains(e, t);
842
- } }, hi = (e, t, n) => {
843
- switch (t) {
844
- case "videovoice":
845
- return !!(e && e.value);
846
- case "open":
847
- return !!n;
848
- case "multipleselect":
849
- return !!(n && Object.keys(n).length);
850
- case "recordedtask":
851
- return (n == null ? void 0 : n.taskStatus) === "completed";
852
- case "texturlprompt":
853
- return !e.value;
854
- case "consentlegal":
855
- case "nps":
856
- case "likert":
857
- return n !== null;
858
- case "multiplechoice":
859
- return n !== void 0;
860
- case "matrix":
861
- return !!(n && Object.values(n).every((r) => r !== null));
862
- default:
863
- return !0;
864
- }
865
- }, Zr = (e, t) => {
866
- if (t === "matrix") {
867
- const n = Object.keys(e).length, r = Object.values(e).filter((o) => o !== null).length;
868
- return r > 0 && r < n;
869
- }
870
- return !1;
871
- }, Gr = ({ cards: e, index: t, hasEndCard: n, allResponses: r, uploadProgress: o = {} }) => {
872
- if (t >= e.length || t < 0) return null;
873
- const i = e[t];
874
- let s = t + 1;
875
- const d = i.props.routingOptions || [];
876
- for (let p = 0; p < d.length; p++) {
877
- const { group: c, target: f } = d[p];
878
- if (!(c != null && c.length)) continue;
879
- const g = c[0];
880
- if (g.questionIndex === void 0 || g.questionIndex > r.length) continue;
881
- let m = Hn({ comparator: g.comparator, response: r[g.questionIndex], type: i.type, value: g.value });
882
- for (let b = 1; b < c.length; b += 2) {
883
- const v = c[b], w = c[b + 1], x = Hn({ comparator: w.comparator, response: r[w.questionIndex], type: e[w.questionIndex].type, value: w.value });
884
- v === pi ? m && (m = x) : v === mi && (m || (m = x));
885
- }
886
- if (m) {
887
- s = f === -1 && n ? e.length - 1 : f;
888
- break;
889
- }
890
- }
891
- const l = e.findIndex((p) => p.type === "uploading");
892
- let u;
893
- return u = l > 0 ? n ? e.length - 3 : e.length - 2 : e.length - 1, t >= u || s === -1 || s !== null && s > u ? l > 0 && Object.values(o).some((c) => c.isSubmitted && !c.isComplete) ? l : n ? e.length - 1 : null : s === -1 ? null : s;
894
- }, Hn = ({ comparator: e, response: t, type: n, value: r }) => {
895
- if (e === "answered") switch (n) {
896
- case "texturlprompt":
897
- return t === void 0;
898
- case "consentlegal":
899
- return t && t.submitted === !0;
900
- case "recordedtask":
901
- return "taskStatus" in t && t.taskStatus === "completed";
902
- case "likert":
903
- case "nps":
904
- return Number.isInteger(t);
905
- case "rankorder":
906
- case "matrix":
907
- return Object.values(t).every((o) => o !== null);
908
- case "maxdiff":
909
- return !(t === null || !Array.isArray(t)) && t.every((o) => {
910
- if (!Array.isArray(o)) return !1;
911
- const i = o.some((d) => d.selected === "left"), s = o.some((d) => d.selected === "right");
912
- return i && s;
913
- });
914
- case "multiplechoice":
915
- return t !== void 0;
916
- case "multipleselect":
917
- return (t == null ? void 0 : t.length) > 0;
918
- case "open":
919
- return t && t.length > 0;
920
- case "videovoice":
921
- return !!(t != null && t.mediaRecordingUid);
922
- default:
923
- return !1;
924
- }
925
- if (e === "given_up") return n !== "recordedtask" || "taskStatus" in t && t.taskStatus === "given.up";
926
- if (e === "partial") return n === "matrix" && Zr(t, n);
927
- if (e === "skipped") switch (n) {
928
- case "texturlprompt":
929
- return t == null ? void 0 : t.skipped;
930
- case "consentlegal":
931
- case "likert":
932
- case "nps":
933
- case "videovoice":
934
- return t === null;
935
- case "recordedtask":
936
- return "taskStatus" in t && t.taskStatus === "abandoned";
937
- case "open":
938
- case "multipleselect":
939
- return t === null || (t == null ? void 0 : t.length) === 0;
940
- case "multiplechoice":
941
- return t == null;
942
- case "matrix":
943
- return t === null || Object.values(t).every((o) => o === null);
944
- case "maxdiff":
945
- return t === null || !Array.isArray(t) || t.some((o) => {
946
- if (!Array.isArray(o)) return !0;
947
- const i = o.some((d) => d.selected === "left"), s = o.some((d) => d.selected === "right");
948
- return !(i && s);
949
- });
950
- case "rankorder":
951
- return t === null || Object.values(t).some((o) => o === null);
952
- default:
953
- return !1;
954
- }
955
- return tn[e](t, r);
956
- }, fi = (e) => {
957
- var r, o, i;
958
- switch (e.type) {
959
- case "multipleselect":
960
- return e && e.props && e.props.options ? e.props.options.length > 13 ? e.props.options.map((s) => [s.value]) : (t = e.props.options.map((s) => s.value), n = !e.props.properties.required, t.reduce((s, d) => s.concat(s.map((l) => [...l, d])), [[]]).filter((s) => n || s.length > 0)) : null;
961
- case "multiplechoice": {
962
- if (!e || !e.props || !e.props.options) return null;
963
- const s = e.props.options.map((d) => d.value);
964
- return e.props.properties.required || s.push(void 0), s;
965
- }
966
- case "matrix": {
967
- if (!((r = e == null ? void 0 : e.props) != null && r.options)) return null;
968
- const s = e.props.properties.matrixColumn, d = e.props.options, l = d.reduce((p, c) => (p[c.id] = null, p), {}), u = [{ ...l, [d[0].id]: s[0].value }, d.reduce((p, c) => (p[c.id] = s[0].value, p), {})];
969
- return e.props.properties.required || u.push(l), u;
970
- }
971
- case "likert": {
972
- const s = Number((i = (o = e.props) == null ? void 0 : o.properties) == null ? void 0 : i.range) || 5;
973
- return [...Array.from(Array(s).keys()).map((l) => l + 1), ...e.props.properties.required ? [] : [null]];
974
- }
975
- case "nps":
976
- return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...e.props.properties.required ? [] : [null]];
977
- case "videovoice":
978
- case "open":
979
- return ["1", ...e.props.properties.required ? [] : [""]];
980
- case "recordedtask": {
981
- const s = [{ taskStatus: "completed" }, { taskStatus: "given.up" }];
982
- return e.props.properties.required || s.push({ taskStatus: "abandoned" }), s;
983
- }
984
- case "texturlprompt":
985
- return [void 0, ...e.props.properties.required ? [] : [{ skipped: !0 }]];
986
- case "consentlegal":
987
- return [1, ...e.props.properties.required ? [] : [null]];
988
- default:
989
- return [1];
990
- }
991
- var t, n;
992
- }, gi = (e) => e in tn, vi = (e) => typeof e == "object" && e !== null && "taskStatus" in e, bi = (e, t = []) => t.reduce((n, r) => {
993
- const { group: o, target: i } = r;
994
- if (!(o != null && o.length)) return [...n];
995
- const s = o.filter((d) => !!Number(d) || typeof d == "object" && d.questionIndex === e).map((d) => {
996
- const { comparator: l, value: u } = d;
997
- return { comparator: l, target: i, value: u };
998
- });
999
- return [...n, ...s];
1000
- }, []), Ct = /* @__PURE__ */ new Set(["thanks", "uploading"]), A = Wr()((e, t) => ({ allResponses: [], answers: void 0, apiURL: "", border: "#000000", cards: [], close: async (n = Ue) => {
1001
- const r = t(), { fadeout: o, remove: i, trackHistory: s, studyType: d } = r;
1002
- await o(n), St(r) || s({ event: "closed" }), Mo.info("SurveyClosing", { surveyId: r.surveyId }), ln.enable(), i({ initiator: cn.Closed, studyType: d });
1003
- }, configureExitOnOverlayClick: () => {
1004
- }, customMetadata: {}, destroy: async (n) => {
1005
- const { eventEmitFn: r, fadeout: o, remove: i, studyType: s, surveyId: d } = t();
1006
- r("survey.complete", d), await o(n), ln.enable(), i({ initiator: cn.Complete, studyType: s });
1007
- }, endCard: { headline: "" }, envId: "", eventEmitFn: Qe.emit.bind(Qe), fadeout: async (n) => {
1008
- const { eventEmitFn: r, headers: o, viewDocument: i } = t();
1009
- return lt(o) ? Promise.resolve() : (r(ce.SurveyFadingOut), new Promise((s) => {
1010
- const d = i.getElementById(n);
1011
- d ? (d.addEventListener("transitionend", () => {
1012
- s();
1013
- }), d.classList.remove("ul-app--visible")) : s();
1014
- }));
1015
- }, forceBrandedLogo: !1, frame: document.createElement("iframe"), handleClickEmbedButton: (n) => {
1016
- const { cards: r, eventEmitFn: o, index: i } = t();
1017
- o(n, { qid: r[i].name, props: r[i].props }), e(() => ({ hasViewedEmbed: !0 }));
1018
- }, handleUploadUpdate: ({ mediaRecordingUid: n, isComplete: r, progressPct: o, isSubmitted: i }) => {
1019
- var g, m, b;
1020
- const { cards: s, destroy: d, index: l, uploadProgress: u } = t(), p = r || ((g = u[n]) == null ? void 0 : g.isComplete), c = { ...u, [n]: { progressPct: p ? 100 : o || ((m = u[n]) == null ? void 0 : m.progressPct), isComplete: p, isSubmitted: i || ((b = u[n]) == null ? void 0 : b.isSubmitted) } };
1021
- if (e({ uploadProgress: c }), s[l].type !== "uploading") return;
1022
- const f = Object.entries(u).every(([v, w]) => !w.isSubmitted || w.isComplete || n == v && r);
1023
- if (f && l >= s.length - 1) return d(Ue);
1024
- e({ index: f ? l + 1 : l, uploadingCardViewed: !0 });
1025
- }, hasViewedEmbed: !1, headers: { Authorization: "", "Content-Type": "", "userleap-platform": "web", "x-ul-environment-id": "", "x-ul-installation-method": "web-snippet", "x-ul-sdk-version": "", "x-ul-visitor-id": "" }, index: 0, isPreview: !1, marketingUrl: "https://sprig.com", meta: { ch: 0, cw: 0, l: "", mode: null, p: "", sh: 0, sw: 0 }, mode: void 0, next: (n) => {
1026
- const { allResponses: r, cards: o, eventEmitFn: i, index: s, responseGroupUid: d, submit: l, trackHistory: u, uploadProgress: p, viewedCardCount: c } = t();
1027
- e({ minScrollableHeight: void 0 });
1028
- const f = Array.isArray(n.data) ? n.data : [n.data], g = Date.now(), m = [...o], b = { response: [], responseGroupUid: d, questionIndex: s };
1029
- let v = null;
1030
- const w = r.slice(0);
1031
- f.forEach((T, C) => {
1032
- const E = m[s + C], { type: _, ...R } = T, L = { ...R, answeredAt: g };
1033
- L.questionId = Math.floor(L.questionId);
1034
- const j = L.value;
1035
- ((y) => y && !Ct.has(y.type))(E) && (E.value = j, E.secondaryValue = L.secondaryValue || null), b.response.push(L);
1036
- let h = j;
1037
- _ !== "multipleselect" && _ !== "multiplechoice" || j === null || (h = _ === "multiplechoice" ? Object.values(j).find((y) => y !== !1) : j, _ === "multipleselect" && (h = m[s + C].props.options.reduce((y, k) => (j[k.id] && y.push(k.value), y), []))), w[s + C] = h, v = Gr({ cards: m, index: s + C, hasEndCard: !!n.endCard, uploadProgress: p, allResponses: w });
1038
- }), e({ allResponses: w }), (v === null || Ct.has(m[v].type)) && (b.completedAt = g);
1039
- const x = l(b);
1040
- if (v === null) return void n.completeSurvey();
1041
- v && !Ct.has(m[v].type) && x.finally(() => {
1042
- u({ event: "seen", index: v });
1043
- });
1044
- const I = m[v];
1045
- m[v] && i && i("survey.question", { qid: I.name, props: I.props }), e({ cards: m, hasViewedEmbed: !1, index: v, viewedCardCount: c + 1 });
1046
- }, pendingRemoveIframeReason: null, previewKey: null, previewMode: void 0, recorder: () => {
1047
- }, recorderEventEmitter: Qe, resolveTrackedPromise: () => {
1048
- const { removeIframeIfReady: n } = t();
1049
- e((r) => ({ unresolvedRequestCount: r.unresolvedRequestCount - 1 })), n();
1050
- }, responseGroupUid: "", remove: ({ initiator: n, studyType: r }) => {
1051
- const { eventEmitFn: o, removeIframeIfReady: i, surveyId: s } = t();
1052
- e({ pendingRemoveIframeReason: n, studyType: r }), o(ce.SurveyCloseRequested, { name: ce.SurveyCloseRequested, initiator: n, studyType: r, "survey.id": s }), i();
1053
- }, removeIframeIfReady: () => {
1054
- const { eventEmitFn: n, pendingRemoveIframeReason: r, unresolvedRequestCount: o, studyType: i, surveyId: s } = t();
1055
- r && o === 0 && (n(ce.SurveyWillClose, { name: ce.SurveyWillClose, initiator: r, studyType: i, "survey.id": s }), e({ pendingRemoveIframeReason: null, studyType: i }));
1056
- }, seen: async () => {
1057
- const { trackHistory: n } = t();
1058
- return n({ event: "seen", isNew: !0 });
1059
- }, slugName: null, showStripes: !1, showSurveyBrand: !1, styleNonce: "", submit: async ({ completedAt: n, questionIndex: r, response: o, responseGroupUid: i }) => {
1060
- const s = t();
1061
- if (!i || St(s)) return;
1062
- const d = { responseGroupUid: i, meta: s.meta, customMetadata: s.customMetadata, responses: o, completedAt: n, previewKey: s.previewKey }, l = await s.trackPromise(Pt(`${s.apiURL}/sdk/1/environments/${s.envId}/visitors/${s.userId}/responses/submit`, { body: JSON.stringify(d), headers: s.headers, method: "POST" }));
1063
- l.ok ? o.forEach((u, p) => {
1064
- s.eventEmitFn(ce.QuestionAnswered, { ...u, questionIndex: r ? r + p : void 0, "survey.id": s.surveyId });
1065
- }) : l.reportError && (console.warn("[Sprig] (ERR-427) Failed to submit response", l.error), await s.trackPromise(qn(s, "submitResponse", l.error)));
1066
- }, surveyId: 0, tabTitle: "", trackHistory: async ({ event: n, index: r, isNew: o = !1 }) => {
1067
- const i = t();
1068
- if (St(i)) return;
1069
- const { cards: s, index: d } = i;
1070
- let l = r ?? d, u = s[l];
1071
- for (; u; ) {
1072
- const p = { sid: i.surveyId, qid: Math.floor(u.name), action: n, vid: i.userId, eid: i.envId, isNew: o, responseGroupUid: i.responseGroupUid, previewKey: i.previewKey }, c = await i.trackPromise(Pt(`${i.apiURL}/sdk/1/visitors/${i.userId}/surveys/${i.surveyId}/history`, { method: "POST", headers: i.headers, body: JSON.stringify(p) }));
1073
- !c.ok && c.reportError && (console.warn("[Sprig] (ERR-428) Failed to track survey event", c.error), await i.trackPromise(qn(i, "trackHistory", c.error)));
1074
- const f = s[l + 1];
1075
- if (!u.groupId || !(f != null && f.groupId) || f.groupId !== u.groupId) break;
1076
- l++, u = f, o = !1;
1077
- }
1078
- }, trackPromise: async (n) => {
1079
- const { resolveTrackedPromise: r } = t();
1080
- return e((o) => ({ unresolvedRequestCount: o.unresolvedRequestCount + 1 })), n.then((o) => (r(), o)).catch((o) => {
1081
- throw r(), o;
1082
- });
1083
- }, unresolvedRequestCount: 0, update: () => {
1084
- const { cards: n, index: r, headers: o, eventEmitFn: i, frame: s, useMobileStyling: d, surveyId: l, viewDocument: u } = t(), p = o["userleap-platform"] === "web", c = lt(o), f = n[r], g = f.type === "matrix" && !(f.props.properties.displayMatrixAsAccordion || d);
1085
- e({ minScrollableHeight: void 0 }), setTimeout(() => {
1086
- var w, x, I;
1087
- !c && !d && ((w = s == null ? void 0 : s.setWidth) == null || w.call(s, To));
1088
- const [m, b, v] = Lo(u, p && !d, c);
1089
- c ? (i(ce.SurveyHeight, { name: ce.SurveyHeight, contentFrameHeight: m, "survey.id": l }), i(ce.SurveyWidth, { name: ce.SurveyWidth, contentFrameWidth: b, "survey.id": l })) : ((x = s.setHeight) == null || x.call(s, m), e({ minScrollableHeight: v }), !d && g && ((I = s.setWidth) == null || I.call(s, b)));
1090
- }, 100);
1091
- }, uploadingCardViewed: !1, uploadProgress: {}, useDesktopPrototype: void 0, useMobileStyling: !1, userId: "", viewDocument: window.document, viewedCardCount: 0, focusedQuestionId: null, setFocusedQuestionId: (n) => e({ focusedQuestionId: n }) })), St = (e) => !e.userId || e.meta && e.meta.mode === "test" || e.isPreview || e.previewMode, qn = async (e, t, n) => {
1092
- const { mode: r, userId: o, envId: i, apiURL: s, headers: d, viewDocument: l } = e, u = l.documentElement, p = { mode: r, screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: u.clientWidth, clientHeight: u.clientHeight, location: window.location.href, language: window.navigator.language }, c = { action: t, err: { message: `${n == null ? void 0 : n.name} - ${n == null ? void 0 : n.message}`, stack: n == null ? void 0 : n.stack }, meta: p, vid: o, envId: i };
1093
- (await Pt(`${s}/sdk/1/errors`, { method: "POST", headers: Object.assign({ "x-ul-error": window.btoa(`userleap-${Date.now()}-error`) }, d), body: JSON.stringify(c) })).ok || console.warn("[Sprig] (ERR-444) Failed to report error to API", n);
1094
- }, Yr = (e) => de("svg", { fill: "none", height: 24, viewBox: "0 0 24 24", width: 24, xmlns: "http://www.w3.org/2000/svg", ...e }, de("path", { d: "M17 10L12 15L7 10", stroke: "#0B2330", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5 })), Kr = (e) => de("svg", { fill: "none", height: 10, viewBox: "0 0 10 10", width: 10, xmlns: "http://www.w3.org/2000/svg", ...e }, de("path", { d: "M9.15377 1.30774L4.07685 8.23082L1.30762 5.00005", stroke: "white", strokeLinecap: "round", strokeWidth: 2 })), _i = ({ visible: e }) => a("div", { className: "sprig-check-background", style: { opacity: e ? 1 : 0 }, children: a(Kr, { className: "sprig-check" }) }), Bn = "250ms", yi = Kt(({ animate: e, children: t, header: n, isOpen: r, onClick: o, showHeaderCheck: i }, s) => {
1095
- const d = ee(null), [l, u] = z(0), [p, c] = z("none"), [f, g] = z(!0);
1096
- return Y(() => {
1097
- var b;
1098
- const m = (b = d.current) == null ? void 0 : b.getBoundingClientRect();
1099
- u(r && m ? m.height : 0);
1100
- }, [r]), Y(() => {
1101
- !l && r || !f || g(!1), c(e && !f ? `height ${Bn} ease` : "none");
1102
- }, [e, f, l, r]), a("div", { className: "sprig-accordion", ref: s, children: [a("button", { className: "sprig-accordion-header-container", onClick: o, type: "button", children: [a("div", { className: "sprig-header-label-container", children: [a("span", { className: "sprig-header-label", children: n }), a(_i, { visible: i })] }), a(Yr, { className: "sprig-caret", style: { transitionDuration: e ? Bn : "0", transform: r ? "rotate(-180deg)" : "none" } })] }), a("div", { className: "sprig-accordion-body", style: { transition: p, height: l }, children: a("div", { ref: d, children: t }) })] });
1103
- }), nn = ({ style: e, stroke: t = "black" }) => a("svg", { fill: "none", height: "10", style: e, viewBox: "0 0 12 10", width: "12", xmlns: "http://www.w3.org/2000/svg", children: [a("path", { d: "M1.47839 5.2085L10.9384 5.2085", stroke: t, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.35" }), a("path", { d: "M7.0686 1.15845L10.9386 5.20845L7.0686 9.25845", stroke: t, strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.35" })] }), H = (...e) => e.filter(Boolean).join(" "), oe = (e, t, n) => {
1104
- const r = t ? "--mobile" : "--desktop";
1105
- return `${e + r} ${e + (n ? `${r}_${n}` : "")} ${e}`;
1106
- }, xi = (e, t) => `${e} ${e}__${t}`, ie = (e) => a("button", { ...e, className: H("ul-card-text__button", e.className), id: "ul-card-text__button" }), Jr = () => {
1107
- const { viewDocument: e } = A((r) => ({ viewDocument: r.viewDocument })), [t, n] = z(!1);
1108
- return Y(() => {
1109
- const r = e.querySelector(".sprig-question-body"), o = new ResizeObserver(() => {
1110
- window.requestAnimationFrame(() => {
1111
- n(!!(r && No(r) && r.scrollHeight > r.offsetHeight));
1112
- });
1113
- });
1114
- return r && o.observe(r), () => {
1115
- r && o.disconnect();
1116
- };
1117
- }, [e]), t;
1118
- }, An = ({ plainText: e, richText: t, id: n, className: r, isHeader: o }) => t ? a("div", { className: r, dangerouslySetInnerHTML: { __html: t }, id: n }) : e ? a(o ? "h1" : "p", { className: r, id: n, children: e }) : null, ki = () => {
1119
- const { cards: e, close: t, endCard: n, headers: r, index: o } = A((d) => ({ cards: d.cards, close: d.close, endCard: d.endCard, headers: d.headers, index: d.index, useMobileStyling: d.useMobileStyling })), i = e.length, s = ge(() => () => t(Ue), [t]);
1120
- return ["email", "link"].includes(r["userleap-platform"]) || n && o + 1 === i ? null : a("div", { "aria-label": "Close button", className: "close-btn", onClick: s, onKeyPress: (d) => {
1121
- d.key === "Enter" && s();
1122
- }, role: "button", tabIndex: 0, children: a("svg", { fill: "none", height: "16px", viewBox: "0 0 13 13", width: "16px", xmlns: "http://www.w3.org/2000/svg", children: a("path", { d: "M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z", fill: "#262136" }) }) });
1123
- }, ue = ({ message: e, properties: t }) => {
1124
- const n = ee(null), r = t == null ? void 0 : t.captionText, o = Jr();
1125
- return a("div", { className: H("question-header-container", "sprig-header-container", o ? "sprig-border-bottom" : null), ref: n, children: [a("div", { className: "question-header-button-container", children: [a(An, { className: "ul-question", id: "ul-question", isHeader: !0, plainText: e, richText: t == null ? void 0 : t.questionHtml }), a(ki, {})] }), a(An, { className: "ul-caption", id: "ul-caption", plainText: r, richText: t == null ? void 0 : t.captionHtml })] });
1126
- }, wi = () => a("svg", { fill: "none", height: "10", viewBox: "0 0 13 10", width: "13", xmlns: "http://www.w3.org/2000/svg", children: a("path", { d: "M11.5 1.5L4.5 8.5L1 5", stroke: "#FFFFFF", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5" }) }), ht = ({ isSubmitDisabled: e, handleSubmit: t }) => a("div", { className: "ul-card-longform__submit-button-container", children: a(ie, { className: "ul-card-longform__submit-button", disabled: e, onClick: t, children: ["OK ", a(wi, {})] }) }), Fn = ({ buttonText: e = "View Prototype", handleClick: t }) => a("button", { className: "prototype-button", onClick: t, children: e }, "prototype-btn"), xe = ({ defaultBody: e, embeddedType: t = "prototype", properties: n }) => {
1127
- var c;
1128
- const { handleClickEmbedButton: r, hasViewedEmbed: o, headers: i, useDesktopPrototype: s } = A((f) => ({ handleClickEmbedButton: f.handleClickEmbedButton, hasViewedEmbed: f.hasViewedEmbed, headers: f.headers, useDesktopPrototype: f.useDesktopPrototype })), d = (n == null ? void 0 : n.conceptUrl) || ((c = n == null ? void 0 : n.consentDocument) == null ? void 0 : c.url), l = window.innerWidth < Po, u = i["userleap-platform"], p = (f, g) => {
1129
- f.preventDefault(), r(g);
1130
- };
1131
- if (!s && l && !o && d && ["email", "link"].includes(u)) {
1132
- if (t === "prototype") return a(Fn, { handleClick: (f) => {
1133
- p(f, "question.prototype.click");
1134
- } });
1135
- if (t === "pdf") return a(Fn, { buttonText: (n == null ? void 0 : n.viewDocumentText) || "View Document", handleClick: (f) => {
1136
- p(f, "question.agreement.click");
1137
- } });
1138
- }
1139
- return e();
1140
- }, Xr = ({ isSelected: e, id: t, divId: n, themeColor: r, disabled: o = !1 }) => a("div", { "aria-checked": e, "aria-disabled": o, "aria-labelledby": `label-${t}`, className: "select-checkbox", id: n, role: "checkbox", style: { ...e ? { backgroundColor: r, borderColor: r, boxShadow: "none" } : {}, ...o ? { opacity: 0.5 } : {} }, tabIndex: o ? -1 : 0, children: e && a(Kr, {}) }), eo = (e, t) => {
1141
- const n = ee(0);
1142
- return () => {
1143
- if (e.current) {
1144
- const r = e.current;
1145
- r.style.height = "1px";
1146
- const o = r.scrollHeight + (r.offsetHeight - r.clientHeight), i = parseInt(window.getComputedStyle(r).getPropertyValue("max-height")), s = o <= i ? o : i;
1147
- n.current !== s && t(), n.current = s, r.style.height = `${s}px`;
1148
- }
1149
- };
1150
- }, Ae = ({ ariaLabel: e, border: t, choiceStyle: n = {}, label: r, isSelected: o, value: i, text: s, id: d, isRadio: l, useMobileStyling: u, error: p, allowTextEntry: c, noneOfTheAbove: f, promptText: g, disabled: m = !1, onUserInputChanged: b }) => {
1151
- const { styleNonce: v, viewDocument: w } = A((k) => ({ styleNonce: k.styleNonce, viewDocument: k.viewDocument })), [x, I] = z(!1);
1152
- Si(w, t, v);
1153
- const T = ({ isSelected: k, userText: N }) => {
1154
- b && b({ id: d, selected: k, value: i, userText: N, noneOfTheAbove: f });
1155
- }, C = (k) => {
1156
- m || (k.stopPropagation(), T({ isSelected: l || !o, userText: s }), I(!1));
1157
- }, E = () => {
1158
- x || I(!0);
1159
- }, _ = () => {
1160
- x && I(!1);
1161
- }, R = { onClick: (k) => C(k), onKeyPress: (k) => ((N) => {
1162
- m || N.key !== "Enter" && N.key !== " " || C(N);
1163
- })(k) };
1164
- "ontouchstart" in w.documentElement ? (R.onTouchStart = _, R.onTouchCancel = _, R.onTouchEnd = _) : (R.onMouseDown = E, R.onMouseLeave = _);
1165
- const L = l ? `radio-${d}` : `checkbox-${d}`, j = o || x ? [it] : [], h = [...p ? [to] : [], ...j, ...m ? ["ul-choice-disabled"] : []], y = r ? { "aria-labelledby": `label-${d}` } : { "aria-label": e };
1166
- return a("div", { className: H(oe("choice", u), ...h), id: `choice-div-${d}`, style: { ...n, ...p ? { borderColor: ze } : {}, ...m ? { opacity: 0.5, cursor: "not-allowed" } : {} }, ...m ? {} : R, "aria-disabled": m, children: [a("div", { className: H("choice-label-container"), children: [l ? a("div", { ...y, className: H("select-radio", ...j), id: L, role: "radio", tabIndex: 0 }) : a(Xr, { disabled: m, divId: L, id: d, isSelected: o, themeColor: t }), r && a("label", { className: H(oe("select-label", u)), htmlFor: L, id: `label-${d}`, children: r })] }), c && o && a("div", { className: H("choice-text-entry-container", ...j), children: a(Ci, { onTextChange: (k) => T({ isSelected: o, userText: k }), promptText: g || "Please specify", textValue: s, useMobileStyling: u }) })] });
1167
- }, Ci = ({ promptText: e, textValue: t, onTextChange: n, useMobileStyling: r }) => {
1168
- const o = ee(null), { update: i } = A((d) => ({ update: d.update })), s = eo(o, () => i());
1169
- return Y(() => (s(), o.current && o.current.focus(), () => {
1170
- i();
1171
- }), []), a("textarea", { "aria-label": e, "aria-multiline": "true", "aria-placeholder": e, className: H(oe("choice-text-input", r)), "data-gramm": "false", maxLength: 5e3, name: "text", onChange: (d) => {
1172
- s(), d.stopPropagation(), n(d.currentTarget.value);
1173
- }, onClick: (d) => {
1174
- d.stopPropagation();
1175
- }, onKeyPress: (d) => {
1176
- d.stopPropagation();
1177
- }, placeholder: e, ref: o, role: "textbox", rows: 1, value: t });
1178
- }, Vn = "ul-select-style-element", it = "ul-select-active-dynamic-style", to = "ul-select-error-dynamic-style", Si = (e, t, n) => {
1179
- let r = e.getElementById(Vn), o = !1;
1180
- r || (r = e.createElement("style"), o = !0), r.tagName.toLowerCase() === "style" && (r.id = Vn, n && (r.nonce = n), r.textContent = Ei(t), o && e.head.appendChild(r));
1181
- }, Ei = (e) => `
1182
- .${it} {
1183
- border-color: ${e};
1184
- }
1185
- .${it} .select-radio, .${it}.select-radio {
1186
- border: 6px solid ${e};
1187
- box-shadow: none;
1188
- }
1189
- .${to} {
1190
- border-color: ${ze};
1191
- }
1192
- `, ve = ({ children: e }) => a("div", { className: "sprig-question-body", children: e }), Ee = ({ children: e }) => {
1193
- const t = Jr();
1194
- return a("div", { className: H("sprig-question-footer-container", t ? "sprig-border-top" : null), children: e });
1195
- }, no = ({ logoOnly: e = !1, style: t = {} }) => a("svg", { alt: (e ? "Powered by " : "") + "Sprig", fill: "none", height: "15", style: { display: "block", ...t }, viewBox: e ? "79 0 31 15" : "0 0 112 15", width: e ? "35" : "112", xmlns: "http://www.w3.org/2000/svg", children: [!e && a("path", { d: "M0.648926 12.0181V2.8584H4.21631C6.0127 2.8584 7.25684 4.06445 7.25684 5.86084V5.87354C7.25684 7.66357 6.0127 8.88867 4.21631 8.88867H2.0708V12.0181H0.648926ZM3.86084 4.05811H2.0708V7.69531H3.86084C5.09229 7.69531 5.80957 7.02881 5.80957 5.87988V5.86719C5.80957 4.72461 5.09229 4.05811 3.86084 4.05811ZM11.6621 12.1514C9.63721 12.1514 8.39941 10.7993 8.39941 8.57764V8.56494C8.39941 6.34961 9.64355 4.99121 11.6621 4.99121C13.6743 4.99121 14.9185 6.34326 14.9185 8.56494V8.57764C14.9185 10.7993 13.6807 12.1514 11.6621 12.1514ZM11.6621 11.0024C12.8428 11.0024 13.5156 10.1011 13.5156 8.57764V8.56494C13.5156 7.03516 12.8428 6.14014 11.6621 6.14014C10.4751 6.14014 9.80859 7.03516 9.80859 8.56494V8.57764C9.80859 10.1074 10.4751 11.0024 11.6621 11.0024ZM17.6226 12.0181L15.7183 5.12451H17.1021L18.3398 10.4438H18.4414L19.8633 5.12451H21.1709L22.5928 10.4438H22.7007L23.9321 5.12451H25.2969L23.3989 12.0181H21.9834L20.5552 6.87646H20.4473L19.0254 12.0181H17.6226ZM29.334 12.1514C27.3154 12.1514 26.0967 10.7739 26.0967 8.59033V8.58398C26.0967 6.43213 27.3408 4.99121 29.2642 4.99121C31.1875 4.99121 32.3682 6.38135 32.3682 8.45068V8.93311H27.4805C27.5059 10.2534 28.2295 11.0215 29.3657 11.0215C30.248 11.0215 30.7749 10.5835 30.9399 10.228L30.9653 10.1772L32.292 10.1709L32.2793 10.228C32.0508 11.1357 31.0986 12.1514 29.334 12.1514ZM29.2705 6.12109C28.3311 6.12109 27.6201 6.76221 27.4995 7.94922H31.0034C30.8955 6.71777 30.2036 6.12109 29.2705 6.12109ZM34.0059 12.0181V5.12451H35.3833V6.16553H35.4849C35.7324 5.43555 36.3735 5.00391 37.2939 5.00391C37.5161 5.00391 37.7573 5.03564 37.897 5.06738V6.33691C37.6494 6.28613 37.4146 6.25439 37.1543 6.25439C36.1006 6.25439 35.3833 6.90186 35.3833 7.89844V12.0181H34.0059ZM41.9277 12.1514C39.9092 12.1514 38.6904 10.7739 38.6904 8.59033V8.58398C38.6904 6.43213 39.9346 4.99121 41.8579 4.99121C43.7812 4.99121 44.9619 6.38135 44.9619 8.45068V8.93311H40.0742C40.0996 10.2534 40.8232 11.0215 41.9595 11.0215C42.8418 11.0215 43.3687 10.5835 43.5337 10.228L43.5591 10.1772L44.8857 10.1709L44.873 10.228C44.6445 11.1357 43.6924 12.1514 41.9277 12.1514ZM41.8643 6.12109C40.9248 6.12109 40.2139 6.76221 40.0933 7.94922H43.5972C43.4893 6.71777 42.7974 6.12109 41.8643 6.12109ZM49.1133 12.1323C47.3804 12.1323 46.2568 10.7422 46.2568 8.57764V8.56494C46.2568 6.38135 47.3613 5.00391 49.1133 5.00391C50.0591 5.00391 50.8652 5.47363 51.2334 6.21631H51.3413V2.42041H52.7124V12.0181H51.3413V10.9326H51.2334C50.8335 11.688 50.0781 12.1323 49.1133 12.1323ZM49.5068 10.958C50.6558 10.958 51.3604 10.0503 51.3604 8.57764V8.56494C51.3604 7.09229 50.6494 6.18457 49.5068 6.18457C48.3516 6.18457 47.6597 7.08594 47.6597 8.56494V8.57764C47.6597 10.0566 48.3516 10.958 49.5068 10.958ZM61.98 12.1323C61.0151 12.1323 60.2598 11.688 59.8599 10.9326H59.7583V12.0181H58.3809V2.42041H59.7583V6.21631H59.8599C60.228 5.47363 61.0342 5.00391 61.98 5.00391C63.7319 5.00391 64.8364 6.38135 64.8364 8.56494V8.57764C64.8364 10.7422 63.7192 12.1323 61.98 12.1323ZM61.5928 10.958C62.7417 10.958 63.4336 10.0566 63.4336 8.57764V8.56494C63.4336 7.08594 62.7417 6.18457 61.5928 6.18457C60.4438 6.18457 59.7329 7.09229 59.7329 8.56494V8.57764C59.7329 10.0503 60.4438 10.958 61.5928 10.958ZM66.8867 14.4429C66.7153 14.4429 66.5122 14.4302 66.3345 14.4111V13.3257C66.4678 13.3447 66.6392 13.3511 66.7979 13.3511C67.439 13.3511 67.8262 13.0781 68.0293 12.3799L68.1309 12.0244L65.6299 5.12451H67.1152L68.8418 10.6343H68.9624L70.6826 5.12451H72.1299L69.5654 12.2847C68.9814 13.9287 68.2832 14.4429 66.8867 14.4429Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M81.1088 6.63629C79.6878 6.32154 78.9672 5.76865 78.9672 4.99369C78.9672 4.19299 79.736 3.5886 80.7556 3.5886C81.8066 3.5886 82.5995 4.25285 82.5995 5.13336V5.20352H84.0518V5.13336C84.0518 3.52424 82.6405 2.30774 80.7693 2.30774C79.8676 2.30774 79.0414 2.58451 78.4433 3.08655C78.1463 3.33144 77.9077 3.63818 77.7448 3.98479C77.5818 4.33141 77.4984 4.70934 77.5005 5.09153C77.4946 5.44197 77.5675 5.78934 77.714 6.10857C77.8605 6.42779 78.0769 6.71092 78.3475 6.93752C78.8512 7.37584 79.5659 7.70024 80.4709 7.90299C81.9949 8.23898 82.7676 8.81054 82.7676 9.60094C82.7676 10.4576 81.9258 11.1032 80.813 11.1032C79.6571 11.1032 78.7854 10.3856 78.7854 9.43424V9.36408H77.3318V9.43424C77.3318 11.1167 78.8219 12.3847 80.7973 12.3847C81.7421 12.3847 82.6093 12.0983 83.2393 11.5769C83.5519 11.3237 83.8034 11.0048 83.9753 10.6433C84.1472 10.2818 84.2352 9.88702 84.2329 9.48766C84.2329 8.05875 83.1833 7.09907 81.1088 6.63629Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M89.2394 4.68276C88.6963 4.67605 88.1596 4.79915 87.6751 5.04156C87.1905 5.28397 86.7725 5.63851 86.4566 6.07497V4.85204H85.0747V14.8479H86.4566V11.0356C86.7725 11.472 87.1906 11.8265 87.6751 12.0688C88.1596 12.3111 88.6963 12.434 89.2394 12.4272C91.3836 12.4272 93 10.7627 93 8.55495C93 6.34723 91.3836 4.68276 89.2394 4.68276ZM91.5608 8.84202C91.5057 9.41605 91.2512 9.95356 90.8406 10.3633C90.4299 10.773 89.8883 11.0296 89.3078 11.0896C88.5363 11.1669 87.8177 10.9461 87.2841 10.4692C86.7505 9.99222 86.4566 9.3106 86.4566 8.55495C86.4566 7.10159 87.5538 6.00546 89.0087 6.00546C89.7619 6.00546 90.4421 6.29124 90.9171 6.81002C91.407 7.34232 91.6357 8.06385 91.5608 8.84202Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M109.95 4.85407V6.06349C109.298 5.18298 108.292 4.68286 107.153 4.68286C105.017 4.68286 103.406 6.31709 103.406 8.48426C103.406 10.6514 105.017 12.285 107.153 12.285C108.296 12.285 109.303 11.79 109.95 10.9185V11.1046C109.95 12.6101 108.993 13.5826 107.513 13.5826C106.513 13.5826 105.68 13.1494 105.284 12.424L105.264 12.3867H103.838L103.871 12.48C104.112 13.1892 104.583 13.8001 105.211 14.2179C105.841 14.6324 106.637 14.8512 107.513 14.8512C108.637 14.8512 109.594 14.4972 110.28 13.8285C110.967 13.1597 111.332 12.2194 111.332 11.1213V4.85407H109.95ZM109.175 10.3502C108.588 10.905 107.752 11.138 106.879 10.9887C106.361 10.8984 105.886 10.6475 105.523 10.2725C105.16 9.89751 104.927 9.41787 104.859 8.90328C104.736 8.03757 104.999 7.21756 105.581 6.655C106.069 6.19093 106.723 5.93643 107.401 5.94699C107.565 5.94713 107.729 5.96026 107.891 5.98625C108.946 6.15489 109.781 7.01609 109.921 8.0852C110.039 8.96507 109.766 9.78958 109.175 10.3502Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M101.89 2.12378C101.63 2.06766 101.358 2.11486 101.133 2.25518C100.908 2.39551 100.747 2.61769 100.687 2.87371C100.626 3.12973 100.67 3.39902 100.809 3.62339C100.947 3.84775 101.17 4.00917 101.428 4.07275C101.503 4.08936 101.58 4.09778 101.657 4.09786C101.906 4.09824 102.146 4.0083 102.331 3.84518C102.517 3.68206 102.636 3.45714 102.664 3.21327C102.693 2.9694 102.63 2.72361 102.487 2.5227C102.344 2.32179 102.132 2.17981 101.89 2.12378Z", fill: "black", fillOpacity: "0.7" }), a("path", { d: "M100.967 10.934H99.7755C98.9285 10.934 98.4196 10.3644 98.4196 9.40982C98.4196 8.4791 98.8757 7.36945 99.8054 6.01778L99.8178 5.99976V5.61807L95.8571 5.06453C95.8585 4.90331 95.8162 4.74466 95.7346 4.60501C95.653 4.46536 95.5352 4.34979 95.3932 4.27027C95.0381 4.07718 94.6498 4.07717 94.3279 4.26383C94.1667 4.35799 94.035 4.4945 93.9476 4.65816C93.8602 4.82182 93.8205 5.00623 93.8328 5.19087C93.8452 5.37552 93.9092 5.55315 94.0176 5.70402C94.1261 5.85489 94.2748 5.97309 94.4472 6.04546L93.2151 12.258H94.5833L95.7196 6.35891L97.8593 6.7155C97.284 7.73439 96.9921 8.68442 96.9921 9.53919C96.9921 11.1168 97.9577 12.1498 99.5187 12.2496V12.258H102.346V4.87723H100.967V10.934Z", fill: "black", fillOpacity: "0.7" })] }), ro = ({ forceBrandedLogo: e, marketingUrlLink: t }) => a("div", { className: e ? "yellow-footer-logo" : "", style: { marginTop: "4px", marginBottom: "4px" }, children: a("a", { href: t, rel: "noreferrer", target: "_blank", children: a("div", { style: { display: "flex" }, children: [a(no, { logoOnly: !1 }), e && a(nn, { style: { display: "block", margin: "auto 0 auto 4px", transform: "rotateY(0deg) rotate(-45deg)" } })] }) }) }), oo = ({ marketingUrlLink: e }) => a("a", { dir: "ltr", href: e, rel: "noreferrer", target: "_blank", children: a("div", { className: "thank-you-card-link", children: [a("div", { className: "sprig-box-logo", children: a(no, { logoOnly: !0, style: { margin: "auto" } }) }), a("div", { children: a("p", { children: ["Capture insights about your own product", a(nn, { style: { display: "inline-flex", marginInlineStart: "4px", verticalAlign: "middle" } })] }) })] }) }), je = (e) => (e == null ? void 0 : e.buttonText) || "Next", rn = (e) => (e == null ? void 0 : e.skipButtonText) || "Skip", io = ({ marketingUrl: e, slugName: t, surveyId: n, forceBrandedLogo: r }) => `${e}?utm_source=survey_branding&utm_medium=website&utm_campaign=${t}&utm_content=${n}${r ? "&utm_term=poweredby_pill" : ""}`, Ii = ({ className: e, message: t, next: n, properties: r, questionId: o, type: i }) => {
1196
- const { useMobileStyling: s, border: d, isLongFormSurvey: l, focusedQuestionId: u } = A((y) => ({ useMobileStyling: y.useMobileStyling, border: y.border, isLongFormSurvey: le(y.studyType), focusedQuestionId: y.focusedQuestionId })), [p, c] = z(!1), [f, g] = z(""), [m, b] = z(!1), v = l && u === o, w = r == null ? void 0 : r.collectName, x = (r == null ? void 0 : r.nameLabelText) || "Full Name", I = (r == null ? void 0 : r.consentText) || "I agree to the stated conditions", T = (r == null ? void 0 : r.submitButtonText) || "Submit", C = !!f.trim(), E = p && (!w || C), _ = (y, k = !1) => {
1197
- y.preventDefault(), y.stopPropagation();
1198
- let N = null;
1199
- if (!k) {
1200
- if (!E) return void b(!0);
1201
- N = { submitted: !0 }, w && (N.name = f);
1202
- }
1203
- n({ value: N, questionId: o, type: i }, E);
1204
- }, R = (y) => {
1205
- y.preventDefault(), y.stopPropagation(), g(y.currentTarget.value);
1206
- }, L = (y) => {
1207
- y.currentTarget.style.borderColor = m && !C ? ze : d;
1208
- }, j = (y) => {
1209
- y.currentTarget.style.borderColor = m && !C ? ze : Vt;
1210
- }, h = () => a(Ee, { children: [a("div", { className: "sprig-stretch", children: [a(Ae, { allowTextEntry: !1, border: d, error: m && !p, id: "consent", isRadio: !1, isSelected: p, label: I, onUserInputChanged: ({ selected: y }) => {
1211
- y !== p && c(!p);
1212
- }, useMobileStyling: s }), w && a("input", { "aria-label": x, "aria-placeholder": x, className: H(oe("ul-consent-legal__name-input", s)), "data-gramm": "false", maxLength: 250, name: "name", onBlur: j, onFocus: L, onInput: R, placeholder: x, style: m && !C ? { borderColor: ze } : {}, tabIndex: 0, value: f })] }), a("div", { className: "ul-card__button-wrapper ul-card-vertical__button-wrapper", children: [a(ie, { className: E ? "" : "sprig-button-disabled", onClick: _, children: T }), r.required === !1 && !l && a("button", { className: "ul-card-skip__button", onClick: (y) => _(y, !0), children: rn(r) })] })] });
1213
- return a("div", { className: H(e, l && !v && "ul-card--unfocused", "ul-card__consent-legal", "fade-in-transition"), children: [a(ue, { message: t, properties: { questionHtml: r.questionHtml } }), a(ne, { children: [r != null && r.richTextBody ? a(ve, { children: a("div", { className: "ul-rich-text-body", dangerouslySetInnerHTML: r != null && r.richTextBody ? { __html: r.richTextBody } : void 0, id: "ul-card__consent-legal-body-container" }) }) : null, a(xe, { properties: r, defaultBody: h, embeddedType: "pdf" })] })] }, o);
1214
- }, ji = ({ icon: e, scaleLabelType: t, value: n, selectedValue: r }) => {
1215
- if (t === "smiley" && n === r) {
1216
- let o = 0;
1217
- return e.replace(/black/g, () => ++o == 1 ? "black" : "white");
1218
- }
1219
- return e;
1220
- }, Ti = ({ activeValue: e, border: t, icon: n, isPressed: r, onSubmit: o, range: i, scaleLabelType: s, selectedValue: d, setSelectedValue: l, setActiveValue: u, setIsPressed: p, useMobileStyling: c, value: f, viewDocument: g }) => {
1221
- const { isLongFormSurvey: m } = A((_) => ({ isLongFormSurvey: le(_.studyType) })), b = `option-${f}`, v = s === "number", w = s === "star", x = s === "smiley", I = v && f === e || f === d, [T, C] = (() => {
1222
- const _ = w && d !== null && f <= d;
1223
- return w && f <= e || x && f === e || _ || f === e || f === d ? [t, r || _ || f === d ? 1 : 0.3] : ["", 1];
1224
- })(), E = ge(() => {
1225
- const _ = { borderColor: I ? T : "", fillOpacity: I ? "" : C, zIndex: I ? 3 : "auto", color: d === f ? "#fff" : "" };
1226
- return v ? { ..._, backgroundColor: d === f ? T : "" } : { ..._, color: w || x || d === f ? T : "" };
1227
- }, [I, T, C, d, f, v, w, x]);
1228
- return a("button", { "aria-label": v ? void 0 : String(f), className: (() => {
1229
- switch (s) {
1230
- case "star":
1231
- return H(oe("likert-star", c), oe(`likert-star-${f}`, c));
1232
- case "smiley":
1233
- return H(oe("likert-smiley", c), oe(`likert-smiley-${f}`, c));
1234
- default:
1235
- return f === i ? H(oe("likert-number", c), oe(`likert-number-${f}`, c), oe("likert-last-option", c)) : H(oe("likert-number", c), oe(`likert-number-${f}`, c));
1236
- }
1237
- })(), dangerouslySetInnerHTML: { __html: ji({ icon: n, scaleLabelType: s, value: f, selectedValue: d }) }, id: b, onClick: (_) => {
1238
- m && (_.preventDefault(), _.stopPropagation(), l(f)), o();
1239
- }, onKeyDown: (_) => {
1240
- var j, h;
1241
- const R = g.querySelectorAll(`.likert-${s ?? "number"}`), L = f - 1;
1242
- _.key === "ArrowRight" ? (j = R[L + 1]) == null || j.focus() : _.key === "ArrowLeft" ? (h = R[L - 1]) == null || h.focus() : _.key !== "Enter" && _.key !== " " || (m && (_.preventDefault(), _.stopPropagation(), l(f)), o());
1243
- }, onPointerDown: () => p(!0), onPointerEnter: () => u(f), onPointerLeave: () => {
1244
- u(-1), p(!1);
1245
- }, style: E, tabIndex: 0 });
1246
- }, Li = ({ className: e, labels: t, message: n, next: r, properties: o, questionId: i, type: s }) => {
1247
- const { border: d, useMobileStyling: l, viewDocument: u, isLongFormSurvey: p, focusedQuestionId: c } = A((k) => ({ border: k.border, useMobileStyling: k.useMobileStyling, viewDocument: k.viewDocument, isLongFormSurvey: le(k.studyType), focusedQuestionId: k.focusedQuestionId })), [f, g] = z(-1), [m, b] = z(!1), [v, w] = z(null), x = p && c === i, I = t && t.left, T = t && t.right;
1248
- let C;
1249
- const { range: E, scaleLabelType: _, ratingIcons: R } = o;
1250
- E && (C = Number(E));
1251
- const L = C || 5, j = (k) => {
1252
- var N, D;
1253
- switch (_) {
1254
- case "star":
1255
- return (N = R[0]) == null ? void 0 : N.svg;
1256
- case "smiley":
1257
- return (D = R[k]) == null ? void 0 : D.svg;
1258
- default:
1259
- return String(k + 1);
1260
- }
1261
- }, h = [...Array(L)].map((k, N) => {
1262
- const D = N + 1;
1263
- return a(Ti, { activeValue: f, border: d, icon: j(N), isPressed: m, onSubmit: () => r({ value: D, questionId: i, type: s }, !0), range: L, scaleLabelType: _, selectedValue: v, setActiveValue: g, setIsPressed: b, setSelectedValue: w, useMobileStyling: l, value: D, viewDocument: u }, N);
1264
- }), y = (k) => {
1265
- k.preventDefault(), k.stopPropagation(), r({ value: null, questionId: i, type: s }, !0);
1266
- };
1267
- return a("form", { className: H(e, "ul-card--likert", "fade-in-transition", p && !x && "ul-card--unfocused"), children: [a(ue, { message: n, properties: o }), a(xe, { properties: o, defaultBody: () => a(ne, { children: [a(ve, { children: [a("div", { "aria-label": `Rating (1 - ${L})`, className: "ul-card--likert__numbers", role: "radiogroup", children: h }), a("div", { className: "ul-card--likert__labels", children: [a("span", { children: I }), a("span", { children: T })] })] }), !o.required && !p && a(Ee, { children: a("div", { className: "ul-vertical-centered-container", children: a(ie, { onClick: y, children: je(o) }) }) })] }) })] }, i);
1268
- }, so = (e) => e && (e.scrollHeight > e.offsetHeight ? e : so(e.parentElement)), Ni = (e) => {
1269
- if (!e || !((n) => n instanceof HTMLElement)(e)) return 0;
1270
- const t = getComputedStyle(e);
1271
- return parseFloat(t.marginTop) + parseFloat(t.marginBottom) + (parseFloat(t.borderTopWidth) + parseFloat(t.borderBottomWidth));
1272
- }, Pi = ({ columns: e, onSelect: t, options: n, selectedOptions: r }) => {
1273
- const o = ee([]), { border: i, useMobileStyling: s } = A((f) => ({ border: f.border, useMobileStyling: f.useMobileStyling })), d = n.findIndex((f) => r[f.id] === null), [l, u] = z(d), p = De((f, g) => {
1274
- t(f, g);
1275
- const m = l + 1, b = n[m];
1276
- if (b && r[b.id] === null) {
1277
- u(m);
1278
- const v = o.current[l];
1279
- if (v != null && v.firstElementChild) {
1280
- const w = so(v), x = v.firstElementChild, I = Ni(v) + x.clientHeight;
1281
- w == null || w.scrollTo(0, v.offsetTop + I);
1282
- }
1283
- }
1284
- }, [t, n, r, l]), c = De((f, g) => {
1285
- const m = l === f;
1286
- return a(yi, { animate: !0, header: g.label, isOpen: m, onClick: () => u(m && !window.UserLeap.isMobileSDK ? -1 : f), ref: (b) => {
1287
- b && (o.current[f] = b);
1288
- }, showHeaderCheck: r[g.id] !== null, children: a("div", { style: { paddingTop: "12px" }, children: e.map((b) => a(Ae, { allowTextEntry: !1, ariaLabel: `${g.label}-${b.label}`, border: i, error: !1, id: `${g.id}-${b.value}`, isRadio: !0, isSelected: r[g.id] === b.value, label: b.label, onUserInputChanged: () => p(g.id, b.value), useMobileStyling: s }, b.label)) }) }, g.id);
1289
- }, [i, e, l, p, r, s]);
1290
- return a("div", { children: n.map((f, g) => c(g, f)) });
1291
- }, Ri = ({ columns: e, onSelect: t, options: n, selectedOptions: r }) => {
1292
- const { border: o, useMobileStyling: i, isLongFormSurvey: s } = A((m) => ({ border: m.border, useMobileStyling: m.useMobileStyling, isLongFormSurvey: le(m.studyType) })), d = n.length, l = e.length, u = ee(null), [p, c] = z(!1), [f, g] = z(!1);
1293
- return Y(() => {
1294
- const m = u.current, b = new ResizeObserver((v) => {
1295
- window.requestAnimationFrame(() => {
1296
- m && (c(Math.round(v[0].contentRect.width) < m.scrollWidth), g(Math.round(v[0].contentRect.width) < m.scrollWidth));
1297
- });
1298
- });
1299
- return m && b.observe(m), () => {
1300
- m && b.unobserve(m);
1301
- };
1302
- }, []), a("div", { className: "ul-card--matrix_question_container", children: [a("div", { className: H("ul-card--matrix_container", p && "ul-matrix-scroll-gradient"), onScroll: () => {
1303
- (() => {
1304
- const m = u.current;
1305
- m && c(m.clientWidth + Math.abs(m.scrollLeft) < m.scrollWidth);
1306
- })();
1307
- }, ref: u, children: a("div", { className: H(s && "ul-card--matrix_grid_longform", "ul-card--matrix_grid"), style: `--numColumns: ${l}; --numRows: ${d + 1};`, children: [a("div", {}), " ", e.map((m) => a("div", { className: "ul-matrix-column-label", children: m.label }, m.label)), n.map((m) => a(ne, { children: [a("div", { "aria-label": m.label, className: "ul-matrix-row-label", children: m.label }, m.label), a("div", { className: "ul-matrix-row-options", role: "radiogroup", children: e.map((b, v) => a("div", { className: H("ul-matrix-option-wrapper", v === l - 1 && "ul-matrix-last-option"), children: a(Ae, { allowTextEntry: !1, ariaLabel: `${m.label}-${b.label}`, border: o, choiceStyle: { background: "transparent", border: "none", marginBottom: "0", padding: "0" }, error: !1, id: `${m.id}-${b.value}`, isRadio: !0, isSelected: r[m.id] === b.value, onUserInputChanged: () => t(m.id, b.value), useMobileStyling: i }) }, b.value)) })] }))] }) }), (p || f) && a("button", { className: f && !p ? "ul-matrix-scroll-arrow left" : "ul-matrix-scroll-arrow", onClick: f && !p ? (m) => {
1308
- m.preventDefault();
1309
- const b = u.current;
1310
- if (b) {
1311
- const v = getComputedStyle(b).direction === "rtl";
1312
- b.scrollTo({ left: v ? b.scrollWidth - b.clientWidth : 0, behavior: "smooth" });
1313
- }
1314
- } : (m) => {
1315
- m.preventDefault();
1316
- const b = u.current;
1317
- if (b) {
1318
- const v = getComputedStyle(b).direction === "rtl";
1319
- b.scrollTo({ left: v ? b.clientWidth - b.scrollWidth : b.scrollWidth, behavior: "smooth" });
1320
- }
1321
- }, children: a(f && !p ? Di : Mi, {}) })] });
1322
- }, Di = () => a("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: a("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" }) }), Mi = () => a("svg", { fill: "currentColor", height: "32", viewBox: "0 0 256 256", width: "32", xmlns: "http://www.w3.org/2000/svg", children: a("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" }) }), Oi = ({ className: e, message: t, next: n, options: r, properties: o, questionId: i, type: s, showIndividualSubmit: d = !1, onSubmitButtonClick: l }) => {
1323
- const { useMobileStyling: u, isLongFormSurvey: p, focusedQuestionId: c, setFocusedQuestionId: f } = A((_) => ({ useMobileStyling: _.useMobileStyling, isLongFormSurvey: le(_.studyType), focusedQuestionId: _.focusedQuestionId, setFocusedQuestionId: _.setFocusedQuestionId })), g = o.matrixColumn, m = o.required, b = p && c === i, v = (_) => {
1324
- _.preventDefault(), _.stopPropagation(), n({ value: x, questionId: i, type: s }, !0), l && l();
1325
- }, w = r.reduce((_, R) => (_[R.id] = null, _), {}), [x, I] = z(w), T = (_) => m && Object.values(_).every((R) => R == null), C = (_, R) => {
1326
- p && n({ value: { ...x, [_]: R }, questionId: i, type: s }, !T({ ...x, [_]: R })), I((L) => ({ ...L, [_]: R }));
1327
- }, E = o.displayMatrixAsAccordion || u;
1328
- return a("form", { className: H(e, !p && "ul-card__matrix", "fade-in-transition", p && !b && "ul-card--unfocused"), id: "text-form", onClick: () => {
1329
- b && f(i);
1330
- }, onSubmit: v, children: [a(ue, { message: t, properties: o }), a(xe, { properties: o, defaultBody: () => a(ne, { children: [a(ve, { children: [a(E ? Pi : Ri, { columns: g, onSelect: C, options: r, selectedOptions: x }), d && a(ht, { handleSubmit: v, isSubmitDisabled: T(x) })] }), !p && a(Ee, { children: a("div", { className: "ul-card__button-wrapper", children: a(ie, { disabled: T(x), children: je(o) }) }) })] }) })] }, i);
1331
- };
1332
- var ao = ((e) => (e.CONTINUE = "CONTINUE", e.EXTERNAL = "EXTERNAL", e.NO_BUTTON = "NO_BUTTON", e))(ao || {}), $e = ((e) => (e.Unlimited = "Unlimited", e.Maximum = "Maximum", e.Range = "Range", e))($e || {});
1333
- const Ui = ({ options: e, selectItem: t, selectedOptions: n, showCheckbox: r, disabledOptions: o, dropdownFooter: i }) => {
1334
- const { themeColor: s } = A((d) => ({ doc: d.viewDocument, themeColor: d.border }));
1335
- return a("div", { className: "select-list", children: [e.map((d) => {
1336
- return a("div", { "aria-disabled": o == null ? void 0 : o.includes(d), className: H("select-option", o != null && o.includes(d) ? "ul-choice-disabled" : ""), onClick: (u) => {
1337
- o != null && o.includes(d) || (t(d), u.stopPropagation());
1338
- }, role: "option", style: { ...o != null && o.includes(d) ? { opacity: 0.5, cursor: "not-allowed" } : {} }, children: [r && a(Xr, { divId: (l = d.id, `checkbox-div-${l}`), id: d.id, isSelected: n.includes(d), themeColor: s }), d.label] }, d.id);
1339
- var l;
1340
- }), i] });
1341
- }, Hi = ({ isMultiSelect: e = !1, multiselectText: t = "choices selected", onChange: n, options: r, placeholderText: o, value: i, disabledOptions: s = [], dropdownFooter: d }) => {
1342
- const [l, u] = z(!1), { viewDocument: p, update: c } = A((m) => ({ viewDocument: m.viewDocument, update: m.update })), f = () => {
1343
- u(!l), c();
1344
- };
1345
- Y(() => {
1346
- var b;
1347
- const m = (v) => {
1348
- const w = v.target;
1349
- (w == null ? void 0 : w.closest(".select-option.ul-choice-disabled")) || (u(!1), c());
1350
- };
1351
- p.addEventListener("click", m);
1352
- try {
1353
- (b = window.parent) == null || b.addEventListener("click", m);
1354
- } catch {
1355
- window.addEventListener("click", m);
1356
- }
1357
- return () => {
1358
- var v;
1359
- p.removeEventListener("click", m);
1360
- try {
1361
- (v = window.parent) == null || v.removeEventListener("click", m);
1362
- } catch {
1363
- window.removeEventListener("click", m);
1364
- }
1365
- };
1366
- }, [p, c]);
1367
- const g = i.length === 0 ? ["select-button-placeholder"] : [];
1368
- return a(ne, { children: [a("button", { "aria-label": "choice dropdown button", className: H("select-button", ...g), onClick: (m) => {
1369
- m.stopPropagation(), f();
1370
- }, type: "button", children: [a("span", { children: i.length === 0 ? o : i.length === 1 ? i[0].label : `${i.length} ${t}` }), a(Yr, {})] }), l && a(Ui, { disabledOptions: s, dropdownFooter: d, options: r, selectedOptions: i, selectItem: (m) => {
1371
- var w;
1372
- const b = i.some((x) => x.id === m.id), v = i.some((x) => {
1373
- var I;
1374
- return (I = x.optionProperties) == null ? void 0 : I.noneOfTheAbove;
1375
- });
1376
- (w = m.optionProperties) != null && w.noneOfTheAbove && !b ? n([m]) : e ? n(b ? i.filter((x) => x.id !== m.id) : v ? [m] : [...i, m]) : b || n([m]), e || f();
1377
- }, showCheckbox: e })] });
1378
- }, lo = ({ className: e, message: t, onSubmit: n, options: r = [], properties: o, questionId: i, type: s, showIndividualSubmit: d = !1, onSubmitButtonClick: l }) => {
1379
- const { border: u, useMobileStyling: p, isLongFormSurvey: c, focusedQuestionId: f, setFocusedQuestionId: g } = A((S) => ({ border: S.border, useMobileStyling: S.useMobileStyling, isLongFormSurvey: le(S.studyType), focusedQuestionId: S.focusedQuestionId, setFocusedQuestionId: S.setFocusedQuestionId })), m = c && f === i, b = r.reduce((S, P) => (S[P.id] = { isSelected: !1 }, S), {}), [v, w] = z(b), x = s === "multiplechoice", I = o.required, T = r.find((S) => {
1380
- var P;
1381
- return (P = S.optionProperties) == null ? void 0 : P.noneOfTheAbove;
1382
- }), C = (S) => Object.entries(S).some(([P, O]) => {
1383
- var $;
1384
- const F = r.find((Q) => `${Q.id}` === P), B = O.userText === void 0 || O.userText.trim() === "";
1385
- return (($ = F == null ? void 0 : F.optionProperties) == null ? void 0 : $.allowsTextEntry) && B && O.isSelected;
1386
- }), E = (S) => Object.values(S).filter((P) => P.isSelected).length, _ = o.minSelect && o.minSelect > 0 && o.maxSelectMode === $e.Range && E(v) < o.minSelect && (I || E(v) > 0), R = (S) => C(S) || I && !E(S) || !((P) => {
1387
- const { minSelect: O = 0, maxSelect: F = 1 / 0, maxSelectMode: B } = o, $ = E(P);
1388
- switch (B) {
1389
- case $e.Maximum:
1390
- return $ <= F;
1391
- case $e.Range:
1392
- return $ === 0 || $ >= O;
1393
- default:
1394
- return !0;
1395
- }
1396
- })(S), L = Object.entries(v).some(([S, P]) => {
1397
- var O, F;
1398
- return P.isSelected && ((F = (O = r.find((B) => `${B.id}` === S)) == null ? void 0 : O.optionProperties) == null ? void 0 : F.allowsTextEntry);
1399
- }), j = d && (!x || L), h = (S) => {
1400
- D(S.id, S.selected, S.userText, S.noneOfTheAbove), S.selected && c && !x && !m && g(i);
1401
- }, y = (S) => {
1402
- var P;
1403
- return (o == null ? void 0 : o.maxSelectMode) !== $e.Unlimited && E(v) === (o == null ? void 0 : o.maxSelect) && !((P = v[S]) != null && P.isSelected);
1404
- }, k = r.map(({ id: S, label: P, value: O, optionProperties: F }) => {
1405
- var J, pe;
1406
- const B = `${S}`, { allowsTextEntry: $, noneOfTheAbove: Q } = { allowsTextEntry: !1, noneOfTheAbove: !1, ...F };
1407
- return a(Ae, { allowTextEntry: $, border: u, disabled: y(B), error: (K = v, C(K)), id: B, isRadio: x, isSelected: !!((J = v[B]) != null && J.isSelected), label: P, noneOfTheAbove: Q, onUserInputChanged: h, promptText: "Please specify", text: (pe = v[S]) == null ? void 0 : pe.userText, useMobileStyling: p, value: O }, B);
1408
- var K;
1409
- }), N = (S) => {
1410
- S.preventDefault(), S.stopPropagation(), n(v, !0), l && l();
1411
- }, D = (S, P, O, F) => {
1412
- const B = Object.assign({}, v);
1413
- if ((x || F) && P) for (const K of Object.values(B)) K.isSelected = !1, delete K.userText;
1414
- else T && !F && v[T.id].isSelected && (B[T.id].isSelected = !1);
1415
- B[S] = { isSelected: P, userText: O };
1416
- const $ = x && Object.entries(B).some(([K, J]) => {
1417
- var pe, Xe;
1418
- return J.isSelected && ((Xe = (pe = r.find((vt) => `${vt.id}` === K)) == null ? void 0 : pe.optionProperties) == null ? void 0 : Xe.allowsTextEntry);
1419
- }), Q = !R(B);
1420
- c && (n(B, Q), x && !$ && Q && l && l()), w(B);
1421
- };
1422
- return a("form", { className: H(e, "ul-card--multiple", "fade-in-transition", c && !m && "ul-card--unfocused"), id: "text-form", onClick: s === "multipleselect" ? () => {
1423
- c && f !== i && s === "multipleselect" && g(i);
1424
- } : void 0, onSubmit: N, children: [a(ue, { message: t, properties: o }), a(xe, { properties: o, defaultBody: () => a(ne, { children: [a(ve, { children: [o.isDropdown ? a(Hi, { disabledOptions: r.filter((S) => y(S.id)), dropdownFooter: _ ? a("div", { className: "ul-card__min-select-counter", style: { marginLeft: "16px" }, children: [E(v), "/", o.minSelect] }) : void 0, isMultiSelect: !x, multiselectText: o.dropdownMultiselectedText ?? "choices selected", onChange: (S) => {
1425
- const P = { ...v };
1426
- for (const O of r) S.includes(O) ? P[O.id].isSelected = !0 : P[O.id].isSelected = !1;
1427
- c && n(P, !R(P)), w(P);
1428
- }, options: r, placeholderText: o.dropdownPlaceholderText ?? (x ? "Select choice" : "Select choice(s)"), value: r.filter((S) => v[S.id].isSelected) }) : a("div", { className: H(oe("ul-card__choices", p)), role: x ? "radiogroup" : "group", children: [k, !!_ && a("div", { className: "ul-card__min-select-counter", children: [E(v), "/", o.minSelect] })] }), j && a(ht, { handleSubmit: N, isSubmitDisabled: R(v) })] }), !c && a(Ee, { children: a("div", { className: "ul-card__button-wrapper", children: a(ie, { disabled: R(v), onClick: N, children: je(o) }) }) })] }) })] }, i);
1429
- }, qi = (e) => {
1430
- const { questionId: t, type: n, next: r, options: o } = e, { setFocusedQuestionId: i } = A((s) => ({ setFocusedQuestionId: s.setFocusedQuestionId }));
1431
- return a(lo, { ...e, onSubmit: (s, d) => {
1432
- var g;
1433
- const l = Object.entries(s).find(([, m]) => m.isSelected) || [void 0, void 0], [u, p] = l, c = o.find((m) => `${m.id}` === u);
1434
- !((g = c == null ? void 0 : c.optionProperties) != null && g.allowsTextEntry) || p != null && p.userText && p.userText.trim() !== "" || i(t);
1435
- const f = p != null && p.userText ? { [u]: { userText: p.userText } } : null;
1436
- r({ value: c && u ? { [u]: c.value } : {}, secondaryValue: f, questionId: t, type: n }, d);
1437
- } });
1438
- }, Bi = (e) => {
1439
- const { questionId: t, type: n, next: r } = e;
1440
- return a(lo, { ...e, onSubmit: (o, i) => {
1441
- const s = Object.entries(o).reduce((l, [u, p]) => (l[u] = p.isSelected, l), {}), d = Object.entries(o).reduce((l, [u, p]) => {
1442
- if (!p.userText) return l;
1443
- const c = l || {};
1444
- return c[u] = { userText: p.userText }, c;
1445
- }, null);
1446
- r({ value: s, secondaryValue: d, questionId: t, type: n }, i);
1447
- } });
1448
- }, Ai = ({ className: e, labels: t, message: n, properties: r, next: o, questionId: i, type: s }) => {
1449
- const [d, l] = z(null), { border: u, useMobileStyling: p, viewDocument: c, isLongFormSurvey: f, focusedQuestionId: g } = A((I) => ({ border: I.border, useMobileStyling: I.useMobileStyling, viewDocument: I.viewDocument, isLongFormSurvey: le(I.studyType), focusedQuestionId: I.focusedQuestionId })), m = f && g === i, b = t && t.left, v = t && t.right, w = [...Array(11)].map((I, T) => a("button", { className: H(oe("nps-number", p), oe(`nps-number-${T}`, p)), id: `option-${T}`, onClick: (C) => {
1450
- f && (C.preventDefault(), C.stopPropagation(), l(T)), o({ value: T, questionId: i, type: s }, !0);
1451
- }, onKeyDown: (C) => {
1452
- var _, R;
1453
- const E = c.querySelectorAll("button.nps-number");
1454
- C.key === "ArrowRight" ? (_ = E[T + 1]) == null || _.focus() : C.key === "ArrowLeft" ? (R = E[T - 1]) == null || R.focus() : C.key !== "Enter" && C.key !== " " || (f && (C.preventDefault(), C.stopPropagation(), l(T)), o({ value: T, questionId: i, type: s }, !0));
1455
- }, onPointerDown: (C) => {
1456
- C.currentTarget.style.zIndex = "2", C.currentTarget.style.borderColor = u;
1457
- }, onPointerLeave: (C) => {
1458
- C.currentTarget.style.zIndex = "auto", C.currentTarget.style.borderColor = Vt;
1459
- }, style: d === T ? { backgroundColor: u, color: "#fff" } : void 0, tabIndex: 0, children: T }, T)), x = (I) => {
1460
- I.preventDefault(), I.stopPropagation(), o({ value: null, questionId: i, type: s }, !0);
1461
- };
1462
- return a("form", { className: H(e, "ul-card--nps", "fade-in-transition", f && !m && "ul-card--unfocused"), children: [a(ue, { message: n, properties: r }), a(xe, { properties: r, defaultBody: () => a(ne, { children: [a(ve, { children: [a("div", { className: "ul-card--nps__numbers", children: w }), a("div", { className: "ul-card--nps__labels", children: [a("span", { children: b }), a("span", { children: v })] })] }), !r.required && !f && a(Ee, { children: a("div", { className: "ul-vertical-centered-container", children: a(ie, { onClick: x, children: je(r) }) }) })] }) })] }, i);
1463
- }, Fi = ({ className: e, message: t, next: n, properties: r, questionId: o, type: i, showIndividualSubmit: s = !1, onSubmitButtonClick: d }) => {
1464
- const { border: l, useMobileStyling: u, update: p, isLongFormSurvey: c, focusedQuestionId: f, setFocusedQuestionId: g, isPreview: m } = A((h) => ({ border: h.border, useMobileStyling: h.useMobileStyling, update: h.update, isLongFormSurvey: le(h.studyType), focusedQuestionId: h.focusedQuestionId, setFocusedQuestionId: h.setFocusedQuestionId, isPreview: h.isPreview })), [b, v] = z(""), w = ee(null), x = c && f === o;
1465
- Y(() => {
1466
- var h, y;
1467
- c && !m && (x ? (h = w.current) == null || h.focus() : (y = w.current) == null || y.blur());
1468
- }, [c, x, m]);
1469
- const I = b.trim(), T = r.required === !0 && !I, C = eo(w, () => p()), E = (h) => {
1470
- const { value: y } = h.currentTarget;
1471
- if (C(), h.preventDefault(), h.stopPropagation(), v(y), c) {
1472
- const k = y.trim().length > 0;
1473
- n({ value: y, questionId: o, type: i }, k);
1474
- }
1475
- }, _ = (h) => {
1476
- h.preventDefault(), h.stopPropagation(), n({ value: b, questionId: o, type: i }, !r.required || I.length > 0), d && d();
1477
- }, R = r && r.openTextPlaceholder ? r.openTextPlaceholder : "", L = (h) => {
1478
- h.currentTarget.style.borderColor = l, g(o);
1479
- }, j = (h) => {
1480
- h.currentTarget.style.borderColor = Vt;
1481
- };
1482
- return a("form", { className: H(e, "ul-card-text", "fade-in-transition", c && !x && "ul-card--unfocused"), id: "text-form", onClick: () => {
1483
- c && f !== o && g(o);
1484
- }, children: [a(ue, { message: t, properties: r }), a(xe, { defaultBody: () => a("div", { className: "ul-card-text", children: a(ve, { children: [a("div", { className: "ul-card-text__container", children: a("textarea", { "aria-describedby": "ul-caption", "aria-labelledby": "ul-question", "aria-multiline": "true", "aria-placeholder": R, className: H(oe("ul-card-text__input", u)), "data-gramm": "false", maxLength: 5e3, name: "text", onBlur: j, onChange: E, onFocus: L, placeholder: R, ref: w, role: "textbox", tabIndex: 0 }) }), r.footerHtml && a("div", { className: "footer", dangerouslySetInnerHTML: { __html: r.footerHtml } }), s && a(ht, { handleSubmit: _, isSubmitDisabled: T }), a(Ee, { children: !c && a(ie, { disabled: T, onClick: _, children: je(r) }) })] }) }), properties: r })] }, o);
1485
- }, Vi = ({ className: e, labels: t, message: n, next: r, properties: o, questionId: i, type: s, onSubmitButtonClick: d, options: l, showIndividualSubmit: u = !1 }) => {
1486
- const p = ee(null), c = ee(0), f = ee(0), g = ee(null), m = ee(!1), b = ee([]), [v, w] = z(() => (o == null ? void 0 : o.required) === !0), [x, I] = z(() => l.map((q) => ({ ...q, rank: null }))), T = ge(() => Array.from({ length: l.length }, (q, G) => G + 1), [l.length]), { isLongFormSurvey: C, focusedQuestionId: E, setFocusedQuestionId: _, useMobileStyling: R, isPreview: L, headers: j } = A((q) => ({ useMobileStyling: q.useMobileStyling, isLongFormSurvey: le(q.studyType), focusedQuestionId: q.focusedQuestionId, setFocusedQuestionId: q.setFocusedQuestionId, isPreview: q.isPreview, headers: q.headers })), h = R && !L, y = Ro(j) && h, k = C && E === i, N = (q) => {
1487
- q.preventDefault(), $(x), d && d();
1488
- }, D = (q, G) => {
1489
- for (let X = 0; X < b.current.length; X++) {
1490
- const W = b.current[X];
1491
- if (!W || W === g.current) continue;
1492
- const ae = W.getBoundingClientRect();
1493
- if (q >= ae.left && q <= ae.right && G >= ae.top && G <= ae.bottom) return { element: W, index: X };
1494
- }
1495
- return null;
1496
- }, S = (q) => (G) => {
1497
- if (!h) return;
1498
- G.preventDefault(), G.stopPropagation(), m.current = !0, p.current = q;
1499
- const X = G.touches[0];
1500
- c.current = X.clientY, f.current = X.clientY;
1501
- const W = G.currentTarget.closest(".ul-card-rank__option");
1502
- W && (g.current = W, W.classList.add("is-dragging"));
1503
- }, P = (q) => {
1504
- if (!h || !m.current || p.current === null) return;
1505
- q.preventDefault(), q.stopPropagation();
1506
- const G = q.touches[0];
1507
- f.current = G.clientY;
1508
- const X = f.current - c.current;
1509
- g.current && (g.current.style.transform = `translateY(${X}px)`, g.current.style.zIndex = "1000"), b.current.forEach((ae) => {
1510
- ae && ae !== g.current && ae.classList.remove("is-drop-target");
1511
- });
1512
- const W = D(G.clientX, G.clientY);
1513
- W && W.element.classList.add("is-drop-target");
1514
- }, O = (q) => {
1515
- if (!h || !m.current || p.current === null) return;
1516
- q.preventDefault(), q.stopPropagation();
1517
- const G = q.changedTouches[0], X = D(G.clientX, G.clientY);
1518
- g.current && (g.current.style.transform = "", g.current.style.zIndex = "", g.current.classList.remove("is-dragging")), b.current.forEach((W) => {
1519
- W && W.classList.remove("is-drop-target");
1520
- }), X && X.index !== p.current && F(p.current, X.index), p.current = null, g.current = null, m.current = !1;
1521
- }, F = (q, G) => {
1522
- I((X) => {
1523
- const W = X.map((Te) => ({ ...Te })), [ae] = W.splice(q, 1);
1524
- return W.splice(G, 0, ae), W.forEach((Te, re) => {
1525
- Te.rank = re + 1;
1526
- }), Q(W), W;
1527
- });
1528
- }, B = (q) => {
1529
- q.preventDefault(), q.dataTransfer && (q.dataTransfer.dropEffect = "move");
1530
- }, $ = (q) => {
1531
- const G = {};
1532
- q.reduce((X, W) => (X[W.id] = W.rank, X), G), r({ value: G, questionId: i, type: s }, !0);
1533
- }, Q = (q) => {
1534
- w(!1), C && $(q);
1535
- }, { left: K, right: J } = t, pe = l.length, Xe = (q) => {
1536
- q.preventDefault(), q.currentTarget.classList.add("is-drop-target");
1537
- }, vt = (q) => {
1538
- q.currentTarget.classList.remove("is-drop-target");
1539
- }, jo = (q) => {
1540
- p.current = null, q.currentTarget.classList.remove("is-dragging");
1541
- };
1542
- return a("form", { className: H(e, "ul-card-rank", "fade-in-transition", C && !k && "ul-card--unfocused"), onClick: () => {
1543
- C && E !== i && _(i);
1544
- }, onSubmit: N, children: [a(ue, { message: n, properties: o }), a(xe, { properties: o, defaultBody: () => a(ne, { children: [a(ve, { children: [a("div", { className: "ul-card--rank__question-inner-container", children: [a("div", { className: "ul-card-rank__labels", children: a("span", { children: ["1 - ", K] }) }), a("ol", { className: "ul-card-rank__list", onDragOver: B, children: x.map(({ id: q, label: G, rank: X }, W) => {
1545
- return a("li", { className: "ul-card-rank__option", draggable: !h, onDragEnd: h ? void 0 : jo, onDragEnter: h ? void 0 : Xe, onDragLeave: h ? void 0 : vt, onDragStart: h ? void 0 : (Te = W, (re) => {
1546
- p.current = Te, re.dataTransfer && (re.dataTransfer.effectAllowed = "move", re.dataTransfer.setData("text/plain", String(Te)), re.currentTarget.classList.add("is-dragging"));
1547
- }), onDrop: h ? void 0 : (ae = W, (re) => {
1548
- var et, Fe;
1549
- re.preventDefault(), re.currentTarget.classList.remove("is-drop-target");
1550
- const Le = p.current;
1551
- p.current = null, (Fe = (et = re.currentTarget.closest(".ul-card-rank__list")) == null ? void 0 : et.querySelector(".is-dragging")) == null || Fe.classList.remove("is-dragging"), Le != null && Le !== ae && F(Le, ae);
1552
- }), ref: (re) => b.current[W] = re, children: [a("select", { "aria-label": `Rank for ${G}`, className: H("ul-card-rank__select", X == null && "ul-card-rank__select--placeholder"), name: `rank[${q}]`, onChange: (re) => ((Le, et) => {
1553
- I((Fe) => {
1554
- const Ve = parseInt(et), be = Fe.map((te) => ({ ...te }));
1555
- be.some((te) => te.rank == null) && be.forEach((te, _t) => te.rank = _t + 1);
1556
- const bt = be.findIndex((te) => te.id === Le);
1557
- if (bt === -1) return Fe;
1558
- const tt = be[bt].rank;
1559
- return Ve < tt ? be.forEach((te) => {
1560
- te.id !== Le && te.rank >= Ve && te.rank < tt && (te.rank = te.rank + 1);
1561
- }) : Ve > tt && be.forEach((te) => {
1562
- te.id !== Le && te.rank > tt && te.rank <= Ve && (te.rank = te.rank - 1);
1563
- }), be[bt].rank = Ve, be.sort((te, _t) => te.rank - _t.rank), Q(be), be;
1564
- });
1565
- })(q, re.currentTarget.value), value: X ?? "", children: [X == null && a("option", { className: "ul-card-rank__select-option", disabled: !0, value: "", children: "-" }), T.map((re) => a("option", { className: "ul-card-rank__select-option", value: re, children: re }, re))] }), a("span", { children: G }), y && a("button", { "aria-label": `Drag ${G} to reorder`, className: "ul-card-rank__drag-btn", onTouchEnd: h ? O : void 0, onTouchMove: h ? P : void 0, onTouchStart: h ? S(W) : void 0, title: "Drag to reorder", type: "button", children: a("svg", { fill: "none", height: "17", viewBox: "0 0 16 17", width: "16", xmlns: "http://www.w3.org/2000/svg", children: a("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" }) }) })] }, q);
1566
- var ae, Te;
1567
- }) }), a("div", { className: "ul-card-rank__labels", children: a("span", { children: [pe, " - ", J] }) })] }), u && a(ht, { handleSubmit: N, isSubmitDisabled: v })] }), !C && a(Ee, { children: a("div", { className: "ul-card__button-wrapper", children: a(ie, { disabled: v, children: je(o) }) }) })] }) })] }, i);
1568
- }, $i = /* @__PURE__ */ new Set(["open", "matrix", "multipleselect", "multiplechoice", "rankorder"]), $n = ({ cardInstance: e, moveToNextQuestion: t, showIndividualSubmit: n, submitQuestion: r, updateCardValues: o }) => {
1569
- const { isLongFormSurvey: i } = A((f) => ({ isLongFormSurvey: le(f.studyType) }));
1570
- if (!e) return null;
1571
- const { name: s, type: d, props: l } = e, u = n && $i.has(d), p = { className: "ul-card", next: (f, g, m = !0) => r(f, g && m), questionId: s, type: d, showIndividualSubmit: n, ...u ? { next: (f, g) => {
1572
- o(f.questionId, f, g ?? !0);
1573
- }, onSubmitButtonClick: () => t(s) } : {} }, c = (() => {
1574
- switch (d) {
1575
- case "consentlegal":
1576
- return a(Ii, { ...p, ...l });
1577
- case "likert":
1578
- return a(Li, { ...p, ...l });
1579
- case "matrix":
1580
- return a(Oi, { ...p, ...l });
1581
- case "maxdiff":
1582
- return a(bs, { ...p, ...l });
1583
- case "multiplechoice":
1584
- return a(qi, { ...p, ...l });
1585
- case "multipleselect":
1586
- return a(Bi, { ...p, ...l });
1587
- case "nps":
1588
- return a(Ai, { ...p, ...l });
1589
- case "open":
1590
- return a(Fi, { ...p, ...l });
1591
- case "rankorder":
1592
- return a(Vi, { ...p, ...l });
1593
- case "recordedtask":
1594
- return a(is, { ...p, ...l });
1595
- case "texturlprompt":
1596
- return a(as, { ...p, ...l });
1597
- case "thanks":
1598
- return a(ls, { ...p, ...l });
1599
- case "uploading":
1600
- return a(gs, { ...p, ...l });
1601
- case "videovoice":
1602
- return a(fs, { ...p, ...l });
1603
- default:
1604
- return null;
1605
- }
1606
- })();
1607
- return c ? i ? a("div", { className: "ul-card-scroll-wrapper", children: c }, s) : c : null;
1608
- }, zi = ({ isSubmitDisabled: e = !1, onSubmit: t, buttonText: n }) => {
1609
- var g;
1610
- const { cards: r, forceBrandedLogo: o, index: i, marketingUrl: s, showSurveyBrand: d, slugName: l, surveyId: u, useMobileStyling: p } = A((m) => ({ cards: m.cards, forceBrandedLogo: m.forceBrandedLogo, index: m.index, marketingUrl: m.marketingUrl, showSurveyBrand: m.showSurveyBrand, slugName: m.slugName, surveyId: m.surveyId, useMobileStyling: m.useMobileStyling })), c = ((g = r[i]) == null ? void 0 : g.type) === "thanks", f = io({ marketingUrl: s, slugName: l, surveyId: u, forceBrandedLogo: o });
1611
- return a("footer", { className: H("long-form-question-footer-container", p && "long-form-question-footer-container--mobile", c && "long-form-question-footer-container-center"), children: [c && o ? a(oo, { marketingUrlLink: f }) : a("div", { className: "long-form-question-footer-container-logo", children: d ? a(ro, { forceBrandedLogo: o, marketingUrlLink: f }) : null }), !c && a("div", { className: H("ul-card__button-wrapper", "ul-card-vertical__button-wrapper", "long-form-question-footer-container-actions"), children: a(ie, { className: H("long-form-button", e && "sprig-button-disabled"), disabled: e, onClick: t, children: a("span", { className: "long-form-button-text-container", children: n ?? a(nn, { stroke: "white" }) }) }) })] });
1612
- }, co = Qt(void 0), Qi = ({ value: e, children: t }) => a(co.Provider, { value: e, children: t }), Wi = /<piped-value\b([^>]*)>.*?<\/piped-value>/gis, zn = ["questionHtml", "captionHtml", "footerHtml", "richTextBody"], uo = (e) => !!e.props && typeof e.props == "object" && "properties" in e.props, Et = (e) => !!e.props && typeof e.props == "object" && "options" in e.props && Array.isArray(e.props.options), Qn = (e) => ["string", "number"].includes(typeof e), Wn = (e) => e.length === 0 ? "" : e.length === 1 ? e[0] : e.join(", "), Zi = (e) => {
1613
- var n, r;
1614
- const t = ((o) => o != null && typeof o == "object" && "value" in o)(e) ? e.value : void 0;
1615
- if (t != null) {
1616
- if (e.type === "multipleselect" && Et(e) && ((o) => !!o && typeof o == "object" && !Array.isArray(o))(t)) {
1617
- const o = e.secondaryValue ?? null, i = e.props.options.filter((s) => t[String(s.id)] === !0).map((s) => {
1618
- var d;
1619
- return s.label + ((d = o == null ? void 0 : o[String(s.id)]) != null && d.userText ? `: ${o[String(s.id)].userText}` : "");
1620
- });
1621
- return i.length ? Wn(i) : "No options selected";
1622
- }
1623
- if (e.type === "multiplechoice" && typeof t == "object" && t !== null) {
1624
- const o = e.secondaryValue ?? null, i = Object.keys(t)[0];
1625
- if (i) {
1626
- const s = e.props.options.find((d) => String(d.id) === i);
1627
- return (s == null ? void 0 : s.label) + ((n = o == null ? void 0 : o[i]) != null && n.userText ? `: ${(r = o == null ? void 0 : o[i]) == null ? void 0 : r.userText}` : "");
1628
- }
1629
- }
1630
- if (e.type === "matrix" && Et(e) && ((o) => {
1631
- if (!uo(o)) return !1;
1632
- const i = o.props.properties;
1633
- return !!i && typeof i == "object" && "matrixColumn" in i;
1634
- })(e)) {
1635
- const o = e.props.options, i = e.props.properties.matrixColumn, s = [];
1636
- for (const [d, l] of Object.entries(t)) {
1637
- const u = o.find((m) => String(m.id) === d), p = (u == null ? void 0 : u.label) ?? d, c = Qn(l) ? String(l) : JSON.stringify(l), f = i.find((m) => m.value === c), g = (f == null ? void 0 : f.label) ?? c;
1638
- s.push(`${p}: ${g}`);
1639
- }
1640
- return s.join("; ");
1641
- }
1642
- if (e.type === "rankorder" && Et(e)) {
1643
- const o = e.props.options.reduce((s, d) => (s[String(d.id)] = d.label, s), {}), i = [];
1644
- for (const [s, d] of Object.entries(t)) {
1645
- const l = o[s];
1646
- l && (i[d - 1] = l);
1647
- }
1648
- return Wn(i);
1649
- }
1650
- if (Qn(t)) {
1651
- const o = String(t).replaceAll(/[\u200B-\u200D\uFEFF]/g, "").trim();
1652
- return o === "" ? void 0 : o;
1653
- }
1654
- try {
1655
- return JSON.stringify(t);
1656
- } catch {
1657
- return String(t);
1658
- }
1659
- }
1660
- }, Zn = (e, t) => {
1661
- const n = new RegExp(`${t}="([^"]*)"`, "i").exec(e);
1662
- return (n == null ? void 0 : n[1]) ?? null;
1663
- }, Gi = (e, t) => {
1664
- if (e == null) return e;
1665
- let n = !1;
1666
- const r = e.replace(Wi, (o, i) => {
1667
- n = !0;
1668
- const s = Zn(i, "answer-id"), d = Zn(i, "fallback-text") ?? "", l = s ? Number(s) : Number.NaN;
1669
- if (Number.isFinite(l) && Object.hasOwn(t, l)) {
1670
- const u = t[l];
1671
- return String(u);
1672
- }
1673
- return d;
1674
- });
1675
- return n ? r : e;
1676
- }, po = (e) => {
1677
- const t = {};
1678
- for (const n of e) {
1679
- const r = Zi(n);
1680
- r !== void 0 && (t[n.name] = r);
1681
- }
1682
- return t;
1683
- }, Yi = ({ cards: e, next: t, previousResponses: n }) => {
1684
- var j;
1685
- const [r, o] = z({}), [i, s] = z({}), d = ge(() => ({ ...n, ...po(e.map((h) => {
1686
- var y, k;
1687
- return { ...h, value: ((y = r[h.name]) == null ? void 0 : y.value) ?? null, secondaryValue: ((k = r[h.name]) == null ? void 0 : k.secondaryValue) ?? null };
1688
- })) }), [n, r, e]), l = (u = d, e.map((h) => {
1689
- if (!uo(h) || h.props.properties === void 0 || h.props.properties === null) return h;
1690
- const y = h.props.properties;
1691
- if (y === null || typeof y != "object" || !zn.some((D) => D in y)) return h;
1692
- let k = !1;
1693
- const N = {};
1694
- for (const D of zn) {
1695
- const S = y[D];
1696
- if (S !== void 0) {
1697
- const P = Gi(S, u);
1698
- N[D] = P, P !== S && (k = !0);
1699
- }
1700
- }
1701
- return k ? { ...h, props: { ...h.props, properties: { ...y, ...N } } } : h;
1702
- }));
1703
- var u;
1704
- const { isLongFormSurvey: p, focusedQuestionId: c, setFocusedQuestionId: f } = A((h) => ({ isLongFormSurvey: le(h.studyType), focusedQuestionId: h.focusedQuestionId, setFocusedQuestionId: h.setFocusedQuestionId })), g = ee(null), m = ee(!1), b = ee(null), v = De((h) => {
1705
- var D, S;
1706
- m.current = !0;
1707
- const y = e.findIndex((P) => P.name === h);
1708
- if (!p || h === null || y === -1) return void (m.current = !1);
1709
- const k = (D = g.current) == null ? void 0 : D.querySelectorAll(".ul-card-scroll-wrapper")[y], N = (S = g.current) == null ? void 0 : S.closest(".ul-card__container");
1710
- if (k && N) {
1711
- if (k && N) {
1712
- const P = k.getBoundingClientRect(), O = N.getBoundingClientRect(), F = P.top - O.top + N.scrollTop, B = F + P.height / 2, $ = window.innerHeight - 157;
1713
- let Q;
1714
- P.height >= $ ? Q = F : Q = B - N.clientHeight / 2;
1715
- const K = N.clientHeight, J = N.scrollHeight - K, pe = Math.max(0, Math.min(Q, J));
1716
- N.scrollTo({ top: pe, behavior: "smooth" }), setTimeout(() => {
1717
- m.current = !1;
1718
- }, 500);
1719
- }
1720
- } else m.current = !1;
1721
- }, [p, e]);
1722
- function w(h, y) {
1723
- return h.map((k) => y[k.name]);
1724
- }
1725
- Y(() => {
1726
- c !== null && e.findIndex((h) => h.name === c) !== -1 || f(e[0].name);
1727
- }, [e, c, f]);
1728
- const x = (h) => {
1729
- if (!p) return;
1730
- const y = e.findIndex((k) => k.name === h) + 1;
1731
- if (y < e.length) {
1732
- const k = e[y].name;
1733
- f(k);
1734
- } else f(h);
1735
- };
1736
- Y(() => {
1737
- p && c !== null && (b.current !== c ? v(c) : b.current = null);
1738
- }, [c, p, v]);
1739
- const I = De(() => {
1740
- var O, F;
1741
- if (m.current) return;
1742
- const h = (O = g.current) == null ? void 0 : O.closest(".ul-card__container");
1743
- if (!h) return;
1744
- const y = (F = g.current) == null ? void 0 : F.querySelectorAll(".ul-card-scroll-wrapper");
1745
- if (!y || y.length === 0) return;
1746
- const k = h.getBoundingClientRect(), N = k.top + k.height / 2;
1747
- let D = 0, S = 1 / 0;
1748
- y.forEach((B, $) => {
1749
- const Q = B.getBoundingClientRect(), K = Q.top + Q.height / 2, J = Math.abs(N - K);
1750
- J < S && (S = J, D = $);
1751
- });
1752
- const P = e[D];
1753
- b.current = P.name, f(P.name);
1754
- }, [e, f]);
1755
- Y(() => {
1756
- var y;
1757
- if (!p) return;
1758
- const h = ((y = g.current) == null ? void 0 : y.closest(".ul-card__container")) || null;
1759
- return h && h.addEventListener("scroll", I, { passive: !0 }), () => {
1760
- h && h.removeEventListener("scroll", I);
1761
- };
1762
- }, [I, p]);
1763
- const T = ge(() => Object.values(i).every((h, y) => {
1764
- var N;
1765
- const k = e[y];
1766
- return !(!(k != null && k.props) || !("properties" in k.props) || ((N = k.props.properties) == null ? void 0 : N.required) !== !1) || h;
1767
- }), [i, e]), C = async (h, y, k) => {
1768
- return s((D) => ({ ...D, [h]: k })), await (N = (D) => ({ ...D, [h]: y }), new Promise((D) => {
1769
- o((S) => {
1770
- const P = N(S);
1771
- return D(P), P;
1772
- });
1773
- }));
1774
- var N;
1775
- };
1776
- Y(() => {
1777
- if (!p) return;
1778
- const h = {};
1779
- e.forEach((y) => {
1780
- var N, D;
1781
- const k = y;
1782
- (D = (N = k.props) == null ? void 0 : N.properties) != null && D.required || (h[k.name] = { value: null, questionId: k.name, type: k.type });
1783
- }), o(h), s({});
1784
- }, [e, p]);
1785
- const E = async (h, y) => {
1786
- if (p) {
1787
- const k = await C(h.questionId, h, y), N = _(h.type), D = R(h.type);
1788
- if (N && x(h.questionId), D && y) {
1789
- const S = w(e, k);
1790
- t(S);
1791
- }
1792
- } else t([h]);
1793
- }, _ = (h) => (/* @__PURE__ */ new Set(["nps", "likert", "multiplechoice"])).has(h), R = (h) => (/* @__PURE__ */ new Set(["videovoice", "consentlegal", "texturlprompt", "maxdiff"])).has(h), L = ((j = e[0]) == null ? void 0 : j.type) === "thanks";
1794
- return p ? a("div", { className: "ul-card-list-container--longform", ref: g, children: [a(Qi, { value: n, children: l.map((h, y) => a($n, { cardInstance: h, moveToNextQuestion: x, showIndividualSubmit: p && e.length > 1 && y < e.length - 1, submitQuestion: E, updateCardValues: C }, (h == null ? void 0 : h.name) || y)) }), !L && a(zi, { isSubmitDisabled: Object.keys(r).length < e.length || !T, onSubmit: function() {
1795
- const h = w(e, r);
1796
- t(h);
1797
- } })] }) : a(ne, { children: l.map((h, y) => a($n, { cardInstance: h, moveToNextQuestion: x, showIndividualSubmit: p && e.length > 1 && y < e.length - 1, submitQuestion: E, updateCardValues: C }, (h == null ? void 0 : h.name) || y)) });
1798
- }, qt = 1, mo = 2, ho = 3, ut = (e) => e.type === "av_permission", Gn = (e) => e.type === "screen_permission", fo = (e, t) => e === void 0 ? qt : e ? ((n, r) => !(ut(r) ? r.permissionDescriptors : []).includes("camera") || n.getVideoTracks().length > 0)(e, t) ? ho : qt : mo, Yn = { avStream: null, currentPage: null, mediaRecordingUids: null, nextQuestion: () => {
1799
- }, passthroughData: void 0, recordingMediaTypes: void 0, screenPermissionRequested: !1, type: void 0 }, ye = Wr((e) => ({ ...Yn, reset: () => {
1800
- e(Yn);
1801
- }, updatePage: (t) => {
1802
- e(t);
1803
- } }));
1804
- function Bt({ currentPage: e, pages: t }) {
1805
- const { avStream: n, recordingMediaTypes: r, updatePage: o } = ye.getState(), { recorderEventEmitter: i } = A.getState();
1806
- i.emit("av.permission", { "permission.descriptors": e.permissionDescriptors, "stream.ready": (s, d) => {
1807
- if (n === s) return;
1808
- let l = e;
1809
- if (s && !e.permissionDescriptors.includes("camera")) {
1810
- const u = t.indexOf(e), p = d != null && d.active ? u + 2 : u + 1;
1811
- d != null && d.active && r && i.emit("begin.recording", { "recording.media.types": r, "start.recording.callback": (c) => o({ mediaRecordingUids: c }) }), l = t[p];
1812
- }
1813
- o({ currentPage: l, avStream: s });
1814
- } });
1815
- }
1816
- function At({ status: e }) {
1817
- const { nextQuestion: t, passthroughData: n, mediaRecordingUids: r, reset: o } = ye.getState(), { recorderEventEmitter: i, handleUploadUpdate: s, index: d } = A.getState(), l = { value: { taskStatus: e }, type: "recordedtask", questionId: (n == null ? void 0 : n.questionId) || 1 };
1818
- n && i.emit("finish.task", { "begin.callback": (u) => {
1819
- s({ mediaRecordingUid: u, isSubmitted: !0, progressPct: 0, isComplete: !1 });
1820
- }, "progress.callback": (u, p) => {
1821
- s({ mediaRecordingUid: u, progressPct: p.detail, isSubmitted: !1, isComplete: !1 });
1822
- }, "upload.callback": (u) => {
1823
- u && s({ mediaRecordingUid: u, isComplete: !0, isSubmitted: !0, progressPct: 100 });
1824
- }, "passthrough.data": n, "current.index": d, "task.response": l, "task.complete.callback": (u) => {
1825
- l.value.taskDurationMillisecond = u, r && (l.value.mediaRecordingUids = r), o(), t(l);
1826
- } });
1827
- }
1828
- function on({ pages: e, setIsRequestingPermission: t }) {
1829
- const { recorderEventEmitter: n, eventEmitFn: r } = A.getState(), { updatePage: o, currentPage: i, recordingMediaTypes: s, screenPermissionRequested: d } = ye.getState();
1830
- if (!i) return;
1831
- const l = e.indexOf(i);
1832
- switch (i.type) {
1833
- case "av_permission": {
1834
- const u = d ? l + 2 : l + 1;
1835
- return d && s && n.emit("begin.recording", { "recording.media.types": s, "start.recording.callback": (p) => {
1836
- o({ mediaRecordingUids: p });
1837
- } }), void o({ currentPage: e[u] });
1838
- }
1839
- case "screen_permission":
1840
- return void n.emit("screen.permission", { "screen.permission.requested": t, "stream.ready.callback": (u, p) => {
1841
- const c = p ? e[l + 1] : i;
1842
- p && s && n.emit("begin.recording", { "recording.media.types": s, "start.recording.callback": (f) => {
1843
- o({ captureStream: p, mediaRecordingUids: f });
1844
- } }), o({ currentPage: c, screenPermissionRequested: !0, captureStream: p });
1845
- } });
1846
- case "start_task":
1847
- return r("recorded.task.start"), n.emit("recorded.task.start"), n.emit("start.task"), void o({ currentPage: e[l + 1], screenPermissionRequested: !0 });
1848
- case "complete_task":
1849
- return;
1850
- }
1851
- }
1852
- const go = "ul-permission-graphics-container", vo = "ul-permission-body", bo = H(go, "ul_recorded-task-inset-spacing"), ft = H("ul-horizontal-button-container", "ul-horizontal-button-container-left"), _o = ({ richTextBody: e }) => a("div", { className: "ul-rich-text-body", dangerouslySetInnerHTML: { __html: e }, id: "ul-task-detail-container" }), gt = ({ required: e, skipButtonText: t, bottom: n = !1 }) => e ? null : a(ie, { className: H(n && "ul-skip-button-below", "ul-button-inactive"), onClick: At.bind(null, { status: "abandoned" }), children: t || "Skip" }), sn = (e) => {
1853
- const { avStream: t, captureStream: n, recordingMediaTypes: r, updatePage: o } = ye.getState(), i = (r == null ? void 0 : r.includes("audio")) || (r == null ? void 0 : r.includes("video"));
1854
- Y(() => {
1855
- const s = setInterval(() => {
1856
- i && t && !t.active ? o({ avStream: null, currentPage: e[0] }) : n && n.active || o({ captureStream: void 0, currentPage: e[i ? 1 : 0] });
1857
- }, 1e3);
1858
- return () => clearInterval(s);
1859
- }, [t, n, i, e, r, o]);
1860
- }, Ki = ({ content: e, pages: t, required: n }) => {
1861
- const { buttonText: r, skipButtonText: o, taskDetail: i } = e;
1862
- return sn(t), a("div", { className: "ul-task-page", children: [i && a(_o, { richTextBody: i }), a("div", { className: ft, children: [a(ie, { onClick: on.bind(null, { pages: t }), children: r }), a(gt, { required: n, skipButtonText: o })] })] }, "start-task");
1863
- }, Ji = ({ content: e, pages: t, properties: n }) => {
1864
- const { buttonText: r, skipButtonText: o } = e;
1865
- sn(t);
1866
- const i = a(xe, { properties: n, defaultBody: () => a("div", { className: ft, children: [a(ie, { className: "ul-complete-task-button", onClick: At.bind(null, { status: "completed" }), children: r }), a(ie, { className: H("ul-button-inactive"), onClick: At.bind(null, { status: "given.up" }), children: o })] }) });
1867
- return a("div", { className: "ul-task-page", children: [e.taskDetail && a(_o, { richTextBody: e.taskDetail }), i] }, "complete-task");
1868
- }, Xi = ({ content: e, pages: t, required: n }) => {
1869
- const { buttonText: r, skipButtonText: o } = e, [i] = A((l) => [l.tabTitle]), [s, d] = z(!1);
1870
- return a("div", { children: [a("div", { className: bo, children: [a("p", { style: { marginTop: "auto" }, children: e.selectTabText }), a("div", { className: "ul-select-tab-container", children: a("p", { className: vo, children: i }) })] }), a("div", { className: n ? "" : ft, children: [a(ie, { disabled: s, onClick: on.bind(null, { pages: t, setIsRequestingPermission: d }), children: r }), a(gt, { required: n, skipButtonText: o })] })] });
1871
- }, es = ({ content: e }) => a("div", { className: H(go, "ul_permission_svg_container", "ul_recorded-task-inset-spacing", "ul-center-horizontally"), dangerouslySetInnerHTML: { __html: e.svg } }, "ul-permission-request-graphic"), ts = ({ content: e, pages: t, required: n }) => {
1872
- const { permissionDeniedHeadline: r, permissionDeniedBody: o, skipButtonText: i, tryAgainButtonText: s } = e, d = ut(t[0]) ? t[0] : null;
1873
- return Y(() => {
1874
- const l = setInterval(() => {
1875
- d !== null && Bt({ currentPage: d, pages: t });
1876
- }, 1e3);
1877
- return () => clearInterval(l);
1878
- }, [d, t]), d ? a("div", { children: [a("div", { className: bo, children: a("p", { className: "ul-av-permission-denied-paragraph", children: [a("span", { className: "ul-av-permission-denied-headline", children: r }), a("span", { className: vo, children: o })] }) }), a("div", { className: ft, children: [a(ie, { onClick: Bt.bind(null, { currentPage: d, pages: t }), children: s }), a(gt, { required: n, skipButtonText: i })] })] }) : null;
1879
- }, ns = ({ stream: e }) => a("video", { autoPlay: !0, className: H("ul_recorded-task-inset-spacing"), id: "ul-record-task-video-preview", muted: !0, ref: (t) => {
1880
- t && (t.srcObject = e || null);
1881
- } }), rs = ({ content: e, pages: t, required: n }) => {
1882
- const { skipButtonText: r } = e, { avStream: o } = ye.getState();
1883
- return sn(t), a("div", { children: [a(ns, { stream: o }), a("div", { className: "ul-vertical-button-container-center", children: [a(ie, { onClick: on.bind(null, { pages: t }), children: e.buttonText }), a(gt, { bottom: !0, required: n, skipButtonText: r })] })] });
1884
- }, os = ({ properties: e }) => {
1885
- const { pages: t, required: n } = e, { avStream: r, currentPage: o } = ye.getState();
1886
- if (o === void 0) return null;
1887
- switch (o == null ? void 0 : o.type) {
1888
- case "av_permission": {
1889
- const i = fo(r, o);
1890
- return i === qt ? a(es, { content: o }) : a(i === mo ? ts : rs, { content: o, pages: t, required: n });
1891
- }
1892
- case "screen_permission":
1893
- return a(Xi, { content: o, pages: t, required: n });
1894
- case "start_task":
1895
- return a(Ki, { content: o, pages: t, required: n });
1896
- case "complete_task":
1897
- return a(Ji, { content: o, pages: t, properties: e });
1898
- default:
1899
- return null;
1900
- }
1901
- }, is = ({ className: e, properties: t, next: n, questionId: r }) => {
1902
- const o = A(), { surveyId: i, responseGroupUid: s, userId: d } = o, l = ye(), { screenPermissionRequested: u } = l, p = ye((b) => b.avStream);
1903
- let c = ye((b) => b.currentPage);
1904
- c || (c = function({ pages: b, userId: v, responseGroupUid: w, surveyId: x, questionId: I, next: T }) {
1905
- const { updatePage: C } = ye.getState(), { eventEmitFn: E, recorderEventEmitter: _ } = A.getState(), R = { questionId: I, surveyId: x, visitorId: v, responseGroupUid: w };
1906
- let L = 0;
1907
- _.emit("recorded.task.permission.screen"), E("recorded.task.permission.screen"), _.emit("permission.status", { "permission.status.callback": (h, y, k, N) => {
1908
- const D = b[L], { type: S } = D, P = ["screen"];
1909
- if (ut(D)) {
1910
- const { permissionDescriptors: O } = D, F = O == null ? void 0 : O.includes("microphone"), B = O == null ? void 0 : O.includes("camera");
1911
- F && P.push("audio"), B && P.push("video"), (h != null && h.active && !B || h != null && h.active && y) && L++;
1912
- }
1913
- Gn(b[L]) && k && (L++, _.emit("begin.recording", { "recording.media.types": P, "start.recording.callback": (O) => C({ mediaRecordingUids: O }) })), C({ currentPage: b[L], avStream: h, screenPermissionRequested: k, nextQuestion: T, type: S, passthroughData: R, recordingMediaTypes: P, captureStream: N });
1914
- } });
1915
- const j = b[L];
1916
- return j.type === "av_permission" && Bt({ currentPage: j, pages: b }), j;
1917
- }({ questionId: r, surveyId: i, next: (b) => {
1918
- n(b, !0);
1919
- }, pages: t.pages, responseGroupUid: s, userId: d }));
1920
- let f = c.headline, g = c.captionText;
1921
- const m = fo(p, c);
1922
- return Gn(c) && u && (f = c.permissionDeniedHeadline, g = c.permissionDeniedCaptionText), ut(c) && m === ho && (f = c.permissionGrantedHeadline, g = c.permissionGrantedCaptionText), a("div", { className: H(e, "ul-center-horizontally", "fade-in-transition"), children: [a(ue, { message: f, properties: { captionText: g } }), a(ve, { children: a(os, { properties: t }) })] });
1923
- }, ss = { "{{user_id}}": "externalUserId", "{{email}}": "email" }, as = ({ className: e, message: t, next: n, properties: r, questionId: o, type: i }) => {
1924
- const { visitorAttributes: s, isLongFormSurvey: d } = A((m) => ({ visitorAttributes: m.visitorAttributes, isLongFormSurvey: le(m.studyType) })), l = (m, b = !1) => {
1925
- n({ value: b ? { skipped: !0 } : void 0, questionId: o, type: i }, !0);
1926
- }, u = (m) => {
1927
- m.key !== "Enter" && m.key !== " " || n({ value: void 0, questionId: o, type: i }, !0);
1928
- }, p = ((m, b = {}) => {
1929
- if (!m) return m;
1930
- try {
1931
- /^https?:\/\//i.test(m) || (m = `http://${m}`);
1932
- const T = new URL(m);
1933
- if (!T.protocol || T.protocol !== "http:" && T.protocol !== "https:") return;
1934
- } catch {
1935
- return;
1936
- }
1937
- let v = m;
1938
- const w = [];
1939
- for (const [T, C] of Object.entries(ss)) if (v.toLowerCase().includes(T)) if (b[C]) {
1940
- const E = new RegExp(T, "gi");
1941
- v = v.replace(E, b[C]);
1942
- } else w.push(T);
1943
- if (w.length === 0 || !v.includes("?")) return v;
1944
- const x = v.slice(0, v.indexOf("?")), I = v.slice(v.indexOf("?") + 1).split("&").map((T) => T.split("=")).filter((T) => !w.includes(T[1]));
1945
- return I.length === 0 ? x : `${x}?${I.map((T) => T.join("=")).join("&")}`;
1946
- })(r && r.buttonUrl, s), c = d && r.promptActionType === ao.NO_BUTTON ? () => a(ne, {}) : () => a(Ee, { children: a("div", { className: "ul-card-button-group", children: [a("a", { className: "ul-card-text__button ul-card__text-url-prompt-button", href: p, id: "ul-card-text__button", onClick: l, onKeyPress: u, rel: "noreferrer", role: p ? "link" : "button", tabIndex: 0, target: "_blank", children: je(r) }), r.required === !1 && a("button", { className: "ul-card-skip__button", onClick: (m) => l(0, !0), children: rn(r) })] }) });
1947
- return a("div", { className: H(e, "ul-card__text-url-prompt", "fade-in-transition"), children: [a(ue, { message: t, properties: { questionHtml: r.questionHtml } }), a(ve, { children: (f = r == null ? void 0 : r.richTextBody, g = r == null ? void 0 : r.body, f ? a("div", { className: "ul-rich-text-body", dangerouslySetInnerHTML: { __html: f }, id: "ul-card__text-url-body-container" }) : g ? a("div", { className: "ul-rich-text-body", id: "ul-card__text-url-body-container", children: (g ? g.split(/\n\s*\n/g) : []).map((m, b) => a("p", { children: m }, b)) }) : null) }), a(xe, { defaultBody: c, properties: r })] }, o);
1948
- var f, g;
1949
- }, ls = ({ className: e, questionId: t }) => {
1950
- const { border: n, destroy: r, endCard: o, forceBrandedLogo: i } = A((l) => ({ border: l.border, destroy: l.destroy, endCard: l.endCard, forceBrandedLogo: l.forceBrandedLogo }));
1951
- Y(() => {
1952
- setTimeout(() => {
1953
- r(Ue);
1954
- }, i ? 4e3 : 2e3);
1955
- }, [r, i]);
1956
- const s = o && o.subheader ? a("p", { className: "ul-caption", children: o.subheader }) : null, d = o && o.headline ? o.headline : "";
1957
- return a("div", { className: H(e, "ul-card--thanks", "fade-in-transition"), children: a("div", { children: a("div", { className: "ul-card--thanks-content", children: [a("div", { className: "ul-thanks-check", children: a("svg", { "aria-labelledby": "title", fill: "none", height: "99", viewBox: "0 0 81 99", width: "81", xmlns: "http://www.w3.org/2000/svg", children: [a("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: n, fillRule: "evenodd" }), a("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: n, fillRule: "evenodd" }), a("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" })] }) }), a(ue, { message: d }), s] }) }) }, t);
1958
- }, Re = "https://cdn.sprig.com", U = { document: void 0, videojs: void 0 }, an = (e) => e + "-loading-spiner", se = "hidden", Kn = ".m3u8", It = "questionId", jt = "ul-video-recorder-camera-off-button", Tt = "ul-recording-in-session", ds = [{ type: "link", content: `${Re}/dependencies/videojs-record-4.5.0.min.css` }, { type: "script", content: `${Re}/dependencies/RecordRTC-5.6.2.js` }, { type: "script", content: `${Re}/dependencies/adapter.8.0.0.min.js` }, { type: "script", content: `${Re}/dependencies/videojs-record-4.5.0.min.js` }, { type: "script", content: `${Re}/userleap-web-upchunk-v2.2.2.js` }], yo = [{ type: "link", content: `${Re}/dependencies/video-js-7.18.0.min.css` }, { type: "script", content: `${Re}/dependencies/video-js-7.18.0.min.js` }, { type: "style", content: `/* progress control styles */
1959
- .video-js .vjs-control {
1960
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
1961
- }
1962
-
1963
- .video-js .vjs-progress-control .vjs-progress-holder {
1964
- margin: 0 0px;
1965
- }
1966
-
1967
- .video-js .vjs-progress-control {
1968
- position: absolute;
1969
- height: 3px;
1970
- width: 100%;
1971
- }
1972
- /* position and align the buttons and button texts */
1973
- .ul-control-panel {
1974
- bottom: 0;
1975
- width: 100%;
1976
- flex-direction: column;
1977
- background-color: white;
1978
- height: fit-content;
1979
- z-index: 2;
1980
- }
1981
-
1982
- .ul-buttons-panel {
1983
- color: black;
1984
- display: flex;
1985
- gap: 20px;
1986
- height: 50px;
1987
- justify-content: center;
1988
- margin: 10px;
1989
- padding: 2px 14px 0;
1990
- }
1991
-
1992
- .video-js .vjs-volume-panel {
1993
- height: 30px;
1994
- width: 40px;
1995
- }
1996
-
1997
- .ul-inactive {
1998
- opacity: 0.3;
1999
- cursor: default;
2000
- pointer-events: none;
2001
- }
2002
-
2003
- /* buttons */
2004
- .ul-buttons-panel > .vjs-button {
2005
- background-color: rgba(0, 0, 0, 0.05);
2006
- border-radius: 50%;
2007
- display: flex;
2008
- height: 3em;
2009
- justify-content: center;
2010
- width: 3em;
2011
- }
2012
-
2013
- .vjs-button>.vjs-icon-placeholder:before {
2014
- align-items: center;
2015
- display: flex;
2016
- font-size: unset;
2017
- line-height: 0.5;
2018
- justify-content: center;
2019
- }
2020
-
2021
- span.ul-button-text {
2022
- align-self: flex-end;
2023
- position: relative;
2024
- top: 14px;
2025
- }
2026
-
2027
- #ul-camera-button {
2028
- white-space: nowrap;
2029
- }
2030
-
2031
- .video-js .vjs-volume-control.vjs-volume-horizontal {
2032
- background-color: #fff;
2033
- z-index: 1;
2034
- }
2035
-
2036
- .vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level {
2037
- background-color: black;
2038
- }
2039
-
2040
- .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,
2041
- .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
2042
- .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active {
2043
- width: 40px;
2044
- }
2045
-
2046
- .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,
2047
- .video-js .vjs-volume-panel .vjs-volume-control:active,
2048
- .video-js .vjs-volume-panel.vjs-hover .vjs-mute-control ~ .vjs-volume-control,
2049
- .video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,
2050
- .video-js .vjs-volume-panel:active .vjs-volume-control,
2051
- .video-js .vjs-volume-panel:focus .vjs-volume-control {
2052
- visibility: visible;
2053
- left: 40px;
2054
- position: absolute;
2055
- transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s;
2056
- }
2057
-
2058
- /* play button customization */
2059
- .video-js .vjs-play-control {
2060
- color: black;
2061
- }
2062
-
2063
- .video-js .vjs-play-control .vjs-icon-placeholder:before {
2064
- content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5363 6.40226L1.93958 10.7006C1.64037 10.8502 1.28833 10.6326 1.28833 10.2981V1.7014C1.28833 1.36688 1.64037 1.14931 1.93958 1.29891L10.5363 5.59727C10.868 5.76311 10.868 6.23642 10.5363 6.40226Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
2065
- }
2066
-
2067
- /* position and style the current timer */
2068
- .ul-time-panel {
2069
- position: absolute;
2070
- bottom: 80px;
2071
- left: 10px;
2072
- height: 22px;
2073
- color: black;
2074
- border: 1px solid #e0e0eb;
2075
- border-radius: 23px;
2076
- background-color: white;
2077
- width: fit-content;
2078
- }
2079
-
2080
- .video-js .vjs-current-time,
2081
- .vjs-no-flex .vjs-current-time {
2082
- display: flex;
2083
- align-items: center;
2084
- text-align: center;
2085
- }
2086
-
2087
- /* remove the dot progress indicator */
2088
- .video-js .vjs-play-progress:before,
2089
- .video-js .vjs-volume-level:before,
2090
- .vjs-icon-circle:before,
2091
- .vjs-seek-to-live-control .vjs-icon-placeholder:before {
2092
- content: none;
2093
- }
2094
-
2095
- .video-js .vjs-mute-control .vjs-icon-placeholder:before {
2096
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.825.324A.75.75 0 019.25 1v11.667a.75.75 0 01-1.219.585l-3.96-3.169H1a.75.75 0 01-.75-.75v-5a.75.75 0 01.75-.75h3.07L8.031.414a.75.75 0 01.794-.09zM7.75 2.56L4.802 4.92a.75.75 0 01-.469.164H1.75v3.5h2.583a.75.75 0 01.469.165l2.948 2.358V2.56zM14.911.47a.75.75 0 011.061 0 9.084 9.084 0 010 12.844.75.75 0 01-1.06-1.06 7.584 7.584 0 000-10.724.75.75 0 010-1.06zM11.97 3.41a.75.75 0 011.06 0 4.917 4.917 0 010 6.953.75.75 0 11-1.06-1.06 3.417 3.417 0 000-4.832.75.75 0 010-1.06z' fill='%23262136'/%3E%3C/svg%3E");
2097
- }
2098
-
2099
- .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before {
2100
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.5 1.167L4.333 4.5H1v5h3.333L8.5 12.833V1.167zM17.17 4.5l-5 5M12.17 4.5l5 5' stroke='%23262136' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
2101
- }
2102
-
2103
- .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before {
2104
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.82489 0.32403C9.08474 0.44892 9.25 0.711703 9.25 1.00001V12.6667C9.25 12.955 9.08474 13.2178 8.82489 13.3427C8.56504 13.4675 8.25661 13.4324 8.03148 13.2523L4.07025 10.0833H1C0.585786 10.0833 0.25 9.74755 0.25 9.33334V4.33334C0.25 3.91913 0.585786 3.58334 1 3.58334H4.07025L8.03148 0.414355C8.25661 0.234253 8.56504 0.19914 8.82489 0.32403ZM7.75 2.56048L4.80185 4.91899C4.66887 5.02538 4.50364 5.08334 4.33333 5.08334H1.75V8.58334H4.33333C4.50364 8.58334 4.66887 8.6413 4.80185 8.74769L7.75 11.1062V2.56048Z' fill='%23262136'/%3E%3C/svg%3E%0A");
2105
- }
2106
-
2107
- .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before {
2108
- content: url("data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8.82489 0.32403C9.08474 0.44892 9.25 0.711703 9.25 1.00001V12.6667C9.25 12.955 9.08474 13.2178 8.82489 13.3427C8.56504 13.4675 8.25661 13.4324 8.03148 13.2523L4.07025 10.0833H1C0.585786 10.0833 0.25 9.74755 0.25 9.33334V4.33334C0.25 3.91913 0.585786 3.58334 1 3.58334H4.07025L8.03148 0.414355C8.25661 0.234253 8.56504 0.19914 8.82489 0.32403ZM7.75 2.56048L4.80185 4.91899C4.66887 5.02538 4.50364 5.08334 4.33333 5.08334H1.75V8.58334H4.33333C4.50364 8.58334 4.66887 8.6413 4.80185 8.74769L7.75 11.1062V2.56048Z' fill='%23262136'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.9698 3.41124C12.2627 3.11839 12.7376 3.11846 13.0304 3.4114C13.9521 4.33341 14.4699 5.58376 14.4699 6.88748C14.4699 8.19121 13.9521 9.44156 13.0304 10.3636C12.7376 10.6565 12.2627 10.6566 11.9698 10.3637C11.6768 10.0709 11.6767 9.596 11.9696 9.30307C12.6101 8.66235 12.9699 7.79346 12.9699 6.88748C12.9699 5.98151 12.6101 5.11262 11.9696 4.4719C11.6767 4.17896 11.6768 3.70409 11.9698 3.41124Z' fill='%23262136'/%3E%3C/svg%3E%0A");
2109
- }
2110
-
2111
- .video-js .vjs-volume-control:hover .vjs-mouse-display {
2112
- display: none !important;
2113
- }
2114
-
2115
- .video-js .vjs-play-progress {
2116
- background-color: black;
2117
- }
2118
-
2119
- /* position video player inside the container */
2120
- .video-js .vjs-tech {
2121
- position: static;
2122
- }
2123
-
2124
- .video-js .vjs-time-tooltip {
2125
- padding: 0.25em 0.75em;
2126
- align-items: center;
2127
- color: #333;
2128
- background: #FCFCFD;
2129
- border-radius: 99px;
2130
- text-align: center;
2131
- border: 1px solid #E0E0EB;
2132
- display: flex;
2133
- align-items: center;
2134
- justify-content: center;
2135
- top: -25px;
2136
- font-size: 12px !important;
2137
- width: 50px !important;
2138
- }
2139
-
2140
- .video-js .vjs-play-progress.vjs-slider-bar .vjs-time-tooltip {
2141
- visibility: hidden !important;
2142
- }
2143
-
2144
- .video-js .vjs-progress-control .vjs-mouse-display {
2145
- z-index: 2;
2146
- }
2147
-
2148
- .ul-video-player {
2149
- width: 100%;
2150
- display: flex;
2151
- flex-direction: column;
2152
- height: auto;
2153
- border: 1px solid #E6E6E6;
2154
- background-color: white;
2155
- box-sizing: border-box;
2156
- border-radius: 4px;
2157
- background-clip: border-box;
2158
- overflow: hidden;
2159
- }
2160
-
2161
- .video-js.vjs-fullscreen:not(.vjs-ios-native-fs) {
2162
- border: none;
2163
- }
2164
-
2165
- #video-response-player-secondary-video-player {
2166
- max-width: 200px;
2167
- margin-right: 20px;
2168
- background-color: transparent;
2169
- }
2170
-
2171
- #ul-card-video__player_recorder-video-recorder.vjs-fullscreen {
2172
- display: table;
2173
- }
2174
-
2175
- .video-js div.vjs-progress-control {
2176
- margin-top: -3px;
2177
- }
2178
-
2179
- .video-js .vjs-progress-control .vjs-slider {
2180
- background-color: #B2BBBD;
2181
- }
2182
-
2183
- .vjs-record.video-js .vjs-control.vjs-button.vjs-fullscreen-control {
2184
- position:relative;
2185
- }
2186
-
2187
- .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before {
2188
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.82143 2.54004L12.2614 2.54004C12.9242 2.54004 13.4614 3.0773 13.4614 3.74004L13.4614 6.18004' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.17955 13.46L3.73955 13.46C3.07681 13.46 2.53955 12.9227 2.53955 12.26L2.53955 9.81996' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12.7772 3.22266L9.36475 6.63516' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.29434 9.70605L2.88184 13.1186' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
2189
- }
2190
-
2191
- .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before {
2192
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.583 9.813H5.25a1 1 0 011 1v3.666M5.375 10.688L1 15.061M14.917 5.813H11.25a1 1 0 01-1-1V1.146M15.063 1l-4.376 4.375' stroke='%23262136' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
2193
- }
2194
-
2195
- .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before, .video-js .vjs-icon-replay:before {
2196
- content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5363 6.40226L1.93958 10.7006C1.64037 10.8502 1.28833 10.6326 1.28833 10.2981V1.7014C1.28833 1.36688 1.64037 1.14931 1.93958 1.29891L10.5363 5.59727C10.868 5.76311 10.868 6.23642 10.5363 6.40226Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
2197
- }
2198
-
2199
- .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before, .vjs-icon-pause:before {
2200
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3.61885' y='2.06074' width='3.16185' height='11.88' rx='0.9' fill='black' stroke='%23EDEDED' stroke-width='0.6' stroke-linecap='round'/%3E%3Crect x='9.21797' y='2.06074' width='3.16185' height='11.88' rx='0.9' fill='black' stroke='%23EDEDED' stroke-width='0.6' stroke-linecap='round'/%3E%3C/svg%3E%0A");
2201
- padding: 2px;
2202
- }
2203
-
2204
- .vjs-error-display {
2205
- display: none;
2206
- }
2207
-
2208
- .ul-video-player-video {
2209
- position: relative;
2210
- top: 0;
2211
- left: 0;
2212
- width: 100%;
2213
- }
2214
-
2215
- .ul-video-container {
2216
- width: 100%;
2217
- height: auto;
2218
- left: 0px;
2219
- top: 0px;
2220
-
2221
- background-color: transparent;
2222
- border-radius: 4px;
2223
-
2224
- align-items: start;
2225
- display: flex;
2226
- flex-direction: column;
2227
-
2228
- /* Inside Auto Layout */
2229
-
2230
- flex: none;
2231
- order: 0;
2232
- flex-grow: 0;
2233
- margin: 10px 0px;
2234
- position: relative;
2235
- }
2236
-
2237
- .vjs-record button.vjs-device-button.vjs-control {
2238
- background: rgba(255, 255, 255, 96);
2239
- width: 100%;
2240
- height: 100%;
2241
- left: 0;
2242
- top: 0;
2243
- margin: 0;
2244
- border-radius: 0;
2245
- line-height: 0.6;
2246
- padding: 10px;
2247
- display: flex;
2248
- align-items: center;
2249
- flex-direction: column;
2250
- justify-content: center;
2251
- z-index: 3;
2252
- }
2253
-
2254
- .vjs-record .vjs-device-button.vjs-control:before {
2255
- font-size: 14px !important;
2256
- color: #333;
2257
- content: "Your browser needs to access your camera and microphone for video recording";
2258
- line-height: 135%;
2259
- }
2260
-
2261
- .vjs-record .vjs-device-button.vjs-control.permission-denied:before {
2262
- font-size: 16px !important;
2263
- color: #262136;
2264
- content: "Unable to access your camera and microphone";
2265
- }
2266
-
2267
- .vjs-record .vjs-device-button.vjs-control:after {
2268
- display: inline-block;
2269
- background: #F0F0F5;
2270
- font-size: 13px;
2271
- border-radius: 4px;
2272
- content: "Request Permissions";
2273
- padding: 1em 2em;
2274
- color: #333;
2275
- margin-top: 20px;
2276
- }
2277
-
2278
- .vjs-record .vjs-device-button.vjs-control.permission-denied:after {
2279
- display: inline-block;
2280
- background: white;
2281
- font-size: 13px;
2282
- content: "Please go to your browser settings and update permissions to enable recording";
2283
- padding: 1em;
2284
- color: #4B575D;
2285
- margin: 5px;
2286
- line-height: 135%;
2287
- text-align: center;
2288
- }
2289
-
2290
- .vjs-control.vjs-button.ul-video-recorder-delete-button, .vjs-control.vjs-button.ul-video-recorder-toggle-button, .vjs-control.vjs-button.ul-video-recorder-camera-off-button-audio-only, .vjs-control.vjs-button.ul-video-recorder-camera-off-button {
2291
- cursor: pointer;
2292
- }
2293
-
2294
- .ul-video-recorder-delete-button .vjs-icon-placeholder:before {
2295
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9.21234 7.37549V11.1193M2.53931 4.25595H13.4593H2.53931ZM5.57234 4.25595V3.00833C5.57222 2.84433 5.60354 2.68192 5.6645 2.53038C5.72546 2.37884 5.81488 2.24115 5.92762 2.12519C6.04037 2.00922 6.17424 1.91726 6.32158 1.85456C6.46892 1.79185 6.62683 1.75964 6.78628 1.75977H9.21234C9.37179 1.75964 9.5297 1.79185 9.67703 1.85456C9.82437 1.91726 9.95824 2.00922 10.071 2.12519C10.1837 2.24115 10.2732 2.37884 10.3341 2.53038C10.3951 2.68192 10.4264 2.84433 10.4263 3.00833V4.25595H5.57234ZM12.2463 4.25595V12.9912C12.2463 13.3223 12.1184 13.6399 11.8907 13.8741C11.6631 14.1082 11.3543 14.2398 11.0323 14.2398H4.96628C4.64432 14.2398 4.33555 14.1082 4.10789 13.8741C3.88023 13.6399 3.75234 13.3223 3.75234 12.9912V4.25595H12.2463ZM6.78628 7.37549V11.1193V7.37549Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
2296
- }
2297
-
2298
- .ul-video-recorder-toggle-button .vjs-icon-placeholder:before {
2299
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0Z' fill='%23D15153'/%3E%3C/svg%3E");
2300
- }
2301
-
2302
- .ul-video-recorder-toggle-button.ul-recording-in-session .vjs-icon-placeholder:before {
2303
- content: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 10L12 2C12 0.89543 11.1046 -4.85396e-07 10 -4.37114e-07L2 -8.74228e-08C0.89543 -3.91405e-08 -4.85396e-07 0.895431 -4.37114e-07 2L-8.74228e-08 10C-3.91405e-08 11.1046 0.895431 12 2 12L10 12C11.1046 12 12 11.1046 12 10Z' fill='%23D15153'/%3E%3C/svg%3E%0A");
2304
- }
2305
-
2306
- .ul-video-recorder-camera-off-button .vjs-icon-placeholder:before {
2307
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2645_4654)'%3E%3Cpath d='M15.1491 4.75L10.5991 8L15.1491 11.25V4.75Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.29912 3.4502H2.14912C1.43115 3.4502 0.849121 4.03223 0.849121 4.7502V11.2502C0.849121 11.9682 1.43115 12.5502 2.14912 12.5502H9.29912C10.0171 12.5502 10.5991 11.9682 10.5991 11.2502V4.7502C10.5991 4.03223 10.0171 3.4502 9.29912 3.4502Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2645_4654'%3E%3Crect width='15.6' height='15.6' fill='white' transform='translate(0.199951 0.200195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
2308
- }
2309
-
2310
- .ul-video-recorder-camera-off-button-audio-only .vjs-icon-placeholder:before {
2311
- content: url("data:image/svg+xml,%3Csvg width='22' height='15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M.75 3A2.75 2.75 0 013.5.25h9.081A2.75 2.75 0 0115.331 3v9a2.75 2.75 0 01-2.75 2.75H3.5A2.75 2.75 0 01.75 12V3zM3.5 1.75c-.69 0-1.25.56-1.25 1.25v9c0 .69.56 1.25 1.25 1.25h9.081c.69 0 1.25-.56 1.25-1.25V3c0-.69-.56-1.25-1.25-1.25H3.5z' fill='%23262136'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.53 2.03l-12 12-1.06-1.06 12-12 1.06 1.06zM20.87 1.525a.75.75 0 01.38.652v10.588a.75.75 0 01-1.134.644l-5.92-3.53a.75.75 0 01-.365-.643v-3.53a.75.75 0 01.366-.644l5.919-3.53a.75.75 0 01.754-.007zm-5.539 4.607V8.81l4.419 2.635V3.497l-4.419 2.635z' fill='%23262136'/%3E%3C/svg%3E");
2312
- transform: scale(0.75);
2313
- }
2314
-
2315
- .ul-upload-progress-label {
2316
- padding: 0.15em 0.75em;
2317
- align-items: center;
2318
- font-size: 12px;
2319
- color: #333;
2320
- background: #FCFCFD;
2321
- border-radius: 99px;
2322
- text-align: center;
2323
- border: 1px solid #E0E0EB;
2324
- display: flex;
2325
- align-items: center;
2326
- justify-content: center;
2327
- position: absolute;
2328
- bottom: 75px;
2329
- left: calc(50% - 65px);
2330
- width: 130px;
2331
- z-index: 5;
2332
- }
2333
-
2334
- .ul-upload-progress-label__time {
2335
- display: inline-flex;
2336
- margin-left: 0.8em;
2337
- align-items: center;
2338
- }
2339
-
2340
- .ul-upload-progress-label__time:before {
2341
- content: "";
2342
- display: inline-flex;
2343
- width: 1px;
2344
- height: 12px;
2345
- background-color: #E0E0EB;
2346
- margin-right: 0.8em;
2347
- }
2348
-
2349
- @keyframes grow {
2350
- 0% {
2351
- transform: scale(1);
2352
- background-color: #EEECFC;
2353
- }
2354
- 50% {
2355
- transform: scale(1.2);
2356
- background-color: #E1DFF4;
2357
- }
2358
- 100% {
2359
- transform: scale(1);
2360
- background-color: #EEECFC;
2361
- }
2362
- }
2363
-
2364
- .ul-audio-recorder-placeholder:before {
2365
- width: 80px;
2366
- height: 80px;
2367
- border-radius: 120px;
2368
- background-color: #EEECFC;
2369
- content: "";
2370
- position: absolute;
2371
- left: calc(50% - 40px);
2372
- top: calc(50% - 40px);
2373
- animation: 6s infinite grow;
2374
- transform-origin: 50% 60%;
2375
- }
2376
-
2377
- .ul-audio-recorder-placeholder:after {
2378
- content: url("data:image/svg+xml,%3Csvg width='98' height='98' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='a' maskUnits='userSpaceOnUse' x='0' y='0' width='98' height='98'%3E%3Ccircle cx='49' cy='49' r='49' fill='%23EDECF8'/%3E%3C/mask%3E%3Cg mask='url(%23a)'%3E%3Ccircle cx='49' cy='49' r='50' fill='%23645CC2'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.422 81.812c5.405-15.547 20.187-26.706 37.576-26.706 17.39 0 32.172 11.159 37.577 26.707-9.164 10.43-22.601 17.013-37.576 17.013-14.976 0-28.414-6.583-37.577-17.014z' fill='%23fff' fill-opacity='.6'/%3E%3Ccircle cx='49' cy='29' r='17' fill='%23fff' fill-opacity='.7'/%3E%3C/g%3E%3C/svg%3E");
2379
- position: absolute;
2380
- left: 50%;
2381
- top: 50%;
2382
- transform: translate(-50%, -50%);
2383
- transform: translate(-50%, -50%) scale(0.6);
2384
- }
2385
-
2386
- .ul-audio-recorder-placeholder {
2387
- min-height: 150px;
2388
- width: 100%;
2389
- background-color: #fcfcfd;
2390
- display: block;
2391
- position: relative;
2392
- }
2393
-
2394
- .vjs-fullscreen .ul-audio-recorder-placeholder {
2395
- vertical-align: middle;
2396
- display: table-cell;
2397
- }
2398
-
2399
- .vjs-fullscreen .ul-control-panel {
2400
- height: 80px;
2401
- position: absolute;
2402
- bottom: 0;
2403
- left: 0;
2404
- width: 100%;
2405
- max-width: 100%;
2406
- background-color: #F8F8F8;
2407
- }
2408
-
2409
- .vjs-playback-rate .vjs-playback-rate-value {
2410
- align-items: center;
2411
- display: flex;
2412
- font-size: 12px;
2413
- justify-content: center;
2414
- }
2415
-
2416
- .vjs-playback-rate .vjs-menu {
2417
- left: -5px;
2418
- bottom: 3px;
2419
- }
2420
-
2421
- .vjs-menu-button-popup .vjs-menu .vjs-menu-content {
2422
- background-color: white;
2423
- border: 1px solid rgba(0, 0, 0, 0.1);
2424
- box-sizing: border-box;
2425
- border-radius: 4px;
2426
- }
2427
-
2428
- .vjs-menu li {
2429
- font-size: 12px;
2430
- padding: 5px 0;
2431
- }
2432
-
2433
- .vjs-menu li.vjs-selected {
2434
- color: lightgray;
2435
- }
2436
-
2437
- .vjs-menu li.vjs-menu-item:hover {
2438
- background-color: rgba(0, 0, 0, 0.05);
2439
- }
2440
-
2441
- .vjs-fullscreen .ul-buttons-panel {
2442
- top: calc(50% - 30px);
2443
- position: relative;
2444
- }
2445
-
2446
- .vjs-fullscreen .vjs-record-indicator.vjs-control {
2447
- bottom: 90px !important;
2448
- }
2449
-
2450
- .vjs-record.video-js div.vjs-control.vjs-record-indicator {
2451
- padding: 0.3em 0.75em 0.15em 15px;
2452
- align-items: center;
2453
- font-size: 12px;
2454
- color: #333;
2455
- background: #FCFCFD;
2456
- border-radius: 99px;
2457
- text-align: center;
2458
- border: 1px solid #E0E0EB;
2459
- display: flex;
2460
- justify-content: center;
2461
- align-items: center;
2462
- position: absolute;
2463
- bottom: 75px;
2464
- top: auto;
2465
- left: calc(50% - 21px);
2466
- width: 43px;
2467
- height: 16px;
2468
- z-index: 4;
2469
- }
2470
-
2471
- .vjs-record.video-js div.vjs-control.vjs-record-indicator:after {
2472
- content: "";
2473
- background-color: #EB5757;
2474
- width: 6px;
2475
- height: 6px;
2476
- border-radius: 8px;
2477
- animation: none;
2478
- top: 4px;
2479
- left: 5px;
2480
- }
2481
-
2482
- .vjs-record.video-js div.vjs-control.vjs-record-indicator:before {
2483
- position: relative;
2484
- font-size: 9px;
2485
- animation: none;
2486
- opacity: 1;
2487
- color: #333;
2488
- top: auto;
2489
- left: auto;
2490
- }
2491
-
2492
- .ul-video-player-loading {
2493
- display: inline-block;
2494
- position: relative;
2495
- width: 6rem;
2496
- height: 6rem;
2497
-
2498
- }
2499
- .ul-video-player-loading div {
2500
- box-sizing: border-box;
2501
- position: absolute;
2502
- display: block;
2503
- width: 80%;
2504
- height: 80%;
2505
- margin: 5px;
2506
- border: 5px solid #666;
2507
- border-radius: 50%;
2508
- animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
2509
- border-color: #666 transparent transparent transparent;
2510
- }
2511
-
2512
- .first {
2513
- animation-delay: -0.45s;
2514
- }
2515
- .second {
2516
- animation-delay: -0.3s;
2517
- }
2518
- .third {
2519
- animation-delay: -0.15s;
2520
- }
2521
-
2522
- @keyframes lds-ring {
2523
- 0% {
2524
- transform: rotate(0deg);
2525
- }
2526
- 100% {
2527
- transform: rotate(360deg);
2528
- }
2529
- }
2530
-
2531
- .ul-video-btn {
2532
- width: 100%;
2533
- border: 1px solid #E6E6E6;
2534
- border-radius: 4px;
2535
- background-color: rgba(0, 0, 0, 0.02);
2536
- padding: 8px;
2537
- font-weight: 500;
2538
- font-size: 15px;
2539
- }
2540
-
2541
- .ul-record-response-btn:before, .ul-record-response-btn:after, .ul-back-question-btn:before, .ul-back-question-btn:after {
2542
- margin: 0 5px;
2543
- vertical-align: middle;
2544
- }
2545
-
2546
- .ul-record-response-btn:before {
2547
- content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_2645_4654)'%3E%3Cpath d='M15.1491 4.75L10.5991 8L15.1491 11.25V4.75Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9.29912 3.4502H2.14912C1.43115 3.4502 0.849121 4.03223 0.849121 4.7502V11.2502C0.849121 11.9682 1.43115 12.5502 2.14912 12.5502H9.29912C10.0171 12.5502 10.5991 11.9682 10.5991 11.2502V4.7502C10.5991 4.03223 10.0171 3.4502 9.29912 3.4502Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_2645_4654'%3E%3Crect width='15.6' height='15.6' fill='white' transform='translate(0.199951 0.200195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
2548
- display: inline-block;
2549
- transform: translate(0px, 2px);
2550
- }
2551
-
2552
- .ul-record-response-btn:after {
2553
- content: 'Record your Response';
2554
- }
2555
-
2556
- .ul-back-question-btn:before {
2557
- content: url("data:image/svg+xml,%3Csvg width='15' height='16' viewBox='0 0 15 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.8757 8.22361L1.1118 14.6056C0.945578 14.6887 0.75 14.5678 0.75 14.382V1.61803C0.75 1.43219 0.945579 1.31131 1.1118 1.39443L13.8757 7.77639C14.06 7.86852 14.06 8.13148 13.8757 8.22361Z' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
2558
- display: inline-block;
2559
- transform: scale(0.85) translate(0, 1px);
2560
- -moz-transform: scale(0.85) translate(0, 2px);
2561
- }
2562
-
2563
- .ul-back-question-btn:after {
2564
- content: 'Back to Question';
2565
- }
2566
-
2567
- .hidden {
2568
- display: none !important;
2569
- opacity: 0;
2570
- visibility: hidden;
2571
- }
2572
-
2573
- .visible {
2574
- visibility: visible;
2575
- opacity: 1;
2576
- animation: fade 0.3s;
2577
- }
2578
-
2579
- @keyframes fade {
2580
- 0% {
2581
- opacity: 0;
2582
- }
2583
-
2584
- 100% {
2585
- opacity: 1;
2586
- }
2587
- }
2588
-
2589
- #ul-recording-countdown-screen {
2590
- width: 100%;
2591
- height: 100%;
2592
- color: black;
2593
- background-color: rgba(255, 255, 255, 0.8);
2594
- position: absolute;
2595
- text-align: center;
2596
- font-size: 15px;
2597
- z-index: 1;
2598
- display: table;
2599
- }
2600
-
2601
- .ul-countdown-text {
2602
- vertical-align: middle;
2603
- display: table-cell;
2604
- transform: translate(0, -25px);
2605
- }
2606
-
2607
- .vjs-fullscreen > #ul-recording-countdown-screen {
2608
- font-size: 25px;
2609
- transform: unset;
2610
- }
2611
-
2612
- .vjs-poster {
2613
- background-size: cover;
2614
- }
2615
- ` }], xo = "-video-player", Jn = "-secondary-video-player", Xn = "-video-recorder";
2616
- let _e, er;
2617
- const Ie = async ({ event: e, apiBase: t, headers: n, visitorId: r, envId: o, metadata: i }) => {
2618
- const s = U.document.documentElement;
2619
- if (!r || !o) return;
2620
- const d = { event: `SDK - ${e}`, visitorId: r, environmentId: o, metadata: { ...i || {}, screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: s.clientWidth, clientHeight: s.clientHeight, location: window.location.href, language: navigator.language } };
2621
- (await fetch(`${t}/sdk/1/visitors/${r}/analytics`, { method: "POST", cache: "no-cache", headers: n, body: JSON.stringify(d) })).ok || console.warn("[Sprig] (ERR-444) Failed to track analytics", e);
2622
- }, ke = async (e, t, n, r, o, i) => {
2623
- Ie({ event: `Video Error ${t}`, apiBase: n, headers: r, visitorId: o, envId: i, metadata: { errorMessage: e.message } });
2624
- const s = U.document.documentElement, d = { screenWidth: window.screen.width, screenHeight: window.screen.height, clientWidth: s.clientWidth, clientHeight: s.clientHeight, location: window.location.href, language: navigator.language }, l = { action: t, err: { message: e.message, stack: e.stack }, meta: d, vid: o, envId: i };
2625
- (await fetch(`${n}/sdk/1/errors`, { method: "POST", cache: "no-cache", headers: { ...r, "userleap-platform": "video_recorder", "x-ul-error": window.btoa(`userleap-${Date.now()}-error`) }, body: JSON.stringify(l) })).ok || console.warn("[Sprig] (ERR-444) Failed to report error to API", e);
2626
- }, ko = (e, t) => {
2627
- if (e.length === 0) return t && t();
2628
- Promise.all(e.reduce((n, r) => (n.push(((o, { type: i, content: s }) => new Promise(function(d, l) {
2629
- let u;
2630
- i === "script" ? (u = U.document.createElement("script"), u.src = s) : i === "link" ? (u = U.document.createElement("link"), u.rel = "stylesheet", u.href = s, u.type = "text/css") : (u = U.document.createElement("style"), u.innerHTML = s), u.onload = function() {
2631
- d(s);
2632
- }, u.onerror = function() {
2633
- l(s);
2634
- }, u.async = !1, u.id = btoa(s), o.appendChild(u);
2635
- }))(U.document.head, r)), n), [])).then(() => {
2636
- U.videojs = U.document.defaultView.videojs, t && t();
2637
- }).catch(function(n) {
2638
- console.log(n + " failed to load");
2639
- });
2640
- }, tr = (e, t, n) => {
2641
- if (t === "start" && (e.style.visibility = "visible"), t === "none") e.style.visibility = se;
2642
- else if (t === "success") e.style.visibility = se, e.innerHTML = "Upload succeeded!";
2643
- else {
2644
- const r = Math.round(parseFloat(n));
2645
- 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%)`;
2646
- }
2647
- }, Lt = (e, t) => {
2648
- const n = U.videojs(e.id());
2649
- return n == null ? void 0 : n.payload[t];
2650
- }, wo = (e, t) => {
2651
- const n = new (U.videojs.getComponent("Component"))(e);
2652
- return n.addClass("ul-buttons-panel"), t.map((r) => {
2653
- n.addChild(r);
2654
- }), cs(n), n;
2655
- }, cs = (e) => {
2656
- e.children().forEach((t) => {
2657
- if (he[t.name_]) {
2658
- const n = st(he[t.name_], `ul-${he[t.name_]}`);
2659
- t.el_.appendChild(n);
2660
- }
2661
- });
2662
- }, st = (e, t = "") => {
2663
- const n = U.document.createElement("span");
2664
- return n.className = "ul-button-text", n.innerHTML = e, n.id = t, n;
2665
- }, Co = (e, t, n, r, o = !1, i) => {
2666
- e.addClass("ul-video-player");
2667
- const s = new (U.videojs.getComponent("Component"))(e);
2668
- s.addClass("ul-control-panel"), e.progressBar = s.addChild("ProgressControl"), n && e.src(n), e.audioPlayerPlaceholder = new (U.videojs.getComponent("Component"))(e), e.audioPlayerPlaceholder.addClass("ul-audio-recorder-placeholder");
2669
- const d = n && n.src ? hs(n.src) : null;
2670
- !n || !o && d ? (e.audioPlayerPlaceholder.hide(), U.document.getElementById(`${e.id()}_html5_api`).style.height = "100%", d && e.poster(d)) : (e.children()[0].classList.add("vjs-hidden"), U.document.getElementById(`${e.id()}_html5_api`).style.height = "0px"), e.on("play", () => {
2671
- o || !n || d || ps(e), i == null || i.play();
2672
- }), e.on("pause", () => {
2673
- i == null || i.pause();
2674
- }), e.on("seeked", () => {
2675
- i == null || i.currentTime(e.currentTime());
2676
- }), e.on("ratechange", () => {
2677
- i == null || i.playbackRate(e.playbackRate());
2678
- }), e.addChild(e.audioPlayerPlaceholder, {}, 1), s.addChild(t), e.addChild(s), r && r(e);
2679
- }, us = (e, t, n, r, o, i, s, d = !1) => {
2680
- er = Date.now();
2681
- const l = pt(t, { controls: !1, bigPlayButton: !1, fluid: !1, width: 1280, height: 720, playsinline: !0, plugins: { record: { audio: !0, video: { mandatory: { minWidth: 1280, minHeight: 720 } }, frameWidth: 1280, frameHeight: 720, maxLength: 600, autoMuteDevice: !0 } } });
2682
- if (!l) return;
2683
- l.payload = n;
2684
- const { surveyId: u, questionId: p, responseGroupUid: c, visitorId: f, envId: g } = n;
2685
- let m;
2686
- const b = (j) => {
2687
- const h = jt, y = jt + "-audio-only";
2688
- tr(l.uploadProgressLabel, "none"), _e && _e.startTime >= er && _e.abort();
2689
- const k = U.document.getElementById("ul-camera-button");
2690
- j ? (l.children()[0].classList.add("vjs-hidden"), I.removeClass(h), I.addClass(y), k.innerHTML = he.TurnOnCamera, l.audioPlayerPlaceholder.removeClass("vjs-hidden"), m == null || m.getTracks().forEach((N) => {
2691
- N.stop();
2692
- }), window.navigator.mediaDevices.getUserMedia({ video: !0, audio: !0 }).then((N) => {
2693
- m = N, N.getVideoTracks().forEach((D) => {
2694
- D.enabled = !1;
2695
- }), l.record().onDeviceReady(N);
2696
- }).catch(l.record().onDeviceError.bind(l.record()))) : (m == null || m.getVideoTracks().forEach((N) => {
2697
- N.enabled = !0;
2698
- }), l.children()[0].classList.remove("vjs-hidden"), l.record().getDevice(), I.removeClass(y), I.addClass(h), k.innerHTML = he.TurnOffCamera, l.audioPlayerPlaceholder.addClass("vjs-hidden"));
2699
- }, v = new (U.videojs.getComponent("Button"))(l, { clickHandler: () => {
2700
- v.hasClass(se) || (Ie({ event: "Video Delete Button Clicked", apiBase: r, headers: s, visitorId: f, envId: g, metadata: { questionId: p, responseGroupUid: c, surveyId: u } }), b(l.cameraOff), o(V.DELETE, {}), I.removeClass(se), v.addClass(se));
2701
- } });
2702
- v.addClass("ul-video-recorder-delete-button"), v.el_.appendChild(st(he.DeleteButton, "ul-delete-button"));
2703
- const w = U.document.getElementById(t), x = () => {
2704
- w.classList.contains("vjs-fullscreen") && l.cameraOff ? w.style.display = "table" : w.style.display = "flex";
2705
- };
2706
- x();
2707
- const I = new (U.videojs.getComponent("Button"))(l, { clickHandler: () => {
2708
- l.record().isRecording() || (l.cameraOff = !l.cameraOff, Ie({ event: "Video Camera Button Clicked", apiBase: r, headers: s, visitorId: n.visitorId, envId: n.envId, metadata: { questionId: p, responseGroupUid: c, surveyId: u, cameraOff: l.cameraOff } }), b(l.cameraOff), !v.hasClass(se) && v.addClass(se), o(V.DELETE, {}), x());
2709
- } });
2710
- I.addClass(jt), I.el_.appendChild(st(he.TurnOffCamera, "ul-camera-button"));
2711
- const T = new (U.videojs.getComponent("Button"))(l, { clickHandler: () => {
2712
- const j = U.document.getElementById("ul-recorder-toggle");
2713
- if (l.record().isRecording()) l.record().stop(), j && (j.innerHTML = he.RecordButton), T.removeClass(Tt), v.removeClass(se);
2714
- else {
2715
- const h = U.document.getElementById("ul-recording-countdown-screen");
2716
- if (h) h.remove(), j && (j.innerHTML = he.RecordButton), b(l.cameraOff), o(V.DELETE, {}), I.removeClass(se), v.addClass(se), T.removeClass(Tt), _.show();
2717
- else {
2718
- T.addClass(Tt), _.hide(), I.addClass(se), v.addClass(se), j && (j.innerHTML = he.StopButton);
2719
- const y = U.document.createElement("div");
2720
- y.id = "ul-recording-countdown-screen", w.insertBefore(y, w.children[1]), y.style.height = `${w.offsetHeight}px`, So(l, 3);
2721
- }
2722
- }
2723
- } });
2724
- T.addClass("ul-video-recorder-toggle-button"), T.el_.appendChild(st(he.RecordButton, "ul-recorder-toggle"));
2725
- const C = U.document.createElement("p");
2726
- C.style.visibility = "hidden", C.className = "ul-upload-progress-label", e.appendChild(C), l.uploadProgressLabel = C;
2727
- const E = wo(l, [v, I, "PlayToggle", T, "FullscreenToggle"]), _ = E.children().find((j) => j.name_ === "FullscreenToggle");
2728
- _.hasClass("vjs-disabled") && _.hide();
2729
- const R = E.children().find((j) => j.name_ === "PlayToggle");
2730
- R.hide(), v.addClass(se), Co(l, E, i, !1, d), l.on("stopRecord", () => {
2731
- T.hide(), R.show(), _.show(), v.removeClass(se);
2732
- }), l.on("deviceReady", () => {
2733
- T.show(), R.hide(), v.addClass(se);
2734
- }), ((j, h, y, k, N) => {
2735
- const { surveyId: D, responseGroupUid: S, visitorId: P, envId: O } = j.payload;
2736
- j.on("deviceError", function() {
2737
- console.warn("device error: ", j.deviceErrorCode), j.deviceErrorCode.message === "Permission denied" ? (j.deviceButton.addClass("permission-denied"), y && y(V.ERROR, { type: V.PERMISSION_DENIED }), Ie({ event: "Video Permission Denied", apiBase: h, headers: N, visitorId: P, envId: O, metadata: { questionId: Lt(j, It), responseGroupUid: S, surveyId: D } })) : (y && y(V.ERROR, { type: V.OTHER }), ke(new Error(j.deviceErrorCode.message), "recorderDeviceError", h, N, P, O));
2738
- }), j.on("error", function(F, B) {
2739
- ke(B || j.error(), "recorderError", h, N, P, O);
2740
- }), j.on("startRecord", function(F, B) {
2741
- k(j.uploadProgressLabel, "none"), Ie({ event: "Video Record Start", apiBase: h, headers: N, visitorId: P, envId: O, metadata: { questionId: Lt(j, It), responseGroupUid: S, surveyId: D } });
2742
- }), j.on("finishRecord", async function() {
2743
- k(j.uploadProgressLabel, "start", 0);
2744
- const F = Lt(j, It);
2745
- if (!D) {
2746
- const J = "internal error: missing fields in payload";
2747
- return y && y(V.ERROR, { type: V.OTHER }), ke(new Error(J), "finishRecord", h, N, P, O), null;
2748
- }
2749
- j.record().stopDevice();
2750
- const B = j.cameraOff ? V.MEDIA_TYPE_AUDIO : V.MEDIA_TYPE_VIDEO, $ = Rt();
2751
- Ie({ event: "Video Record Finish", apiBase: h, headers: N, visitorId: P, envId: O, metadata: { mediaRecordingUid: $, questionId: F, responseGroupUid: S, surveyId: D, mediaType: B } });
2752
- const Q = { surveyId: D, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), mediaType: B, mediaRecordingUid: $ };
2753
- F && (Q.questionId = F), S && (Q.responseGroupUid = S), P && (Q.visitorId = P);
2754
- const K = await (async () => {
2755
- const J = await fetch(`${h}/2/environments/integrations/upload`, { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify(Q) });
2756
- if (J.ok) {
2757
- const pe = await J.json();
2758
- return y && y(V.UPLOAD_STARTED, { [V.UPLOAD_ID]: pe.upload.id, [V.MEDIA_TYPE]: B, [V.MEDIA_RECORDING_UID]: $ }), pe.upload.url;
2759
- }
2760
- return y && y(V.ERROR, { type: V.OTHER, response: J }), ke(new Error("failed to get upload response with url"), "finishRecord", h, N, P, O), null;
2761
- })();
2762
- K && (_e = U.document.defaultView.UpChunk.createUpload({ endpoint: K, file: new U.document.defaultView.File([j.recordedData], `recording ${B} ${Date.now()}`), chunkSize: 5120 }), _e.startTime = Date.now(), Ie({ event: "Video Upload Start", apiBase: h, headers: N, visitorId: P, envId: O, metadata: { mediaRecordingUid: $, questionId: F, responseGroupUid: S, surveyId: D, mediaType: B, url: K } }), _e.on("error", (J) => {
2763
- k(j.uploadProgressLabel, "none"), y && y(V.UPLOAD_FINISHED, { [V.MEDIA_RECORDING_UID]: $ }), ke(J, "finishRecord", h, N, P, O);
2764
- }), _e.on("progress", (J) => {
2765
- y && y(V.UPLOAD_PROGRESS, { [V.MEDIA_RECORDING_UID]: $, [V.UPLOAD_PROGRESS_PCT]: J.detail }), k(j.uploadProgressLabel, "progress", J.detail);
2766
- }), _e.on("success", () => {
2767
- k(j.uploadProgressLabel, "success"), y && y(V.UPLOAD_FINISHED, { [V.MEDIA_RECORDING_UID]: $ }), Ie({ event: "Video Upload Success", apiBase: h, headers: N, visitorId: P, envId: O, metadata: { mediaRecordingUid: $, questionId: F, responseGroupUid: S, surveyId: D, mediaType: B, url: K, elapsedMs: _e.startTime && Date.now() - _e.startTime } });
2768
- }));
2769
- });
2770
- })(l, r, o, tr, s);
2771
- const L = [{ name: "microphone" }];
2772
- !l.cameraOff && L.push({ name: "camera" }), Promise.all(L.map((j) => {
2773
- var h;
2774
- return (h = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : h.query(j);
2775
- })).then((j) => {
2776
- j.reduce((h, y) => h & y.state === "granted", !0) && l && (l.deviceButton && l.deviceButton.hide(), l.record().getDevice());
2777
- }).catch((j) => {
2778
- });
2779
- }, So = (e, t = 3) => {
2780
- const n = U.document.getElementById("ul-recording-countdown-screen");
2781
- n && t === 0 ? (n.remove(), e.record().start()) : n && (n.innerHTML = `<span class='ul-countdown-text'>Recording in... ${t}</span>`, setTimeout(() => {
2782
- So(e, t - 1);
2783
- }, 1e3));
2784
- }, Eo = (e) => {
2785
- const t = U.document.createElement("div");
2786
- return t.className = "ul-video-container", t.appendChild(((n) => {
2787
- const r = U.document.createElement("div");
2788
- return r.className = "ul-video-player-loading", r.id = an(n), ["first", "second", "third", "fourth"].map((o) => {
2789
- const i = U.document.createElement("div");
2790
- i.className = o, r.appendChild(i);
2791
- }), r;
2792
- })(e)), t;
2793
- }, Ft = (e, t) => {
2794
- const n = U.document.createElement("video");
2795
- n.id = e, n.className = "video-js vjs-default-skin ul-video-player-video";
2796
- const r = U.document.createElement("p");
2797
- r.className = "vjs-no-js", r.innerHTML = "To view this video please enable JavaScript, and consider upgrading to a web browser that";
2798
- const o = U.document.createElement("a");
2799
- return o.href = "https://videojs.com/html5-video-support/", o.target = "_blank", o.innerHTML = "supports HTML5 video", r.appendChild(o), n.appendChild(r), t.appendChild(n), t;
2800
- }, ps = (e, t) => {
2801
- e.children()[0].classList.remove("vjs-hidden"), e.audioPlayerPlaceholder.hide(), U.document.getElementById(`${e.id()}_html5_api`).style.height = "100%";
2802
- }, pt = (e, t) => U.document.getElementById(e) ? t ? U.videojs(e, t) : U.videojs(e) : (console.error(`Error in finding player element with ID, ${e}`), null), ms = (e, t, n, r = !1, o = "https://api.sprig.com", i = document, s = null, d = null) => {
2803
- U.document = i;
2804
- const l = e + xo, u = Eo(l);
2805
- return U.document.addEventListener("securitypolicyviolation", (p) => {
2806
- ke(new Error(`Voice & Video feature violates ${p.violatedDirective} web page CSP policies for the question player.`), "playerDeviceError", o, {});
2807
- }), ko(yo, () => {
2808
- U.document.getElementById(an(l)).remove(), Ft(l, u);
2809
- const p = { playsinline: !0, playbackRates: [0.5, 1, 1.5, 2], fill: !0 };
2810
- try {
2811
- const c = e + Jn;
2812
- Ft(c, u);
2813
- const f = pt(l, p), g = pt(c, { muted: !0, ...p });
2814
- if (!f || !g) return;
2815
- ((v, w, x) => {
2816
- v.addClass(`ul${Jn}`);
2817
- const I = new (U.videojs.getComponent("Component"))(v);
2818
- w && v.src(w), v.addChild(I), x && x(v);
2819
- })(g, s, d), s || g.addClass(se);
2820
- const m = wo(f, ["PlaybackRateMenuButton", "PlayToggle", "FullscreenToggle"]), b = m.children().find((v) => v.name_ === "FullscreenToggle");
2821
- b.hasClass("vjs-disabled") && b.hide(), Co(f, m, t, n, r, g);
2822
- } catch (c) {
2823
- return void ke(new Error(`Error when creating video player object ${c}`), "playerDeviceError", o, {});
2824
- }
2825
- }), u;
2826
- }, hs = (e) => {
2827
- if (!e) return null;
2828
- const t = e.match(/https:\/\/stream.mux.com\/(.*)/);
2829
- let n = t ? t[1] : null;
2830
- return n.includes(Kn) && (n = n.replace(Kn, "")), n ? `https://image.mux.com/${n}/thumbnail.jpg?time=0` : null;
2831
- }, V = { UPLOAD_STARTED: "upload.started", UPLOAD_PROGRESS: "upload.progress", UPLOAD_FINISHED: "upload.finished", DELETE: "delete", ERROR: "error", MEDIA_TYPE: "media.type", PERMISSION_DENIED: "permission_denied", OTHER: "other", UPLOAD_ID: "upload.id", UPLOAD_PROGRESS_PCT: "upload.progress.pct", MEDIA_RECORDING_UID: "media.recording.uid", MEDIA_TYPE_VIDEO: "video", MEDIA_TYPE_AUDIO: "audio" }, he = { PlaybackRateMenuButton: "Speed", PlayToggle: "Play", FullscreenToggle: "Expand", TurnOnCamera: "Turn on", TurnOffCamera: "Turn off", DeleteButton: "Delete", RecordButton: "Record", StopButton: "Stop", PauseButton: "Pause" }, Ne = "ul-card-video__player_recorder", nr = "ul-video-btn", Nt = 0, rr = 1, fs = ({ className: e, message: t, next: n, properties: r, questionId: o, type: i }) => {
2832
- const { apiURL: s, envId: d, handleUploadUpdate: l, headers: u, responseGroupUid: p, surveyId: c, update: f, viewDocument: g, visitorId: m } = A((h) => ({ apiURL: h.apiURL, envId: h.envId, handleUploadUpdate: h.handleUploadUpdate, headers: h.headers, responseGroupUid: h.responseGroupUid, surveyId: h.surveyId, update: h.update, viewDocument: h.viewDocument, visitorId: h.userId })), [b, v] = z(!1), [w, x] = z(null), [I, T] = z(null), [C, E] = z(Nt), _ = ee(null), R = r && r.videoUrl;
2833
- Y(() => {
2834
- const h = _.current, y = new ResizeObserver(() => {
2835
- f();
2836
- });
2837
- return h && y.observe(h), () => {
2838
- h && y.unobserve(h);
2839
- };
2840
- }, [f]);
2841
- const L = (h, y) => {
2842
- h === V.UPLOAD_STARTED ? (x(y[V.UPLOAD_ID]), T(y[V.MEDIA_RECORDING_UID]), v(!0)) : h === V.DELETE ? (x(null), T(null), v(!1)) : h === V.UPLOAD_PROGRESS ? isNaN(y[V.UPLOAD_PROGRESS_PCT]) ? l({ mediaRecordingUid: y[V.MEDIA_RECORDING_UID], isComplete: !0 }) : l({ mediaRecordingUid: y[V.MEDIA_RECORDING_UID], progressPct: y[V.UPLOAD_PROGRESS_PCT] }) : h === V.UPLOAD_FINISHED && l({ mediaRecordingUid: y[V.MEDIA_RECORDING_UID], isComplete: !0 });
2843
- }, j = (h) => {
2844
- h.preventDefault(), h.stopPropagation(), document.getElementById(Ne) && ((y) => {
2845
- const k = y + Xn;
2846
- if (U.document.getElementById(k) && U.videojs) {
2847
- try {
2848
- if (!U.videojs(k).record().stream) return;
2849
- } catch {
2850
- return;
2851
- }
2852
- U.videojs(k).record().stop(), U.videojs(k).record().stopDevice();
2853
- }
2854
- })(Ne), w && I ? (l({ mediaRecordingUid: I, isSubmitted: !0 }), n({ value: { mediaRecordingUid: I }, questionId: o, type: i }, !0)) : n({ value: null, questionId: o, type: i }, !0);
2855
- };
2856
- return a("form", { className: H(e, "ul-card--video", "fade-in-transition"), id: "ul-video-interview-form", children: [a(ue, { message: t, properties: r }), a(ve, { children: [a("div", { id: "ul-question-player-container", ref: _, style: { display: C === Nt ? "" : "none" }, children: [a("div", { id: Ne, ref: (h) => {
2857
- if (h && h.children.length === 0 && !r.hideRecordedPrompt) {
2858
- const y = ms(Ne, { src: R, type: "application/x-mpegURL" }, void 0, r.mediaType === V.MEDIA_TYPE_AUDIO, s, g);
2859
- h.appendChild(y);
2860
- }
2861
- } }), a(xe, { defaultBody: () => a("button", { className: `${nr} ul-record-response-btn`, onClick: (h) => {
2862
- h.preventDefault(), h.stopPropagation(), document.getElementById(Ne) && ((y) => {
2863
- const k = pt(y + xo);
2864
- k == null || k.pause();
2865
- })(Ne), E(rr);
2866
- } }), properties: r })] }), a("div", { style: { display: C === rr ? "block" : "none" }, children: [a("button", { className: `${nr} ul-back-question-btn`, onClick: (h) => {
2867
- h.preventDefault(), h.stopPropagation(), E(Nt);
2868
- }, style: { display: r.hideRecordedPrompt ? "none" : "block" } }), a("div", { id: "ul-recorder-player-container", ref: (h) => {
2869
- if (h && h.children.length === 0) {
2870
- const y = ((k, N = {}, D = "https://api.userleap.com", S, P, O, F = !1, B = document) => {
2871
- U.document = B;
2872
- const $ = k + Xn, Q = Eo($);
2873
- return U.document.addEventListener("securitypolicyviolation", (K) => {
2874
- ke(new Error(`Voice & Video feature violates ${K.violatedDirective} web page CSP policies for the recorder player.`), "recorderDeviceError", D, O, N.visitorId, N.envId);
2875
- }), ko(yo.concat(ds), () => {
2876
- Ft($, Q), U.document.getElementById(an($)).remove();
2877
- try {
2878
- us(Q, $, N, D, S, P, O, F);
2879
- } catch (K) {
2880
- return void ke(new Error(`Error when creating video recorder player object ${K}`), "recorderDeviceError", D, O, N.visitorId, N.envId);
2881
- }
2882
- }), Q;
2883
- })(Ne, { surveyId: c, responseGroupUid: p, questionId: o, visitorId: m, envId: d }, s, L, void 0, { ...u, "x-ul-video-recorder-origin": "sdk" }, r.mediaType === V.MEDIA_TYPE_AUDIO, g);
2884
- h.appendChild(y);
2885
- }
2886
- } })] })] }), a(Ee, { children: [a(ie, { disabled: !b, onClick: j, children: je(r) }), a("button", { className: "ul-card-text__button ul-button-inactive ul-card-skip__button", id: "ul-card-video__skip_button", onClick: j, style: { display: r.required ? "none" : "block", ...b ? { display: "none" } : {} }, children: rn(r) })] })] });
2887
- }, gs = ({ className: e }) => {
2888
- const { uploadProgress: t } = A((i) => ({ uploadProgress: i.uploadProgress }));
2889
- let n, r;
2890
- Object.values(t).filter((i) => i.isSubmitted).length > 1 ? (n = "Your responses are processing", r = "Please keep this tab open until your responses are fully processed.") : (n = "Your response is processing", r = "Please keep this tab open until your response is fully processed.");
2891
- const o = Math.round(Math.min(99, ...Object.values(t).filter((i) => i.isSubmitted).map((i) => i.progressPct || 0)));
2892
- return a("div", { className: H(e, "ul-card--uploading", "fade-in-transition"), children: [a("div", { "aria-busy": "true", "aria-label": "Processing...", "aria-live": "polite", className: "ul-loading-spinner-container", role: "progressbar", children: a("div", { className: "ul-loading-spinner", children: [a("div", { className: "first" }), a("div", { className: "second" }), a("div", { className: "third" }), a("div", { className: "fourth" })] }) }), a(ue, { message: `${n} (${o}% complete)` }), a("p", { className: "ul-caption", children: r })] });
2893
- }, vs = ({ isRightLabel: e, isLeftLabel: t }) => e ? me.RIGHT : t ? me.LEFT : null, bs = ({ className: e, labels: t, message: n, properties: r, options: o, questionId: i, type: s, next: d }) => {
2894
- var I, T, C, E;
2895
- const [l, u] = z(o.map((_, R) => ({ ..._, label: _.label === "" ? `Item ${R + 1}` : _.label, isRightLabel: !1, isLeftLabel: !1 }))), p = (() => {
2896
- const _ = Zt(co);
2897
- if (_ === void 0) throw new Error("usePreviousResponses must be used within a PreviousResponsesProvider");
2898
- return _;
2899
- })(), c = { padding: "12px", display: "flex", cursor: "pointer", width: "86px" }, [f, g] = z(!1);
2900
- Y(() => {
2901
- const _ = l.findIndex((D) => D.isRightLabel), R = l.findIndex((D) => D.isLeftLabel), L = _ !== -1 && R !== -1;
2902
- g(L);
2903
- const j = !r.required || r.required && L, h = l.map((D) => ({ id: D.id, option: D.label, selected: vs(D) })), y = Math.floor(i), k = Object.keys(p).filter((D) => D.startsWith(y.toString())).map(Number).sort((D, S) => D - S).at(-1), N = [];
2904
- if (typeof k == "number") {
2905
- const D = p[k], S = JSON.parse(D);
2906
- N.push(...S);
2907
- }
2908
- N.push(h), setTimeout(() => {
2909
- d({ value: N, questionId: i, type: s }, j, L), g(!1);
2910
- }, L ? 500 : 0);
2911
- }, [l]);
2912
- const { border: m, useMobileStyling: b } = A((_) => ({ border: _.border, useMobileStyling: _.useMobileStyling })), v = (_, R) => () => {
2913
- f || u((L) => ((j, h, y) => j.map((k) => k.id === h ? { ...k, isRightLabel: y === me.RIGHT, isLeftLabel: y === me.LEFT } : y === me.RIGHT && k.isRightLabel || y === me.LEFT && k.isLeftLabel ? { ...k, isRightLabel: !1, isLeftLabel: !1 } : k))(L, _, R));
2914
- }, w = (I = r.ratingIcons) == null ? void 0 : I[0].svg, x = (T = r.ratingIcons) == null ? void 0 : T[1].svg;
2915
- return a("form", { className: H(e, "ul-card-maxdiff", "fade-in-transition"), children: [a(ue, { message: n, properties: r }), a(ve, { children: a("div", { className: "ul-card--maxdiff__question-inner-container", children: [a("div", { className: "ul-card-maxdiff__labels-row", children: [a("div", { className: "ul-card-maxdiff__label", children: (t == null ? void 0 : t.left) || ((C = r == null ? void 0 : r.labels) == null ? void 0 : C.left) || "Most important" }), a("div", { className: "ul-card-maxdiff__label", children: (t == null ? void 0 : t.right) || ((E = r == null ? void 0 : r.labels) == null ? void 0 : E.right) || "Least important" })] }), l.map(({ id: _, label: R, isLeftLabel: L, isRightLabel: j }) => a("div", { className: "ul-card-maxdiff__option-row", children: [a("div", { className: "ul-card-maxdiff__option-control " + (x ? "smiley" : ""), children: x ? a("span", { "aria-pressed": L, className: L ? "ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected good" : "ul-card-maxdiff__option-btn", dangerouslySetInnerHTML: { __html: x }, id: `smiley-good-${_}`, onClick: v(_, me.LEFT), tabIndex: 0, type: "button" }) : a(Ae, { allowTextEntry: !1, ariaLabel: `leftLabel-${R}`, border: m, choiceStyle: c, error: !1, id: `${_}`, isRadio: !0, isSelected: L, onUserInputChanged: v(_, me.LEFT), useMobileStyling: b }) }), a("div", { className: "ul-card-maxdiff__option-label", children: R }), a("div", { className: "ul-card-maxdiff__option-control " + (w ? "smiley" : ""), children: w ? a("span", { "aria-pressed": j, className: j ? "ul-card-maxdiff__option-btn ul-card-maxdiff__option-selected bad" : "ul-card-maxdiff__option-btn", dangerouslySetInnerHTML: { __html: w }, id: `smiley-bad-${_}`, onClick: v(_, me.RIGHT), tabIndex: 0, type: "button" }) : a(Ae, { allowTextEntry: !1, ariaLabel: `rightLabel-${R}`, border: m, choiceStyle: c, error: !1, id: `${_}`, isRadio: !0, isSelected: j, onUserInputChanged: v(_, me.RIGHT), useMobileStyling: b }) })] }, _))] }) })] }, i);
2916
- }, _s = () => {
2917
- var w;
2918
- const { border: e, cards: t, forceBrandedLogo: n, headers: r, index: o, marketingUrl: i, showSurveyBrand: s, slugName: d, surveyId: l, viewedCardCount: u } = A((x) => ({ border: x.border, cards: x.cards, forceBrandedLogo: x.forceBrandedLogo, headers: x.headers, index: x.index, marketingUrl: x.marketingUrl, showSurveyBrand: x.showSurveyBrand, slugName: x.slugName, surveyId: x.surveyId, viewedCardCount: x.viewedCardCount })), p = ee(null), c = t.filter((x) => x.type !== "uploading" && x.type !== "thanks"), f = ((x, I) => {
2919
- const T = /* @__PURE__ */ new Set(["thanks", "uploading"]);
2920
- if (I >= x.length || I < 0 || T.has(x[I].type)) return 0;
2921
- const C = x.filter((_) => !T.has(_.type));
2922
- if (I === C.length - 1) return 1;
2923
- const E = { [C.length - 1]: 1, [-1]: 0 };
2924
- for (let _ = C.length - 2; _ >= I; _--) {
2925
- const R = C[_], L = bi(_, R.props.routingOptions);
2926
- if (L.length === 0) {
2927
- E[_] = E[_ + 1] + 1;
2928
- continue;
2929
- }
2930
- let j = 0, h = fi(R);
2931
- if (h === null) return C.length - 1 - I;
2932
- for (let y = 0; y < L.length && h.length !== 0; y++) {
2933
- const { comparator: k, target: N, value: D } = L[y], S = h.filter((P) => {
2934
- const O = hi({ value: P }, R.type, P), F = Zr(P, R.type);
2935
- return !(O && k === "answered" || F && k === "partial" || !O && !F && k === "skipped" || k === "given_up" && vi(P) && P.taskStatus === "given.up" || O && R.type === "open" && (k === "contains" || k === "notcontains") || O && gi(k) && tn[k](P, D));
2936
- });
2937
- if (S.length < h.length) {
2938
- const P = parseInt(String(N), 10);
2939
- if (P !== -1 && P <= _ || P >= C.length) return C.length - 1 - I;
2940
- j = Math.max(E[P] + 1, j);
2941
- }
2942
- h = S;
2943
- }
2944
- h.length > 0 && (j = Math.max(E[_ + 1] + 1, j)), E[_] = j;
2945
- }
2946
- return E[I];
2947
- })(t, o), g = u + 1, m = g / (g + f), b = io({ marketingUrl: i, slugName: d, surveyId: l, forceBrandedLogo: n });
2948
- Y(() => {
2949
- p.current && (p.current.style.width = 100 * m + "%");
2950
- }, [m]);
2951
- const v = ((w = t[o]) == null ? void 0 : w.type) === "thanks";
2952
- return a("footer", { className: "ul-footer " + (r["userleap-platform"] === "link" ? "ul-footer__link" : ""), children: v && n ? a(oo, { marketingUrlLink: b }) : a(ne, { children: [c.length > 1 && a("div", { className: "ul-progress-bar-container ul-progress-bar-container__footer", children: a("div", { className: "ul-progress-bar-current", ref: p, style: { border: `1px solid ${e || "#000"}` } }) }), s ? a(ro, { forceBrandedLogo: n, marketingUrlLink: b }) : null] }) });
2953
- }, ys = () => {
2954
- const e = A((s) => s.border), t = A((s) => s.cards), n = A((s) => s.index), r = A((s) => s.focusedQuestionId), { totalQuestions: o, fraction: i } = ge(() => {
2955
- var u;
2956
- const s = t.filter((p) => p.type !== "uploading" && p.type !== "thanks"), d = s.length;
2957
- if (d <= 1) return { totalQuestions: d, fraction: 0 };
2958
- if (((u = t[n]) == null ? void 0 : u.type) === "thanks") return { totalQuestions: d, fraction: 1 };
2959
- const l = s.findIndex((p) => p.name === r);
2960
- return { totalQuestions: d, fraction: (l >= 0 ? l : 0) / d };
2961
- }, [t, n, r]);
2962
- return o <= 1 ? null : a("div", { className: "ul-progress-bar-container ul-progress-bar-container__header", children: a("div", { className: "ul-progress-bar-current", style: { width: 100 * i + "%", border: `1px solid ${e ?? "#000"}` } }) });
2963
- }, xs = () => {
2964
- const { answers: e, border: t, cards: n, close: r, configureExitOnOverlayClick: o, destroy: i, endCard: s, eventEmitFn: d, fontFamily: l, headers: u, index: p, minScrollableHeight: c, next: f, previewMode: g, productConfig: m, seen: b, showStripes: v, studyType: w, surveyId: x, update: I, useMobileStyling: T, viewDocument: C } = A((S) => ({ answers: S.answers, border: S.border, cards: S.cards, close: S.close, configureExitOnOverlayClick: S.configureExitOnOverlayClick, destroy: S.destroy, endCard: S.endCard, eventEmitFn: S.eventEmitFn, fontFamily: S.fontFamily, headers: S.headers, index: S.index, previewMode: S.previewMode, productConfig: S.productConfig, minScrollableHeight: S.minScrollableHeight, next: S.next, seen: S.seen, showStripes: S.showStripes, studyType: S.studyType, surveyId: S.surveyId, update: S.update, useMobileStyling: S.useMobileStyling, viewDocument: S.viewDocument })), E = ee(null), _ = ee(!1), R = u["userleap-platform"], { props: L, type: j, name: h } = n[p];
2965
- Y(() => {
2966
- if (window.Sprig) return window.Sprig.trackHistory = (S) => A.getState().trackHistory(S), () => {
2967
- window.Sprig.trackHistory = void 0;
2968
- };
2969
- }, []), Y(() => {
2970
- E.current && (E.current.classList.contains("ul-app--visible") || E.current.classList.add("ul-app--visible"), !_.current && d && (_.current = !0, d(ce.SurveyAppeared, { name: ce.SurveyAppeared, "survey.id": x })));
2971
- }, [d, x]), Y(() => {
2972
- const S = () => {
2973
- C.visibilityState === "visible" && (b(), C.removeEventListener("visibilitychange", S));
2974
- };
2975
- return C.addEventListener("visibilitychange", S), S(), () => {
2976
- C.removeEventListener("visibilitychange", S);
2977
- };
2978
- }, [b, C]), Y(() => {
2979
- I();
2980
- }, [p, I]), Y(() => {
2981
- o(() => r());
2982
- }, [r, o]);
2983
- const y = ge(() => Oo(n, p), [n, p]), k = po(n), N = De((S) => {
2984
- f({ data: S, completeSurvey: () => i(Ue), endCard: s }), Do(C);
2985
- }, [f, i, s, C]);
2986
- if (e) {
2987
- for (const S of e) if (S.questionId === h) {
2988
- let P;
2989
- if (j === "multiplechoice") {
2990
- const O = L.options.find(({ value: F }) => F === S.value);
2991
- if (!O) break;
2992
- P = { [O.id]: O.value };
2993
- } else P = S.value;
2994
- N({ value: P, type: j, questionId: S.questionId });
2995
- break;
2996
- }
2997
- }
2998
- const D = !T && ((m == null ? void 0 : m.framePosition) === "center" || (m == null ? void 0 : m.desktopDisplay) === "center-modal" || ((m == null ? void 0 : m.placement) || "").includes("center"));
2999
- return a("div", { className: H("ul-app", lt(u) ? "ul-app--visible" : "ul-app--overlay"), dir: "auto", id: Ue, onClick: (S) => {
3000
- var B;
3001
- const P = window.sprigAPI, O = S.target;
3002
- if (!P || !O) return;
3003
- const F = [O, O.parentElement];
3004
- for (const $ of F) if (((B = $ == null ? void 0 : $.tagName) == null ? void 0 : B.toLowerCase()) === "a") {
3005
- S.preventDefault();
3006
- try {
3007
- const Q = new URL($.href);
3008
- Q.protocol !== "http:" && Q.protocol !== "https:" || (P == null || P.openUrl(Q.toString()));
3009
- } catch (Q) {
3010
- console.error(Q);
3011
- }
3012
- return;
3013
- }
3014
- }, ref: E, style: { "--theme": t, ...l ? { fontFamily: l.replace(";", "") } : {}, ...D ? { position: "relative" } : {} }, children: a("div", { className: "ul-app__container", children: a("div", { className: H(oe("ul-card__container", T, w)), style: { ...w !== "feedbackButton" || (m == null ? void 0 : m.desktopDisplay) === "center-modal" ? { borderColor: t } : {}, ...(m == null ? void 0 : m.desktopDisplay) === "slider" ? { margin: "0px" } : {} }, children: a("div", { className: "sprig-container", style: { minHeight: c }, children: [v && a("div", { className: "ul-header__container", dir: "ltr", children: a("div", { className: "ul-header", children: "For development purposes only" }) }), g && a("div", { className: "ul-header__container", dir: "ltr", children: a("div", { className: "ul-header", children: "Preview Mode: Response will not be recorded." }) }), le(w) && a(ys, {}), a("div", { className: H(xi("ul-card-main-content", R)), children: a(Yi, { cards: y, next: N, previousResponses: k }) }), !le(w) && a(_s, {})] }) }) }) });
3015
- }, Io = () => MediaRecorder.isTypeSupported("video/webm") ? "video/webm" : "video/mp4", or = (e) => {
3016
- const t = { audioBitsPerSecond: 128e3, videoBitsPerSecond: 25e5, mimeType: Io() };
3017
- return new MediaRecorder(e, t);
3018
- }, ir = (e, t, n) => {
3019
- n[t] = [], e.ondataavailable = function(r) {
3020
- n[t].push(r.data);
3021
- }, e.currentMediaRecordingUid = t, e.start();
3022
- };
3023
- function sr(e, t, n, r, o, i) {
3024
- if (e && e.state !== "inactive") {
3025
- const { "begin.callback": s } = r, d = e.currentMediaRecordingUid;
3026
- if (!d) return;
3027
- s && s(d), e.onstop = () => async function(l, u, p, c, f, g, m) {
3028
- const b = A.getState().viewDocument, { "upload.callback": v, "progress.callback": w } = c, x = { mediaType: p, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), mediaRecordingUid: f, ...c["passthrough.data"] }, I = await (async (_, R) => {
3029
- var j;
3030
- const L = await fetch(R, { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify(_) });
3031
- if (L.ok) {
3032
- const h = await L.json();
3033
- return (j = h == null ? void 0 : h.upload) == null ? void 0 : j.url;
3034
- }
3035
- return null;
3036
- })(x, l);
3037
- if (!I) return void (v && v(null, { message: "failed to get upload url" }));
3038
- const T = new Blob(m, { type: Io() });
3039
- if (!b.defaultView) return;
3040
- const C = new b.defaultView.File([T], `recording video ${Date.now()}`), E = g.createUpload({ endpoint: I, file: C, chunkSize: 5120 });
3041
- E.on("error", (_) => {
3042
- v && v(null, _);
3043
- }), E.on("progress", (_) => {
3044
- w && w(f, _);
3045
- }), E.on("success", () => {
3046
- v && v(f, !0);
3047
- });
3048
- }(t, 0, n, r, d, o, i), e.stop();
3049
- }
3050
- }
3051
- const ks = { state: { chunks: {} }, stopRecording(e) {
3052
- const { uploadApiEndpoint: t, avRecorder: n, screenRecorder: r, UpChunk: o } = this.state, i = this.state.avStream && this.state.avStream.getVideoTracks().length > 0 ? "video" : "audio";
3053
- this.state.chunks && t && o && (n != null && n.currentMediaRecordingUid && sr(n, t, i, e, o, this.state.chunks[n == null ? void 0 : n.currentMediaRecordingUid]), r != null && r.currentMediaRecordingUid && sr(r, t, "screen", e, o, this.state.chunks[r == null ? void 0 : r.currentMediaRecordingUid]));
3054
- }, handleCancelledStream(e) {
3055
- const t = e.getVideoTracks(), n = e.getAudioTracks();
3056
- let r = t.length && t[0];
3057
- r = r || n.length && n[0], r && r.addEventListener("ended", () => {
3058
- [this.state.avRecorder, this.state.screenRecorder].map((o) => {
3059
- o && (o.state === "recording" && o.stop(), o.stream.getTracks().map((i) => {
3060
- i.readyState === "live" && i.stop();
3061
- }));
3062
- }), Object.assign(this.state, { avStream: null, captureStream: null, avRecorder: null, screenRecorder: null });
3063
- });
3064
- }, taskDurationMillisecond() {
3065
- return this.state.startTime ? (/* @__PURE__ */ new Date()).getTime() - this.state.startTime.getTime() : 0;
3066
- }, setUpChunk(e) {
3067
- this.state.UpChunk = e;
3068
- }, configure(e, t) {
3069
- Object.assign(this.state, t), this.state.uploadApiEndpoint = `${t.apiURL}/2/environments/integrations/upload`, this.state.chunks = {}, e.on("permission.status", this.permissionStatusCallback.bind(this)), e.on("av.permission", async (n) => {
3070
- this.avPermissionCallback(n);
3071
- }), e.on("begin.recording", this.beginRecordingCallback.bind(this)), e.on("start.task", this.startTaskCallback.bind(this)), e.on("screen.permission", async (n) => {
3072
- this.screenPermissionCallback(n);
3073
- }), e.on("finish.task", async (n) => {
3074
- this.finishTaskCallback(n);
3075
- });
3076
- }, async avPermissionCallback(e) {
3077
- var r, o, i;
3078
- const { "stream.ready": t, "permission.descriptors": n } = e;
3079
- try {
3080
- (r = this.state.avStream) != null && r.active && (this.state.avStream.getTracks().map((s) => s.readyState === "live" && s.stop()), ((o = this.state.captureStream) == null ? void 0 : o.getAudioTracks().length) === 1 && this.state.captureStream.removeTrack(this.state.captureStream.getAudioTracks()[0])), this.state.avStream = await navigator.mediaDevices.getUserMedia({ video: n.includes("camera"), audio: !0 }), ((i = this.state.captureStream) == null ? void 0 : i.getAudioTracks().length) === 0 && this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]), this.handleCancelledStream(this.state.avStream);
3081
- } catch (s) {
3082
- return console.warn("Error: failed to get permissions: " + s), void (t && t(null, null));
3083
- }
3084
- t && t(this.state.avStream, this.state.captureStream);
3085
- }, async screenPermissionCallback(e) {
3086
- const { "screen.permission.requested": t, "stream.ready.callback": n } = e;
3087
- t == null || t(!0);
3088
- try {
3089
- this.state.captureStream = await navigator.mediaDevices.getDisplayMedia({ video: !0, cursor: "always", displaySurface: "browser", preferCurrentTab: !0 });
3090
- } catch (r) {
3091
- return t == null || t(!1), console.warn("Error: failed to get permissions: " + r), void (n && n(null, null));
3092
- }
3093
- t == null || t(!1), this.state.avStream && this.state.avStream.getAudioTracks().length > 0 && this.state.captureStream.addTrack(this.state.avStream.getAudioTracks()[0]), this.handleCancelledStream(this.state.captureStream), n && n(this.state.avStream || null, this.state.captureStream);
3094
- }, beginRecordingCallback(e) {
3095
- const { "recording.media.types": t, "start.recording.callback": n = () => {
3096
- } } = e;
3097
- if (!t) return;
3098
- const r = [];
3099
- if (t.includes("video") && this.state.avStream) {
3100
- this.state.avRecorder = or(this.state.avStream);
3101
- const o = Rt();
3102
- ir(this.state.avRecorder, o, this.state.chunks), r.push(o);
3103
- }
3104
- if (t.includes("screen") && this.state.captureStream) {
3105
- this.state.screenRecorder = or(this.state.captureStream);
3106
- const o = Rt();
3107
- ir(this.state.screenRecorder, o, this.state.chunks), r.push(o);
3108
- }
3109
- r && n && n(r);
3110
- }, async finishTaskCallback(e) {
3111
- const { "current.index": t, "task.response": n, "task.complete.callback": r } = e;
3112
- await this.stopRecording(e), r && r(this.taskDurationMillisecond()), this.state.cards && this.state.hasEndCard !== void 0 && this.lookAheadAndStopStream(t, n, this.state.cards, this.state.hasEndCard);
3113
- }, startTaskCallback() {
3114
- this.state.startTime = /* @__PURE__ */ new Date();
3115
- }, permissionStatusCallback(e) {
3116
- var r;
3117
- const { "permission.status.callback": t } = e, n = this.state.avStream;
3118
- t && t(n, !!n && (n == null ? void 0 : n.getVideoTracks().length) > 0, !!((r = this.state.captureStream) != null && r.active), this.state.captureStream);
3119
- }, lookAheadAndStopStream(e, t, n, r) {
3120
- const { avRecorder: o, screenRecorder: i } = this.state, { allResponses: s } = A.getState(), d = Gr({ cards: n, index: e, hasEndCard: r, allResponses: s });
3121
- d !== null && n[d].type === "recordedtask" || [o, i].map((l) => {
3122
- l && (l.state === "recording" && l.stop(), l.stream.getTracks().map((u) => {
3123
- u.readyState === "live" && u.stop();
3124
- }));
3125
- });
3126
- } }, at = Object.create(ks);
3127
- Object.freeze(at);
3128
- const ws = ({ mode: e = null, viewWindow: t, viewDocument: n, trackPageViewUrl: r }) => {
3129
- const o = n.documentElement;
3130
- let i;
3131
- try {
3132
- i = t.parent.location.href;
3133
- } catch {
3134
- i = t.location.href;
3135
- }
3136
- return { mode: e, sw: t.screen.width, sh: t.screen.height, cw: o.clientWidth, ch: o.clientHeight, p: r ?? i, l: t.navigator.language };
3137
- }, Es = { configure: function(e, t = !0) {
3138
- var w;
3139
- const { answers: n, apiURL: r, endCard: o, eventEmitFn: i, fontFamilyURL: s, frame: d, previewKey: l, viewDocument: u, viewWindow: p } = e, c = lt(e.headers) ? e.frame : u.body, f = e.UpChunk || window.UpChunk, g = Qe, m = ((x, I) => {
3140
- const T = [...x], C = /* @__PURE__ */ new Set(["videovoice", "recordedtask"]);
3141
- return x.some((E) => C.has(E.type)) && T.push({ name: -2, props: { routingOptions: [] }, type: "uploading" }), I && T.push({ name: -1, props: { routingOptions: [] }, type: "thanks" }), T;
3142
- })(e.cards, !!o);
3143
- at.configure(g, { cards: m, hasEndCard: !!o, apiURL: r, UpChunk: f }), A.setState({ apiURL: r, answers: n, border: e.border, index: e.startingQuestionIdx || 0, cards: m, configureExitOnOverlayClick: e.configureExitOnOverlayClick, customMetadata: e.customMetadata, endCard: e.endCard, envId: e.envId, eventEmitFn: i, fontFamily: e.fontFamily, forceBrandedLogo: e.forceBrandedLogo, frame: d, headers: e.headers, hasViewedEmbed: !1, isPreview: e.isPreview, marketingUrl: "https://sprig.com", meta: ws({ mode: e.mode, viewWindow: p, viewDocument: u, trackPageViewUrl: e.trackPageViewUrl }), mode: e.mode, previewKey: l, previewMode: e.previewMode, productConfig: e.productConfig, recorder: at, recorderEventEmitter: g, responseGroupUid: e.responseGroupUid, showStripes: e.showStripes, showSurveyBrand: e.showSurveyBrand, slugName: e.slugName, styleNonce: e.styleNonce, studyType: e.studyType, surveyId: e.surveyId, tabTitle: e.tabTitle, uploadingCardViewed: !1, uploadProgress: {}, useMobileStyling: e.useMobileStyling, useDesktopPrototype: e.useDesktopPrototype, userId: e.userId, viewDocument: e.viewDocument, visitorAttributes: e.visitorAttributes, viewedCardCount: e.startingQuestionIdx || 0 });
3144
- const { head: b } = u;
3145
- if (dn({ document: u, elementId: "sprig-style", styleString: `html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}ol,ul{padding-inline-start:1em}.ul-loading-spinner-container{font-size:1.8rem;flex-grow:1;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.ul-loading-spinner{display:inline-block;position:relative;width:6rem;height:6rem}.ul-loading-spinner div{box-sizing:border-box;display:block;position:absolute;width:80%;height:80%;margin:5px;border:5px solid #152e3e;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:#152e3e transparent transparent transparent}.ul-loading-spinner .first{animation-delay:-.45s}.ul-loading-spinner .second{animation-delay:-.3s}.ul-loading-spinner .third{animation-delay:-.15s}@keyframes lds-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.fade-in-transition{animation:fadeIn .4s ease-in}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.ul-card{flex:1 1 auto;border-radius:2px;display:flex;flex-direction:column;font-size:17px;line-height:19px;text-align:start;min-width:200px;justify-content:center;animation:enable-transitions 0s .3s forwards;min-height:0}@keyframes enable-transitions{to{transition:opacity .2s ease-in-out}}.ul-focus-transitions-active .ul-card,.ul-card--with-transitions{transition:opacity .2s ease-in-out}.ul-card__container--desktop{border:2px solid #fff;box-shadow:0 0 15px #00000026;margin:15px}.ul-card__container--mobile{border-width:0;box-shadow:0 0 5px #00000040;margin-top:5px}.ul-card__container--desktop_longFormSurvey,.ul-card__container--mobile_longFormSurvey{margin:0}.sprig-container{display:flex;flex-direction:column;width:100%;height:fit-content;flex:1 1 auto;min-height:0;justify-content:center}.ul-card__container{background:#fff;border-radius:6px;display:flex;flex-direction:column;flex-grow:1;flex:1 1 auto;font-size:17px;line-height:23px;padding:0;min-height:0;position:relative;text-align:center;word-break:normal;overflow:auto}.ul-card__container--desktop_feedbackButton{box-shadow:unset}.ul-card-vertical__button-wrapper{flex-direction:column;align-items:center}.ul-card__button-wrapper{margin-top:4px;display:flex;gap:16px;justify-content:center;align-self:stretch}.sprig-question-footer-container{align-items:center;width:100%;height:fit-content;display:flex;flex-direction:column;padding:12px 20px 0}.long-form-question-footer-container{position:fixed;bottom:0;left:0;width:100%;display:flex;justify-content:space-between;align-items:center;overflow:visible;z-index:1000;pointer-events:none;padding:32px}.long-form-question-footer-container--mobile{background-color:#fff;border-top:1px solid #e6e6e6;padding:16px 24px}.long-form-question-footer-container-center{justify-content:center}.long-form-question-footer-container .long-form-question-footer-container-logo{width:auto;pointer-events:auto}.long-form-question-footer-container-center .long-form-question-footer-container-logo{margin-left:0}.long-form-question-footer-container .long-form-question-footer-container-actions{display:flex;gap:8px;pointer-events:auto}.long-form-question-footer-container .long-form-question-footer-container-actions .long-form-button{display:flex;justify-content:center;align-items:center;gap:8px;padding:12px;border-radius:8px;height:40px;width:40px}.long-form-question-footer-container .long-form-question-footer-container-actions .long-form-button .long-form-button-text-container{display:flex;align-items:center}.ul-rich-text-body{min-height:2em}.ul-rich-text-body,.ul-rich-text-body p{margin-top:10px;margin-bottom:10px}.ul-rich-text-body li{margin:5px 0}.ul-rich-text-body p,.ul-rich-text-body li{font-size:15px;line-height:130.35%;letter-spacing:.02em;color:#343442;text-align:start;white-space:pre-line}.ul-rich-text-body:last-child,.ul-rich-text-body li:last-child{margin-bottom:15px}.ul-card-main-content__link,.ul-card-main-content__email,.ul-card-main-content__web,.ul-card-main-content__android,.ul-card-main-content__ios{display:flex;flex:1 1 auto;min-height:0;flex-direction:column;z-index:2;height:fit-content}.sprig-border-bottom{border-bottom:1px solid rgba(0,0,0,.1)}.sprig-border-top{border-top:1px solid rgba(0,0,0,.1)}.question-header-container{z-index:1}.sprig-header-container{padding:16px}.question-header-button-container{display:grid;grid-template-columns:97fr 3fr;align-items:center;justify-content:space-between;width:100%;height:fit-content}.ul-card--thanks-content .question-header-button-container{justify-content:center}.sprig-question-body{padding:0 20px;min-height:0;flex-shrink:1;overflow:auto;position:relative;align-self:stretch;width:100%}.sprig-stretch{align-self:stretch}.ul-question{color:#343442;display:block;font-size:17px;line-height:125%;font-weight:500;cursor:default;text-align:start}.ul-question ol,.ul-question ul,.ul-caption ol,.ul-caption ul{margin-left:1em}.ul-caption{flex:1 0 auto;font-size:14px;line-height:130.35%;letter-spacing:.02em;color:#6c6c6e;text-align:start;margin-top:4px}.ul-card__choices{margin:5px 0 0;flex:1 0}.choice--mobile{border:2px solid #e6e6e6}.choice--desktop{border:1px solid #e6e6e6}.choice{align-items:flex-start;color:#262136;cursor:pointer;display:flex;justify-content:flex-start;flex-direction:column;box-sizing:border-box;border-radius:3px;margin-bottom:7px;font-size:15px;line-height:20px;padding:10px 20px 10px 15px;background-color:#00000003}.choice--desktop:hover,.choice--desktop:active,.choice--mobile:active{background-color:#0000000d}.choice-label-container{align-items:center;display:flex;flex-direction:row;flex:0 0 fit-content;gap:15px;height:fit-content;justify-content:flex-start;width:100%}.choice-text-entry-container{width:100%;height:fit-content;flex:0 1 fit-content;overflow:hidden}.choice .choice-text-input--mobile{max-height:63px}.choice .choice-text-input--desktop{max-height:150px}.choice .choice-text-input{box-sizing:border-box;background-color:transparent;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:20px;max-height:60px;padding:0;margin-top:8px;resize:none;width:100%;font-size:14px;line-height:20px;outline:none;border:none;overflow-wrap:break-word}.choice .choice-text-input::placeholder{color:#6c6c6e80}.ul-thanks-check{text-align:center;margin-bottom:20px}.ul-card--thanks-content{padding:20px 0 10px}.ul-card--thanks .ul-question{padding-top:0;text-align:center}.ul-card--thanks .ul-caption{padding-top:0;text-align:center;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;hyphenate-limit-lines:no-limit}.ul-card--uploading .ul-question{padding-top:15px;text-align:center}.ul-card--uploading .ul-caption{padding-top:5px;text-align:center;overflow-wrap:break-word}.select-checkbox{height:16px;width:16px;display:flex;box-sizing:border-box;background-color:"transparent";align-items:center;justify-content:center;border-radius:4px;border:1px solid #b0b5b7;flex-shrink:0}.select-radio{height:16px;width:16px;border-radius:16px;border:1px solid #323232;display:flex;box-sizing:border-box;box-shadow:inset 2px 2px #0000001a;background-color:"transparent";align-items:center;justify-content:center}.footer{width:100%;margin-top:12px;font-size:12px;line-height:12px;color:#000000b3}[class^=CenteredSurveyLayout] .ul-header__container,[class^=QuestionConceptTestLayout] .ul-header__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{margin-bottom:unset}[class^=CenteredSurveyLayout] .ul-card__container,[class^=QuestionConceptTestLayout] .ul-card__container,.ul-websurvey-frame .ul-card__container,.ul-websurvey-frame-mobile .ul-card__container{align-self:center;box-shadow:unset;border-radius:unset;border:none!important;position:unset;width:100%}@media only screen and (min-height: 600px) and (width: 600px){.ul-card{position:relative;top:-20px}}.ul-vertical-centered-container{display:flex;flex-direction:column;align-items:center;align-self:stretch}.sprig-accordion{width:100%;margin-bottom:8px}.sprig-accordion-body{width:100%;overflow:hidden}.sprig-accordion-header-container{background:transparent;border:none;display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;cursor:pointer;margin:8px 0 0;padding:0;font-family:inherit}.sprig-header-label-container{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;flex:1 1 0}.sprig-header-label{color:#343442;font-size:15px;font-weight:590;line-height:21px;text-align:start;overflow:hidden}.sprig-check-background{flex:0 0 16px;height:16px;width:16px;border-radius:8px;margin-right:8px;background-color:#efefee;display:flex;align-items:center;justify-content:center}.sprig-check{height:9px;width:9px;margin-left:-1px}.sprig-check path{stroke:#506067;stroke-width:1.5}.sprig-caret{height:20px;width:20px;transition-property:transform}.sprig-caret path{stroke:#000}.ul-card-longform__submit-button-container{display:flex;justify-content:flex-end}.ul-card-longform__submit-button-container .ul-card-longform__submit-button{display:flex;flex-direction:row;align-items:center;white-space:nowrap;gap:4px;border-radius:8px;color:#fff;cursor:pointer}.ul-card-longform__submit-button-container .ul-card-longform__submit-button:disabled{opacity:.5;cursor:not-allowed}.ul-card-list-container--longform{display:flex;flex-direction:column;gap:2rem;width:100%;align-items:center;padding-block-start:calc(40vh - 100px);padding-block-end:calc(50vh - 100px);height:auto}@media (min-height: 1200px){.ul-card-list-container--longform{padding-block-start:calc(50vh - 100px)}}.ul-card-scroll-wrapper{width:100%;max-width:100vw;position:relative;display:flex;justify-content:center}.ul-card--unfocused{opacity:.3;transition:opacity .3s ease-in-out}.ul-consent-legal__name-input--mobile{border:2px solid #e6e6e6}.ul-consent-legal__name-input--desktop{border:1px solid #e6e6e6}.ul-consent-legal__name-input{background:#00000003;box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;padding:10px 20px 10px 15px;border-radius:3px;font-size:15px;line-height:20px;margin-bottom:7px;width:100%}.ul-consent-legal__name-input::placeholder{color:#6c6c6e80}.ul-consent-legal__name-input:focus{outline:none;background:#fff}.ul-consent-legal__name-input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__consent-legal .choice{font-size:15px;padding:10px 15px;background-color:#00000003}.ul-card__consent-legal .choice--desktop:hover,.ul-card__consent-legal .choice--desktop:active,.ul-card__consent-legal .choice--mobile:active{background-color:#0000000d}.ul-card--likert__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.ul-card--likert__numbers>button{padding:unset}.likert-number--mobile{border:2px solid #e6e6e6}.likert-number--mobile:not(:first-child){margin-inline-start:-2px}.likert-number--desktop{border:1px solid #e6e6e6}.likert-number--desktop:not(:first-child){margin-inline-start:-1px}.likert-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px}.likert-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.likert-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.likert-number:active,.likert-number--desktop:hover{background-color:#0000000d;font-weight:500}.likert-star--mobile:not(:first-child){margin-inline-start:-2px}.likert-star--desktop:not(:first-child){margin-inline-start:-1px}.likert-star{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;font-size:18px;line-height:24px;height:67px;background:unset;border:unset}.likert-smiley--mobile:not(:first-child){margin-inline-start:-2px}.likert-smiley--desktop:not(:first-child){margin-inline-start:-1px}.likert-smiley{align-items:center;cursor:pointer;display:flex;justify-content:space-between;flex:1 0;color:transparent;line-height:24px;height:67px;background:unset;border:unset}.likert-smiley>svg{margin:0 auto}.likert-smiley circle:not(:first-child){fill-opacity:1}.ul-card--likert__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card--likert__labels>span:last-child{margin-left:auto;flex:1 1 auto;min-width:0;text-align:right}.ul-card--matrix_grid{display:grid;grid-template-columns:max-content repeat(var(--numColumns),minmax(107px,1fr));grid-template-rows:repeat(var(--numRows),min-content);margin:0 auto;row-gap:4px;width:max-content}.ul-card--matrix_grid_longform{width:100%}.ul-matrix-row-options{display:grid;grid-column:2/-1;grid-template-columns:subgrid}.ul-matrix-column-label{font-size:15px;max-width:150px;padding:10px 12px;text-align:center}.ul-card--matrix_container{margin-bottom:16px;overflow:auto}.ul-card--matrix_question_container{display:flex;flex-direction:column}.ul-matrix-scroll-gradient{-webkit-mask-image:linear-gradient(90deg,#000 90%,transparent);mask-image:linear-gradient(90deg,#000 90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl){-webkit-mask-image:linear-gradient(270deg,#000,90%,transparent);mask-image:linear-gradient(270deg,#000,90%,transparent)}.ul-matrix-scroll-gradient:dir(rtl)+.ul-matrix-scroll-arrow{rotate:180deg}.ul-matrix-scroll-arrow{align-self:flex-end;background:none;border:none;color:#000;padding:0;position:absolute;top:45%}.ul-matrix-scroll-arrow:hover{cursor:pointer}.ul-matrix-option-wrapper{align-items:center;background:#f9f9f8;display:flex;justify-content:center;padding:10px 12px}.ul-matrix-last-option{border-start-end-radius:4px;border-end-end-radius:4px}.ul-matrix-row-label{align-items:center;background:#f9f9f8;border-end-start-radius:4px;border-start-start-radius:4px;display:flex;font-size:15px;left:0;right:0;max-width:200px;min-width:100px;padding:10px 12px;position:sticky}.ul-matrix-option-selected{border:6px solid var(--border);box-shadow:none}.ul-card__matrix{max-width:100%}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}.ul-card--nps__numbers{align-items:center;border-radius:5px;display:flex;flex-direction:row;flex:1 0;justify-content:center;margin:5px 0 0}.nps-number--mobile{border:2px solid #e6e6e6}.nps-number--mobile:not(:first-child){margin-inline-start:-2px}.nps-number--desktop{border:1px solid #e6e6e6}.nps-number--desktop:not(:first-child){margin-inline-start:-1px}.nps-number{align-items:center;cursor:pointer;display:flex;justify-content:center;flex:1 0;background-color:#00000003;font-size:18px;line-height:24px;height:67px;padding:unset}.nps-number:first-child{border-start-start-radius:5px;border-end-start-radius:5px}.nps-number:last-child{border-start-end-radius:5px;border-end-end-radius:5px}.nps-number:active,.nps-number--desktop:hover{background-color:#0000000d;font-weight:500}.ul-card--nps__labels{align-items:center;color:#262136;display:flex;flex-direction:row;flex:1 0;font-weight:500;font-size:13px;line-height:15px;justify-content:space-between;margin:7px 0 10px}.ul-card-rank__labels{font-size:14px;font-style:normal;font-weight:600;line-height:150%}.ul-card--rank__question-inner-container{padding:0 16px}.ul-card-rank__list{list-style-type:none;padding-inline-start:0;margin:4px 0}.ul-card-rank__option{display:flex;align-items:center;padding:8px;gap:8px;align-self:stretch;border:1px solid #e2e3e1;border-radius:8px;margin-bottom:4px}.ul-card-rank__option:last-child{margin-bottom:0}.ul-card-rank__drag-btn{display:inline-flex;align-items:center;justify-content:center;line-height:0;padding:0;width:25px;height:25px;margin-left:auto;color:#0b2330;cursor:grab;background:transparent;border:0}.ul-card-rank__drag-btn:active,.ul-card-rank__option:active{cursor:grabbing}.ul-card-rank__option svg{display:block}.ul-card-rank__option.is-dragging{opacity:1;box-shadow:0 8px 25px #00000026,0 3px 10px #0000001a;z-index:1000;background:#fff;border-color:#0b2330;transition:none}.ul-card-rank__option.is-drop-target{background:#0b23301a;border-radius:8px;border-color:#0b23301a}.ul-card-rank__option.is-drop-target select,.ul-card-rank__option.is-drop-target span,.ul-card-rank__option.is-drop-target button{visibility:hidden}.ul-card-rank__option span{font-size:14px;font-weight:400;pointer-events:none}.ul-card-rank__select{appearance:none;-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;height:25px;min-height:25px;border:1px solid #E2E3E1;border-radius:4px;font-size:14px;line-height:1.4;padding:2px 28px 2px 8px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='13' viewBox='0 0 12 13' fill='none'><path d='M9.75 5L6 8.75L2.25 5' stroke='%230B2330' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 8px center;background-size:12px 12px;background-color:#fff;cursor:pointer;pointer-events:auto}.ul-card-rank__select.ul-card-rank__select--placeholder{color:#b0b5b7}.ul-card-text{margin-top:2px;margin-bottom:3px;display:flex;flex-direction:column;justify-content:center;padding:0;width:100%}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:#00000003;box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:12px;resize:none;width:100%;border-radius:3px;font-size:15px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:#fff}.ul-card-text__input--desktop:hover:not(:focus){background-color:#0000000d}.ul-card__text-url-prompt-button{text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:-webkit-fill-available}#ul-card-video__player_recorder{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.ul-card-record__task{flex:1 0 auto;margin-top:2px;margin-bottom:3px;align-items:center;display:flex;flex-wrap:wrap;justify-content:center;padding:0}#ul-record-task-upload-progress,#ul-record-task-video-preview{width:100%;height:150px}.ul-permission-graphics-container{width:100%;height:150px;background-color:#0000000d;text-align:center;flex-direction:column;margin-left:auto;margin-right:auto;border-radius:5px;display:flex;align-items:center;font-size:15px;color:#000000b3}.ul-av-permission-denied-paragraph{margin:auto 15px;font-size:12px}.ul-av-permission-denied-headline{font-size:14px;color:#262136;text-decoration:underline;font-size:12px}.ul-permission-body{color:#000;margin:5px auto 5px 5px;line-height:135%;text-align:center}.ul-select-tab-container{width:240px;height:46px;background:#fff;border-radius:5px;text-align:start;align-items:center;display:flex;padding:0 5px;margin-top:20px;margin-bottom:auto}.ul-select-tab-text{color:#4b575d;margin:5px;line-height:135%;text-align:center}button.ul-task-skip-button{color:#000;background-color:#fff}#ul-task-detail-container{margin-top:0;margin-bottom:0;overflow:auto}#ul-task-detail-container.ul-rich-text-body p,#ul-task-detail-container.ul-rich-text-body li,#ul-task-detail-container.ul-rich-text-body{color:#4c4c4c}#ul-task-detail-container :first-child{margin-top:0}#ul-task-detail-container :last-child{margin-bottom:20px}.ul-horizontal-button-container{width:100%;display:flex;flex-direction:row}.ul-skip-button-below{margin-top:5px}.ul-horizontal-button-container-center{justify-content:center}.ul-vertical-button-container-center{display:flex;flex-direction:column;align-items:center}.ul-horizontal-button-container-left{justify-content:flex-start}.ul_recorded-task-inset-spacing{margin-top:5px;margin-bottom:24px}.ul_permission_svg_container{justify-content:center}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button:disabled>svg path,.ul-card-text__button.sprig-button-disabled>svg path{stroke:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff!important;color:#5d696f!important}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:15px;justify-content:center;flex-direction:column}.select-button{align-items:center;background-color:transparent;border-radius:8px;border:1px solid #0b2330;box-shadow:0 0 0 2px #c8cccc;cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%}.select-button:hover{background-color:#f3f3f3}.select-button:active{background-color:#eee}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:#b0b5b7}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:#fff;border:1px solid #E2E3E1;box-shadow:0 16px 24px #0b23300d,0 4px 12px #0b233008;border-radius:8px;overflow-y:scroll;width:100%}.select-option{align-items:center;cursor:pointer;display:flex;font-size:15px;gap:16px;line-height:20px;padding:8px 16px}.select-option:hover{background-color:#f3f3f3}.ul-card-maxdiff__labels-row{display:flex;justify-content:space-between;margin-bottom:8px;column-gap:50%}@media (max-width: 600px){.ul-card-maxdiff__labels-row{column-gap:30%}}.ul-card-maxdiff__label{font-weight:600;text-align:center;margin:auto;flex:1;padding:8px;overflow:auto;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto}.ul-card-maxdiff__label-spacer{flex:6}.ul-card-maxdiff .ul-question{text-align:center}.ul-card-maxdiff__option-row{display:flex;justify-content:space-between;margin-bottom:8px;padding:0 24px}.ul-card-maxdiff__option-label{flex:6;align-self:center;padding:12px;text-align:center}.ul-card-maxdiff__option-control.smiley{display:flex;justify-content:center;align-items:center;flex:1;padding:12px;border-radius:none;border:none;background:none;cursor:pointer}.ul-card-maxdiff__option-control .choice-label-container{justify-content:center}.ul-card-maxdiff p.ul-caption{text-align:center}.ul-card-maxdiff .question-header-button-container{display:flex;justify-content:center}.ul-card-maxdiff__option-selected{border-radius:100px}.ul-card-maxdiff__option-selected.good{background:#90ee90}.ul-card-maxdiff__option-selected.bad{background:#f08080}.ul-card-maxdiff__option-btn{width:42px;height:42px;justify-content:center;align-items:center}html,body{cursor:default;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-webkit-touch-callout:none}b{font-weight:500}form{margin-block-end:0;margin-block-start:0}#ul-app{opacity:0;width:100%;flex-grow:2;display:flex}#ul-app.ul-app--overlay{position:absolute;bottom:0;transition:opacity .1s ease-out;transition-delay:.1s}#ul-app.ul-app--visible{opacity:1;bottom:0}.ul-app__container{width:100%;display:flex;flex-direction:column;max-height:100vh}.ul-header__container{margin-bottom:15px}.ul-header{align-items:center;background:repeating-linear-gradient(120deg,#ebebeb,#ebebeb 24px,#fff 24px,#fff 48px);border-bottom:2px solid #ebebeb;display:flex;font-size:14px;font-weight:500;height:40px;justify-content:center;width:100%}.ul-footer{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;margin-top:auto;flex-grow:0;width:100%;min-height:10px;height:fit-content;flex-shrink:0}.ul-footer>.yellow-footer-logo{background:#fad133;border:1px solid #f9c600;border-radius:14px;padding:6px 12px}.ul-footer>.yellow-footer-logo:hover{background:#f9c600}.ul-footer .thank-you-card-link{background:#00000003;border:1px solid #e6e6e6;border-radius:8px;cursor:pointer;display:inline-flex;font-size:14px;gap:12px;margin-bottom:15px;padding:12px;text-align:initial;width:280px}.ul-footer .thank-you-card-link:hover{background:#00000008}.ul-footer>a{color:inherit}.ul-footer-bubble{display:inline-block;margin:0 3px;width:7px;height:7px;border-radius:3px;border:1px solid transparent}.sprig-box-logo{background:#f9c600;border-radius:5px;display:flex;padding:4px}.close-container{display:flex;justify-content:flex-end;width:100%;height:0}.close-btn{cursor:pointer;height:16px;margin-inline-end:-10px;position:relative;top:-10px;width:16px;z-index:1;align-self:flex-start;justify-self:end;flex-shrink:0}.ul-app__container{transition:opacity .3s ease-out}.ul-center-horizontally{text-align:center}.ul-progress-bar-container{width:100%;height:2px;background-color:#0000001a;border-radius:2px}.ul-progress-bar-container__footer{max-width:250px;margin:16px 0}.ul-progress-bar-container__header{position:fixed;top:80px;max-width:unset;margin:0;z-index:3}.ul-progress-bar-current{transition:width 1s ease;width:0%;height:0;border-radius:2px}.prototype-button{align-self:stretch;background:#00000003;border:1.5px solid #e6e6e6;border-radius:4px 0 0 4px;flex:none;flex-grow:0;height:fit-content;line-height:16.5px;margin:0 20px;padding:20px 0;font-size:14px;font-family:inherit;text-decoration:underline}.prototype-button:hover{cursor:pointer}` }), e.customStyles && dn({ document: u, elementId: "ul-custom-style", styleString: e.customStyles, nonce: e.styleNonce }), e.fontFamily && s && parent) {
3146
- const x = u.createElement("link");
3147
- x.rel = "stylesheet", x.href = s, b.appendChild(x);
3148
- }
3149
- if (!f && e.cards.some((x) => x.type === "recordedtask")) {
3150
- const x = u.createElement("script");
3151
- x.src = e.upchunkLibraryURL ?? "https://cdn.sprig.com/userleap-web-upchunk-v2.2.2.js", x.onload = () => {
3152
- at.setUpChunk(p.UpChunk);
3153
- }, x.onerror = () => {
3154
- console.warn("[Sprig] - recording functionality not configured due to UpChunk library load failure");
3155
- }, b.appendChild(x);
3156
- }
3157
- const v = i || ((w = d.eventEmitter) == null ? void 0 : w.emit);
3158
- v == null || v("verify.view.version", { "view.version": "2.38.1" }), c && t && (qe(a(xs, {}), c), Qe.once(ce.SurveyClosed, () => {
3159
- Xt(c);
3160
- }));
3161
- } };
3162
- export {
3163
- Es as default
3164
- };