UNPKG

@sprig-technologies/sprig-browser

Version:

npm package for the sprig web sdk

1,106 lines 137 kB
import { A as G, d as ln, e as cn, C as mt, f as Ke, r as un } from "./core-hnPqe1SX.js"; import { e as pe, h as Ie, S as P, s as de, b as Pe, D as gt, t as Re, u as dn, v as _t } from "./metricsReporter-CNrl9aag.js"; var he, C, ar, Z, ht, sr, Je, lr, me = {}, cr = [], pn = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ue = Array.isArray; function B(e, t) { for (var r in t) e[r] = t[r]; return e; } function ur(e) { var t = e.parentNode; t && t.removeChild(e); } function O(e, t, r) { var o, n, i, a = {}; for (i in t) i == "key" ? o = t[i] : i == "ref" ? n = t[i] : a[i] = t[i]; if (arguments.length > 2 && (a.children = arguments.length > 3 ? he.call(arguments, 2) : r), typeof e == "function" && e.defaultProps != null) for (i in e.defaultProps) a[i] === void 0 && (a[i] = e.defaultProps[i]); return fe(e, a, o, n, null); } function fe(e, t, r, o, n) { var i = { type: e, props: t, key: r, ref: o, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: n ?? ++ar, __i: -1, __u: 0 }; return n == null && C.vnode != null && C.vnode(i), i; } function dr() { return { current: null }; } function z(e) { return e.children; } function F(e, t) { this.props = e, this.context = t; } function ae(e, t) { if (t == null) return e.__ ? ae(e.__, e.__i + 1) : null; for (var r; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) return r.__e; return typeof e.type == "function" ? ae(e) : null; } function pr(e) { var t, r; if ((e = e.__) != null && e.__c != null) { for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) { e.__e = e.__c.base = r.__e; break; } return pr(e); } } function Ye(e) { (!e.__d && (e.__d = !0) && Z.push(e) && !Ae.__r++ || ht !== C.debounceRendering) && ((ht = C.debounceRendering) || sr)(Ae); } function Ae() { var e, t, r, o, n, i, a, s, l; for (Z.sort(Je); e = Z.shift(); ) e.__d && (t = Z.length, o = void 0, i = (n = (r = e).__v).__e, s = [], l = [], (a = r.__P) && ((o = B({}, n)).__v = n.__v + 1, C.vnode && C.vnode(o), nt(a, o, n, r.__n, a.ownerSVGElement !== void 0, 32 & n.__u ? [i] : null, s, i ?? ae(n), !!(32 & n.__u), l), o.__.__k[o.__i] = o, gr(s, o, l), o.__e != i && pr(o)), Z.length > t && Z.sort(Je)); Ae.__r = 0; } function fr(e, t, r, o, n, i, a, s, l, c, d) { var u, g, p, v, m, h = o && o.__k || cr, x = t.length; for (r.__d = l, function(f, k, w) { var _, b, y, A, R, N = k.length, L = w.length, U = L, E = 0; for (f.__k = [], _ = 0; _ < N; _++) (b = f.__k[_] = (b = k[_]) == null || typeof b == "boolean" || typeof b == "function" ? null : typeof b == "string" || typeof b == "number" || typeof b == "bigint" || b.constructor == String ? fe(null, b, null, null, b) : Ue(b) ? fe(z, { children: b }, null, null, null) : b.constructor === void 0 && b.__b > 0 ? fe(b.type, b.props, b.key, b.ref ? b.ref : null, b.__v) : b) != null ? (b.__ = f, b.__b = f.__b + 1, R = fn(b, w, A = _ + E, U), b.__i = R, y = null, R !== -1 && (U--, (y = w[R]) && (y.__u |= 131072)), y == null || y.__v === null ? (R == -1 && E--, typeof b.type != "function" && (b.__u |= 65536)) : R !== A && (R === A + 1 ? E++ : R > A ? U > N - A ? E += R - A : E-- : E = R < A && R == A - 1 ? R - A : 0, R !== _ + E && (b.__u |= 65536))) : (y = w[_]) && y.key == null && y.__e && (y.__e == f.__d && (f.__d = ae(y)), Xe(y, y, !1), w[_] = null, U--); if (U) for (_ = 0; _ < L; _++) (y = w[_]) != null && !(131072 & y.__u) && (y.__e == f.__d && (f.__d = ae(y)), Xe(y, y)); }(r, t, h), l = r.__d, u = 0; u < x; u++) (p = r.__k[u]) != null && typeof p != "boolean" && typeof p != "function" && (g = p.__i === -1 ? me : h[p.__i] || me, p.__i = u, nt(e, p, g, n, i, a, s, l, c, d), v = p.__e, p.ref && g.ref != p.ref && (g.ref && ot(g.ref, null, p), d.push(p.ref, p.__c || v, p)), m == null && v != null && (m = v), 65536 & p.__u || g.__k === p.__k ? l = mr(p, l, e) : typeof p.type == "function" && p.__d !== void 0 ? l = p.__d : v && (l = v.nextSibling), p.__d = void 0, p.__u &= -196609); r.__d = l, r.__e = m; } function mr(e, t, r) { var o, n; if (typeof e.type == "function") { for (o = e.__k, n = 0; o && n < o.length; n++) o[n] && (o[n].__ = e, t = mr(o[n], t, r)); return t; } return e.__e != t && (r.insertBefore(e.__e, t || null), t = e.__e), t && t.nextSibling; } function $(e, t) { return t = t || [], e == null || typeof e == "boolean" || (Ue(e) ? e.some(function(r) { $(r, t); }) : t.push(e)), t; } function fn(e, t, r, o) { var n = e.key, i = e.type, a = r - 1, s = r + 1, l = t[r]; if (l === null || l && n == l.key && i === l.type) return r; if (o > (l == null || 131072 & l.__u ? 0 : 1)) for (; a >= 0 || s < t.length; ) { if (a >= 0) { if ((l = t[a]) && !(131072 & l.__u) && n == l.key && i === l.type) return a; a--; } if (s < t.length) { if ((l = t[s]) && !(131072 & l.__u) && n == l.key && i === l.type) return s; s++; } } return -1; } function vt(e, t, r) { t[0] === "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" || pn.test(t) ? r : r + "px"; } function ke(e, t, r, o, n) { var i; e: if (t === "style") if (typeof r == "string") e.style.cssText = r; else { if (typeof o == "string" && (e.style.cssText = o = ""), o) for (t in o) r && t in r || vt(e.style, t, ""); if (r) for (t in r) o && r[t] === o[t] || vt(e.style, t, r[t]); } 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] = r, r ? o ? r.u = o.u : (r.u = Date.now(), e.addEventListener(t, i ? bt : yt, i)) : e.removeEventListener(t, i ? bt : yt, i); else { if (n) t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s"); 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 { e[t] = r ?? ""; break e; } catch { } typeof r == "function" || (r == null || r === !1 && t[4] !== "-" ? e.removeAttribute(t) : e.setAttribute(t, r)); } } function yt(e) { var t = this.l[e.type + !1]; if (e.t) { if (e.t <= t.u) return; } else e.t = Date.now(); return t(C.event ? C.event(e) : e); } function bt(e) { return this.l[e.type + !0](C.event ? C.event(e) : e); } function nt(e, t, r, o, n, i, a, s, l, c) { var d, u, g, p, v, m, h, x, f, k, w, _, b, y, A, R = t.type; if (t.constructor !== void 0) return null; 128 & r.__u && (l = !!(32 & r.__u), i = [s = t.__e = r.__e]), (d = C.__b) && d(t); e: if (typeof R == "function") try { if (x = t.props, f = (d = R.contextType) && o[d.__c], k = d ? f ? f.props.value : d.__ : o, r.__c ? h = (u = t.__c = r.__c).__ = u.__E : ("prototype" in R && R.prototype.render ? t.__c = u = new R(x, k) : (t.__c = u = new F(x, k), u.constructor = R, u.render = gn), f && f.sub(u), u.props = x, u.state || (u.state = {}), u.context = k, u.__n = o, g = u.__d = !0, u.__h = [], u._sb = []), u.__s == null && (u.__s = u.state), R.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = B({}, u.__s)), B(u.__s, R.getDerivedStateFromProps(x, u.__s))), p = u.props, v = u.state, u.__v = t, g) R.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), u.componentDidMount != null && u.__h.push(u.componentDidMount); else { if (R.getDerivedStateFromProps == null && x !== p && u.componentWillReceiveProps != null && u.componentWillReceiveProps(x, k), !u.__e && (u.shouldComponentUpdate != null && u.shouldComponentUpdate(x, u.__s, k) === !1 || t.__v === r.__v)) { for (t.__v !== r.__v && (u.props = x, u.state = u.__s, u.__d = !1), t.__e = r.__e, t.__k = r.__k, t.__k.forEach(function(N) { N && (N.__ = t); }), w = 0; w < u._sb.length; w++) u.__h.push(u._sb[w]); u._sb = [], u.__h.length && a.push(u); break e; } u.componentWillUpdate != null && u.componentWillUpdate(x, u.__s, k), u.componentDidUpdate != null && u.__h.push(function() { u.componentDidUpdate(p, v, m); }); } if (u.context = k, u.props = x, u.__P = e, u.__e = !1, _ = C.__r, b = 0, "prototype" in R && R.prototype.render) { for (u.state = u.__s, u.__d = !1, _ && _(t), d = u.render(u.props, u.state, u.context), y = 0; y < u._sb.length; y++) u.__h.push(u._sb[y]); u._sb = []; } else do u.__d = !1, _ && _(t), d = u.render(u.props, u.state, u.context), u.state = u.__s; while (u.__d && ++b < 25); u.state = u.__s, u.getChildContext != null && (o = B(B({}, o), u.getChildContext())), g || u.getSnapshotBeforeUpdate == null || (m = u.getSnapshotBeforeUpdate(p, v)), fr(e, Ue(A = d != null && d.type === z && d.key == null ? d.props.children : d) ? A : [A], t, r, o, n, i, a, s, l, c), u.base = t.__e, t.__u &= -161, u.__h.length && a.push(u), h && (u.__E = u.__ = null); } catch (N) { t.__v = null, l || i != null ? (t.__e = s, t.__u |= l ? 160 : 32, i[i.indexOf(s)] = null) : (t.__e = r.__e, t.__k = r.__k), C.__e(N, t, r); } else i == null && t.__v === r.__v ? (t.__k = r.__k, t.__e = r.__e) : t.__e = mn(r.__e, t, r, o, n, i, a, l, c); (d = C.diffed) && d(t); } function gr(e, t, r) { t.__d = void 0; for (var o = 0; o < r.length; o++) ot(r[o], r[++o], r[++o]); C.__c && C.__c(t, e), e.some(function(n) { try { e = n.__h, n.__h = [], e.some(function(i) { i.call(n); }); } catch (i) { C.__e(i, n.__v); } }); } function mn(e, t, r, o, n, i, a, s, l) { var c, d, u, g, p, v, m, h = r.props, x = t.props, f = t.type; if (f === "svg" && (n = !0), i != null) { for (c = 0; c < i.length; c++) if ((p = i[c]) && "setAttribute" in p == !!f && (f ? p.localName === f : p.nodeType === 3)) { e = p, i[c] = null; break; } } if (e == null) { if (f === null) return document.createTextNode(x); e = n ? document.createElementNS("http://www.w3.org/2000/svg", f) : document.createElement(f, x.is && x), i = null, s = !1; } if (f === null) h === x || s && e.data === x || (e.data = x); else { if (i = i && he.call(e.childNodes), h = r.props || me, !s && i != null) for (h = {}, c = 0; c < e.attributes.length; c++) h[(p = e.attributes[c]).name] = p.value; for (c in h) p = h[c], c == "children" || (c == "dangerouslySetInnerHTML" ? u = p : c === "key" || c in x || ke(e, c, null, p, n)); for (c in x) p = x[c], c == "children" ? g = p : c == "dangerouslySetInnerHTML" ? d = p : c == "value" ? v = p : c == "checked" ? m = p : c === "key" || s && typeof p != "function" || h[c] === p || ke(e, c, p, h[c], n); if (d) s || u && (d.__html === u.__html || d.__html === e.innerHTML) || (e.innerHTML = d.__html), t.__k = []; else if (u && (e.innerHTML = ""), fr(e, Ue(g) ? g : [g], t, r, o, n && f !== "foreignObject", i, a, i ? i[0] : r.__k && ae(r, 0), s, l), i != null) for (c = i.length; c--; ) i[c] != null && ur(i[c]); s || (c = "value", v !== void 0 && (v !== e[c] || f === "progress" && !v || f === "option" && v !== h[c]) && ke(e, c, v, h[c], !1), c = "checked", m !== void 0 && m !== e[c] && ke(e, c, m, h[c], !1)); } return e; } function ot(e, t, r) { try { typeof e == "function" ? e(t) : e.current = t; } catch (o) { C.__e(o, r); } } function Xe(e, t, r) { var o, n; if (C.unmount && C.unmount(e), (o = e.ref) && (o.current && o.current !== e.__e || ot(o, null, t)), (o = e.__c) != null) { if (o.componentWillUnmount) try { o.componentWillUnmount(); } catch (i) { C.__e(i, t); } o.base = o.__P = null, e.__c = void 0; } if (o = e.__k) for (n = 0; n < o.length; n++) o[n] && Xe(o[n], t, r || typeof e.type != "function"); r || e.__e == null || ur(e.__e), e.__ = e.__e = e.__d = void 0; } function gn(e, t, r) { return this.constructor(e, r); } function se(e, t, r) { var o, n, i, a; C.__ && C.__(e, t), n = (o = typeof r == "function") ? null : r && r.__k || t.__k, i = [], a = [], nt(t, e = (!o && r || t).__k = O(z, null, [e]), n || me, me, t.ownerSVGElement !== void 0, !o && r ? [r] : n ? null : t.firstChild ? he.call(t.childNodes) : null, i, !o && r ? r : n ? n.__e : t.firstChild, o, a), gr(i, e, a); } function _r(e, t) { se(e, t, _r); } function _n(e, t, r) { var o, n, i, a, s = B({}, e.props); for (i in e.type && e.type.defaultProps && (a = e.type.defaultProps), t) i == "key" ? o = t[i] : i == "ref" ? n = t[i] : s[i] = t[i] === void 0 && a !== void 0 ? a[i] : t[i]; return arguments.length > 2 && (s.children = arguments.length > 3 ? he.call(arguments, 2) : r), fe(e.type, s, o || e.key, n || e.ref, null); } function hr(e, t) { var r = { __c: t = "__cC" + lr++, __: e, Consumer: function(o, n) { return o.children(n); }, Provider: function(o) { var n, i; return this.getChildContext || (n = [], (i = {})[t] = this, this.getChildContext = function() { return i; }, this.shouldComponentUpdate = function(a) { this.props.value !== a.value && n.some(function(s) { s.__e = !0, Ye(s); }); }, this.sub = function(a) { n.push(a); var s = a.componentWillUnmount; a.componentWillUnmount = function() { n.splice(n.indexOf(a), 1), s && s.call(a); }; }), o.children; } }; return r.Provider.__ = r.Consumer.contextType = r; } he = cr.slice, C = { __e: function(e, t, r, o) { for (var n, i, a; t = t.__; ) if ((n = t.__c) && !n.__) try { if ((i = n.constructor) && i.getDerivedStateFromError != null && (n.setState(i.getDerivedStateFromError(e)), a = n.__d), n.componentDidCatch != null && (n.componentDidCatch(e, o || {}), a = n.__d), a) return n.__E = n; } catch (s) { e = s; } throw e; } }, ar = 0, F.prototype.setState = function(e, t) { var r; r = this.__s != null && this.__s !== this.state ? this.__s : this.__s = B({}, this.state), typeof e == "function" && (e = e(B({}, r), this.props)), e && B(r, e), e != null && this.__v && (t && this._sb.push(t), Ye(this)); }, F.prototype.forceUpdate = function(e) { this.__v && (this.__e = !0, e && this.__h.push(e), Ye(this)); }, F.prototype.render = z, Z = [], sr = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Je = function(e, t) { return e.__v.__b - t.__v.__b; }, Ae.__r = 0, lr = 0; var hn = 0; function S(e, t, r, o, n, i) { var a, s, l = {}; for (s in t) s == "ref" ? a = t[s] : l[s] = t[s]; var c = { type: e, props: l, key: r, ref: a, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --hn, __i: -1, __u: 0, __source: n, __self: i }; if (typeof e == "function" && (a = e.defaultProps)) for (s in a) l[s] === void 0 && (l[s] = a[s]); return C.vnode && C.vnode(c), c; } var Q, j, qe, xt, le = 0, vr = [], we = [], kt = C.__b, wt = C.__r, Ct = C.diffed, St = C.__c, It = C.unmount; function X(e, t) { C.__h && C.__h(j, e, le || t), le = 0; var r = j.__H || (j.__H = { __: [], __h: [] }); return e >= r.__.length && r.__.push({ __V: we }), r.__[e]; } function J(e) { return le = 1, it(kr, e); } function it(e, t, r) { var o = X(Q++, 2); if (o.t = e, !o.__c && (o.__ = [r ? r(t) : kr(void 0, t), function(s) { var l = o.__N ? o.__N[0] : o.__[0], c = o.t(l, s); l !== c && (o.__N = [c, o.__[1]], o.__c.setState({})); }], o.__c = j, !j.u)) { var n = function(s, l, c) { if (!o.__c.__H) return !0; var d = o.__c.__H.__.filter(function(g) { return g.__c; }); if (d.every(function(g) { return !g.__N; })) return !i || i.call(this, s, l, c); var u = !1; return d.forEach(function(g) { if (g.__N) { var p = g.__[0]; g.__ = g.__N, g.__N = void 0, p !== g.__[0] && (u = !0); } }), !(!u && o.__c.props === s) && (!i || i.call(this, s, l, c)); }; j.u = !0; var i = j.shouldComponentUpdate, a = j.componentWillUpdate; j.componentWillUpdate = function(s, l, c) { if (this.__e) { var d = i; i = void 0, n(s, l, c), i = d; } a && a.call(this, s, l, c); }, j.shouldComponentUpdate = n; } return o.__N || o.__; } function q(e, t) { var r = X(Q++, 3); !C.__s && st(r.__H, t) && (r.__ = e, r.i = t, j.__H.__h.push(r)); } function ve(e, t) { var r = X(Q++, 4); !C.__s && st(r.__H, t) && (r.__ = e, r.i = t, j.__h.push(r)); } function Y(e) { return le = 5, ee(function() { return { current: e }; }, []); } function yr(e, t, r) { le = 6, ve(function() { return typeof e == "function" ? (e(t()), function() { return e(null); }) : e ? (e.current = t(), function() { return e.current = null; }) : void 0; }, r == null ? r : r.concat(e)); } function ee(e, t) { var r = X(Q++, 7); return st(r.__H, t) ? (r.__V = e(), r.i = t, r.__h = e, r.__V) : r.__; } function je(e, t) { return le = 8, ee(function() { return e; }, t); } function br(e) { var t = j.context[e.__c], r = X(Q++, 9); return r.c = e, t ? (r.__ == null && (r.__ = !0, t.sub(j)), t.props.value) : e.__; } function at(e, t) { C.useDebugValue && C.useDebugValue(t ? t(e) : e); } function xr() { var e = X(Q++, 11); if (!e.__) { for (var t = j.__v; t !== null && !t.__m && t.__ !== null; ) t = t.__; var r = t.__m || (t.__m = [0, 0]); e.__ = "P" + r[0] + "-" + r[1]++; } return e.__; } function vn() { for (var e; e = vr.shift(); ) if (e.__P && e.__H) try { e.__H.__h.forEach(Ce), e.__H.__h.forEach(et), e.__H.__h = []; } catch (t) { e.__H.__h = [], C.__e(t, e.__v); } } C.__b = function(e) { j = null, kt && kt(e); }, C.__r = function(e) { wt && wt(e), Q = 0; var t = (j = e.__c).__H; t && (qe === j ? (t.__h = [], j.__h = [], t.__.forEach(function(r) { r.__N && (r.__ = r.__N), r.__V = we, r.__N = r.i = void 0; })) : (t.__h.forEach(Ce), t.__h.forEach(et), t.__h = [], Q = 0)), qe = j; }, C.diffed = function(e) { Ct && Ct(e); var t = e.__c; t && t.__H && (t.__H.__h.length && (vr.push(t) !== 1 && xt === C.requestAnimationFrame || ((xt = C.requestAnimationFrame) || yn)(vn)), t.__H.__.forEach(function(r) { r.i && (r.__H = r.i), r.__V !== we && (r.__ = r.__V), r.i = void 0, r.__V = we; })), qe = j = null; }, C.__c = function(e, t) { t.some(function(r) { try { r.__h.forEach(Ce), r.__h = r.__h.filter(function(o) { return !o.__ || et(o); }); } catch (o) { t.some(function(n) { n.__h && (n.__h = []); }), t = [], C.__e(o, r.__v); } }), St && St(e, t); }, C.unmount = function(e) { It && It(e); var t, r = e.__c; r && r.__H && (r.__H.__.forEach(function(o) { try { Ce(o); } catch (n) { t = n; } }), r.__H = void 0, t && C.__e(t, r.__v)); }; var Rt = typeof requestAnimationFrame == "function"; function yn(e) { var t, r = function() { clearTimeout(o), Rt && cancelAnimationFrame(t), setTimeout(e); }, o = setTimeout(r, 100); Rt && (t = requestAnimationFrame(r)); } function Ce(e) { var t = j, r = e.__c; typeof r == "function" && (e.__c = void 0, r()), j = t; } function et(e) { var t = j; e.__c = e.__(), j = t; } function st(e, t) { return !e || e.length !== t.length || t.some(function(r, o) { return r !== e[o]; }); } function kr(e, t) { return typeof t == "function" ? t(e) : t; } function wr(e, t) { for (var r in t) e[r] = t[r]; return e; } function tt(e, t) { for (var r in e) if (r !== "__source" && !(r in t)) return !0; for (var o in t) if (o !== "__source" && e[o] !== t[o]) return !0; return !1; } function Ee(e) { this.props = e; } function Cr(e, t) { function r(n) { var i = this.props.ref, a = i == n.ref; return !a && i && (i.call ? i(null) : i.current = null), t ? !t(this.props, n) || !a : tt(this.props, n); } function o(n) { return this.shouldComponentUpdate = r, O(e, n); } return o.displayName = "Memo(" + (e.displayName || e.name) + ")", o.prototype.isReactComponent = !0, o.__f = !0, o; } (Ee.prototype = new F()).isPureReactComponent = !0, Ee.prototype.shouldComponentUpdate = function(e, t) { return tt(this.props, e) || tt(this.state, t); }; var At = C.__b; C.__b = function(e) { e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), At && At(e); }; var bn = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911; function lt(e) { function t(r) { var o = wr({}, r); return delete o.ref, e(o, r.ref || null); } return t.$$typeof = bn, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t; } var jt = function(e, t) { return e == null ? null : $($(e).map(t)); }, Sr = { map: jt, forEach: jt, count: function(e) { return e ? $(e).length : 0; }, only: function(e) { var t = $(e); if (t.length !== 1) throw "Children.only"; return t[0]; }, toArray: $ }, xn = C.__e; C.__e = function(e, t, r, o) { if (e.then) { for (var n, i = t; i = i.__; ) if ((n = i.__c) && n.__c) return t.__e == null && (t.__e = r.__e, t.__k = r.__k), n.__c(e, t); } xn(e, t, r, o); }; var Et = C.unmount; function Ir(e, t, r) { return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(o) { typeof o.__c == "function" && o.__c(); }), e.__c.__H = null), (e = wr({}, e)).__c != null && (e.__c.__P === r && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(o) { return Ir(o, t, r); })), e; } function Rr(e, t, r) { return e && r && (e.__v = null, e.__k = e.__k && e.__k.map(function(o) { return Rr(o, t, r); }), e.__c && e.__c.__P === t && (e.__e && r.appendChild(e.__e), e.__c.__e = !0, e.__c.__P = r)), e; } function ie() { this.__u = 0, this.t = null, this.__b = null; } function Ar(e) { var t = e.__.__c; return t && t.__a && t.__a(e); } function Te(e) { var t, r, o; function n(i) { if (t || (t = e()).then(function(a) { r = a.default || a; }, function(a) { o = a; }), o) throw o; if (!r) throw t; return O(r, i); } return n.displayName = "Lazy", n.__f = !0, n; } function ne() { this.u = null, this.o = null; } C.unmount = function(e) { var t = e.__c; t && t.__R && t.__R(), t && 32 & e.__u && (e.type = null), Et && Et(e); }, (ie.prototype = new F()).__c = function(e, t) { var r = t.__c, o = this; o.t == null && (o.t = []), o.t.push(r); var n = Ar(o.__v), i = !1, a = function() { i || (i = !0, r.__R = null, n ? n(s) : s()); }; r.__R = a; var s = function() { if (!--o.__u) { if (o.state.__a) { var l = o.state.__a; o.__v.__k[0] = Rr(l, l.__c.__P, l.__c.__O); } var c; for (o.setState({ __a: o.__b = null }); c = o.t.pop(); ) c.forceUpdate(); } }; o.__u++ || 32 & t.__u || o.setState({ __a: o.__b = o.__v.__k[0] }), e.then(a, a); }, ie.prototype.componentWillUnmount = function() { this.t = []; }, ie.prototype.render = function(e, t) { if (this.__b) { if (this.__v.__k) { var r = document.createElement("div"), o = this.__v.__k[0].__c; this.__v.__k[0] = Ir(this.__b, r, o.__O = o.__P); } this.__b = null; } var n = t.__a && O(z, null, e.fallback); return n && (n.__u &= -33), [O(z, null, t.__a ? null : e.children), n]; }; var Nt = function(e, t, r) { if (++r[1] === r[0] && e.o.delete(t), e.props.revealOrder && (e.props.revealOrder[0] !== "t" || !e.o.size)) for (r = e.u; r; ) { for (; r.length > 3; ) r.pop()(); if (r[1] < r[0]) break; e.u = r = r[2]; } }; function kn(e) { return this.getChildContext = function() { return e.context; }, e.children; } function wn(e) { var t = this, r = e.i; t.componentWillUnmount = function() { se(null, t.l), t.l = null, t.i = null; }, t.i && t.i !== r && t.componentWillUnmount(), t.l || (t.i = r, t.l = { nodeType: 1, parentNode: r, childNodes: [], appendChild: function(o) { this.childNodes.push(o), t.i.appendChild(o); }, insertBefore: function(o, n) { this.childNodes.push(o), t.i.appendChild(o); }, removeChild: function(o) { this.childNodes.splice(this.childNodes.indexOf(o) >>> 1, 1), t.i.removeChild(o); } }), se(O(kn, { context: t.context }, e.__v), t.l); } function jr(e, t) { var r = O(wn, { __v: e, i: t }); return r.containerInfo = t, r; } (ne.prototype = new F()).__a = function(e) { var t = this, r = Ar(t.__v), o = t.o.get(e); return o[0]++, function(n) { var i = function() { t.props.revealOrder ? (o.push(n), Nt(t, e, o)) : n(); }; r ? r(i) : i(); }; }, ne.prototype.render = function(e) { this.u = null, this.o = /* @__PURE__ */ new Map(); var t = $(e.children); e.revealOrder && e.revealOrder[0] === "b" && t.reverse(); for (var r = t.length; r--; ) this.o.set(t[r], this.u = [1, 0, this.u]); return e.children; }, ne.prototype.componentDidUpdate = ne.prototype.componentDidMount = function() { var e = this; this.o.forEach(function(t, r) { Nt(e, r, t); }); }; var Er = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, Cn = /^(?: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]/, Sn = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, In = /[A-Z0-9]/g, Rn = typeof document < "u", An = function(e) { return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e); }; function Nr(e, t, r) { return t.__k == null && (t.textContent = ""), se(e, t), typeof r == "function" && r(), e ? e.__c : null; } function Lr(e, t, r) { return _r(e, t), typeof r == "function" && r(), e ? e.__c : null; } F.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) { Object.defineProperty(F.prototype, e, { configurable: !0, get: function() { return this["UNSAFE_" + e]; }, set: function(t) { Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t }); } }); }); var Lt = C.event; function jn() { } function En() { return this.cancelBubble; } function Nn() { return this.defaultPrevented; } C.event = function(e) { return Lt && (e = Lt(e)), e.persist = jn, e.isPropagationStopped = En, e.isDefaultPrevented = Nn, e.nativeEvent = e; }; var ct, Ln = { enumerable: !1, configurable: !0, get: function() { return this.class; } }, Ut = C.vnode; C.vnode = function(e) { typeof e.type == "string" && function(t) { var r = t.props, o = t.type, n = {}; for (var i in r) { var a = r[i]; if (!(i === "value" && "defaultValue" in r && a == null || Rn && i === "children" && o === "noscript" || i === "class" || i === "className")) { var s = i.toLowerCase(); i === "defaultValue" && "value" in r && r.value == null ? i = "value" : i === "download" && a === !0 ? a = "" : s === "ondoubleclick" ? i = "ondblclick" : s !== "onchange" || o !== "input" && o !== "textarea" || An(r.type) ? s === "onfocus" ? i = "onfocusin" : s === "onblur" ? i = "onfocusout" : Sn.test(i) ? i = s : o.indexOf("-") === -1 && Cn.test(i) ? i = i.replace(In, "-$&").toLowerCase() : a === null && (a = void 0) : s = i = "oninput", s === "oninput" && n[i = s] && (i = "oninputCapture"), n[i] = a; } } o == "select" && n.multiple && Array.isArray(n.value) && (n.value = $(r.children).forEach(function(l) { l.props.selected = n.value.indexOf(l.props.value) != -1; })), o == "select" && n.defaultValue != null && (n.value = $(r.children).forEach(function(l) { l.props.selected = n.multiple ? n.defaultValue.indexOf(l.props.value) != -1 : n.defaultValue == l.props.value; })), r.class && !r.className ? (n.class = r.class, Object.defineProperty(n, "className", Ln)) : (r.className && !r.class || r.class && r.className) && (n.class = n.className = r.className), t.props = n; }(e), e.$$typeof = Er, Ut && Ut(e); }; var Tt = C.__r; C.__r = function(e) { Tt && Tt(e), ct = e.__c; }; var Vt = C.diffed; C.diffed = function(e) { Vt && Vt(e); var t = e.props, r = e.__e; r != null && e.type === "textarea" && "value" in t && t.value !== r.value && (r.value = t.value == null ? "" : t.value), ct = null; }; var Ur = { ReactCurrentDispatcher: { current: { readContext: function(e) { return ct.__n[e.__c].props.value; } } } }; function Tr(e) { return O.bind(null, e); } function ye(e) { return !!e && e.$$typeof === Er; } function Vr(e) { return ye(e) && e.type === z; } function Or(e) { return ye(e) ? _n.apply(null, arguments) : e; } function Ne(e) { return !!e.__k && (se(null, e), !0); } function Pr(e) { return e && (e.base || e.nodeType === 1 && e) || null; } var qr = function(e, t) { return e(t); }, Hr = function(e, t) { return e(t); }, Mr = z; function ut(e) { e(); } function Fr(e) { return e; } function zr() { return [!1, ut]; } var Dr = ve, Br = ye; function $r(e, t) { var r = t(), o = J({ h: { __: r, v: t } }), n = o[0].h, i = o[1]; return ve(function() { n.__ = r, n.v = t, He(n) && i({ h: n }); }, [e, r, t]), q(function() { return He(n) && i({ h: n }), e(function() { He(n) && i({ h: n }); }); }, [e]), r; } function He(e) { var t, r, o = e.v, n = e.__; try { var i = o(); return !((t = n) === (r = i) && (t !== 0 || 1 / t == 1 / r) || t != t && r != r); } catch { return !0; } } var Un = { useState: J, useId: xr, useReducer: it, useEffect: q, useLayoutEffect: ve, useInsertionEffect: Dr, useTransition: zr, useDeferredValue: Fr, useSyncExternalStore: $r, startTransition: ut, useRef: Y, useImperativeHandle: yr, useMemo: ee, useCallback: je, useContext: br, useDebugValue: at, version: "17.0.2", Children: Sr, render: Nr, hydrate: Lr, unmountComponentAtNode: Ne, createPortal: jr, createElement: O, createContext: hr, createFactory: Tr, cloneElement: Or, createRef: dr, Fragment: z, isValidElement: ye, isElement: Br, isFragment: Vr, findDOMNode: Pr, Component: F, PureComponent: Ee, memo: Cr, forwardRef: lt, flushSync: Hr, unstable_batchedUpdates: qr, StrictMode: Mr, Suspense: ie, SuspenseList: ne, lazy: Te, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Ur }; const Tn = Object.freeze(Object.defineProperty({ __proto__: null, Children: Sr, Component: F, Fragment: z, PureComponent: Ee, StrictMode: Mr, Suspense: ie, SuspenseList: ne, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Ur, cloneElement: Or, createContext: hr, createElement: O, createFactory: Tr, createPortal: jr, createRef: dr, default: Un, findDOMNode: Pr, flushSync: Hr, forwardRef: lt, hydrate: Lr, isElement: Br, isFragment: Vr, isValidElement: ye, lazy: Te, memo: Cr, render: Nr, startTransition: ut, unmountComponentAtNode: Ne, unstable_batchedUpdates: qr, useCallback: je, useContext: br, useDebugValue: at, useDeferredValue: Fr, useEffect: q, useErrorBoundary: function(e) { var t = X(Q++, 10), r = J(); return t.__ = e, j.componentDidCatch || (j.componentDidCatch = function(o, n) { t.__ && t.__(o, n), r[1](o); }), [r[0], function() { r[1](void 0); }]; }, useId: xr, useImperativeHandle: yr, useInsertionEffect: Dr, useLayoutEffect: ve, useMemo: ee, useReducer: it, useRef: Y, useState: J, useSyncExternalStore: $r, useTransition: zr, version: "17.0.2" }, Symbol.toStringTag, { value: "Module" })), Ot = (e) => { let t; const r = /* @__PURE__ */ new Set(), o = (a, s) => { const l = typeof a == "function" ? a(t) : a; if (!Object.is(l, t)) { const c = t; t = s ?? typeof l != "object" ? l : Object.assign({}, t, l), r.forEach((d) => d(t, c)); } }, n = () => t, i = { setState: o, getState: n, subscribe: (a) => (r.add(a), () => r.delete(a)), destroy: () => r.clear() }; return t = e(o, n, i), i; }; function Vn(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } function On(e) { if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e; var t = e.default; if (typeof t == "function") { var r = function o() { return this instanceof o ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments); }; r.prototype = t.prototype; } else r = {}; return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) { var n = Object.getOwnPropertyDescriptor(e, o); Object.defineProperty(r, o, n.get ? n : { enumerable: !0, get: function() { return e[o]; } }); }), r; } var Pt = { exports: {} }, Me = {}; const Qr = On(Tn); var qt, Ht, Mt, Ft, zt = { exports: {} }, Fe = {}; function Pn() { return Ht || (Ht = 1, zt.exports = function() { if (qt) return Fe; qt = 1; var e = Qr, t = typeof Object.is == "function" ? Object.is : function(l, c) { return l === c && (l !== 0 || 1 / l == 1 / c) || l != l && c != c; }, r = e.useState, o = e.useEffect, n = e.useLayoutEffect, i = e.useDebugValue; function a(l) { var c = l.getSnapshot; l = l.value; try { var d = c(); return !t(l, d); } catch { return !0; } } var s = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? function(l, c) { return c(); } : function(l, c) { var d = c(), u = r({ inst: { value: d, getSnapshot: c } }), g = u[0].inst, p = u[1]; return n(function() { g.value = d, g.getSnapshot = c, a(g) && p({ inst: g }); }, [l, d, c]), o(function() { return a(g) && p({ inst: g }), l(function() { a(g) && p({ inst: g }); }); }, [l]), i(d), d; }; return Fe.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : s, Fe; }()), zt.exports; } var qn = (Ft || (Ft = 1, Pt.exports = function() { if (Mt) return Me; Mt = 1; var e = Qr, t = Pn(), r = typeof Object.is == "function" ? Object.is : function(l, c) { return l === c && (l !== 0 || 1 / l == 1 / c) || l != l && c != c; }, o = t.useSyncExternalStore, n = e.useRef, i = e.useEffect, a = e.useMemo, s = e.useDebugValue; return Me.useSyncExternalStoreWithSelector = function(l, c, d, u, g) { var p = n(null); if (p.current === null) { var v = { hasValue: !1, value: null }; p.current = v; } else v = p.current; p = a(function() { function h(_) { if (!k) { if (k = !0, x = _, _ = u(_), g !== void 0 && v.hasValue) { var b = v.value; if (g(b, _)) return f = b; } return f = _; } if (b = f, r(x, _)) return b; var y = u(_); return g !== void 0 && g(b, y) ? b : (x = _, f = y); } var x, f, k = !1, w = d === void 0 ? null : d; return [function() { return h(c()); }, w === null ? void 0 : function() { return h(w()); }]; }, [c, d, u, g]); var m = o(l, p[0], p[1]); return i(function() { v.hasValue = !0, v.value = m; }, [m]), s(m), m; }, Me; }()), Pt.exports); const Hn = Vn(qn), { useSyncExternalStoreWithSelector: Mn } = Hn, Dt = (e) => { const t = typeof e == "function" ? ((o) => o ? Ot(o) : Ot)(e) : e, r = (o, n) => function(i, a = i.getState, s) { const l = Mn(i.subscribe, i.getState, i.getServerState || i.getState, a, s); return at(l), l; }(t, o, n); return Object.assign(r, t), r; }, Fn = (e) => e ? Dt(e) : Dt; var zn = ((e) => (e.RIGHT = "right", e.LEFT = "left", e))(zn || {}); const ze = (e) => e != null && typeof e == "object" && typeof Reflect.get(e, "taskStatus") == "string", Bt = (e) => e != null && typeof e == "object" && !Array.isArray(e) && Object.values(e).every((t) => t === null || typeof t == "string"), $t = (e) => e != null && typeof e == "object" && !Array.isArray(e) && Object.values(e).every((t) => t === null || typeof t == "number"), Qt = (e) => Array.isArray(e) && e.every((t) => Array.isArray(t) && t.every((r) => { if (typeof r != "object" || r === null) return !1; const o = Reflect.get(r, "selected"); return o === "left" || o === "right" || o === null; })), rt = (e, t) => { const { allowUndefined: r = !0, rejectBooleanRecord: o = !1 } = t ?? {}; if (e === void 0) return r; if (e === null || typeof e == "string" || typeof e == "number" || Array.isArray(e)) return !0; if (typeof e == "object" && e !== null) { if (o) { const n = Object.values(e); if (n.length > 0 && n.every((i) => typeof i == "boolean")) return !1; } return !0; } return !1; }, dt = (e, t) => { var r; if (t === null) return null; if (e.type === "texturlprompt") return ((o) => o === void 0 || typeof o == "object" && o !== null && "skipped" in o)(t) ? t : void 0; if (t === void 0) return null; if (e.type === "consentlegal") return typeof t == "object" && "submitted" in t && t.submitted === !0 ? t : null; if (e.type === "multipleselect") { const o = (r = e.props) == null ? void 0 : r.options; if (Array.isArray(o) && ((n) => typeof n == "object" && n !== null && !Array.isArray(n) && Object.values(n).every((i) => typeof i == "boolean"))(t)) { const n = t; return o.reduce((i, a) => (n[String(a.id)] && i.push(a.value), i), []); } } if (e.type === "multiplechoice") { if (typeof t == "object" && t !== null && !Array.isArray(t)) { if (Object.keys(t).length === 0) return null; const o = Object.values(t).find((n) => n !== !1 && n !== void 0); if (o !== void 0) return o; } return rt(t, { allowUndefined: !1, rejectBooleanRecord: !0 }) ? t : null; } return rt(t, { allowUndefined: !1, rejectBooleanRecord: !0 }) ? t : null; }, wo = ({ storeAllResponses: e, cards: t, cardValues: r, cardIndexByName: o }) => { const n = e ? [...e] : []; if (o === void 0) return n; for (const i of t) { const a = o[i.name]; if (typeof a != "number") continue; const s = r[i.name]; (s == null ? void 0 : s.value) !== void 0 && (n[a] = dt(i, s.value)); } return n; }, Dn = /<piped-value\b([^>]*)>.*?<\/piped-value>/gis, Wt = ["questionHtml", "captionHtml", "footerHtml", "richTextBody"], pt = (e) => !!e.props && typeof e.props == "object" && "properties" in e.props, De = (e) => !!e.props && typeof e.props == "object" && "options" in e.props && Array.isArray(e.props.options), Zt = (e) => ["string", "number"].includes(typeof e), Gt = (e) => e.length === 0 ? "" : e.length === 1 ? e[0] : e.join(", "), Bn = (e) => { var r, o; const t = ((n) => n != null && typeof n == "object" && "value" in n)(e) ? e.value : void 0; if (t != null) { if (e.type === "multipleselect" && De(e) && ((n) => !!n && typeof n == "object" && !Array.isArray(n))(t)) { const n = e.secondaryValue ?? null, i = e.props.options.filter((a) => t[String(a.id)] === !0).map((a) => { var s; return a.label + ((s = n == null ? void 0 : n[String(a.id)]) != null && s.userText ? `: ${n[String(a.id)].userText}` : ""); }); return i.length ? Gt(i) : "No options selected"; } if (e.type === "multiplechoice" && typeof t == "object" && t !== null) { const n = Object.keys(t); if (n.length === 0) return "No options selected"; const i = e.secondaryValue ?? null, a = n[0]; if (a) { const s = e.props.options.find((l) => String(l.id) === a); return (s == null ? void 0 : s.label) + ((r = i == null ? void 0 : i[a]) != null && r.userText ? `: ${(o = i == null ? void 0 : i[a]) == null ? void 0 : o.userText}` : ""); } } if (e.type === "matrix" && De(e) && ((n) => { if (!pt(n)) return !1; const i = n.props.properties; return !!i && typeof i == "object" && "matrixColumn" in i; })(e)) { const n = e.props.options, i = e.props.properties.matrixColumn, a = []; for (const [s, l] of Object.entries(t)) { const c = n.find((v) => String(v.id) === s), d = (c == null ? void 0 : c.label) ?? s, u = Zt(l) ? String(l) : JSON.stringify(l), g = i.find((v) => v.value === u), p = (g == null ? void 0 : g.label) ?? u; a.push(`${d}: ${p}`); } return a.join("; "); } if (e.type === "rankorder" && De(e)) { const n = e.props.options.reduce((a, s) => (a[String(s.id)] = s.label, a), {}), i = []; for (const [a, s] of Object.entries(t)) { const l = n[a]; l && (i[s - 1] = l); } return Gt(i); } if (Zt(t)) { const n = String(t).replaceAll(/[\u200B-\u200D\uFEFF]/g, "").trim(); return n === "" ? void 0 : n; } try { return JSON.stringify(t); } catch { return String(t); } } }, Co = (e, t) => e.map((r) => { if (!pt(r) || r.props.properties === void 0 || r.props.properties === null) return r; const o = r.props.properties; if (o === null || typeof o != "object" || !Wt.some((a) => a in o)) return r; let n = !1; const i = {}; for (const a of Wt) { const s = o[a]; if (s !== void 0) { const l = $n(s, t); i[a] = l, l !== s && (n = !0); } } return n ? { ...r, props: { ...r.props, properties: { ...o, ...i } } } : r; }), Kt = (e, t) => { const r = new RegExp(`${t}="([^"]*)"`, "i").exec(e); return (r == null ? void 0 : r[1]) ?? null; }, $n = (e, t) => { if (e == null) return e; let r = !1; const o = e.replace(Dn, (n, i) => { r = !0; const a = Kt(i, "answer-id"), s = Kt(i, "fallback-text") ?? ""; if (!a) return s; const l = a.startsWith("attr-") ? a : Number(a); if (Object.hasOwn(t, l)) { const c = t[l]; return String(c); } return s; }); return r ? o : e; }, Wr = (e, t) => { const r = {}; if (t) for (const [o, n] of Object.entries(t)) typeof n == "string" ? r[`attr-${o}`] = n : n != null && (r[`attr-${o}`] = JSON.stringify(n)); for (const o of e) { const n = Bn(o); n !== void 0 && (r[o.name] = n); } return r; }, So = (e) => { var t; return pt(e) && ((t = e.props.properties) != null && t.questionHtml) && typeof e.props.properties.questionHtml == "string" ? e.props.properties.questionHtml.replace(/<[^>]*>/g, "").trim() : e.props && "message" in e.props && typeof e.props.message == "string" ? e.props.message.trim() : e.props && "questionHtml" in e.props && typeof e.props.questionHtml == "string" ? e.props.questionHtml.replace(/<[^>]*>/g, "").trim() : ""; }, Qn = (e, t, r) => { switch (t) { case "videovoice": return !!(e != null && e.value); case "open": return !!r; case "multipleselect": return !!(r && Object.keys(r).length); case "recordedtask": return r !== null && typeof r == "object" && "taskStatus" in r && r.taskStatus === "completed"; case "texturlprompt": return !e.value; case "consentlegal": case "nps": case "likert": return r !== null; case "multiplechoice": return r !== void 0; case "matrix": return !!(r && Object.values(r).every((o) => o !== null)); default: return !0; } }, Zr = (e, t) => { if (t === "matrix" && e && typeof e == "object") { const r = Object.keys(e).length, o = Object.values(e).filter((n) => n !== null).length; return o > 0 && o < r; } return !1; }, Le = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : typeof e == "string" ? e : String(e), oe = { eq: (e, t) => Number(e) === Number(t), neq: (e, t) => !oe.eq(e, t), gt: (e, t) => Number(e) > Number(t), gte: (e, t) => Number(e) >= Number(t), lt: (e, t) => Number(e) < Number(t), lte: (e, t) => Number(e) <= Number(t), list_exact(e, t) { if (!Array.isArray(e) || !Array.isArray(t)) return !1; const r = (o, n) => String(o).localeCompare(String(n)); return e.slice().sort(r).join(",") === t.slice().sort(r).join(","); }, list_all: (e, t) => !(!Array.isArray(e) || !Array.isArray(t)) && !t.some((r) => !e.includes(r)), list_alo(e, t) { if (!Array.isArray(t)) return !1; const r = Array.isArray(e) ? e : [e], o = new Set(r); return t.some((n) => o.has(n)); }, list_dni(e, t) { if (!Array.isArray(t)) return !1; const r = Array.isArray(e) ? e : [e], o = new Set(r); return t.every((n) => !o.has(n)); }, contains(e, t) { const r = Le(e).toLowerCase(), o = Le(t).toLowerCase(); return r.includes(o); }, notcontains: (e, t) => !oe.contains(e, t) }, ge = { eq: (e, t) => e == t, neq: (e, t) => !ge.eq(e, t), gt: (e, t) => Number(e) > Number(t), gte: (e, t) => Number(e) >= Number(t), lt: (e, t) => Number(e) < Number(t), lte: (e, t) => Number(e) <= Number(t), list_exact(e, t) { if (!Array.isArray(e) || !Array.isArray(t)) return !1; const r = (o, n) => String(o).localeCompare(String(n)); return e.slice().sort(r).join(",") === t.slice().sort(r).join(","); }, list_all: (e, t) => !(!Array.isArray(e) || !Array.isArray(t)) && !t.some((r) => !e.includes(r)), list_alo(e, t) { if (!Array.isArray(t)) return !1; const r = Array.isArray(e) ? e : [e], o = new Set(r); return t.some((n) => o.has(n)); }, list_dni(e, t) { if (!Array.isArray(t)) return !1; const r = Array.isArray(e) ? e : [e], o = new Set(r); return t.every((n) => !o.has(n)); }, contains(e, t) { const r = String(e ?? "").toLowerCase(), o = String(t ?? "").toLowerCase(); return r.includes(o); }, notcontains: (e, t) => !ge.contains(e, t) }, Wn = (e) => e in ge, Gr = 1, Zn = 2, Gn = (e) => { var o, n, i; switch (e.type) { case "multipleselect": return e && e.props && e.props.options ? e.props.options.length > 13 ? e.props.options.map((a) => [a.value]) : (t = e.props.options.map((a) => a.value), r = !e.props.properties.required, t.reduce((a, s) => a.concat(a.map((l) => [...l, s])), [[]]).filter((a) => r || a.length > 0)) : null; case "multiplechoice": { if (!e || !e.props || !e.props.options) return null; const a = e.props.options.map((s) => s.value); return e.props.properties.required || a.push(void 0), a; } case "matrix": { if (!((o = e == null ? void 0 : e.props) != null && o.options)) return null; const a = e.props.properties.matrixColumn, s = e.props.options, l = s.reduce((d, u) => (d[u.id] = null, d), {}), c = [{ ...l, [s[0].id]: a[0].value }, s.reduce((d, u) => (d[u.id] = a[0].value, d), {})]; return e.props.properties.required || c.push(l), c; } case "likert": { const a = Number((i = (n = e.props) == null ? void 0 : n.properties) == null ? void 0 : i.range) || 5; return [...Array.from(new Array(a).keys()).map((l) => l + 1), ...e.props.properties.required ? [] : [null]]; } case "nps": return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...e.props.properties.required ? [] : [null]]; case "videovoice": case "open": return ["1", ...e.props.properties.required ? [] : [""]]; case "recordedtask": { const a = [{ taskStatus: "completed" }, { taskStatus: "given.up" }]; return e.props.properties.required || a.push({ taskStatus: "abandoned" }), a; } case "texturlprompt": return [void 0, ...e.props.properties.required ? [] : [{ skipped: !0 }]]; case "consentlegal": return [1, ...e.props.properties.required ? [] : [null]]; default: return [1]; } var t, r; }, Kn = (e) => typeof e == "object" && e !== null && "taskStatus" in e, Jn = (e) => typeof e == "object" && e !== null && !Array.isArray(e) && "comparator" in e && "questionIndex" in e, Kr = (e, t) => { const r = []; for (const o of e) Array.isArray(o) ? r.push(...Kr(o, t)) : Jn(o) && o.questionIndex === t && r.push(o); return r; }, Yn = (e, t = []) => t.reduce((r, o) => { const { group: n, target: i } = o; if (!(n != null && n.length)) return [...r]; const a = Kr(n, e).map((s) => { const { comparator: l, value: c } = s; return { comparator: l, target: i, value: c }; }); return [...r, ...a]; }, []), Jr = (e, t, r) => r > 0 ? t ? e.length - 3 : e.length - 2 : t ? e.length - 2 : e.length - 1, Yr = ({ cards: e, index: t, hasEndCard: r, allResponses: o, uploadProgress: n = {}, surveyVisitorAttributes: i = {} }) => { var u, g, p; if (t >= e.length || t < 0) return null; const a = e[t]; let s = t + 1; const l = a.props.routingOptions || []; for (const v of l) { if (!Xr(v)) continue; const { group: m, target: h } = v; if (nn({ group: m, allResponses: o, cards: e, surveyVisitorAttributes: i })) { s = h === -1 && r ? e.length - 1 : h; break; } } const c = e.findIndex((v) => v.type === "uploading"), d = Jr(e, r, c); for (; s !== null && s !== -1 && s <= d && ((g = (u = e[s]) == null ? void 0 : u.props) != null && g.displayLogic) && e[s].props.displayLogic.length > 0; ) { const v = e[s].props.displayLogic || []; if (rn({ displayLogic: v, allResponses: o, cards: e, surveyVisitorAttributes: i })) break; s++; } if (s !== -1 && ((p = e == null ? void 0 : e[s]) != null && p.parentId)) { const v = e.findIndex((m) => { var h; return m.name === ((h = e == null ? void 0 : e[s]) == null ? void 0 : h.parentId); }); if (v > -1) { const m = e[v], h = o[v], x = _e({ comparator: "answered", type: m.type, response: h }), f = m.type === "matrix" && _e({ comparator: "partial", type: m.type, response: h }); x || f || s++; } } return t >= d || s === -1 || s !== null && s > d ? c > 0 && Object.values(n).some((m) => m.isSubmitted && !m.isComplete) ? c : r ? e.length - 1 : null : s === -1 ? null : s; }, Xr = (e) => typeof e == "object" && e !== null && "group" in e, en = (e) => e === Gr || e === Zn, Jt = ({ segment: e, allResponses: t, cards: r, surveyVisitorAttributes: o }) => Array.isArray(e) ? tn({ segments: e, allResponses: t, cards: r, surveyVisitorAttributes: o }) : !en(e) && !!((n) => typeof n == "object" && n !== null && !Array.isArray(n) && "comparator" in n)(e) && (({ rule: n, allResponses: i, cards: a,