@ronak27/superwise-chatbot-package 1.0.11 → 1.0.13
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/chatbot-plugin.css +1 -0
- package/dist/react-chatbot.es.js +691 -1445
- package/dist/react-chatbot.umd.js +11 -492
- package/package.json +8 -4
- package/dist/superwise-chatbot-package.css +0 -1
package/dist/react-chatbot.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import De, { memo as Me, useState as H, useRef as
|
|
2
|
-
var ye = { exports: {} },
|
|
1
|
+
import De, { memo as Me, useState as H, useRef as A, useEffect as P, useMemo as ge, useCallback as Y } from "react";
|
|
2
|
+
var ye = { exports: {} }, ee = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -9,29 +9,29 @@ var ye = { exports: {} }, oe = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
function i
|
|
18
|
-
var
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else
|
|
24
|
-
return
|
|
25
|
-
$$typeof:
|
|
26
|
-
type:
|
|
27
|
-
key:
|
|
28
|
-
ref:
|
|
29
|
-
props:
|
|
12
|
+
var je;
|
|
13
|
+
function Fe() {
|
|
14
|
+
if (je) return ee;
|
|
15
|
+
je = 1;
|
|
16
|
+
var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
17
|
+
function a(i, n, m) {
|
|
18
|
+
var g = null;
|
|
19
|
+
if (m !== void 0 && (g = "" + m), n.key !== void 0 && (g = "" + n.key), "key" in n) {
|
|
20
|
+
m = {};
|
|
21
|
+
for (var l in n)
|
|
22
|
+
l !== "key" && (m[l] = n[l]);
|
|
23
|
+
} else m = n;
|
|
24
|
+
return n = m.ref, {
|
|
25
|
+
$$typeof: t,
|
|
26
|
+
type: i,
|
|
27
|
+
key: g,
|
|
28
|
+
ref: n !== void 0 ? n : null,
|
|
29
|
+
props: m
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return ee.Fragment = r, ee.jsx = a, ee.jsxs = a, ee;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var te = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -41,238 +41,238 @@ var se = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
function
|
|
48
|
-
if (
|
|
49
|
-
if (typeof
|
|
50
|
-
return
|
|
51
|
-
if (typeof
|
|
52
|
-
switch (
|
|
53
|
-
case
|
|
44
|
+
var He;
|
|
45
|
+
function Ze() {
|
|
46
|
+
return He || (He = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
+
function t(s) {
|
|
48
|
+
if (s == null) return null;
|
|
49
|
+
if (typeof s == "function")
|
|
50
|
+
return s.$$typeof === le ? null : s.displayName || s.name || null;
|
|
51
|
+
if (typeof s == "string") return s;
|
|
52
|
+
switch (s) {
|
|
53
|
+
case v:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case
|
|
55
|
+
case R:
|
|
56
56
|
return "Profiler";
|
|
57
|
-
case
|
|
57
|
+
case S:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case N:
|
|
60
60
|
return "Suspense";
|
|
61
|
-
case
|
|
61
|
+
case oe:
|
|
62
62
|
return "SuspenseList";
|
|
63
|
-
case
|
|
63
|
+
case ie:
|
|
64
64
|
return "Activity";
|
|
65
65
|
}
|
|
66
|
-
if (typeof
|
|
67
|
-
switch (typeof
|
|
66
|
+
if (typeof s == "object")
|
|
67
|
+
switch (typeof s.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
-
),
|
|
70
|
-
case
|
|
69
|
+
), s.$$typeof) {
|
|
70
|
+
case w:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
73
|
-
return
|
|
74
|
-
case
|
|
75
|
-
return (
|
|
76
|
-
case
|
|
77
|
-
var
|
|
78
|
-
return
|
|
79
|
-
case
|
|
80
|
-
return
|
|
81
|
-
case
|
|
82
|
-
|
|
72
|
+
case se:
|
|
73
|
+
return s.displayName || "Context";
|
|
74
|
+
case B:
|
|
75
|
+
return (s._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case ne:
|
|
77
|
+
var d = s.render;
|
|
78
|
+
return s = s.displayName, s || (s = d.displayName || d.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
79
|
+
case ae:
|
|
80
|
+
return d = s.displayName || null, d !== null ? d : t(s.type) || "Memo";
|
|
81
|
+
case J:
|
|
82
|
+
d = s._payload, s = s._init;
|
|
83
83
|
try {
|
|
84
|
-
return
|
|
84
|
+
return t(s(d));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
return "" +
|
|
90
|
+
function r(s) {
|
|
91
|
+
return "" + s;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function a(s) {
|
|
94
94
|
try {
|
|
95
|
-
|
|
96
|
-
var
|
|
95
|
+
r(s);
|
|
96
|
+
var d = !1;
|
|
97
97
|
} catch {
|
|
98
|
-
|
|
98
|
+
d = !0;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
return
|
|
104
|
-
|
|
100
|
+
if (d) {
|
|
101
|
+
d = console;
|
|
102
|
+
var b = d.error, E = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
103
|
+
return b.call(
|
|
104
|
+
d,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
107
|
-
),
|
|
106
|
+
E
|
|
107
|
+
), r(s);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
112
|
-
if (typeof
|
|
110
|
+
function i(s) {
|
|
111
|
+
if (s === v) return "<>";
|
|
112
|
+
if (typeof s == "object" && s !== null && s.$$typeof === J)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
|
-
var
|
|
116
|
-
return
|
|
115
|
+
var d = t(s);
|
|
116
|
+
return d ? "<" + d + ">" : "<...>";
|
|
117
117
|
} catch {
|
|
118
118
|
return "<...>";
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
var
|
|
123
|
-
return
|
|
121
|
+
function n() {
|
|
122
|
+
var s = M.A;
|
|
123
|
+
return s === null ? null : s.getOwner();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function m() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
128
|
+
function g(s) {
|
|
129
|
+
if ($.call(s, "key")) {
|
|
130
|
+
var d = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
131
|
+
if (d && d.isReactWarning) return !1;
|
|
132
132
|
}
|
|
133
|
-
return
|
|
133
|
+
return s.key !== void 0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
function
|
|
137
|
-
|
|
135
|
+
function l(s, d) {
|
|
136
|
+
function b() {
|
|
137
|
+
K || (K = !0, console.error(
|
|
138
138
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
-
|
|
139
|
+
d
|
|
140
140
|
));
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
142
|
+
b.isReactWarning = !0, Object.defineProperty(s, "key", {
|
|
143
|
+
get: b,
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
var
|
|
149
|
-
return
|
|
147
|
+
function p() {
|
|
148
|
+
var s = t(this.type);
|
|
149
|
+
return q[s] || (q[s] = !0, console.error(
|
|
150
150
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
-
)),
|
|
151
|
+
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
155
|
-
return
|
|
156
|
-
$$typeof:
|
|
157
|
-
type:
|
|
158
|
-
key:
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
153
|
+
function c(s, d, b, E, G, V) {
|
|
154
|
+
var L = b.ref;
|
|
155
|
+
return s = {
|
|
156
|
+
$$typeof: h,
|
|
157
|
+
type: s,
|
|
158
|
+
key: d,
|
|
159
|
+
props: b,
|
|
160
|
+
_owner: E
|
|
161
|
+
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(s, "ref", {
|
|
162
162
|
enumerable: !1,
|
|
163
|
-
get:
|
|
164
|
-
}) : Object.defineProperty(
|
|
163
|
+
get: p
|
|
164
|
+
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
writable: !0,
|
|
168
168
|
value: 0
|
|
169
|
-
}), Object.defineProperty(
|
|
169
|
+
}), Object.defineProperty(s, "_debugInfo", {
|
|
170
170
|
configurable: !1,
|
|
171
171
|
enumerable: !1,
|
|
172
172
|
writable: !0,
|
|
173
173
|
value: null
|
|
174
|
-
}), Object.defineProperty(
|
|
174
|
+
}), Object.defineProperty(s, "_debugStack", {
|
|
175
175
|
configurable: !1,
|
|
176
176
|
enumerable: !1,
|
|
177
177
|
writable: !0,
|
|
178
|
-
value:
|
|
179
|
-
}), Object.defineProperty(
|
|
178
|
+
value: G
|
|
179
|
+
}), Object.defineProperty(s, "_debugTask", {
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
184
|
-
}), Object.freeze && (Object.freeze(
|
|
183
|
+
value: V
|
|
184
|
+
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
for (
|
|
192
|
-
L
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
186
|
+
function C(s, d, b, E, G, V) {
|
|
187
|
+
var L = d.children;
|
|
188
|
+
if (L !== void 0)
|
|
189
|
+
if (E)
|
|
190
|
+
if (ce(L)) {
|
|
191
|
+
for (E = 0; E < L.length; E++)
|
|
192
|
+
j(L[E]);
|
|
193
|
+
Object.freeze && Object.freeze(L);
|
|
194
194
|
} else
|
|
195
195
|
console.error(
|
|
196
196
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
197
|
);
|
|
198
|
-
else L
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
return
|
|
198
|
+
else j(L);
|
|
199
|
+
if ($.call(d, "key")) {
|
|
200
|
+
L = t(s);
|
|
201
|
+
var I = Object.keys(d).filter(function(he) {
|
|
202
|
+
return he !== "key";
|
|
203
203
|
});
|
|
204
|
-
|
|
204
|
+
E = 0 < I.length ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}", ue[L + E] || (I = 0 < I.length ? "{" + I.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
206
|
let props = %s;
|
|
207
207
|
<%s {...props} />
|
|
208
208
|
React keys must be passed directly to JSX without using spread:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s key={someKey} {...props} />`,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
),
|
|
211
|
+
E,
|
|
212
|
+
L,
|
|
213
|
+
I,
|
|
214
|
+
L
|
|
215
|
+
), ue[L + E] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
for (var
|
|
220
|
-
|
|
221
|
-
} else
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
typeof
|
|
225
|
-
),
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
217
|
+
if (L = null, b !== void 0 && (a(b), L = "" + b), g(d) && (a(d.key), L = "" + d.key), "key" in d) {
|
|
218
|
+
b = {};
|
|
219
|
+
for (var T in d)
|
|
220
|
+
T !== "key" && (b[T] = d[T]);
|
|
221
|
+
} else b = d;
|
|
222
|
+
return L && l(
|
|
223
|
+
b,
|
|
224
|
+
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
225
|
+
), c(
|
|
226
|
+
s,
|
|
227
|
+
L,
|
|
228
|
+
b,
|
|
229
|
+
n(),
|
|
230
|
+
G,
|
|
231
|
+
V
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
234
|
+
function j(s) {
|
|
235
|
+
f(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === J && (s._payload.status === "fulfilled" ? f(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return typeof
|
|
237
|
+
function f(s) {
|
|
238
|
+
return typeof s == "object" && s !== null && s.$$typeof === h;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var u = De, h = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), B = Symbol.for("react.consumer"), se = Symbol.for("react.context"), ne = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), ae = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), ie = Symbol.for("react.activity"), le = Symbol.for("react.client.reference"), M = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, ce = Array.isArray, de = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
244
|
-
react_stack_bottom_frame: function(
|
|
245
|
-
return
|
|
243
|
+
u = {
|
|
244
|
+
react_stack_bottom_frame: function(s) {
|
|
245
|
+
return s();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
|
|
253
|
-
var
|
|
254
|
-
return
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
248
|
+
var K, q = {}, D = u.react_stack_bottom_frame.bind(
|
|
249
|
+
u,
|
|
250
|
+
m
|
|
251
|
+
)(), Q = de(i(m)), ue = {};
|
|
252
|
+
te.Fragment = v, te.jsx = function(s, d, b) {
|
|
253
|
+
var E = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return C(
|
|
255
|
+
s,
|
|
256
|
+
d,
|
|
257
|
+
b,
|
|
258
258
|
!1,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
E ? Error("react-stack-top-frame") : D,
|
|
260
|
+
E ? de(i(s)) : Q
|
|
261
261
|
);
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
262
|
+
}, te.jsxs = function(s, d, b) {
|
|
263
|
+
var E = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return C(
|
|
265
|
+
s,
|
|
266
|
+
d,
|
|
267
|
+
b,
|
|
268
268
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
E ? Error("react-stack-top-frame") : D,
|
|
270
|
+
E ? de(i(s)) : Q
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
|
-
}()),
|
|
273
|
+
}()), te;
|
|
274
274
|
}
|
|
275
|
-
process.env.NODE_ENV === "production" ? ye.exports =
|
|
275
|
+
process.env.NODE_ENV === "production" ? ye.exports = Fe() : ye.exports = Ze();
|
|
276
276
|
var e = ye.exports;
|
|
277
277
|
const Be = [
|
|
278
278
|
"Parameters:",
|
|
@@ -280,851 +280,162 @@ const Be = [
|
|
|
280
280
|
"additional_parameter_company_size:",
|
|
281
281
|
"additional_parameter_user_role:",
|
|
282
282
|
"additional_parameter_use_case:"
|
|
283
|
-
],
|
|
284
|
-
function
|
|
285
|
-
if (typeof
|
|
286
|
-
let
|
|
287
|
-
for (const
|
|
283
|
+
], re = "Apologize, I’m unable to respond at the moment. Please try asking your question again or click Contact Sales to get in touch with our team.";
|
|
284
|
+
function qe(t) {
|
|
285
|
+
if (typeof t != "string" || t.length === 0) return t;
|
|
286
|
+
let r = t;
|
|
287
|
+
for (const a of Be)
|
|
288
288
|
for (; ; ) {
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
let
|
|
294
|
-
for (let
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
|
|
298
|
-
else if (
|
|
299
|
-
|
|
289
|
+
const i = r.indexOf(a);
|
|
290
|
+
if (i === -1) break;
|
|
291
|
+
const n = r.indexOf("{", i);
|
|
292
|
+
if (n === -1) break;
|
|
293
|
+
let m = 0, g = -1;
|
|
294
|
+
for (let c = n; c < r.length; c++) {
|
|
295
|
+
const C = r[c];
|
|
296
|
+
if (C === "{")
|
|
297
|
+
m++;
|
|
298
|
+
else if (C === "}" && (m--, m === 0)) {
|
|
299
|
+
g = c;
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
if (
|
|
304
|
-
const
|
|
305
|
-
|
|
303
|
+
if (g === -1) break;
|
|
304
|
+
const l = r.slice(0, i).trim(), p = r.slice(g + 1).trim();
|
|
305
|
+
r = l + (p.length > 0 ? " " + p : "");
|
|
306
306
|
}
|
|
307
|
-
return
|
|
307
|
+
return r.includes("Parameters:") && (r = r.split("Parameters:")[0].trim()), r;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
if (typeof
|
|
311
|
-
const
|
|
312
|
-
return
|
|
309
|
+
function Ge(t) {
|
|
310
|
+
if (typeof t != "string" || t.length === 0) return t;
|
|
311
|
+
const r = t.trim();
|
|
312
|
+
return r.startsWith("Message: ") ? r.slice(9).trim() : r.startsWith("Message : ") ? r.slice(11).trim() : t;
|
|
313
313
|
}
|
|
314
|
-
async function
|
|
315
|
-
var
|
|
316
|
-
const
|
|
317
|
-
role:
|
|
318
|
-
message:
|
|
319
|
-
})) : [],
|
|
320
|
-
user_input:
|
|
321
|
-
chat_history:
|
|
322
|
-
mql_df: Array.isArray(
|
|
323
|
-
agent_id:
|
|
324
|
-
discovery_agent_id:
|
|
314
|
+
async function ze(t, r = [], a = [], i = "", n = "", m = "", g = null) {
|
|
315
|
+
var j, f, u;
|
|
316
|
+
const l = typeof m == "string" && m.trim().length > 0 ? m.trim() : "https://sage-api-ttyw-stage.superwise.ai/api/v1/", p = l.replace(/\/+$/, "").endsWith("/chat") ? l : l.replace(/\/+$/, "") + "/chat", c = Array.isArray(r) ? r.map((h) => ({
|
|
317
|
+
role: h.role,
|
|
318
|
+
message: h.content != null ? h.content : ""
|
|
319
|
+
})) : [], C = {
|
|
320
|
+
user_input: t,
|
|
321
|
+
chat_history: c,
|
|
322
|
+
mql_df: Array.isArray(a) ? a : [],
|
|
323
|
+
agent_id: i,
|
|
324
|
+
discovery_agent_id: n,
|
|
325
325
|
utm_source: "Web",
|
|
326
326
|
utm_medium: "chatbot"
|
|
327
327
|
};
|
|
328
|
-
console.log("Sending payload:",
|
|
328
|
+
console.log("Sending payload:", C);
|
|
329
329
|
try {
|
|
330
|
-
const
|
|
330
|
+
const h = await fetch(p, {
|
|
331
331
|
method: "POST",
|
|
332
332
|
headers: {
|
|
333
333
|
"Content-Type": "application/json",
|
|
334
334
|
Accept: "application/json"
|
|
335
335
|
},
|
|
336
|
-
body: JSON.stringify(
|
|
337
|
-
signal:
|
|
336
|
+
body: JSON.stringify(C),
|
|
337
|
+
signal: g ?? void 0
|
|
338
338
|
});
|
|
339
|
-
if (console.log("Response status:",
|
|
340
|
-
const
|
|
341
|
-
return console.error("API Error Response:",
|
|
339
|
+
if (console.log("Response status:", h.status), console.log("Response headers:", h.headers), !h.ok) {
|
|
340
|
+
const B = await h.text();
|
|
341
|
+
return console.error("API Error Response:", B), { reply: re, mqlDf: [], isError: !0, status: h.status };
|
|
342
342
|
}
|
|
343
|
-
const
|
|
344
|
-
console.log("API Response Data:",
|
|
345
|
-
let
|
|
346
|
-
return
|
|
347
|
-
} catch (
|
|
348
|
-
if (console.error("API call failed:",
|
|
349
|
-
throw
|
|
350
|
-
return
|
|
343
|
+
const w = await h.json();
|
|
344
|
+
console.log("API Response Data:", w);
|
|
345
|
+
let v = "⚠️ No reply from server.", S = [], R = !1;
|
|
346
|
+
return w.chat_response ? v = w.chat_response : w.success && ((j = w.data) != null && j.chat_response) ? v = w.data.chat_response : w.message && (v = w.message), w.mql_df ? S = w.mql_df : (f = w.data) != null && f.mql_df && (S = w.data.mql_df), (w.chat_history_limit_exceeded === !0 || ((u = w.data) == null ? void 0 : u.chat_history_limit_exceeded) === !0) && (R = !0), v = qe(v), v = Ge(v), { reply: v, mqlDf: S, chatHistoryLimitExceeded: R };
|
|
347
|
+
} catch (h) {
|
|
348
|
+
if (console.error("API call failed:", h), h.name === "AbortError")
|
|
349
|
+
throw h;
|
|
350
|
+
return h.name === "TypeError" && h.message.includes("fetch") ? { reply: re, mqlDf: [], isError: !0 } : { reply: re, mqlDf: [], isError: !0 };
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
async function
|
|
354
|
-
const
|
|
353
|
+
async function Ye(t, r = null, a = [], i = "") {
|
|
354
|
+
const g = (typeof i == "string" && i.trim().length > 0 ? i.trim() : "https://sage-api-ttyw-stage.superwise.ai/api/v1/").replace(/\/+$/, "").replace(/\/chat\/?$/, "").replace(/\/+$/, "") + "/pdf", l = Array.isArray(t) && t.length > 0 ? t[0] : r || {
|
|
355
355
|
name: "User",
|
|
356
356
|
email: "user@example.com",
|
|
357
357
|
summary: "Chat conversation summary"
|
|
358
|
-
},
|
|
359
|
-
role:
|
|
360
|
-
message:
|
|
361
|
-
})) : [],
|
|
362
|
-
lead_row:
|
|
363
|
-
chat_history:
|
|
358
|
+
}, p = Array.isArray(a) ? a.map((C) => ({
|
|
359
|
+
role: C.role,
|
|
360
|
+
message: C.content != null ? C.content : ""
|
|
361
|
+
})) : [], c = {
|
|
362
|
+
lead_row: l,
|
|
363
|
+
chat_history: p
|
|
364
364
|
};
|
|
365
|
-
console.log("Downloading PDF with payload:",
|
|
365
|
+
console.log("Downloading PDF with payload:", c);
|
|
366
366
|
try {
|
|
367
|
-
const
|
|
367
|
+
const C = await fetch(g, {
|
|
368
368
|
method: "POST",
|
|
369
369
|
headers: {
|
|
370
370
|
"Content-Type": "application/json",
|
|
371
371
|
Accept: "application/pdf"
|
|
372
372
|
},
|
|
373
|
-
body: JSON.stringify(
|
|
373
|
+
body: JSON.stringify(c)
|
|
374
374
|
});
|
|
375
|
-
if (console.log("PDF Response status:",
|
|
376
|
-
const
|
|
377
|
-
throw console.error("PDF API Error Response:",
|
|
375
|
+
if (console.log("PDF Response status:", C.status), !C.ok) {
|
|
376
|
+
const h = await C.text();
|
|
377
|
+
throw console.error("PDF API Error Response:", h), new Error(`PDF API Error ${C.status}: ${h}`);
|
|
378
378
|
}
|
|
379
|
-
const
|
|
380
|
-
return
|
|
381
|
-
} catch (
|
|
382
|
-
throw console.error("PDF download failed:",
|
|
379
|
+
const j = await C.blob(), f = window.URL.createObjectURL(j), u = document.createElement("a");
|
|
380
|
+
return u.href = f, u.download = `chatbot-report-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.pdf`, document.body.appendChild(u), u.click(), document.body.removeChild(u), window.URL.revokeObjectURL(f), !0;
|
|
381
|
+
} catch (C) {
|
|
382
|
+
throw console.error("PDF download failed:", C), C;
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
const g = {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
height: "75vh",
|
|
396
|
-
display: "flex",
|
|
397
|
-
flexDirection: "column",
|
|
398
|
-
borderRadius: "1rem",
|
|
399
|
-
background: "white",
|
|
400
|
-
boxShadow: "0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",
|
|
401
|
-
boxSizing: "border-box"
|
|
402
|
-
},
|
|
403
|
-
containerExpanded: {
|
|
404
|
-
position: "fixed",
|
|
405
|
-
top: "5px",
|
|
406
|
-
left: "10px",
|
|
407
|
-
right: "20px",
|
|
408
|
-
bottom: "20px",
|
|
409
|
-
zIndex: 999999,
|
|
410
|
-
fontFamily: "'Inter', sans-serif",
|
|
411
|
-
display: "flex",
|
|
412
|
-
flexDirection: "column",
|
|
413
|
-
borderRadius: "0",
|
|
414
|
-
background: "white",
|
|
415
|
-
boxShadow: "0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",
|
|
416
|
-
boxSizing: "border-box"
|
|
417
|
-
},
|
|
418
|
-
containerMinimized: {
|
|
419
|
-
position: "fixed",
|
|
420
|
-
bottom: "20px",
|
|
421
|
-
right: "20px",
|
|
422
|
-
zIndex: 999999,
|
|
423
|
-
fontFamily: "'Inter', sans-serif",
|
|
424
|
-
width: "auto",
|
|
425
|
-
minWidth: "auto",
|
|
426
|
-
maxWidth: "none",
|
|
427
|
-
height: "auto",
|
|
428
|
-
display: "flex",
|
|
429
|
-
flexDirection: "row",
|
|
430
|
-
borderRadius: "25px",
|
|
431
|
-
background: "var(--swttyw-minimized-button-color)",
|
|
432
|
-
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
|
433
|
-
boxSizing: "border-box",
|
|
434
|
-
padding: "12px 16px",
|
|
435
|
-
alignItems: "center",
|
|
436
|
-
justifyContent: "center",
|
|
437
|
-
cursor: "pointer"
|
|
438
|
-
},
|
|
439
|
-
header: {
|
|
440
|
-
position: "relative",
|
|
441
|
-
display: "flex",
|
|
442
|
-
alignItems: "center",
|
|
443
|
-
justifyContent: "space-between",
|
|
444
|
-
padding: "10px",
|
|
445
|
-
background: "var(--swttyw-primary-color)",
|
|
446
|
-
color: "#fff",
|
|
447
|
-
borderRadius: "10px 10px 0 0",
|
|
448
|
-
fontFamily: "'Inter', sans-serif",
|
|
449
|
-
flexShrink: 0,
|
|
450
|
-
boxSizing: "border-box"
|
|
451
|
-
},
|
|
452
|
-
name: {
|
|
453
|
-
fontWeight: 500,
|
|
454
|
-
fontSize: "var(--swttyw-header-font-size)",
|
|
455
|
-
color: "#fff",
|
|
456
|
-
flexGrow: 1,
|
|
457
|
-
marginBottom: "0.125rem",
|
|
458
|
-
wordBreak: "break-all"
|
|
459
|
-
},
|
|
460
|
-
headerActions: {
|
|
461
|
-
display: "flex",
|
|
462
|
-
alignItems: "center",
|
|
463
|
-
gap: "8px"
|
|
464
|
-
},
|
|
465
|
-
headerButton: {
|
|
466
|
-
background: "transparent",
|
|
467
|
-
border: "none",
|
|
468
|
-
color: "#fff",
|
|
469
|
-
cursor: "pointer",
|
|
470
|
-
padding: "4px",
|
|
471
|
-
borderRadius: "4px",
|
|
472
|
-
display: "flex",
|
|
473
|
-
alignItems: "center",
|
|
474
|
-
justifyContent: "center",
|
|
475
|
-
width: "24px",
|
|
476
|
-
height: "24px",
|
|
477
|
-
textDecoration: "none",
|
|
478
|
-
transition: "opacity 0.3s ease"
|
|
479
|
-
},
|
|
480
|
-
chatSection: {
|
|
481
|
-
padding: "1rem",
|
|
482
|
-
backgroundColor: "var(--swttyw-background-color)",
|
|
483
|
-
flexGrow: 1,
|
|
484
|
-
overflowY: "auto",
|
|
485
|
-
overflowX: "hidden",
|
|
486
|
-
display: "flex",
|
|
487
|
-
flexDirection: "column",
|
|
488
|
-
boxShadow: "inset 0 2rem 2rem -2rem rgba(0, 0, 0, 0.05), inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.05)",
|
|
489
|
-
height: "calc(50vh - 200px)"
|
|
490
|
-
},
|
|
491
|
-
inputSection: {
|
|
492
|
-
boxSizing: "border-box",
|
|
493
|
-
flexBasis: "4rem",
|
|
494
|
-
flexShrink: 0,
|
|
495
|
-
display: "flex",
|
|
496
|
-
alignItems: "center",
|
|
497
|
-
boxShadow: "0 0 1rem rgba(0, 0, 0, 0.1), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.2)",
|
|
498
|
-
margin: "0.50rem"
|
|
499
|
-
},
|
|
500
|
-
textarea: {
|
|
501
|
-
border: "none",
|
|
502
|
-
backgroundImage: "none",
|
|
503
|
-
backgroundColor: "white",
|
|
504
|
-
padding: "0.5rem 1rem",
|
|
505
|
-
marginRight: "1rem",
|
|
506
|
-
borderRadius: "10px",
|
|
507
|
-
flexGrow: 2,
|
|
508
|
-
fontFamily: "'Inter', sans-serif",
|
|
509
|
-
fontWeight: 400,
|
|
510
|
-
letterSpacing: "0.025em",
|
|
511
|
-
resize: "none",
|
|
512
|
-
fontSize: "16px",
|
|
513
|
-
outline: "none"
|
|
514
|
-
},
|
|
515
|
-
inputFooter: {
|
|
516
|
-
display: "flex",
|
|
517
|
-
flexDirection: "column",
|
|
518
|
-
justifyContent: "space-between",
|
|
519
|
-
padding: "5px"
|
|
520
|
-
},
|
|
521
|
-
sendButton: {
|
|
522
|
-
background: "transparent",
|
|
523
|
-
border: "0px",
|
|
524
|
-
cursor: "pointer",
|
|
525
|
-
display: "flex",
|
|
526
|
-
alignItems: "center",
|
|
527
|
-
justifyContent: "center",
|
|
528
|
-
color: "#000000"
|
|
529
|
-
},
|
|
530
|
-
characterCount: {
|
|
531
|
-
fontSize: "12px",
|
|
532
|
-
color: "var(--swttyw-primary-color)",
|
|
533
|
-
textAlign: "center"
|
|
534
|
-
},
|
|
535
|
-
modalOverlay: {
|
|
536
|
-
position: "absolute",
|
|
537
|
-
background: "#ffffffe8",
|
|
538
|
-
height: "calc(100% - 85px)",
|
|
539
|
-
width: "100%",
|
|
540
|
-
top: "48px",
|
|
541
|
-
display: "flex",
|
|
542
|
-
justifyContent: "center",
|
|
543
|
-
alignItems: "center"
|
|
544
|
-
},
|
|
545
|
-
modalBody: {
|
|
546
|
-
textAlign: "center"
|
|
547
|
-
},
|
|
548
|
-
modalActions: {
|
|
549
|
-
display: "flex",
|
|
550
|
-
justifyContent: "center"
|
|
551
|
-
},
|
|
552
|
-
footer: {
|
|
553
|
-
flexShrink: 0,
|
|
554
|
-
display: "flex",
|
|
555
|
-
alignItems: "center",
|
|
556
|
-
justifyContent: "center",
|
|
557
|
-
background: "var(--swttyw-primary-color)",
|
|
558
|
-
borderRadius: "0 0 10px 10px",
|
|
559
|
-
paddingBottom: "6px",
|
|
560
|
-
paddingTop: "6px",
|
|
561
|
-
marginTop: "0px",
|
|
562
|
-
color: "#f8f9fa",
|
|
563
|
-
fontSize: "var(--swttyw-footer-font-size)",
|
|
564
|
-
borderTop: "3px solid var(--swttyw-primary-color)",
|
|
565
|
-
padding: "15px 0px",
|
|
566
|
-
fontFamily: "'Inter', sans-serif"
|
|
567
|
-
},
|
|
568
|
-
message: {
|
|
569
|
-
boxSizing: "border-box",
|
|
570
|
-
padding: "0.5rem 1rem",
|
|
571
|
-
margin: "1rem",
|
|
572
|
-
background: "#FFF",
|
|
573
|
-
borderRadius: "1.125rem 1.125rem 1.125rem 0",
|
|
574
|
-
minHeight: "2.25rem",
|
|
575
|
-
width: "fit-content",
|
|
576
|
-
boxShadow: "0 0 2rem rgba(0, 0, 0, 0.075), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.1)",
|
|
577
|
-
fontSize: "15px",
|
|
578
|
-
wordBreak: "break-word",
|
|
579
|
-
fontFamily: "'Inter', sans-serif",
|
|
580
|
-
display: "table",
|
|
581
|
-
alignItems: "flex-start",
|
|
582
|
-
gap: "8px",
|
|
583
|
-
position: "relative"
|
|
584
|
-
},
|
|
585
|
-
messageSelf: {
|
|
586
|
-
margin: "1rem 1rem 1rem auto",
|
|
587
|
-
borderRadius: "1.125rem 1.125rem 0 1.125rem",
|
|
588
|
-
background: "#000000",
|
|
589
|
-
color: "white",
|
|
590
|
-
position: "relative",
|
|
591
|
-
maxWidth: "80%",
|
|
592
|
-
fontSize: "var(--swttyw-body-font-size)",
|
|
593
|
-
flexDirection: "row-reverse"
|
|
594
|
-
},
|
|
595
|
-
messageOther: {
|
|
596
|
-
position: "relative",
|
|
597
|
-
fontSize: "var(--swttyw-body-font-size)"
|
|
598
|
-
},
|
|
599
|
-
messageAvatar: {
|
|
600
|
-
width: "24px",
|
|
601
|
-
height: "24px",
|
|
602
|
-
borderRadius: "50%",
|
|
603
|
-
flexShrink: 0,
|
|
604
|
-
display: "flex",
|
|
605
|
-
alignItems: "center",
|
|
606
|
-
justifyContent: "center",
|
|
607
|
-
fontSize: "12px",
|
|
608
|
-
fontWeight: "bold",
|
|
609
|
-
position: "absolute",
|
|
610
|
-
top: "5px"
|
|
611
|
-
},
|
|
612
|
-
messageContent: {
|
|
613
|
-
flex: 1,
|
|
614
|
-
marginLeft: "32px",
|
|
615
|
-
marginRight: "8px"
|
|
616
|
-
},
|
|
617
|
-
minimizedContent: {
|
|
618
|
-
display: "flex",
|
|
619
|
-
alignItems: "center",
|
|
620
|
-
gap: "12px",
|
|
621
|
-
color: "white",
|
|
622
|
-
flex: 1
|
|
623
|
-
},
|
|
624
|
-
chatIcon: {
|
|
625
|
-
width: "20px",
|
|
626
|
-
height: "20px",
|
|
627
|
-
flexShrink: 0
|
|
385
|
+
const Je = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='190'%20height='42'%20viewBox='0%200%20190%2042'%20fill='none'%3e%3cpath%20d='M17.2253%2014.2603C17.155%2014.0259%2016.9441%2013.8618%2016.7097%2013.8618H14.6472C14.3894%2013.8618%2014.1785%2014.0259%2014.1316%2014.2603L10.7801%2027.5053C10.7332%2027.6694%2010.7801%2027.8335%2010.8739%2027.9741C10.9676%2028.1148%2011.1317%2028.1851%2011.2957%2028.1851H12.9363C13.1941%2028.1851%2013.4051%2027.9976%2013.4754%2027.7631L14.0613%2025.0673H17.3191L17.905%2027.7631C17.9519%2028.021%2018.1862%2028.1851%2018.444%2028.1851H20.0846C20.2487%2028.1851%2020.4128%2028.1148%2020.5065%2027.9741C20.6003%2027.8335%2020.6471%2027.6694%2020.6003%2027.5053L17.2488%2014.2603H17.2253ZM14.5769%2022.5824L15.655%2017.636L16.7566%2022.5824H14.5769Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M23.8359%2013.8618H22.2656C21.9609%2013.8618%2021.7266%2014.0962%2021.7266%2014.401V27.6459C21.7266%2027.9507%2021.9609%2028.1851%2022.2656%2028.1851H23.8359C24.1406%2028.1851%2024.375%2027.9507%2024.375%2027.6459V14.401C24.375%2014.0962%2024.1406%2013.8618%2023.8359%2013.8618ZM22.2891%2014.0493C22.2422%2014.0493%2022.1953%2014.0493%2022.1484%2014.0728C22.1953%2014.0728%2022.2422%2014.0493%2022.2891%2014.0493Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M36.1401%2029.4041L36.0932%2012.5256C36.0932%2011.3066%2035.4369%2010.1579%2034.3588%209.5484L19.7341%201.15601C18.6794%200.546507%2017.3669%200.546507%2016.2888%201.15601L1.71091%209.61872C0.65624%2010.2282%200%2011.3769%200%2012.5959L0.046874%2029.4744C0.046874%2030.6934%200.703114%2031.8421%201.78122%2032.4516L16.406%2040.844C17.4607%2041.4535%2018.7731%2041.4535%2019.8513%2040.844L34.4291%2032.3813C35.4838%2031.7718%2036.1401%2030.6231%2036.1401%2029.4041ZM11.9998%2031.5608C6.16397%2028.1851%204.17181%2020.7539%207.54676%2014.9167C10.8983%209.07955%2018.3513%207.08694%2024.1871%2010.4626C30.023%2013.8149%2032.0151%2021.2696%2028.6402%2027.1068C25.2887%2032.9439%2017.8357%2034.9365%2011.9998%2031.5608Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M46.3593%2014.19C46.6171%2013.9087%2046.9218%2013.6977%2047.2734%2013.557C47.6249%2013.4164%2048.0468%2013.3461%2048.5155%2013.3461C48.9843%2013.3461%2049.6171%2013.4398%2050.0858%2013.6508C50.5546%2013.8618%2050.9295%2014.1665%2051.2342%2014.5416C51.3983%2014.7526%2051.5623%2014.987%2051.6795%2015.2683C51.8202%2015.5496%2051.9139%2015.8309%2051.9608%2016.1357L55.4295%2015.0574C55.1717%2014.1431%2054.8201%2013.3695%2054.3748%2012.7131C53.9295%2012.0567%2053.3904%2011.4941%2052.7576%2011.0487C52.1952%2010.6502%2051.5623%2010.3689%2050.8358%2010.1813C50.1327%209.99379%2049.3593%209.90002%2048.5624%209.90002C47.7655%209.90002%2046.5937%2010.0407%2045.7734%2010.3454C44.9765%2010.6502%2044.2734%2011.0956%2043.7109%2011.6816C43.125%2012.2443%2042.7031%2012.9241%2042.4219%2013.7211C42.1406%2014.5182%2042%2015.4324%2042%2016.4405C42%2017.4485%2042.1641%2018.5034%2042.5156%2019.277C42.8672%2020.0506%2043.3828%2020.707%2044.0859%2021.2461C44.789%2021.7853%2045.7031%2022.2776%2046.8515%2022.6761L48.8436%2023.4028C49.5702%2023.6842%2050.1561%2023.9655%2050.5546%2024.2702C50.953%2024.5515%2051.2342%2024.8797%2051.3983%2025.2314C51.5623%2025.583%2051.6327%2026.0284%2051.6327%2026.5676C51.6327%2027.1067%2051.5858%2027.4818%2051.4686%2027.8335C51.3749%2028.1851%2051.1874%2028.4899%2050.9764%2028.7712C50.742%2029.0759%2050.4374%2029.2869%2050.0624%2029.4275C49.7108%2029.5682%2049.2889%2029.6385%2048.8202%2029.6385C48.3515%2029.6385%2047.7187%2029.5448%2047.2734%2029.3338C46.8046%2029.1228%2046.4296%2028.818%2046.1249%2028.443C45.9374%2028.232%2045.7734%2027.9976%2045.6562%2027.6928C45.5156%2027.4115%2045.4453%2027.1067%2045.3749%2026.802L41.8594%2027.7866C42.0937%2028.7008%2042.4453%2029.4979%2042.8906%2030.2011C43.3594%2030.9044%2043.8984%2031.467%2044.5546%2031.9359C45.1406%2032.311%2045.7734%2032.5923%2046.4765%2032.8032C47.1796%2033.0142%2047.953%2033.108%2048.7499%2033.108C49.5468%2033.108%2050.742%2032.9439%2051.5389%2032.6626C52.3592%2032.3578%2053.0623%2031.9124%2053.6483%2031.3029C54.1873%2030.7169%2054.6092%2030.0136%2054.9139%2029.1931C55.2185%2028.3726%2055.3592%2027.4349%2055.3592%2026.3566C55.3592%2025.2782%2055.1951%2024.2702%2054.8435%2023.4966C54.492%2022.723%2053.9764%2022.0666%2053.2498%2021.5275C52.5233%2020.9883%2051.5858%2020.496%2050.3905%2020.0506L48.4218%2019.3239C47.6952%2019.0426%2047.1327%2018.7612%2046.7577%2018.4799C46.3593%2018.1752%2046.1015%2017.8704%2045.9609%2017.5188C45.8203%2017.1672%2045.7499%2016.7686%2045.7499%2016.2998C45.7499%2015.8309%2045.7968%2015.4324%2045.914%2015.0808C46.0077%2014.7292%2046.1718%2014.4478%2046.3593%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M67.5233%2026.4504C67.5233%2027.1536%2067.4295%2027.7631%2067.242%2028.232C67.0545%2028.7008%2066.7499%2029.0525%2066.3046%2029.3103C65.8593%2029.5682%2065.2733%2029.6854%2064.5468%2029.6854C63.8202%2029.6854%2063.2109%2029.5682%2062.7656%2029.3103C62.3202%2029.0525%2062.0156%2028.7008%2061.8281%2028.232C61.6406%2027.7631%2061.5468%2027.1771%2061.5468%2026.4504V10.1579H57.8672V26.3332C57.8672%2027.6694%2058.1016%2028.8415%2058.5703%2029.8495C59.039%2030.8575%2059.7656%2031.6546%2060.75%2032.2406C61.7343%2032.8267%2063.0234%2033.108%2064.5702%2033.108C66.1171%2033.108%2067.3592%2032.8267%2068.367%2032.2406C69.3748%2031.6546%2070.1014%2030.8575%2070.5467%2029.8261C70.992%2028.7946%2071.2264%2027.6459%2071.2264%2026.3332V10.1579H67.5467V26.4504H67.5233Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M83.7186%2010.9549C82.7811%2010.4158%2081.5858%2010.1579%2080.1562%2010.1579H74.0859V32.8033H77.7656V24.9032H80.1093C81.5624%2024.9032%2082.7577%2024.6453%2083.6952%2024.1296C84.6327%2023.6138%2085.3358%2022.8168%2085.8045%2021.7385C86.2732%2020.6601%2086.5076%2019.2536%2086.5076%2017.5423C86.5076%2015.831%2086.2732%2014.4479%2085.8045%2013.3695C85.3358%2012.2912%2084.6327%2011.4941%2083.6952%2010.9549H83.7186ZM82.4999%2019.9099C82.2889%2020.4726%2081.9843%2020.8711%2081.5858%2021.1289C81.1874%2021.3868%2080.6718%2021.504%2080.0155%2021.504H77.7421V13.6274H80.0155C80.6718%2013.6274%2081.1874%2013.7446%2081.5858%2014.0025C81.9843%2014.2603%2082.2889%2014.6588%2082.4999%2015.2215C82.7108%2015.7841%2082.8046%2016.5577%2082.8046%2017.5423C82.8046%2018.5268%2082.7108%2019.3473%2082.4999%2019.9099Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M88.5938%2032.8267H99.7029V29.3807H92.2734V23.0043H98.4608V19.5817H92.2734V13.6274H99.7029V10.1813H88.5938V32.8267Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M111.797%2023.356C112.711%2022.8402%20113.437%2022.0666%20113.953%2021.0352C114.469%2020.0037%20114.726%2018.7144%20114.726%2017.1672C114.726%2015.62%20114.492%2014.2134%20114.023%2013.2054C113.555%2012.1739%20112.851%2011.4238%20111.961%2010.9315C111.047%2010.4392%20109.922%2010.2048%20108.586%2010.2048H102.023V32.8501H105.703V24.153H108.258L111.094%2032.8501H115.078L111.75%2023.4028C111.75%2023.4028%20111.797%2023.4028%20111.82%2023.3794L111.797%2023.356ZM105.68%2013.6274H108.422C108.961%2013.6274%20109.406%2013.7211%20109.805%2013.9321C110.18%2014.1431%20110.484%2014.4947%20110.695%2015.0105C110.906%2015.5028%20111%2016.2295%20111%2017.1437C111%2018.058%20110.906%2018.8081%20110.695%2019.3239C110.484%2019.8396%20110.203%2020.1912%20109.828%2020.4022C109.453%2020.6132%20109.008%2020.707%20108.469%2020.707H105.703V13.6508L105.68%2013.6274Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M132.234%2027.3412L129.047%2010.1813H125.508L122.344%2027.2474L119.086%2010.1813H115.148L120.328%2032.8267H124.148L127.289%2017.6595L130.406%2032.8267H134.226L139.382%2010.1813H135.492L132.234%2027.3412Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M144.773%2010.1813H141.094V32.8267H144.773V10.1813Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M151.851%2014.19C152.109%2013.9087%20152.414%2013.6977%20152.766%2013.557C153.117%2013.4164%20153.539%2013.3461%20154.008%2013.3461C154.476%2013.3461%20155.109%2013.4398%20155.578%2013.6508C156.047%2013.8618%20156.422%2014.1665%20156.726%2014.5416C156.89%2014.7526%20157.055%2014.987%20157.172%2015.2683C157.312%2015.5496%20157.406%2015.8309%20157.453%2016.1357L160.922%2015.0574C160.664%2014.1431%20160.312%2013.3695%20159.867%2012.7131C159.422%2012.0567%20158.883%2011.4941%20158.25%2011.0487C157.687%2010.6502%20157.055%2010.3689%20156.328%2010.1813C155.625%209.99379%20154.851%209.90002%20154.055%209.90002C153.258%209.90002%20152.086%2010.0407%20151.266%2010.3454C150.469%2010.6502%20149.766%2011.0956%20149.203%2011.6816C148.617%2012.2443%20148.195%2012.9241%20147.914%2013.7211C147.633%2014.5182%20147.492%2015.4324%20147.492%2016.4405C147.492%2017.4485%20147.656%2018.5034%20148.008%2019.277C148.359%2020.0506%20148.875%2020.707%20149.578%2021.2461C150.281%2021.7853%20151.195%2022.2776%20152.344%2022.6761L154.336%2023.4028C155.062%2023.6842%20155.648%2023.9655%20156.047%2024.2702C156.445%2024.5515%20156.726%2024.8797%20156.89%2025.2314C157.055%2025.583%20157.125%2026.0284%20157.125%2026.5676C157.125%2027.1067%20157.078%2027.4818%20156.961%2027.8335C156.867%2028.1851%20156.68%2028.4899%20156.469%2028.7712C156.234%2029.0759%20155.93%2029.2869%20155.555%2029.4275C155.203%2029.5682%20154.781%2029.6385%20154.312%2029.6385C153.844%2029.6385%20153.211%2029.5448%20152.766%2029.3338C152.297%2029.1228%20151.922%2028.818%20151.617%2028.443C151.43%2028.232%20151.266%2027.9976%20151.148%2027.6928C151.008%2027.4115%20150.914%2027.1067%20150.867%2026.802L147.352%2027.7866C147.586%2028.7008%20147.937%2029.4979%20148.383%2030.2011C148.852%2030.9044%20149.391%2031.467%20150.047%2031.9359C150.633%2032.311%20151.266%2032.5923%20151.969%2032.8032C152.672%2033.0142%20153.445%2033.108%20154.242%2033.108C155.039%2033.108%20156.234%2032.9439%20157.031%2032.6626C157.851%2032.3578%20158.555%2031.9124%20159.14%2031.3029C159.68%2030.7169%20160.101%2030.0136%20160.406%2029.1931C160.711%2028.3726%20160.851%2027.4349%20160.851%2026.3566C160.851%2025.2782%20160.687%2024.2702%20160.336%2023.4966C159.984%2022.723%20159.469%2022.0666%20158.742%2021.5275C158.015%2020.9883%20157.078%2020.496%20155.883%2020.0506L153.914%2019.3239C153.187%2019.0426%20152.625%2018.7612%20152.25%2018.4799C151.852%2018.1752%20151.594%2017.8704%20151.453%2017.5188C151.312%2017.1672%20151.242%2016.7686%20151.242%2016.2998C151.242%2015.8309%20151.289%2015.4324%20151.406%2015.0808C151.5%2014.7292%20151.664%2014.4478%20151.851%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M174.633%2013.6274V10.1813H163.5V32.8267H174.633V29.3807H167.18V23.0043H173.367V19.5817H167.18V13.6274H174.633Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M179.316%2011.0956V10.1345H183.512V11.0956H181.918V15.8075H180.91V11.0956H179.316Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M184.168%2010.1345H185.41L186.676%2013.9321L187.941%2010.1345H189.184V15.8075H188.269V11.8223L187.098%2015.1511H186.254L185.082%2011.9161V15.831H184.168V10.1579V10.1345Z'%20fill='black'%3e%3c/path%3e%3c/svg%3e", _e = "superwise-chatbot-package-css", Xe = "chatbot-plugin.css";
|
|
386
|
+
function Ke() {
|
|
387
|
+
if (typeof document > "u") return "";
|
|
388
|
+
const t = document.querySelector('script[src*="chatbot-plugin"]');
|
|
389
|
+
if (!(t != null && t.src)) return "";
|
|
390
|
+
try {
|
|
391
|
+
const r = new URL(t.src), a = r.pathname.replace(/\/[^/]*$/, "/");
|
|
392
|
+
return r.pathname = a + Xe, r.search = "", r.hash = "", r.toString();
|
|
393
|
+
} catch {
|
|
394
|
+
return "";
|
|
628
395
|
}
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
.
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
.
|
|
662
|
-
background: var(--swttyw-primary-color);\r
|
|
663
|
-
opacity: 0.9;\r
|
|
664
|
-
}\r
|
|
665
|
-
\r
|
|
666
|
-
/* Allow overflow so the wave/bounce animation is not cut off */\r
|
|
667
|
-
.sw-ttyw-chatbot .message-loading {\r
|
|
668
|
-
overflow: visible !important;\r
|
|
669
|
-
}\r
|
|
670
|
-
\r
|
|
671
|
-
/* Loading (typing) bubble: compact so it doesn't get cut at top/bottom */\r
|
|
672
|
-
.sw-ttyw-chatbot .message-loading .message-content {\r
|
|
673
|
-
min-height: 1.5rem !important;\r
|
|
674
|
-
min-width: 4.0rem !important;\r
|
|
675
|
-
display: flex !important;\r
|
|
676
|
-
align-items: center !important;\r
|
|
677
|
-
padding: 0.45rem 0 0.25rem 0.5rem !important;\r
|
|
678
|
-
overflow: visible !important;\r
|
|
679
|
-
} \r
|
|
680
|
-
\r
|
|
681
|
-
.typing {\r
|
|
682
|
-
display: inline-block !important;\r
|
|
683
|
-
width: 0.8rem !important;\r
|
|
684
|
-
height: 0.8rem !important;\r
|
|
685
|
-
min-width: 0.8rem !important;\r
|
|
686
|
-
min-height: 0.8rem !important;\r
|
|
687
|
-
max-width: 0.8rem !important;\r
|
|
688
|
-
max-height: 0.8rem !important;\r
|
|
689
|
-
margin-right: 0.5rem !important;\r
|
|
690
|
-
box-sizing: border-box !important;\r
|
|
691
|
-
background: #ccc !important;\r
|
|
692
|
-
border-radius: 50% !important;\r
|
|
693
|
-
}\r
|
|
694
|
-
\r
|
|
695
|
-
.typing.typing-1 {\r
|
|
696
|
-
-webkit-animation: typingAlt 1.4s infinite !important;\r
|
|
697
|
-
animation: typingAlt 1.4s infinite !important;\r
|
|
698
|
-
}\r
|
|
699
|
-
\r
|
|
700
|
-
.typing.typing-2 {\r
|
|
701
|
-
-webkit-animation: typingAlt 1.4s 0.2s infinite !important;\r
|
|
702
|
-
animation: typingAlt 1.4s 0.2s infinite !important;\r
|
|
703
|
-
}\r
|
|
704
|
-
\r
|
|
705
|
-
.typing.typing-3 {\r
|
|
706
|
-
-webkit-animation: typingAlt 1.4s 0.4s infinite !important;\r
|
|
707
|
-
animation: typingAlt 1.4s 0.4s infinite !important;\r
|
|
708
|
-
}\r
|
|
709
|
-
\r
|
|
710
|
-
.typing-cursor {\r
|
|
711
|
-
animation: blink 1s infinite;\r
|
|
712
|
-
color: var(--swttyw-primary-color);\r
|
|
713
|
-
font-weight: bold;\r
|
|
714
|
-
}\r
|
|
715
|
-
\r
|
|
716
|
-
@keyframes blink {\r
|
|
717
|
-
0%, 50% { opacity: 1; }\r
|
|
718
|
-
51%, 100% { opacity: 0; }\r
|
|
719
|
-
}\r
|
|
720
|
-
\r
|
|
721
|
-
/* Error message styling */\r
|
|
722
|
-
.swttyw-input-error {\r
|
|
723
|
-
background-color: #FEE8E8;\r
|
|
724
|
-
border: 1px solid #FDC2C2;\r
|
|
725
|
-
border-radius: 8px;\r
|
|
726
|
-
padding: 12px 16px;\r
|
|
727
|
-
margin: 8px 0;\r
|
|
728
|
-
display: flex;\r
|
|
729
|
-
align-items: center;\r
|
|
730
|
-
gap: 8px;\r
|
|
731
|
-
color: #E04F4F;\r
|
|
732
|
-
font-size: 14px;\r
|
|
733
|
-
line-height: 1.4;\r
|
|
734
|
-
}\r
|
|
735
|
-
\r
|
|
736
|
-
.swttyw-input-error .error-icon {\r
|
|
737
|
-
color: #F59E0B;\r
|
|
738
|
-
font-size: 16px;\r
|
|
739
|
-
flex-shrink: 0;\r
|
|
740
|
-
}\r
|
|
741
|
-
\r
|
|
742
|
-
/* Validation message in messages area */\r
|
|
743
|
-
.sw-ttyw-validation-message {\r
|
|
744
|
-
background-color: #FEE8E8;\r
|
|
745
|
-
border: 1px solid #FDC2C2;\r
|
|
746
|
-
border-radius: 8px;\r
|
|
747
|
-
padding: 12px 16px;\r
|
|
748
|
-
margin: 8px 16px;\r
|
|
749
|
-
display: flex;\r
|
|
750
|
-
align-items: center;\r
|
|
751
|
-
gap: 8px;\r
|
|
752
|
-
color: #E04F4F;\r
|
|
753
|
-
font-size: 14px;\r
|
|
754
|
-
line-height: 1.4;\r
|
|
755
|
-
animation: slideIn 0.3s ease-out;\r
|
|
756
|
-
}\r
|
|
757
|
-
\r
|
|
758
|
-
.sw-ttyw-validation-message .error-icon {\r
|
|
759
|
-
color: #F59E0B;\r
|
|
760
|
-
font-size: 16px;\r
|
|
761
|
-
flex-shrink: 0;\r
|
|
762
|
-
}\r
|
|
763
|
-
\r
|
|
764
|
-
/* Contact Sales CTA (shown on errors or >90s response delay) */\r
|
|
765
|
-
.sw-ttyw-contact-cta {\r
|
|
766
|
-
margin: 0px auto;\r
|
|
767
|
-
animation: slideIn 0.3s ease-out;\r
|
|
768
|
-
max-width: 320px;\r
|
|
769
|
-
text-align: center;\r
|
|
770
|
-
}\r
|
|
771
|
-
\r
|
|
772
|
-
.sw-ttyw-cta-button {\r
|
|
773
|
-
display: inline-flex;\r
|
|
774
|
-
align-items: center;\r
|
|
775
|
-
gap: 8px;\r
|
|
776
|
-
padding: 10px 16px;\r
|
|
777
|
-
background: var(--swttyw-primary-color, #000);\r
|
|
778
|
-
color: #fff !important;\r
|
|
779
|
-
text-decoration: none;\r
|
|
780
|
-
border-radius: 8px;\r
|
|
781
|
-
font-size: 14px;\r
|
|
782
|
-
font-weight: 500;\r
|
|
783
|
-
transition: opacity 0.2s, transform 0.2s;\r
|
|
784
|
-
}\r
|
|
785
|
-
\r
|
|
786
|
-
.sw-ttyw-cta-button:hover {\r
|
|
787
|
-
opacity: 0.9;\r
|
|
788
|
-
transform: translateY(-1px);\r
|
|
789
|
-
}\r
|
|
790
|
-
\r
|
|
791
|
-
.sw-ttyw-cta-icon {\r
|
|
792
|
-
font-size: 16px;\r
|
|
793
|
-
}\r
|
|
794
|
-
\r
|
|
795
|
-
/* Chat history limit exceeded (reference: chatbot.js swecShowChatLimitExceededMessage) */\r
|
|
796
|
-
.sw-ttyw-limit-exceeded {\r
|
|
797
|
-
margin: 8px 16px;\r
|
|
798
|
-
animation: slideIn 0.3s ease-out;\r
|
|
799
|
-
}\r
|
|
800
|
-
\r
|
|
801
|
-
.sw-ttyw-limit-exceeded-message {\r
|
|
802
|
-
background-color: #FEE8E8;\r
|
|
803
|
-
border: 1px solid #FDC2C2;\r
|
|
804
|
-
border-radius: 8px;\r
|
|
805
|
-
padding: 12px 16px;\r
|
|
806
|
-
margin-bottom: 12px;\r
|
|
807
|
-
color: #E04F4F;\r
|
|
808
|
-
font-size: 14px;\r
|
|
809
|
-
line-height: 1.4;\r
|
|
810
|
-
}\r
|
|
811
|
-
\r
|
|
812
|
-
.sw-ttyw-limit-action-buttons {\r
|
|
813
|
-
display: flex;\r
|
|
814
|
-
flex-wrap: wrap;\r
|
|
815
|
-
gap: 10px;\r
|
|
816
|
-
align-items: center;\r
|
|
817
|
-
justify-content: center;\r
|
|
818
|
-
}\r
|
|
819
|
-
\r
|
|
820
|
-
.sw-ttyw-limit-download-pdf,\r
|
|
821
|
-
.sw-ttyw-limit-clear-history {\r
|
|
822
|
-
display: inline-flex;\r
|
|
823
|
-
align-items: center;\r
|
|
824
|
-
gap: 8px;\r
|
|
825
|
-
padding: 10px 16px;\r
|
|
826
|
-
border-radius: 8px;\r
|
|
827
|
-
font-size: 14px;\r
|
|
828
|
-
font-weight: 500;\r
|
|
829
|
-
cursor: pointer;\r
|
|
830
|
-
transition: opacity 0.2s, transform 0.2s;\r
|
|
831
|
-
border: none;\r
|
|
832
|
-
}\r
|
|
833
|
-
\r
|
|
834
|
-
.sw-ttyw-limit-download-pdf {\r
|
|
835
|
-
background: var(--swttyw-primary-color, #000);\r
|
|
836
|
-
color: #fff;\r
|
|
837
|
-
}\r
|
|
838
|
-
\r
|
|
839
|
-
.sw-ttyw-limit-download-pdf:hover:not(:disabled) {\r
|
|
840
|
-
opacity: 0.9;\r
|
|
841
|
-
transform: translateY(-1px);\r
|
|
842
|
-
}\r
|
|
843
|
-
\r
|
|
844
|
-
.sw-ttyw-limit-download-pdf:disabled {\r
|
|
845
|
-
opacity: 0.6;\r
|
|
846
|
-
cursor: not-allowed;\r
|
|
847
|
-
}\r
|
|
848
|
-
\r
|
|
849
|
-
.sw-ttyw-limit-clear-history {\r
|
|
850
|
-
background: transparent;\r
|
|
851
|
-
color: var(--swttyw-primary-color, #000);\r
|
|
852
|
-
border: 1px solid var(--swttyw-primary-color, #000);\r
|
|
853
|
-
}\r
|
|
854
|
-
\r
|
|
855
|
-
.sw-ttyw-limit-clear-history:hover {\r
|
|
856
|
-
opacity: 0.9;\r
|
|
857
|
-
transform: translateY(-1px);\r
|
|
858
|
-
}\r
|
|
859
|
-
\r
|
|
860
|
-
@keyframes slideIn {\r
|
|
861
|
-
from {\r
|
|
862
|
-
opacity: 0;\r
|
|
863
|
-
transform: translateY(-10px);\r
|
|
864
|
-
}\r
|
|
865
|
-
to {\r
|
|
866
|
-
opacity: 1;\r
|
|
867
|
-
transform: translateY(0);\r
|
|
868
|
-
}\r
|
|
869
|
-
}\r
|
|
870
|
-
\r
|
|
871
|
-
@-webkit-keyframes typingAlt {\r
|
|
872
|
-
0%, 60%, 100% {\r
|
|
873
|
-
transform: translateY(0) scale(1);\r
|
|
874
|
-
opacity: 0.4;\r
|
|
875
|
-
}\r
|
|
876
|
-
30% {\r
|
|
877
|
-
transform: translateY(-10px) scale(1.2);\r
|
|
878
|
-
opacity: 1;\r
|
|
879
|
-
}\r
|
|
880
|
-
}\r
|
|
881
|
-
\r
|
|
882
|
-
@keyframes typingAlt {\r
|
|
883
|
-
0%, 60%, 100% {\r
|
|
884
|
-
transform: translateY(0) scale(1);\r
|
|
885
|
-
opacity: 0.4;\r
|
|
886
|
-
}\r
|
|
887
|
-
30% {\r
|
|
888
|
-
transform: translateY(-10px) scale(1.2);\r
|
|
889
|
-
opacity: 1;\r
|
|
890
|
-
}\r
|
|
891
|
-
}\r
|
|
892
|
-
\r
|
|
893
|
-
/* User messages: background uses primary color */\r
|
|
894
|
-
.sw-ttyw-message.self {\r
|
|
895
|
-
background: var(--swttyw-primary-color) !important;\r
|
|
896
|
-
color: white !important;\r
|
|
897
|
-
margin: 1rem 1rem 1rem auto !important;\r
|
|
898
|
-
border-radius: 1.125rem 1.125rem 0 1.125rem !important;\r
|
|
899
|
-
max-width: 80% !important;\r
|
|
900
|
-
display: table;\r
|
|
901
|
-
}\r
|
|
902
|
-
\r
|
|
903
|
-
/* Avatar positioning and color for user messages */\r
|
|
904
|
-
.sw-ttyw-message.self .message-avatar {\r
|
|
905
|
-
right: -28px !important;\r
|
|
906
|
-
left: auto !important;\r
|
|
907
|
-
color: var(--swttyw-primary-color);\r
|
|
908
|
-
}\r
|
|
909
|
-
.sw-ttyw-message.self .message-avatar svg {\r
|
|
910
|
-
fill: currentColor;\r
|
|
911
|
-
}\r
|
|
912
|
-
\r
|
|
913
|
-
/* Avatar positioning for AI messages */\r
|
|
914
|
-
.sw-ttyw-message.other .message-avatar {\r
|
|
915
|
-
left: -28px !important;\r
|
|
916
|
-
right: auto !important;\r
|
|
917
|
-
display: table;\r
|
|
918
|
-
}\r
|
|
919
|
-
\r
|
|
920
|
-
/* Ensure proper spacing for message content and wrap text */\r
|
|
921
|
-
.sw-ttyw-message .message-content {\r
|
|
922
|
-
margin-left: 0 !important;\r
|
|
923
|
-
margin-right: 0 !important;\r
|
|
924
|
-
padding-left: 0 !important;\r
|
|
925
|
-
padding-right: 0 !important;\r
|
|
926
|
-
min-width: 0;\r
|
|
927
|
-
overflow-wrap: break-word;\r
|
|
928
|
-
word-break: break-word;\r
|
|
929
|
-
overflow-x: hidden;\r
|
|
930
|
-
}\r
|
|
931
|
-
\r
|
|
932
|
-
/* Markdown in AI messages (reference: chatbot.js processMarkdown) */\r
|
|
933
|
-
.sw-ttyw-markdown h1,\r
|
|
934
|
-
.sw-ttyw-markdown h2,\r
|
|
935
|
-
.sw-ttyw-markdown h3 {\r
|
|
936
|
-
margin: 0.5em 0 0.25em;\r
|
|
937
|
-
font-weight: 600;\r
|
|
938
|
-
line-height: 1.3;\r
|
|
939
|
-
}\r
|
|
940
|
-
.sw-ttyw-markdown h1 { font-size: 1.25em; }\r
|
|
941
|
-
.sw-ttyw-markdown h2 { font-size: 1.1em; }\r
|
|
942
|
-
.sw-ttyw-markdown h3 { font-size: 1em; }\r
|
|
943
|
-
.sw-ttyw-markdown h1:first-child,\r
|
|
944
|
-
.sw-ttyw-markdown h2:first-child,\r
|
|
945
|
-
.sw-ttyw-markdown h3:first-child { margin-top: 0; }\r
|
|
946
|
-
\r
|
|
947
|
-
/* Message content: wrap text, no horizontal scroll */\r
|
|
948
|
-
.sw-ttyw-markdown {\r
|
|
949
|
-
overflow-wrap: break-word;\r
|
|
950
|
-
word-break: break-word;\r
|
|
951
|
-
overflow-x: hidden;\r
|
|
952
|
-
}\r
|
|
953
|
-
\r
|
|
954
|
-
/* Reduce space taken by <br> in responses (avoid large gaps after paragraphs) */\r
|
|
955
|
-
.sw-ttyw-markdown br {\r
|
|
956
|
-
display: block;\r
|
|
957
|
-
line-height: 0.5;\r
|
|
958
|
-
margin: 0;\r
|
|
959
|
-
padding: 0;\r
|
|
960
|
-
}\r
|
|
961
|
-
\r
|
|
962
|
-
.sw-ttyw-markdown pre,\r
|
|
963
|
-
.sw-ttyw-markdown pre.sw-ttyw-code-block {\r
|
|
964
|
-
margin: 0.5em 0;\r
|
|
965
|
-
padding: 0.75em 1em;\r
|
|
966
|
-
background: rgba(0, 0, 0, 0.06);\r
|
|
967
|
-
border-radius: 6px;\r
|
|
968
|
-
overflow-x: hidden;\r
|
|
969
|
-
white-space: pre-wrap;\r
|
|
970
|
-
word-break: break-word;\r
|
|
971
|
-
font-size: 0.9em;\r
|
|
972
|
-
line-height: 1.4;\r
|
|
973
|
-
}\r
|
|
974
|
-
.sw-ttyw-markdown code {\r
|
|
975
|
-
padding: 0.15em 0.4em;\r
|
|
976
|
-
background: rgba(0, 0, 0, 0.08);\r
|
|
977
|
-
border-radius: 4px;\r
|
|
978
|
-
font-size: 0.9em;\r
|
|
979
|
-
word-break: break-word;\r
|
|
980
|
-
}\r
|
|
981
|
-
.sw-ttyw-markdown pre code,\r
|
|
982
|
-
.sw-ttyw-markdown pre.sw-ttyw-code-block code {\r
|
|
983
|
-
padding: 0;\r
|
|
984
|
-
background: none;\r
|
|
985
|
-
white-space: pre-wrap;\r
|
|
986
|
-
word-break: break-word;\r
|
|
987
|
-
}\r
|
|
988
|
-
\r
|
|
989
|
-
.sw-ttyw-markdown ol,\r
|
|
990
|
-
.sw-ttyw-markdown ul {\r
|
|
991
|
-
margin: 0.35em 0;\r
|
|
992
|
-
padding-left: 1.25em;\r
|
|
993
|
-
}\r
|
|
994
|
-
.sw-ttyw-markdown ol {\r
|
|
995
|
-
list-style: decimal;\r
|
|
996
|
-
}\r
|
|
997
|
-
.sw-ttyw-markdown ul {\r
|
|
998
|
-
list-style: disc;\r
|
|
999
|
-
}\r
|
|
1000
|
-
.sw-ttyw-markdown ul ul {\r
|
|
1001
|
-
margin: 0.2em 0;\r
|
|
1002
|
-
padding-left: 1.25em;\r
|
|
1003
|
-
list-style: circle;\r
|
|
1004
|
-
}\r
|
|
1005
|
-
.sw-ttyw-markdown ol ul {\r
|
|
1006
|
-
margin: 0.2em 0;\r
|
|
1007
|
-
padding-left: 1.25em;\r
|
|
1008
|
-
list-style: disc;\r
|
|
1009
|
-
}\r
|
|
1010
|
-
.sw-ttyw-markdown li {\r
|
|
1011
|
-
margin: 0.15em 0;\r
|
|
1012
|
-
line-height: 1.4;\r
|
|
1013
|
-
}\r
|
|
1014
|
-
\r
|
|
1015
|
-
.sw-ttyw-markdown a {\r
|
|
1016
|
-
color: var(--swttyw-primary-color, #000);\r
|
|
1017
|
-
text-decoration: underline;\r
|
|
1018
|
-
}\r
|
|
1019
|
-
.sw-ttyw-markdown a:hover {\r
|
|
1020
|
-
opacity: 0.85;\r
|
|
1021
|
-
}\r
|
|
1022
|
-
\r
|
|
1023
|
-
/* API bracket labels e.g. [Agents], [Via the SUPERWISE dashboard] */\r
|
|
1024
|
-
.sw-ttyw-markdown .sw-ttyw-bracket-label {\r
|
|
1025
|
-
font-weight: 600;\r
|
|
1026
|
-
opacity: 0.9;\r
|
|
1027
|
-
}\r
|
|
1028
|
-
\r
|
|
1029
|
-
/* [text]...[/text] section titles e.g. Programmatic creation (SDK — Python example) */\r
|
|
1030
|
-
.sw-ttyw-markdown .sw-ttyw-text-block {\r
|
|
1031
|
-
display: block;\r
|
|
1032
|
-
font-weight: 600;\r
|
|
1033
|
-
font-size: 1.05em;\r
|
|
1034
|
-
margin: 0.75em 0 0.35em;\r
|
|
1035
|
-
line-height: 1.0;\r
|
|
1036
|
-
color: inherit;\r
|
|
1037
|
-
}\r
|
|
1038
|
-
.sw-ttyw-markdown .sw-ttyw-text-block:first-child {\r
|
|
1039
|
-
margin-top: 0;\r
|
|
1040
|
-
}\r
|
|
1041
|
-
\r
|
|
1042
|
-
/* Empty state styling */\r
|
|
1043
|
-
.sw-ttyw-empty-state {\r
|
|
1044
|
-
background-color: var(--swttyw-background-color) !important;\r
|
|
1045
|
-
transition: opacity 0.3s ease-in-out !important;\r
|
|
1046
|
-
}\r
|
|
1047
|
-
\r
|
|
1048
|
-
.sw-ttyw-empty-state:hover {\r
|
|
1049
|
-
opacity: 0.5 !important;\r
|
|
1050
|
-
}\r
|
|
1051
|
-
\r
|
|
1052
|
-
/* Messages area: vertical scroll only, scrollbar uses primary color */\r
|
|
1053
|
-
.sw-ttyw-messages {\r
|
|
1054
|
-
overflow-x: hidden;\r
|
|
1055
|
-
scrollbar-width: thin;\r
|
|
1056
|
-
scrollbar-color: var(--swttyw-primary-color) transparent;\r
|
|
1057
|
-
}\r
|
|
1058
|
-
\r
|
|
1059
|
-
/* Ensure empty state doesn't interfere with scrolling */\r
|
|
1060
|
-
.sw-ttyw-messages:has(.sw-ttyw-empty-state) {\r
|
|
1061
|
-
overflow: hidden !important;\r
|
|
1062
|
-
}\r
|
|
1063
|
-
\r
|
|
1064
|
-
.sw-ttyw-chat-footer img {\r
|
|
1065
|
-
height: 20px !important;\r
|
|
1066
|
-
}\r
|
|
1067
|
-
\r
|
|
1068
|
-
.sw-ttyw-input:disabled {\r
|
|
1069
|
-
opacity: 0.7;\r
|
|
1070
|
-
cursor: not-allowed;\r
|
|
1071
|
-
}\r
|
|
1072
|
-
\r
|
|
1073
|
-
.sw-ttyw-chatbot #sw-ttyw-chat-send-message {\r
|
|
1074
|
-
color: var(--swttyw-primary-color);\r
|
|
1075
|
-
}\r
|
|
1076
|
-
.sw-ttyw-chatbot #sw-ttyw-chat-send-message svg {\r
|
|
1077
|
-
fill: currentColor;\r
|
|
1078
|
-
}\r
|
|
1079
|
-
#sw-ttyw-chat-send-message:disabled {\r
|
|
1080
|
-
opacity: 0.5;\r
|
|
1081
|
-
cursor: not-allowed;\r
|
|
1082
|
-
}\r
|
|
1083
|
-
\r
|
|
1084
|
-
#sw-ttyw-chat-send-message:disabled svg,\r
|
|
1085
|
-
#sw-ttyw-chat-send-message:disabled path {\r
|
|
1086
|
-
cursor: not-allowed;\r
|
|
1087
|
-
}\r
|
|
1088
|
-
\r
|
|
1089
|
-
.sw-ttyw-jump-latest {\r
|
|
1090
|
-
position: sticky;\r
|
|
1091
|
-
bottom: 12px;\r
|
|
1092
|
-
display: flex;\r
|
|
1093
|
-
justify-content: center;\r
|
|
1094
|
-
margin-top: 8px;\r
|
|
1095
|
-
}\r
|
|
1096
|
-
\r
|
|
1097
|
-
.sw-ttyw-jump-button {\r
|
|
1098
|
-
background: var(--swttyw-primary-color, #000);\r
|
|
1099
|
-
border: 1px solid var(--swttyw-primary-color, #000);\r
|
|
1100
|
-
color: #fff;\r
|
|
1101
|
-
border-radius: 20px;\r
|
|
1102
|
-
padding: 6px 12px;\r
|
|
1103
|
-
font-size: 12px;\r
|
|
1104
|
-
cursor: pointer;\r
|
|
1105
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);\r
|
|
1106
|
-
}\r
|
|
1107
|
-
\r
|
|
1108
|
-
.sw-ttyw-jump-button:hover {\r
|
|
1109
|
-
opacity: 0.9;\r
|
|
1110
|
-
}`, Xe = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='190'%20height='42'%20viewBox='0%200%20190%2042'%20fill='none'%3e%3cpath%20d='M17.2253%2014.2603C17.155%2014.0259%2016.9441%2013.8618%2016.7097%2013.8618H14.6472C14.3894%2013.8618%2014.1785%2014.0259%2014.1316%2014.2603L10.7801%2027.5053C10.7332%2027.6694%2010.7801%2027.8335%2010.8739%2027.9741C10.9676%2028.1148%2011.1317%2028.1851%2011.2957%2028.1851H12.9363C13.1941%2028.1851%2013.4051%2027.9976%2013.4754%2027.7631L14.0613%2025.0673H17.3191L17.905%2027.7631C17.9519%2028.021%2018.1862%2028.1851%2018.444%2028.1851H20.0846C20.2487%2028.1851%2020.4128%2028.1148%2020.5065%2027.9741C20.6003%2027.8335%2020.6471%2027.6694%2020.6003%2027.5053L17.2488%2014.2603H17.2253ZM14.5769%2022.5824L15.655%2017.636L16.7566%2022.5824H14.5769Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M23.8359%2013.8618H22.2656C21.9609%2013.8618%2021.7266%2014.0962%2021.7266%2014.401V27.6459C21.7266%2027.9507%2021.9609%2028.1851%2022.2656%2028.1851H23.8359C24.1406%2028.1851%2024.375%2027.9507%2024.375%2027.6459V14.401C24.375%2014.0962%2024.1406%2013.8618%2023.8359%2013.8618ZM22.2891%2014.0493C22.2422%2014.0493%2022.1953%2014.0493%2022.1484%2014.0728C22.1953%2014.0728%2022.2422%2014.0493%2022.2891%2014.0493Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M36.1401%2029.4041L36.0932%2012.5256C36.0932%2011.3066%2035.4369%2010.1579%2034.3588%209.5484L19.7341%201.15601C18.6794%200.546507%2017.3669%200.546507%2016.2888%201.15601L1.71091%209.61872C0.65624%2010.2282%200%2011.3769%200%2012.5959L0.046874%2029.4744C0.046874%2030.6934%200.703114%2031.8421%201.78122%2032.4516L16.406%2040.844C17.4607%2041.4535%2018.7731%2041.4535%2019.8513%2040.844L34.4291%2032.3813C35.4838%2031.7718%2036.1401%2030.6231%2036.1401%2029.4041ZM11.9998%2031.5608C6.16397%2028.1851%204.17181%2020.7539%207.54676%2014.9167C10.8983%209.07955%2018.3513%207.08694%2024.1871%2010.4626C30.023%2013.8149%2032.0151%2021.2696%2028.6402%2027.1068C25.2887%2032.9439%2017.8357%2034.9365%2011.9998%2031.5608Z'%20fill='%23FF0000'%3e%3c/path%3e%3cpath%20d='M46.3593%2014.19C46.6171%2013.9087%2046.9218%2013.6977%2047.2734%2013.557C47.6249%2013.4164%2048.0468%2013.3461%2048.5155%2013.3461C48.9843%2013.3461%2049.6171%2013.4398%2050.0858%2013.6508C50.5546%2013.8618%2050.9295%2014.1665%2051.2342%2014.5416C51.3983%2014.7526%2051.5623%2014.987%2051.6795%2015.2683C51.8202%2015.5496%2051.9139%2015.8309%2051.9608%2016.1357L55.4295%2015.0574C55.1717%2014.1431%2054.8201%2013.3695%2054.3748%2012.7131C53.9295%2012.0567%2053.3904%2011.4941%2052.7576%2011.0487C52.1952%2010.6502%2051.5623%2010.3689%2050.8358%2010.1813C50.1327%209.99379%2049.3593%209.90002%2048.5624%209.90002C47.7655%209.90002%2046.5937%2010.0407%2045.7734%2010.3454C44.9765%2010.6502%2044.2734%2011.0956%2043.7109%2011.6816C43.125%2012.2443%2042.7031%2012.9241%2042.4219%2013.7211C42.1406%2014.5182%2042%2015.4324%2042%2016.4405C42%2017.4485%2042.1641%2018.5034%2042.5156%2019.277C42.8672%2020.0506%2043.3828%2020.707%2044.0859%2021.2461C44.789%2021.7853%2045.7031%2022.2776%2046.8515%2022.6761L48.8436%2023.4028C49.5702%2023.6842%2050.1561%2023.9655%2050.5546%2024.2702C50.953%2024.5515%2051.2342%2024.8797%2051.3983%2025.2314C51.5623%2025.583%2051.6327%2026.0284%2051.6327%2026.5676C51.6327%2027.1067%2051.5858%2027.4818%2051.4686%2027.8335C51.3749%2028.1851%2051.1874%2028.4899%2050.9764%2028.7712C50.742%2029.0759%2050.4374%2029.2869%2050.0624%2029.4275C49.7108%2029.5682%2049.2889%2029.6385%2048.8202%2029.6385C48.3515%2029.6385%2047.7187%2029.5448%2047.2734%2029.3338C46.8046%2029.1228%2046.4296%2028.818%2046.1249%2028.443C45.9374%2028.232%2045.7734%2027.9976%2045.6562%2027.6928C45.5156%2027.4115%2045.4453%2027.1067%2045.3749%2026.802L41.8594%2027.7866C42.0937%2028.7008%2042.4453%2029.4979%2042.8906%2030.2011C43.3594%2030.9044%2043.8984%2031.467%2044.5546%2031.9359C45.1406%2032.311%2045.7734%2032.5923%2046.4765%2032.8032C47.1796%2033.0142%2047.953%2033.108%2048.7499%2033.108C49.5468%2033.108%2050.742%2032.9439%2051.5389%2032.6626C52.3592%2032.3578%2053.0623%2031.9124%2053.6483%2031.3029C54.1873%2030.7169%2054.6092%2030.0136%2054.9139%2029.1931C55.2185%2028.3726%2055.3592%2027.4349%2055.3592%2026.3566C55.3592%2025.2782%2055.1951%2024.2702%2054.8435%2023.4966C54.492%2022.723%2053.9764%2022.0666%2053.2498%2021.5275C52.5233%2020.9883%2051.5858%2020.496%2050.3905%2020.0506L48.4218%2019.3239C47.6952%2019.0426%2047.1327%2018.7612%2046.7577%2018.4799C46.3593%2018.1752%2046.1015%2017.8704%2045.9609%2017.5188C45.8203%2017.1672%2045.7499%2016.7686%2045.7499%2016.2998C45.7499%2015.8309%2045.7968%2015.4324%2045.914%2015.0808C46.0077%2014.7292%2046.1718%2014.4478%2046.3593%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M67.5233%2026.4504C67.5233%2027.1536%2067.4295%2027.7631%2067.242%2028.232C67.0545%2028.7008%2066.7499%2029.0525%2066.3046%2029.3103C65.8593%2029.5682%2065.2733%2029.6854%2064.5468%2029.6854C63.8202%2029.6854%2063.2109%2029.5682%2062.7656%2029.3103C62.3202%2029.0525%2062.0156%2028.7008%2061.8281%2028.232C61.6406%2027.7631%2061.5468%2027.1771%2061.5468%2026.4504V10.1579H57.8672V26.3332C57.8672%2027.6694%2058.1016%2028.8415%2058.5703%2029.8495C59.039%2030.8575%2059.7656%2031.6546%2060.75%2032.2406C61.7343%2032.8267%2063.0234%2033.108%2064.5702%2033.108C66.1171%2033.108%2067.3592%2032.8267%2068.367%2032.2406C69.3748%2031.6546%2070.1014%2030.8575%2070.5467%2029.8261C70.992%2028.7946%2071.2264%2027.6459%2071.2264%2026.3332V10.1579H67.5467V26.4504H67.5233Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M83.7186%2010.9549C82.7811%2010.4158%2081.5858%2010.1579%2080.1562%2010.1579H74.0859V32.8033H77.7656V24.9032H80.1093C81.5624%2024.9032%2082.7577%2024.6453%2083.6952%2024.1296C84.6327%2023.6138%2085.3358%2022.8168%2085.8045%2021.7385C86.2732%2020.6601%2086.5076%2019.2536%2086.5076%2017.5423C86.5076%2015.831%2086.2732%2014.4479%2085.8045%2013.3695C85.3358%2012.2912%2084.6327%2011.4941%2083.6952%2010.9549H83.7186ZM82.4999%2019.9099C82.2889%2020.4726%2081.9843%2020.8711%2081.5858%2021.1289C81.1874%2021.3868%2080.6718%2021.504%2080.0155%2021.504H77.7421V13.6274H80.0155C80.6718%2013.6274%2081.1874%2013.7446%2081.5858%2014.0025C81.9843%2014.2603%2082.2889%2014.6588%2082.4999%2015.2215C82.7108%2015.7841%2082.8046%2016.5577%2082.8046%2017.5423C82.8046%2018.5268%2082.7108%2019.3473%2082.4999%2019.9099Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M88.5938%2032.8267H99.7029V29.3807H92.2734V23.0043H98.4608V19.5817H92.2734V13.6274H99.7029V10.1813H88.5938V32.8267Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M111.797%2023.356C112.711%2022.8402%20113.437%2022.0666%20113.953%2021.0352C114.469%2020.0037%20114.726%2018.7144%20114.726%2017.1672C114.726%2015.62%20114.492%2014.2134%20114.023%2013.2054C113.555%2012.1739%20112.851%2011.4238%20111.961%2010.9315C111.047%2010.4392%20109.922%2010.2048%20108.586%2010.2048H102.023V32.8501H105.703V24.153H108.258L111.094%2032.8501H115.078L111.75%2023.4028C111.75%2023.4028%20111.797%2023.4028%20111.82%2023.3794L111.797%2023.356ZM105.68%2013.6274H108.422C108.961%2013.6274%20109.406%2013.7211%20109.805%2013.9321C110.18%2014.1431%20110.484%2014.4947%20110.695%2015.0105C110.906%2015.5028%20111%2016.2295%20111%2017.1437C111%2018.058%20110.906%2018.8081%20110.695%2019.3239C110.484%2019.8396%20110.203%2020.1912%20109.828%2020.4022C109.453%2020.6132%20109.008%2020.707%20108.469%2020.707H105.703V13.6508L105.68%2013.6274Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M132.234%2027.3412L129.047%2010.1813H125.508L122.344%2027.2474L119.086%2010.1813H115.148L120.328%2032.8267H124.148L127.289%2017.6595L130.406%2032.8267H134.226L139.382%2010.1813H135.492L132.234%2027.3412Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M144.773%2010.1813H141.094V32.8267H144.773V10.1813Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M151.851%2014.19C152.109%2013.9087%20152.414%2013.6977%20152.766%2013.557C153.117%2013.4164%20153.539%2013.3461%20154.008%2013.3461C154.476%2013.3461%20155.109%2013.4398%20155.578%2013.6508C156.047%2013.8618%20156.422%2014.1665%20156.726%2014.5416C156.89%2014.7526%20157.055%2014.987%20157.172%2015.2683C157.312%2015.5496%20157.406%2015.8309%20157.453%2016.1357L160.922%2015.0574C160.664%2014.1431%20160.312%2013.3695%20159.867%2012.7131C159.422%2012.0567%20158.883%2011.4941%20158.25%2011.0487C157.687%2010.6502%20157.055%2010.3689%20156.328%2010.1813C155.625%209.99379%20154.851%209.90002%20154.055%209.90002C153.258%209.90002%20152.086%2010.0407%20151.266%2010.3454C150.469%2010.6502%20149.766%2011.0956%20149.203%2011.6816C148.617%2012.2443%20148.195%2012.9241%20147.914%2013.7211C147.633%2014.5182%20147.492%2015.4324%20147.492%2016.4405C147.492%2017.4485%20147.656%2018.5034%20148.008%2019.277C148.359%2020.0506%20148.875%2020.707%20149.578%2021.2461C150.281%2021.7853%20151.195%2022.2776%20152.344%2022.6761L154.336%2023.4028C155.062%2023.6842%20155.648%2023.9655%20156.047%2024.2702C156.445%2024.5515%20156.726%2024.8797%20156.89%2025.2314C157.055%2025.583%20157.125%2026.0284%20157.125%2026.5676C157.125%2027.1067%20157.078%2027.4818%20156.961%2027.8335C156.867%2028.1851%20156.68%2028.4899%20156.469%2028.7712C156.234%2029.0759%20155.93%2029.2869%20155.555%2029.4275C155.203%2029.5682%20154.781%2029.6385%20154.312%2029.6385C153.844%2029.6385%20153.211%2029.5448%20152.766%2029.3338C152.297%2029.1228%20151.922%2028.818%20151.617%2028.443C151.43%2028.232%20151.266%2027.9976%20151.148%2027.6928C151.008%2027.4115%20150.914%2027.1067%20150.867%2026.802L147.352%2027.7866C147.586%2028.7008%20147.937%2029.4979%20148.383%2030.2011C148.852%2030.9044%20149.391%2031.467%20150.047%2031.9359C150.633%2032.311%20151.266%2032.5923%20151.969%2032.8032C152.672%2033.0142%20153.445%2033.108%20154.242%2033.108C155.039%2033.108%20156.234%2032.9439%20157.031%2032.6626C157.851%2032.3578%20158.555%2031.9124%20159.14%2031.3029C159.68%2030.7169%20160.101%2030.0136%20160.406%2029.1931C160.711%2028.3726%20160.851%2027.4349%20160.851%2026.3566C160.851%2025.2782%20160.687%2024.2702%20160.336%2023.4966C159.984%2022.723%20159.469%2022.0666%20158.742%2021.5275C158.015%2020.9883%20157.078%2020.496%20155.883%2020.0506L153.914%2019.3239C153.187%2019.0426%20152.625%2018.7612%20152.25%2018.4799C151.852%2018.1752%20151.594%2017.8704%20151.453%2017.5188C151.312%2017.1672%20151.242%2016.7686%20151.242%2016.2998C151.242%2015.8309%20151.289%2015.4324%20151.406%2015.0808C151.5%2014.7292%20151.664%2014.4478%20151.851%2014.19Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M174.633%2013.6274V10.1813H163.5V32.8267H174.633V29.3807H167.18V23.0043H173.367V19.5817H167.18V13.6274H174.633Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M179.316%2011.0956V10.1345H183.512V11.0956H181.918V15.8075H180.91V11.0956H179.316Z'%20fill='black'%3e%3c/path%3e%3cpath%20d='M184.168%2010.1345H185.41L186.676%2013.9321L187.941%2010.1345H189.184V15.8075H188.269V11.8223L187.098%2015.1511H186.254L185.082%2011.9161V15.831H184.168V10.1579V10.1345Z'%20fill='black'%3e%3c/path%3e%3c/svg%3e";
|
|
1111
|
-
let Ke = 0;
|
|
1112
|
-
function Pe({ width: r = 20, height: n = 20, style: i }) {
|
|
1113
|
-
const a = M(null);
|
|
1114
|
-
a.current || (a.current = `clip0_avatar_${++Ke}`);
|
|
1115
|
-
const o = a.current;
|
|
1116
|
-
return /* @__PURE__ */ e.jsxs("svg", { width: r, height: n, viewBox: "0 0 155 174", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: i, "aria-hidden": !0, children: [
|
|
1117
|
-
/* @__PURE__ */ e.jsxs("g", { clipPath: `url(#${o})`, children: [
|
|
396
|
+
}
|
|
397
|
+
function Qe() {
|
|
398
|
+
if (typeof document > "u" || document.getElementById(_e)) return;
|
|
399
|
+
const t = Ke();
|
|
400
|
+
if (!t) return;
|
|
401
|
+
const r = document.createElement("link");
|
|
402
|
+
r.id = _e, r.rel = "stylesheet", r.href = t, document.head.appendChild(r);
|
|
403
|
+
}
|
|
404
|
+
function Re(t) {
|
|
405
|
+
if (!t || typeof t != "string") return "";
|
|
406
|
+
const r = t.trim().toLowerCase();
|
|
407
|
+
return /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(r) ? r.length === 4 ? "#" + r[1] + r[1] + r[2] + r[2] + r[3] + r[3] : r : "";
|
|
408
|
+
}
|
|
409
|
+
const e2 = [
|
|
410
|
+
{ re: /^(#000000|#000)$/, class: "sw-ttyw-theme-default" },
|
|
411
|
+
{ re: /^#2563eb$/i, class: "sw-ttyw-theme-blue" },
|
|
412
|
+
{ re: /^#dc2626$/i, class: "sw-ttyw-theme-red" },
|
|
413
|
+
{ re: /^#16a34a$/i, class: "sw-ttyw-theme-green" }
|
|
414
|
+
];
|
|
415
|
+
function t2(t, r) {
|
|
416
|
+
const a = Re(t) || "#000";
|
|
417
|
+
Re(r);
|
|
418
|
+
for (const { re: i, class: n } of e2)
|
|
419
|
+
if (i.test(a)) return n;
|
|
420
|
+
return "sw-ttyw-theme-default";
|
|
421
|
+
}
|
|
422
|
+
let r2 = 0;
|
|
423
|
+
function Ie({ width: t = 20, height: r = 20 }) {
|
|
424
|
+
const a = A(null);
|
|
425
|
+
a.current || (a.current = `clip0_avatar_${++r2}`);
|
|
426
|
+
const i = a.current;
|
|
427
|
+
return /* @__PURE__ */ e.jsxs("svg", { width: t, height: r, viewBox: "0 0 155 174", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
428
|
+
/* @__PURE__ */ e.jsxs("g", { clipPath: `url(#${i})`, children: [
|
|
1118
429
|
/* @__PURE__ */ e.jsx("path", { d: "M73.41 57.8388C73.15 56.8088 72.23 56.0988 71.17 56.0988H62.35C61.29 56.0988 60.37 56.8188 60.11 57.8488L45.8 114.299C45.62 114.999 45.78 115.719 46.22 116.289C46.66 116.859 47.33 117.179 48.05 117.179H55.05C56.13 117.179 57.08 116.419 57.31 115.359L59.83 103.889H73.76L76.29 115.359C76.52 116.409 77.47 117.179 78.55 117.179H85.54C86.26 117.179 86.92 116.849 87.37 116.289C87.81 115.719 87.96 114.999 87.79 114.299L73.44 57.8488L73.41 57.8388ZM62.12 93.3688L66.76 72.2188L71.42 93.3688H62.12Z", fill: "#FF0000" }),
|
|
1119
430
|
/* @__PURE__ */ e.jsx("path", { d: "M101.69 56.0988H95.01C93.73 56.0988 92.7 57.1388 92.7 58.4088V114.859C92.7 116.139 93.74 117.169 95.01 117.169H101.69C102.97 117.169 104 116.129 104 114.859V58.4088C104 57.1288 102.96 56.0988 101.69 56.0988Z", fill: "#FF0000" }),
|
|
1120
431
|
/* @__PURE__ */ e.jsx("path", { d: "M154.17 122.419L153.98 50.4588C153.97 45.2188 151.16 40.3788 146.61 37.7688L84.21 1.94879C79.66 -0.661205 74.07 -0.651206 69.54 1.98879L7.30003 38.1288C2.77003 40.7588 -0.00997311 45.6088 2.68877e-05 50.8488L0.190027 122.809C0.200027 128.049 3.01003 132.889 7.56003 135.499L69.97 171.319C74.52 173.929 80.11 173.919 84.64 171.279L146.87 135.139C151.4 132.509 154.19 127.659 154.17 122.409V122.419ZM51.11 131.639C26.26 117.289 17.74 85.5088 32.09 60.6488C46.44 35.7988 78.22 27.2788 103.08 41.6288C127.93 55.9788 136.45 87.7588 122.1 112.619C107.75 137.469 75.97 145.989 51.11 131.639Z", fill: "#FF0000" })
|
|
1121
432
|
] }),
|
|
1122
|
-
/* @__PURE__ */ e.jsx("defs", { children: /* @__PURE__ */ e.jsx("clipPath", { id:
|
|
433
|
+
/* @__PURE__ */ e.jsx("defs", { children: /* @__PURE__ */ e.jsx("clipPath", { id: i, children: /* @__PURE__ */ e.jsx("rect", { width: "154.17", height: "173.268", fill: "white" }) }) })
|
|
1123
434
|
] });
|
|
1124
435
|
}
|
|
1125
|
-
function
|
|
1126
|
-
const a =
|
|
1127
|
-
return /* @__PURE__ */ e.jsxs("svg", { width: a, height:
|
|
436
|
+
function s2({ width: t, height: r = 20 }) {
|
|
437
|
+
const a = t ?? 4.6875 * r;
|
|
438
|
+
return /* @__PURE__ */ e.jsxs("svg", { width: a, height: r, viewBox: "0 0 75 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
1128
439
|
/* @__PURE__ */ e.jsx("path", { d: "M6.82917 5.34411C6.8013 5.25174 6.71768 5.18707 6.62476 5.18707H5.80712C5.70492 5.18707 5.62129 5.25174 5.60271 5.34411L4.27404 10.5635C4.25546 10.6282 4.27404 10.6928 4.31121 10.7483C4.34838 10.8037 4.41341 10.8314 4.47845 10.8314H5.12885C5.23106 10.8314 5.31468 10.7575 5.34255 10.6651L5.57484 9.60278H6.86634L7.09862 10.6651C7.11721 10.7667 7.21012 10.8314 7.31232 10.8314H7.96272C8.02776 10.8314 8.0928 10.8037 8.12997 10.7483C8.16713 10.6928 8.18571 10.6282 8.16713 10.5635L6.83846 5.34411H6.82917ZM5.77925 8.62356L6.20665 6.67437L6.64335 8.62356H5.77925Z", fill: "white" }),
|
|
1129
440
|
/* @__PURE__ */ e.jsx("path", { d: "M9.44935 5.18707H8.82683C8.70604 5.18707 8.61313 5.27945 8.61313 5.39954V10.6189C8.61313 10.739 8.70604 10.8314 8.82683 10.8314H9.44935C9.57014 10.8314 9.66305 10.739 9.66305 10.6189V5.39954C9.66305 5.27945 9.57014 5.18707 9.44935 5.18707ZM8.83612 5.26097C8.81754 5.26097 8.79896 5.26098 8.78037 5.27021C8.79896 5.27021 8.81754 5.26097 8.83612 5.26097Z", fill: "white" }),
|
|
1130
441
|
/* @__PURE__ */ e.jsx("path", { d: "M14.3273 11.3118L14.3087 4.66051C14.3087 4.18014 14.0486 3.72748 13.6212 3.4873L7.82334 0.180139C7.40523 -0.0600462 6.88491 -0.0600462 6.45751 0.180139L0.678271 3.51501C0.260159 3.7552 0 4.20785 0 4.68822L0.0185826 11.3395C0.0185826 11.8199 0.278741 12.2725 0.706145 12.5127L6.50396 15.8199C6.92208 16.06 7.44239 16.06 7.8698 15.8199L13.649 12.485C14.0671 12.2448 14.3273 11.7921 14.3273 11.3118ZM4.75719 12.1617C2.44363 10.8314 1.65386 7.903 2.99182 5.60277C4.32049 3.30254 7.27515 2.51732 9.5887 3.84758C11.9023 5.16859 12.692 8.10624 11.3541 10.4065C10.0254 12.7067 7.07074 13.4919 4.75719 12.1617Z", fill: "white" }),
|
|
@@ -1141,568 +452,521 @@ function Qe({ width: r, height: n = 20, style: i }) {
|
|
|
1141
452
|
/* @__PURE__ */ e.jsx("path", { d: "M73.0116 3.71826H73.5041L74.0058 5.2148L74.5075 3.71826H75V5.95383H74.6376V4.38339L74.173 5.69517H73.8386L73.374 4.42034V5.96306H73.0116V3.7275V3.71826Z", fill: "white" })
|
|
1142
453
|
] });
|
|
1143
454
|
}
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
if (typeof document > "u" || document.getElementById(_e)) return;
|
|
1147
|
-
const r = document.createElement("style");
|
|
1148
|
-
r.id = _e, r.textContent = Je, document.head.appendChild(r);
|
|
1149
|
-
}
|
|
1150
|
-
et();
|
|
1151
|
-
function tt(r) {
|
|
1152
|
-
return r === "human" ? { ...g.message, ...g.messageSelf } : { ...g.message, ...g.messageOther };
|
|
1153
|
-
}
|
|
1154
|
-
function xe(r) {
|
|
1155
|
-
return String(r).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
455
|
+
function xe(t) {
|
|
456
|
+
return String(t).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1156
457
|
}
|
|
1157
|
-
function
|
|
1158
|
-
return !
|
|
458
|
+
function we(t) {
|
|
459
|
+
return !t.trim() || /^\s*([*\-]|\d+\.)\s+/.test(t) ? !1 : /^\s{2,}/.test(t) && /[=(){}\[\],:]/.test(t) || /["'][^"']*["']\s*[:=]/.test(t) && t.length > 10 ? !0 : /\[text\]|\[\/text\]|\]\[text\]/i.test(t) || /\?|!/.test(t) || t.includes("—") || t.includes("–") || /^\s*(Would|Can|May|Could|Should|I |You |We |Let's|Please|Sure|Yes|No)\b/i.test(t) || /\b(your|you|we|me)\b/i.test(t) || /^\s*[A-Z][^.(]*[.?]\s*$/.test(t) || /^\s*#/.test(t) || /^\s*[-*]\s+[A-Z]/.test(t) && !/\.\w+\s*\(|=/.test(t) || /^\s*\d+\.\s+[A-Z][^.(]*$/.test(t) ? !1 : !!(/^\s*[)\]}]\s*$/.test(t) || /^\s*\.{3}\s*$/.test(t) || /^\s*(GET|POST|PUT|PATCH|DELETE|HEAD)\s+\S+/i.test(t) || /^\s*(Authorization|Content-Type|Accept)\s*:/i.test(t) || /^\s*\{\s*$/.test(t) || /^\s*[\w.]+\s*=/.test(t) || /\.\w+\s*\(|\b(print|range|open|str|int|list|dict)\s*\(/.test(t) || /^\s*(def|class|import|from|return|if|else|elif|for|while|try|except|with|async)\b/.test(t) || /^\s{2,}/.test(t) && /[=(){}\[\],:]/.test(t) || /[,(]\s*$|:\s*$/.test(t) || /["'][^"']*["']\s*[:=]/.test(t) && t.length > 10 || /\b\w+\s*\([^)]*\)\s*$/.test(t) && /[=.]\w+\s*\(|import|from\s+\w+/.test(t));
|
|
1159
460
|
}
|
|
1160
|
-
function
|
|
1161
|
-
const
|
|
1162
|
-
`),
|
|
1163
|
-
let
|
|
1164
|
-
for (;
|
|
1165
|
-
const
|
|
1166
|
-
if (!
|
|
1167
|
-
|
|
461
|
+
function n2(t) {
|
|
462
|
+
const r = [], a = t.split(`
|
|
463
|
+
`), i = [];
|
|
464
|
+
let n = 0;
|
|
465
|
+
for (; n < a.length; ) {
|
|
466
|
+
const m = a[n];
|
|
467
|
+
if (!we(m)) {
|
|
468
|
+
i.push(m), n++;
|
|
1168
469
|
continue;
|
|
1169
470
|
}
|
|
1170
|
-
const
|
|
1171
|
-
for (;
|
|
1172
|
-
const
|
|
1173
|
-
if (
|
|
1174
|
-
|
|
471
|
+
const g = [];
|
|
472
|
+
for (; n < a.length; ) {
|
|
473
|
+
const l = we(a[n]), p = a[n].trim() === "", c = n + 1 < a.length && we(a[n + 1]);
|
|
474
|
+
if (l || p && g.length > 0 && c)
|
|
475
|
+
g.push(a[n]), n++;
|
|
1175
476
|
else break;
|
|
1176
477
|
}
|
|
1177
|
-
if (
|
|
1178
|
-
const
|
|
1179
|
-
`).trim(),
|
|
1180
|
-
|
|
1181
|
-
} else
|
|
478
|
+
if (g.length >= 2) {
|
|
479
|
+
const l = r.length, p = g.join(`
|
|
480
|
+
`).trim(), c = xe(p);
|
|
481
|
+
r.push({ placeholder: `\0CODE_RAW_${l}\0`, html: `<pre class="sw-ttyw-code-block"><code>${c}</code></pre>` }), i.push(`\0CODE_RAW_${l}\0`);
|
|
482
|
+
} else g.length === 1 && i.push(g[0]);
|
|
1182
483
|
}
|
|
1183
|
-
return { html:
|
|
1184
|
-
`), codeBlocks:
|
|
484
|
+
return { html: i.join(`
|
|
485
|
+
`), codeBlocks: r };
|
|
1185
486
|
}
|
|
1186
|
-
function
|
|
1187
|
-
return !
|
|
487
|
+
function Pe(t) {
|
|
488
|
+
return !t || !String(t).trim() ? "" : String(t).replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/`([^`]+)`/g, "<code>$1</code>").replace(/\n/g, "<br>");
|
|
1188
489
|
}
|
|
1189
|
-
const
|
|
1190
|
-
function
|
|
1191
|
-
const
|
|
1192
|
-
for (const
|
|
1193
|
-
const
|
|
1194
|
-
if (!
|
|
1195
|
-
const
|
|
1196
|
-
|
|
490
|
+
const $e = /^\s*([*\-]|\d+\.)\s+(.*)$/;
|
|
491
|
+
function o2(t) {
|
|
492
|
+
const r = [];
|
|
493
|
+
for (const p of t) {
|
|
494
|
+
const c = p.match($e);
|
|
495
|
+
if (!c) continue;
|
|
496
|
+
const C = p.match(/^(\s*)/)[1].length, j = c[1], f = c[2], u = /^\d+\.$/.test(j);
|
|
497
|
+
r.push({ indent: C, content: f, ordered: u });
|
|
1197
498
|
}
|
|
1198
|
-
if (
|
|
1199
|
-
const
|
|
1200
|
-
let
|
|
1201
|
-
for (let
|
|
1202
|
-
const { indent:
|
|
1203
|
-
if (
|
|
1204
|
-
|
|
499
|
+
if (r.length === 0) return "";
|
|
500
|
+
const a = 2, i = [], n = [];
|
|
501
|
+
let m = !1, g = !1, l = !1;
|
|
502
|
+
for (let p = 0; p < r.length; p++) {
|
|
503
|
+
const { indent: c, content: C, ordered: j } = r[p], f = Math.floor(c / a), u = Pe(C);
|
|
504
|
+
if (j)
|
|
505
|
+
g && (l && i.push("</li>"), i.push("</ul></li>"), n.pop(), g = !1, l = !1), l && n.length > 0 && n[n.length - 1].type === "ol" && i.push("</li>"), (n.length === 0 || n[n.length - 1].type !== "ol") && (i.push("<ol>"), n.push({ type: "ol", indentLevel: f })), i.push("<li>", u), l = !0, m = !0;
|
|
1205
506
|
else {
|
|
1206
|
-
if (
|
|
1207
|
-
|
|
1208
|
-
else if (
|
|
1209
|
-
|
|
1210
|
-
const
|
|
1211
|
-
for (;
|
|
1212
|
-
const
|
|
1213
|
-
if (
|
|
1214
|
-
|
|
507
|
+
if (m && f <= (n.length > 0 ? n[n.length - 1].indentLevel : 0))
|
|
508
|
+
i.push("<ul>"), n.push({ type: "ul", indentLevel: f }), g = !0, l = !1;
|
|
509
|
+
else if (g || n.length > 0 && n[n.length - 1].type === "ul") {
|
|
510
|
+
l && i.push("</li>"), l = !0;
|
|
511
|
+
const h = n.length > 0 ? n[n.length - 1].indentLevel : -1;
|
|
512
|
+
for (; f > h && n.length > 0 && n[n.length - 1].type === "ul"; ) {
|
|
513
|
+
const w = n[n.length - 1];
|
|
514
|
+
if (f <= w.indentLevel) break;
|
|
515
|
+
i.push("<ul>"), n.push({ type: "ul", indentLevel: f });
|
|
1215
516
|
}
|
|
1216
517
|
} else
|
|
1217
|
-
|
|
1218
|
-
|
|
518
|
+
n.length > 0 && i.push("</li>"), (n.length === 0 || n[n.length - 1].type !== "ul") && (i.push("<ul>"), n.push({ type: "ul", indentLevel: f })), l = !0;
|
|
519
|
+
i.push("<li>", u), m = !1;
|
|
1219
520
|
}
|
|
1220
521
|
}
|
|
1221
|
-
for (
|
|
1222
|
-
|
|
1223
|
-
return
|
|
522
|
+
for (l && i.push("</li>"); n.length > 0; )
|
|
523
|
+
n.pop().type === "ul" ? (i.push("</ul>"), n.length > 0 && n[n.length - 1].type === "ol" && i.push("</li>")) : i.push("</ol>");
|
|
524
|
+
return i.join("");
|
|
1224
525
|
}
|
|
1225
|
-
function
|
|
1226
|
-
if (!
|
|
1227
|
-
let
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1230
|
-
const
|
|
1231
|
-
return
|
|
1232
|
-
}),
|
|
1233
|
-
const
|
|
1234
|
-
return
|
|
526
|
+
function Ve(t) {
|
|
527
|
+
if (!t) return "";
|
|
528
|
+
let r = String(t);
|
|
529
|
+
const a = [];
|
|
530
|
+
r = r.replace(/```\s*(\w*)\s*\n?([\s\S]*?)```/g, (f, u, h) => {
|
|
531
|
+
const w = a.length, v = xe(h.trim());
|
|
532
|
+
return a.push(`<pre class="sw-ttyw-code-block"><code class="${u ? `language-${u}` : ""}">${v}</code></pre>`), `\0CODE_FENCED_${w}\0`;
|
|
533
|
+
}), r = r.replace(/\[code\]([\s\S]*?)\[\/code\]/gi, (f, u) => {
|
|
534
|
+
const h = a.length, w = xe(u.trim());
|
|
535
|
+
return a.push(`<pre class="sw-ttyw-code-block"><code>${w}</code></pre>`), `\0CODE_FENCED_${h}\0`;
|
|
1235
536
|
});
|
|
1236
|
-
const { html:
|
|
1237
|
-
|
|
1238
|
-
const
|
|
1239
|
-
`),
|
|
1240
|
-
let
|
|
1241
|
-
function
|
|
1242
|
-
|
|
537
|
+
const { html: i, codeBlocks: n } = n2(r);
|
|
538
|
+
r = i, r = r.replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\]|\[text\]|\](?=\s*(\n|$)))/gi, '<span class="sw-ttyw-text-block">$1</span>').replace(/\[bold\]([\s\S]*?)(?:\[\/bold\]|\]\[bold\]|\[bold\]|\](?=\s*(\n|$)))/gi, "<strong>$1</strong>").replace(/\[italic\]([\s\S]*?)(?:\[\/italic\]|\]\[italic\]|\[italic\]|\](?=\s*(\n|$)))/gi, "<em>$1</em>").replace(/bold([\s\S]*?)\/bold/gi, "<strong>$1</strong>").replace(/italic([\s\S]*?)\/italic/gi, "<em>$1</em>").replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/(https?:\/\/[^\s<]+)/g, '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[([^[\]]+)\]/g, '<span class="sw-ttyw-bracket-label">$1</span>');
|
|
539
|
+
const m = r.split(`
|
|
540
|
+
`), g = [];
|
|
541
|
+
let l = [], p = [];
|
|
542
|
+
function c() {
|
|
543
|
+
l.length && (g.push({ type: "list", lines: l }), l = []);
|
|
1243
544
|
}
|
|
1244
|
-
function
|
|
1245
|
-
|
|
545
|
+
function C() {
|
|
546
|
+
p.length && (g.push({ type: "content", lines: p }), p = []);
|
|
1246
547
|
}
|
|
1247
|
-
for (let
|
|
1248
|
-
const
|
|
1249
|
-
|
|
548
|
+
for (let f = 0; f < m.length; f++) {
|
|
549
|
+
const u = m[f];
|
|
550
|
+
$e.test(u) ? (C(), l.push(u)) : (c(), p.push(u));
|
|
1250
551
|
}
|
|
1251
|
-
return
|
|
1252
|
-
`))).join(""),
|
|
1253
|
-
|
|
1254
|
-
}),
|
|
1255
|
-
|
|
1256
|
-
}),
|
|
552
|
+
return c(), C(), r = g.map((f) => f.type === "list" ? o2(f.lines) : Pe(f.lines.join(`
|
|
553
|
+
`))).join(""), a.forEach((f, u) => {
|
|
554
|
+
r = r.replace(`\0CODE_FENCED_${u}\0`, f);
|
|
555
|
+
}), n.forEach(({ placeholder: f, html: u }) => {
|
|
556
|
+
r = r.replace(f, u);
|
|
557
|
+
}), r = r.replace(/(<br\s*\/?>)\s*$/i, ""), r;
|
|
1257
558
|
}
|
|
1258
|
-
const
|
|
1259
|
-
const [
|
|
559
|
+
const a2 = 30, i2 = 300, l2 = Me(function({ text: r, speed: a = 20, onComplete: i }) {
|
|
560
|
+
const [n, m] = H(""), [g, l] = H(!1), p = A(i);
|
|
1260
561
|
P(() => {
|
|
1261
|
-
|
|
1262
|
-
}, [
|
|
1263
|
-
if (!
|
|
1264
|
-
|
|
1265
|
-
const
|
|
1266
|
-
let
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1269
|
-
},
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
562
|
+
p.current = i;
|
|
563
|
+
}, [i]), P(() => {
|
|
564
|
+
if (!r) return;
|
|
565
|
+
m(""), l(!1);
|
|
566
|
+
const C = r.trim().split(/\s+/), j = Math.min(a2, C.length), f = C.slice(0, j).join(" "), u = Math.min(f.length, i2, r.length);
|
|
567
|
+
let h = 0, w = null, v = !1;
|
|
568
|
+
const S = () => {
|
|
569
|
+
v || (v = !0, w && clearInterval(w), w = null, m(r), l(!0), p.current && p.current());
|
|
570
|
+
}, R = () => {
|
|
571
|
+
typeof document < "u" && S();
|
|
572
|
+
};
|
|
573
|
+
return typeof document < "u" && document.addEventListener("visibilitychange", R), w = setInterval(() => {
|
|
574
|
+
h < u ? (m(r.slice(0, h + 1)), h++) : S();
|
|
575
|
+
}, a), () => {
|
|
576
|
+
w && clearInterval(w), typeof document < "u" && document.removeEventListener("visibilitychange", R);
|
|
577
|
+
};
|
|
578
|
+
}, [r, a]);
|
|
579
|
+
const c = (C) => C.replace(/(https?:\/\/[^\s<]+)/g, '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[bold\]([\s\S]*?)(?:\[\/bold\]|\]\[bold\]|\[bold\]|\](?=\s*(\n|$)))/gi, "<strong>$1</strong>").replace(/\[italic\]([\s\S]*?)(?:\[\/italic\]|\]\[italic\]|\[italic\]|\](?=\s*(\n|$)))/gi, "<em>$1</em>").replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\]|\[text\]|\](?=\s*(\n|$)))/gi, '<span class="sw-ttyw-text-block">$1</span>').replace(/bold([\s\S]*?)\/bold/gi, "<strong>$1</strong>").replace(/italic([\s\S]*?)\/italic/gi, "<em>$1</em>").replace(/\[([^[\]]+)\]/g, '<span class="sw-ttyw-bracket-label">$1</span>').replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/(?:^|\n)-\s+/g, `
|
|
1273
580
|
• `).replace(/\n/g, "<br/>").replace(/(\d+\.\s)/g, "<br/>$1").replace(/(\*\s)/g, "<br/>$1");
|
|
1274
581
|
return /* @__PURE__ */ e.jsx(
|
|
1275
582
|
"div",
|
|
1276
583
|
{
|
|
1277
|
-
|
|
1278
|
-
whiteSpace: "pre-wrap",
|
|
1279
|
-
lineHeight: "1.5",
|
|
1280
|
-
wordBreak: "break-word"
|
|
1281
|
-
},
|
|
584
|
+
className: "sw-ttyw-markdown-pre-wrap",
|
|
1282
585
|
dangerouslySetInnerHTML: {
|
|
1283
|
-
__html:
|
|
586
|
+
__html: g ? Ve(n) : c(n) + '<span class="typing-cursor">|</span>'
|
|
1284
587
|
}
|
|
1285
588
|
}
|
|
1286
589
|
);
|
|
1287
|
-
}),
|
|
1288
|
-
const
|
|
1289
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
1290
|
-
/* @__PURE__ */ e.jsx("div", { className: "message-avatar",
|
|
590
|
+
}), c2 = Me(function({ msg: r, isTyping: a = !1, onTypingComplete: i }) {
|
|
591
|
+
const n = r.from === "human" ? "sw-ttyw-message self" : "sw-ttyw-message other";
|
|
592
|
+
return /* @__PURE__ */ e.jsxs("div", { className: n, children: [
|
|
593
|
+
/* @__PURE__ */ e.jsx("div", { className: "message-avatar", children: r.from === "human" ? /* @__PURE__ */ e.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1291
594
|
/* @__PURE__ */ e.jsx("path", { d: "M20 21V19C20 17.9391 19.5786 16.9217 18.8284 16.1716C18.0783 15.4214 17.0609 15 16 15H8C6.93913 15 5.92172 15.4214 5.17157 16.1716C4.42143 16.9217 4 17.9391 4 19V21" }),
|
|
1292
595
|
/* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "7", r: "4" })
|
|
1293
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
1294
|
-
/* @__PURE__ */ e.jsx("div", { className: "message-content sw-ttyw-markdown",
|
|
596
|
+
] }) : /* @__PURE__ */ e.jsx(Ie, { width: 20, height: 20 }) }),
|
|
597
|
+
/* @__PURE__ */ e.jsx("div", { className: "message-content sw-ttyw-markdown", children: r.from === "ai" && a ? /* @__PURE__ */ e.jsx(l2, { text: r.text, speed: 20, onComplete: i }) : r.from === "ai" ? /* @__PURE__ */ e.jsx(
|
|
1295
598
|
"div",
|
|
1296
599
|
{
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
lineHeight: "1.5",
|
|
1300
|
-
wordBreak: "break-word"
|
|
1301
|
-
},
|
|
1302
|
-
dangerouslySetInnerHTML: { __html: We(n.text) }
|
|
600
|
+
className: "sw-ttyw-markdown-pre-wrap",
|
|
601
|
+
dangerouslySetInnerHTML: { __html: Ve(r.text) }
|
|
1303
602
|
}
|
|
1304
603
|
) : /* @__PURE__ */ e.jsx(
|
|
1305
604
|
"div",
|
|
1306
605
|
{
|
|
1307
|
-
|
|
1308
|
-
whiteSpace: "pre-wrap",
|
|
1309
|
-
lineHeight: "1.5",
|
|
1310
|
-
wordBreak: "break-word"
|
|
1311
|
-
},
|
|
606
|
+
className: "sw-ttyw-markdown-pre-wrap",
|
|
1312
607
|
dangerouslySetInnerHTML: {
|
|
1313
|
-
__html:
|
|
608
|
+
__html: r.text.replace(/\[bold\]([\s\S]*?)(?:\[\/bold\]|\]\[bold\]|\[bold\]|\](?=\s*(\n|$)))/gi, "<strong>$1</strong>").replace(/\[italic\]([\s\S]*?)(?:\[\/italic\]|\]\[italic\]|\[italic\]|\](?=\s*(\n|$)))/gi, "<em>$1</em>").replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\]|\[text\]|\](?=\s*(\n|$)))/gi, '<span class="sw-ttyw-text-block">$1</span>').replace(/bold([\s\S]*?)\/bold/gi, "<strong>$1</strong>").replace(/italic([\s\S]*?)\/italic/gi, "<em>$1</em>").replace(/\[([^[\]]+)\]/g, "<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/(?:^|\n)-\s+/g, `
|
|
1314
609
|
• `).replace(/\n/g, "<br/>").replace(/(\d+\.\s)/g, "<br/>$1").replace(/(\*\s)/g, "<br/>$1")
|
|
1315
610
|
}
|
|
1316
611
|
}
|
|
1317
612
|
) })
|
|
1318
613
|
] });
|
|
1319
|
-
}),
|
|
1320
|
-
const
|
|
1321
|
-
let
|
|
1322
|
-
return
|
|
1323
|
-
`🌅 Good morning ${
|
|
1324
|
-
`☀️ Morning ${
|
|
1325
|
-
`🌞 Good morning ${
|
|
1326
|
-
`👋 Rise and shine ${
|
|
1327
|
-
`👋 Morning ${
|
|
1328
|
-
] :
|
|
614
|
+
}), d2 = (t = "") => {
|
|
615
|
+
const r = (/* @__PURE__ */ new Date()).getHours();
|
|
616
|
+
let a = [];
|
|
617
|
+
return r >= 5 && r < 12 ? t ? a = [
|
|
618
|
+
`🌅 Good morning ${t}! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?`,
|
|
619
|
+
`☀️ Morning ${t}! I'm an expert on SUPERWISE. What would you like to discover or optimize today?`,
|
|
620
|
+
`🌞 Good morning ${t}! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?`,
|
|
621
|
+
`👋 Rise and shine ${t}! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.`,
|
|
622
|
+
`👋 Morning ${t}! I'm an expert on SUPERWISE. How can I guide you through the platform today?`
|
|
623
|
+
] : a = [
|
|
1329
624
|
"🌅 Good morning! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?",
|
|
1330
625
|
"☀️ Morning! I'm an expert on SUPERWISE. What would you like to discover or optimize today?",
|
|
1331
626
|
"🌞 Good morning! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?",
|
|
1332
627
|
"👋 Rise and shine! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.",
|
|
1333
628
|
"👋 Morning! I'm an expert on SUPERWISE. How can I guide you through the platform today?"
|
|
1334
|
-
] :
|
|
1335
|
-
`🌞 Good afternoon ${
|
|
1336
|
-
`☀️ Afternoon ${
|
|
1337
|
-
`👋 Good afternoon ${
|
|
1338
|
-
`🌅 Hey there ${
|
|
1339
|
-
`🌅 Afternoon ${
|
|
1340
|
-
] :
|
|
629
|
+
] : r >= 12 && r < 17 ? t ? a = [
|
|
630
|
+
`🌞 Good afternoon ${t}! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?`,
|
|
631
|
+
`☀️ Afternoon ${t}! I'm an expert on SUPERWISE. How may I help you today?`,
|
|
632
|
+
`👋 Good afternoon ${t}! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?`,
|
|
633
|
+
`🌅 Hey there ${t}! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.`,
|
|
634
|
+
`🌅 Afternoon ${t}! I'm an expert on SUPERWISE. How can I support your exploration today?`
|
|
635
|
+
] : a = [
|
|
1341
636
|
"🌞 Good afternoon! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?",
|
|
1342
637
|
"☀️ Afternoon! I'm an expert on SUPERWISE. How may I help you today?",
|
|
1343
638
|
"👋 Good afternoon! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?",
|
|
1344
639
|
"🌅 Hey there! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.",
|
|
1345
640
|
"🌅 Afternoon! I'm an expert on SUPERWISE. How can I support your exploration today?"
|
|
1346
|
-
] :
|
|
1347
|
-
`🌆 Good evening ${
|
|
1348
|
-
`🌅 Evening ${
|
|
1349
|
-
`👋 Good evening ${
|
|
1350
|
-
`🌇 Hey there ${
|
|
1351
|
-
`🌇 Evening ${
|
|
1352
|
-
] :
|
|
641
|
+
] : r >= 17 && r < 21 ? t ? a = [
|
|
642
|
+
`🌆 Good evening ${t}! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?`,
|
|
643
|
+
`🌅 Evening ${t}! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?`,
|
|
644
|
+
`👋 Good evening ${t}! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?`,
|
|
645
|
+
`🌇 Hey there ${t}! SUPERWISE expert here. Want to dive into the platform together?`,
|
|
646
|
+
`🌇 Evening ${t}! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?`
|
|
647
|
+
] : a = [
|
|
1353
648
|
"🌆 Good evening! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?",
|
|
1354
649
|
"🌅 Evening! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?",
|
|
1355
650
|
"👋 Good evening! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?",
|
|
1356
651
|
"🌇 Hey there! SUPERWISE expert here. Want to dive into the platform together?",
|
|
1357
652
|
"🌇 Evening! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?"
|
|
1358
|
-
] :
|
|
1359
|
-
`🌙 Good evening ${
|
|
1360
|
-
`⭐ Evening ${
|
|
1361
|
-
`👋 Good evening ${
|
|
1362
|
-
`🌃 Hey there ${
|
|
1363
|
-
`🌃 Evening ${
|
|
1364
|
-
] :
|
|
653
|
+
] : t ? a = [
|
|
654
|
+
`🌙 Good evening ${t}! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.`,
|
|
655
|
+
`⭐ Evening ${t}! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?`,
|
|
656
|
+
`👋 Good evening ${t}! I'm a SUPERWISE expert. Looking to discover features or understand how something works?`,
|
|
657
|
+
`🌃 Hey there ${t}! I'm a SUPERWISE expert. Want to explore what the platform offers?`,
|
|
658
|
+
`🌃 Evening ${t}! SUPERWISE expert here. How can I help simplify or explain things for you today?`
|
|
659
|
+
] : a = [
|
|
1365
660
|
"🌙 Good evening! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.",
|
|
1366
661
|
"⭐ Evening! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?",
|
|
1367
662
|
"👋 Good evening! I'm a SUPERWISE expert. Looking to discover features or understand how something works?",
|
|
1368
663
|
"🌃 Hey there! I'm a SUPERWISE expert. Want to explore what the platform offers?",
|
|
1369
664
|
"🌃 Evening! SUPERWISE expert here. How can I help simplify or explain things for you today?"
|
|
1370
|
-
],
|
|
665
|
+
], a[Math.floor(Math.random() * a.length)];
|
|
1371
666
|
};
|
|
1372
|
-
function
|
|
1373
|
-
|
|
667
|
+
function h2({ title: t = "", agentId: r = "", discoveryAgentId: a = "", primaryColor: i = "", minimizedButtonColor: n = "", apiUrl: m = "" }) {
|
|
668
|
+
P(() => {
|
|
669
|
+
Qe();
|
|
670
|
+
}, []);
|
|
671
|
+
const g = ge(() => t2(i, n), [i, n]), [l, p] = H(() => {
|
|
1374
672
|
try {
|
|
1375
673
|
if (typeof window < "u" && window.localStorage) {
|
|
1376
|
-
const
|
|
1377
|
-
return
|
|
674
|
+
const o = window.localStorage.getItem("chatbot-messages");
|
|
675
|
+
return o ? JSON.parse(o) : [];
|
|
1378
676
|
}
|
|
1379
677
|
} catch {
|
|
1380
678
|
}
|
|
1381
679
|
return [];
|
|
1382
|
-
}), [
|
|
680
|
+
}), [c, C] = H(() => {
|
|
1383
681
|
try {
|
|
1384
682
|
if (typeof window < "u" && window.localStorage) {
|
|
1385
|
-
const
|
|
1386
|
-
return
|
|
683
|
+
const o = window.localStorage.getItem("chatbot-mql_df");
|
|
684
|
+
return o ? JSON.parse(o) : [];
|
|
1387
685
|
}
|
|
1388
686
|
} catch {
|
|
1389
687
|
}
|
|
1390
688
|
return [];
|
|
1391
|
-
}), [
|
|
1392
|
-
if (
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
if (!l || l.length === 0) return "";
|
|
1403
|
-
const s = l.find((x) => x.name && x.email);
|
|
1404
|
-
return s ? `${s.name} (${s.email})` : "";
|
|
1405
|
-
}, [l]), ee = M(null), k = M(null), [O, D] = H(!0), N = M(!0), be = M(c), _ = J(() => {
|
|
1406
|
-
Y.current && (clearTimeout(Y.current), Y.current = null);
|
|
1407
|
-
}, []), ke = J((s) => {
|
|
1408
|
-
_(), Y.current = setTimeout(s, ne);
|
|
1409
|
-
}, [ne, _]), we = He(() => c.map((s) => ({ role: s.from, content: s.text })), [c]), me = (s) => {
|
|
1410
|
-
z(s), setTimeout(() => {
|
|
1411
|
-
z("");
|
|
689
|
+
}), [j, f] = H(""), [u, h] = H(!1), [w, v] = H(!1), [S, R] = H(!0), [B, se] = H(!1), [ne, N] = H(/* @__PURE__ */ new Set()), [oe, ae] = H(!1), [J, ie] = H(!1), [le, M] = H(!1), [$, ce] = H(!1), [de, K] = H(""), [q, D] = H(""), Q = 12e4, ue = "https://superwise.ai/contact/", s = (o) => typeof o == "string" && o.includes("unable to respond at the moment") && o.includes("Contact Sales"), d = A(null), b = A(null), E = ge(() => {
|
|
690
|
+
if (!c || c.length === 0) return "";
|
|
691
|
+
const o = c.find((y) => y.name && y.email);
|
|
692
|
+
return o ? `${o.name} (${o.email})` : "";
|
|
693
|
+
}, [c]), G = A(null), V = A(null), [L, I] = H(!0), T = A(!0), he = A(l), W = Y(() => {
|
|
694
|
+
d.current && (clearTimeout(d.current), d.current = null);
|
|
695
|
+
}, []), be = Y((o) => {
|
|
696
|
+
W(), d.current = setTimeout(o, Q);
|
|
697
|
+
}, [Q, W]), me = ge(() => l.map((o) => ({ role: o.from, content: o.text })), [l]), pe = (o) => {
|
|
698
|
+
D(o), setTimeout(() => {
|
|
699
|
+
D("");
|
|
1412
700
|
}, 4e3);
|
|
1413
|
-
}, Te = (
|
|
1414
|
-
const
|
|
1415
|
-
return
|
|
1416
|
-
},
|
|
1417
|
-
var
|
|
1418
|
-
const
|
|
1419
|
-
|
|
701
|
+
}, Te = (o) => {
|
|
702
|
+
const y = o.length, k = o.trim();
|
|
703
|
+
return K(""), D(""), !k || y === 0 ? (pe("Please enter a message before sending."), !1) : new RegExp(/(<([^>]+)>)/gi).test(k) ? (pe("Please avoid using HTML tags or scripts in your message."), !1) : k.length < 2 ? (pe("Please enter a meaningful question (at least 2 characters)."), !1) : k.length > 1e3 ? (pe("Message is too long. Please keep it under 1000 characters."), !1) : (K(""), D(""), !0);
|
|
704
|
+
}, F = Y((o = "auto") => {
|
|
705
|
+
var k;
|
|
706
|
+
const y = V.current;
|
|
707
|
+
y && (y.scrollTop = y.scrollHeight), (k = G.current) == null || k.scrollIntoView({ behavior: o }), T.current = !0, I(!0);
|
|
1420
708
|
}, []);
|
|
1421
709
|
P(() => {
|
|
1422
|
-
|
|
1423
|
-
}, [
|
|
1424
|
-
const
|
|
1425
|
-
if (!
|
|
1426
|
-
const
|
|
1427
|
-
|
|
710
|
+
T.current && requestAnimationFrame(() => F("auto"));
|
|
711
|
+
}, [l, q, le, $, ne, u, F]), P(() => {
|
|
712
|
+
const o = V.current;
|
|
713
|
+
if (!o || typeof ResizeObserver > "u") return;
|
|
714
|
+
const y = new ResizeObserver(() => {
|
|
715
|
+
T.current && F("auto");
|
|
1428
716
|
});
|
|
1429
|
-
return
|
|
1430
|
-
}, [
|
|
1431
|
-
const
|
|
717
|
+
return y.observe(o), () => y.disconnect();
|
|
718
|
+
}, [F]);
|
|
719
|
+
const Ce = A(null), ke = A(S);
|
|
1432
720
|
P(() => {
|
|
1433
|
-
const
|
|
1434
|
-
if (
|
|
1435
|
-
const
|
|
1436
|
-
|
|
1437
|
-
const
|
|
1438
|
-
if (
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1441
|
-
const
|
|
1442
|
-
|
|
721
|
+
const o = ke.current;
|
|
722
|
+
if (ke.current = S, o && !S) {
|
|
723
|
+
const y = Ce.current;
|
|
724
|
+
y != null ? (Ce.current = null, requestAnimationFrame(() => {
|
|
725
|
+
const k = V.current;
|
|
726
|
+
if (k) {
|
|
727
|
+
const _ = k.scrollHeight - k.clientHeight;
|
|
728
|
+
k.scrollTop = Math.min(y, Math.max(0, _));
|
|
729
|
+
const fe = k.scrollHeight - k.scrollTop - k.clientHeight <= 40;
|
|
730
|
+
T.current = fe, I(fe);
|
|
1443
731
|
}
|
|
1444
|
-
})) : requestAnimationFrame(() =>
|
|
732
|
+
})) : requestAnimationFrame(() => F("auto"));
|
|
1445
733
|
}
|
|
1446
|
-
}, [
|
|
1447
|
-
const
|
|
1448
|
-
const
|
|
1449
|
-
if (!
|
|
1450
|
-
const
|
|
1451
|
-
|
|
734
|
+
}, [S, F]);
|
|
735
|
+
const We = Y(() => {
|
|
736
|
+
const o = V.current;
|
|
737
|
+
if (!o) return;
|
|
738
|
+
const _ = o.scrollHeight - o.scrollTop - o.clientHeight <= 40;
|
|
739
|
+
T.current !== _ && (T.current = _, I(_));
|
|
1452
740
|
}, []);
|
|
1453
741
|
P(() => {
|
|
1454
742
|
try {
|
|
1455
|
-
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-messages", JSON.stringify(
|
|
743
|
+
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-messages", JSON.stringify(l));
|
|
1456
744
|
} catch {
|
|
1457
745
|
}
|
|
1458
|
-
}, [
|
|
746
|
+
}, [l]), P(() => {
|
|
1459
747
|
try {
|
|
1460
|
-
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-mql_df", JSON.stringify(
|
|
748
|
+
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-mql_df", JSON.stringify(c));
|
|
1461
749
|
} catch {
|
|
1462
750
|
}
|
|
1463
|
-
}, [l]), P(() => {
|
|
1464
|
-
be.current = c;
|
|
1465
751
|
}, [c]), P(() => {
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
752
|
+
he.current = l;
|
|
753
|
+
}, [l]), P(() => {
|
|
754
|
+
if (l.length === 0 && !oe) {
|
|
755
|
+
const y = { from: "ai", text: d2(E) };
|
|
756
|
+
p([y]), ae(!0), N(/* @__PURE__ */ new Set([0]));
|
|
1469
757
|
}
|
|
1470
|
-
}, [
|
|
1471
|
-
const
|
|
758
|
+
}, [l.length, oe, E]), P(() => () => W(), [W]);
|
|
759
|
+
const ve = Y(async () => {
|
|
1472
760
|
var Le;
|
|
1473
|
-
if (
|
|
1474
|
-
const
|
|
1475
|
-
if (!
|
|
761
|
+
if (u || $) return;
|
|
762
|
+
const o = j.trim();
|
|
763
|
+
if (!o || !Te(j))
|
|
1476
764
|
return;
|
|
1477
|
-
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1480
|
-
const
|
|
1481
|
-
|
|
1482
|
-
let
|
|
1483
|
-
if (
|
|
1484
|
-
const
|
|
1485
|
-
|
|
765
|
+
M(!1), W(), (Le = b.current) == null || Le.abort();
|
|
766
|
+
const y = new AbortController();
|
|
767
|
+
b.current = y;
|
|
768
|
+
const k = y.signal, _ = { from: "human", text: o }, O = he.current, fe = [...O, _];
|
|
769
|
+
p(fe), f(""), h(!0);
|
|
770
|
+
let Se = o;
|
|
771
|
+
if (c && c.length > 0 && !J) {
|
|
772
|
+
const x = O.filter((z) => z.from === "ai").pop();
|
|
773
|
+
x && x.text && x.text.trim() !== "" && (Se = o + "." + x.text, ie(!0));
|
|
1486
774
|
}
|
|
1487
|
-
const
|
|
1488
|
-
|
|
1489
|
-
var
|
|
1490
|
-
|
|
775
|
+
const Oe = [...me, { role: "human", content: o }];
|
|
776
|
+
be(() => {
|
|
777
|
+
var x;
|
|
778
|
+
M(!0), (x = b.current) == null || x.abort(), h(!1);
|
|
1491
779
|
});
|
|
1492
780
|
try {
|
|
1493
|
-
const
|
|
1494
|
-
if (
|
|
1495
|
-
const
|
|
1496
|
-
|
|
1497
|
-
const
|
|
1498
|
-
return
|
|
1499
|
-
}), (
|
|
781
|
+
const x = await ze(Se, Oe, c, r, a, m, k);
|
|
782
|
+
if (W(), typeof x == "string") {
|
|
783
|
+
const z = { from: "ai", text: x };
|
|
784
|
+
p((Z) => {
|
|
785
|
+
const U = [...Z, z];
|
|
786
|
+
return N((X) => /* @__PURE__ */ new Set([...X, U.length - 1])), U;
|
|
787
|
+
}), (x.startsWith("⚠️") || x.startsWith("❌") || s(x)) && M(!0);
|
|
1500
788
|
} else {
|
|
1501
|
-
if (
|
|
1502
|
-
|
|
1503
|
-
const
|
|
1504
|
-
|
|
1505
|
-
const
|
|
1506
|
-
return
|
|
789
|
+
if (x != null && x.isError) {
|
|
790
|
+
M(!0);
|
|
791
|
+
const Z = x.reply || re;
|
|
792
|
+
p((U) => {
|
|
793
|
+
const X = [...U, { from: "ai", text: Z }];
|
|
794
|
+
return N((Ue) => /* @__PURE__ */ new Set([...Ue, X.length - 1])), X;
|
|
1507
795
|
});
|
|
1508
796
|
return;
|
|
1509
797
|
}
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1512
|
-
const
|
|
1513
|
-
return
|
|
1514
|
-
}),
|
|
798
|
+
const z = { from: "ai", text: x.reply };
|
|
799
|
+
p((Z) => {
|
|
800
|
+
const U = [...Z, z];
|
|
801
|
+
return N((X) => /* @__PURE__ */ new Set([...X, U.length - 1])), U;
|
|
802
|
+
}), x.mqlDf && Array.isArray(x.mqlDf) && C(x.mqlDf), x.reply && (x.reply.startsWith("⚠️") || x.reply.startsWith("❌") || s(x.reply)) && M(!0), x.chatHistoryLimitExceeded && ce(!0);
|
|
1515
803
|
}
|
|
1516
|
-
} catch (
|
|
1517
|
-
if (
|
|
804
|
+
} catch (x) {
|
|
805
|
+
if (W(), x.name === "AbortError")
|
|
1518
806
|
return;
|
|
1519
|
-
|
|
1520
|
-
const
|
|
1521
|
-
...
|
|
807
|
+
M(!0), p((z) => {
|
|
808
|
+
const Z = [
|
|
809
|
+
...z,
|
|
1522
810
|
{
|
|
1523
811
|
from: "ai",
|
|
1524
|
-
text:
|
|
812
|
+
text: re
|
|
1525
813
|
}
|
|
1526
814
|
];
|
|
1527
|
-
return
|
|
815
|
+
return N((U) => /* @__PURE__ */ new Set([...U, Z.length - 1])), Z;
|
|
1528
816
|
});
|
|
1529
817
|
} finally {
|
|
1530
|
-
|
|
818
|
+
h(!1);
|
|
1531
819
|
}
|
|
1532
|
-
}, [
|
|
1533
|
-
var
|
|
1534
|
-
|
|
820
|
+
}, [j, r, a, c, J, me, $, W, be]), Ae = Y(() => {
|
|
821
|
+
var o;
|
|
822
|
+
W(), (o = b.current) == null || o.abort(), M(!1), ce(!1), p([]), N(/* @__PURE__ */ new Set()), ae(!1), ie(!1);
|
|
1535
823
|
try {
|
|
1536
824
|
typeof window < "u" && window.localStorage && window.localStorage.removeItem("chatbot-messages");
|
|
1537
825
|
} catch {
|
|
1538
826
|
}
|
|
1539
|
-
|
|
1540
|
-
}, [
|
|
1541
|
-
var
|
|
1542
|
-
if (!
|
|
827
|
+
v(!1);
|
|
828
|
+
}, [W]), Ee = Y(async () => {
|
|
829
|
+
var o, y, k;
|
|
830
|
+
if (!c || c.length === 0) {
|
|
1543
831
|
console.warn("No mql_df data available for PDF download");
|
|
1544
832
|
return;
|
|
1545
833
|
}
|
|
1546
834
|
try {
|
|
1547
|
-
|
|
1548
|
-
const
|
|
1549
|
-
name: ((
|
|
1550
|
-
email: ((
|
|
1551
|
-
summary: `Chat conversation with ${
|
|
835
|
+
h(!0), console.log("mql_df data for lead extraction:", c);
|
|
836
|
+
const _ = {
|
|
837
|
+
name: ((o = c.find((O) => O.name)) == null ? void 0 : o.name) || "Chat User",
|
|
838
|
+
email: ((y = c.find((O) => O.email)) == null ? void 0 : y.email) || "user@example.com",
|
|
839
|
+
summary: `Chat conversation with ${l.length} messages. User asked: "${((k = l.find((O) => O.from === "human")) == null ? void 0 : k.text) || "No user messages"}"`
|
|
1552
840
|
};
|
|
1553
|
-
console.log("Extracted lead row:",
|
|
1554
|
-
} catch (
|
|
1555
|
-
console.error("Failed to download PDF:",
|
|
841
|
+
console.log("Extracted lead row:", _), await Ye(c, _, me, m), console.log("PDF downloaded successfully");
|
|
842
|
+
} catch (_) {
|
|
843
|
+
console.error("Failed to download PDF:", _);
|
|
1556
844
|
} finally {
|
|
1557
|
-
|
|
845
|
+
h(!1);
|
|
1558
846
|
}
|
|
1559
|
-
}, [
|
|
847
|
+
}, [c, l]), Ne = [
|
|
848
|
+
"sw-ttyw-chatbot",
|
|
849
|
+
g,
|
|
850
|
+
S ? "sw-ttyw-container-minimized" : B ? "sw-ttyw-container-expanded" : "sw-ttyw-container"
|
|
851
|
+
].filter(Boolean).join(" ");
|
|
1560
852
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
1561
853
|
"div",
|
|
1562
854
|
{
|
|
1563
|
-
className:
|
|
1564
|
-
|
|
1565
|
-
...b ? g.containerMinimized : A ? g.containerExpanded : g.container,
|
|
1566
|
-
"--swttyw-primary-color": E,
|
|
1567
|
-
"--swttyw-minimized-button-color": j,
|
|
1568
|
-
"--swttyw-avatar-image": "url('')",
|
|
1569
|
-
"--swttyw-user-avatar-image": "url('')",
|
|
1570
|
-
"--swttyw-background-color": "#F7F7F7",
|
|
1571
|
-
"--swttyw-header-font-size": "16px",
|
|
1572
|
-
"--swttyw-body-font-size": "15px",
|
|
1573
|
-
"--swttyw-footer-font-size": "16px",
|
|
1574
|
-
"--swttyw-user-background-image": "url('')"
|
|
1575
|
-
},
|
|
1576
|
-
onClick: b ? () => F(!1) : void 0,
|
|
855
|
+
className: Ne,
|
|
856
|
+
onClick: S ? () => R(!1) : void 0,
|
|
1577
857
|
children: [
|
|
1578
|
-
|
|
1579
|
-
/*
|
|
1580
|
-
/* @__PURE__ */ e.jsx("
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
"
|
|
1592
|
-
{
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
"button",
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
)
|
|
1652
|
-
] })
|
|
858
|
+
S ? /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-minimized-content", children: /* @__PURE__ */ e.jsxs("svg", { className: "sw-ttyw-chat-icon", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
859
|
+
/* @__PURE__ */ e.jsx("path", { d: "M21 15C21 15.5304 20.7893 16.0391 20.4142 16.4142C20.0391 16.7893 19.5304 17 19 17H7L3 21V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H19C19.5304 3 20.0391 3.21071 20.4142 3.58579C20.7893 3.96086 21 4.46957 21 5V15Z", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
860
|
+
/* @__PURE__ */ e.jsx("path", { d: "M8 9H16", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }),
|
|
861
|
+
/* @__PURE__ */ e.jsx("path", { d: "M8 13H12", stroke: "white", strokeWidth: "2", strokeLinecap: "round" })
|
|
862
|
+
] }) }) : /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-header", children: [
|
|
863
|
+
/* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-name", children: t }),
|
|
864
|
+
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-header-actions", children: [
|
|
865
|
+
/* @__PURE__ */ e.jsx(
|
|
866
|
+
"button",
|
|
867
|
+
{
|
|
868
|
+
type: "button",
|
|
869
|
+
onClick: () => se((o) => !o),
|
|
870
|
+
className: "sw-ttyw-header-button",
|
|
871
|
+
title: B ? "Shrink chat" : "Expand chat",
|
|
872
|
+
children: B ? /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
873
|
+
/* @__PURE__ */ e.jsx("path", { d: "M9 4V9H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
874
|
+
/* @__PURE__ */ e.jsx("path", { d: "M15 4V9H20", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
875
|
+
/* @__PURE__ */ e.jsx("path", { d: "M9 20V15H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
876
|
+
/* @__PURE__ */ e.jsx("path", { d: "M15 20V15H20", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
877
|
+
] }) : /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
878
|
+
/* @__PURE__ */ e.jsx("path", { d: "M4 9V4H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
879
|
+
/* @__PURE__ */ e.jsx("path", { d: "M20 9V4H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
880
|
+
/* @__PURE__ */ e.jsx("path", { d: "M4 15V20H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
881
|
+
/* @__PURE__ */ e.jsx("path", { d: "M20 15V20H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
882
|
+
] })
|
|
883
|
+
}
|
|
884
|
+
),
|
|
885
|
+
/* @__PURE__ */ e.jsx(
|
|
886
|
+
"button",
|
|
887
|
+
{
|
|
888
|
+
type: "button",
|
|
889
|
+
onClick: () => {
|
|
890
|
+
if (!S) {
|
|
891
|
+
const o = V.current;
|
|
892
|
+
o && (Ce.current = o.scrollTop), se(!1);
|
|
893
|
+
}
|
|
894
|
+
R(!S);
|
|
895
|
+
},
|
|
896
|
+
className: "sw-ttyw-header-button",
|
|
897
|
+
title: S ? "Maximize chat" : "Minimize chat",
|
|
898
|
+
children: /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx("path", { d: "M6 9H18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
899
|
+
}
|
|
900
|
+
),
|
|
901
|
+
c && c.length > 0 && /* @__PURE__ */ e.jsx(
|
|
902
|
+
"button",
|
|
903
|
+
{
|
|
904
|
+
type: "button",
|
|
905
|
+
onClick: Ee,
|
|
906
|
+
className: "sw-ttyw-header-button",
|
|
907
|
+
title: "Download PDF Report",
|
|
908
|
+
disabled: u,
|
|
909
|
+
children: /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
910
|
+
/* @__PURE__ */ e.jsx("path", { d: "M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
911
|
+
/* @__PURE__ */ e.jsx("path", { d: "M7 10L12 15L17 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
912
|
+
/* @__PURE__ */ e.jsx("path", { d: "M12 15V3", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
913
|
+
] })
|
|
914
|
+
}
|
|
915
|
+
),
|
|
916
|
+
/* @__PURE__ */ e.jsx(
|
|
917
|
+
"button",
|
|
918
|
+
{
|
|
919
|
+
type: "button",
|
|
920
|
+
onClick: () => v(!0),
|
|
921
|
+
className: "sw-ttyw-header-button",
|
|
922
|
+
title: "Clear chat",
|
|
923
|
+
children: /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
924
|
+
/* @__PURE__ */ e.jsx("path", { d: "M3 6H5H21", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
925
|
+
/* @__PURE__ */ e.jsx("path", { d: "M8 6V4C8 3.46957 8.21071 2.96086 8.58579 2.58579C8.96086 2.21071 9.46957 2 10 2H14C14.5304 2 15.0391 2.21071 15.4142 2.58579C15.7893 2.96086 16 3.46957 16 4V6M19 6V20C19 20.5304 18.7893 21.0391 18.4142 21.4142C18.0391 21.7893 17.5304 22 17 22H7C6.46957 22 5.96086 21.7893 5.58579 21.4142C5.21071 21.0391 5 20.5304 5 20V6H19Z", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
926
|
+
/* @__PURE__ */ e.jsx("path", { d: "M10 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
927
|
+
/* @__PURE__ */ e.jsx("path", { d: "M14 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
928
|
+
] })
|
|
929
|
+
}
|
|
930
|
+
)
|
|
1653
931
|
] })
|
|
1654
|
-
),
|
|
1655
|
-
!
|
|
932
|
+
] }),
|
|
933
|
+
!S && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-section sw-ttyw-chat-section-flex", children: [
|
|
1656
934
|
/* @__PURE__ */ e.jsxs(
|
|
1657
935
|
"div",
|
|
1658
936
|
{
|
|
1659
|
-
className: "sw-ttyw-messages",
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
onScroll: $e,
|
|
937
|
+
className: "sw-ttyw-messages sw-ttyw-chat-section",
|
|
938
|
+
ref: V,
|
|
939
|
+
onScroll: We,
|
|
1663
940
|
children: [
|
|
1664
|
-
|
|
1665
|
-
display: "flex",
|
|
1666
|
-
flexDirection: "column",
|
|
1667
|
-
alignItems: "center",
|
|
1668
|
-
justifyContent: "center",
|
|
1669
|
-
height: "100%",
|
|
1670
|
-
position: "relative"
|
|
1671
|
-
}, children: /* @__PURE__ */ e.jsx(
|
|
941
|
+
l.length === 0 && !u && /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-empty-state", children: /* @__PURE__ */ e.jsx(
|
|
1672
942
|
"img",
|
|
1673
943
|
{
|
|
1674
|
-
src:
|
|
944
|
+
src: Je,
|
|
1675
945
|
alt: "Superwise Logo",
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
height: "200px",
|
|
1679
|
-
opacity: 0.8,
|
|
1680
|
-
objectFit: "contain"
|
|
1681
|
-
},
|
|
1682
|
-
onError: (s) => {
|
|
1683
|
-
console.log("Logo failed to load, using fallback"), s.target.style.display = "none";
|
|
946
|
+
onError: (o) => {
|
|
947
|
+
console.log("Logo failed to load, using fallback"), o.target.classList.add("sw-ttyw-logo-hidden");
|
|
1684
948
|
}
|
|
1685
949
|
}
|
|
1686
950
|
) }),
|
|
1687
|
-
|
|
1688
|
-
|
|
951
|
+
l.map((o, y) => /* @__PURE__ */ e.jsx(
|
|
952
|
+
c2,
|
|
1689
953
|
{
|
|
1690
|
-
msg:
|
|
1691
|
-
isTyping:
|
|
954
|
+
msg: o,
|
|
955
|
+
isTyping: ne.has(y),
|
|
1692
956
|
onTypingComplete: () => {
|
|
1693
|
-
|
|
1694
|
-
const
|
|
1695
|
-
return
|
|
1696
|
-
}), requestAnimationFrame(() =>
|
|
957
|
+
N((k) => {
|
|
958
|
+
const _ = new Set(k);
|
|
959
|
+
return _.delete(y), _;
|
|
960
|
+
}), requestAnimationFrame(() => F("auto"));
|
|
1697
961
|
}
|
|
1698
962
|
},
|
|
1699
|
-
|
|
963
|
+
y
|
|
1700
964
|
)),
|
|
1701
|
-
|
|
965
|
+
q && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-validation-message", children: [
|
|
1702
966
|
/* @__PURE__ */ e.jsx("span", { className: "error-icon", children: "⚠️" }),
|
|
1703
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
967
|
+
/* @__PURE__ */ e.jsx("span", { children: q })
|
|
1704
968
|
] }),
|
|
1705
|
-
|
|
969
|
+
le && /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-contact-cta", children: /* @__PURE__ */ e.jsxs(
|
|
1706
970
|
"a",
|
|
1707
971
|
{
|
|
1708
972
|
href: ue,
|
|
@@ -1715,7 +979,7 @@ function dt({ title: r = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1715
979
|
]
|
|
1716
980
|
}
|
|
1717
981
|
) }),
|
|
1718
|
-
|
|
982
|
+
$ && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-limit-exceeded", children: [
|
|
1719
983
|
/* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-limit-exceeded-message", children: "Chat history limit reached. Please download your conversation as PDF and clear chat history to continue." }),
|
|
1720
984
|
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-limit-action-buttons", children: [
|
|
1721
985
|
/* @__PURE__ */ e.jsxs(
|
|
@@ -1724,7 +988,7 @@ function dt({ title: r = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1724
988
|
type: "button",
|
|
1725
989
|
className: "sw-ttyw-limit-download-pdf",
|
|
1726
990
|
onClick: Ee,
|
|
1727
|
-
disabled:
|
|
991
|
+
disabled: u,
|
|
1728
992
|
children: [
|
|
1729
993
|
/* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
1730
994
|
/* @__PURE__ */ e.jsx("path", { d: "M21 15V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
@@ -1740,7 +1004,7 @@ function dt({ title: r = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1740
1004
|
{
|
|
1741
1005
|
type: "button",
|
|
1742
1006
|
className: "sw-ttyw-limit-clear-history",
|
|
1743
|
-
onClick: () =>
|
|
1007
|
+
onClick: () => v(!0),
|
|
1744
1008
|
children: [
|
|
1745
1009
|
/* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": !0, children: [
|
|
1746
1010
|
/* @__PURE__ */ e.jsx("path", { d: "M3 6H5H21", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
@@ -1754,58 +1018,58 @@ function dt({ title: r = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1754
1018
|
)
|
|
1755
1019
|
] })
|
|
1756
1020
|
] }),
|
|
1757
|
-
|
|
1758
|
-
/* @__PURE__ */ e.jsx("div", { className: "message-avatar",
|
|
1759
|
-
/* @__PURE__ */ e.jsxs("div", { className: "message-content",
|
|
1021
|
+
u && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-message other message-loading", children: [
|
|
1022
|
+
/* @__PURE__ */ e.jsx("div", { className: "message-avatar", children: /* @__PURE__ */ e.jsx(Ie, { width: 20, height: 20 }) }),
|
|
1023
|
+
/* @__PURE__ */ e.jsxs("div", { className: "message-content", children: [
|
|
1760
1024
|
/* @__PURE__ */ e.jsx("div", { className: "typing typing-1" }),
|
|
1761
1025
|
/* @__PURE__ */ e.jsx("div", { className: "typing typing-2" }),
|
|
1762
1026
|
/* @__PURE__ */ e.jsx("div", { className: "typing typing-3" })
|
|
1763
1027
|
] })
|
|
1764
1028
|
] }),
|
|
1765
|
-
!
|
|
1029
|
+
!L && /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-jump-latest", children: /* @__PURE__ */ e.jsx(
|
|
1766
1030
|
"button",
|
|
1767
1031
|
{
|
|
1768
1032
|
type: "button",
|
|
1769
1033
|
className: "sw-ttyw-jump-button",
|
|
1770
1034
|
onClick: () => {
|
|
1771
|
-
|
|
1035
|
+
F("smooth"), I(!0);
|
|
1772
1036
|
},
|
|
1773
1037
|
children: "Jump to latest"
|
|
1774
1038
|
}
|
|
1775
1039
|
) }),
|
|
1776
|
-
/* @__PURE__ */ e.jsx("div", { ref:
|
|
1040
|
+
/* @__PURE__ */ e.jsx("div", { ref: G })
|
|
1777
1041
|
]
|
|
1778
1042
|
}
|
|
1779
1043
|
),
|
|
1780
|
-
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-input-section",
|
|
1044
|
+
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-input-section", children: [
|
|
1781
1045
|
/* @__PURE__ */ e.jsx(
|
|
1782
1046
|
"textarea",
|
|
1783
1047
|
{
|
|
1784
1048
|
className: "sw-ttyw-input",
|
|
1785
|
-
placeholder:
|
|
1786
|
-
value:
|
|
1787
|
-
onChange: (
|
|
1788
|
-
|
|
1049
|
+
placeholder: $ ? "Chat limit reached." : "Please ask question here",
|
|
1050
|
+
value: j,
|
|
1051
|
+
onChange: (o) => {
|
|
1052
|
+
f(o.target.value), q && D("");
|
|
1789
1053
|
},
|
|
1790
1054
|
maxLength: 1e3,
|
|
1791
|
-
disabled:
|
|
1792
|
-
|
|
1793
|
-
onKeyDown: (s) => s.key === "Enter" && !s.shiftKey && (s.preventDefault(), Se())
|
|
1055
|
+
disabled: u || $,
|
|
1056
|
+
onKeyDown: (o) => o.key === "Enter" && !o.shiftKey && (o.preventDefault(), ve())
|
|
1794
1057
|
}
|
|
1795
1058
|
),
|
|
1796
|
-
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-input-content",
|
|
1797
|
-
/* @__PURE__ */ e.jsxs("small", { id: "sw-ttyw-chat-textbox-status",
|
|
1798
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
1059
|
+
/* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-input-content sw-ttyw-input-footer", children: [
|
|
1060
|
+
/* @__PURE__ */ e.jsxs("small", { id: "sw-ttyw-chat-textbox-status", className: "sw-ttyw-character-count", children: [
|
|
1061
|
+
/* @__PURE__ */ e.jsx("span", { children: j.length }),
|
|
1799
1062
|
"/1000"
|
|
1800
1063
|
] }),
|
|
1801
1064
|
/* @__PURE__ */ e.jsx(
|
|
1802
1065
|
"button",
|
|
1803
1066
|
{
|
|
1067
|
+
type: "button",
|
|
1804
1068
|
id: "sw-ttyw-chat-send-message",
|
|
1805
|
-
|
|
1069
|
+
className: "sw-ttyw-send-button",
|
|
1070
|
+
onClick: ve,
|
|
1806
1071
|
"aria-label": "Send message",
|
|
1807
|
-
disabled:
|
|
1808
|
-
style: { ...g.sendButton, color: E },
|
|
1072
|
+
disabled: u || $,
|
|
1809
1073
|
children: /* @__PURE__ */ e.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "currentColor", className: "cwv replaced-svg", children: [
|
|
1810
1074
|
/* @__PURE__ */ e.jsx("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1811
1075
|
/* @__PURE__ */ e.jsx("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" })
|
|
@@ -1815,61 +1079,43 @@ function dt({ title: r = "", agentId: n = "", discoveryAgentId: i = "", primaryC
|
|
|
1815
1079
|
] })
|
|
1816
1080
|
] })
|
|
1817
1081
|
] }),
|
|
1818
|
-
|
|
1082
|
+
w && /* @__PURE__ */ e.jsxs("div", { className: "swttyw-modal swttyw-modal-clear-history swttyw-modal-overlay", children: [
|
|
1819
1083
|
/* @__PURE__ */ e.jsx("div", { className: "swtty-modal-header" }),
|
|
1820
|
-
/* @__PURE__ */ e.jsxs("div", { className: "swtty-modal-body",
|
|
1084
|
+
/* @__PURE__ */ e.jsxs("div", { className: "swtty-modal-body", children: [
|
|
1821
1085
|
/* @__PURE__ */ e.jsx("div", { className: "swtty-content", children: "Are you sure you want to delete the chat history?" }),
|
|
1822
|
-
/* @__PURE__ */ e.jsxs("div", { className: "swtty-action",
|
|
1086
|
+
/* @__PURE__ */ e.jsxs("div", { className: "swtty-action swtty-modal-actions", children: [
|
|
1823
1087
|
/* @__PURE__ */ e.jsx(
|
|
1824
1088
|
"input",
|
|
1825
1089
|
{
|
|
1826
1090
|
type: "button",
|
|
1827
|
-
className: "swttyw-btn swttyw-btn-primary",
|
|
1091
|
+
className: "swttyw-btn swttyw-btn-primary swttyw-btn-modal-yes",
|
|
1828
1092
|
id: "swttyw-btn-clear-history-yes",
|
|
1829
|
-
onClick:
|
|
1830
|
-
value: "Yes"
|
|
1831
|
-
style: {
|
|
1832
|
-
background: "var(--swttyw-primary-color)",
|
|
1833
|
-
color: "white",
|
|
1834
|
-
border: "none",
|
|
1835
|
-
padding: "10px 20px",
|
|
1836
|
-
cursor: "pointer",
|
|
1837
|
-
borderRadius: "8px",
|
|
1838
|
-
margin: "10px 5px"
|
|
1839
|
-
}
|
|
1093
|
+
onClick: Ae,
|
|
1094
|
+
value: "Yes"
|
|
1840
1095
|
}
|
|
1841
1096
|
),
|
|
1842
1097
|
/* @__PURE__ */ e.jsx(
|
|
1843
1098
|
"input",
|
|
1844
1099
|
{
|
|
1845
1100
|
type: "button",
|
|
1846
|
-
className: "swttyw-btn swttyw-btn-primary-inverse",
|
|
1101
|
+
className: "swttyw-btn swttyw-btn-primary-inverse swttyw-btn-modal-no",
|
|
1847
1102
|
id: "swttyw-btn-clear-history-no",
|
|
1848
|
-
onClick: () =>
|
|
1849
|
-
value: "No"
|
|
1850
|
-
style: {
|
|
1851
|
-
background: "transparent",
|
|
1852
|
-
color: "var(--swttyw-primary-color)",
|
|
1853
|
-
border: "1px solid var(--swttyw-primary-color)",
|
|
1854
|
-
padding: "10px 20px",
|
|
1855
|
-
cursor: "pointer",
|
|
1856
|
-
borderRadius: "8px",
|
|
1857
|
-
margin: "10px 5px"
|
|
1858
|
-
}
|
|
1103
|
+
onClick: () => v(!1),
|
|
1104
|
+
value: "No"
|
|
1859
1105
|
}
|
|
1860
1106
|
)
|
|
1861
1107
|
] })
|
|
1862
1108
|
] }),
|
|
1863
1109
|
/* @__PURE__ */ e.jsx("div", { className: "swtty-modal-footer" })
|
|
1864
1110
|
] }),
|
|
1865
|
-
!
|
|
1111
|
+
!S && /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-footer", children: [
|
|
1866
1112
|
"Powered by ",
|
|
1867
|
-
/* @__PURE__ */ e.jsx("a", { href: "https://superwise.ai/", className: "ml-1", target: "_new", rel: "noopener noreferrer",
|
|
1113
|
+
/* @__PURE__ */ e.jsx("a", { href: "https://superwise.ai/", className: "ml-1", target: "_new", rel: "noopener noreferrer", "aria-label": "SUPERWISE®", children: /* @__PURE__ */ e.jsx(s2, { height: 20 }) })
|
|
1868
1114
|
] })
|
|
1869
1115
|
]
|
|
1870
1116
|
}
|
|
1871
1117
|
) });
|
|
1872
1118
|
}
|
|
1873
1119
|
export {
|
|
1874
|
-
|
|
1120
|
+
h2 as Chatbot
|
|
1875
1121
|
};
|