@evelan/jexity-widget 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +775 -779
- package/dist/index.mjs.map +1 -1
- package/dist/react.mjs +787 -791
- package/dist/react.mjs.map +1 -1
- package/dist/types/features/chat/hooks/useConvexSession.d.ts +0 -1
- package/dist/types/features/chat/hooks/useConvexSession.d.ts.map +1 -1
- package/dist/types/module/shell/mount.d.ts.map +1 -1
- package/dist/types/module/shell/shell.state.d.ts +3 -0
- package/dist/types/module/shell/shell.state.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/widget.js +19 -19
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ze, m, yr, vr, le, $n, _r, kr, wr, rn, zt, Bt, Sr, Ve = {}, jr = [], Pi = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Xe = Array.isArray;
|
|
2
2
|
function Z(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function sn(t) {
|
|
7
7
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function re(t, e, n) {
|
|
10
10
|
var r, i, s, o = {};
|
|
11
11
|
for (s in e) s == "key" ? r = e[s] : s == "ref" ? i = e[s] : o[s] = e[s];
|
|
12
|
-
if (arguments.length > 2 && (o.children = arguments.length > 3 ?
|
|
13
|
-
return
|
|
12
|
+
if (arguments.length > 2 && (o.children = arguments.length > 3 ? Ze.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) o[s] === void 0 && (o[s] = t.defaultProps[s]);
|
|
13
|
+
return Be(t, o, r, i, null);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
var s = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++
|
|
15
|
+
function Be(t, e, n, r, i) {
|
|
16
|
+
var s = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++yr, __i: -1, __u: 0 };
|
|
17
17
|
return i == null && m.vnode != null && m.vnode(s), s;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Mi() {
|
|
20
20
|
return { current: null };
|
|
21
21
|
}
|
|
22
22
|
function F(t) {
|
|
@@ -25,57 +25,57 @@ function F(t) {
|
|
|
25
25
|
function z(t, e) {
|
|
26
26
|
this.props = t, this.context = e;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
if (e == null) return t.__ ?
|
|
28
|
+
function je(t, e) {
|
|
29
|
+
if (e == null) return t.__ ? je(t.__, t.__i + 1) : null;
|
|
30
30
|
for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
|
|
31
|
-
return typeof t.type == "function" ?
|
|
31
|
+
return typeof t.type == "function" ? je(t) : null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function Cr(t) {
|
|
34
34
|
var e, n;
|
|
35
35
|
if ((t = t.__) != null && t.__c != null) {
|
|
36
36
|
for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
|
|
37
37
|
t.__e = t.__c.base = n.__e;
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return Cr(t);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
function Ft(t) {
|
|
44
|
-
(!t.__d && (t.__d = !0) && le.push(t) && !
|
|
44
|
+
(!t.__d && (t.__d = !0) && le.push(t) && !ht.__r++ || $n != m.debounceRendering) && (($n = m.debounceRendering) || _r)(ht);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
for (var t, e, n, r, i, s, o, l = 1; le.length; ) le.length > l && le.sort(
|
|
48
|
-
|
|
46
|
+
function ht() {
|
|
47
|
+
for (var t, e, n, r, i, s, o, l = 1; le.length; ) le.length > l && le.sort(kr), t = le.shift(), l = le.length, t.__d && (n = void 0, r = void 0, i = (r = (e = t).__v).__e, s = [], o = [], e.__P && ((n = Z({}, r)).__v = r.__v + 1, m.vnode && m.vnode(n), on(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [i] : null, s, i ?? je(r), !!(32 & r.__u), o), n.__v = r.__v, n.__.__k[n.__i] = n, $r(s, n, o), r.__e = r.__ = null, n.__e != i && Cr(n)));
|
|
48
|
+
ht.__r = 0;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
var c, p, f, g, b, w, _, k = r && r.__k ||
|
|
52
|
-
for (a =
|
|
50
|
+
function Tr(t, e, n, r, i, s, o, l, a, u, d) {
|
|
51
|
+
var c, p, f, g, b, w, _, k = r && r.__k || jr, V = e.length;
|
|
52
|
+
for (a = Li(n, e, k, a, V), c = 0; c < V; c++) (f = n.__k[c]) != null && (p = f.__i == -1 ? Ve : k[f.__i] || Ve, f.__i = c, w = on(t, f, p, i, s, o, l, a, u, d), g = f.__e, f.ref && p.ref != f.ref && (p.ref && an(p.ref, null, f), d.push(f.ref, f.__c || g, f)), b == null && g != null && (b = g), (_ = !!(4 & f.__u)) || p.__k === f.__k ? a = Rr(f, a, t, _) : typeof f.type == "function" && w !== void 0 ? a = w : g && (a = g.nextSibling), f.__u &= -7);
|
|
53
53
|
return n.__e = b, a;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Li(t, e, n, r, i) {
|
|
56
56
|
var s, o, l, a, u, d = n.length, c = d, p = 0;
|
|
57
|
-
for (t.__k = new Array(i), s = 0; s < i; s++) (o = e[s]) != null && typeof o != "boolean" && typeof o != "function" ? (a = s + p, (o = t.__k[s] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ?
|
|
58
|
-
if (c) for (s = 0; s < d; s++) (l = n[s]) != null && (2 & l.__u) == 0 && (l.__e == r && (r =
|
|
57
|
+
for (t.__k = new Array(i), s = 0; s < i; s++) (o = e[s]) != null && typeof o != "boolean" && typeof o != "function" ? (a = s + p, (o = t.__k[s] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Be(null, o, null, null, null) : Xe(o) ? Be(F, { children: o }, null, null, null) : o.constructor == null && o.__b > 0 ? Be(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o).__ = t, o.__b = t.__b + 1, l = null, (u = o.__i = Oi(o, n, a, c)) != -1 && (c--, (l = n[u]) && (l.__u |= 2)), l == null || l.__v == null ? (u == -1 && (i > d ? p-- : i < d && p++), typeof o.type != "function" && (o.__u |= 4)) : u != a && (u == a - 1 ? p-- : u == a + 1 ? p++ : (u > a ? p-- : p++, o.__u |= 4))) : t.__k[s] = null;
|
|
58
|
+
if (c) for (s = 0; s < d; s++) (l = n[s]) != null && (2 & l.__u) == 0 && (l.__e == r && (r = je(l)), Ir(l, l));
|
|
59
59
|
return r;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Rr(t, e, n, r) {
|
|
62
62
|
var i, s;
|
|
63
63
|
if (typeof t.type == "function") {
|
|
64
|
-
for (i = t.__k, s = 0; i && s < i.length; s++) i[s] && (i[s].__ = t, e =
|
|
64
|
+
for (i = t.__k, s = 0; i && s < i.length; s++) i[s] && (i[s].__ = t, e = Rr(i[s], e, n, r));
|
|
65
65
|
return e;
|
|
66
66
|
}
|
|
67
|
-
t.__e != e && (r && (e && t.type && !e.parentNode && (e =
|
|
67
|
+
t.__e != e && (r && (e && t.type && !e.parentNode && (e = je(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
|
|
68
68
|
do
|
|
69
69
|
e = e && e.nextSibling;
|
|
70
70
|
while (e != null && e.nodeType == 8);
|
|
71
71
|
return e;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
return e = e || [], t == null || typeof t == "boolean" || (
|
|
75
|
-
|
|
73
|
+
function ne(t, e) {
|
|
74
|
+
return e = e || [], t == null || typeof t == "boolean" || (Xe(t) ? t.some(function(n) {
|
|
75
|
+
ne(n, e);
|
|
76
76
|
}) : e.push(t)), e;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Oi(t, e, n, r) {
|
|
79
79
|
var i, s, o, l = t.key, a = t.type, u = e[n], d = u != null && (2 & u.__u) == 0;
|
|
80
80
|
if (u === null && t.key == null || d && l == u.key && a == u.type) return n;
|
|
81
81
|
if (r > (d ? 1 : 0)) {
|
|
@@ -83,17 +83,17 @@ function Li(t, e, n, r) {
|
|
|
83
83
|
}
|
|
84
84
|
return -1;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
86
|
+
function An(t, e, n) {
|
|
87
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || Pi.test(e) ? n : n + "px";
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function rt(t, e, n, r, i) {
|
|
90
90
|
var s, o;
|
|
91
91
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
92
92
|
else {
|
|
93
|
-
if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n ||
|
|
94
|
-
if (n) for (e in n) r && n[e] == r[e] ||
|
|
93
|
+
if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n || An(t.style, e, "");
|
|
94
|
+
if (n) for (e in n) r && n[e] == r[e] || An(t.style, e, n[e]);
|
|
95
95
|
}
|
|
96
|
-
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(
|
|
96
|
+
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(wr, "$1")), o = e.toLowerCase(), e = o in t || e == "onFocusOut" || e == "onFocusIn" ? o.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? r ? n.u = r.u : (n.u = rn, t.addEventListener(e, s ? Bt : zt, s)) : t.removeEventListener(e, s ? Bt : zt, s);
|
|
97
97
|
else {
|
|
98
98
|
if (i == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
99
99
|
else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
|
|
@@ -104,22 +104,22 @@ function it(t, e, n, r, i) {
|
|
|
104
104
|
typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function In(t) {
|
|
108
108
|
return function(e) {
|
|
109
109
|
if (this.l) {
|
|
110
110
|
var n = this.l[e.type + t];
|
|
111
|
-
if (e.t == null) e.t =
|
|
111
|
+
if (e.t == null) e.t = rn++;
|
|
112
112
|
else if (e.t < n.u) return;
|
|
113
113
|
return n(m.event ? m.event(e) : e);
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
var d, c, p, f, g, b, w, _, k, V, W, ie, O,
|
|
117
|
+
function on(t, e, n, r, i, s, o, l, a, u) {
|
|
118
|
+
var d, c, p, f, g, b, w, _, k, V, W, ie, O, Rn, nt, Pe, Rt, H = e.type;
|
|
119
119
|
if (e.constructor != null) return null;
|
|
120
120
|
128 & n.__u && (a = !!(32 & n.__u), s = [l = e.__e = n.__e]), (d = m.__b) && d(e);
|
|
121
121
|
e: if (typeof H == "function") try {
|
|
122
|
-
if (_ = e.props, k = "prototype" in H && H.prototype.render, V = (d = H.contextType) && r[d.__c], W = d ? V ? V.props.value : d.__ : r, n.__c ? w = (c = e.__c = n.__c).__ = c.__E : (k ? e.__c = c = new H(_, W) : (e.__c = c = new z(_, W), c.constructor = H, c.render =
|
|
122
|
+
if (_ = e.props, k = "prototype" in H && H.prototype.render, V = (d = H.contextType) && r[d.__c], W = d ? V ? V.props.value : d.__ : r, n.__c ? w = (c = e.__c = n.__c).__ = c.__E : (k ? e.__c = c = new H(_, W) : (e.__c = c = new z(_, W), c.constructor = H, c.render = Qi), V && V.sub(c), c.props = _, c.state || (c.state = {}), c.context = W, c.__n = r, p = c.__d = !0, c.__h = [], c._sb = []), k && c.__s == null && (c.__s = c.state), k && H.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = Z({}, c.__s)), Z(c.__s, H.getDerivedStateFromProps(_, c.__s))), f = c.props, g = c.state, c.__v = e, p) k && H.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), k && c.componentDidMount != null && c.__h.push(c.componentDidMount);
|
|
123
123
|
else {
|
|
124
124
|
if (k && H.getDerivedStateFromProps == null && _ !== f && c.componentWillReceiveProps != null && c.componentWillReceiveProps(_, W), !c.__e && c.shouldComponentUpdate != null && c.shouldComponentUpdate(_, c.__s, W) === !1 || e.__v == n.__v) {
|
|
125
125
|
for (e.__v != n.__v && (c.props = _, c.state = c.__s, c.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(xe) {
|
|
@@ -132,32 +132,32 @@ function sn(t, e, n, r, i, s, o, l, a, u) {
|
|
|
132
132
|
c.componentDidUpdate(f, g, b);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
if (c.context = W, c.props = _, c.__P = t, c.__e = !1, O = m.__r,
|
|
136
|
-
for (c.state = c.__s, c.__d = !1, O && O(e), d = c.render(c.props, c.state, c.context),
|
|
135
|
+
if (c.context = W, c.props = _, c.__P = t, c.__e = !1, O = m.__r, Rn = 0, k) {
|
|
136
|
+
for (c.state = c.__s, c.__d = !1, O && O(e), d = c.render(c.props, c.state, c.context), nt = 0; nt < c._sb.length; nt++) c.__h.push(c._sb[nt]);
|
|
137
137
|
c._sb = [];
|
|
138
138
|
} else do
|
|
139
139
|
c.__d = !1, O && O(e), d = c.render(c.props, c.state, c.context), c.state = c.__s;
|
|
140
|
-
while (c.__d && ++
|
|
141
|
-
c.state = c.__s, c.getChildContext != null && (r = Z(Z({}, r), c.getChildContext())), k && !p && c.getSnapshotBeforeUpdate != null && (b = c.getSnapshotBeforeUpdate(f, g)),
|
|
140
|
+
while (c.__d && ++Rn < 25);
|
|
141
|
+
c.state = c.__s, c.getChildContext != null && (r = Z(Z({}, r), c.getChildContext())), k && !p && c.getSnapshotBeforeUpdate != null && (b = c.getSnapshotBeforeUpdate(f, g)), Pe = d, d != null && d.type === F && d.key == null && (Pe = Ar(d.props.children)), l = Tr(t, Xe(Pe) ? Pe : [Pe], e, n, r, i, s, o, l, a, u), c.base = e.__e, e.__u &= -161, c.__h.length && o.push(c), w && (c.__E = c.__ = null);
|
|
142
142
|
} catch (xe) {
|
|
143
143
|
if (e.__v = null, a || s != null) if (xe.then) {
|
|
144
144
|
for (e.__u |= a ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
145
145
|
s[s.indexOf(l)] = null, e.__e = l;
|
|
146
146
|
} else {
|
|
147
|
-
for (Rt = s.length; Rt--; )
|
|
147
|
+
for (Rt = s.length; Rt--; ) sn(s[Rt]);
|
|
148
148
|
Dt(e);
|
|
149
149
|
}
|
|
150
150
|
else e.__e = n.__e, e.__k = n.__k, xe.then || Dt(e);
|
|
151
151
|
m.__e(xe, e, n);
|
|
152
152
|
}
|
|
153
|
-
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e =
|
|
153
|
+
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = Ni(n.__e, e, n, r, i, s, o, a, u);
|
|
154
154
|
return (d = m.diffed) && d(e), 128 & e.__u ? void 0 : l;
|
|
155
155
|
}
|
|
156
156
|
function Dt(t) {
|
|
157
157
|
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(Dt);
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
for (var r = 0; r < n.length; r++)
|
|
159
|
+
function $r(t, e, n) {
|
|
160
|
+
for (var r = 0; r < n.length; r++) an(n[r], n[++r], n[++r]);
|
|
161
161
|
m.__c && m.__c(e, t), t.some(function(i) {
|
|
162
162
|
try {
|
|
163
163
|
t = i.__h, i.__h = [], t.some(function(s) {
|
|
@@ -168,10 +168,10 @@ function Rr(t, e, n) {
|
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t :
|
|
171
|
+
function Ar(t) {
|
|
172
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : Xe(t) ? t.map(Ar) : Z({}, t);
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Ni(t, e, n, r, i, s, o, l, a) {
|
|
175
175
|
var u, d, c, p, f, g, b, w = n.props, _ = e.props, k = e.type;
|
|
176
176
|
if (k == "svg" ? i = "http://www.w3.org/2000/svg" : k == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), s != null) {
|
|
177
177
|
for (u = 0; u < s.length; u++) if ((f = s[u]) && "setAttribute" in f == !!k && (k ? f.localName == k : f.nodeType == 3)) {
|
|
@@ -185,22 +185,22 @@ function Oi(t, e, n, r, i, s, o, l, a) {
|
|
|
185
185
|
}
|
|
186
186
|
if (k == null) w === _ || l && t.data == _ || (t.data = _);
|
|
187
187
|
else {
|
|
188
|
-
if (s = s &&
|
|
188
|
+
if (s = s && Ze.call(t.childNodes), w = n.props || Ve, !l && s != null) for (w = {}, u = 0; u < t.attributes.length; u++) w[(f = t.attributes[u]).name] = f.value;
|
|
189
189
|
for (u in w) if (f = w[u], u != "children") {
|
|
190
190
|
if (u == "dangerouslySetInnerHTML") c = f;
|
|
191
191
|
else if (!(u in _)) {
|
|
192
192
|
if (u == "value" && "defaultValue" in _ || u == "checked" && "defaultChecked" in _) continue;
|
|
193
|
-
|
|
193
|
+
rt(t, u, null, f, i);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
for (u in _) f = _[u], u == "children" ? p = f : u == "dangerouslySetInnerHTML" ? d = f : u == "value" ? g = f : u == "checked" ? b = f : l && typeof f != "function" || w[u] === f ||
|
|
196
|
+
for (u in _) f = _[u], u == "children" ? p = f : u == "dangerouslySetInnerHTML" ? d = f : u == "value" ? g = f : u == "checked" ? b = f : l && typeof f != "function" || w[u] === f || rt(t, u, f, w[u], i);
|
|
197
197
|
if (d) l || c && (d.__html == c.__html || d.__html == t.innerHTML) || (t.innerHTML = d.__html), e.__k = [];
|
|
198
|
-
else if (c && (t.innerHTML = ""),
|
|
199
|
-
l || (u = "value", k == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[u] || k == "progress" && !g || k == "option" && g != w[u]) &&
|
|
198
|
+
else if (c && (t.innerHTML = ""), Tr(e.type == "template" ? t.content : t, Xe(p) ? p : [p], e, n, r, k == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, s, o, s ? s[0] : n.__k && je(n, 0), l, a), s != null) for (u = s.length; u--; ) sn(s[u]);
|
|
199
|
+
l || (u = "value", k == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[u] || k == "progress" && !g || k == "option" && g != w[u]) && rt(t, u, g, w[u], i), u = "checked", b != null && b != t[u] && rt(t, u, b, w[u], i));
|
|
200
200
|
}
|
|
201
201
|
return t;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function an(t, e, n) {
|
|
204
204
|
try {
|
|
205
205
|
if (typeof t == "function") {
|
|
206
206
|
var r = typeof t.__u == "function";
|
|
@@ -210,9 +210,9 @@ function on(t, e, n) {
|
|
|
210
210
|
m.__e(i, n);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Ir(t, e, n) {
|
|
214
214
|
var r, i;
|
|
215
|
-
if (m.unmount && m.unmount(t), (r = t.ref) && (r.current && r.current != t.__e ||
|
|
215
|
+
if (m.unmount && m.unmount(t), (r = t.ref) && (r.current && r.current != t.__e || an(r, null, e)), (r = t.__c) != null) {
|
|
216
216
|
if (r.componentWillUnmount) try {
|
|
217
217
|
r.componentWillUnmount();
|
|
218
218
|
} catch (s) {
|
|
@@ -220,25 +220,25 @@ function Ar(t, e, n) {
|
|
|
220
220
|
}
|
|
221
221
|
r.base = r.__P = null;
|
|
222
222
|
}
|
|
223
|
-
if (r = t.__k) for (i = 0; i < r.length; i++) r[i] &&
|
|
224
|
-
n ||
|
|
223
|
+
if (r = t.__k) for (i = 0; i < r.length; i++) r[i] && Ir(r[i], e, n || typeof t.type != "function");
|
|
224
|
+
n || sn(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function Qi(t, e, n) {
|
|
227
227
|
return this.constructor(t, n);
|
|
228
228
|
}
|
|
229
229
|
function he(t, e, n) {
|
|
230
230
|
var r, i, s, o;
|
|
231
|
-
e == document && (e = document.documentElement), m.__ && m.__(t, e), i = (r = typeof n == "function") ? null : n && n.__k || e.__k, s = [], o = [],
|
|
231
|
+
e == document && (e = document.documentElement), m.__ && m.__(t, e), i = (r = typeof n == "function") ? null : n && n.__k || e.__k, s = [], o = [], on(e, t = (!r && n || e).__k = re(F, null, [t]), i || Ve, Ve, e.namespaceURI, !r && n ? [n] : i ? null : e.firstChild ? Ze.call(e.childNodes) : null, s, !r && n ? n : i ? i.__e : e.firstChild, r, o), $r(s, t, o);
|
|
232
232
|
}
|
|
233
|
-
function
|
|
234
|
-
he(t, e,
|
|
233
|
+
function Er(t, e) {
|
|
234
|
+
he(t, e, Er);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function zi(t, e, n) {
|
|
237
237
|
var r, i, s, o, l = Z({}, t.props);
|
|
238
238
|
for (s in t.type && t.type.defaultProps && (o = t.type.defaultProps), e) s == "key" ? r = e[s] : s == "ref" ? i = e[s] : l[s] = e[s] === void 0 && o != null ? o[s] : e[s];
|
|
239
|
-
return arguments.length > 2 && (l.children = arguments.length > 3 ?
|
|
239
|
+
return arguments.length > 2 && (l.children = arguments.length > 3 ? Ze.call(arguments, 2) : n), Be(t.type, l, r || t.key, i || t.ref, null);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function Bi(t) {
|
|
242
242
|
function e(n) {
|
|
243
243
|
var r, i;
|
|
244
244
|
return this.getChildContext || (r = /* @__PURE__ */ new Set(), (i = {})[e.__c] = this, this.getChildContext = function() {
|
|
@@ -257,48 +257,48 @@ function zi(t) {
|
|
|
257
257
|
};
|
|
258
258
|
}), n.children;
|
|
259
259
|
}
|
|
260
|
-
return e.__c = "__cC" +
|
|
260
|
+
return e.__c = "__cC" + Sr++, e.__ = t, e.Provider = e.__l = (e.Consumer = function(n, r) {
|
|
261
261
|
return n.children(r);
|
|
262
262
|
}).contextType = e, e;
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
Ze = jr.slice, m = { __e: function(t, e, n, r) {
|
|
265
265
|
for (var i, s, o; e = e.__; ) if ((i = e.__c) && !i.__) try {
|
|
266
266
|
if ((s = i.constructor) && s.getDerivedStateFromError != null && (i.setState(s.getDerivedStateFromError(t)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, r || {}), o = i.__d), o) return i.__E = i;
|
|
267
267
|
} catch (l) {
|
|
268
268
|
t = l;
|
|
269
269
|
}
|
|
270
270
|
throw t;
|
|
271
|
-
} },
|
|
271
|
+
} }, yr = 0, vr = function(t) {
|
|
272
272
|
return t != null && t.constructor == null;
|
|
273
273
|
}, z.prototype.setState = function(t, e) {
|
|
274
274
|
var n;
|
|
275
275
|
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = Z({}, this.state), typeof t == "function" && (t = t(Z({}, n), this.props)), t && Z(n, t), t != null && this.__v && (e && this._sb.push(e), Ft(this));
|
|
276
276
|
}, z.prototype.forceUpdate = function(t) {
|
|
277
277
|
this.__v && (this.__e = !0, t && this.__h.push(t), Ft(this));
|
|
278
|
-
}, z.prototype.render = F, le = [],
|
|
278
|
+
}, z.prototype.render = F, le = [], _r = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, kr = function(t, e) {
|
|
279
279
|
return t.__v.__b - e.__v.__b;
|
|
280
|
-
},
|
|
281
|
-
var
|
|
280
|
+
}, ht.__r = 0, wr = /(PointerCapture)$|Capture$/i, rn = 0, zt = In(!1), Bt = In(!0), Sr = 0;
|
|
281
|
+
var Fi = 0;
|
|
282
282
|
function h(t, e, n, r, i, s) {
|
|
283
283
|
e || (e = {});
|
|
284
284
|
var o, l, a = e;
|
|
285
285
|
if ("ref" in a) for (l in a = {}, e) l == "ref" ? o = e[l] : a[l] = e[l];
|
|
286
|
-
var u = { type: t, props: a, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --
|
|
286
|
+
var u = { type: t, props: a, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Fi, __i: -1, __u: 0, __source: i, __self: s };
|
|
287
287
|
if (typeof t == "function" && (o = t.defaultProps)) for (l in o) a[l] === void 0 && (a[l] = o[l]);
|
|
288
288
|
return m.vnode && m.vnode(u), u;
|
|
289
289
|
}
|
|
290
|
-
var oe, S, $t,
|
|
291
|
-
function
|
|
292
|
-
j.__h && j.__h(S, t,
|
|
290
|
+
var oe, S, $t, En, Ce = 0, qr = [], j = m, qn = j.__b, Pn = j.__r, Mn = j.diffed, Ln = j.__c, On = j.unmount, Nn = j.__;
|
|
291
|
+
function Ae(t, e) {
|
|
292
|
+
j.__h && j.__h(S, t, Ce || e), Ce = 0;
|
|
293
293
|
var n = S.__H || (S.__H = { __: [], __h: [] });
|
|
294
294
|
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
295
295
|
}
|
|
296
296
|
function R(t) {
|
|
297
|
-
return
|
|
297
|
+
return Ce = 1, ln(Or, t);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
var r =
|
|
301
|
-
if (r.t = t, !r.__c && (r.__ = [n ? n(e) :
|
|
299
|
+
function ln(t, e, n) {
|
|
300
|
+
var r = Ae(oe++, 2);
|
|
301
|
+
if (r.t = t, !r.__c && (r.__ = [n ? n(e) : Or(void 0, e), function(l) {
|
|
302
302
|
var a = r.__N ? r.__N[0] : r.__[0], u = r.t(a, l);
|
|
303
303
|
a !== u && (r.__N = [u, r.__[1]], r.__c.setState({}));
|
|
304
304
|
}], r.__c = S, !S.__f)) {
|
|
@@ -331,20 +331,20 @@ function an(t, e, n) {
|
|
|
331
331
|
return r.__N || r.__;
|
|
332
332
|
}
|
|
333
333
|
function D(t, e) {
|
|
334
|
-
var n =
|
|
335
|
-
!j.__s &&
|
|
334
|
+
var n = Ae(oe++, 3);
|
|
335
|
+
!j.__s && cn(n.__H, e) && (n.__ = t, n.u = e, S.__H.__h.push(n));
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
var n =
|
|
339
|
-
!j.__s &&
|
|
337
|
+
function Ye(t, e) {
|
|
338
|
+
var n = Ae(oe++, 4);
|
|
339
|
+
!j.__s && cn(n.__H, e) && (n.__ = t, n.u = e, S.__h.push(n));
|
|
340
340
|
}
|
|
341
341
|
function vt(t) {
|
|
342
|
-
return
|
|
342
|
+
return Ce = 5, U(function() {
|
|
343
343
|
return { current: t };
|
|
344
344
|
}, []);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
346
|
+
function Pr(t, e, n) {
|
|
347
|
+
Ce = 6, Ye(function() {
|
|
348
348
|
if (typeof t == "function") {
|
|
349
349
|
var r = t(e());
|
|
350
350
|
return function() {
|
|
@@ -357,23 +357,23 @@ function qr(t, e, n) {
|
|
|
357
357
|
}, n == null ? n : n.concat(t));
|
|
358
358
|
}
|
|
359
359
|
function U(t, e) {
|
|
360
|
-
var n =
|
|
361
|
-
return
|
|
360
|
+
var n = Ae(oe++, 7);
|
|
361
|
+
return cn(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
return
|
|
363
|
+
function We(t, e) {
|
|
364
|
+
return Ce = 8, U(function() {
|
|
365
365
|
return t;
|
|
366
366
|
}, e);
|
|
367
367
|
}
|
|
368
368
|
function _t(t) {
|
|
369
|
-
var e = S.context[t.__c], n =
|
|
369
|
+
var e = S.context[t.__c], n = Ae(oe++, 9);
|
|
370
370
|
return n.c = t, e ? (n.__ == null && (n.__ = !0, e.sub(S)), e.props.value) : t.__;
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function Mr(t, e) {
|
|
373
373
|
j.useDebugValue && j.useDebugValue(e ? e(t) : t);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
var t =
|
|
375
|
+
function Lr() {
|
|
376
|
+
var t = Ae(oe++, 11);
|
|
377
377
|
if (!t.__) {
|
|
378
378
|
for (var e = S.__v; e !== null && !e.__m && e.__ !== null; ) e = e.__;
|
|
379
379
|
var n = e.__m || (e.__m = [0, 0]);
|
|
@@ -381,33 +381,33 @@ function Mr() {
|
|
|
381
381
|
}
|
|
382
382
|
return t.__;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
for (var t; t =
|
|
386
|
-
t.__H.__h.forEach(
|
|
384
|
+
function Di() {
|
|
385
|
+
for (var t; t = qr.shift(); ) if (t.__P && t.__H) try {
|
|
386
|
+
t.__H.__h.forEach(lt), t.__H.__h.forEach(Ut), t.__H.__h = [];
|
|
387
387
|
} catch (e) {
|
|
388
388
|
t.__H.__h = [], j.__e(e, t.__v);
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
j.__b = function(t) {
|
|
392
|
-
S = null,
|
|
392
|
+
S = null, qn && qn(t);
|
|
393
393
|
}, j.__ = function(t, e) {
|
|
394
|
-
t && e.__k && e.__k.__m && (t.__m = e.__k.__m),
|
|
394
|
+
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Nn && Nn(t, e);
|
|
395
395
|
}, j.__r = function(t) {
|
|
396
|
-
|
|
396
|
+
Pn && Pn(t), oe = 0;
|
|
397
397
|
var e = (S = t.__c).__H;
|
|
398
398
|
e && ($t === S ? (e.__h = [], S.__h = [], e.__.forEach(function(n) {
|
|
399
399
|
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
400
|
-
})) : (e.__h.forEach(
|
|
400
|
+
})) : (e.__h.forEach(lt), e.__h.forEach(Ut), e.__h = [], oe = 0)), $t = S;
|
|
401
401
|
}, j.diffed = function(t) {
|
|
402
|
-
|
|
402
|
+
Mn && Mn(t);
|
|
403
403
|
var e = t.__c;
|
|
404
|
-
e && e.__H && (e.__H.__h.length && (
|
|
404
|
+
e && e.__H && (e.__H.__h.length && (qr.push(e) !== 1 && En === j.requestAnimationFrame || ((En = j.requestAnimationFrame) || Ui)(Di)), e.__H.__.forEach(function(n) {
|
|
405
405
|
n.u && (n.__H = n.u), n.u = void 0;
|
|
406
406
|
})), $t = S = null;
|
|
407
407
|
}, j.__c = function(t, e) {
|
|
408
408
|
e.some(function(n) {
|
|
409
409
|
try {
|
|
410
|
-
n.__h.forEach(
|
|
410
|
+
n.__h.forEach(lt), n.__h = n.__h.filter(function(r) {
|
|
411
411
|
return !r.__ || Ut(r);
|
|
412
412
|
});
|
|
413
413
|
} catch (r) {
|
|
@@ -415,26 +415,26 @@ j.__b = function(t) {
|
|
|
415
415
|
i.__h && (i.__h = []);
|
|
416
416
|
}), e = [], j.__e(r, n.__v);
|
|
417
417
|
}
|
|
418
|
-
}),
|
|
418
|
+
}), Ln && Ln(t, e);
|
|
419
419
|
}, j.unmount = function(t) {
|
|
420
|
-
|
|
420
|
+
On && On(t);
|
|
421
421
|
var e, n = t.__c;
|
|
422
422
|
n && n.__H && (n.__H.__.forEach(function(r) {
|
|
423
423
|
try {
|
|
424
|
-
|
|
424
|
+
lt(r);
|
|
425
425
|
} catch (i) {
|
|
426
426
|
e = i;
|
|
427
427
|
}
|
|
428
428
|
}), n.__H = void 0, e && j.__e(e, n.__v));
|
|
429
429
|
};
|
|
430
|
-
var
|
|
431
|
-
function
|
|
430
|
+
var Qn = typeof requestAnimationFrame == "function";
|
|
431
|
+
function Ui(t) {
|
|
432
432
|
var e, n = function() {
|
|
433
|
-
clearTimeout(r),
|
|
433
|
+
clearTimeout(r), Qn && cancelAnimationFrame(e), setTimeout(t);
|
|
434
434
|
}, r = setTimeout(n, 35);
|
|
435
|
-
|
|
435
|
+
Qn && (e = requestAnimationFrame(n));
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function lt(t) {
|
|
438
438
|
var e = S, n = t.__c;
|
|
439
439
|
typeof n == "function" && (t.__c = void 0, n()), S = e;
|
|
440
440
|
}
|
|
@@ -442,15 +442,15 @@ function Ut(t) {
|
|
|
442
442
|
var e = S;
|
|
443
443
|
t.__c = t.__(), S = e;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function cn(t, e) {
|
|
446
446
|
return !t || t.length !== e.length || e.some(function(n, r) {
|
|
447
447
|
return n !== t[r];
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Or(t, e) {
|
|
451
451
|
return typeof e == "function" ? e(t) : e;
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function Nr(t, e) {
|
|
454
454
|
for (var n in e) t[n] = e[n];
|
|
455
455
|
return t;
|
|
456
456
|
}
|
|
@@ -459,9 +459,9 @@ function Vt(t, e) {
|
|
|
459
459
|
for (var r in e) if (r !== "__source" && t[r] !== e[r]) return !0;
|
|
460
460
|
return !1;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Qr(t, e) {
|
|
463
463
|
var n = e(), r = R({ t: { __: n, u: e } }), i = r[0].t, s = r[1];
|
|
464
|
-
return
|
|
464
|
+
return Ye(function() {
|
|
465
465
|
i.__ = n, i.u = e, At(i) && s({ t: i });
|
|
466
466
|
}, [t, n, e]), D(function() {
|
|
467
467
|
return At(i) && s({ t: i }), t(function() {
|
|
@@ -478,80 +478,80 @@ function At(t) {
|
|
|
478
478
|
return !0;
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function zr(t) {
|
|
482
482
|
t();
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function Br(t) {
|
|
485
485
|
return t;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
return [!1,
|
|
487
|
+
function Fr() {
|
|
488
|
+
return [!1, zr];
|
|
489
489
|
}
|
|
490
|
-
var
|
|
490
|
+
var Dr = Ye;
|
|
491
491
|
function Wt(t, e) {
|
|
492
492
|
this.props = t, this.context = e;
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function Vi(t, e) {
|
|
495
495
|
function n(i) {
|
|
496
496
|
var s = this.props.ref, o = s == i.ref;
|
|
497
497
|
return !o && s && (s.call ? s(null) : s.current = null), e ? !e(this.props, i) || !o : Vt(this.props, i);
|
|
498
498
|
}
|
|
499
499
|
function r(i) {
|
|
500
|
-
return this.shouldComponentUpdate = n,
|
|
500
|
+
return this.shouldComponentUpdate = n, re(t, i);
|
|
501
501
|
}
|
|
502
502
|
return r.displayName = "Memo(" + (t.displayName || t.name) + ")", r.prototype.isReactComponent = !0, r.__f = !0, r.type = t, r;
|
|
503
503
|
}
|
|
504
504
|
(Wt.prototype = new z()).isPureReactComponent = !0, Wt.prototype.shouldComponentUpdate = function(t, e) {
|
|
505
505
|
return Vt(this.props, t) || Vt(this.state, e);
|
|
506
506
|
};
|
|
507
|
-
var
|
|
507
|
+
var zn = m.__b;
|
|
508
508
|
m.__b = function(t) {
|
|
509
|
-
t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null),
|
|
509
|
+
t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), zn && zn(t);
|
|
510
510
|
};
|
|
511
|
-
var
|
|
512
|
-
function
|
|
511
|
+
var Wi = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.forward_ref") || 3911;
|
|
512
|
+
function Hi(t) {
|
|
513
513
|
function e(n) {
|
|
514
|
-
var r =
|
|
514
|
+
var r = Nr({}, n);
|
|
515
515
|
return delete r.ref, t(r, n.ref || null);
|
|
516
516
|
}
|
|
517
|
-
return e.$$typeof =
|
|
517
|
+
return e.$$typeof = Wi, e.render = t, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e;
|
|
518
518
|
}
|
|
519
|
-
var
|
|
520
|
-
return t == null ? null :
|
|
521
|
-
},
|
|
522
|
-
return t ?
|
|
519
|
+
var Bn = function(t, e) {
|
|
520
|
+
return t == null ? null : ne(ne(t).map(e));
|
|
521
|
+
}, Ji = { map: Bn, forEach: Bn, count: function(t) {
|
|
522
|
+
return t ? ne(t).length : 0;
|
|
523
523
|
}, only: function(t) {
|
|
524
|
-
var e =
|
|
524
|
+
var e = ne(t);
|
|
525
525
|
if (e.length !== 1) throw "Children.only";
|
|
526
526
|
return e[0];
|
|
527
|
-
}, toArray:
|
|
527
|
+
}, toArray: ne }, Gi = m.__e;
|
|
528
528
|
m.__e = function(t, e, n, r) {
|
|
529
529
|
if (t.then) {
|
|
530
530
|
for (var i, s = e; s = s.__; ) if ((i = s.__c) && i.__c) return e.__e == null && (e.__e = n.__e, e.__k = n.__k), i.__c(t, e);
|
|
531
531
|
}
|
|
532
532
|
Gi(t, e, n, r);
|
|
533
533
|
};
|
|
534
|
-
var
|
|
535
|
-
function
|
|
534
|
+
var Fn = m.unmount;
|
|
535
|
+
function Ur(t, e, n) {
|
|
536
536
|
return t && (t.__c && t.__c.__H && (t.__c.__H.__.forEach(function(r) {
|
|
537
537
|
typeof r.__c == "function" && r.__c();
|
|
538
|
-
}), t.__c.__H = null), (t =
|
|
539
|
-
return
|
|
538
|
+
}), t.__c.__H = null), (t = Nr({}, t)).__c != null && (t.__c.__P === n && (t.__c.__P = e), t.__c.__e = !0, t.__c = null), t.__k = t.__k && t.__k.map(function(r) {
|
|
539
|
+
return Ur(r, e, n);
|
|
540
540
|
})), t;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Vr(t, e, n) {
|
|
543
543
|
return t && n && (t.__v = null, t.__k = t.__k && t.__k.map(function(r) {
|
|
544
|
-
return
|
|
544
|
+
return Vr(r, e, n);
|
|
545
545
|
}), t.__c && t.__c.__P === e && (t.__e && n.appendChild(t.__e), t.__c.__e = !0, t.__c.__P = n)), t;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function ct() {
|
|
548
548
|
this.__u = 0, this.o = null, this.__b = null;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Wr(t) {
|
|
551
551
|
var e = t.__.__c;
|
|
552
552
|
return e && e.__a && e.__a(t);
|
|
553
553
|
}
|
|
554
|
-
function
|
|
554
|
+
function Ki(t) {
|
|
555
555
|
var e, n, r;
|
|
556
556
|
function i(s) {
|
|
557
557
|
if (e || (e = t()).then(function(o) {
|
|
@@ -560,20 +560,20 @@ function Ji(t) {
|
|
|
560
560
|
r = o;
|
|
561
561
|
}), r) throw r;
|
|
562
562
|
if (!n) throw e;
|
|
563
|
-
return
|
|
563
|
+
return re(n, s);
|
|
564
564
|
}
|
|
565
565
|
return i.displayName = "Lazy", i.__f = !0, i;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Ne() {
|
|
568
568
|
this.i = null, this.l = null;
|
|
569
569
|
}
|
|
570
570
|
m.unmount = function(t) {
|
|
571
571
|
var e = t.__c;
|
|
572
|
-
e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null),
|
|
573
|
-
}, (
|
|
572
|
+
e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), Fn && Fn(t);
|
|
573
|
+
}, (ct.prototype = new z()).__c = function(t, e) {
|
|
574
574
|
var n = e.__c, r = this;
|
|
575
575
|
r.o == null && (r.o = []), r.o.push(n);
|
|
576
|
-
var i =
|
|
576
|
+
var i = Wr(r.__v), s = !1, o = function() {
|
|
577
577
|
s || (s = !0, n.__R = null, i ? i(l) : l());
|
|
578
578
|
};
|
|
579
579
|
n.__R = o;
|
|
@@ -581,39 +581,39 @@ m.unmount = function(t) {
|
|
|
581
581
|
if (!--r.__u) {
|
|
582
582
|
if (r.state.__a) {
|
|
583
583
|
var a = r.state.__a;
|
|
584
|
-
r.__v.__k[0] =
|
|
584
|
+
r.__v.__k[0] = Vr(a, a.__c.__P, a.__c.__O);
|
|
585
585
|
}
|
|
586
586
|
var u;
|
|
587
587
|
for (r.setState({ __a: r.__b = null }); u = r.o.pop(); ) u.forceUpdate();
|
|
588
588
|
}
|
|
589
589
|
};
|
|
590
590
|
r.__u++ || 32 & e.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), t.then(o, o);
|
|
591
|
-
},
|
|
591
|
+
}, ct.prototype.componentWillUnmount = function() {
|
|
592
592
|
this.o = [];
|
|
593
|
-
},
|
|
593
|
+
}, ct.prototype.render = function(t, e) {
|
|
594
594
|
if (this.__b) {
|
|
595
595
|
if (this.__v.__k) {
|
|
596
596
|
var n = document.createElement("div"), r = this.__v.__k[0].__c;
|
|
597
|
-
this.__v.__k[0] =
|
|
597
|
+
this.__v.__k[0] = Ur(this.__b, n, r.__O = r.__P);
|
|
598
598
|
}
|
|
599
599
|
this.__b = null;
|
|
600
600
|
}
|
|
601
|
-
var i = e.__a &&
|
|
602
|
-
return i && (i.__u &= -33), [
|
|
601
|
+
var i = e.__a && re(F, null, t.fallback);
|
|
602
|
+
return i && (i.__u &= -33), [re(F, null, e.__a ? null : t.children), i];
|
|
603
603
|
};
|
|
604
|
-
var
|
|
604
|
+
var Dn = function(t, e, n) {
|
|
605
605
|
if (++n[1] === n[0] && t.l.delete(e), t.props.revealOrder && (t.props.revealOrder[0] !== "t" || !t.l.size)) for (n = t.i; n; ) {
|
|
606
606
|
for (; n.length > 3; ) n.pop()();
|
|
607
607
|
if (n[1] < n[0]) break;
|
|
608
608
|
t.i = n = n[2];
|
|
609
609
|
}
|
|
610
610
|
};
|
|
611
|
-
function
|
|
611
|
+
function Zi(t) {
|
|
612
612
|
return this.getChildContext = function() {
|
|
613
613
|
return t.context;
|
|
614
614
|
}, t.children;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function Xi(t) {
|
|
617
617
|
var e = this, n = t.h;
|
|
618
618
|
if (e.componentWillUnmount = function() {
|
|
619
619
|
he(null, e.v), e.v = null, e.h = null;
|
|
@@ -627,40 +627,40 @@ function Zi(t) {
|
|
|
627
627
|
this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.h.removeChild(i);
|
|
628
628
|
} };
|
|
629
629
|
}
|
|
630
|
-
he(
|
|
630
|
+
he(re(Zi, { context: e.context }, t.__v), e.v);
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
var n =
|
|
632
|
+
function Yi(t, e) {
|
|
633
|
+
var n = re(Xi, { __v: t, h: e });
|
|
634
634
|
return n.containerInfo = e, n;
|
|
635
635
|
}
|
|
636
|
-
(
|
|
637
|
-
var e = this, n =
|
|
636
|
+
(Ne.prototype = new z()).__a = function(t) {
|
|
637
|
+
var e = this, n = Wr(e.__v), r = e.l.get(t);
|
|
638
638
|
return r[0]++, function(i) {
|
|
639
639
|
var s = function() {
|
|
640
|
-
e.props.revealOrder ? (r.push(i),
|
|
640
|
+
e.props.revealOrder ? (r.push(i), Dn(e, t, r)) : i();
|
|
641
641
|
};
|
|
642
642
|
n ? n(s) : s();
|
|
643
643
|
};
|
|
644
|
-
},
|
|
644
|
+
}, Ne.prototype.render = function(t) {
|
|
645
645
|
this.i = null, this.l = /* @__PURE__ */ new Map();
|
|
646
|
-
var e =
|
|
646
|
+
var e = ne(t.children);
|
|
647
647
|
t.revealOrder && t.revealOrder[0] === "b" && e.reverse();
|
|
648
648
|
for (var n = e.length; n--; ) this.l.set(e[n], this.i = [1, 0, this.i]);
|
|
649
649
|
return t.children;
|
|
650
|
-
},
|
|
650
|
+
}, Ne.prototype.componentDidUpdate = Ne.prototype.componentDidMount = function() {
|
|
651
651
|
var t = this;
|
|
652
652
|
this.l.forEach(function(e, n) {
|
|
653
|
-
|
|
653
|
+
Dn(t, n, e);
|
|
654
654
|
});
|
|
655
655
|
};
|
|
656
|
-
var
|
|
656
|
+
var Hr = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.element") || 60103, es = /^(?: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]/, ts = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, ns = /[A-Z0-9]/g, rs = typeof document < "u", is = function(t) {
|
|
657
657
|
return (typeof Symbol < "u" && typeof /* @__PURE__ */ Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(t);
|
|
658
658
|
};
|
|
659
|
-
function
|
|
659
|
+
function ss(t, e, n) {
|
|
660
660
|
return e.__k == null && (e.textContent = ""), he(t, e), typeof n == "function" && n(), t ? t.__c : null;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
return
|
|
662
|
+
function os(t, e, n) {
|
|
663
|
+
return Er(t, e), typeof n == "function" && n(), t ? t.__c : null;
|
|
664
664
|
}
|
|
665
665
|
z.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) {
|
|
666
666
|
Object.defineProperty(z.prototype, t, { configurable: !0, get: function() {
|
|
@@ -669,82 +669,82 @@ z.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveP
|
|
|
669
669
|
Object.defineProperty(this, t, { configurable: !0, writable: !0, value: e });
|
|
670
670
|
} });
|
|
671
671
|
});
|
|
672
|
-
var
|
|
673
|
-
function os() {
|
|
674
|
-
}
|
|
672
|
+
var Un = m.event;
|
|
675
673
|
function as() {
|
|
676
|
-
return this.cancelBubble;
|
|
677
674
|
}
|
|
678
675
|
function ls() {
|
|
676
|
+
return this.cancelBubble;
|
|
677
|
+
}
|
|
678
|
+
function cs() {
|
|
679
679
|
return this.defaultPrevented;
|
|
680
680
|
}
|
|
681
681
|
m.event = function(t) {
|
|
682
|
-
return
|
|
682
|
+
return Un && (t = Un(t)), t.persist = as, t.isPropagationStopped = ls, t.isDefaultPrevented = cs, t.nativeEvent = t;
|
|
683
683
|
};
|
|
684
|
-
var
|
|
684
|
+
var un, us = { enumerable: !1, configurable: !0, get: function() {
|
|
685
685
|
return this.class;
|
|
686
|
-
} },
|
|
686
|
+
} }, Vn = m.vnode;
|
|
687
687
|
m.vnode = function(t) {
|
|
688
688
|
typeof t.type == "string" && (function(e) {
|
|
689
689
|
var n = e.props, r = e.type, i = {}, s = r.indexOf("-") === -1;
|
|
690
690
|
for (var o in n) {
|
|
691
691
|
var l = n[o];
|
|
692
|
-
if (!(o === "value" && "defaultValue" in n && l == null ||
|
|
692
|
+
if (!(o === "value" && "defaultValue" in n && l == null || rs && o === "children" && r === "noscript" || o === "class" || o === "className")) {
|
|
693
693
|
var a = o.toLowerCase();
|
|
694
|
-
o === "defaultValue" && "value" in n && n.value == null ? o = "value" : o === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" ||
|
|
694
|
+
o === "defaultValue" && "value" in n && n.value == null ? o = "value" : o === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" || is(n.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : ts.test(o) && (o = a) : a = o = "oninput" : s && es.test(o) ? o = o.replace(ns, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && i[o = a] && (o = "oninputCapture"), i[o] = l;
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
r == "select" && i.multiple && Array.isArray(i.value) && (i.value =
|
|
697
|
+
r == "select" && i.multiple && Array.isArray(i.value) && (i.value = ne(n.children).forEach(function(u) {
|
|
698
698
|
u.props.selected = i.value.indexOf(u.props.value) != -1;
|
|
699
|
-
})), r == "select" && i.defaultValue != null && (i.value =
|
|
699
|
+
})), r == "select" && i.defaultValue != null && (i.value = ne(n.children).forEach(function(u) {
|
|
700
700
|
u.props.selected = i.multiple ? i.defaultValue.indexOf(u.props.value) != -1 : i.defaultValue == u.props.value;
|
|
701
|
-
})), n.class && !n.className ? (i.class = n.class, Object.defineProperty(i, "className",
|
|
702
|
-
})(t), t.$$typeof =
|
|
701
|
+
})), n.class && !n.className ? (i.class = n.class, Object.defineProperty(i, "className", us)) : (n.className && !n.class || n.class && n.className) && (i.class = i.className = n.className), e.props = i;
|
|
702
|
+
})(t), t.$$typeof = Hr, Vn && Vn(t);
|
|
703
703
|
};
|
|
704
|
-
var
|
|
704
|
+
var Wn = m.__r;
|
|
705
705
|
m.__r = function(t) {
|
|
706
|
-
|
|
706
|
+
Wn && Wn(t), un = t.__c;
|
|
707
707
|
};
|
|
708
|
-
var
|
|
708
|
+
var Hn = m.diffed;
|
|
709
709
|
m.diffed = function(t) {
|
|
710
|
-
|
|
710
|
+
Hn && Hn(t);
|
|
711
711
|
var e = t.props, n = t.__e;
|
|
712
|
-
n != null && t.type === "textarea" && "value" in e && e.value !== n.value && (n.value = e.value == null ? "" : e.value),
|
|
712
|
+
n != null && t.type === "textarea" && "value" in e && e.value !== n.value && (n.value = e.value == null ? "" : e.value), un = null;
|
|
713
713
|
};
|
|
714
|
-
var
|
|
715
|
-
return
|
|
716
|
-
}, useCallback:
|
|
717
|
-
function
|
|
718
|
-
return
|
|
714
|
+
var hs = { ReactCurrentDispatcher: { current: { readContext: function(t) {
|
|
715
|
+
return un.__n[t.__c].props.value;
|
|
716
|
+
}, useCallback: We, useContext: _t, useDebugValue: Mr, useDeferredValue: Br, useEffect: D, useId: Lr, useImperativeHandle: Pr, useInsertionEffect: Dr, useLayoutEffect: Ye, useMemo: U, useReducer: ln, useRef: vt, useState: R, useSyncExternalStore: Qr, useTransition: Fr } } };
|
|
717
|
+
function ds(t) {
|
|
718
|
+
return re.bind(null, t);
|
|
719
719
|
}
|
|
720
720
|
function kt(t) {
|
|
721
|
-
return !!t && t.$$typeof ===
|
|
722
|
-
}
|
|
723
|
-
function ds(t) {
|
|
724
|
-
return kt(t) && t.type === F;
|
|
721
|
+
return !!t && t.$$typeof === Hr;
|
|
725
722
|
}
|
|
726
723
|
function fs(t) {
|
|
727
|
-
return
|
|
724
|
+
return kt(t) && t.type === F;
|
|
728
725
|
}
|
|
729
726
|
function ps(t) {
|
|
730
|
-
return
|
|
727
|
+
return !!t && !!t.displayName && (typeof t.displayName == "string" || t.displayName instanceof String) && t.displayName.startsWith("Memo(");
|
|
731
728
|
}
|
|
732
729
|
function gs(t) {
|
|
733
|
-
return
|
|
730
|
+
return kt(t) ? zi.apply(null, arguments) : t;
|
|
734
731
|
}
|
|
735
732
|
function ms(t) {
|
|
733
|
+
return !!t.__k && (he(null, t), !0);
|
|
734
|
+
}
|
|
735
|
+
function xs(t) {
|
|
736
736
|
return t && (t.base || t.nodeType === 1 && t) || null;
|
|
737
737
|
}
|
|
738
|
-
var
|
|
738
|
+
var bs = function(t, e) {
|
|
739
739
|
return t(e);
|
|
740
|
-
},
|
|
740
|
+
}, ys = function(t, e) {
|
|
741
741
|
return t(e);
|
|
742
|
-
},
|
|
743
|
-
for (var be = 0,
|
|
742
|
+
}, vs = F, _s = kt, hn = { useState: R, useId: Lr, useReducer: ln, useEffect: D, useLayoutEffect: Ye, useInsertionEffect: Dr, useTransition: Fr, useDeferredValue: Br, useSyncExternalStore: Qr, startTransition: zr, useRef: vt, useImperativeHandle: Pr, useMemo: U, useCallback: We, useContext: _t, useDebugValue: Mr, version: "18.3.1", Children: Ji, render: ss, hydrate: os, unmountComponentAtNode: ms, createPortal: Yi, createElement: re, createContext: Bi, createFactory: ds, cloneElement: gs, createRef: Mi, Fragment: F, isValidElement: kt, isElement: _s, isFragment: fs, isMemo: ps, findDOMNode: xs, Component: z, PureComponent: Wt, memo: Vi, forwardRef: Hi, flushSync: ys, unstable_batchedUpdates: bs, StrictMode: vs, Suspense: ct, SuspenseList: Ne, lazy: Ki, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: hs }, K = [], L = [], ks = Uint8Array, It = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
743
|
+
for (var be = 0, ws = It.length; be < ws; ++be)
|
|
744
744
|
K[be] = It[be], L[It.charCodeAt(be)] = be;
|
|
745
745
|
L[45] = 62;
|
|
746
746
|
L[95] = 63;
|
|
747
|
-
function
|
|
747
|
+
function Ss(t) {
|
|
748
748
|
var e = t.length;
|
|
749
749
|
if (e % 4 > 0)
|
|
750
750
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
@@ -753,27 +753,27 @@ function ws(t) {
|
|
|
753
753
|
var r = n === e ? 0 : 4 - n % 4;
|
|
754
754
|
return [n, r];
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function js(t, e, n) {
|
|
757
757
|
return (e + n) * 3 / 4 - n;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
var e, n =
|
|
759
|
+
function He(t) {
|
|
760
|
+
var e, n = Ss(t), r = n[0], i = n[1], s = new ks(js(t, r, i)), o = 0, l = i > 0 ? r - 4 : r, a;
|
|
761
761
|
for (a = 0; a < l; a += 4)
|
|
762
762
|
e = L[t.charCodeAt(a)] << 18 | L[t.charCodeAt(a + 1)] << 12 | L[t.charCodeAt(a + 2)] << 6 | L[t.charCodeAt(a + 3)], s[o++] = e >> 16 & 255, s[o++] = e >> 8 & 255, s[o++] = e & 255;
|
|
763
763
|
return i === 2 && (e = L[t.charCodeAt(a)] << 2 | L[t.charCodeAt(a + 1)] >> 4, s[o++] = e & 255), i === 1 && (e = L[t.charCodeAt(a)] << 10 | L[t.charCodeAt(a + 1)] << 4 | L[t.charCodeAt(a + 2)] >> 2, s[o++] = e >> 8 & 255, s[o++] = e & 255), s;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Cs(t) {
|
|
766
766
|
return K[t >> 18 & 63] + K[t >> 12 & 63] + K[t >> 6 & 63] + K[t & 63];
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function Ts(t, e, n) {
|
|
769
769
|
for (var r, i = [], s = e; s < n; s += 3)
|
|
770
|
-
r = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (t[s + 2] & 255), i.push(
|
|
770
|
+
r = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (t[s + 2] & 255), i.push(Cs(r));
|
|
771
771
|
return i.join("");
|
|
772
772
|
}
|
|
773
773
|
function Je(t) {
|
|
774
774
|
for (var e, n = t.length, r = n % 3, i = [], s = 16383, o = 0, l = n - r; o < l; o += s)
|
|
775
775
|
i.push(
|
|
776
|
-
|
|
776
|
+
Ts(
|
|
777
777
|
t,
|
|
778
778
|
o,
|
|
779
779
|
o + s > l ? l : o + s
|
|
@@ -783,16 +783,16 @@ function Je(t) {
|
|
|
783
783
|
K[e >> 10] + K[e >> 4 & 63] + K[e << 2 & 63] + "="
|
|
784
784
|
)), i.join("");
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function te(t) {
|
|
787
787
|
if (t === void 0)
|
|
788
788
|
return {};
|
|
789
|
-
if (!
|
|
789
|
+
if (!Jr(t))
|
|
790
790
|
throw new Error(
|
|
791
791
|
`The arguments to a Convex function must be an object. Received: ${t}`
|
|
792
792
|
);
|
|
793
793
|
return t;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
795
|
+
function Rs(t) {
|
|
796
796
|
if (typeof t > "u")
|
|
797
797
|
throw new Error(
|
|
798
798
|
"Client created with undefined deployment address. If you used an environment variable, check that it's set."
|
|
@@ -817,58 +817,58 @@ function Ts(t) {
|
|
|
817
817
|
`Invalid deployment address: "${t}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`
|
|
818
818
|
);
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function Jr(t) {
|
|
821
821
|
const e = typeof t == "object", n = Object.getPrototypeOf(t), r = n === null || n === Object.prototype || // Objects generated from other contexts (e.g. across Node.js `vm` modules) will not satisfy the previous
|
|
822
822
|
// conditions but are still simple objects.
|
|
823
823
|
n?.constructor?.name === "Object";
|
|
824
824
|
return e && r;
|
|
825
825
|
}
|
|
826
|
-
const Gr = !0,
|
|
827
|
-
function
|
|
826
|
+
const Gr = !0, Te = BigInt("-9223372036854775808"), dn = BigInt("9223372036854775807"), Ht = BigInt("0"), $s = BigInt("8"), As = BigInt("256");
|
|
827
|
+
function Kr(t) {
|
|
828
828
|
return Number.isNaN(t) || !Number.isFinite(t) || Object.is(t, -0);
|
|
829
829
|
}
|
|
830
|
-
function
|
|
831
|
-
t < Ht && (t -=
|
|
830
|
+
function Is(t) {
|
|
831
|
+
t < Ht && (t -= Te + Te);
|
|
832
832
|
let e = t.toString(16);
|
|
833
833
|
e.length % 2 === 1 && (e = "0" + e);
|
|
834
834
|
const n = new Uint8Array(new ArrayBuffer(8));
|
|
835
835
|
let r = 0;
|
|
836
836
|
for (const i of e.match(/.{2}/g).reverse())
|
|
837
|
-
n.set([parseInt(i, 16)], r++), t >>=
|
|
837
|
+
n.set([parseInt(i, 16)], r++), t >>= $s;
|
|
838
838
|
return Je(n);
|
|
839
839
|
}
|
|
840
|
-
function
|
|
841
|
-
const e =
|
|
840
|
+
function Es(t) {
|
|
841
|
+
const e = He(t);
|
|
842
842
|
if (e.byteLength !== 8)
|
|
843
843
|
throw new Error(
|
|
844
844
|
`Received ${e.byteLength} bytes, expected 8 for $integer`
|
|
845
845
|
);
|
|
846
846
|
let n = Ht, r = Ht;
|
|
847
847
|
for (const i of e)
|
|
848
|
-
n += BigInt(i) *
|
|
849
|
-
return n >
|
|
848
|
+
n += BigInt(i) * As ** r, r++;
|
|
849
|
+
return n > dn && (n += Te + Te), n;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
852
|
-
if (t <
|
|
851
|
+
function qs(t) {
|
|
852
|
+
if (t < Te || dn < t)
|
|
853
853
|
throw new Error(
|
|
854
854
|
`BigInt ${t} does not fit into a 64-bit signed integer.`
|
|
855
855
|
);
|
|
856
856
|
const e = new ArrayBuffer(8);
|
|
857
857
|
return new DataView(e).setBigInt64(0, t, !0), Je(new Uint8Array(e));
|
|
858
858
|
}
|
|
859
|
-
function
|
|
860
|
-
const e =
|
|
859
|
+
function Ps(t) {
|
|
860
|
+
const e = He(t);
|
|
861
861
|
if (e.byteLength !== 8)
|
|
862
862
|
throw new Error(
|
|
863
863
|
`Received ${e.byteLength} bytes, expected 8 for $integer`
|
|
864
864
|
);
|
|
865
865
|
return new DataView(e.buffer).getBigInt64(0, !0);
|
|
866
866
|
}
|
|
867
|
-
const
|
|
868
|
-
function
|
|
869
|
-
if (t.length >
|
|
867
|
+
const Ms = DataView.prototype.setBigInt64 ? qs : Is, Ls = DataView.prototype.getBigInt64 ? Ps : Es, Jn = 1024;
|
|
868
|
+
function Zr(t) {
|
|
869
|
+
if (t.length > Jn)
|
|
870
870
|
throw new Error(
|
|
871
|
-
`Field name ${t} exceeds maximum field name length ${
|
|
871
|
+
`Field name ${t} exceeds maximum field name length ${Jn}.`
|
|
872
872
|
);
|
|
873
873
|
if (t.startsWith("$"))
|
|
874
874
|
throw new Error(`Field name ${t} starts with a '$', which is reserved.`);
|
|
@@ -880,11 +880,11 @@ function Kr(t) {
|
|
|
880
880
|
);
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function Re(t) {
|
|
884
884
|
if (t === null || typeof t == "boolean" || typeof t == "number" || typeof t == "string")
|
|
885
885
|
return t;
|
|
886
886
|
if (Array.isArray(t))
|
|
887
|
-
return t.map((r) =>
|
|
887
|
+
return t.map((r) => Re(r));
|
|
888
888
|
if (typeof t != "object")
|
|
889
889
|
throw new Error(`Unexpected type of ${t}`);
|
|
890
890
|
const e = Object.entries(t);
|
|
@@ -893,23 +893,23 @@ function $e(t) {
|
|
|
893
893
|
if (r === "$bytes") {
|
|
894
894
|
if (typeof t.$bytes != "string")
|
|
895
895
|
throw new Error(`Malformed $bytes field on ${t}`);
|
|
896
|
-
return
|
|
896
|
+
return He(t.$bytes).buffer;
|
|
897
897
|
}
|
|
898
898
|
if (r === "$integer") {
|
|
899
899
|
if (typeof t.$integer != "string")
|
|
900
900
|
throw new Error(`Malformed $integer field on ${t}`);
|
|
901
|
-
return
|
|
901
|
+
return Ls(t.$integer);
|
|
902
902
|
}
|
|
903
903
|
if (r === "$float") {
|
|
904
904
|
if (typeof t.$float != "string")
|
|
905
905
|
throw new Error(`Malformed $float field on ${t}`);
|
|
906
|
-
const i =
|
|
906
|
+
const i = He(t.$float);
|
|
907
907
|
if (i.byteLength !== 8)
|
|
908
908
|
throw new Error(
|
|
909
909
|
`Received ${i.byteLength} bytes, expected 8 for $float`
|
|
910
910
|
);
|
|
911
911
|
const o = new DataView(i.buffer).getFloat64(0, Gr);
|
|
912
|
-
if (!
|
|
912
|
+
if (!Kr(o))
|
|
913
913
|
throw new Error(`Float ${o} should be encoded as a number`);
|
|
914
914
|
return o;
|
|
915
915
|
}
|
|
@@ -924,11 +924,11 @@ function $e(t) {
|
|
|
924
924
|
}
|
|
925
925
|
const n = {};
|
|
926
926
|
for (const [r, i] of Object.entries(t))
|
|
927
|
-
|
|
927
|
+
Zr(r), n[r] = Re(i);
|
|
928
928
|
return n;
|
|
929
929
|
}
|
|
930
930
|
const Gn = 16384;
|
|
931
|
-
function
|
|
931
|
+
function Fe(t) {
|
|
932
932
|
const e = JSON.stringify(t, (n, r) => r === void 0 ? "undefined" : typeof r == "bigint" ? `${r.toString()}n` : r);
|
|
933
933
|
if (e.length > Gn) {
|
|
934
934
|
const n = "[...truncated]";
|
|
@@ -938,9 +938,9 @@ function De(t) {
|
|
|
938
938
|
}
|
|
939
939
|
return e;
|
|
940
940
|
}
|
|
941
|
-
function
|
|
941
|
+
function Jt(t, e, n, r) {
|
|
942
942
|
if (t === void 0) {
|
|
943
|
-
const o = n && ` (present at path ${n} in original object ${
|
|
943
|
+
const o = n && ` (present at path ${n} in original object ${Fe(
|
|
944
944
|
e
|
|
945
945
|
)})`;
|
|
946
946
|
throw new Error(
|
|
@@ -950,14 +950,14 @@ function Gt(t, e, n, r) {
|
|
|
950
950
|
if (t === null)
|
|
951
951
|
return t;
|
|
952
952
|
if (typeof t == "bigint") {
|
|
953
|
-
if (t <
|
|
953
|
+
if (t < Te || dn < t)
|
|
954
954
|
throw new Error(
|
|
955
955
|
`BigInt ${t} does not fit into a 64-bit signed integer.`
|
|
956
956
|
);
|
|
957
|
-
return { $integer:
|
|
957
|
+
return { $integer: Ms(t) };
|
|
958
958
|
}
|
|
959
959
|
if (typeof t == "number")
|
|
960
|
-
if (
|
|
960
|
+
if (Kr(t)) {
|
|
961
961
|
const o = new ArrayBuffer(8);
|
|
962
962
|
return new DataView(o).setFloat64(0, t, Gr), { $float: Je(new Uint8Array(o)) };
|
|
963
963
|
} else
|
|
@@ -968,7 +968,7 @@ function Gt(t, e, n, r) {
|
|
|
968
968
|
return { $bytes: Je(new Uint8Array(t)) };
|
|
969
969
|
if (Array.isArray(t))
|
|
970
970
|
return t.map(
|
|
971
|
-
(o, l) =>
|
|
971
|
+
(o, l) => Jt(o, e, n + `[${l}]`)
|
|
972
972
|
);
|
|
973
973
|
if (t instanceof Set)
|
|
974
974
|
throw new Error(
|
|
@@ -978,7 +978,7 @@ function Gt(t, e, n, r) {
|
|
|
978
978
|
throw new Error(
|
|
979
979
|
Et(n, "Map", [...t], e)
|
|
980
980
|
);
|
|
981
|
-
if (!
|
|
981
|
+
if (!Jr(t)) {
|
|
982
982
|
const o = t?.constructor?.name, l = o ? `${o} ` : "";
|
|
983
983
|
throw new Error(
|
|
984
984
|
Et(n, l, t, e)
|
|
@@ -987,35 +987,35 @@ function Gt(t, e, n, r) {
|
|
|
987
987
|
const i = {}, s = Object.entries(t);
|
|
988
988
|
s.sort(([o, l], [a, u]) => o === a ? 0 : o < a ? -1 : 1);
|
|
989
989
|
for (const [o, l] of s)
|
|
990
|
-
l !== void 0 && (
|
|
990
|
+
l !== void 0 && (Zr(o), i[o] = Jt(l, e, n + `.${o}`));
|
|
991
991
|
return i;
|
|
992
992
|
}
|
|
993
993
|
function Et(t, e, n, r) {
|
|
994
|
-
return t ? `${e}${
|
|
994
|
+
return t ? `${e}${Fe(
|
|
995
995
|
n
|
|
996
|
-
)} is not a supported Convex type (present at path ${t} in original object ${
|
|
996
|
+
)} is not a supported Convex type (present at path ${t} in original object ${Fe(
|
|
997
997
|
r
|
|
998
|
-
)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.` : `${e}${
|
|
998
|
+
)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.` : `${e}${Fe(
|
|
999
999
|
n
|
|
1000
1000
|
)} is not a supported Convex type.`;
|
|
1001
1001
|
}
|
|
1002
1002
|
function X(t) {
|
|
1003
|
-
return
|
|
1003
|
+
return Jt(t, t, "");
|
|
1004
1004
|
}
|
|
1005
|
-
var
|
|
1006
|
-
const
|
|
1007
|
-
class
|
|
1005
|
+
var Os = Object.defineProperty, Ns = (t, e, n) => e in t ? Os(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, qt = (t, e, n) => Ns(t, typeof e != "symbol" ? e + "" : e, n), Kn, Zn;
|
|
1006
|
+
const Qs = /* @__PURE__ */ Symbol.for("ConvexError");
|
|
1007
|
+
class Gt extends (Zn = Error, Kn = Qs, Zn) {
|
|
1008
1008
|
constructor(e) {
|
|
1009
|
-
super(typeof e == "string" ? e :
|
|
1009
|
+
super(typeof e == "string" ? e : Fe(e)), qt(this, "name", "ConvexError"), qt(this, "data"), qt(this, Kn, !0), this.data = e;
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
const
|
|
1016
|
-
var
|
|
1017
|
-
const
|
|
1018
|
-
function
|
|
1012
|
+
const Xr = () => Array.from({ length: 4 }, () => 0);
|
|
1013
|
+
Xr();
|
|
1014
|
+
Xr();
|
|
1015
|
+
const Xn = "1.35.1";
|
|
1016
|
+
var zs = Object.defineProperty, Bs = (t, e, n) => e in t ? zs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Yn = (t, e, n) => Bs(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1017
|
+
const Fs = "color:rgb(0, 145, 255)";
|
|
1018
|
+
function Yr(t) {
|
|
1019
1019
|
switch (t) {
|
|
1020
1020
|
case "query":
|
|
1021
1021
|
return "Q";
|
|
@@ -1027,9 +1027,9 @@ function Xr(t) {
|
|
|
1027
1027
|
return "?";
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
|
-
class
|
|
1030
|
+
class ei {
|
|
1031
1031
|
constructor(e) {
|
|
1032
|
-
|
|
1032
|
+
Yn(this, "_onLogLineFuncs"), Yn(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
|
|
1033
1033
|
}
|
|
1034
1034
|
addLogLineListener(e) {
|
|
1035
1035
|
let n = Math.random().toString(36).substring(2, 15);
|
|
@@ -1057,8 +1057,8 @@ class Yr {
|
|
|
1057
1057
|
n("error", ...e);
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const e = new
|
|
1060
|
+
function ti(t) {
|
|
1061
|
+
const e = new ei(t);
|
|
1062
1062
|
return e.addLogLineListener((n, ...r) => {
|
|
1063
1063
|
switch (n) {
|
|
1064
1064
|
case "debug":
|
|
@@ -1078,11 +1078,11 @@ function ei(t) {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
}), e;
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1082
|
-
return new
|
|
1081
|
+
function ni(t) {
|
|
1082
|
+
return new ei(t);
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1085
|
-
const s =
|
|
1084
|
+
function dt(t, e, n, r, i) {
|
|
1085
|
+
const s = Yr(n);
|
|
1086
1086
|
if (typeof i == "object" && (i = `ConvexError ${JSON.stringify(i.errorData, null, 2)}`), e === "info") {
|
|
1087
1087
|
const o = i.match(/^\[.*?\] /);
|
|
1088
1088
|
if (o === null) {
|
|
@@ -1092,16 +1092,16 @@ function ft(t, e, n, r, i) {
|
|
|
1092
1092
|
return;
|
|
1093
1093
|
}
|
|
1094
1094
|
const l = i.slice(1, o[0].length - 2), a = i.slice(o[0].length);
|
|
1095
|
-
t.log(`%c[CONVEX ${s}(${r})] [${l}]`,
|
|
1095
|
+
t.log(`%c[CONVEX ${s}(${r})] [${l}]`, Fs, a);
|
|
1096
1096
|
} else
|
|
1097
1097
|
t.error(`[CONVEX ${s}(${r})] ${i}`);
|
|
1098
1098
|
}
|
|
1099
|
-
function
|
|
1099
|
+
function Ds(t, e) {
|
|
1100
1100
|
const n = `[CONVEX FATAL ERROR] ${e}`;
|
|
1101
1101
|
return t.error(n), new Error(n);
|
|
1102
1102
|
}
|
|
1103
1103
|
function _e(t, e, n) {
|
|
1104
|
-
return `[CONVEX ${
|
|
1104
|
+
return `[CONVEX ${Yr(t)}(${e})] ${n.errorMessage}
|
|
1105
1105
|
Called by client`;
|
|
1106
1106
|
}
|
|
1107
1107
|
function Kt(t, e) {
|
|
@@ -1118,7 +1118,7 @@ function ue(t, e) {
|
|
|
1118
1118
|
args: X(e)
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function er(t, e, n) {
|
|
1122
1122
|
const { initialNumItems: r, id: i } = n;
|
|
1123
1123
|
return JSON.stringify({
|
|
1124
1124
|
type: "paginated",
|
|
@@ -1127,10 +1127,10 @@ function Yn(t, e, n) {
|
|
|
1127
1127
|
options: X({ initialNumItems: r, id: i })
|
|
1128
1128
|
});
|
|
1129
1129
|
}
|
|
1130
|
-
var
|
|
1131
|
-
class
|
|
1130
|
+
var Us = Object.defineProperty, Vs = (t, e, n) => e in t ? Us(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, J = (t, e, n) => Vs(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1131
|
+
class Ws {
|
|
1132
1132
|
constructor() {
|
|
1133
|
-
|
|
1133
|
+
J(this, "nextQueryId"), J(this, "querySetVersion"), J(this, "querySet"), J(this, "queryIdToToken"), J(this, "identityVersion"), J(this, "auth"), J(this, "outstandingQueriesOlderThanRestart"), J(this, "outstandingAuthOlderThanRestart"), J(this, "paused"), J(this, "pendingQuerySetModifications"), this.nextQueryId = 0, this.querySetVersion = 0, this.identityVersion = 0, this.querySet = /* @__PURE__ */ new Map(), this.queryIdToToken = /* @__PURE__ */ new Map(), this.outstandingQueriesOlderThanRestart = /* @__PURE__ */ new Set(), this.outstandingAuthOlderThanRestart = !1, this.paused = !1, this.pendingQuerySetModifications = /* @__PURE__ */ new Map();
|
|
1134
1134
|
}
|
|
1135
1135
|
hasSyncedPastLastReconnect() {
|
|
1136
1136
|
return this.outstandingQueriesOlderThanRestart.size === 0 && !this.outstandingAuthOlderThanRestart;
|
|
@@ -1333,10 +1333,10 @@ class Vs {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
|
-
var
|
|
1336
|
+
var Hs = Object.defineProperty, Js = (t, e, n) => e in t ? Hs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, it = (t, e, n) => Js(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1337
1337
|
class Gs {
|
|
1338
1338
|
constructor(e, n) {
|
|
1339
|
-
this.logger = e, this.markConnectionStateDirty = n,
|
|
1339
|
+
this.logger = e, this.markConnectionStateDirty = n, it(this, "inflightRequests"), it(this, "requestsOlderThanRestart"), it(this, "inflightMutationsCount", 0), it(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
|
|
1340
1340
|
}
|
|
1341
1341
|
request(e, n) {
|
|
1342
1342
|
const r = new Promise((i) => {
|
|
@@ -1360,21 +1360,21 @@ class Gs {
|
|
|
1360
1360
|
return null;
|
|
1361
1361
|
const r = n.message.type === "Mutation" ? "mutation" : "action", i = n.message.udfPath;
|
|
1362
1362
|
for (const a of e.logLines)
|
|
1363
|
-
|
|
1363
|
+
dt(this.logger, "info", r, i, a);
|
|
1364
1364
|
const s = n.status;
|
|
1365
1365
|
let o, l;
|
|
1366
1366
|
if (e.success)
|
|
1367
1367
|
o = {
|
|
1368
1368
|
success: !0,
|
|
1369
1369
|
logLines: e.logLines,
|
|
1370
|
-
value:
|
|
1370
|
+
value: Re(e.result)
|
|
1371
1371
|
}, l = () => s.onResult(o);
|
|
1372
1372
|
else {
|
|
1373
1373
|
const a = e.result, { errorData: u } = e;
|
|
1374
|
-
|
|
1374
|
+
dt(this.logger, "error", r, i, a), o = {
|
|
1375
1375
|
success: !1,
|
|
1376
1376
|
errorMessage: a,
|
|
1377
|
-
errorData: u !== void 0 ?
|
|
1377
|
+
errorData: u !== void 0 ? Re(u) : void 0,
|
|
1378
1378
|
logLines: e.logLines
|
|
1379
1379
|
}, l = () => s.onResult(o);
|
|
1380
1380
|
}
|
|
@@ -1470,21 +1470,21 @@ class Gs {
|
|
|
1470
1470
|
return this.inflightActionsCount;
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
const
|
|
1474
|
-
function Js(t) {
|
|
1475
|
-
return t[ni] ?? null;
|
|
1476
|
-
}
|
|
1473
|
+
const Ge = /* @__PURE__ */ Symbol.for("functionName"), ri = /* @__PURE__ */ Symbol.for("toReferencePath");
|
|
1477
1474
|
function Ks(t) {
|
|
1478
|
-
return t
|
|
1475
|
+
return t[ri] ?? null;
|
|
1479
1476
|
}
|
|
1480
1477
|
function Zs(t) {
|
|
1478
|
+
return t.startsWith("function://");
|
|
1479
|
+
}
|
|
1480
|
+
function Xs(t) {
|
|
1481
1481
|
let e;
|
|
1482
1482
|
if (typeof t == "string")
|
|
1483
|
-
|
|
1484
|
-
else if (t[
|
|
1485
|
-
e = { name: t[
|
|
1483
|
+
Zs(t) ? e = { functionHandle: t } : e = { name: t };
|
|
1484
|
+
else if (t[Ge])
|
|
1485
|
+
e = { name: t[Ge] };
|
|
1486
1486
|
else {
|
|
1487
|
-
const n =
|
|
1487
|
+
const n = Ks(t);
|
|
1488
1488
|
if (!n)
|
|
1489
1489
|
throw new Error(`${t} is not a functionReference`);
|
|
1490
1490
|
e = { reference: n };
|
|
@@ -1492,7 +1492,7 @@ function Zs(t) {
|
|
|
1492
1492
|
return e;
|
|
1493
1493
|
}
|
|
1494
1494
|
function q(t) {
|
|
1495
|
-
const e =
|
|
1495
|
+
const e = Xs(t);
|
|
1496
1496
|
if (e.name === void 0)
|
|
1497
1497
|
throw e.functionHandle !== void 0 ? new Error(
|
|
1498
1498
|
`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${e.functionHandle}`
|
|
@@ -1502,21 +1502,21 @@ function q(t) {
|
|
|
1502
1502
|
`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(e)}`
|
|
1503
1503
|
);
|
|
1504
1504
|
if (typeof t == "string") return t;
|
|
1505
|
-
const n = t[
|
|
1505
|
+
const n = t[Ge];
|
|
1506
1506
|
if (!n)
|
|
1507
1507
|
throw new Error(`${t} is not a functionReference`);
|
|
1508
1508
|
return n;
|
|
1509
1509
|
}
|
|
1510
|
-
function
|
|
1511
|
-
return { [
|
|
1510
|
+
function ii(t) {
|
|
1511
|
+
return { [Ge]: t };
|
|
1512
1512
|
}
|
|
1513
|
-
function
|
|
1513
|
+
function si(t = []) {
|
|
1514
1514
|
const e = {
|
|
1515
1515
|
get(n, r) {
|
|
1516
1516
|
if (typeof r == "string") {
|
|
1517
1517
|
const i = [...t, r];
|
|
1518
|
-
return
|
|
1519
|
-
} else if (r ===
|
|
1518
|
+
return si(i);
|
|
1519
|
+
} else if (r === Ge) {
|
|
1520
1520
|
if (t.length < 2) {
|
|
1521
1521
|
const o = ["api", ...t].join(".");
|
|
1522
1522
|
throw new Error(
|
|
@@ -1530,30 +1530,30 @@ function ii(t = []) {
|
|
|
1530
1530
|
};
|
|
1531
1531
|
return new Proxy({}, e);
|
|
1532
1532
|
}
|
|
1533
|
-
const
|
|
1534
|
-
var
|
|
1535
|
-
class
|
|
1533
|
+
const Ys = si();
|
|
1534
|
+
var eo = Object.defineProperty, to = (t, e, n) => e in t ? eo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ft = (t, e, n) => to(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1535
|
+
class Ke {
|
|
1536
1536
|
constructor(e) {
|
|
1537
|
-
|
|
1537
|
+
ft(this, "queryResults"), ft(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
|
|
1538
1538
|
}
|
|
1539
1539
|
getQuery(e, ...n) {
|
|
1540
|
-
const r =
|
|
1540
|
+
const r = te(n[0]), i = q(e), s = this.queryResults.get(
|
|
1541
1541
|
ue(i, r)
|
|
1542
1542
|
);
|
|
1543
1543
|
if (s !== void 0)
|
|
1544
|
-
return
|
|
1544
|
+
return Ke.queryValue(s.result);
|
|
1545
1545
|
}
|
|
1546
1546
|
getAllQueries(e) {
|
|
1547
1547
|
const n = [], r = q(e);
|
|
1548
1548
|
for (const i of this.queryResults.values())
|
|
1549
1549
|
i.udfPath === de(r) && n.push({
|
|
1550
1550
|
args: i.args,
|
|
1551
|
-
value:
|
|
1551
|
+
value: Ke.queryValue(i.result)
|
|
1552
1552
|
});
|
|
1553
1553
|
return n;
|
|
1554
1554
|
}
|
|
1555
1555
|
setQuery(e, n, r) {
|
|
1556
|
-
const i =
|
|
1556
|
+
const i = te(n), s = q(e), o = ue(s, i);
|
|
1557
1557
|
let l;
|
|
1558
1558
|
r === void 0 ? l = void 0 : l = {
|
|
1559
1559
|
success: !0,
|
|
@@ -1573,9 +1573,9 @@ class Ze {
|
|
|
1573
1573
|
return e.success ? e.value : void 0;
|
|
1574
1574
|
}
|
|
1575
1575
|
}
|
|
1576
|
-
class
|
|
1576
|
+
class no {
|
|
1577
1577
|
constructor() {
|
|
1578
|
-
|
|
1578
|
+
ft(this, "queryResults"), ft(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
|
|
1579
1579
|
}
|
|
1580
1580
|
/**
|
|
1581
1581
|
* Apply all optimistic updates on top of server query results
|
|
@@ -1584,7 +1584,7 @@ class to {
|
|
|
1584
1584
|
this.optimisticUpdates = this.optimisticUpdates.filter((o) => !n.has(o.mutationId));
|
|
1585
1585
|
const r = this.queryResults;
|
|
1586
1586
|
this.queryResults = new Map(e);
|
|
1587
|
-
const i = new
|
|
1587
|
+
const i = new Ke(this.queryResults);
|
|
1588
1588
|
for (const o of this.optimisticUpdates)
|
|
1589
1589
|
o.update(i);
|
|
1590
1590
|
const s = [];
|
|
@@ -1599,7 +1599,7 @@ class to {
|
|
|
1599
1599
|
update: e,
|
|
1600
1600
|
mutationId: n
|
|
1601
1601
|
});
|
|
1602
|
-
const r = new
|
|
1602
|
+
const r = new Ke(this.queryResults);
|
|
1603
1603
|
return e(r), r.modifiedQueries;
|
|
1604
1604
|
}
|
|
1605
1605
|
/**
|
|
@@ -1623,7 +1623,7 @@ class to {
|
|
|
1623
1623
|
return r.value;
|
|
1624
1624
|
throw r.errorData !== void 0 ? Kt(
|
|
1625
1625
|
r,
|
|
1626
|
-
new
|
|
1626
|
+
new Gt(
|
|
1627
1627
|
_e("query", n.udfPath, r)
|
|
1628
1628
|
)
|
|
1629
1629
|
) : new Error(
|
|
@@ -1641,7 +1641,7 @@ class to {
|
|
|
1641
1641
|
return this.queryResults.get(e)?.result?.logLines;
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
|
-
var
|
|
1644
|
+
var ro = Object.defineProperty, io = (t, e, n) => e in t ? ro(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Pt = (t, e, n) => io(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1645
1645
|
class E {
|
|
1646
1646
|
constructor(e, n) {
|
|
1647
1647
|
Pt(this, "low"), Pt(this, "high"), Pt(this, "__isUnsignedLong__"), this.low = e | 0, this.high = n | 0, this.__isUnsignedLong__ = !0;
|
|
@@ -1671,10 +1671,10 @@ class E {
|
|
|
1671
1671
|
];
|
|
1672
1672
|
}
|
|
1673
1673
|
static fromNumber(e) {
|
|
1674
|
-
return isNaN(e) || e < 0 ?
|
|
1674
|
+
return isNaN(e) || e < 0 ? tr : e >= so ? oo : new E(e % De | 0, e / De | 0);
|
|
1675
1675
|
}
|
|
1676
1676
|
toString() {
|
|
1677
|
-
return (BigInt(this.high) * BigInt(
|
|
1677
|
+
return (BigInt(this.high) * BigInt(De) + BigInt(this.low)).toString();
|
|
1678
1678
|
}
|
|
1679
1679
|
equals(e) {
|
|
1680
1680
|
return E.isLong(e) || (e = E.fromValue(e)), this.high >>> 31 === 1 && e.high >>> 31 === 1 ? !1 : this.high === e.high && this.low === e.low;
|
|
@@ -1695,11 +1695,11 @@ class E {
|
|
|
1695
1695
|
return typeof e == "number" ? E.fromNumber(e) : new E(e.low, e.high);
|
|
1696
1696
|
}
|
|
1697
1697
|
}
|
|
1698
|
-
const
|
|
1699
|
-
var
|
|
1700
|
-
class
|
|
1698
|
+
const tr = new E(0, 0), nr = 65536, De = nr * nr, so = De * De, oo = new E(-1, -1);
|
|
1699
|
+
var ao = Object.defineProperty, lo = (t, e, n) => e in t ? ao(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, st = (t, e, n) => lo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1700
|
+
class rr {
|
|
1701
1701
|
constructor(e, n) {
|
|
1702
|
-
|
|
1702
|
+
st(this, "version"), st(this, "remoteQuerySet"), st(this, "queryPath"), st(this, "logger"), this.version = { querySet: 0, ts: E.fromNumber(0), identity: 0 }, this.remoteQuerySet = /* @__PURE__ */ new Map(), this.queryPath = e, this.logger = n;
|
|
1703
1703
|
}
|
|
1704
1704
|
transition(e) {
|
|
1705
1705
|
const n = e.startVersion;
|
|
@@ -1713,8 +1713,8 @@ class nr {
|
|
|
1713
1713
|
const i = this.queryPath(r.queryId);
|
|
1714
1714
|
if (i)
|
|
1715
1715
|
for (const o of r.logLines)
|
|
1716
|
-
|
|
1717
|
-
const s =
|
|
1716
|
+
dt(this.logger, "info", "query", i, o);
|
|
1717
|
+
const s = Re(r.value ?? null);
|
|
1718
1718
|
this.remoteQuerySet.set(r.queryId, {
|
|
1719
1719
|
success: !0,
|
|
1720
1720
|
value: s,
|
|
@@ -1726,12 +1726,12 @@ class nr {
|
|
|
1726
1726
|
const i = this.queryPath(r.queryId);
|
|
1727
1727
|
if (i)
|
|
1728
1728
|
for (const o of r.logLines)
|
|
1729
|
-
|
|
1729
|
+
dt(this.logger, "info", "query", i, o);
|
|
1730
1730
|
const { errorData: s } = r;
|
|
1731
1731
|
this.remoteQuerySet.set(r.queryId, {
|
|
1732
1732
|
success: !1,
|
|
1733
1733
|
errorMessage: r.errorMessage,
|
|
1734
|
-
errorData: s !== void 0 ?
|
|
1734
|
+
errorData: s !== void 0 ? Re(s) : void 0,
|
|
1735
1735
|
logLines: r.logLines
|
|
1736
1736
|
});
|
|
1737
1737
|
break;
|
|
@@ -1753,14 +1753,14 @@ class nr {
|
|
|
1753
1753
|
}
|
|
1754
1754
|
}
|
|
1755
1755
|
function Mt(t) {
|
|
1756
|
-
const e =
|
|
1756
|
+
const e = He(t);
|
|
1757
1757
|
return E.fromBytesLE(Array.from(e));
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1759
|
+
function co(t) {
|
|
1760
1760
|
const e = new Uint8Array(t.toBytesLE());
|
|
1761
1761
|
return Je(e);
|
|
1762
1762
|
}
|
|
1763
|
-
function
|
|
1763
|
+
function ir(t) {
|
|
1764
1764
|
switch (t.type) {
|
|
1765
1765
|
case "FatalError":
|
|
1766
1766
|
case "AuthError":
|
|
@@ -1784,7 +1784,7 @@ function rr(t) {
|
|
|
1784
1784
|
};
|
|
1785
1785
|
}
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1787
|
+
function uo(t) {
|
|
1788
1788
|
switch (t.type) {
|
|
1789
1789
|
case "Authenticate":
|
|
1790
1790
|
case "ModifyQuerySet":
|
|
@@ -1795,20 +1795,20 @@ function co(t) {
|
|
|
1795
1795
|
case "Connect":
|
|
1796
1796
|
return t.maxObservedTimestamp !== void 0 ? {
|
|
1797
1797
|
...t,
|
|
1798
|
-
maxObservedTimestamp:
|
|
1798
|
+
maxObservedTimestamp: co(t.maxObservedTimestamp)
|
|
1799
1799
|
} : { ...t, maxObservedTimestamp: void 0 };
|
|
1800
1800
|
}
|
|
1801
1801
|
}
|
|
1802
|
-
var
|
|
1803
|
-
const
|
|
1804
|
-
let
|
|
1802
|
+
var ho = Object.defineProperty, fo = (t, e, n) => e in t ? ho(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, C = (t, e, n) => fo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1803
|
+
const po = 1e3, go = 1001, mo = 1005, xo = 4040;
|
|
1804
|
+
let ut;
|
|
1805
1805
|
function ve() {
|
|
1806
|
-
return
|
|
1806
|
+
return ut === void 0 && (ut = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(ut + performance.now());
|
|
1807
1807
|
}
|
|
1808
|
-
function
|
|
1809
|
-
return `t=${Math.round((ve() -
|
|
1808
|
+
function sr() {
|
|
1809
|
+
return `t=${Math.round((ve() - ut) / 100) / 10}s`;
|
|
1810
1810
|
}
|
|
1811
|
-
const
|
|
1811
|
+
const oi = {
|
|
1812
1812
|
// A known error, e.g. during a restart or push
|
|
1813
1813
|
InternalServerError: { timeout: 1e3 },
|
|
1814
1814
|
// ErrorMetadata::overloaded() messages that we realy should back off
|
|
@@ -1828,16 +1828,16 @@ const si = {
|
|
|
1828
1828
|
SearchIndexTooLarge: { timeout: 3e3 },
|
|
1829
1829
|
TooManyWritesInTimePeriod: { timeout: 3e3 }
|
|
1830
1830
|
};
|
|
1831
|
-
function
|
|
1831
|
+
function bo(t) {
|
|
1832
1832
|
if (t === void 0) return "Unknown";
|
|
1833
1833
|
for (const e of Object.keys(
|
|
1834
|
-
|
|
1834
|
+
oi
|
|
1835
1835
|
))
|
|
1836
1836
|
if (t.startsWith(e))
|
|
1837
1837
|
return e;
|
|
1838
1838
|
return "Unknown";
|
|
1839
1839
|
}
|
|
1840
|
-
class
|
|
1840
|
+
class yo {
|
|
1841
1841
|
constructor(e, n, r, i, s, o) {
|
|
1842
1842
|
this.markConnectionStateDirty = s, this.debug = o, C(this, "socket"), C(this, "connectionCount"), C(this, "_hasEverConnected", !1), C(this, "lastCloseReason"), C(this, "transitionChunkBuffer", null), C(this, "defaultInitialBackoff"), C(this, "maxBackoff"), C(this, "retries"), C(this, "serverInactivityThreshold"), C(this, "reconnectDueToServerInactivityTimeout"), C(this, "scheduledReconnect", null), C(this, "networkOnlineHandler", null), C(this, "pendingNetworkRecoveryInfo", null), C(this, "uri"), C(this, "onOpen"), C(this, "onResume"), C(this, "onMessage"), C(this, "webSocketConstructor"), C(this, "logger"), C(this, "onServerDisconnectError"), this.webSocketConstructor = r, this.socket = { state: "disconnected" }, this.connectionCount = 0, this.lastCloseReason = "InitialConnect", this.defaultInitialBackoff = 1e3, this.maxBackoff = 16e3, this.retries = 0, this.serverInactivityThreshold = 6e4, this.reconnectDueToServerInactivityTimeout = null, this.uri = e, this.onOpen = n.onOpen, this.onResume = n.onResume, this.onMessage = n.onMessage, this.onServerDisconnectError = n.onServerDisconnectError, this.logger = i, this.setupNetworkListener(), this.connect();
|
|
1843
1843
|
}
|
|
@@ -1870,7 +1870,7 @@ class bo {
|
|
|
1870
1870
|
if (this.transitionChunkBuffer.chunks.push(e.chunk), this.transitionChunkBuffer.chunks.length === e.totalParts) {
|
|
1871
1871
|
const n = this.transitionChunkBuffer.chunks.join("");
|
|
1872
1872
|
this.transitionChunkBuffer = null;
|
|
1873
|
-
const r =
|
|
1873
|
+
const r = ir(JSON.parse(n));
|
|
1874
1874
|
if (r.type !== "Transition")
|
|
1875
1875
|
throw new Error(
|
|
1876
1876
|
`Expected Transition, got ${r.type} after assembling chunks`
|
|
@@ -1904,10 +1904,10 @@ class bo {
|
|
|
1904
1904
|
clientTs: ve()
|
|
1905
1905
|
})), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log(
|
|
1906
1906
|
"WebSocket reconnected at",
|
|
1907
|
-
|
|
1907
|
+
sr(),
|
|
1908
1908
|
"after disconnect due to",
|
|
1909
1909
|
this.lastCloseReason
|
|
1910
|
-
) : this.logger.log("WebSocket reconnected at",
|
|
1910
|
+
) : this.logger.log("WebSocket reconnected at", sr())), this.connectionCount += 1, this.lastCloseReason = null, this.pendingNetworkRecoveryInfo !== null) {
|
|
1911
1911
|
const { timeSavedMs: n } = this.pendingNetworkRecoveryInfo;
|
|
1912
1912
|
this.pendingNetworkRecoveryInfo = null, this.sendMessage({
|
|
1913
1913
|
type: "Event",
|
|
@@ -1924,7 +1924,7 @@ class bo {
|
|
|
1924
1924
|
}, e.onmessage = (n) => {
|
|
1925
1925
|
this.resetServerInactivityTimeout();
|
|
1926
1926
|
const r = n.data.length;
|
|
1927
|
-
let i =
|
|
1927
|
+
let i = ir(JSON.parse(n.data));
|
|
1928
1928
|
if (this._logVerbose(`received ws message with type ${i.type}`), i.type === "Ping")
|
|
1929
1929
|
return;
|
|
1930
1930
|
if (i.type === "TransitionChunk") {
|
|
@@ -1942,12 +1942,12 @@ class bo {
|
|
|
1942
1942
|
transition: i
|
|
1943
1943
|
}), this.onMessage(i).hasSyncedPastLastReconnect && (this.retries = 0, this.markConnectionStateDirty());
|
|
1944
1944
|
}, e.onclose = (n) => {
|
|
1945
|
-
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = n.reason || `closed with code ${n.code}`), n.code !==
|
|
1946
|
-
n.code !==
|
|
1945
|
+
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = n.reason || `closed with code ${n.code}`), n.code !== po && n.code !== go && // This commonly gets fired on mobile apps when the app is backgrounded
|
|
1946
|
+
n.code !== mo && n.code !== xo) {
|
|
1947
1947
|
let i = `WebSocket closed with code ${n.code}`;
|
|
1948
1948
|
n.reason && (i += `: ${n.reason}`), this.logger.log(i), this.onServerDisconnectError && n.reason && this.onServerDisconnectError(i);
|
|
1949
1949
|
}
|
|
1950
|
-
const r =
|
|
1950
|
+
const r = bo(n.reason);
|
|
1951
1951
|
this.scheduleReconnect(r);
|
|
1952
1952
|
};
|
|
1953
1953
|
}
|
|
@@ -1969,7 +1969,7 @@ class bo {
|
|
|
1969
1969
|
} : {}
|
|
1970
1970
|
};
|
|
1971
1971
|
if (this.socket.state === "ready" && this.socket.paused === "no") {
|
|
1972
|
-
const r =
|
|
1972
|
+
const r = uo(e), i = JSON.stringify(r);
|
|
1973
1973
|
let s = !1;
|
|
1974
1974
|
try {
|
|
1975
1975
|
this.socket.ws.send(i), s = !0;
|
|
@@ -2199,7 +2199,7 @@ class bo {
|
|
|
2199
2199
|
this.logger.logVerbose(e);
|
|
2200
2200
|
}
|
|
2201
2201
|
nextBackoff(e) {
|
|
2202
|
-
const r = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff :
|
|
2202
|
+
const r = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : oi[e].timeout) * Math.pow(2, this.retries);
|
|
2203
2203
|
this.retries += 1;
|
|
2204
2204
|
const i = Math.min(r, this.maxBackoff), s = i * (Math.random() - 0.5);
|
|
2205
2205
|
return i + s;
|
|
@@ -2228,19 +2228,19 @@ class bo {
|
|
|
2228
2228
|
});
|
|
2229
2229
|
}
|
|
2230
2230
|
}
|
|
2231
|
-
function yo() {
|
|
2232
|
-
return vo();
|
|
2233
|
-
}
|
|
2234
2231
|
function vo() {
|
|
2232
|
+
return _o();
|
|
2233
|
+
}
|
|
2234
|
+
function _o() {
|
|
2235
2235
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
2236
2236
|
const e = Math.random() * 16 | 0;
|
|
2237
2237
|
return (t === "x" ? e : e & 3 | 8).toString(16);
|
|
2238
2238
|
});
|
|
2239
2239
|
}
|
|
2240
|
-
class
|
|
2240
|
+
class Qe extends Error {
|
|
2241
2241
|
}
|
|
2242
|
-
|
|
2243
|
-
function
|
|
2242
|
+
Qe.prototype.name = "InvalidTokenError";
|
|
2243
|
+
function ko(t) {
|
|
2244
2244
|
return decodeURIComponent(
|
|
2245
2245
|
atob(t).replace(/(.)/g, (e, n) => {
|
|
2246
2246
|
let r = n.charCodeAt(0).toString(16).toUpperCase();
|
|
@@ -2248,7 +2248,7 @@ function _o(t) {
|
|
|
2248
2248
|
})
|
|
2249
2249
|
);
|
|
2250
2250
|
}
|
|
2251
|
-
function
|
|
2251
|
+
function wo(t) {
|
|
2252
2252
|
let e = t.replace(/-/g, "+").replace(/_/g, "/");
|
|
2253
2253
|
switch (e.length % 4) {
|
|
2254
2254
|
case 0:
|
|
@@ -2263,39 +2263,39 @@ function ko(t) {
|
|
|
2263
2263
|
throw new Error("base64 string is not of the correct length");
|
|
2264
2264
|
}
|
|
2265
2265
|
try {
|
|
2266
|
-
return
|
|
2266
|
+
return ko(e);
|
|
2267
2267
|
} catch {
|
|
2268
2268
|
return atob(e);
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function ai(t, e) {
|
|
2272
2272
|
if (typeof t != "string")
|
|
2273
|
-
throw new
|
|
2273
|
+
throw new Qe("Invalid token specified: must be a string");
|
|
2274
2274
|
e || (e = {});
|
|
2275
2275
|
const n = e.header === !0 ? 0 : 1, r = t.split(".")[n];
|
|
2276
2276
|
if (typeof r != "string")
|
|
2277
|
-
throw new
|
|
2277
|
+
throw new Qe(
|
|
2278
2278
|
`Invalid token specified: missing part #${n + 1}`
|
|
2279
2279
|
);
|
|
2280
2280
|
let i;
|
|
2281
2281
|
try {
|
|
2282
|
-
i =
|
|
2282
|
+
i = wo(r);
|
|
2283
2283
|
} catch (s) {
|
|
2284
|
-
throw new
|
|
2284
|
+
throw new Qe(
|
|
2285
2285
|
`Invalid token specified: invalid base64 for part #${n + 1} (${s.message})`
|
|
2286
2286
|
);
|
|
2287
2287
|
}
|
|
2288
2288
|
try {
|
|
2289
2289
|
return JSON.parse(i);
|
|
2290
2290
|
} catch (s) {
|
|
2291
|
-
throw new
|
|
2291
|
+
throw new Qe(
|
|
2292
2292
|
`Invalid token specified: invalid json for part #${n + 1} (${s.message})`
|
|
2293
2293
|
);
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
2296
|
-
var
|
|
2297
|
-
const
|
|
2298
|
-
class
|
|
2296
|
+
var So = Object.defineProperty, jo = (t, e, n) => e in t ? So(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, M = (t, e, n) => jo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
2297
|
+
const Co = 480 * 60 * 60 * 1e3, or = 2;
|
|
2298
|
+
class To {
|
|
2299
2299
|
constructor(e, n, r) {
|
|
2300
2300
|
M(this, "authState", { state: "noAuth" }), M(this, "configVersion", 0), M(this, "syncState"), M(this, "authenticate"), M(this, "stopSocket"), M(this, "tryRestartSocket"), M(this, "pauseSocket"), M(this, "resumeSocket"), M(this, "clearAuth"), M(this, "logger"), M(this, "refreshTokenLeewaySeconds"), M(this, "tokenConfirmationAttempts", 0), this.syncState = e, this.authenticate = n.authenticate, this.stopSocket = n.stopSocket, this.tryRestartSocket = n.tryRestartSocket, this.pauseSocket = n.pauseSocket, this.resumeSocket = n.resumeSocket, this.clearAuth = n.clearAuth, this.logger = r.logger, this.refreshTokenLeewaySeconds = r.refreshTokenLeewaySeconds;
|
|
2301
2301
|
}
|
|
@@ -2346,14 +2346,14 @@ class Co {
|
|
|
2346
2346
|
if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), // No way to fetch another token, kaboom
|
|
2347
2347
|
this.authState.state === "noAuth" || // We failed on a fresh token. After a small number of retries, we give up
|
|
2348
2348
|
// and clear the auth state to avoid infinite retries.
|
|
2349
|
-
this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >=
|
|
2349
|
+
this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= or) {
|
|
2350
2350
|
this.logger.error(
|
|
2351
2351
|
`Failed to authenticate: "${e.error}", check your server auth config`
|
|
2352
2352
|
), this.syncState.hasAuth() && this.syncState.clearAuth(), this.authState.state !== "noAuth" && this.setAndReportAuthFailed(this.authState.config.onAuthChange);
|
|
2353
2353
|
return;
|
|
2354
2354
|
}
|
|
2355
2355
|
this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(
|
|
2356
|
-
`retrying reauthentication, ${
|
|
2356
|
+
`retrying reauthentication, ${or - this.tokenConfirmationAttempts} attempts remaining`
|
|
2357
2357
|
)), await this.stopSocket();
|
|
2358
2358
|
const n = await this.fetchTokenAndGuardAgainstRace(
|
|
2359
2359
|
this.authState.config.fetchToken,
|
|
@@ -2418,7 +2418,7 @@ class Co {
|
|
|
2418
2418
|
return;
|
|
2419
2419
|
}
|
|
2420
2420
|
let o = Math.min(
|
|
2421
|
-
|
|
2421
|
+
Co,
|
|
2422
2422
|
(s - this.refreshTokenLeewaySeconds) * 1e3
|
|
2423
2423
|
);
|
|
2424
2424
|
o <= 0 && (this.logger.warn(
|
|
@@ -2475,7 +2475,7 @@ class Co {
|
|
|
2475
2475
|
}
|
|
2476
2476
|
decodeToken(e) {
|
|
2477
2477
|
try {
|
|
2478
|
-
return
|
|
2478
|
+
return ai(e);
|
|
2479
2479
|
} catch (n) {
|
|
2480
2480
|
return this._logVerbose(
|
|
2481
2481
|
`Error decoding token: ${n instanceof Error ? n.message : "Unknown error"}`
|
|
@@ -2486,34 +2486,34 @@ class Co {
|
|
|
2486
2486
|
this.logger.logVerbose(`${e} [v${this.configVersion}]`);
|
|
2487
2487
|
}
|
|
2488
2488
|
}
|
|
2489
|
-
const
|
|
2489
|
+
const Ro = [
|
|
2490
2490
|
"convexClientConstructed",
|
|
2491
2491
|
"convexWebSocketOpen",
|
|
2492
2492
|
"convexFirstMessageReceived"
|
|
2493
2493
|
];
|
|
2494
|
-
function
|
|
2494
|
+
function $o(t, e) {
|
|
2495
2495
|
const n = { sessionId: e };
|
|
2496
2496
|
typeof performance > "u" || !performance.mark || performance.mark(t, { detail: n });
|
|
2497
2497
|
}
|
|
2498
|
-
function
|
|
2498
|
+
function Ao(t) {
|
|
2499
2499
|
let e = t.name.slice(6);
|
|
2500
2500
|
return e = e.charAt(0).toLowerCase() + e.slice(1), {
|
|
2501
2501
|
name: e,
|
|
2502
2502
|
startTime: t.startTime
|
|
2503
2503
|
};
|
|
2504
2504
|
}
|
|
2505
|
-
function
|
|
2505
|
+
function Io(t) {
|
|
2506
2506
|
if (typeof performance > "u" || !performance.getEntriesByName)
|
|
2507
2507
|
return [];
|
|
2508
2508
|
const e = [];
|
|
2509
|
-
for (const n of
|
|
2509
|
+
for (const n of Ro) {
|
|
2510
2510
|
const r = performance.getEntriesByName(n).filter((i) => i.entryType === "mark").filter((i) => i.detail.sessionId === t);
|
|
2511
2511
|
e.push(...r);
|
|
2512
2512
|
}
|
|
2513
|
-
return e.map(
|
|
2513
|
+
return e.map(Ao);
|
|
2514
2514
|
}
|
|
2515
|
-
var
|
|
2516
|
-
class
|
|
2515
|
+
var Eo = Object.defineProperty, qo = (t, e, n) => e in t ? Eo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, T = (t, e, n) => qo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
2516
|
+
class Po {
|
|
2517
2517
|
/**
|
|
2518
2518
|
* @param address - The url of your Convex deployment, often provided
|
|
2519
2519
|
* by an environment variable. E.g. `https://small-mouse-123.convex.cloud`.
|
|
@@ -2533,19 +2533,19 @@ class qo {
|
|
|
2533
2533
|
}
|
|
2534
2534
|
});
|
|
2535
2535
|
}), T(this, "mark", (f) => {
|
|
2536
|
-
this.debug &&
|
|
2536
|
+
this.debug && $o(f, this.sessionId);
|
|
2537
2537
|
}), typeof e == "object")
|
|
2538
2538
|
throw new Error(
|
|
2539
2539
|
"Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly."
|
|
2540
2540
|
);
|
|
2541
|
-
r?.skipConvexDeploymentUrlCheck !== !0 &&
|
|
2541
|
+
r?.skipConvexDeploymentUrlCheck !== !0 && Rs(e), r = { ...r };
|
|
2542
2542
|
const i = r.authRefreshTokenLeewaySeconds ?? 10;
|
|
2543
2543
|
let s = r.webSocketConstructor;
|
|
2544
2544
|
if (!s && typeof WebSocket > "u")
|
|
2545
2545
|
throw new Error(
|
|
2546
2546
|
"No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient"
|
|
2547
2547
|
);
|
|
2548
|
-
s = s || WebSocket, this.debug = r.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = r.logger === !1 ?
|
|
2548
|
+
s = s || WebSocket, this.debug = r.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = r.logger === !1 ? ni({ verbose: r.verbose ?? !1 }) : r.logger !== !0 && r.logger ? r.logger : ti({ verbose: r.verbose ?? !1 });
|
|
2549
2549
|
const o = e.search("://");
|
|
2550
2550
|
if (o === -1)
|
|
2551
2551
|
throw new Error("Provided address was not an absolute URL.");
|
|
@@ -2557,8 +2557,8 @@ class qo {
|
|
|
2557
2557
|
u = "wss";
|
|
2558
2558
|
else
|
|
2559
2559
|
throw new Error(`Unknown parent protocol ${a}`);
|
|
2560
|
-
const d = `${u}://${l}/api/${
|
|
2561
|
-
this.state = new
|
|
2560
|
+
const d = `${u}://${l}/api/${Xn}/sync`;
|
|
2561
|
+
this.state = new Ws(), this.remoteQuerySet = new rr(
|
|
2562
2562
|
(f) => this.state.queryPath(f),
|
|
2563
2563
|
this.logger
|
|
2564
2564
|
), this.requestManager = new Gs(
|
|
@@ -2568,7 +2568,7 @@ class qo {
|
|
|
2568
2568
|
const c = () => {
|
|
2569
2569
|
this.webSocketManager.pause(), this.state.pause();
|
|
2570
2570
|
};
|
|
2571
|
-
this.authenticationManager = new
|
|
2571
|
+
this.authenticationManager = new To(
|
|
2572
2572
|
this.state,
|
|
2573
2573
|
{
|
|
2574
2574
|
authenticate: (f) => {
|
|
@@ -2587,9 +2587,9 @@ class qo {
|
|
|
2587
2587
|
logger: this.logger,
|
|
2588
2588
|
refreshTokenLeewaySeconds: i
|
|
2589
2589
|
}
|
|
2590
|
-
), this.optimisticQueryResults = new
|
|
2590
|
+
), this.optimisticQueryResults = new no(), this.addOnTransitionHandler((f) => {
|
|
2591
2591
|
n(f.queries.map((g) => g.token));
|
|
2592
|
-
}), this._nextRequestId = 0, this._sessionId =
|
|
2592
|
+
}), this._nextRequestId = 0, this._sessionId = vo();
|
|
2593
2593
|
const { unsavedChangesWarning: p } = r;
|
|
2594
2594
|
if (typeof window > "u" || typeof window.addEventListener > "u") {
|
|
2595
2595
|
if (p === !0)
|
|
@@ -2603,7 +2603,7 @@ class qo {
|
|
|
2603
2603
|
return (f || window.event).returnValue = g, g;
|
|
2604
2604
|
}
|
|
2605
2605
|
});
|
|
2606
|
-
this.webSocketManager = new
|
|
2606
|
+
this.webSocketManager = new yo(
|
|
2607
2607
|
d,
|
|
2608
2608
|
{
|
|
2609
2609
|
onOpen: (f) => {
|
|
@@ -2612,7 +2612,7 @@ class qo {
|
|
|
2612
2612
|
type: "Connect",
|
|
2613
2613
|
sessionId: this._sessionId,
|
|
2614
2614
|
maxObservedTimestamp: this.maxObservedTimestamp
|
|
2615
|
-
}), this.remoteQuerySet = new
|
|
2615
|
+
}), this.remoteQuerySet = new rr(
|
|
2616
2616
|
(w) => this.state.queryPath(w),
|
|
2617
2617
|
this.logger
|
|
2618
2618
|
);
|
|
@@ -2659,7 +2659,7 @@ class qo {
|
|
|
2659
2659
|
break;
|
|
2660
2660
|
}
|
|
2661
2661
|
case "FatalError": {
|
|
2662
|
-
const g =
|
|
2662
|
+
const g = Ds(this.logger, f.error);
|
|
2663
2663
|
throw this.webSocketManager.terminate(), g;
|
|
2664
2664
|
}
|
|
2665
2665
|
}
|
|
@@ -2759,7 +2759,7 @@ class qo {
|
|
|
2759
2759
|
let n = {};
|
|
2760
2760
|
if (e && e.tokenType === "User")
|
|
2761
2761
|
try {
|
|
2762
|
-
n = e ?
|
|
2762
|
+
n = e ? ai(e.value) : {};
|
|
2763
2763
|
} catch {
|
|
2764
2764
|
n = {};
|
|
2765
2765
|
}
|
|
@@ -2805,7 +2805,7 @@ class qo {
|
|
|
2805
2805
|
* query and an `unsubscribe` callback.
|
|
2806
2806
|
*/
|
|
2807
2807
|
subscribe(e, n, r) {
|
|
2808
|
-
const i =
|
|
2808
|
+
const i = te(n), { modification: s, queryToken: o, unsubscribe: l } = this.state.subscribe(
|
|
2809
2809
|
e,
|
|
2810
2810
|
i,
|
|
2811
2811
|
r?.journal,
|
|
@@ -2826,7 +2826,7 @@ class qo {
|
|
|
2826
2826
|
* query or its value has been set optimistically.
|
|
2827
2827
|
*/
|
|
2828
2828
|
localQueryResult(e, n) {
|
|
2829
|
-
const r =
|
|
2829
|
+
const r = te(n), i = ue(e, r);
|
|
2830
2830
|
return this.optimisticQueryResults.queryResult(i);
|
|
2831
2831
|
}
|
|
2832
2832
|
/**
|
|
@@ -2854,7 +2854,7 @@ class qo {
|
|
|
2854
2854
|
* @internal
|
|
2855
2855
|
*/
|
|
2856
2856
|
localQueryLogs(e, n) {
|
|
2857
|
-
const r =
|
|
2857
|
+
const r = te(n), i = ue(e, r);
|
|
2858
2858
|
return this.optimisticQueryResults.queryLogs(i);
|
|
2859
2859
|
}
|
|
2860
2860
|
/**
|
|
@@ -2867,7 +2867,7 @@ class qo {
|
|
|
2867
2867
|
* @returns The query's {@link QueryJournal} or `undefined`.
|
|
2868
2868
|
*/
|
|
2869
2869
|
queryJournal(e, n) {
|
|
2870
|
-
const r =
|
|
2870
|
+
const r = te(n), i = ue(e, r);
|
|
2871
2871
|
return this.state.queryJournal(i);
|
|
2872
2872
|
}
|
|
2873
2873
|
/**
|
|
@@ -2920,7 +2920,7 @@ class qo {
|
|
|
2920
2920
|
if (!i.success)
|
|
2921
2921
|
throw i.errorData !== void 0 ? Kt(
|
|
2922
2922
|
i,
|
|
2923
|
-
new
|
|
2923
|
+
new Gt(
|
|
2924
2924
|
_e("mutation", e, i)
|
|
2925
2925
|
)
|
|
2926
2926
|
) : new Error(_e("mutation", e, i));
|
|
@@ -2942,7 +2942,7 @@ class qo {
|
|
|
2942
2942
|
* @internal
|
|
2943
2943
|
*/
|
|
2944
2944
|
enqueueMutation(e, n, r, i) {
|
|
2945
|
-
const s =
|
|
2945
|
+
const s = te(n);
|
|
2946
2946
|
this.tryReportLongDisconnect();
|
|
2947
2947
|
const o = this.nextRequestId;
|
|
2948
2948
|
if (this._nextRequestId++, r !== void 0) {
|
|
@@ -3004,7 +3004,7 @@ class qo {
|
|
|
3004
3004
|
if (!r.success)
|
|
3005
3005
|
throw r.errorData !== void 0 ? Kt(
|
|
3006
3006
|
r,
|
|
3007
|
-
new
|
|
3007
|
+
new Gt(_e("action", e, r))
|
|
3008
3008
|
) : new Error(_e("action", e, r));
|
|
3009
3009
|
return r.value;
|
|
3010
3010
|
}
|
|
@@ -3012,7 +3012,7 @@ class qo {
|
|
|
3012
3012
|
* @internal
|
|
3013
3013
|
*/
|
|
3014
3014
|
async actionInternal(e, n, r) {
|
|
3015
|
-
const i =
|
|
3015
|
+
const i = te(n), s = this.nextRequestId;
|
|
3016
3016
|
this._nextRequestId++, this.tryReportLongDisconnect();
|
|
3017
3017
|
const o = {
|
|
3018
3018
|
type: "Action",
|
|
@@ -3061,7 +3061,7 @@ class qo {
|
|
|
3061
3061
|
*/
|
|
3062
3062
|
reportMarks() {
|
|
3063
3063
|
if (this.debug) {
|
|
3064
|
-
const e =
|
|
3064
|
+
const e = Io(this.sessionId);
|
|
3065
3065
|
this.webSocketManager.sendMessage({
|
|
3066
3066
|
type: "Event",
|
|
3067
3067
|
eventType: "ClientConnect",
|
|
@@ -3080,7 +3080,7 @@ class qo {
|
|
|
3080
3080
|
method: "POST",
|
|
3081
3081
|
headers: {
|
|
3082
3082
|
"Content-Type": "application/json",
|
|
3083
|
-
"Convex-Client": `npm-${
|
|
3083
|
+
"Convex-Client": `npm-${Xn}`
|
|
3084
3084
|
},
|
|
3085
3085
|
body: JSON.stringify({ event: "LongWebsocketDisconnect" })
|
|
3086
3086
|
}).then((r) => {
|
|
@@ -3098,10 +3098,10 @@ function Lt(t) {
|
|
|
3098
3098
|
throw new Error(`Not a valid paginated query result: ${t?.toString()}`);
|
|
3099
3099
|
return t;
|
|
3100
3100
|
}
|
|
3101
|
-
var
|
|
3102
|
-
class
|
|
3101
|
+
var Mo = Object.defineProperty, Lo = (t, e, n) => e in t ? Mo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ar = (t, e, n) => Lo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3102
|
+
class Oo {
|
|
3103
3103
|
constructor(e, n) {
|
|
3104
|
-
this.client = e, this.onTransition = n,
|
|
3104
|
+
this.client = e, this.onTransition = n, ar(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), ar(this, "lastTransitionTs"), this.lastTransitionTs = E.fromNumber(0), this.client.addOnTransitionHandler(
|
|
3105
3105
|
(r) => this.onBaseTransition(r)
|
|
3106
3106
|
);
|
|
3107
3107
|
}
|
|
@@ -3114,7 +3114,7 @@ class Lo {
|
|
|
3114
3114
|
* @returns Object with paginatedQueryToken and unsubscribe function
|
|
3115
3115
|
*/
|
|
3116
3116
|
subscribe(e, n, r) {
|
|
3117
|
-
const i = de(e), s =
|
|
3117
|
+
const i = de(e), s = er(
|
|
3118
3118
|
i,
|
|
3119
3119
|
n,
|
|
3120
3120
|
r
|
|
@@ -3145,7 +3145,7 @@ class Lo {
|
|
|
3145
3145
|
* Throws an error when one of the pages has errored.
|
|
3146
3146
|
*/
|
|
3147
3147
|
localQueryResult(e, n, r) {
|
|
3148
|
-
const i = de(e), s =
|
|
3148
|
+
const i = de(e), s = er(
|
|
3149
3149
|
i,
|
|
3150
3150
|
n,
|
|
3151
3151
|
r
|
|
@@ -3374,7 +3374,7 @@ class Lo {
|
|
|
3374
3374
|
return n;
|
|
3375
3375
|
}
|
|
3376
3376
|
}
|
|
3377
|
-
function
|
|
3377
|
+
function No({
|
|
3378
3378
|
// (Synchronously) returns the current value of our subscription.
|
|
3379
3379
|
getCurrentValue: t,
|
|
3380
3380
|
// This function is passed an event handler to attach to the subscription.
|
|
@@ -3406,13 +3406,13 @@ function Oo({
|
|
|
3406
3406
|
};
|
|
3407
3407
|
}, [t, e]), i;
|
|
3408
3408
|
}
|
|
3409
|
-
var
|
|
3410
|
-
const
|
|
3411
|
-
if (typeof
|
|
3409
|
+
var Qo = Object.defineProperty, zo = (t, e, n) => e in t ? Qo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ee = (t, e, n) => zo(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3410
|
+
const Bo = 5e3;
|
|
3411
|
+
if (typeof hn > "u")
|
|
3412
3412
|
throw new Error("Required dependency 'react' not found");
|
|
3413
|
-
function
|
|
3413
|
+
function li(t, e, n) {
|
|
3414
3414
|
function r(i) {
|
|
3415
|
-
return
|
|
3415
|
+
return Vo(i), e.mutation(t, i, {
|
|
3416
3416
|
optimisticUpdate: n
|
|
3417
3417
|
});
|
|
3418
3418
|
}
|
|
@@ -3423,17 +3423,17 @@ function ai(t, e, n) {
|
|
|
3423
3423
|
t
|
|
3424
3424
|
)}`
|
|
3425
3425
|
);
|
|
3426
|
-
return
|
|
3426
|
+
return li(t, e, s);
|
|
3427
3427
|
}, r;
|
|
3428
3428
|
}
|
|
3429
|
-
class
|
|
3429
|
+
class Fo {
|
|
3430
3430
|
/**
|
|
3431
3431
|
* @param address - The url of your Convex deployment, often provided
|
|
3432
3432
|
* by an environment variable. E.g. `https://small-mouse-123.convex.cloud`.
|
|
3433
3433
|
* @param options - See {@link ConvexReactClientOptions} for a full description.
|
|
3434
3434
|
*/
|
|
3435
3435
|
constructor(e, n) {
|
|
3436
|
-
if (
|
|
3436
|
+
if (ee(this, "address"), ee(this, "cachedSync"), ee(this, "cachedPaginatedQueryClient"), ee(this, "listeners"), ee(this, "options"), ee(this, "closed", !1), ee(this, "_logger"), ee(this, "adminAuth"), ee(this, "fakeUserIdentity"), e === void 0)
|
|
3437
3437
|
throw new Error(
|
|
3438
3438
|
"No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated."
|
|
3439
3439
|
);
|
|
@@ -3443,7 +3443,7 @@ class Bo {
|
|
|
3443
3443
|
);
|
|
3444
3444
|
if (!e.includes("://"))
|
|
3445
3445
|
throw new Error("Provided address was not an absolute URL.");
|
|
3446
|
-
this.address = e, this.listeners = /* @__PURE__ */ new Map(), this._logger = n?.logger === !1 ?
|
|
3446
|
+
this.address = e, this.listeners = /* @__PURE__ */ new Map(), this._logger = n?.logger === !1 ? ni({ verbose: n?.verbose ?? !1 }) : n?.logger !== !0 && n?.logger ? n.logger : ti({ verbose: n?.verbose ?? !1 }), this.options = { ...n, logger: this._logger };
|
|
3447
3447
|
}
|
|
3448
3448
|
/**
|
|
3449
3449
|
* Return the address for this client, useful for creating a new client.
|
|
@@ -3463,13 +3463,13 @@ class Bo {
|
|
|
3463
3463
|
get sync() {
|
|
3464
3464
|
if (this.closed)
|
|
3465
3465
|
throw new Error("ConvexReactClient has already been closed.");
|
|
3466
|
-
return this.cachedSync ? this.cachedSync : (this.cachedSync = new
|
|
3466
|
+
return this.cachedSync ? this.cachedSync : (this.cachedSync = new Po(
|
|
3467
3467
|
this.address,
|
|
3468
3468
|
() => {
|
|
3469
3469
|
},
|
|
3470
3470
|
// Use the PaginatedQueryClient's transition instead.
|
|
3471
3471
|
this.options
|
|
3472
|
-
), this.adminAuth && this.cachedSync.setAdminAuth(this.adminAuth, this.fakeUserIdentity), this.cachedPaginatedQueryClient = new
|
|
3472
|
+
), this.adminAuth && this.cachedSync.setAdminAuth(this.adminAuth, this.fakeUserIdentity), this.cachedPaginatedQueryClient = new Oo(
|
|
3473
3473
|
this.cachedSync,
|
|
3474
3474
|
(e) => this.handleTransition(e)
|
|
3475
3475
|
), this.cachedSync);
|
|
@@ -3579,7 +3579,7 @@ class Bo {
|
|
|
3579
3579
|
* an optional extendSubscriptionFor for how long to subscribe to the query.
|
|
3580
3580
|
*/
|
|
3581
3581
|
prewarmQuery(e) {
|
|
3582
|
-
const n = e.extendSubscriptionFor ??
|
|
3582
|
+
const n = e.extendSubscriptionFor ?? Bo, i = this.watchQuery(e.query, e.args || {}).onUpdate(() => {
|
|
3583
3583
|
});
|
|
3584
3584
|
setTimeout(i, n);
|
|
3585
3585
|
}
|
|
@@ -3730,20 +3730,20 @@ class Bo {
|
|
|
3730
3730
|
}
|
|
3731
3731
|
}
|
|
3732
3732
|
}
|
|
3733
|
-
const
|
|
3733
|
+
const fn = hn.createContext(
|
|
3734
3734
|
void 0
|
|
3735
3735
|
// in the future this will be a mocked client for testing
|
|
3736
3736
|
);
|
|
3737
|
-
function
|
|
3738
|
-
return _t(
|
|
3737
|
+
function Do() {
|
|
3738
|
+
return _t(fn);
|
|
3739
3739
|
}
|
|
3740
|
-
const
|
|
3741
|
-
|
|
3740
|
+
const Uo = ({ client: t, children: e }) => hn.createElement(
|
|
3741
|
+
fn.Provider,
|
|
3742
3742
|
{ value: t },
|
|
3743
3743
|
e
|
|
3744
3744
|
);
|
|
3745
|
-
function
|
|
3746
|
-
const n = e[0] === "skip", r = e[0] === "skip" ? {} :
|
|
3745
|
+
function lr(t, ...e) {
|
|
3746
|
+
const n = e[0] === "skip", r = e[0] === "skip" ? {} : te(e[0]), i = typeof t == "string" ? ii(t) : t, s = q(i), o = U(
|
|
3747
3747
|
() => n ? {} : { query: { query: i, args: r } },
|
|
3748
3748
|
// Stringify args so args that are semantically the same don't trigger a
|
|
3749
3749
|
// rerender. Saves developers from adding `useMemo` on every args usage.
|
|
@@ -3755,25 +3755,25 @@ function ar(t, ...e) {
|
|
|
3755
3755
|
return a;
|
|
3756
3756
|
}
|
|
3757
3757
|
function wt(t) {
|
|
3758
|
-
const e = typeof t == "string" ?
|
|
3758
|
+
const e = typeof t == "string" ? ii(t) : t, n = _t(fn);
|
|
3759
3759
|
if (n === void 0)
|
|
3760
3760
|
throw new Error(
|
|
3761
3761
|
"Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app"
|
|
3762
3762
|
);
|
|
3763
3763
|
return U(
|
|
3764
|
-
() =>
|
|
3764
|
+
() => li(e, n),
|
|
3765
3765
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3766
3766
|
[n, q(e)]
|
|
3767
3767
|
);
|
|
3768
3768
|
}
|
|
3769
|
-
function
|
|
3769
|
+
function Vo(t) {
|
|
3770
3770
|
if (typeof t == "object" && t !== null && "bubbles" in t && "persist" in t && "isDefaultPrevented" in t)
|
|
3771
3771
|
throw new Error(
|
|
3772
3772
|
"Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler."
|
|
3773
3773
|
);
|
|
3774
3774
|
}
|
|
3775
|
-
var
|
|
3776
|
-
class
|
|
3775
|
+
var Wo = Object.defineProperty, Ho = (t, e, n) => e in t ? Wo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Ot = (t, e, n) => Ho(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3776
|
+
class Jo {
|
|
3777
3777
|
constructor(e) {
|
|
3778
3778
|
Ot(this, "createWatch"), Ot(this, "queries"), Ot(this, "listeners"), this.createWatch = e, this.queries = {}, this.listeners = /* @__PURE__ */ new Set();
|
|
3779
3779
|
}
|
|
@@ -3875,7 +3875,7 @@ class Ho {
|
|
|
3875
3875
|
}
|
|
3876
3876
|
}
|
|
3877
3877
|
function Go(t) {
|
|
3878
|
-
const e =
|
|
3878
|
+
const e = Do();
|
|
3879
3879
|
if (e === void 0)
|
|
3880
3880
|
throw new Error(
|
|
3881
3881
|
"Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app"
|
|
@@ -3884,10 +3884,10 @@ function Go(t) {
|
|
|
3884
3884
|
journal: s,
|
|
3885
3885
|
paginationOptions: o
|
|
3886
3886
|
}) => o ? e.watchPaginatedQuery(r, i, o) : e.watchQuery(r, i, s ? { journal: s } : {}), [e]);
|
|
3887
|
-
return
|
|
3887
|
+
return Ko(t, n);
|
|
3888
3888
|
}
|
|
3889
|
-
function
|
|
3890
|
-
const [n] = R(() => new
|
|
3889
|
+
function Ko(t, e) {
|
|
3890
|
+
const [n] = R(() => new Jo(e));
|
|
3891
3891
|
n.createWatch !== e && n.setCreateWatch(e), D(() => () => n.destroy(), [n]);
|
|
3892
3892
|
const r = U(
|
|
3893
3893
|
() => ({
|
|
@@ -3896,18 +3896,18 @@ function Jo(t, e) {
|
|
|
3896
3896
|
}),
|
|
3897
3897
|
[n, t]
|
|
3898
3898
|
);
|
|
3899
|
-
return
|
|
3899
|
+
return No(r);
|
|
3900
3900
|
}
|
|
3901
|
-
var
|
|
3901
|
+
var Zo = /* @__PURE__ */ Symbol.for("preact-signals");
|
|
3902
3902
|
function St() {
|
|
3903
3903
|
if (se > 1)
|
|
3904
3904
|
se--;
|
|
3905
3905
|
else {
|
|
3906
|
-
for (var t, e = !1;
|
|
3907
|
-
var n =
|
|
3908
|
-
for (
|
|
3906
|
+
for (var t, e = !1; Ue !== void 0; ) {
|
|
3907
|
+
var n = Ue;
|
|
3908
|
+
for (Ue = void 0, Zt++; n !== void 0; ) {
|
|
3909
3909
|
var r = n.o;
|
|
3910
|
-
if (n.o = void 0, n.f &= -3, !(8 & n.f) &&
|
|
3910
|
+
if (n.o = void 0, n.f &= -3, !(8 & n.f) && hi(n)) try {
|
|
3911
3911
|
n.c();
|
|
3912
3912
|
} catch (i) {
|
|
3913
3913
|
e || (t = i, e = !0);
|
|
@@ -3918,7 +3918,7 @@ function St() {
|
|
|
3918
3918
|
if (Zt = 0, se--, e) throw t;
|
|
3919
3919
|
}
|
|
3920
3920
|
}
|
|
3921
|
-
function
|
|
3921
|
+
function Xo(t) {
|
|
3922
3922
|
if (se > 0) return t();
|
|
3923
3923
|
se++;
|
|
3924
3924
|
try {
|
|
@@ -3928,7 +3928,7 @@ function Zo(t) {
|
|
|
3928
3928
|
}
|
|
3929
3929
|
}
|
|
3930
3930
|
var y = void 0;
|
|
3931
|
-
function
|
|
3931
|
+
function ci(t) {
|
|
3932
3932
|
var e = y;
|
|
3933
3933
|
y = void 0;
|
|
3934
3934
|
try {
|
|
@@ -3937,8 +3937,8 @@ function li(t) {
|
|
|
3937
3937
|
y = e;
|
|
3938
3938
|
}
|
|
3939
3939
|
}
|
|
3940
|
-
var
|
|
3941
|
-
function
|
|
3940
|
+
var Ue = void 0, se = 0, Zt = 0, pt = 0;
|
|
3941
|
+
function ui(t) {
|
|
3942
3942
|
if (y !== void 0) {
|
|
3943
3943
|
var e = t.n;
|
|
3944
3944
|
if (e === void 0 || e.t !== y)
|
|
@@ -3950,13 +3950,13 @@ function ci(t) {
|
|
|
3950
3950
|
function $(t, e) {
|
|
3951
3951
|
this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
3952
3952
|
}
|
|
3953
|
-
$.prototype.brand =
|
|
3953
|
+
$.prototype.brand = Zo;
|
|
3954
3954
|
$.prototype.h = function() {
|
|
3955
3955
|
return !0;
|
|
3956
3956
|
};
|
|
3957
3957
|
$.prototype.S = function(t) {
|
|
3958
3958
|
var e = this, n = this.t;
|
|
3959
|
-
n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t :
|
|
3959
|
+
n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : ci(function() {
|
|
3960
3960
|
var r;
|
|
3961
3961
|
(r = e.W) == null || r.call(e);
|
|
3962
3962
|
}));
|
|
@@ -3965,7 +3965,7 @@ $.prototype.U = function(t) {
|
|
|
3965
3965
|
var e = this;
|
|
3966
3966
|
if (this.t !== void 0) {
|
|
3967
3967
|
var n = t.e, r = t.x;
|
|
3968
|
-
n !== void 0 && (n.x = r, t.e = void 0), r !== void 0 && (r.e = n, t.x = void 0), t === this.t && (this.t = r, r === void 0 &&
|
|
3968
|
+
n !== void 0 && (n.x = r, t.e = void 0), r !== void 0 && (r.e = n, t.x = void 0), t === this.t && (this.t = r, r === void 0 && ci(function() {
|
|
3969
3969
|
var i;
|
|
3970
3970
|
(i = e.Z) == null || i.call(e);
|
|
3971
3971
|
}));
|
|
@@ -3973,7 +3973,7 @@ $.prototype.U = function(t) {
|
|
|
3973
3973
|
};
|
|
3974
3974
|
$.prototype.subscribe = function(t) {
|
|
3975
3975
|
var e = this;
|
|
3976
|
-
return
|
|
3976
|
+
return et(function() {
|
|
3977
3977
|
var n = e.value, r = y;
|
|
3978
3978
|
y = void 0;
|
|
3979
3979
|
try {
|
|
@@ -4002,12 +4002,12 @@ $.prototype.peek = function() {
|
|
|
4002
4002
|
}
|
|
4003
4003
|
};
|
|
4004
4004
|
Object.defineProperty($.prototype, "value", { get: function() {
|
|
4005
|
-
var t =
|
|
4005
|
+
var t = ui(this);
|
|
4006
4006
|
return t !== void 0 && (t.i = this.i), this.v;
|
|
4007
4007
|
}, set: function(t) {
|
|
4008
4008
|
if (t !== this.v) {
|
|
4009
4009
|
if (Zt > 100) throw new Error("Cycle detected");
|
|
4010
|
-
this.v = t, this.i++,
|
|
4010
|
+
this.v = t, this.i++, pt++, se++;
|
|
4011
4011
|
try {
|
|
4012
4012
|
for (var e = this.t; e !== void 0; e = e.x) e.t.N();
|
|
4013
4013
|
} finally {
|
|
@@ -4015,14 +4015,14 @@ Object.defineProperty($.prototype, "value", { get: function() {
|
|
|
4015
4015
|
}
|
|
4016
4016
|
}
|
|
4017
4017
|
} });
|
|
4018
|
-
function
|
|
4018
|
+
function Y(t, e) {
|
|
4019
4019
|
return new $(t, e);
|
|
4020
4020
|
}
|
|
4021
|
-
function
|
|
4021
|
+
function hi(t) {
|
|
4022
4022
|
for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
|
|
4023
4023
|
return !1;
|
|
4024
4024
|
}
|
|
4025
|
-
function
|
|
4025
|
+
function di(t) {
|
|
4026
4026
|
for (var e = t.s; e !== void 0; e = e.n) {
|
|
4027
4027
|
var n = e.S.n;
|
|
4028
4028
|
if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
@@ -4031,7 +4031,7 @@ function hi(t) {
|
|
|
4031
4031
|
}
|
|
4032
4032
|
}
|
|
4033
4033
|
}
|
|
4034
|
-
function
|
|
4034
|
+
function fi(t) {
|
|
4035
4035
|
for (var e = t.s, n = void 0; e !== void 0; ) {
|
|
4036
4036
|
var r = e.p;
|
|
4037
4037
|
e.i === -1 ? (e.S.U(e), r !== void 0 && (r.n = e.n), e.n !== void 0 && (e.n.p = r)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = r;
|
|
@@ -4039,23 +4039,23 @@ function di(t) {
|
|
|
4039
4039
|
t.s = n;
|
|
4040
4040
|
}
|
|
4041
4041
|
function ge(t, e) {
|
|
4042
|
-
$.call(this, void 0), this.x = t, this.s = void 0, this.g =
|
|
4042
|
+
$.call(this, void 0), this.x = t, this.s = void 0, this.g = pt - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
4043
4043
|
}
|
|
4044
4044
|
ge.prototype = new $();
|
|
4045
4045
|
ge.prototype.h = function() {
|
|
4046
4046
|
if (this.f &= -3, 1 & this.f) return !1;
|
|
4047
|
-
if ((36 & this.f) == 32 || (this.f &= -5, this.g ===
|
|
4048
|
-
if (this.g =
|
|
4047
|
+
if ((36 & this.f) == 32 || (this.f &= -5, this.g === pt)) return !0;
|
|
4048
|
+
if (this.g = pt, this.f |= 1, this.i > 0 && !hi(this))
|
|
4049
4049
|
return this.f &= -2, !0;
|
|
4050
4050
|
var t = y;
|
|
4051
4051
|
try {
|
|
4052
|
-
|
|
4052
|
+
di(this), y = this;
|
|
4053
4053
|
var e = this.x();
|
|
4054
4054
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
4055
4055
|
} catch (n) {
|
|
4056
4056
|
this.v = n, this.f |= 16, this.i++;
|
|
4057
4057
|
}
|
|
4058
|
-
return y = t,
|
|
4058
|
+
return y = t, fi(this), this.f &= -2, !0;
|
|
4059
4059
|
};
|
|
4060
4060
|
ge.prototype.S = function(t) {
|
|
4061
4061
|
if (this.t === void 0) {
|
|
@@ -4078,14 +4078,14 @@ ge.prototype.N = function() {
|
|
|
4078
4078
|
};
|
|
4079
4079
|
Object.defineProperty(ge.prototype, "value", { get: function() {
|
|
4080
4080
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
4081
|
-
var t =
|
|
4081
|
+
var t = ui(this);
|
|
4082
4082
|
if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
|
|
4083
4083
|
return this.v;
|
|
4084
4084
|
} });
|
|
4085
|
-
function
|
|
4085
|
+
function cr(t, e) {
|
|
4086
4086
|
return new ge(t, e);
|
|
4087
4087
|
}
|
|
4088
|
-
function
|
|
4088
|
+
function pi(t) {
|
|
4089
4089
|
var e = t.u;
|
|
4090
4090
|
if (t.u = void 0, typeof e == "function") {
|
|
4091
4091
|
se++;
|
|
@@ -4094,24 +4094,24 @@ function fi(t) {
|
|
|
4094
4094
|
try {
|
|
4095
4095
|
e();
|
|
4096
4096
|
} catch (r) {
|
|
4097
|
-
throw t.f &= -2, t.f |= 8,
|
|
4097
|
+
throw t.f &= -2, t.f |= 8, pn(t), r;
|
|
4098
4098
|
} finally {
|
|
4099
4099
|
y = n, St();
|
|
4100
4100
|
}
|
|
4101
4101
|
}
|
|
4102
4102
|
}
|
|
4103
|
-
function
|
|
4103
|
+
function pn(t) {
|
|
4104
4104
|
for (var e = t.s; e !== void 0; e = e.n) e.S.U(e);
|
|
4105
|
-
t.x = void 0, t.s = void 0,
|
|
4105
|
+
t.x = void 0, t.s = void 0, pi(t);
|
|
4106
4106
|
}
|
|
4107
|
-
function
|
|
4107
|
+
function Yo(t) {
|
|
4108
4108
|
if (y !== this) throw new Error("Out-of-order effect");
|
|
4109
|
-
|
|
4109
|
+
fi(this), y = t, this.f &= -2, 8 & this.f && pn(this), St();
|
|
4110
4110
|
}
|
|
4111
|
-
function
|
|
4111
|
+
function Ie(t, e) {
|
|
4112
4112
|
this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e?.name;
|
|
4113
4113
|
}
|
|
4114
|
-
|
|
4114
|
+
Ie.prototype.c = function() {
|
|
4115
4115
|
var t = this.S();
|
|
4116
4116
|
try {
|
|
4117
4117
|
if (8 & this.f || this.x === void 0) return;
|
|
@@ -4121,23 +4121,23 @@ Ee.prototype.c = function() {
|
|
|
4121
4121
|
t();
|
|
4122
4122
|
}
|
|
4123
4123
|
};
|
|
4124
|
-
|
|
4124
|
+
Ie.prototype.S = function() {
|
|
4125
4125
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
4126
|
-
this.f |= 1, this.f &= -9,
|
|
4126
|
+
this.f |= 1, this.f &= -9, pi(this), di(this), se++;
|
|
4127
4127
|
var t = y;
|
|
4128
|
-
return y = this,
|
|
4128
|
+
return y = this, Yo.bind(this, t);
|
|
4129
4129
|
};
|
|
4130
|
-
|
|
4131
|
-
2 & this.f || (this.f |= 2, this.o =
|
|
4130
|
+
Ie.prototype.N = function() {
|
|
4131
|
+
2 & this.f || (this.f |= 2, this.o = Ue, Ue = this);
|
|
4132
4132
|
};
|
|
4133
|
-
|
|
4134
|
-
this.f |= 8, 1 & this.f ||
|
|
4133
|
+
Ie.prototype.d = function() {
|
|
4134
|
+
this.f |= 8, 1 & this.f || pn(this);
|
|
4135
4135
|
};
|
|
4136
|
-
|
|
4136
|
+
Ie.prototype.dispose = function() {
|
|
4137
4137
|
this.d();
|
|
4138
4138
|
};
|
|
4139
|
-
function
|
|
4140
|
-
var n = new
|
|
4139
|
+
function et(t, e) {
|
|
4140
|
+
var n = new Ie(t, e);
|
|
4141
4141
|
try {
|
|
4142
4142
|
n.c();
|
|
4143
4143
|
} catch (i) {
|
|
@@ -4146,22 +4146,22 @@ function tt(t, e) {
|
|
|
4146
4146
|
var r = n.d.bind(n);
|
|
4147
4147
|
return r[Symbol.dispose] = r, r;
|
|
4148
4148
|
}
|
|
4149
|
-
var
|
|
4150
|
-
|
|
4151
|
-
|
|
4149
|
+
var gi, ot, ea = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, mi = [];
|
|
4150
|
+
et(function() {
|
|
4151
|
+
gi = this.N;
|
|
4152
4152
|
})();
|
|
4153
|
-
function
|
|
4153
|
+
function Ee(t, e) {
|
|
4154
4154
|
m[t] = e.bind(null, m[t] || function() {
|
|
4155
4155
|
});
|
|
4156
4156
|
}
|
|
4157
|
-
function
|
|
4158
|
-
if (
|
|
4159
|
-
var e =
|
|
4160
|
-
|
|
4157
|
+
function gt(t) {
|
|
4158
|
+
if (ot) {
|
|
4159
|
+
var e = ot;
|
|
4160
|
+
ot = void 0, e();
|
|
4161
4161
|
}
|
|
4162
|
-
|
|
4162
|
+
ot = t && t.S();
|
|
4163
4163
|
}
|
|
4164
|
-
function
|
|
4164
|
+
function xi(t) {
|
|
4165
4165
|
var e = this, n = t.data, r = ke(n);
|
|
4166
4166
|
r.value = n;
|
|
4167
4167
|
var i = U(function() {
|
|
@@ -4169,13 +4169,13 @@ function mi(t) {
|
|
|
4169
4169
|
a.__c.__$f |= 4;
|
|
4170
4170
|
break;
|
|
4171
4171
|
}
|
|
4172
|
-
var u =
|
|
4172
|
+
var u = cr(function() {
|
|
4173
4173
|
var f = r.value.value;
|
|
4174
4174
|
return f === 0 ? 0 : f === !0 ? "" : f || "";
|
|
4175
|
-
}), d =
|
|
4176
|
-
return !Array.isArray(u.value) && !
|
|
4177
|
-
}), c =
|
|
4178
|
-
if (this.N =
|
|
4175
|
+
}), d = cr(function() {
|
|
4176
|
+
return !Array.isArray(u.value) && !vr(u.value);
|
|
4177
|
+
}), c = et(function() {
|
|
4178
|
+
if (this.N = bi, d.value) {
|
|
4179
4179
|
var f = u.value;
|
|
4180
4180
|
l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = f);
|
|
4181
4181
|
}
|
|
@@ -4186,11 +4186,11 @@ function mi(t) {
|
|
|
4186
4186
|
}, []), s = i[0], o = i[1];
|
|
4187
4187
|
return s.value ? o.peek() : o.value;
|
|
4188
4188
|
}
|
|
4189
|
-
|
|
4190
|
-
Object.defineProperties($.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value:
|
|
4189
|
+
xi.displayName = "ReactiveTextNode";
|
|
4190
|
+
Object.defineProperties($.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: xi }, props: { configurable: !0, get: function() {
|
|
4191
4191
|
return { data: this };
|
|
4192
4192
|
} }, __b: { configurable: !0, value: 1 } });
|
|
4193
|
-
|
|
4193
|
+
Ee("__b", function(t, e) {
|
|
4194
4194
|
if (typeof e.type == "string") {
|
|
4195
4195
|
var n, r = e.props;
|
|
4196
4196
|
for (var i in r) if (i !== "children") {
|
|
@@ -4200,26 +4200,26 @@ qe("__b", function(t, e) {
|
|
|
4200
4200
|
}
|
|
4201
4201
|
t(e);
|
|
4202
4202
|
});
|
|
4203
|
-
|
|
4203
|
+
Ee("__r", function(t, e) {
|
|
4204
4204
|
if (t(e), e.type !== F) {
|
|
4205
|
-
|
|
4205
|
+
gt();
|
|
4206
4206
|
var n, r = e.__c;
|
|
4207
4207
|
r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = (function(i, s) {
|
|
4208
4208
|
var o;
|
|
4209
|
-
return
|
|
4209
|
+
return et(function() {
|
|
4210
4210
|
o = this;
|
|
4211
4211
|
}, { name: s }), o.c = i, o;
|
|
4212
4212
|
})(function() {
|
|
4213
4213
|
var i;
|
|
4214
|
-
|
|
4215
|
-
}, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))),
|
|
4214
|
+
ea && ((i = n.y) == null || i.call(n)), r.__$f |= 1, r.setState({});
|
|
4215
|
+
}, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), gt(n);
|
|
4216
4216
|
}
|
|
4217
4217
|
});
|
|
4218
|
-
|
|
4219
|
-
|
|
4218
|
+
Ee("__e", function(t, e, n, r) {
|
|
4219
|
+
gt(), t(e, n, r);
|
|
4220
4220
|
});
|
|
4221
|
-
|
|
4222
|
-
|
|
4221
|
+
Ee("diffed", function(t, e) {
|
|
4222
|
+
gt();
|
|
4223
4223
|
var n;
|
|
4224
4224
|
if (typeof e.type == "string" && (n = e.__e)) {
|
|
4225
4225
|
var r = e.__np, i = e.props;
|
|
@@ -4233,23 +4233,23 @@ qe("diffed", function(t, e) {
|
|
|
4233
4233
|
s = {}, n.U = s;
|
|
4234
4234
|
for (var a in r) {
|
|
4235
4235
|
var u = s[a], d = r[a];
|
|
4236
|
-
u === void 0 ? (u =
|
|
4236
|
+
u === void 0 ? (u = ta(n, a, d, i), s[a] = u) : u.o(d, i);
|
|
4237
4237
|
}
|
|
4238
4238
|
}
|
|
4239
4239
|
}
|
|
4240
4240
|
t(e);
|
|
4241
4241
|
});
|
|
4242
|
-
function
|
|
4243
|
-
var i = e in t && t.ownerSVGElement === void 0, s =
|
|
4242
|
+
function ta(t, e, n, r) {
|
|
4243
|
+
var i = e in t && t.ownerSVGElement === void 0, s = Y(n);
|
|
4244
4244
|
return { o: function(o, l) {
|
|
4245
4245
|
s.value = o, r = l;
|
|
4246
|
-
}, d:
|
|
4247
|
-
this.N =
|
|
4246
|
+
}, d: et(function() {
|
|
4247
|
+
this.N = bi;
|
|
4248
4248
|
var o = s.value.value;
|
|
4249
4249
|
r[e] !== o && (r[e] = o, i ? t[e] = o : o != null && (o !== !1 || e[4] === "-") ? t.setAttribute(e, o) : t.removeAttribute(e));
|
|
4250
4250
|
}) };
|
|
4251
4251
|
}
|
|
4252
|
-
|
|
4252
|
+
Ee("unmount", function(t, e) {
|
|
4253
4253
|
if (typeof e.type == "string") {
|
|
4254
4254
|
var n = e.__e;
|
|
4255
4255
|
if (n) {
|
|
@@ -4271,7 +4271,7 @@ qe("unmount", function(t, e) {
|
|
|
4271
4271
|
}
|
|
4272
4272
|
t(e);
|
|
4273
4273
|
});
|
|
4274
|
-
|
|
4274
|
+
Ee("__h", function(t, e, n, r) {
|
|
4275
4275
|
(r < 3 || r === 9) && (e.__$f |= 2), t(e, n, r);
|
|
4276
4276
|
});
|
|
4277
4277
|
z.prototype.shouldComponentUpdate = function(t, e) {
|
|
@@ -4288,30 +4288,30 @@ z.prototype.shouldComponentUpdate = function(t, e) {
|
|
|
4288
4288
|
};
|
|
4289
4289
|
function ke(t, e) {
|
|
4290
4290
|
return U(function() {
|
|
4291
|
-
return
|
|
4291
|
+
return Y(t, e);
|
|
4292
4292
|
}, []);
|
|
4293
4293
|
}
|
|
4294
|
-
var
|
|
4294
|
+
var na = function(t) {
|
|
4295
4295
|
queueMicrotask(function() {
|
|
4296
4296
|
queueMicrotask(t);
|
|
4297
4297
|
});
|
|
4298
4298
|
};
|
|
4299
|
-
function
|
|
4300
|
-
|
|
4301
|
-
for (var t; t =
|
|
4299
|
+
function ra() {
|
|
4300
|
+
Xo(function() {
|
|
4301
|
+
for (var t; t = mi.shift(); ) gi.call(t);
|
|
4302
4302
|
});
|
|
4303
4303
|
}
|
|
4304
|
-
function
|
|
4305
|
-
|
|
4304
|
+
function bi() {
|
|
4305
|
+
mi.push(this) === 1 && (m.requestAnimationFrame || na)(ra);
|
|
4306
4306
|
}
|
|
4307
|
-
const A =
|
|
4308
|
-
function
|
|
4307
|
+
const A = Y(!1), mt = Y(void 0), Xt = Y(void 0);
|
|
4308
|
+
function ia(t) {
|
|
4309
4309
|
return t.replace(/\.convex\.site\b/, ".convex.cloud");
|
|
4310
4310
|
}
|
|
4311
|
-
function
|
|
4311
|
+
function sa(t) {
|
|
4312
4312
|
return t.replace(/\.convex\.cloud\b/, ".convex.site");
|
|
4313
4313
|
}
|
|
4314
|
-
function
|
|
4314
|
+
function oa(t, e) {
|
|
4315
4315
|
const n = t.title ?? e?.title ?? "Assistant";
|
|
4316
4316
|
return {
|
|
4317
4317
|
title: n,
|
|
@@ -4333,21 +4333,21 @@ function sa(t, e) {
|
|
|
4333
4333
|
windowHeight: t.windowHeight ?? e?.windowHeight
|
|
4334
4334
|
};
|
|
4335
4335
|
}
|
|
4336
|
-
async function
|
|
4336
|
+
async function aa(t, e, n) {
|
|
4337
4337
|
const r = `${t}/widget/config?orgSlug=${encodeURIComponent(e)}`, i = await fetch(r, { signal: n });
|
|
4338
4338
|
return i.ok ? i.json() : null;
|
|
4339
4339
|
}
|
|
4340
|
-
function
|
|
4340
|
+
function la(t, e) {
|
|
4341
4341
|
const [n, r] = R(null);
|
|
4342
4342
|
return D(() => {
|
|
4343
4343
|
r(null);
|
|
4344
|
-
const i = e ?? "https://festive-mouse-978.eu-west-1.convex.cloud", s = i ?
|
|
4344
|
+
const i = e ?? "https://festive-mouse-978.eu-west-1.convex.cloud", s = i ? sa(i) : void 0;
|
|
4345
4345
|
if (!s || !t)
|
|
4346
4346
|
return;
|
|
4347
4347
|
const o = new AbortController();
|
|
4348
4348
|
async function l(a) {
|
|
4349
4349
|
try {
|
|
4350
|
-
const u = await
|
|
4350
|
+
const u = await aa(a, t, o.signal);
|
|
4351
4351
|
u && r(u);
|
|
4352
4352
|
} catch (u) {
|
|
4353
4353
|
if (u instanceof Error && u.name === "AbortError")
|
|
@@ -4359,7 +4359,7 @@ function aa(t, e) {
|
|
|
4359
4359
|
};
|
|
4360
4360
|
}, [t, e]), n;
|
|
4361
4361
|
}
|
|
4362
|
-
const
|
|
4362
|
+
const yi = {
|
|
4363
4363
|
title: "Assistant",
|
|
4364
4364
|
statusOnline: "Online · Responds in seconds",
|
|
4365
4365
|
inputPlaceholder: "Type a message…",
|
|
@@ -4414,7 +4414,7 @@ const bi = {
|
|
|
4414
4414
|
somethingWentWrong: "Something went wrong",
|
|
4415
4415
|
fabLabel: "Chat with us",
|
|
4416
4416
|
chatNoLongerAvailable: "This chat is no longer available."
|
|
4417
|
-
},
|
|
4417
|
+
}, ca = {
|
|
4418
4418
|
title: "Assistent",
|
|
4419
4419
|
statusOnline: "Online · Antwortet in Sekunden",
|
|
4420
4420
|
inputPlaceholder: "Nachricht eingeben…",
|
|
@@ -4469,25 +4469,25 @@ const bi = {
|
|
|
4469
4469
|
somethingWentWrong: "Etwas ist schiefgelaufen",
|
|
4470
4470
|
fabLabel: "Chatte mit uns",
|
|
4471
4471
|
chatNoLongerAvailable: "Dieser Chat ist nicht mehr verfügbar."
|
|
4472
|
-
},
|
|
4472
|
+
}, ua = [
|
|
4473
4473
|
{ value: "de", label: "Deutsch", flag: "🇩🇪" },
|
|
4474
4474
|
{ value: "en", label: "English", flag: "🇬🇧" }
|
|
4475
|
-
],
|
|
4475
|
+
], ha = "de", da = "jex-locale", gn = Y("de"), fa = { en: yi, de: ca };
|
|
4476
4476
|
function P() {
|
|
4477
|
-
return
|
|
4477
|
+
return fa[gn.value] ?? yi;
|
|
4478
4478
|
}
|
|
4479
4479
|
function Nt(t) {
|
|
4480
4480
|
if (!t)
|
|
4481
4481
|
return null;
|
|
4482
4482
|
const e = (t.split("-")[0] ?? "").toLowerCase();
|
|
4483
|
-
return
|
|
4483
|
+
return ua.some((r) => r.value === e) ? e : null;
|
|
4484
4484
|
}
|
|
4485
|
-
function
|
|
4485
|
+
function vi(t) {
|
|
4486
4486
|
const e = Nt(t);
|
|
4487
4487
|
if (e)
|
|
4488
4488
|
return e;
|
|
4489
4489
|
try {
|
|
4490
|
-
const n = Nt(localStorage.getItem(
|
|
4490
|
+
const n = Nt(localStorage.getItem(da));
|
|
4491
4491
|
if (n)
|
|
4492
4492
|
return n;
|
|
4493
4493
|
} catch {
|
|
@@ -4497,51 +4497,51 @@ function yi(t) {
|
|
|
4497
4497
|
if (n)
|
|
4498
4498
|
return n;
|
|
4499
4499
|
}
|
|
4500
|
-
return
|
|
4500
|
+
return ha;
|
|
4501
4501
|
}
|
|
4502
|
-
function
|
|
4502
|
+
function pa(t) {
|
|
4503
4503
|
D(() => {
|
|
4504
4504
|
function e(n) {
|
|
4505
4505
|
const r = t ?? window.location.origin;
|
|
4506
4506
|
if (n.origin !== r || n.data?.type !== "jexity:config")
|
|
4507
4507
|
return;
|
|
4508
4508
|
const { locale: i } = n.data.payload;
|
|
4509
|
-
i && (
|
|
4509
|
+
i && (gn.value = vi(i));
|
|
4510
4510
|
}
|
|
4511
4511
|
return window.addEventListener("message", e), () => {
|
|
4512
4512
|
window.removeEventListener("message", e);
|
|
4513
4513
|
};
|
|
4514
4514
|
}, [t]);
|
|
4515
4515
|
}
|
|
4516
|
-
const
|
|
4517
|
-
function
|
|
4516
|
+
const mn = "jex-session-ref", jt = "jex-session-active", ae = Y(null), fe = Y(!1);
|
|
4517
|
+
function ga() {
|
|
4518
4518
|
return "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
|
|
4519
4519
|
}
|
|
4520
|
-
function
|
|
4520
|
+
function ma() {
|
|
4521
4521
|
try {
|
|
4522
|
-
const t = sessionStorage.getItem(
|
|
4522
|
+
const t = sessionStorage.getItem(mn), e = sessionStorage.getItem(jt);
|
|
4523
4523
|
ae.value = t ?? null, fe.value = t !== null && e === "true";
|
|
4524
4524
|
} catch {
|
|
4525
4525
|
ae.value = null, fe.value = !1;
|
|
4526
4526
|
}
|
|
4527
4527
|
}
|
|
4528
|
-
function
|
|
4529
|
-
const t =
|
|
4528
|
+
function Yt() {
|
|
4529
|
+
const t = ga();
|
|
4530
4530
|
ae.value = t, fe.value = !1;
|
|
4531
4531
|
try {
|
|
4532
|
-
sessionStorage.setItem(
|
|
4532
|
+
sessionStorage.setItem(mn, t), sessionStorage.removeItem(jt);
|
|
4533
4533
|
} catch {
|
|
4534
4534
|
}
|
|
4535
4535
|
return t;
|
|
4536
4536
|
}
|
|
4537
|
-
function
|
|
4537
|
+
function xa(t) {
|
|
4538
4538
|
ae.value = t, fe.value = !0;
|
|
4539
4539
|
try {
|
|
4540
|
-
sessionStorage.setItem(
|
|
4540
|
+
sessionStorage.setItem(mn, t), sessionStorage.setItem(jt, "true");
|
|
4541
4541
|
} catch {
|
|
4542
4542
|
}
|
|
4543
4543
|
}
|
|
4544
|
-
function
|
|
4544
|
+
function ba() {
|
|
4545
4545
|
if (ae.value) {
|
|
4546
4546
|
fe.value = !0;
|
|
4547
4547
|
try {
|
|
@@ -4550,7 +4550,7 @@ function xa() {
|
|
|
4550
4550
|
}
|
|
4551
4551
|
}
|
|
4552
4552
|
}
|
|
4553
|
-
function
|
|
4553
|
+
function ya(t) {
|
|
4554
4554
|
const e = {}, { primaryColor: n, theme: r } = t;
|
|
4555
4555
|
if (n && (e["--jex-primary"] = n, e["--jex-bg-trigger"] = n, e["--jex-bg-header"] = n, e["--jex-bg-msg-user"] = n, e["--jex-bg-send-btn"] = n), t.accentColor && (e["--jex-accent"] = t.accentColor), r?.bg) {
|
|
4556
4556
|
const i = r.bg;
|
|
@@ -4566,17 +4566,17 @@ function ba(t) {
|
|
|
4566
4566
|
}
|
|
4567
4567
|
return t.fontFamily && (e["--jex-font-family"] = t.fontFamily), t.fontSize && (e["--jex-font-size"] = `${t.fontSize}px`), t.borderRadius && (e["--jex-radius"] = t.borderRadius), t.windowWidth && (e["--jex-window-width"] = `${t.windowWidth}px`), t.windowHeight && (e["--jex-window-height"] = `${t.windowHeight}px`), Object.keys(e).length > 0 ? e : void 0;
|
|
4568
4568
|
}
|
|
4569
|
-
const B =
|
|
4570
|
-
function
|
|
4569
|
+
const B = Y([{ id: "home" }]), va = Y("screen");
|
|
4570
|
+
function we(t) {
|
|
4571
4571
|
B.value = [...B.value, t];
|
|
4572
4572
|
}
|
|
4573
|
-
function
|
|
4573
|
+
function xn() {
|
|
4574
4574
|
B.value.length > 1 && (B.value = B.value.slice(0, -1));
|
|
4575
4575
|
}
|
|
4576
|
-
function
|
|
4576
|
+
function Se(t) {
|
|
4577
4577
|
B.value = [...B.value.slice(0, -1), t];
|
|
4578
4578
|
}
|
|
4579
|
-
function
|
|
4579
|
+
function bn({ size: t = 24 }) {
|
|
4580
4580
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
4581
4581
|
/* @__PURE__ */ h("path", { d: "M12 8V4H8" }),
|
|
4582
4582
|
/* @__PURE__ */ h("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }),
|
|
@@ -4586,29 +4586,29 @@ function xn({ size: t = 24 }) {
|
|
|
4586
4586
|
/* @__PURE__ */ h("path", { d: "M9 13v2" })
|
|
4587
4587
|
] });
|
|
4588
4588
|
}
|
|
4589
|
-
function
|
|
4589
|
+
function ur({ title: t }) {
|
|
4590
4590
|
const e = P(), n = B.value.length > 1;
|
|
4591
4591
|
return /* @__PURE__ */ h("header", { class: "jex-chat-header", children: [
|
|
4592
4592
|
n && /* @__PURE__ */ h(
|
|
4593
4593
|
"button",
|
|
4594
4594
|
{
|
|
4595
4595
|
class: "jex-header-back",
|
|
4596
|
-
onClick:
|
|
4596
|
+
onClick: xn,
|
|
4597
4597
|
"aria-label": e.back || "Go back",
|
|
4598
4598
|
children: /* @__PURE__ */ h("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ h("path", { d: "m15 18-6-6 6-6" }) })
|
|
4599
4599
|
}
|
|
4600
4600
|
),
|
|
4601
|
-
!n && /* @__PURE__ */ h(
|
|
4601
|
+
!n && /* @__PURE__ */ h(bn, { size: 24 }),
|
|
4602
4602
|
/* @__PURE__ */ h("div", { class: "jex-header-info", children: [
|
|
4603
4603
|
/* @__PURE__ */ h("h3", { children: t }),
|
|
4604
4604
|
/* @__PURE__ */ h("p", { children: e.statusOnline })
|
|
4605
4605
|
] })
|
|
4606
4606
|
] });
|
|
4607
4607
|
}
|
|
4608
|
-
function
|
|
4608
|
+
function _a({ size: t = 14 }) {
|
|
4609
4609
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ h("path", { d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" }) });
|
|
4610
4610
|
}
|
|
4611
|
-
function
|
|
4611
|
+
function hr() {
|
|
4612
4612
|
return /* @__PURE__ */ h("div", { class: "jex-widget-footer", children: /* @__PURE__ */ h(
|
|
4613
4613
|
"a",
|
|
4614
4614
|
{
|
|
@@ -4617,7 +4617,7 @@ function ur() {
|
|
|
4617
4617
|
rel: "noopener noreferrer",
|
|
4618
4618
|
class: "jex-branding",
|
|
4619
4619
|
children: [
|
|
4620
|
-
/* @__PURE__ */ h(
|
|
4620
|
+
/* @__PURE__ */ h(_a, { size: 14 }),
|
|
4621
4621
|
/* @__PURE__ */ h("span", { children: [
|
|
4622
4622
|
"Powered by ",
|
|
4623
4623
|
/* @__PURE__ */ h("strong", { children: "Jexity" })
|
|
@@ -4626,16 +4626,16 @@ function ur() {
|
|
|
4626
4626
|
}
|
|
4627
4627
|
) });
|
|
4628
4628
|
}
|
|
4629
|
-
function
|
|
4629
|
+
function _i({ size: t = 28 }) {
|
|
4630
4630
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ h("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
|
|
4631
4631
|
}
|
|
4632
|
-
function
|
|
4632
|
+
function ka({ size: t = 28 }) {
|
|
4633
4633
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
4634
4634
|
/* @__PURE__ */ h("path", { d: "M18 6 6 18" }),
|
|
4635
4635
|
/* @__PURE__ */ h("path", { d: "m6 6 12 12" })
|
|
4636
4636
|
] });
|
|
4637
4637
|
}
|
|
4638
|
-
function
|
|
4638
|
+
function wa({ size: t = 24, ...e }) {
|
|
4639
4639
|
return /* @__PURE__ */ h(
|
|
4640
4640
|
"svg",
|
|
4641
4641
|
{
|
|
@@ -4652,52 +4652,52 @@ function ka({ size: t = 24, ...e }) {
|
|
|
4652
4652
|
}
|
|
4653
4653
|
);
|
|
4654
4654
|
}
|
|
4655
|
-
const
|
|
4656
|
-
chat: /* @__PURE__ */ h(
|
|
4657
|
-
bot: /* @__PURE__ */ h(
|
|
4658
|
-
sparkles: /* @__PURE__ */ h(
|
|
4659
|
-
},
|
|
4655
|
+
const Sa = {
|
|
4656
|
+
chat: /* @__PURE__ */ h(_i, { size: 28 }),
|
|
4657
|
+
bot: /* @__PURE__ */ h(bn, { size: 28 }),
|
|
4658
|
+
sparkles: /* @__PURE__ */ h(wa, { size: 28 })
|
|
4659
|
+
}, ja = {
|
|
4660
4660
|
none: "0px",
|
|
4661
4661
|
sm: "0.5rem",
|
|
4662
4662
|
md: "0.75rem",
|
|
4663
4663
|
lg: "1.25rem",
|
|
4664
4664
|
full: "9999px"
|
|
4665
4665
|
};
|
|
4666
|
-
function
|
|
4666
|
+
function Ca({ radius: t = "full", iconOption: e = "chat", label: n }) {
|
|
4667
4667
|
const r = P(), i = n ?? r.fabLabel, s = i !== "";
|
|
4668
4668
|
return /* @__PURE__ */ h(
|
|
4669
4669
|
"button",
|
|
4670
4670
|
{
|
|
4671
4671
|
class: `jex-floating-button ${!A.value && s ? "jex-has-label" : ""}`,
|
|
4672
|
-
style: { borderRadius:
|
|
4672
|
+
style: { borderRadius: ja[t] ?? "9999px" },
|
|
4673
4673
|
onClick: () => {
|
|
4674
4674
|
A.value = !A.value;
|
|
4675
4675
|
},
|
|
4676
4676
|
"aria-label": A.value ? r.closeChatAriaLabel : r.openChatAriaLabel,
|
|
4677
|
-
children: A.value ? /* @__PURE__ */ h(
|
|
4678
|
-
|
|
4677
|
+
children: A.value ? /* @__PURE__ */ h(ka, { size: 28 }) : /* @__PURE__ */ h("div", { class: "jex-fab-inner", children: [
|
|
4678
|
+
Sa[e],
|
|
4679
4679
|
s && /* @__PURE__ */ h("span", { class: "jex-fab-label", children: i })
|
|
4680
4680
|
] })
|
|
4681
4681
|
}
|
|
4682
4682
|
);
|
|
4683
4683
|
}
|
|
4684
|
-
function
|
|
4684
|
+
function Ta({ title: t }) {
|
|
4685
4685
|
const e = P(), n = ae.value, [r, i] = R("");
|
|
4686
4686
|
function s() {
|
|
4687
|
-
|
|
4687
|
+
Yt(), we({ id: "chat" });
|
|
4688
4688
|
}
|
|
4689
4689
|
function o() {
|
|
4690
|
-
|
|
4690
|
+
we({ id: "chat" });
|
|
4691
4691
|
}
|
|
4692
4692
|
function l(a) {
|
|
4693
4693
|
a.preventDefault();
|
|
4694
4694
|
const u = r.trim().toUpperCase();
|
|
4695
|
-
u && (
|
|
4695
|
+
u && (xa(u), we({ id: "chat" }));
|
|
4696
4696
|
}
|
|
4697
4697
|
return /* @__PURE__ */ h("div", { class: "jex-home", children: [
|
|
4698
4698
|
/* @__PURE__ */ h("div", { class: "jex-home-hero", children: [
|
|
4699
4699
|
/* @__PURE__ */ h("div", { class: "jex-home-avatar", children: [
|
|
4700
|
-
/* @__PURE__ */ h(
|
|
4700
|
+
/* @__PURE__ */ h(_i, { size: 24 }),
|
|
4701
4701
|
/* @__PURE__ */ h("span", { class: "jex-home-status-dot" })
|
|
4702
4702
|
] }),
|
|
4703
4703
|
/* @__PURE__ */ h("div", { class: "jex-home-hero-text", children: [
|
|
@@ -4740,7 +4740,7 @@ function Ca({ title: t }) {
|
|
|
4740
4740
|
] })
|
|
4741
4741
|
] });
|
|
4742
4742
|
}
|
|
4743
|
-
function
|
|
4743
|
+
function Ra({ title: t }) {
|
|
4744
4744
|
const e = P();
|
|
4745
4745
|
return /* @__PURE__ */ h("div", { class: "jex-selection", children: [
|
|
4746
4746
|
/* @__PURE__ */ h("h2", { class: "jex-selection-title", children: e.howCanWeHelp }),
|
|
@@ -4749,7 +4749,7 @@ function Ta({ title: t }) {
|
|
|
4749
4749
|
"button",
|
|
4750
4750
|
{
|
|
4751
4751
|
class: "jex-selection-option",
|
|
4752
|
-
onClick: () =>
|
|
4752
|
+
onClick: () => we({ id: "chat" }),
|
|
4753
4753
|
children: [
|
|
4754
4754
|
/* @__PURE__ */ h("span", { class: "jex-selection-icon", children: "💬" }),
|
|
4755
4755
|
/* @__PURE__ */ h("span", { class: "jex-selection-label", children: e.chatWith.replace("{title}", t) }),
|
|
@@ -4761,7 +4761,7 @@ function Ta({ title: t }) {
|
|
|
4761
4761
|
"button",
|
|
4762
4762
|
{
|
|
4763
4763
|
class: "jex-selection-option",
|
|
4764
|
-
onClick: () =>
|
|
4764
|
+
onClick: () => we({ id: "form" }),
|
|
4765
4765
|
children: [
|
|
4766
4766
|
/* @__PURE__ */ h("span", { class: "jex-selection-icon", children: "📝" }),
|
|
4767
4767
|
/* @__PURE__ */ h("span", { class: "jex-selection-label", children: e.submitTicket }),
|
|
@@ -4772,13 +4772,13 @@ function Ta({ title: t }) {
|
|
|
4772
4772
|
] })
|
|
4773
4773
|
] });
|
|
4774
4774
|
}
|
|
4775
|
-
function
|
|
4775
|
+
function ki(t, e) {
|
|
4776
4776
|
const n = {
|
|
4777
4777
|
get(r, i) {
|
|
4778
4778
|
if (typeof i == "string") {
|
|
4779
4779
|
const s = [...e, i];
|
|
4780
|
-
return
|
|
4781
|
-
} else if (i ===
|
|
4780
|
+
return ki(t, s);
|
|
4781
|
+
} else if (i === ri) {
|
|
4782
4782
|
if (e.length < 1) {
|
|
4783
4783
|
const s = [t, ...e].join(".");
|
|
4784
4784
|
throw new Error(
|
|
@@ -4792,70 +4792,66 @@ function _i(t, e) {
|
|
|
4792
4792
|
};
|
|
4793
4793
|
return new Proxy({}, n);
|
|
4794
4794
|
}
|
|
4795
|
-
const
|
|
4796
|
-
|
|
4797
|
-
function
|
|
4798
|
-
const e = vt(null), n = ke(!1), r = ke(!1), i = ke(!1), s = ke(null), o = wt(
|
|
4795
|
+
const $a = () => ki("components", []), $e = Ys;
|
|
4796
|
+
$a();
|
|
4797
|
+
function Aa(t) {
|
|
4798
|
+
const e = vt(null), n = ke(!1), r = ke(!1), i = ke(!1), s = ke(null), o = wt($e.functions.chat.public.sessions.createOrResume), l = async (c) => {
|
|
4799
|
+
const p = Xt.value;
|
|
4800
|
+
if (!p)
|
|
4801
|
+
return console.warn("[JexityChat] No bootstrap token — session creation blocked."), null;
|
|
4802
|
+
const f = await o({
|
|
4803
|
+
orgSlug: t,
|
|
4804
|
+
visitorId: c,
|
|
4805
|
+
bootstrapToken: p,
|
|
4806
|
+
...mt.value ? { source: mt.value } : {}
|
|
4807
|
+
});
|
|
4808
|
+
s.value = f.status;
|
|
4809
|
+
const g = { sessionId: f.sessionId, visitorId: c };
|
|
4810
|
+
return e.current = g, { session: g, result: f };
|
|
4811
|
+
}, a = We(async () => {
|
|
4799
4812
|
if (e.current)
|
|
4800
4813
|
return e.current;
|
|
4801
4814
|
if (i.value)
|
|
4802
4815
|
return null;
|
|
4803
4816
|
n.value = !0;
|
|
4804
|
-
const
|
|
4817
|
+
const c = ae.value !== null, p = ae.value ?? Yt();
|
|
4805
4818
|
try {
|
|
4806
|
-
const
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
});
|
|
4811
|
-
if (s.value = p.status, d && p.isNew) {
|
|
4812
|
-
r.value = !0, i.value = !0;
|
|
4813
|
-
const g = { sessionId: p.sessionId, visitorId: c };
|
|
4814
|
-
return e.current = g, g;
|
|
4815
|
-
}
|
|
4816
|
-
const f = { sessionId: p.sessionId, visitorId: c };
|
|
4817
|
-
return e.current = f, f;
|
|
4818
|
-
} catch (p) {
|
|
4819
|
-
return console.error("[jexity] Failed to create session:", p), null;
|
|
4819
|
+
const f = await l(p);
|
|
4820
|
+
return f ? (c && f.result.isNew && (r.value = !0, i.value = !0), f.session) : null;
|
|
4821
|
+
} catch (f) {
|
|
4822
|
+
return console.error("[JexityChat] Failed to create session:", f), null;
|
|
4820
4823
|
} finally {
|
|
4821
4824
|
n.value = !1;
|
|
4822
4825
|
}
|
|
4823
|
-
}, [t, o, n, r, i]),
|
|
4826
|
+
}, [t, o, n, r, i]), u = We(async () => {
|
|
4824
4827
|
e.current = null, i.value = !1, r.value = !1;
|
|
4825
|
-
const
|
|
4828
|
+
const c = Yt();
|
|
4826
4829
|
n.value = !0;
|
|
4827
4830
|
try {
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
...we.value ? { source: we.value } : {}
|
|
4832
|
-
});
|
|
4833
|
-
s.value = c.status;
|
|
4834
|
-
const p = { sessionId: c.sessionId, visitorId: d };
|
|
4835
|
-
return e.current = p, p;
|
|
4836
|
-
} catch (c) {
|
|
4837
|
-
return console.error("[jexity] Failed to create fresh session:", c), null;
|
|
4831
|
+
return (await l(c))?.session ?? null;
|
|
4832
|
+
} catch (p) {
|
|
4833
|
+
return console.error("[JexityChat] Failed to create fresh session:", p), null;
|
|
4838
4834
|
} finally {
|
|
4839
4835
|
n.value = !1;
|
|
4840
4836
|
}
|
|
4841
|
-
}, [t, o, n, r, i, s]),
|
|
4837
|
+
}, [t, o, n, r, i, s]), d = e.current;
|
|
4842
4838
|
return {
|
|
4843
|
-
sessionId:
|
|
4844
|
-
visitorId:
|
|
4839
|
+
sessionId: d?.sessionId ?? null,
|
|
4840
|
+
visitorId: d?.visitorId ?? null,
|
|
4845
4841
|
isLoading: n.value,
|
|
4846
4842
|
sessionNotFound: r.value,
|
|
4847
4843
|
resumeFailed: i.value,
|
|
4848
4844
|
sessionStatus: s.value,
|
|
4849
4845
|
isOrgDeleted: s.value === "org_deleted",
|
|
4850
|
-
ensureSession:
|
|
4851
|
-
startFresh:
|
|
4846
|
+
ensureSession: a,
|
|
4847
|
+
startFresh: u
|
|
4852
4848
|
};
|
|
4853
4849
|
}
|
|
4854
|
-
function
|
|
4850
|
+
function yn() {
|
|
4855
4851
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
4856
4852
|
}
|
|
4857
|
-
var me =
|
|
4858
|
-
function
|
|
4853
|
+
var me = yn();
|
|
4854
|
+
function wi(t) {
|
|
4859
4855
|
me = t;
|
|
4860
4856
|
}
|
|
4861
4857
|
var ce = { exec: () => null };
|
|
@@ -4866,21 +4862,21 @@ function x(t, e = "") {
|
|
|
4866
4862
|
}, getRegex: () => new RegExp(n, e) };
|
|
4867
4863
|
return r;
|
|
4868
4864
|
}
|
|
4869
|
-
var
|
|
4865
|
+
var Ia = (() => {
|
|
4870
4866
|
try {
|
|
4871
4867
|
return !!new RegExp("(?<=1)(?<!1)");
|
|
4872
4868
|
} catch {
|
|
4873
4869
|
return !1;
|
|
4874
4870
|
}
|
|
4875
|
-
})(), I = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`), htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}>`) },
|
|
4876
|
-
]`).replace("lheading",
|
|
4877
|
-
function
|
|
4871
|
+
})(), I = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`), htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}>`) }, Ea = /^(?:[ \t]*(?:\n|$))+/, qa = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Pa = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, tt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Ma = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, vn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Si = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ji = x(Si).replace(/bull/g, vn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), La = x(Si).replace(/bull/g, vn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), _n = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Oa = /^[^\n]+/, kn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Na = x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", kn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Qa = x(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, vn).getRegex(), Ct = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", wn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, za = x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", wn).replace("tag", Ct).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ci = x(_n).replace("hr", tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ct).getRegex(), Ba = x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ci).getRegex(), Sn = { blockquote: Ba, code: qa, def: Na, fences: Pa, heading: Ma, hr: tt, html: za, lheading: ji, list: Qa, newline: Ea, paragraph: Ci, table: ce, text: Oa }, dr = x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ct).getRegex(), Fa = { ...Sn, lheading: La, table: dr, paragraph: x(_n).replace("hr", tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", dr).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ct).getRegex() }, Da = { ...Sn, html: x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", wn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: ce, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: x(_n).replace("hr", tt).replace("heading", ` *#{1,6} *[^
|
|
4872
|
+
]`).replace("lheading", ji).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ua = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Va = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ti = /^( {2,}|\\)\n(?!\s*$)/, Wa = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, qe = /[\p{P}\p{S}]/u, Tt = /[\s\p{P}\p{S}]/u, jn = /[^\s\p{P}\p{S}]/u, Ha = x(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Tt).getRegex(), Ri = /(?!~)[\p{P}\p{S}]/u, Ja = /(?!~)[\s\p{P}\p{S}]/u, Ga = /(?:[^\s\p{P}\p{S}]|~)/u, Ka = x(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Ia ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), $i = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Za = x($i, "u").replace(/punct/g, qe).getRegex(), Xa = x($i, "u").replace(/punct/g, Ri).getRegex(), Ai = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ya = x(Ai, "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, Tt).replace(/punct/g, qe).getRegex(), el = x(Ai, "gu").replace(/notPunctSpace/g, Ga).replace(/punctSpace/g, Ja).replace(/punct/g, Ri).getRegex(), tl = x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, Tt).replace(/punct/g, qe).getRegex(), nl = x(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, qe).getRegex(), rl = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", il = x(rl, "gu").replace(/notPunctSpace/g, jn).replace(/punctSpace/g, Tt).replace(/punct/g, qe).getRegex(), sl = x(/\\(punct)/, "gu").replace(/punct/g, qe).getRegex(), ol = x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), al = x(wn).replace("(?:-->|$)", "-->").getRegex(), ll = x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", al).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), xt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, cl = x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", xt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ii = x(/^!?\[(label)\]\[(ref)\]/).replace("label", xt).replace("ref", kn).getRegex(), Ei = x(/^!?\[(ref)\](?:\[\])?/).replace("ref", kn).getRegex(), ul = x("reflink|nolink(?!\\()", "g").replace("reflink", Ii).replace("nolink", Ei).getRegex(), fr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Cn = { _backpedal: ce, anyPunctuation: sl, autolink: ol, blockSkip: Ka, br: Ti, code: Va, del: ce, delLDelim: ce, delRDelim: ce, emStrongLDelim: Za, emStrongRDelimAst: Ya, emStrongRDelimUnd: tl, escape: Ua, link: cl, nolink: Ei, punctuation: Ha, reflink: Ii, reflinkSearch: ul, tag: ll, text: Wa, url: ce }, hl = { ...Cn, link: x(/^!?\[(label)\]\((.*?)\)/).replace("label", xt).getRegex(), reflink: x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", xt).getRegex() }, en = { ...Cn, emStrongRDelimAst: el, emStrongLDelim: Xa, delLDelim: nl, delRDelim: il, url: x(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", fr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: x(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", fr).getRegex() }, dl = { ...en, br: x(Ti).replace("{2,}", "*").getRegex(), text: x(en.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, at = { normal: Sn, gfm: Fa, pedantic: Da }, Me = { normal: Cn, gfm: en, breaks: dl, pedantic: hl }, fl = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, pr = (t) => fl[t];
|
|
4873
|
+
function G(t, e) {
|
|
4878
4874
|
if (e) {
|
|
4879
|
-
if (I.escapeTest.test(t)) return t.replace(I.escapeReplace,
|
|
4880
|
-
} else if (I.escapeTestNoEncode.test(t)) return t.replace(I.escapeReplaceNoEncode,
|
|
4875
|
+
if (I.escapeTest.test(t)) return t.replace(I.escapeReplace, pr);
|
|
4876
|
+
} else if (I.escapeTestNoEncode.test(t)) return t.replace(I.escapeReplaceNoEncode, pr);
|
|
4881
4877
|
return t;
|
|
4882
4878
|
}
|
|
4883
|
-
function
|
|
4879
|
+
function gr(t) {
|
|
4884
4880
|
try {
|
|
4885
4881
|
t = encodeURI(t).replace(I.percentDecode, "%");
|
|
4886
4882
|
} catch {
|
|
@@ -4888,7 +4884,7 @@ function pr(t) {
|
|
|
4888
4884
|
}
|
|
4889
4885
|
return t;
|
|
4890
4886
|
}
|
|
4891
|
-
function
|
|
4887
|
+
function mr(t, e) {
|
|
4892
4888
|
let n = t.replace(I.findPipe, (s, o, l) => {
|
|
4893
4889
|
let a = !1, u = o;
|
|
4894
4890
|
for (; --u >= 0 && l[u] === "\\"; ) a = !a;
|
|
@@ -4899,7 +4895,7 @@ function gr(t, e) {
|
|
|
4899
4895
|
for (; i < r.length; i++) r[i] = r[i].trim().replace(I.slashPipe, "|");
|
|
4900
4896
|
return r;
|
|
4901
4897
|
}
|
|
4902
|
-
function
|
|
4898
|
+
function Le(t, e, n) {
|
|
4903
4899
|
let r = t.length;
|
|
4904
4900
|
if (r === 0) return "";
|
|
4905
4901
|
let i = 0;
|
|
@@ -4907,7 +4903,7 @@ function Oe(t, e, n) {
|
|
|
4907
4903
|
i++;
|
|
4908
4904
|
return t.slice(0, r - i);
|
|
4909
4905
|
}
|
|
4910
|
-
function
|
|
4906
|
+
function pl(t, e) {
|
|
4911
4907
|
if (t.indexOf(e[1]) === -1) return -1;
|
|
4912
4908
|
let n = 0;
|
|
4913
4909
|
for (let r = 0; r < t.length; r++) if (t[r] === "\\") r++;
|
|
@@ -4915,7 +4911,7 @@ function fl(t, e) {
|
|
|
4915
4911
|
else if (t[r] === e[1] && (n--, n < 0)) return r;
|
|
4916
4912
|
return n > 0 ? -2 : -1;
|
|
4917
4913
|
}
|
|
4918
|
-
function
|
|
4914
|
+
function gl(t, e = 0) {
|
|
4919
4915
|
let n = e, r = "";
|
|
4920
4916
|
for (let i of t) if (i === " ") {
|
|
4921
4917
|
let s = 4 - n % 4;
|
|
@@ -4923,13 +4919,13 @@ function pl(t, e = 0) {
|
|
|
4923
4919
|
} else r += i, n++;
|
|
4924
4920
|
return r;
|
|
4925
4921
|
}
|
|
4926
|
-
function
|
|
4922
|
+
function xr(t, e, n, r, i) {
|
|
4927
4923
|
let s = e.href, o = e.title || null, l = t[1].replace(i.other.outputLinkReplace, "$1");
|
|
4928
4924
|
r.state.inLink = !0;
|
|
4929
4925
|
let a = { type: t[0].charAt(0) === "!" ? "image" : "link", raw: n, href: s, title: o, text: l, tokens: r.inlineTokens(l) };
|
|
4930
4926
|
return r.state.inLink = !1, a;
|
|
4931
4927
|
}
|
|
4932
|
-
function
|
|
4928
|
+
function ml(t, e, n) {
|
|
4933
4929
|
let r = t.match(n.other.indentCodeCompensation);
|
|
4934
4930
|
if (r === null) return e;
|
|
4935
4931
|
let i = r[1];
|
|
@@ -4957,14 +4953,14 @@ var bt = class {
|
|
|
4957
4953
|
let e = this.rules.block.code.exec(t);
|
|
4958
4954
|
if (e) {
|
|
4959
4955
|
let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
4960
|
-
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n :
|
|
4956
|
+
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : Le(n, `
|
|
4961
4957
|
`) };
|
|
4962
4958
|
}
|
|
4963
4959
|
}
|
|
4964
4960
|
fences(t) {
|
|
4965
4961
|
let e = this.rules.block.fences.exec(t);
|
|
4966
4962
|
if (e) {
|
|
4967
|
-
let n = e[0], r =
|
|
4963
|
+
let n = e[0], r = ml(n, e[3] || "", this.rules);
|
|
4968
4964
|
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
|
|
4969
4965
|
}
|
|
4970
4966
|
}
|
|
@@ -4973,7 +4969,7 @@ var bt = class {
|
|
|
4973
4969
|
if (e) {
|
|
4974
4970
|
let n = e[2].trim();
|
|
4975
4971
|
if (this.rules.other.endingHash.test(n)) {
|
|
4976
|
-
let r =
|
|
4972
|
+
let r = Le(n, "#");
|
|
4977
4973
|
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
4978
4974
|
}
|
|
4979
4975
|
return { type: "heading", raw: e[0], depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
@@ -4981,13 +4977,13 @@ var bt = class {
|
|
|
4981
4977
|
}
|
|
4982
4978
|
hr(t) {
|
|
4983
4979
|
let e = this.rules.block.hr.exec(t);
|
|
4984
|
-
if (e) return { type: "hr", raw:
|
|
4980
|
+
if (e) return { type: "hr", raw: Le(e[0], `
|
|
4985
4981
|
`) };
|
|
4986
4982
|
}
|
|
4987
4983
|
blockquote(t) {
|
|
4988
4984
|
let e = this.rules.block.blockquote.exec(t);
|
|
4989
4985
|
if (e) {
|
|
4990
|
-
let n =
|
|
4986
|
+
let n = Le(e[0], `
|
|
4991
4987
|
`).split(`
|
|
4992
4988
|
`), r = "", i = "", s = [];
|
|
4993
4989
|
for (; n.length > 0; ) {
|
|
@@ -5034,7 +5030,7 @@ ${d}` : d;
|
|
|
5034
5030
|
let a = !1, u = "", d = "";
|
|
5035
5031
|
if (!(e = s.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
5036
5032
|
u = e[0], t = t.substring(u.length);
|
|
5037
|
-
let c =
|
|
5033
|
+
let c = gl(e[2].split(`
|
|
5038
5034
|
`, 1)[0], e[1].length), p = t.split(`
|
|
5039
5035
|
`, 1)[0], f = !c.trim(), g = 0;
|
|
5040
5036
|
if (this.options.pedantic ? (g = 2, d = c.trimStart()) : f ? g = e[1].length + 1 : (g = c.search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, d = c.slice(g), g += e[1].length), f && this.rules.other.blankLine.test(p) && (u += p + `
|
|
@@ -5102,12 +5098,12 @@ ${d}` : d;
|
|
|
5102
5098
|
table(t) {
|
|
5103
5099
|
let e = this.rules.block.table.exec(t);
|
|
5104
5100
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
5105
|
-
let n =
|
|
5101
|
+
let n = mr(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
5106
5102
|
`) : [], s = { type: "table", raw: e[0], header: [], align: [], rows: [] };
|
|
5107
5103
|
if (n.length === r.length) {
|
|
5108
5104
|
for (let o of r) this.rules.other.tableAlignRight.test(o) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? s.align.push("left") : s.align.push(null);
|
|
5109
5105
|
for (let o = 0; o < n.length; o++) s.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: s.align[o] });
|
|
5110
|
-
for (let o of i) s.rows.push(
|
|
5106
|
+
for (let o of i) s.rows.push(mr(o, s.header.length).map((l, a) => ({ text: l, tokens: this.lexer.inline(l), header: !1, align: s.align[a] })));
|
|
5111
5107
|
return s;
|
|
5112
5108
|
}
|
|
5113
5109
|
}
|
|
@@ -5144,10 +5140,10 @@ ${d}` : d;
|
|
|
5144
5140
|
let n = e[2].trim();
|
|
5145
5141
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
5146
5142
|
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
5147
|
-
let s =
|
|
5143
|
+
let s = Le(n.slice(0, -1), "\\");
|
|
5148
5144
|
if ((n.length - s.length) % 2 === 0) return;
|
|
5149
5145
|
} else {
|
|
5150
|
-
let s =
|
|
5146
|
+
let s = pl(e[2], "()");
|
|
5151
5147
|
if (s === -2) return;
|
|
5152
5148
|
if (s > -1) {
|
|
5153
5149
|
let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + s;
|
|
@@ -5159,7 +5155,7 @@ ${d}` : d;
|
|
|
5159
5155
|
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
5160
5156
|
s && (r = s[1], i = s[3]);
|
|
5161
5157
|
} else i = e[3] ? e[3].slice(1, -1) : "";
|
|
5162
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
5158
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), xr(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
5163
5159
|
}
|
|
5164
5160
|
}
|
|
5165
5161
|
reflink(t, e) {
|
|
@@ -5170,7 +5166,7 @@ ${d}` : d;
|
|
|
5170
5166
|
let s = n[0].charAt(0);
|
|
5171
5167
|
return { type: "text", raw: s, text: s };
|
|
5172
5168
|
}
|
|
5173
|
-
return
|
|
5169
|
+
return xr(n, i, n[0], this.lexer, this.rules);
|
|
5174
5170
|
}
|
|
5175
5171
|
}
|
|
5176
5172
|
emStrong(t, e, n = "") {
|
|
@@ -5255,7 +5251,7 @@ ${d}` : d;
|
|
|
5255
5251
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
5256
5252
|
}
|
|
5257
5253
|
}
|
|
5258
|
-
}, N = class
|
|
5254
|
+
}, N = class tn {
|
|
5259
5255
|
tokens;
|
|
5260
5256
|
options;
|
|
5261
5257
|
state;
|
|
@@ -5263,17 +5259,17 @@ ${d}` : d;
|
|
|
5263
5259
|
tokenizer;
|
|
5264
5260
|
constructor(e) {
|
|
5265
5261
|
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || me, this.options.tokenizer = this.options.tokenizer || new bt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
5266
|
-
let n = { other: I, block:
|
|
5267
|
-
this.options.pedantic ? (n.block =
|
|
5262
|
+
let n = { other: I, block: at.normal, inline: Me.normal };
|
|
5263
|
+
this.options.pedantic ? (n.block = at.pedantic, n.inline = Me.pedantic) : this.options.gfm && (n.block = at.gfm, this.options.breaks ? n.inline = Me.breaks : n.inline = Me.gfm), this.tokenizer.rules = n;
|
|
5268
5264
|
}
|
|
5269
5265
|
static get rules() {
|
|
5270
|
-
return { block:
|
|
5266
|
+
return { block: at, inline: Me };
|
|
5271
5267
|
}
|
|
5272
5268
|
static lex(e, n) {
|
|
5273
|
-
return new
|
|
5269
|
+
return new tn(n).lex(e);
|
|
5274
5270
|
}
|
|
5275
5271
|
static lexInline(e, n) {
|
|
5276
|
-
return new
|
|
5272
|
+
return new tn(n).inlineTokens(e);
|
|
5277
5273
|
}
|
|
5278
5274
|
lex(e) {
|
|
5279
5275
|
e = e.replace(I.carriageReturn, `
|
|
@@ -5475,8 +5471,8 @@ ${d}` : d;
|
|
|
5475
5471
|
code({ text: t, lang: e, escaped: n }) {
|
|
5476
5472
|
let r = (e || "").match(I.notSpaceStart)?.[0], i = t.replace(I.endingNewline, "") + `
|
|
5477
5473
|
`;
|
|
5478
|
-
return r ? '<pre><code class="language-' +
|
|
5479
|
-
` : "<pre><code>" + (n ? i :
|
|
5474
|
+
return r ? '<pre><code class="language-' + G(r) + '">' + (n ? i : G(i, !0)) + `</code></pre>
|
|
5475
|
+
` : "<pre><code>" + (n ? i : G(i, !0)) + `</code></pre>
|
|
5480
5476
|
`;
|
|
5481
5477
|
}
|
|
5482
5478
|
blockquote({ tokens: t }) {
|
|
@@ -5554,7 +5550,7 @@ ${t}</tr>
|
|
|
5554
5550
|
return `<em>${this.parser.parseInline(t)}</em>`;
|
|
5555
5551
|
}
|
|
5556
5552
|
codespan({ text: t }) {
|
|
5557
|
-
return `<code>${
|
|
5553
|
+
return `<code>${G(t, !0)}</code>`;
|
|
5558
5554
|
}
|
|
5559
5555
|
br(t) {
|
|
5560
5556
|
return "<br>";
|
|
@@ -5563,24 +5559,24 @@ ${t}</tr>
|
|
|
5563
5559
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
5564
5560
|
}
|
|
5565
5561
|
link({ href: t, title: e, tokens: n }) {
|
|
5566
|
-
let r = this.parser.parseInline(n), i =
|
|
5562
|
+
let r = this.parser.parseInline(n), i = gr(t);
|
|
5567
5563
|
if (i === null) return r;
|
|
5568
5564
|
t = i;
|
|
5569
5565
|
let s = '<a href="' + t + '"';
|
|
5570
|
-
return e && (s += ' title="' +
|
|
5566
|
+
return e && (s += ' title="' + G(e) + '"'), s += ">" + r + "</a>", s;
|
|
5571
5567
|
}
|
|
5572
5568
|
image({ href: t, title: e, text: n, tokens: r }) {
|
|
5573
5569
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
5574
|
-
let i =
|
|
5575
|
-
if (i === null) return
|
|
5570
|
+
let i = gr(t);
|
|
5571
|
+
if (i === null) return G(n);
|
|
5576
5572
|
t = i;
|
|
5577
|
-
let s = `<img src="${t}" alt="${
|
|
5578
|
-
return e && (s += ` title="${
|
|
5573
|
+
let s = `<img src="${t}" alt="${G(n)}"`;
|
|
5574
|
+
return e && (s += ` title="${G(e)}"`), s += ">", s;
|
|
5579
5575
|
}
|
|
5580
5576
|
text(t) {
|
|
5581
|
-
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text :
|
|
5577
|
+
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : G(t.text);
|
|
5582
5578
|
}
|
|
5583
|
-
},
|
|
5579
|
+
}, Tn = class {
|
|
5584
5580
|
strong({ text: t }) {
|
|
5585
5581
|
return t;
|
|
5586
5582
|
}
|
|
@@ -5611,18 +5607,18 @@ ${t}</tr>
|
|
|
5611
5607
|
checkbox({ raw: t }) {
|
|
5612
5608
|
return t;
|
|
5613
5609
|
}
|
|
5614
|
-
}, Q = class
|
|
5610
|
+
}, Q = class nn {
|
|
5615
5611
|
options;
|
|
5616
5612
|
renderer;
|
|
5617
5613
|
textRenderer;
|
|
5618
5614
|
constructor(e) {
|
|
5619
|
-
this.options = e || me, this.options.renderer = this.options.renderer || new yt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new
|
|
5615
|
+
this.options = e || me, this.options.renderer = this.options.renderer || new yt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Tn();
|
|
5620
5616
|
}
|
|
5621
5617
|
static parse(e, n) {
|
|
5622
|
-
return new
|
|
5618
|
+
return new nn(n).parse(e);
|
|
5623
5619
|
}
|
|
5624
5620
|
static parseInline(e, n) {
|
|
5625
|
-
return new
|
|
5621
|
+
return new nn(n).parseInline(e);
|
|
5626
5622
|
}
|
|
5627
5623
|
parse(e) {
|
|
5628
5624
|
this.renderer.parser = this;
|
|
@@ -5762,7 +5758,7 @@ ${t}</tr>
|
|
|
5762
5758
|
}
|
|
5763
5759
|
return r;
|
|
5764
5760
|
}
|
|
5765
|
-
},
|
|
5761
|
+
}, ze = class {
|
|
5766
5762
|
options;
|
|
5767
5763
|
block;
|
|
5768
5764
|
constructor(t) {
|
|
@@ -5788,17 +5784,17 @@ ${t}</tr>
|
|
|
5788
5784
|
provideParser() {
|
|
5789
5785
|
return this.block ? Q.parse : Q.parseInline;
|
|
5790
5786
|
}
|
|
5791
|
-
},
|
|
5792
|
-
defaults =
|
|
5787
|
+
}, xl = class {
|
|
5788
|
+
defaults = yn();
|
|
5793
5789
|
options = this.setOptions;
|
|
5794
5790
|
parse = this.parseMarkdown(!0);
|
|
5795
5791
|
parseInline = this.parseMarkdown(!1);
|
|
5796
5792
|
Parser = Q;
|
|
5797
5793
|
Renderer = yt;
|
|
5798
|
-
TextRenderer =
|
|
5794
|
+
TextRenderer = Tn;
|
|
5799
5795
|
Lexer = N;
|
|
5800
5796
|
Tokenizer = bt;
|
|
5801
|
-
Hooks =
|
|
5797
|
+
Hooks = ze;
|
|
5802
5798
|
constructor(...t) {
|
|
5803
5799
|
this.use(...t);
|
|
5804
5800
|
}
|
|
@@ -5872,13 +5868,13 @@ ${t}</tr>
|
|
|
5872
5868
|
r.tokenizer = i;
|
|
5873
5869
|
}
|
|
5874
5870
|
if (n.hooks) {
|
|
5875
|
-
let i = this.defaults.hooks || new
|
|
5871
|
+
let i = this.defaults.hooks || new ze();
|
|
5876
5872
|
for (let s in n.hooks) {
|
|
5877
5873
|
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
5878
5874
|
if (["options", "block"].includes(s)) continue;
|
|
5879
5875
|
let o = s, l = n.hooks[o], a = i[o];
|
|
5880
|
-
|
|
5881
|
-
if (this.defaults.async &&
|
|
5876
|
+
ze.passThroughHooks.has(s) ? i[o] = (u) => {
|
|
5877
|
+
if (this.defaults.async && ze.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
5882
5878
|
let c = await l.call(i, u);
|
|
5883
5879
|
return a.call(i, c);
|
|
5884
5880
|
})();
|
|
@@ -5941,24 +5937,24 @@ ${t}</tr>
|
|
|
5941
5937
|
return (n) => {
|
|
5942
5938
|
if (n.message += `
|
|
5943
5939
|
Please report this to https://github.com/markedjs/marked.`, t) {
|
|
5944
|
-
let r = "<p>An error occurred:</p><pre>" +
|
|
5940
|
+
let r = "<p>An error occurred:</p><pre>" + G(n.message + "", !0) + "</pre>";
|
|
5945
5941
|
return e ? Promise.resolve(r) : r;
|
|
5946
5942
|
}
|
|
5947
5943
|
if (e) return Promise.reject(n);
|
|
5948
5944
|
throw n;
|
|
5949
5945
|
};
|
|
5950
5946
|
}
|
|
5951
|
-
}, pe = new
|
|
5947
|
+
}, pe = new xl();
|
|
5952
5948
|
function v(t, e) {
|
|
5953
5949
|
return pe.parse(t, e);
|
|
5954
5950
|
}
|
|
5955
5951
|
v.options = v.setOptions = function(t) {
|
|
5956
|
-
return pe.setOptions(t), v.defaults = pe.defaults,
|
|
5952
|
+
return pe.setOptions(t), v.defaults = pe.defaults, wi(v.defaults), v;
|
|
5957
5953
|
};
|
|
5958
|
-
v.getDefaults =
|
|
5954
|
+
v.getDefaults = yn;
|
|
5959
5955
|
v.defaults = me;
|
|
5960
5956
|
v.use = function(...t) {
|
|
5961
|
-
return pe.use(...t), v.defaults = pe.defaults,
|
|
5957
|
+
return pe.use(...t), v.defaults = pe.defaults, wi(v.defaults), v;
|
|
5962
5958
|
};
|
|
5963
5959
|
v.walkTokens = function(t, e) {
|
|
5964
5960
|
return pe.walkTokens(t, e);
|
|
@@ -5967,11 +5963,11 @@ v.parseInline = pe.parseInline;
|
|
|
5967
5963
|
v.Parser = Q;
|
|
5968
5964
|
v.parser = Q.parse;
|
|
5969
5965
|
v.Renderer = yt;
|
|
5970
|
-
v.TextRenderer =
|
|
5966
|
+
v.TextRenderer = Tn;
|
|
5971
5967
|
v.Lexer = N;
|
|
5972
5968
|
v.lexer = N.lex;
|
|
5973
5969
|
v.Tokenizer = bt;
|
|
5974
|
-
v.Hooks =
|
|
5970
|
+
v.Hooks = ze;
|
|
5975
5971
|
v.parse = v;
|
|
5976
5972
|
v.options;
|
|
5977
5973
|
v.setOptions;
|
|
@@ -5984,7 +5980,7 @@ v.setOptions({
|
|
|
5984
5980
|
breaks: !0,
|
|
5985
5981
|
gfm: !0
|
|
5986
5982
|
});
|
|
5987
|
-
function
|
|
5983
|
+
function bl({ text: t }) {
|
|
5988
5984
|
const e = U(() => {
|
|
5989
5985
|
if (!t)
|
|
5990
5986
|
return "";
|
|
@@ -5993,30 +5989,30 @@ function xl({ text: t }) {
|
|
|
5993
5989
|
}, [t]);
|
|
5994
5990
|
return /* @__PURE__ */ h("div", { class: "jex-md", dangerouslySetInnerHTML: { __html: e } });
|
|
5995
5991
|
}
|
|
5996
|
-
function
|
|
5992
|
+
function yl(t) {
|
|
5997
5993
|
const e = t.trim().split(/\s+/).filter(Boolean);
|
|
5998
5994
|
return e.length === 0 ? "?" : e.map((n) => n[0]).join("").slice(0, 2).toUpperCase();
|
|
5999
5995
|
}
|
|
6000
5996
|
function ye({ text: t, streaming: e, error: n, authorId: r, authorName: i, authorImage: s, botAvatarUrl: o }) {
|
|
6001
|
-
const l = !!r, [a, u] = R(!1), d =
|
|
5997
|
+
const l = !!r, [a, u] = R(!1), d = We(() => u(!0), []), c = [
|
|
6002
5998
|
"jex-message bot",
|
|
6003
5999
|
n ? "jex-message-error" : ""
|
|
6004
6000
|
].filter(Boolean).join(" ");
|
|
6005
6001
|
return /* @__PURE__ */ h("div", { class: "jex-message-row bot", children: [
|
|
6006
|
-
/* @__PURE__ */ h("div", { class: `jex-avatar ${l ? "jex-avatar-agent" : "jex-avatar-bot"}`, children: l && s && !a ? /* @__PURE__ */ h("img", { src: s, alt: i ?? "", class: "jex-avatar-img", onError: d }) : l ? /* @__PURE__ */ h("span", { class: "jex-avatar-initials", children:
|
|
6002
|
+
/* @__PURE__ */ h("div", { class: `jex-avatar ${l ? "jex-avatar-agent" : "jex-avatar-bot"}`, children: l && s && !a ? /* @__PURE__ */ h("img", { src: s, alt: i ?? "", class: "jex-avatar-img", onError: d }) : l ? /* @__PURE__ */ h("span", { class: "jex-avatar-initials", children: yl(i ?? "") }) : o && !a ? /* @__PURE__ */ h("img", { src: o, alt: "", class: "jex-avatar-img", onError: d }) : /* @__PURE__ */ h(bn, { size: 14 }) }),
|
|
6007
6003
|
/* @__PURE__ */ h("div", { class: "jex-message-content", children: [
|
|
6008
6004
|
/* @__PURE__ */ h("div", { class: c, children: [
|
|
6009
|
-
/* @__PURE__ */ h(
|
|
6005
|
+
/* @__PURE__ */ h(bl, { text: t }),
|
|
6010
6006
|
e && /* @__PURE__ */ h("span", { class: "jex-streaming-cursor" })
|
|
6011
6007
|
] }),
|
|
6012
6008
|
l && i && /* @__PURE__ */ h("span", { class: "jex-message-author", children: i })
|
|
6013
6009
|
] })
|
|
6014
6010
|
] });
|
|
6015
6011
|
}
|
|
6016
|
-
function
|
|
6012
|
+
function vl({ text: t }) {
|
|
6017
6013
|
return /* @__PURE__ */ h("div", { class: "jex-message user", children: t });
|
|
6018
6014
|
}
|
|
6019
|
-
function
|
|
6015
|
+
function _l({ message: t, sessionId: e, visitorId: n }) {
|
|
6020
6016
|
const r = P();
|
|
6021
6017
|
return t.formData ? /* @__PURE__ */ h("div", { class: "jex-inline-form-submitted", children: [
|
|
6022
6018
|
/* @__PURE__ */ h("span", { class: "jex-inline-form-check", children: "✓" }),
|
|
@@ -6029,7 +6025,7 @@ function vl({ message: t, sessionId: e, visitorId: n }) {
|
|
|
6029
6025
|
] })
|
|
6030
6026
|
] })
|
|
6031
6027
|
] }) : /* @__PURE__ */ h("div", { class: "jex-message-row bot", children: /* @__PURE__ */ h(
|
|
6032
|
-
|
|
6028
|
+
kl,
|
|
6033
6029
|
{
|
|
6034
6030
|
messageId: t._id,
|
|
6035
6031
|
sessionId: e,
|
|
@@ -6037,8 +6033,8 @@ function vl({ message: t, sessionId: e, visitorId: n }) {
|
|
|
6037
6033
|
}
|
|
6038
6034
|
) });
|
|
6039
6035
|
}
|
|
6040
|
-
function
|
|
6041
|
-
const r = P(), [i, s] = R(""), [o, l] = R(""), [a, u] = R(!1), d = wt(
|
|
6036
|
+
function kl({ messageId: t, sessionId: e, visitorId: n }) {
|
|
6037
|
+
const r = P(), [i, s] = R(""), [o, l] = R(""), [a, u] = R(!1), d = wt($e.functions.chat.public.helpdesk.submitEscalation);
|
|
6042
6038
|
async function c(p) {
|
|
6043
6039
|
if (p.preventDefault(), !a) {
|
|
6044
6040
|
u(!0);
|
|
@@ -6093,14 +6089,14 @@ function _l({ messageId: t, sessionId: e, visitorId: n }) {
|
|
|
6093
6089
|
/* @__PURE__ */ h("div", { class: "jex-inline-form-consent", children: r.escalationConsent })
|
|
6094
6090
|
] });
|
|
6095
6091
|
}
|
|
6096
|
-
function
|
|
6092
|
+
function wl() {
|
|
6097
6093
|
return /* @__PURE__ */ h("div", { class: "jex-typing", children: [
|
|
6098
6094
|
/* @__PURE__ */ h("span", {}),
|
|
6099
6095
|
/* @__PURE__ */ h("span", {}),
|
|
6100
6096
|
/* @__PURE__ */ h("span", {})
|
|
6101
6097
|
] });
|
|
6102
6098
|
}
|
|
6103
|
-
function
|
|
6099
|
+
function Sl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r, onStartFresh: i, sessionId: s, visitorId: o }) {
|
|
6104
6100
|
const l = P(), a = vt(null), [u, d] = R(null);
|
|
6105
6101
|
return D(() => {
|
|
6106
6102
|
a.current?.scrollIntoView({ behavior: "smooth" });
|
|
@@ -6124,7 +6120,7 @@ function wl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6124
6120
|
if (c.contentType === "human-notice")
|
|
6125
6121
|
return /* @__PURE__ */ h(ye, { text: c.content }, c._id);
|
|
6126
6122
|
if (c.contentType === "escalation-form" && s && o)
|
|
6127
|
-
return
|
|
6123
|
+
return va.value === "screen" && !c.formData ? u === c._id ? null : /* @__PURE__ */ h("div", { class: "jex-inline-form jex-inline-form-card", children: [
|
|
6128
6124
|
/* @__PURE__ */ h("div", { class: "jex-inline-form-title", children: l.escalationPromptTitle }),
|
|
6129
6125
|
/* @__PURE__ */ h("div", { class: "jex-inline-form-subtitle", children: l.escalationPromptSubtitle }),
|
|
6130
6126
|
/* @__PURE__ */ h(
|
|
@@ -6133,7 +6129,7 @@ function wl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6133
6129
|
class: "jex-form-submit",
|
|
6134
6130
|
type: "button",
|
|
6135
6131
|
onClick: () => {
|
|
6136
|
-
|
|
6132
|
+
we({ id: "escalation-form", formMessageId: c._id, sessionId: s, visitorId: o });
|
|
6137
6133
|
},
|
|
6138
6134
|
children: l.escalationPromptSubmit
|
|
6139
6135
|
}
|
|
@@ -6149,17 +6145,17 @@ function wl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6149
6145
|
children: l.escalationSkip
|
|
6150
6146
|
}
|
|
6151
6147
|
)
|
|
6152
|
-
] }, c._id) : /* @__PURE__ */ h(
|
|
6148
|
+
] }, c._id) : /* @__PURE__ */ h(_l, { message: c, sessionId: s, visitorId: o }, c._id);
|
|
6153
6149
|
if (c.contentType === "escalation-confirm")
|
|
6154
6150
|
return /* @__PURE__ */ h(ye, { text: c.content }, c._id);
|
|
6155
6151
|
if (c.role === "user")
|
|
6156
|
-
return /* @__PURE__ */ h(
|
|
6152
|
+
return /* @__PURE__ */ h(vl, { text: c.content }, c._id);
|
|
6157
6153
|
const p = {
|
|
6158
6154
|
authorId: c.authorId,
|
|
6159
6155
|
authorName: c.authorName,
|
|
6160
6156
|
authorImage: c.authorImage
|
|
6161
6157
|
};
|
|
6162
|
-
return c.status === "streaming" && c.content === "" ? /* @__PURE__ */ h(
|
|
6158
|
+
return c.status === "streaming" && c.content === "" ? /* @__PURE__ */ h(wl, {}, c._id) : c.status === "streaming" ? /* @__PURE__ */ h(ye, { text: c.content, streaming: !0, ...p }, c._id) : c.status === "error" ? /* @__PURE__ */ h(
|
|
6163
6159
|
ye,
|
|
6164
6160
|
{
|
|
6165
6161
|
text: c.errorMessage ?? `${l.somethingWentWrong}. ${l.tryAgain}.`,
|
|
@@ -6172,14 +6168,14 @@ function wl({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6172
6168
|
/* @__PURE__ */ h("div", { ref: a })
|
|
6173
6169
|
] });
|
|
6174
6170
|
}
|
|
6175
|
-
function
|
|
6171
|
+
function jl({ size: t = 18 }) {
|
|
6176
6172
|
return /* @__PURE__ */ h("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
6177
6173
|
/* @__PURE__ */ h("path", { d: "M22 2 11 13" }),
|
|
6178
6174
|
/* @__PURE__ */ h("path", { d: "M22 2 15 22 11 13 2 9l20-7z" })
|
|
6179
6175
|
] });
|
|
6180
6176
|
}
|
|
6181
|
-
function
|
|
6182
|
-
const l = P(), a = ke(""), u = wt(
|
|
6177
|
+
function Cl({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionStatus: i, ensureSession: s, onStartFresh: o }) {
|
|
6178
|
+
const l = P(), a = ke(""), u = wt($e.functions.chat.public.conversations.send), d = n || r;
|
|
6183
6179
|
if (i === "resolved")
|
|
6184
6180
|
return /* @__PURE__ */ h("div", { class: "jex-chat-input-resolved", children: [
|
|
6185
6181
|
/* @__PURE__ */ h("div", { class: "jex-resolved-notice", children: l.sessionResolved }),
|
|
@@ -6200,7 +6196,7 @@ function jl({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionS
|
|
|
6200
6196
|
if (!p || d)
|
|
6201
6197
|
return;
|
|
6202
6198
|
const f = t && e ? { sessionId: t, visitorId: e } : await s();
|
|
6203
|
-
f && (
|
|
6199
|
+
f && (ba(), a.value = "", u({
|
|
6204
6200
|
sessionId: f.sessionId,
|
|
6205
6201
|
visitorId: f.visitorId,
|
|
6206
6202
|
content: p
|
|
@@ -6232,30 +6228,30 @@ function jl({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionS
|
|
|
6232
6228
|
onClick: c,
|
|
6233
6229
|
"aria-label": l.sendAriaLabel,
|
|
6234
6230
|
disabled: d,
|
|
6235
|
-
children: /* @__PURE__ */ h(
|
|
6231
|
+
children: /* @__PURE__ */ h(jl, { size: 18 })
|
|
6236
6232
|
}
|
|
6237
6233
|
)
|
|
6238
6234
|
] });
|
|
6239
6235
|
}
|
|
6240
|
-
function
|
|
6236
|
+
function qi({ message: t }) {
|
|
6241
6237
|
return /* @__PURE__ */ h("div", { class: "jex-overlay jex-loading", children: [
|
|
6242
6238
|
/* @__PURE__ */ h("div", { class: "jex-loading-spinner", "aria-hidden": "true" }),
|
|
6243
6239
|
t && /* @__PURE__ */ h("p", { class: "jex-loading-message", children: t })
|
|
6244
6240
|
] });
|
|
6245
6241
|
}
|
|
6246
|
-
function
|
|
6247
|
-
const n = P(), { sessionId: r, visitorId: i, isLoading: s, sessionNotFound: o, resumeFailed: l, isOrgDeleted: a, ensureSession: u, startFresh: d } =
|
|
6248
|
-
|
|
6242
|
+
function Tl({ greeting: t, orgSlug: e }) {
|
|
6243
|
+
const n = P(), { sessionId: r, visitorId: i, isLoading: s, sessionNotFound: o, resumeFailed: l, isOrgDeleted: a, ensureSession: u, startFresh: d } = Aa(e), c = lr(
|
|
6244
|
+
$e.functions.chat.public.conversations.listBySession,
|
|
6249
6245
|
r && i ? { sessionId: r, visitorId: i } : "skip"
|
|
6250
|
-
), p =
|
|
6251
|
-
|
|
6246
|
+
), p = lr(
|
|
6247
|
+
$e.functions.chat.public.sessions.getSessionStatus,
|
|
6252
6248
|
r && i ? { sessionId: r, visitorId: i } : "skip"
|
|
6253
6249
|
), f = r !== null && c === void 0, g = c?.some((b) => b.status === "streaming") ?? !1;
|
|
6254
6250
|
return D(() => {
|
|
6255
6251
|
fe.value && !r && u();
|
|
6256
|
-
}, [u, r]), a ? /* @__PURE__ */ h("div", { class: "jex-chat-messages", children: /* @__PURE__ */ h("div", { class: "jex-session-notice", children: n.chatNoLongerAvailable }) }) : s || f && fe.value ? /* @__PURE__ */ h(
|
|
6252
|
+
}, [u, r]), a ? /* @__PURE__ */ h("div", { class: "jex-chat-messages", children: /* @__PURE__ */ h("div", { class: "jex-session-notice", children: n.chatNoLongerAvailable }) }) : s || f && fe.value ? /* @__PURE__ */ h(qi, { message: n.resumeConversation }) : /* @__PURE__ */ h(F, { children: [
|
|
6257
6253
|
/* @__PURE__ */ h(
|
|
6258
|
-
|
|
6254
|
+
Sl,
|
|
6259
6255
|
{
|
|
6260
6256
|
conversations: c,
|
|
6261
6257
|
greeting: t,
|
|
@@ -6267,7 +6263,7 @@ function Cl({ greeting: t, orgSlug: e }) {
|
|
|
6267
6263
|
}
|
|
6268
6264
|
),
|
|
6269
6265
|
/* @__PURE__ */ h(
|
|
6270
|
-
|
|
6266
|
+
Cl,
|
|
6271
6267
|
{
|
|
6272
6268
|
sessionId: r,
|
|
6273
6269
|
visitorId: i,
|
|
@@ -6280,10 +6276,10 @@ function Cl({ greeting: t, orgSlug: e }) {
|
|
|
6280
6276
|
)
|
|
6281
6277
|
] });
|
|
6282
6278
|
}
|
|
6283
|
-
function
|
|
6284
|
-
const r = P(), [i, s] = R(""), [o, l] = R(""), a = wt(
|
|
6279
|
+
function Rl({ formMessageId: t, sessionId: e, visitorId: n }) {
|
|
6280
|
+
const r = P(), [i, s] = R(""), [o, l] = R(""), a = wt($e.functions.chat.public.helpdesk.submitEscalation);
|
|
6285
6281
|
async function u(d) {
|
|
6286
|
-
d.preventDefault(),
|
|
6282
|
+
d.preventDefault(), Se({ id: "loading", message: r.escalationSubmitting });
|
|
6287
6283
|
try {
|
|
6288
6284
|
const c = await a({
|
|
6289
6285
|
sessionId: e,
|
|
@@ -6292,9 +6288,9 @@ function Tl({ formMessageId: t, sessionId: e, visitorId: n }) {
|
|
|
6292
6288
|
visitorName: i.trim(),
|
|
6293
6289
|
visitorEmail: o.trim()
|
|
6294
6290
|
});
|
|
6295
|
-
|
|
6291
|
+
Se({ id: "confirmation", ref: c.ticketRef });
|
|
6296
6292
|
} catch (c) {
|
|
6297
|
-
console.error("[EscalationFormScreen] Submit failed:", c),
|
|
6293
|
+
console.error("[EscalationFormScreen] Submit failed:", c), Se({ id: "error", message: r.escalationSubmitFailed });
|
|
6298
6294
|
}
|
|
6299
6295
|
}
|
|
6300
6296
|
return /* @__PURE__ */ h("div", { class: "jex-form-screen", children: [
|
|
@@ -6333,18 +6329,18 @@ function Tl({ formMessageId: t, sessionId: e, visitorId: n }) {
|
|
|
6333
6329
|
] }),
|
|
6334
6330
|
/* @__PURE__ */ h("div", { class: "jex-inline-form-consent", style: { textAlign: "center", margin: "16px 0 8px 0" }, children: r.escalationConsent }),
|
|
6335
6331
|
/* @__PURE__ */ h("button", { class: "jex-escalation-skip", type: "button", onClick: () => {
|
|
6336
|
-
|
|
6332
|
+
xn();
|
|
6337
6333
|
}, children: r.escalationSkip })
|
|
6338
6334
|
] });
|
|
6339
6335
|
}
|
|
6340
|
-
function
|
|
6336
|
+
function $l() {
|
|
6341
6337
|
const t = P(), [e, n] = R(""), [r, i] = R(""), [s, o] = R("");
|
|
6342
6338
|
async function l(a) {
|
|
6343
|
-
a.preventDefault(),
|
|
6339
|
+
a.preventDefault(), Se({ id: "loading", message: t.submittingTicket }), await new Promise((d) => {
|
|
6344
6340
|
setTimeout(d, 1200);
|
|
6345
6341
|
});
|
|
6346
6342
|
const u = "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
|
|
6347
|
-
|
|
6343
|
+
Se({ id: "confirmation", ref: u });
|
|
6348
6344
|
}
|
|
6349
6345
|
return /* @__PURE__ */ h("div", { class: "jex-form-screen", children: [
|
|
6350
6346
|
/* @__PURE__ */ h("h2", { class: "jex-form-title", children: t.submitTicket }),
|
|
@@ -6393,7 +6389,7 @@ function Rl() {
|
|
|
6393
6389
|
] })
|
|
6394
6390
|
] });
|
|
6395
6391
|
}
|
|
6396
|
-
function
|
|
6392
|
+
function Al({ ticketRef: t }) {
|
|
6397
6393
|
const e = P();
|
|
6398
6394
|
return /* @__PURE__ */ h("div", { class: "jex-confirmation", children: [
|
|
6399
6395
|
/* @__PURE__ */ h("div", { class: "jex-confirmation-icon", "aria-hidden": "true", children: "✓" }),
|
|
@@ -6413,7 +6409,7 @@ function $l({ ticketRef: t }) {
|
|
|
6413
6409
|
)
|
|
6414
6410
|
] });
|
|
6415
6411
|
}
|
|
6416
|
-
function
|
|
6412
|
+
function Il({ message: t, onRetry: e, onBack: n }) {
|
|
6417
6413
|
const r = P();
|
|
6418
6414
|
return /* @__PURE__ */ h("div", { class: "jex-overlay jex-error", children: [
|
|
6419
6415
|
/* @__PURE__ */ h("p", { class: "jex-error-message", children: t }),
|
|
@@ -6423,45 +6419,45 @@ function Al({ message: t, onRetry: e, onBack: n }) {
|
|
|
6423
6419
|
] })
|
|
6424
6420
|
] });
|
|
6425
6421
|
}
|
|
6426
|
-
function
|
|
6422
|
+
function br({ greeting: t, title: e, orgSlug: n }) {
|
|
6427
6423
|
const r = B.value, i = r[r.length - 1], s = r.findLast(
|
|
6428
6424
|
(o) => o.id === "confirmation"
|
|
6429
6425
|
);
|
|
6430
6426
|
return /* @__PURE__ */ h("div", { class: "jex-screen-container", children: [
|
|
6431
|
-
i.id === "home" && /* @__PURE__ */ h(
|
|
6432
|
-
i.id === "selection" && /* @__PURE__ */ h(
|
|
6433
|
-
i.id === "form" && /* @__PURE__ */ h(
|
|
6427
|
+
i.id === "home" && /* @__PURE__ */ h(Ta, { greeting: t, title: e }),
|
|
6428
|
+
i.id === "selection" && /* @__PURE__ */ h(Ra, { title: e }),
|
|
6429
|
+
i.id === "form" && /* @__PURE__ */ h($l, {}),
|
|
6434
6430
|
i.id === "escalation-form" && /* @__PURE__ */ h(
|
|
6435
|
-
|
|
6431
|
+
Rl,
|
|
6436
6432
|
{
|
|
6437
6433
|
formMessageId: i.formMessageId,
|
|
6438
6434
|
sessionId: i.sessionId,
|
|
6439
6435
|
visitorId: i.visitorId
|
|
6440
6436
|
}
|
|
6441
6437
|
),
|
|
6442
|
-
i.id === "confirmation" && s && /* @__PURE__ */ h(
|
|
6443
|
-
i.id === "chat" && /* @__PURE__ */ h(
|
|
6444
|
-
i.id === "loading" && /* @__PURE__ */ h(
|
|
6438
|
+
i.id === "confirmation" && s && /* @__PURE__ */ h(Al, { ticketRef: s.ref }),
|
|
6439
|
+
i.id === "chat" && /* @__PURE__ */ h(Tl, { greeting: t, orgSlug: n }),
|
|
6440
|
+
i.id === "loading" && /* @__PURE__ */ h(qi, { message: i.message }),
|
|
6445
6441
|
i.id === "error" && /* @__PURE__ */ h(
|
|
6446
|
-
|
|
6442
|
+
Il,
|
|
6447
6443
|
{
|
|
6448
6444
|
message: i.message,
|
|
6449
|
-
onRetry: () =>
|
|
6450
|
-
onBack:
|
|
6445
|
+
onRetry: () => Se({ id: "loading" }),
|
|
6446
|
+
onBack: xn
|
|
6451
6447
|
}
|
|
6452
6448
|
)
|
|
6453
6449
|
] });
|
|
6454
6450
|
}
|
|
6455
|
-
function
|
|
6456
|
-
const e =
|
|
6457
|
-
|
|
6458
|
-
|
|
6451
|
+
function El({ options: t }) {
|
|
6452
|
+
const e = la(t.orgSlug, t.convexUrl);
|
|
6453
|
+
pa(t.parentOrigin), D(() => {
|
|
6454
|
+
ma();
|
|
6459
6455
|
}, []);
|
|
6460
|
-
const n =
|
|
6456
|
+
const n = oa(t, e);
|
|
6461
6457
|
D(() => {
|
|
6462
|
-
|
|
6458
|
+
gn.value = vi(n.locale);
|
|
6463
6459
|
}, [n.locale]);
|
|
6464
|
-
const r = n.position === "bottom-left", i = n.colorScheme === "dark" || n.colorScheme === "light" ? n.colorScheme : "", s =
|
|
6460
|
+
const r = n.position === "bottom-left", i = n.colorScheme === "dark" || n.colorScheme === "light" ? n.colorScheme : "", s = ya({
|
|
6465
6461
|
...t,
|
|
6466
6462
|
primaryColor: n.primaryColor,
|
|
6467
6463
|
accentColor: n.accentColor,
|
|
@@ -6477,17 +6473,17 @@ function Il({ options: t }) {
|
|
|
6477
6473
|
class: `jex-widget ${i}`.trim(),
|
|
6478
6474
|
style: a,
|
|
6479
6475
|
children: o ? /* @__PURE__ */ h("div", { class: "jex-embedded", children: [
|
|
6480
|
-
/* @__PURE__ */ h(
|
|
6481
|
-
/* @__PURE__ */ h(
|
|
6482
|
-
!n.hideBranding && /* @__PURE__ */ h(
|
|
6476
|
+
/* @__PURE__ */ h(ur, { title: n.title }),
|
|
6477
|
+
/* @__PURE__ */ h(br, { greeting: n.greeting, title: n.title, orgSlug: t.orgSlug }),
|
|
6478
|
+
!n.hideBranding && /* @__PURE__ */ h(hr, {})
|
|
6483
6479
|
] }) : /* @__PURE__ */ h("div", { class: `jex-container${r ? " jex-pos-left" : ""}`, children: [
|
|
6484
6480
|
A.value && /* @__PURE__ */ h("div", { class: "jex-chat-window", children: [
|
|
6485
|
-
/* @__PURE__ */ h(
|
|
6486
|
-
/* @__PURE__ */ h(
|
|
6487
|
-
!n.hideBranding && /* @__PURE__ */ h(
|
|
6481
|
+
/* @__PURE__ */ h(ur, { title: n.title }),
|
|
6482
|
+
/* @__PURE__ */ h(br, { greeting: n.greeting, title: n.title, orgSlug: t.orgSlug }),
|
|
6483
|
+
!n.hideBranding && /* @__PURE__ */ h(hr, {})
|
|
6488
6484
|
] }),
|
|
6489
6485
|
/* @__PURE__ */ h(
|
|
6490
|
-
|
|
6486
|
+
Ca,
|
|
6491
6487
|
{
|
|
6492
6488
|
iconOption: n.triggerIcon,
|
|
6493
6489
|
radius: n.triggerRadius,
|
|
@@ -6498,34 +6494,34 @@ function Il({ options: t }) {
|
|
|
6498
6494
|
}
|
|
6499
6495
|
);
|
|
6500
6496
|
}
|
|
6501
|
-
const El = '.jex-widget{--jex-primary: #115A62;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-radius: .75rem;--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;--jex-font-size: 14px;--jex-window-width: 380px;--jex-window-height: 600px;--jex-shadow: 0 16px 48px -12px rgba(13, 127, 138, .25), 0 4px 16px rgba(0, 0, 0, .08);pointer-events:auto;--jex-bg-trigger: var(--jex-primary);--jex-bg-header: var(--jex-primary);--jex-bg-msg-user: var(--jex-primary);--jex-bg-send-btn: var(--jex-primary);--jex-bg-window: rgba(255, 255, 255, .95);--jex-bg-msg-bot: #f1f5f9;--jex-bg-input: rgba(247, 253, 253, .6);--jex-text-header: #ffffff;--jex-text-msg-user: #ffffff;--jex-text-msg-bot: #0f172a;--jex-text-main: #0f172a;--jex-text-muted: #64748b;--jex-bg-avatar-agent: #d1fae5;--jex-text-avatar-agent: #065f46;--jex-border-window: rgba(226, 232, 240, .8);--jex-border-input: rgba(203, 213, 225, .8);--jex-bg-glass: var(--jex-bg-window);--jex-border-glass: var(--jex-border-window);font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}.dark .jex-widget,.jex-widget.dark{--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-avatar-agent: #064e3b;--jex-text-avatar-agent: #6ee7b7;--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light){--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}:host(.jex-mode-embedded){display:block;width:100%;height:100%}:host(.jex-mode-embedded) .jex-widget{width:100%;height:100%}.jex-embedded{display:flex;flex-direction:column;width:100%;height:100%;background:var(--jex-bg-window);border:1px solid var(--jex-border-window);overflow:hidden}.jex-embedded .jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-floating-button{height:56px;min-width:56px;padding:0;background:var(--jex-bg-trigger);color:var(--jex-text-header);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s,width .3s ease,border-radius .3s ease}.jex-floating-button.jex-has-label{min-width:110px;padding:0 20px}.jex-fab-inner{display:flex;align-items:center;gap:12px}.jex-fab-label{font-size:15px;font-weight:600;white-space:nowrap}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:var(--jex-window-width);height:var(--jex-window-height);max-height:calc(100vh - 120px);background:var(--jex-bg-window);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--jex-border-window);border-radius:calc(var(--jex-radius) * 2);box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-bg-header);color:var(--jex-text-header);display:flex;align-items:center;gap:12px;flex-shrink:0}.jex-header-info h3{font-size:16px;font-weight:600;color:var(--jex-text-header);margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:var(--jex-text-header);margin:0}.jex-header-back{background:none;border:none;color:var(--jex-text-header);cursor:pointer;padding:4px;display:flex;align-items:center;opacity:.8;transition:opacity .2s;flex-shrink:0}.jex-header-back:hover{opacity:1}.jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-home{flex:1;display:flex;flex-direction:column;padding:24px;gap:20px;overflow-y:auto}.jex-home-hero{display:flex;align-items:center;gap:14px;animation:jexFadeIn .4s ease both}.jex-home-avatar{position:relative;width:48px;height:48px;border-radius:14px;background:var(--jex-primary);color:var(--jex-text-header);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 4px 12px color-mix(in srgb,var(--jex-primary) 30%,transparent)}.jex-home-status-dot{position:absolute;bottom:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:#22c55e;border:2.5px solid var(--jex-bg-window);animation:jexPulse 2s ease-in-out infinite}@keyframes jexPulse{0%,to{box-shadow:0 0 #22c55e66}50%{box-shadow:0 0 0 6px #22c55e00}}.jex-home-hero-text{display:flex;flex-direction:column;gap:2px;min-width:0}.jex-home-title{font-size:17px;font-weight:700;color:var(--jex-text-main);margin:0;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.jex-home-status{font-size:12px;font-weight:500;color:#22c55e;letter-spacing:.02em}.jex-home-greeting{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:4px 16px 16px;padding:16px 18px;font-size:14px;line-height:1.55;color:var(--jex-text-main);animation:jexFadeIn .4s .1s ease both}.jex-home-greeting p{margin:0}@keyframes jexFadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.jex-home-actions{display:flex;flex-direction:column;gap:10px;animation:jexFadeIn .4s .2s ease both}.jex-home-start-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;padding:14px 20px;font-size:15px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,transform .15s,box-shadow .2s;width:100%;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 25%,transparent)}.jex-home-start-btn:hover{background:var(--jex-primary-hover);transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 35%,transparent)}.jex-home-start-btn:active{transform:translateY(0);box-shadow:0 1px 4px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card{display:flex;flex-direction:column;gap:8px;width:100%;text-align:left;padding:16px 18px;border-radius:14px;border:1.5px solid var(--jex-primary);background:color-mix(in srgb,var(--jex-primary) 6%,var(--jex-bg-window));cursor:pointer;font-family:inherit;transition:background .2s,border-color .2s,transform .15s,box-shadow .2s;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 12%,transparent)}.jex-home-resume-card:hover{background:color-mix(in srgb,var(--jex-primary) 10%,var(--jex-bg-window));transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card:active{transform:translateY(0)}.jex-home-resume-top{display:flex;align-items:center;justify-content:space-between}.jex-home-resume-label{font-size:14px;font-weight:600;color:var(--jex-primary)}.jex-home-resume-arrow{color:var(--jex-primary);opacity:.6;transition:opacity .2s,transform .2s}.jex-home-resume-card:hover .jex-home-resume-arrow{opacity:1;transform:translate(2px)}.jex-home-resume-ref{font-family:ui-monospace,Cascadia Code,Fira Code,monospace;font-size:13px;font-weight:600;letter-spacing:.06em;color:var(--jex-text-muted)}.jex-home-new-btn{background:transparent;color:var(--jex-text-muted);border:1px solid var(--jex-border-input);border-radius:12px;padding:12px 20px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit;transition:color .2s,border-color .2s,background .2s;width:100%}.jex-home-new-btn:hover{color:var(--jex-text-main);border-color:var(--jex-text-muted);background:color-mix(in srgb,var(--jex-primary) 3%,transparent)}.jex-session-ref{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:8px;font-size:12px}.jex-session-ref-label{color:var(--jex-text-muted);font-weight:500}.jex-session-ref-code{color:var(--jex-primary);font-weight:700;font-family:ui-monospace,Cascadia Code,monospace;letter-spacing:.05em}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message-row{display:flex;align-items:flex-end;gap:8px;max-width:85%}.jex-message-row.bot{align-self:flex-start}.jex-message-content{flex:1;min-width:0}.jex-avatar{width:24px;height:24px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;margin-bottom:2px}.jex-avatar-bot{background:var(--jex-bg-msg-bot);color:var(--jex-primary)}.jex-avatar-agent{background:var(--jex-bg-avatar-agent)}.jex-avatar-img{width:100%;height:100%;border-radius:50%;object-fit:cover}.jex-avatar-initials{font-size:9px;font-weight:700;color:var(--jex-text-avatar-agent)}.jex-message-author{display:block;font-size:10px;color:var(--jex-text-muted);margin-top:2px;padding-left:4px}.jex-message{padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);color:var(--jex-text-msg-bot);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;max-width:80%;background:var(--jex-bg-msg-user);color:var(--jex-text-msg-user);border-bottom-right-radius:4px}.jex-typing{align-self:flex-start;display:flex;gap:4px;padding:12px 16px}.jex-typing span{width:8px;height:8px;border-radius:50%;background:var(--jex-text-muted);animation:jexTypingDot 1.2s infinite ease-in-out}.jex-typing span:nth-child(2){animation-delay:.2s}.jex-typing span:nth-child(3){animation-delay:.4s}@keyframes jexTypingDot{0%,80%,to{transform:scale(.8);opacity:.4}40%{transform:scale(1);opacity:1}}.jex-md{word-break:break-word;overflow-wrap:anywhere}.jex-md p{margin:0 0 8px}.jex-md p:last-child{margin-bottom:0}.jex-md strong{font-weight:600}.jex-md em{font-style:italic}.jex-md ul,.jex-md ol{margin:0 0 8px;padding-left:20px}.jex-md ul:last-child,.jex-md ol:last-child{margin-bottom:0}.jex-md ul{list-style-type:disc}.jex-md ol{list-style-type:decimal}.jex-md li{margin-bottom:2px}.jex-md li:last-child{margin-bottom:0}.jex-md a{color:var(--jex-primary);text-decoration:underline;text-underline-offset:2px}.jex-md a:hover{opacity:.8}.jex-md code{background:#00000014;padding:1px 5px;border-radius:4px;font-size:.9em;font-family:ui-monospace,Cascadia Code,Fira Code,monospace}.jex-md pre{background:#0000000f;border-radius:8px;padding:10px 12px;margin:0 0 8px;overflow-x:auto;font-size:.85em}.jex-md pre:last-child{margin-bottom:0}.jex-md pre code{background:none;padding:0;border-radius:0;font-size:inherit}.jex-md h1,.jex-md h2,.jex-md h3,.jex-md h4{font-weight:600;margin:8px 0 4px}.jex-md h1:first-child,.jex-md h2:first-child,.jex-md h3:first-child,.jex-md h4:first-child{margin-top:0}.jex-md h3{font-size:1em}.jex-md h4{font-size:.95em}.jex-md hr{border:none;border-top:1px solid var(--jex-border-window);margin:8px 0}.jex-md blockquote{border-left:3px solid var(--jex-primary);margin:0 0 8px;padding:4px 12px;color:var(--jex-text-muted)}.jex-md blockquote:last-child{margin-bottom:0}.dark .jex-md code,.jex-widget.dark .jex-md code{background:#ffffff1a}.dark .jex-md pre,.jex-widget.dark .jex-md pre{background:#ffffff14}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-md code{background:#ffffff1a}:host:not(.light) .jex-widget:not(.light) .jex-md pre{background:#ffffff14}}.jex-streaming-cursor:after{content:"◊";margin-left:2px;animation:jexBlinkCursor .8s ease-in-out infinite}@keyframes jexBlinkCursor{0%,to{opacity:1}50%{opacity:0}}.jex-session-notice{align-self:center;text-align:center;padding:8px 16px;margin:8px 0;font-size:12px;color:var(--jex-text-muted);background:var(--jex-bg-input, #f1f5f9);border-radius:8px;line-height:1.4}.jex-message-error{background:var(--jex-bg-error, #fef2f2)!important;border-color:var(--jex-border-error, #fecaca)!important;color:var(--jex-text-error, #991b1b)!important}.jex-chat-input{padding:16px;border-top:1px solid var(--jex-border-window);display:flex;gap:8px;flex-shrink:0}.jex-chat-input input{flex:1;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit;font-size:14px}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.175,.885,.32,1.275);flex-shrink:0}.jex-send-btn:hover{transform:scale(1.05);background:var(--jex-primary-hover)}.jex-send-btn:active{transform:scale(.95)}.jex-widget-footer{display:flex;align-items:center;justify-content:center;padding:8px 16px;border-top:1px solid var(--jex-border-glass);background:#00000005;flex-shrink:0}.jex-widget.dark .jex-widget-footer{background:#ffffff05}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-widget-footer{background:#ffffff05}}.jex-branding{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--jex-text-muted);font-size:11px;font-weight:500;transition:color .2s}.jex-branding:hover{color:var(--jex-text-main)}.jex-branding-icon{color:var(--jex-primary)}.jex-branding span strong{font-weight:700;color:var(--jex-text-main)}.jex-locale-select-wrapper{position:relative;display:flex;align-items:center}.jex-locale-select{appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;padding:4px 20px 4px 6px;border-radius:6px;font-family:inherit;font-size:11px;font-weight:600;color:var(--jex-text-muted);background-color:transparent;cursor:pointer;outline:none;transition:all .2s ease}.jex-locale-select option{background-color:#fff;color:#0f172a}.jex-locale-select:hover,.jex-locale-select:focus-visible{color:var(--jex-text-main);background:#0000000a}.jex-widget.dark .jex-locale-select:hover,.jex-widget.dark .jex-locale-select:focus-visible{background:#ffffff0d}.jex-widget.dark .jex-locale-select option{background-color:#0f172a;color:#f8fafc}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-locale-select:hover,:host:not(.light) .jex-widget:not(.light) .jex-locale-select:focus-visible{background:#ffffff0d}:host:not(.light) .jex-widget:not(.light) .jex-locale-select option{background-color:#0f172a;color:#f8fafc}}.jex-locale-select:focus-visible{border-color:var(--jex-primary)}.jex-locale-chevron{position:absolute;right:4px;pointer-events:none;color:var(--jex-text-muted);transition:color .2s ease}.jex-locale-select-wrapper:hover .jex-locale-chevron{color:var(--jex-text-main)}.jex-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--jex-bg-window, #fff);z-index:10;padding:24px;text-align:center}.jex-loading-spinner{width:32px;height:32px;border:3px solid var(--jex-border-input, #e2e8f0);border-top-color:var(--jex-primary, #115A62);border-radius:50%;animation:jex-spin .7s linear infinite}@keyframes jex-spin{to{transform:rotate(360deg)}}.jex-loading-message{font-size:14px;color:var(--jex-text-muted, #64748b)}.jex-error-message{font-size:14px;color:var(--jex-text-main, #334155)}.jex-error-actions{display:flex;gap:8px}.jex-error-retry,.jex-error-back{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none}.jex-error-retry{background:var(--jex-primary, #115A62);color:#fff}.jex-error-back{background:transparent;color:var(--jex-text-muted, #64748b);border:1px solid var(--jex-border-input, #e2e8f0)}.jex-selection{display:flex;flex-direction:column;gap:12px;padding:24px 16px;height:100%}.jex-selection-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 8px}.jex-selection-options{display:flex;flex-direction:column;gap:10px}.jex-selection-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:16px;border-radius:12px;border:1px solid var(--jex-border-window, #e2e8f0);background:transparent;cursor:pointer;text-align:left;transition:border-color .15s ease,background .15s ease}.jex-selection-option:hover{border-color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 5%,transparent)}.jex-selection-icon{font-size:20px}.jex-selection-label{font-size:14px;font-weight:600;color:var(--jex-text-main, #0f172a)}.jex-selection-sub{font-size:12px;color:var(--jex-text-muted, #64748b)}.jex-form-screen{display:flex;flex-direction:column;padding:20px 16px;height:100%;overflow-y:auto}.jex-form-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 16px}.jex-form{display:flex;flex-direction:column;gap:10px}.jex-form-input,.jex-form-textarea{padding:10px 12px;border-radius:8px;border:1px solid var(--jex-border-input, #e2e8f0);font-size:14px;background:transparent;color:var(--jex-text-main, #0f172a);outline:none}.jex-form-input:focus,.jex-form-textarea:focus{border-color:var(--jex-primary, #115A62)}.jex-form-textarea{min-height:80px;resize:vertical}.jex-form-submit{padding:10px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer;margin-top:4px}.jex-inline-form{display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-title{font-weight:600;font-size:15px;color:var(--jex-text-main, #0f172a);margin:0}.jex-inline-form-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.4;margin:0 0 4px}.jex-inline-form-consent{font-size:11px;color:var(--jex-text-muted, #64748b);line-height:1.3;margin-top:4px;text-align:center}.jex-inline-form .jex-form-submit:disabled{opacity:.7;cursor:not-allowed}.jex-escalation-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.45;margin:0 0 8px}.jex-escalation-skip{padding:8px 12px;border:none;background:transparent;color:var(--jex-text-muted, #64748b);font-size:13px;cursor:pointer;text-decoration:underline;text-underline-offset:2px;text-align:center}.jex-escalation-skip:hover{color:var(--jex-text-main, #0f172a)}.jex-inline-form-card{position:relative;padding:14px;gap:8px}.jex-inline-form-dismiss{position:absolute;top:10px;right:10px;width:24px;height:24px;border-radius:50%;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-window, #fff);color:var(--jex-text-muted, #64748b);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}.jex-inline-form-dismiss:hover{background:var(--jex-bg-msg-bot, #f1f5f9);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-check{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary) 15%,transparent);color:var(--jex-primary, #115A62);font-size:14px;font-weight:700;flex-shrink:0}.jex-inline-form-submitted-title{font-weight:600;font-size:var(--jex-font-size, 14px);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted-detail{font-size:12px;color:var(--jex-text-muted, #64748b);margin-top:2px}.jex-escalation-confirm{border-left:3px solid var(--jex-primary, #115A62);padding-left:8px}.jex-session-prompt{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 16px;margin:8px 0;text-align:center}.jex-session-prompt-text{font-size:13px;color:var(--jex-text-muted, #64748b)}.jex-session-prompt-btn{padding:8px 16px;border-radius:8px;border:1px solid var(--jex-primary, #115A62);background:transparent;color:var(--jex-primary, #115A62);font-size:13px;font-weight:600;cursor:pointer}.jex-session-prompt-btn:hover{background:color-mix(in srgb,var(--jex-primary) 10%,transparent)}.jex-chat-input-resolved{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 16px;border-top:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-msg-bot, #f1f5f9);text-align:center}.jex-resolved-notice{font-size:13px;font-weight:500;color:var(--jex-text-muted, #64748b)}.jex-resolved-new-btn{padding:10px 20px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;width:100%}.jex-resolved-new-btn:hover{opacity:.9}.jex-confirmation{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;height:100%;text-align:center}.jex-confirmation-icon{width:48px;height:48px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary, #115A62) 15%,transparent);color:var(--jex-primary, #115A62);font-size:22px;display:flex;align-items:center;justify-content:center}.jex-confirmation-title{font-size:18px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0}.jex-confirmation-body{font-size:13px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-ref{font-size:20px;font-weight:700;letter-spacing:.05em;color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 10%,transparent);padding:10px 20px;border-radius:10px}.jex-confirmation-hint{font-size:12px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-done{margin-top:8px;padding:10px 28px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer}.jex-home-lookup-link{background:none;border:none;font-size:12px;color:var(--jex-text-muted, #64748b);cursor:pointer;text-decoration:underline;padding:0;align-self:center}.jex-home-lookup{display:flex;gap:8px;width:100%;animation:jexFadeIn .4s .1s ease both}.jex-home-lookup-input{flex:1;padding:10px 14px;border-radius:10px;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-input);color:var(--jex-text-main);font-size:13px;font-family:ui-monospace,Cascadia Code,Fira Code,monospace;letter-spacing:.04em;outline:none;transition:border-color .2s}.jex-home-lookup-input::placeholder{font-family:inherit;letter-spacing:.04em;color:var(--jex-text-muted);opacity:.7}.jex-home-lookup-input:focus{border-color:var(--jex-primary, #115A62)}.jex-home-lookup-submit{padding:10px 16px;border-radius:10px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,opacity .2s;flex-shrink:0}.jex-home-lookup-submit:hover:not(:disabled){background:var(--jex-primary-hover)}.jex-home-lookup-submit:disabled{opacity:.4;cursor:default}';
|
|
6502
|
-
function
|
|
6497
|
+
const ql = '.jex-widget{--jex-primary: #115A62;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-radius: .75rem;--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;--jex-font-size: 14px;--jex-window-width: 380px;--jex-window-height: 600px;--jex-shadow: 0 16px 48px -12px rgba(13, 127, 138, .25), 0 4px 16px rgba(0, 0, 0, .08);pointer-events:auto;--jex-bg-trigger: var(--jex-primary);--jex-bg-header: var(--jex-primary);--jex-bg-msg-user: var(--jex-primary);--jex-bg-send-btn: var(--jex-primary);--jex-bg-window: rgba(255, 255, 255, .95);--jex-bg-msg-bot: #f1f5f9;--jex-bg-input: rgba(247, 253, 253, .6);--jex-text-header: #ffffff;--jex-text-msg-user: #ffffff;--jex-text-msg-bot: #0f172a;--jex-text-main: #0f172a;--jex-text-muted: #64748b;--jex-bg-avatar-agent: #d1fae5;--jex-text-avatar-agent: #065f46;--jex-border-window: rgba(226, 232, 240, .8);--jex-border-input: rgba(203, 213, 225, .8);--jex-bg-glass: var(--jex-bg-window);--jex-border-glass: var(--jex-border-window);font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}.dark .jex-widget,.jex-widget.dark{--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-avatar-agent: #064e3b;--jex-text-avatar-agent: #6ee7b7;--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light){--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}:host(.jex-mode-embedded){display:block;width:100%;height:100%}:host(.jex-mode-embedded) .jex-widget{width:100%;height:100%}.jex-embedded{display:flex;flex-direction:column;width:100%;height:100%;background:var(--jex-bg-window);border:1px solid var(--jex-border-window);overflow:hidden}.jex-embedded .jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-floating-button{height:56px;min-width:56px;padding:0;background:var(--jex-bg-trigger);color:var(--jex-text-header);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s,width .3s ease,border-radius .3s ease}.jex-floating-button.jex-has-label{min-width:110px;padding:0 20px}.jex-fab-inner{display:flex;align-items:center;gap:12px}.jex-fab-label{font-size:15px;font-weight:600;white-space:nowrap}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:var(--jex-window-width);height:var(--jex-window-height);max-height:calc(100vh - 120px);background:var(--jex-bg-window);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--jex-border-window);border-radius:calc(var(--jex-radius) * 2);box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-bg-header);color:var(--jex-text-header);display:flex;align-items:center;gap:12px;flex-shrink:0}.jex-header-info h3{font-size:16px;font-weight:600;color:var(--jex-text-header);margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:var(--jex-text-header);margin:0}.jex-header-back{background:none;border:none;color:var(--jex-text-header);cursor:pointer;padding:4px;display:flex;align-items:center;opacity:.8;transition:opacity .2s;flex-shrink:0}.jex-header-back:hover{opacity:1}.jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-home{flex:1;display:flex;flex-direction:column;padding:24px;gap:20px;overflow-y:auto}.jex-home-hero{display:flex;align-items:center;gap:14px;animation:jexFadeIn .4s ease both}.jex-home-avatar{position:relative;width:48px;height:48px;border-radius:14px;background:var(--jex-primary);color:var(--jex-text-header);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 4px 12px color-mix(in srgb,var(--jex-primary) 30%,transparent)}.jex-home-status-dot{position:absolute;bottom:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:#22c55e;border:2.5px solid var(--jex-bg-window);animation:jexPulse 2s ease-in-out infinite}@keyframes jexPulse{0%,to{box-shadow:0 0 #22c55e66}50%{box-shadow:0 0 0 6px #22c55e00}}.jex-home-hero-text{display:flex;flex-direction:column;gap:2px;min-width:0}.jex-home-title{font-size:17px;font-weight:700;color:var(--jex-text-main);margin:0;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.jex-home-status{font-size:12px;font-weight:500;color:#22c55e;letter-spacing:.02em}.jex-home-greeting{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:4px 16px 16px;padding:16px 18px;font-size:14px;line-height:1.55;color:var(--jex-text-main);animation:jexFadeIn .4s .1s ease both}.jex-home-greeting p{margin:0}@keyframes jexFadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.jex-home-actions{display:flex;flex-direction:column;gap:10px;animation:jexFadeIn .4s .2s ease both}.jex-home-start-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;padding:14px 20px;font-size:15px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,transform .15s,box-shadow .2s;width:100%;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 25%,transparent)}.jex-home-start-btn:hover{background:var(--jex-primary-hover);transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 35%,transparent)}.jex-home-start-btn:active{transform:translateY(0);box-shadow:0 1px 4px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card{display:flex;flex-direction:column;gap:8px;width:100%;text-align:left;padding:16px 18px;border-radius:14px;border:1.5px solid var(--jex-primary);background:color-mix(in srgb,var(--jex-primary) 6%,var(--jex-bg-window));cursor:pointer;font-family:inherit;transition:background .2s,border-color .2s,transform .15s,box-shadow .2s;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 12%,transparent)}.jex-home-resume-card:hover{background:color-mix(in srgb,var(--jex-primary) 10%,var(--jex-bg-window));transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card:active{transform:translateY(0)}.jex-home-resume-top{display:flex;align-items:center;justify-content:space-between}.jex-home-resume-label{font-size:14px;font-weight:600;color:var(--jex-primary)}.jex-home-resume-arrow{color:var(--jex-primary);opacity:.6;transition:opacity .2s,transform .2s}.jex-home-resume-card:hover .jex-home-resume-arrow{opacity:1;transform:translate(2px)}.jex-home-resume-ref{font-family:ui-monospace,Cascadia Code,Fira Code,monospace;font-size:13px;font-weight:600;letter-spacing:.06em;color:var(--jex-text-muted)}.jex-home-new-btn{background:transparent;color:var(--jex-text-muted);border:1px solid var(--jex-border-input);border-radius:12px;padding:12px 20px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit;transition:color .2s,border-color .2s,background .2s;width:100%}.jex-home-new-btn:hover{color:var(--jex-text-main);border-color:var(--jex-text-muted);background:color-mix(in srgb,var(--jex-primary) 3%,transparent)}.jex-session-ref{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:8px;font-size:12px}.jex-session-ref-label{color:var(--jex-text-muted);font-weight:500}.jex-session-ref-code{color:var(--jex-primary);font-weight:700;font-family:ui-monospace,Cascadia Code,monospace;letter-spacing:.05em}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message-row{display:flex;align-items:flex-end;gap:8px;max-width:85%}.jex-message-row.bot{align-self:flex-start}.jex-message-content{flex:1;min-width:0}.jex-avatar{width:24px;height:24px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;margin-bottom:2px}.jex-avatar-bot{background:var(--jex-bg-msg-bot);color:var(--jex-primary)}.jex-avatar-agent{background:var(--jex-bg-avatar-agent)}.jex-avatar-img{width:100%;height:100%;border-radius:50%;object-fit:cover}.jex-avatar-initials{font-size:9px;font-weight:700;color:var(--jex-text-avatar-agent)}.jex-message-author{display:block;font-size:10px;color:var(--jex-text-muted);margin-top:2px;padding-left:4px}.jex-message{padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);color:var(--jex-text-msg-bot);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;max-width:80%;background:var(--jex-bg-msg-user);color:var(--jex-text-msg-user);border-bottom-right-radius:4px}.jex-typing{align-self:flex-start;display:flex;gap:4px;padding:12px 16px}.jex-typing span{width:8px;height:8px;border-radius:50%;background:var(--jex-text-muted);animation:jexTypingDot 1.2s infinite ease-in-out}.jex-typing span:nth-child(2){animation-delay:.2s}.jex-typing span:nth-child(3){animation-delay:.4s}@keyframes jexTypingDot{0%,80%,to{transform:scale(.8);opacity:.4}40%{transform:scale(1);opacity:1}}.jex-md{word-break:break-word;overflow-wrap:anywhere}.jex-md p{margin:0 0 8px}.jex-md p:last-child{margin-bottom:0}.jex-md strong{font-weight:600}.jex-md em{font-style:italic}.jex-md ul,.jex-md ol{margin:0 0 8px;padding-left:20px}.jex-md ul:last-child,.jex-md ol:last-child{margin-bottom:0}.jex-md ul{list-style-type:disc}.jex-md ol{list-style-type:decimal}.jex-md li{margin-bottom:2px}.jex-md li:last-child{margin-bottom:0}.jex-md a{color:var(--jex-primary);text-decoration:underline;text-underline-offset:2px}.jex-md a:hover{opacity:.8}.jex-md code{background:#00000014;padding:1px 5px;border-radius:4px;font-size:.9em;font-family:ui-monospace,Cascadia Code,Fira Code,monospace}.jex-md pre{background:#0000000f;border-radius:8px;padding:10px 12px;margin:0 0 8px;overflow-x:auto;font-size:.85em}.jex-md pre:last-child{margin-bottom:0}.jex-md pre code{background:none;padding:0;border-radius:0;font-size:inherit}.jex-md h1,.jex-md h2,.jex-md h3,.jex-md h4{font-weight:600;margin:8px 0 4px}.jex-md h1:first-child,.jex-md h2:first-child,.jex-md h3:first-child,.jex-md h4:first-child{margin-top:0}.jex-md h3{font-size:1em}.jex-md h4{font-size:.95em}.jex-md hr{border:none;border-top:1px solid var(--jex-border-window);margin:8px 0}.jex-md blockquote{border-left:3px solid var(--jex-primary);margin:0 0 8px;padding:4px 12px;color:var(--jex-text-muted)}.jex-md blockquote:last-child{margin-bottom:0}.dark .jex-md code,.jex-widget.dark .jex-md code{background:#ffffff1a}.dark .jex-md pre,.jex-widget.dark .jex-md pre{background:#ffffff14}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-md code{background:#ffffff1a}:host:not(.light) .jex-widget:not(.light) .jex-md pre{background:#ffffff14}}.jex-streaming-cursor:after{content:"◊";margin-left:2px;animation:jexBlinkCursor .8s ease-in-out infinite}@keyframes jexBlinkCursor{0%,to{opacity:1}50%{opacity:0}}.jex-session-notice{align-self:center;text-align:center;padding:8px 16px;margin:8px 0;font-size:12px;color:var(--jex-text-muted);background:var(--jex-bg-input, #f1f5f9);border-radius:8px;line-height:1.4}.jex-message-error{background:var(--jex-bg-error, #fef2f2)!important;border-color:var(--jex-border-error, #fecaca)!important;color:var(--jex-text-error, #991b1b)!important}.jex-chat-input{padding:16px;border-top:1px solid var(--jex-border-window);display:flex;gap:8px;flex-shrink:0}.jex-chat-input input{flex:1;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit;font-size:14px}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.175,.885,.32,1.275);flex-shrink:0}.jex-send-btn:hover{transform:scale(1.05);background:var(--jex-primary-hover)}.jex-send-btn:active{transform:scale(.95)}.jex-widget-footer{display:flex;align-items:center;justify-content:center;padding:8px 16px;border-top:1px solid var(--jex-border-glass);background:#00000005;flex-shrink:0}.jex-widget.dark .jex-widget-footer{background:#ffffff05}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-widget-footer{background:#ffffff05}}.jex-branding{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--jex-text-muted);font-size:11px;font-weight:500;transition:color .2s}.jex-branding:hover{color:var(--jex-text-main)}.jex-branding-icon{color:var(--jex-primary)}.jex-branding span strong{font-weight:700;color:var(--jex-text-main)}.jex-locale-select-wrapper{position:relative;display:flex;align-items:center}.jex-locale-select{appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;padding:4px 20px 4px 6px;border-radius:6px;font-family:inherit;font-size:11px;font-weight:600;color:var(--jex-text-muted);background-color:transparent;cursor:pointer;outline:none;transition:all .2s ease}.jex-locale-select option{background-color:#fff;color:#0f172a}.jex-locale-select:hover,.jex-locale-select:focus-visible{color:var(--jex-text-main);background:#0000000a}.jex-widget.dark .jex-locale-select:hover,.jex-widget.dark .jex-locale-select:focus-visible{background:#ffffff0d}.jex-widget.dark .jex-locale-select option{background-color:#0f172a;color:#f8fafc}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-locale-select:hover,:host:not(.light) .jex-widget:not(.light) .jex-locale-select:focus-visible{background:#ffffff0d}:host:not(.light) .jex-widget:not(.light) .jex-locale-select option{background-color:#0f172a;color:#f8fafc}}.jex-locale-select:focus-visible{border-color:var(--jex-primary)}.jex-locale-chevron{position:absolute;right:4px;pointer-events:none;color:var(--jex-text-muted);transition:color .2s ease}.jex-locale-select-wrapper:hover .jex-locale-chevron{color:var(--jex-text-main)}.jex-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--jex-bg-window, #fff);z-index:10;padding:24px;text-align:center}.jex-loading-spinner{width:32px;height:32px;border:3px solid var(--jex-border-input, #e2e8f0);border-top-color:var(--jex-primary, #115A62);border-radius:50%;animation:jex-spin .7s linear infinite}@keyframes jex-spin{to{transform:rotate(360deg)}}.jex-loading-message{font-size:14px;color:var(--jex-text-muted, #64748b)}.jex-error-message{font-size:14px;color:var(--jex-text-main, #334155)}.jex-error-actions{display:flex;gap:8px}.jex-error-retry,.jex-error-back{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none}.jex-error-retry{background:var(--jex-primary, #115A62);color:#fff}.jex-error-back{background:transparent;color:var(--jex-text-muted, #64748b);border:1px solid var(--jex-border-input, #e2e8f0)}.jex-selection{display:flex;flex-direction:column;gap:12px;padding:24px 16px;height:100%}.jex-selection-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 8px}.jex-selection-options{display:flex;flex-direction:column;gap:10px}.jex-selection-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:16px;border-radius:12px;border:1px solid var(--jex-border-window, #e2e8f0);background:transparent;cursor:pointer;text-align:left;transition:border-color .15s ease,background .15s ease}.jex-selection-option:hover{border-color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 5%,transparent)}.jex-selection-icon{font-size:20px}.jex-selection-label{font-size:14px;font-weight:600;color:var(--jex-text-main, #0f172a)}.jex-selection-sub{font-size:12px;color:var(--jex-text-muted, #64748b)}.jex-form-screen{display:flex;flex-direction:column;padding:20px 16px;height:100%;overflow-y:auto}.jex-form-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 16px}.jex-form{display:flex;flex-direction:column;gap:10px}.jex-form-input,.jex-form-textarea{padding:10px 12px;border-radius:8px;border:1px solid var(--jex-border-input, #e2e8f0);font-size:14px;background:transparent;color:var(--jex-text-main, #0f172a);outline:none}.jex-form-input:focus,.jex-form-textarea:focus{border-color:var(--jex-primary, #115A62)}.jex-form-textarea{min-height:80px;resize:vertical}.jex-form-submit{padding:10px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer;margin-top:4px}.jex-inline-form{display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-title{font-weight:600;font-size:15px;color:var(--jex-text-main, #0f172a);margin:0}.jex-inline-form-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.4;margin:0 0 4px}.jex-inline-form-consent{font-size:11px;color:var(--jex-text-muted, #64748b);line-height:1.3;margin-top:4px;text-align:center}.jex-inline-form .jex-form-submit:disabled{opacity:.7;cursor:not-allowed}.jex-escalation-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.45;margin:0 0 8px}.jex-escalation-skip{padding:8px 12px;border:none;background:transparent;color:var(--jex-text-muted, #64748b);font-size:13px;cursor:pointer;text-decoration:underline;text-underline-offset:2px;text-align:center}.jex-escalation-skip:hover{color:var(--jex-text-main, #0f172a)}.jex-inline-form-card{position:relative;padding:14px;gap:8px}.jex-inline-form-dismiss{position:absolute;top:10px;right:10px;width:24px;height:24px;border-radius:50%;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-window, #fff);color:var(--jex-text-muted, #64748b);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}.jex-inline-form-dismiss:hover{background:var(--jex-bg-msg-bot, #f1f5f9);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-check{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary) 15%,transparent);color:var(--jex-primary, #115A62);font-size:14px;font-weight:700;flex-shrink:0}.jex-inline-form-submitted-title{font-weight:600;font-size:var(--jex-font-size, 14px);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted-detail{font-size:12px;color:var(--jex-text-muted, #64748b);margin-top:2px}.jex-escalation-confirm{border-left:3px solid var(--jex-primary, #115A62);padding-left:8px}.jex-session-prompt{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 16px;margin:8px 0;text-align:center}.jex-session-prompt-text{font-size:13px;color:var(--jex-text-muted, #64748b)}.jex-session-prompt-btn{padding:8px 16px;border-radius:8px;border:1px solid var(--jex-primary, #115A62);background:transparent;color:var(--jex-primary, #115A62);font-size:13px;font-weight:600;cursor:pointer}.jex-session-prompt-btn:hover{background:color-mix(in srgb,var(--jex-primary) 10%,transparent)}.jex-chat-input-resolved{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 16px;border-top:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-msg-bot, #f1f5f9);text-align:center}.jex-resolved-notice{font-size:13px;font-weight:500;color:var(--jex-text-muted, #64748b)}.jex-resolved-new-btn{padding:10px 20px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;width:100%}.jex-resolved-new-btn:hover{opacity:.9}.jex-confirmation{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;height:100%;text-align:center}.jex-confirmation-icon{width:48px;height:48px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary, #115A62) 15%,transparent);color:var(--jex-primary, #115A62);font-size:22px;display:flex;align-items:center;justify-content:center}.jex-confirmation-title{font-size:18px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0}.jex-confirmation-body{font-size:13px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-ref{font-size:20px;font-weight:700;letter-spacing:.05em;color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 10%,transparent);padding:10px 20px;border-radius:10px}.jex-confirmation-hint{font-size:12px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-done{margin-top:8px;padding:10px 28px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer}.jex-home-lookup-link{background:none;border:none;font-size:12px;color:var(--jex-text-muted, #64748b);cursor:pointer;text-decoration:underline;padding:0;align-self:center}.jex-home-lookup{display:flex;gap:8px;width:100%;animation:jexFadeIn .4s .1s ease both}.jex-home-lookup-input{flex:1;padding:10px 14px;border-radius:10px;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-input);color:var(--jex-text-main);font-size:13px;font-family:ui-monospace,Cascadia Code,Fira Code,monospace;letter-spacing:.04em;outline:none;transition:border-color .2s}.jex-home-lookup-input::placeholder{font-family:inherit;letter-spacing:.04em;color:var(--jex-text-muted);opacity:.7}.jex-home-lookup-input:focus{border-color:var(--jex-primary, #115A62)}.jex-home-lookup-submit{padding:10px 16px;border-radius:10px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,opacity .2s;flex-shrink:0}.jex-home-lookup-submit:hover:not(:disabled){background:var(--jex-primary-hover)}.jex-home-lookup-submit:disabled{opacity:.4;cursor:default}';
|
|
6498
|
+
function Pl(t) {
|
|
6503
6499
|
const e = document.createElement("style");
|
|
6504
|
-
e.textContent =
|
|
6500
|
+
e.textContent = ql, t.appendChild(e);
|
|
6505
6501
|
}
|
|
6506
|
-
const
|
|
6502
|
+
const Ml = "https://festive-mouse-978.eu-west-1.convex.cloud";
|
|
6507
6503
|
let Qt = null;
|
|
6508
|
-
function
|
|
6509
|
-
const e = t ??
|
|
6504
|
+
function Ll(t) {
|
|
6505
|
+
const e = t ?? Ml;
|
|
6510
6506
|
if (!e)
|
|
6511
6507
|
throw new Error("[jexity] No Convex URL — set VITE_CONVEX_URL at build time or data-convex-url on the script tag");
|
|
6512
|
-
return Qt || (Qt = new
|
|
6508
|
+
return Qt || (Qt = new Fo(ia(e))), Qt;
|
|
6513
6509
|
}
|
|
6514
|
-
function
|
|
6510
|
+
function Ol(t, e) {
|
|
6515
6511
|
const n = t.shadowRoot ?? t.attachShadow({ mode: "open" });
|
|
6516
6512
|
for (; n.firstChild; )
|
|
6517
6513
|
n.removeChild(n.firstChild);
|
|
6518
|
-
|
|
6514
|
+
Pl(n), mt.value = e.source, Xt.value = e.bootstrapToken, B.value = [{ id: "home" }], e.mode === "embedded" && (t.classList.add("jex-mode-embedded"), A.value = !0);
|
|
6519
6515
|
const r = document.createElement("div");
|
|
6520
6516
|
return e.mode === "embedded" && (r.style.cssText = "width:100%;height:100%"), n.appendChild(r), he(
|
|
6521
|
-
/* @__PURE__ */ h(
|
|
6517
|
+
/* @__PURE__ */ h(Uo, { client: Ll(e.convexUrl), children: /* @__PURE__ */ h(El, { options: e }) }),
|
|
6522
6518
|
r
|
|
6523
6519
|
), function() {
|
|
6524
|
-
he(null, r), A.value = !1,
|
|
6520
|
+
he(null, r), A.value = !1, mt.value = void 0, Xt.value = void 0, B.value = [{ id: "home" }];
|
|
6525
6521
|
};
|
|
6526
6522
|
}
|
|
6527
|
-
function
|
|
6528
|
-
const r =
|
|
6523
|
+
function Nl(t, e, n) {
|
|
6524
|
+
const r = Ol(t, e), i = /* @__PURE__ */ new Set(), s = A.subscribe((l) => {
|
|
6529
6525
|
for (const a of i)
|
|
6530
6526
|
a(l);
|
|
6531
6527
|
});
|
|
@@ -6552,17 +6548,17 @@ function Ol(t, e, n) {
|
|
|
6552
6548
|
}
|
|
6553
6549
|
};
|
|
6554
6550
|
}
|
|
6555
|
-
let
|
|
6556
|
-
function
|
|
6557
|
-
|
|
6551
|
+
let Oe = null;
|
|
6552
|
+
function Ql(t) {
|
|
6553
|
+
Oe && Oe.shutdown();
|
|
6558
6554
|
let e;
|
|
6559
6555
|
t.container ? e = typeof t.container == "string" ? document.querySelector(t.container) : t.container : (e = document.createElement("div"), e.id = "jexity-chat-widget", document.body.appendChild(e));
|
|
6560
|
-
const n =
|
|
6561
|
-
t.container || e.remove(),
|
|
6556
|
+
const n = Nl(e, t, () => {
|
|
6557
|
+
t.container || e.remove(), Oe === n && (Oe = null);
|
|
6562
6558
|
});
|
|
6563
|
-
return
|
|
6559
|
+
return Oe = n, n;
|
|
6564
6560
|
}
|
|
6565
6561
|
export {
|
|
6566
|
-
|
|
6562
|
+
Ql as JexityChat
|
|
6567
6563
|
};
|
|
6568
6564
|
//# sourceMappingURL=index.mjs.map
|