@ronak27/superwise-chatbot-package 1.0.0 → 1.0.1
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/README.md +46 -0
- package/dist/react-chatbot.es.js +409 -560
- package/dist/react-chatbot.umd.js +4 -193
- package/dist/superwise-chatbot-package.css +1 -0
- package/package.json +2 -3
package/dist/react-chatbot.es.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import ae, { memo as se, useState as b, useEffect as
|
|
2
|
-
var G = { exports: {} },
|
|
1
|
+
import ae, { memo as se, useState as b, useEffect as P, useRef as ee, useMemo as ie, useCallback as Z } from "react";
|
|
2
|
+
var G = { exports: {} }, D = {};
|
|
3
3
|
var te;
|
|
4
4
|
function le() {
|
|
5
|
-
if (te) return
|
|
5
|
+
if (te) return D;
|
|
6
6
|
te = 1;
|
|
7
7
|
var n = /* @__PURE__ */ Symbol.for("react.transitional.element"), i = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
-
function w(
|
|
9
|
-
var
|
|
10
|
-
if (f !== void 0 && (
|
|
8
|
+
function w(x, s, f) {
|
|
9
|
+
var u = null;
|
|
10
|
+
if (f !== void 0 && (u = "" + f), s.key !== void 0 && (u = "" + s.key), "key" in s) {
|
|
11
11
|
f = {};
|
|
12
12
|
for (var l in s)
|
|
13
13
|
l !== "key" && (f[l] = s[l]);
|
|
14
14
|
} else f = s;
|
|
15
15
|
return s = f.ref, {
|
|
16
16
|
$$typeof: n,
|
|
17
|
-
type:
|
|
18
|
-
key:
|
|
17
|
+
type: x,
|
|
18
|
+
key: u,
|
|
19
19
|
ref: s !== void 0 ? s : null,
|
|
20
20
|
props: f
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
return
|
|
23
|
+
return D.Fragment = i, D.jsx = w, D.jsxs = w, D;
|
|
24
24
|
}
|
|
25
|
-
var
|
|
25
|
+
var F = {};
|
|
26
26
|
var re;
|
|
27
27
|
function ce() {
|
|
28
28
|
return re || (re = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
@@ -32,15 +32,15 @@ function ce() {
|
|
|
32
32
|
return e.$$typeof === X ? null : e.displayName || e.name || null;
|
|
33
33
|
if (typeof e == "string") return e;
|
|
34
34
|
switch (e) {
|
|
35
|
-
case
|
|
35
|
+
case E:
|
|
36
36
|
return "Fragment";
|
|
37
|
-
case
|
|
37
|
+
case J:
|
|
38
38
|
return "Profiler";
|
|
39
|
-
case
|
|
39
|
+
case W:
|
|
40
40
|
return "StrictMode";
|
|
41
|
-
case
|
|
41
|
+
case Q:
|
|
42
42
|
return "Suspense";
|
|
43
|
-
case
|
|
43
|
+
case V:
|
|
44
44
|
return "SuspenseList";
|
|
45
45
|
case K:
|
|
46
46
|
return "Activity";
|
|
@@ -49,18 +49,18 @@ function ce() {
|
|
|
49
49
|
switch (typeof e.tag == "number" && console.error(
|
|
50
50
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
51
51
|
), e.$$typeof) {
|
|
52
|
-
case
|
|
52
|
+
case z:
|
|
53
53
|
return "Portal";
|
|
54
|
-
case
|
|
54
|
+
case $:
|
|
55
55
|
return e.displayName || "Context";
|
|
56
|
-
case
|
|
56
|
+
case T:
|
|
57
57
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
58
58
|
case H:
|
|
59
59
|
var r = e.render;
|
|
60
60
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
|
-
case
|
|
61
|
+
case N:
|
|
62
62
|
return r = e.displayName || null, r !== null ? r : n(e.type) || "Memo";
|
|
63
|
-
case
|
|
63
|
+
case S:
|
|
64
64
|
r = e._payload, e = e._init;
|
|
65
65
|
try {
|
|
66
66
|
return n(e(r));
|
|
@@ -81,17 +81,17 @@ function ce() {
|
|
|
81
81
|
}
|
|
82
82
|
if (r) {
|
|
83
83
|
r = console;
|
|
84
|
-
var d = r.error,
|
|
84
|
+
var d = r.error, g = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
85
85
|
return d.call(
|
|
86
86
|
r,
|
|
87
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
|
-
|
|
88
|
+
g
|
|
89
89
|
), i(e);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
if (e ===
|
|
94
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
92
|
+
function x(e) {
|
|
93
|
+
if (e === E) return "<>";
|
|
94
|
+
if (typeof e == "object" && e !== null && e.$$typeof === S)
|
|
95
95
|
return "<...>";
|
|
96
96
|
try {
|
|
97
97
|
var r = n(e);
|
|
@@ -101,14 +101,14 @@ function ce() {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
function s() {
|
|
104
|
-
var e =
|
|
104
|
+
var e = M.A;
|
|
105
105
|
return e === null ? null : e.getOwner();
|
|
106
106
|
}
|
|
107
107
|
function f() {
|
|
108
108
|
return Error("react-stack-top-frame");
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
110
|
+
function u(e) {
|
|
111
|
+
if (L.call(e, "key")) {
|
|
112
112
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
113
113
|
if (r && r.isReactWarning) return !1;
|
|
114
114
|
}
|
|
@@ -128,19 +128,19 @@ function ce() {
|
|
|
128
128
|
}
|
|
129
129
|
function c() {
|
|
130
130
|
var e = n(this.type);
|
|
131
|
-
return
|
|
131
|
+
return O[e] || (O[e] = !0, console.error(
|
|
132
132
|
"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."
|
|
133
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
134
|
}
|
|
135
|
-
function m(e, r, d,
|
|
136
|
-
var
|
|
135
|
+
function m(e, r, d, g, j, A) {
|
|
136
|
+
var h = d.ref;
|
|
137
137
|
return e = {
|
|
138
|
-
$$typeof:
|
|
138
|
+
$$typeof: k,
|
|
139
139
|
type: e,
|
|
140
140
|
key: r,
|
|
141
141
|
props: d,
|
|
142
|
-
_owner:
|
|
143
|
-
}, (
|
|
142
|
+
_owner: g
|
|
143
|
+
}, (h !== void 0 ? h : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
144
|
enumerable: !1,
|
|
145
145
|
get: c
|
|
146
146
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
@@ -157,7 +157,7 @@ function ce() {
|
|
|
157
157
|
configurable: !1,
|
|
158
158
|
enumerable: !1,
|
|
159
159
|
writable: !0,
|
|
160
|
-
value:
|
|
160
|
+
value: j
|
|
161
161
|
}), Object.defineProperty(e, "_debugTask", {
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
@@ -165,112 +165,112 @@ function ce() {
|
|
|
165
165
|
value: A
|
|
166
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
for (
|
|
174
|
-
|
|
175
|
-
Object.freeze && Object.freeze(
|
|
168
|
+
function p(e, r, d, g, j, A) {
|
|
169
|
+
var h = r.children;
|
|
170
|
+
if (h !== void 0)
|
|
171
|
+
if (g)
|
|
172
|
+
if (q(h)) {
|
|
173
|
+
for (g = 0; g < h.length; g++)
|
|
174
|
+
y(h[g]);
|
|
175
|
+
Object.freeze && Object.freeze(h);
|
|
176
176
|
} else
|
|
177
177
|
console.error(
|
|
178
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
179
|
);
|
|
180
|
-
else
|
|
181
|
-
if (
|
|
182
|
-
|
|
180
|
+
else y(h);
|
|
181
|
+
if (L.call(r, "key")) {
|
|
182
|
+
h = n(e);
|
|
183
183
|
var v = Object.keys(r).filter(function(ne) {
|
|
184
184
|
return ne !== "key";
|
|
185
185
|
});
|
|
186
|
-
|
|
186
|
+
g = 0 < v.length ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}", o[h + g] || (v = 0 < v.length ? "{" + v.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
188
188
|
let props = %s;
|
|
189
189
|
<%s {...props} />
|
|
190
190
|
React keys must be passed directly to JSX without using spread:
|
|
191
191
|
let props = %s;
|
|
192
192
|
<%s key={someKey} {...props} />`,
|
|
193
|
-
h,
|
|
194
193
|
g,
|
|
194
|
+
h,
|
|
195
195
|
v,
|
|
196
|
-
|
|
197
|
-
), o[
|
|
196
|
+
h
|
|
197
|
+
), o[h + g] = !0);
|
|
198
198
|
}
|
|
199
|
-
if (
|
|
199
|
+
if (h = null, d !== void 0 && (w(d), h = "" + d), u(r) && (w(r.key), h = "" + r.key), "key" in r) {
|
|
200
200
|
d = {};
|
|
201
|
-
for (var
|
|
202
|
-
|
|
201
|
+
for (var I in r)
|
|
202
|
+
I !== "key" && (d[I] = r[I]);
|
|
203
203
|
} else d = r;
|
|
204
|
-
return
|
|
204
|
+
return h && l(
|
|
205
205
|
d,
|
|
206
206
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
207
|
), m(
|
|
208
208
|
e,
|
|
209
|
-
|
|
209
|
+
h,
|
|
210
210
|
d,
|
|
211
211
|
s(),
|
|
212
|
-
|
|
212
|
+
j,
|
|
213
213
|
A
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
|
|
216
|
+
function y(e) {
|
|
217
|
+
R(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === S && (e._payload.status === "fulfilled" ? R(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
219
|
+
function R(e) {
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === k;
|
|
221
221
|
}
|
|
222
|
-
var
|
|
222
|
+
var _ = ae, k = /* @__PURE__ */ Symbol.for("react.transitional.element"), z = /* @__PURE__ */ Symbol.for("react.portal"), E = /* @__PURE__ */ Symbol.for("react.fragment"), W = /* @__PURE__ */ Symbol.for("react.strict_mode"), J = /* @__PURE__ */ Symbol.for("react.profiler"), T = /* @__PURE__ */ Symbol.for("react.consumer"), $ = /* @__PURE__ */ Symbol.for("react.context"), H = /* @__PURE__ */ Symbol.for("react.forward_ref"), Q = /* @__PURE__ */ Symbol.for("react.suspense"), V = /* @__PURE__ */ Symbol.for("react.suspense_list"), N = /* @__PURE__ */ Symbol.for("react.memo"), S = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), X = /* @__PURE__ */ Symbol.for("react.client.reference"), M = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, q = Array.isArray, C = console.createTask ? console.createTask : function() {
|
|
223
223
|
return null;
|
|
224
224
|
};
|
|
225
|
-
|
|
225
|
+
_ = {
|
|
226
226
|
react_stack_bottom_frame: function(e) {
|
|
227
227
|
return e();
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
|
-
var B,
|
|
231
|
-
|
|
230
|
+
var B, O = {}, Y = _.react_stack_bottom_frame.bind(
|
|
231
|
+
_,
|
|
232
232
|
f
|
|
233
|
-
)(), U =
|
|
234
|
-
|
|
235
|
-
var
|
|
236
|
-
return
|
|
233
|
+
)(), U = C(x(f)), o = {};
|
|
234
|
+
F.Fragment = E, F.jsx = function(e, r, d) {
|
|
235
|
+
var g = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return p(
|
|
237
237
|
e,
|
|
238
238
|
r,
|
|
239
239
|
d,
|
|
240
240
|
!1,
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
g ? Error("react-stack-top-frame") : Y,
|
|
242
|
+
g ? C(x(e)) : U
|
|
243
243
|
);
|
|
244
|
-
},
|
|
245
|
-
var
|
|
246
|
-
return
|
|
244
|
+
}, F.jsxs = function(e, r, d) {
|
|
245
|
+
var g = 1e4 > M.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return p(
|
|
247
247
|
e,
|
|
248
248
|
r,
|
|
249
249
|
d,
|
|
250
250
|
!0,
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
g ? Error("react-stack-top-frame") : Y,
|
|
252
|
+
g ? C(x(e)) : U
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
|
-
})()),
|
|
255
|
+
})()), F;
|
|
256
256
|
}
|
|
257
257
|
var oe;
|
|
258
258
|
function de() {
|
|
259
259
|
return oe || (oe = 1, process.env.NODE_ENV === "production" ? G.exports = le() : G.exports = ce()), G.exports;
|
|
260
260
|
}
|
|
261
261
|
var t = de();
|
|
262
|
-
async function
|
|
263
|
-
const f = "https://sage-api-ttyw-stage.superwise.ai/api/v1/chat"
|
|
264
|
-
console.log("src/api.js: sendMessageToAI called with discoveryAgentId:", s), console.log("src/api.js: agentId:", y);
|
|
265
|
-
const p = Array.isArray(i) ? i.map((c) => ({
|
|
262
|
+
async function ue(n, i = [], w = [], x = "", s = "") {
|
|
263
|
+
const f = "https://sage-api-ttyw-stage.superwise.ai/api/v1/chat", u = Array.isArray(i) ? i.map((c) => ({
|
|
266
264
|
role: c.role,
|
|
267
265
|
message: c.content != null ? c.content : ""
|
|
268
266
|
})) : [], l = {
|
|
269
267
|
user_input: n,
|
|
270
|
-
chat_history:
|
|
268
|
+
chat_history: u,
|
|
271
269
|
mql_df: Array.isArray(w) ? w : [],
|
|
272
|
-
agent_id:
|
|
273
|
-
discovery_agent_id: s
|
|
270
|
+
agent_id: x,
|
|
271
|
+
discovery_agent_id: s,
|
|
272
|
+
utm_source: "Web",
|
|
273
|
+
utm_medium: "chatbot"
|
|
274
274
|
};
|
|
275
275
|
console.log("Sending payload:", l);
|
|
276
276
|
try {
|
|
@@ -283,45 +283,45 @@ async function pe(n, i = [], w = [], y = "", s = "") {
|
|
|
283
283
|
body: JSON.stringify(l)
|
|
284
284
|
});
|
|
285
285
|
if (console.log("Response status:", c.status), console.log("Response headers:", c.headers), !c.ok) {
|
|
286
|
-
const
|
|
287
|
-
return console.error("API Error Response:",
|
|
286
|
+
const R = await c.text();
|
|
287
|
+
return console.error("API Error Response:", R), { reply: `❌ API Error ${c.status}: ${R}`, mqlDf: [] };
|
|
288
288
|
}
|
|
289
289
|
const m = await c.json();
|
|
290
290
|
console.log("API Response Data:", m);
|
|
291
|
-
let
|
|
292
|
-
return m.chat_response ?
|
|
291
|
+
let p = "⚠️ No reply from server.", y = [];
|
|
292
|
+
return m.chat_response ? p = m.chat_response : m.success && m.data?.chat_response ? p = m.data.chat_response : m.message && (p = m.message), m.mql_df ? y = m.mql_df : m.data?.mql_df && (y = m.data.mql_df), p.includes("Parameters:") && (p = p.split("Parameters:")[0].trim()), { reply: p, mqlDf: y };
|
|
293
293
|
} catch (c) {
|
|
294
294
|
return console.error("API call failed:", c), c.name === "TypeError" && c.message.includes("fetch") ? { reply: "⚠️ Network error. Please check your connection.", mqlDf: [] } : { reply: `⚠️ API request failed: ${c.message}`, mqlDf: [] };
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
async function me(n, i = null, w = []) {
|
|
298
|
-
const
|
|
298
|
+
const x = "https://sage-api-ttyw-stage.superwise.ai/pdf", s = Array.isArray(n) && n.length > 0 ? n[0] : i || {
|
|
299
299
|
name: "User",
|
|
300
300
|
email: "user@example.com",
|
|
301
301
|
summary: "Chat conversation summary"
|
|
302
302
|
}, f = Array.isArray(w) ? w.map((l) => ({
|
|
303
303
|
role: l.role,
|
|
304
304
|
message: l.content != null ? l.content : ""
|
|
305
|
-
})) : [],
|
|
305
|
+
})) : [], u = {
|
|
306
306
|
lead_row: s,
|
|
307
307
|
chat_history: f
|
|
308
308
|
};
|
|
309
|
-
console.log("Downloading PDF with payload:",
|
|
309
|
+
console.log("Downloading PDF with payload:", u);
|
|
310
310
|
try {
|
|
311
|
-
const l = await fetch(
|
|
311
|
+
const l = await fetch(x, {
|
|
312
312
|
method: "POST",
|
|
313
313
|
headers: {
|
|
314
314
|
"Content-Type": "application/json",
|
|
315
315
|
Accept: "application/pdf"
|
|
316
316
|
},
|
|
317
|
-
body: JSON.stringify(
|
|
317
|
+
body: JSON.stringify(u)
|
|
318
318
|
});
|
|
319
319
|
if (console.log("PDF Response status:", l.status), !l.ok) {
|
|
320
|
-
const
|
|
321
|
-
throw console.error("PDF API Error Response:",
|
|
320
|
+
const y = await l.text();
|
|
321
|
+
throw console.error("PDF API Error Response:", y), new Error(`PDF API Error ${l.status}: ${y}`);
|
|
322
322
|
}
|
|
323
|
-
const c = await l.blob(), m = window.URL.createObjectURL(c),
|
|
324
|
-
return
|
|
323
|
+
const c = await l.blob(), m = window.URL.createObjectURL(c), p = document.createElement("a");
|
|
324
|
+
return p.href = m, p.download = `chatbot-report-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.pdf`, document.body.appendChild(p), p.click(), document.body.removeChild(p), window.URL.revokeObjectURL(m), !0;
|
|
325
325
|
} catch (l) {
|
|
326
326
|
throw console.error("PDF download failed:", l), l;
|
|
327
327
|
}
|
|
@@ -344,6 +344,21 @@ const a = {
|
|
|
344
344
|
boxShadow: "0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",
|
|
345
345
|
boxSizing: "border-box"
|
|
346
346
|
},
|
|
347
|
+
containerExpanded: {
|
|
348
|
+
position: "fixed",
|
|
349
|
+
top: "0px",
|
|
350
|
+
left: "0px",
|
|
351
|
+
zIndex: 999999,
|
|
352
|
+
fontFamily: "'Inter', sans-serif",
|
|
353
|
+
width: "100vw",
|
|
354
|
+
height: "100vh",
|
|
355
|
+
display: "flex",
|
|
356
|
+
flexDirection: "column",
|
|
357
|
+
borderRadius: "0",
|
|
358
|
+
background: "white",
|
|
359
|
+
boxShadow: "0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",
|
|
360
|
+
boxSizing: "border-box"
|
|
361
|
+
},
|
|
347
362
|
containerMinimized: {
|
|
348
363
|
position: "fixed",
|
|
349
364
|
bottom: "20px",
|
|
@@ -560,21 +575,22 @@ const a = {
|
|
|
560
575
|
margin: 0
|
|
561
576
|
}
|
|
562
577
|
};
|
|
563
|
-
function
|
|
578
|
+
function pe(n) {
|
|
564
579
|
return n === "human" ? { ...a.message, ...a.messageSelf } : { ...a.message, ...a.messageOther };
|
|
565
580
|
}
|
|
566
|
-
const fe = se(function({ text: i, speed: w = 10, onComplete:
|
|
567
|
-
const [s, f] = b(""), [
|
|
568
|
-
|
|
581
|
+
const fe = se(function({ text: i, speed: w = 10, onComplete: x }) {
|
|
582
|
+
const [s, f] = b(""), [u, l] = b(!1);
|
|
583
|
+
P(() => {
|
|
569
584
|
if (!i) return;
|
|
570
585
|
f(""), l(!1);
|
|
571
586
|
let m = 0;
|
|
572
|
-
const
|
|
573
|
-
m < i.length ? (f(i.slice(0, m + 1)), m++) : (l(!0), clearInterval(
|
|
587
|
+
const p = setInterval(() => {
|
|
588
|
+
m < i.length ? (f(i.slice(0, m + 1)), m++) : (l(!0), clearInterval(p), x && x());
|
|
574
589
|
}, w);
|
|
575
|
-
return () => clearInterval(
|
|
576
|
-
}, [i, w,
|
|
577
|
-
const c = (m) => m.replace(
|
|
590
|
+
return () => clearInterval(p);
|
|
591
|
+
}, [i, w, x]);
|
|
592
|
+
const c = (m) => m.replace(/\[bold\](.*?)\[\/bold\]/g, "<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/(?:^|\n)-\s+/g, `
|
|
593
|
+
• `).replace(/\n/g, "<br/>").replace(/(\d+\.\s)/g, "<br/>$1").replace(/(\*\s)/g, "<br/>$1");
|
|
578
594
|
return /* @__PURE__ */ t.jsx(
|
|
579
595
|
"div",
|
|
580
596
|
{
|
|
@@ -584,20 +600,20 @@ const fe = se(function({ text: i, speed: w = 10, onComplete: y }) {
|
|
|
584
600
|
wordBreak: "break-word"
|
|
585
601
|
},
|
|
586
602
|
dangerouslySetInnerHTML: {
|
|
587
|
-
__html: c(s) + (
|
|
603
|
+
__html: c(s) + (u ? "" : '<span class="typing-cursor">|</span>')
|
|
588
604
|
}
|
|
589
605
|
}
|
|
590
606
|
);
|
|
591
|
-
}),
|
|
607
|
+
}), he = se(function({ msg: i, isTyping: w = !1, onTypingComplete: x }) {
|
|
592
608
|
const s = i.from === "human" ? "sw-ttyw-message self" : "sw-ttyw-message other";
|
|
593
|
-
return /* @__PURE__ */ t.jsxs("div", { className: s, style:
|
|
609
|
+
return /* @__PURE__ */ t.jsxs("div", { className: s, style: pe(i.from), children: [
|
|
594
610
|
/* @__PURE__ */ t.jsx("div", { className: "message-avatar", style: a.messageAvatar, children: i.from === "human" ? /* @__PURE__ */ t.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "black", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
595
611
|
/* @__PURE__ */ t.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", fill: "black" }),
|
|
596
612
|
/* @__PURE__ */ t.jsx("circle", { cx: "12", cy: "7", r: "4", fill: "black" })
|
|
597
613
|
] }) : /* @__PURE__ */ t.jsx(
|
|
598
614
|
"img",
|
|
599
615
|
{
|
|
600
|
-
src: "
|
|
616
|
+
src: "/images/avatars/default_avatar.png",
|
|
601
617
|
alt: "AI Avatar",
|
|
602
618
|
style: {
|
|
603
619
|
width: "20px",
|
|
@@ -607,7 +623,7 @@ const fe = se(function({ text: i, speed: w = 10, onComplete: y }) {
|
|
|
607
623
|
}
|
|
608
624
|
}
|
|
609
625
|
) }),
|
|
610
|
-
/* @__PURE__ */ t.jsx("div", { className: "message-content", style: a.messageContent, children: i.from === "ai" && w ? /* @__PURE__ */ t.jsx(fe, { text: i.text, speed: 20, onComplete:
|
|
626
|
+
/* @__PURE__ */ t.jsx("div", { className: "message-content", style: a.messageContent, children: i.from === "ai" && w ? /* @__PURE__ */ t.jsx(fe, { text: i.text, speed: 20, onComplete: x }) : /* @__PURE__ */ t.jsx(
|
|
611
627
|
"div",
|
|
612
628
|
{
|
|
613
629
|
style: {
|
|
@@ -616,17 +632,18 @@ const fe = se(function({ text: i, speed: w = 10, onComplete: y }) {
|
|
|
616
632
|
wordBreak: "break-word"
|
|
617
633
|
},
|
|
618
634
|
dangerouslySetInnerHTML: {
|
|
619
|
-
__html: i.text.replace(
|
|
635
|
+
__html: i.text.replace(/\[bold\](.*?)\[\/bold\]/g, "<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/(?:^|\n)-\s+/g, `
|
|
636
|
+
• `).replace(/\n/g, "<br/>").replace(/(\d+\.\s)/g, "<br/>$1").replace(/(\*\s)/g, "<br/>$1")
|
|
620
637
|
// Bullet points
|
|
621
638
|
}
|
|
622
639
|
}
|
|
623
640
|
) })
|
|
624
641
|
] });
|
|
625
|
-
}),
|
|
642
|
+
}), ge = () => {
|
|
626
643
|
const n = (/* @__PURE__ */ new Date()).getHours();
|
|
627
644
|
return n >= 5 && n < 12 ? "Good morning" : n >= 12 && n < 17 ? "Good afternoon" : (n >= 17 && n < 21, "Good evening");
|
|
628
|
-
},
|
|
629
|
-
const n =
|
|
645
|
+
}, we = () => {
|
|
646
|
+
const n = ge(), i = [
|
|
630
647
|
`👋 ${n}! Looking to explore Superwise?`,
|
|
631
648
|
`👋 ${n}! Ready to discover what Superwise can do for you?`,
|
|
632
649
|
`👋 ${n}! How can I help you with Superwise today?`,
|
|
@@ -635,8 +652,7 @@ const fe = se(function({ text: i, speed: w = 10, onComplete: y }) {
|
|
|
635
652
|
];
|
|
636
653
|
return i[Math.floor(Math.random() * i.length)];
|
|
637
654
|
};
|
|
638
|
-
function
|
|
639
|
-
console.log("chatbot.jsx: Chatbot component mounted with props:", { agentId: i, discoveryAgentId: w, title: n });
|
|
655
|
+
function ye({ title: n = "", agentId: i = "", discoveryAgentId: w = "", primaryColor: x = "" }) {
|
|
640
656
|
const [s, f] = b(() => {
|
|
641
657
|
try {
|
|
642
658
|
if (typeof window < "u" && window.localStorage) {
|
|
@@ -646,7 +662,7 @@ function xe({ title: n = "Superwise Expert Agent", agentId: i = "", discoveryAge
|
|
|
646
662
|
} catch {
|
|
647
663
|
}
|
|
648
664
|
return [];
|
|
649
|
-
}), [
|
|
665
|
+
}), [u, l] = b(() => {
|
|
650
666
|
try {
|
|
651
667
|
if (typeof window < "u" && window.localStorage) {
|
|
652
668
|
const o = window.localStorage.getItem("chatbot-mql_df");
|
|
@@ -655,8 +671,8 @@ function xe({ title: n = "Superwise Expert Agent", agentId: i = "", discoveryAge
|
|
|
655
671
|
} catch {
|
|
656
672
|
}
|
|
657
673
|
return [];
|
|
658
|
-
}), [c, m] = b(""), [
|
|
659
|
-
if (
|
|
674
|
+
}), [c, m] = b(""), [p, y] = b(!1), [R, _] = b(!1), [k, z] = b(!1), [E, W] = b(!1), [J, T] = b(/* @__PURE__ */ new Set()), [$, H] = b(!1), [Q, V] = b(""), [N, S] = b(""), X = (() => {
|
|
675
|
+
if (x) return x;
|
|
660
676
|
if (typeof document < "u" && typeof window < "u") {
|
|
661
677
|
const o = document.querySelector("[data-chatbot-color]");
|
|
662
678
|
if (o)
|
|
@@ -665,497 +681,330 @@ function xe({ title: n = "Superwise Expert Agent", agentId: i = "", discoveryAge
|
|
|
665
681
|
if (r) return r;
|
|
666
682
|
}
|
|
667
683
|
return "#000";
|
|
668
|
-
})(),
|
|
669
|
-
|
|
670
|
-
|
|
684
|
+
})(), M = ee(null), L = ee(s), q = ie(() => s.map((o) => ({ role: o.from, content: o.text })), [s]), C = (o) => {
|
|
685
|
+
S(o), setTimeout(() => {
|
|
686
|
+
S("");
|
|
671
687
|
}, 4e3);
|
|
672
688
|
}, B = (o) => {
|
|
673
689
|
const e = o.length, r = o.trim();
|
|
674
|
-
return
|
|
690
|
+
return V(""), S(""), !r || e === 0 ? (C("Please enter a message before sending."), !1) : new RegExp(/(<([^>]+)>)/gi).test(r) ? (C("Please avoid using HTML tags or scripts in your message."), !1) : r.length < 2 ? (C("Please enter a meaningful question (at least 2 characters)."), !1) : r.length > 1e3 ? (C("Message is too long. Please keep it under 1000 characters."), !1) : (V(""), S(""), !0);
|
|
675
691
|
};
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
}, [s,
|
|
692
|
+
P(() => {
|
|
693
|
+
M.current?.scrollIntoView({ behavior: "smooth" });
|
|
694
|
+
}, [s, p]), P(() => {
|
|
679
695
|
try {
|
|
680
696
|
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-messages", JSON.stringify(s));
|
|
681
697
|
} catch {
|
|
682
698
|
}
|
|
683
|
-
}, [s]),
|
|
699
|
+
}, [s]), P(() => {
|
|
684
700
|
try {
|
|
685
|
-
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-mql_df", JSON.stringify(
|
|
701
|
+
typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-mql_df", JSON.stringify(u));
|
|
686
702
|
} catch {
|
|
687
703
|
}
|
|
688
|
-
}, [
|
|
689
|
-
|
|
690
|
-
}, []),
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
const e = { from: "ai", text: he() };
|
|
695
|
-
f([e]), q(!0), C(/* @__PURE__ */ new Set([0]));
|
|
704
|
+
}, [u]), P(() => {
|
|
705
|
+
L.current = s;
|
|
706
|
+
}, [s]), P(() => {
|
|
707
|
+
if (s.length === 0 && !$) {
|
|
708
|
+
const e = { from: "ai", text: we() };
|
|
709
|
+
f([e]), H(!0), T(/* @__PURE__ */ new Set([0]));
|
|
696
710
|
}
|
|
697
|
-
}, [s.length,
|
|
698
|
-
const
|
|
711
|
+
}, [s.length, $]);
|
|
712
|
+
const O = Z(async () => {
|
|
699
713
|
const o = c.trim();
|
|
700
714
|
if (!o || !B(c))
|
|
701
715
|
return;
|
|
702
|
-
const e = { from: "human", text: o }, d = [...
|
|
703
|
-
f(d), m(""),
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
const v = [...g, A];
|
|
711
|
-
return C((T) => /* @__PURE__ */ new Set([...T, v.length - 1])), v;
|
|
716
|
+
const e = { from: "human", text: o }, d = [...L.current, e];
|
|
717
|
+
f(d), m(""), y(!0);
|
|
718
|
+
const g = [...q, { role: "human", content: o }], j = await ue(o, g, u, i, w);
|
|
719
|
+
if (typeof j == "string") {
|
|
720
|
+
const A = { from: "ai", text: j };
|
|
721
|
+
f((h) => {
|
|
722
|
+
const v = [...h, A];
|
|
723
|
+
return T((I) => /* @__PURE__ */ new Set([...I, v.length - 1])), v;
|
|
712
724
|
});
|
|
713
725
|
} else {
|
|
714
|
-
const A = { from: "ai", text:
|
|
715
|
-
f((
|
|
716
|
-
const v = [...
|
|
717
|
-
return
|
|
718
|
-
}),
|
|
726
|
+
const A = { from: "ai", text: j.reply };
|
|
727
|
+
f((h) => {
|
|
728
|
+
const v = [...h, A];
|
|
729
|
+
return T((I) => /* @__PURE__ */ new Set([...I, v.length - 1])), v;
|
|
730
|
+
}), j.mqlDf && Array.isArray(j.mqlDf) && l(j.mqlDf);
|
|
719
731
|
}
|
|
720
|
-
|
|
721
|
-
}, [c, i, w,
|
|
722
|
-
f([]), l([]),
|
|
732
|
+
y(!1);
|
|
733
|
+
}, [c, i, w, u]), Y = Z(() => {
|
|
734
|
+
f([]), l([]), T(/* @__PURE__ */ new Set()), H(!1);
|
|
723
735
|
try {
|
|
724
736
|
typeof window < "u" && window.localStorage && (window.localStorage.removeItem("chatbot-messages"), window.localStorage.removeItem("chatbot-mql_df"));
|
|
725
737
|
} catch {
|
|
726
738
|
}
|
|
727
|
-
|
|
739
|
+
_(!1);
|
|
728
740
|
}, []), U = Z(async () => {
|
|
729
|
-
if (!
|
|
741
|
+
if (!u || u.length === 0) {
|
|
730
742
|
console.warn("No mql_df data available for PDF download");
|
|
731
743
|
return;
|
|
732
744
|
}
|
|
733
745
|
try {
|
|
734
|
-
|
|
746
|
+
y(!0), console.log("mql_df data for lead extraction:", u);
|
|
735
747
|
const o = {
|
|
736
|
-
name:
|
|
737
|
-
email:
|
|
748
|
+
name: u.find((e) => e.name)?.name || "Chat User",
|
|
749
|
+
email: u.find((e) => e.email)?.email || "user@example.com",
|
|
738
750
|
summary: `Chat conversation with ${s.length} messages. User asked: "${s.find((e) => e.from === "human")?.text || "No user messages"}"`
|
|
739
751
|
};
|
|
740
|
-
console.log("Extracted lead row:", o), await me(
|
|
752
|
+
console.log("Extracted lead row:", o), await me(u, o, q), console.log("PDF downloaded successfully");
|
|
741
753
|
} catch (o) {
|
|
742
754
|
console.error("Failed to download PDF:", o);
|
|
743
755
|
} finally {
|
|
744
|
-
|
|
756
|
+
y(!1);
|
|
745
757
|
}
|
|
746
|
-
}, [
|
|
747
|
-
return /* @__PURE__ */ t.
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
.
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
/* Validation message in messages area */
|
|
840
|
-
.sw-ttyw-validation-message {
|
|
841
|
-
background-color: #FEE8E8;
|
|
842
|
-
border: 1px solid #FDC2C2;
|
|
843
|
-
border-radius: 8px;
|
|
844
|
-
padding: 12px 16px;
|
|
845
|
-
margin: 8px 16px;
|
|
846
|
-
display: flex;
|
|
847
|
-
align-items: center;
|
|
848
|
-
gap: 8px;
|
|
849
|
-
color: #E04F4F;
|
|
850
|
-
font-size: 14px;
|
|
851
|
-
line-height: 1.4;
|
|
852
|
-
animation: slideIn 0.3s ease-out;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
.sw-ttyw-validation-message .error-icon {
|
|
856
|
-
color: #F59E0B;
|
|
857
|
-
font-size: 16px;
|
|
858
|
-
flex-shrink: 0;
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
@keyframes slideIn {
|
|
862
|
-
from {
|
|
863
|
-
opacity: 0;
|
|
864
|
-
transform: translateY(-10px);
|
|
865
|
-
}
|
|
866
|
-
to {
|
|
867
|
-
opacity: 1;
|
|
868
|
-
transform: translateY(0);
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
@-webkit-keyframes typingAlt {
|
|
873
|
-
0%, 60%, 100% {
|
|
874
|
-
transform: translateY(0) scale(1);
|
|
875
|
-
opacity: 0.4;
|
|
876
|
-
}
|
|
877
|
-
30% {
|
|
878
|
-
transform: translateY(-10px) scale(1.2);
|
|
879
|
-
opacity: 1;
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
@keyframes typingAlt {
|
|
884
|
-
0%, 60%, 100% {
|
|
885
|
-
transform: translateY(0) scale(1);
|
|
886
|
-
opacity: 0.4;
|
|
887
|
-
}
|
|
888
|
-
30% {
|
|
889
|
-
transform: translateY(-10px) scale(1.2);
|
|
890
|
-
opacity: 1;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
/* Ensure user messages have black background */
|
|
895
|
-
.sw-ttyw-message.self {
|
|
896
|
-
background: #000000 !important;
|
|
897
|
-
color: white !important;
|
|
898
|
-
margin: 1rem 1rem 1rem auto !important;
|
|
899
|
-
border-radius: 1.125rem 1.125rem 0 1.125rem !important;
|
|
900
|
-
max-width: 80% !important;
|
|
901
|
-
display: table;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
/* Avatar positioning for user messages */
|
|
905
|
-
.sw-ttyw-message.self .message-avatar {
|
|
906
|
-
right: -28px !important;
|
|
907
|
-
left: auto !important;
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
/* Avatar positioning for AI messages */
|
|
911
|
-
.sw-ttyw-message.other .message-avatar {
|
|
912
|
-
left: -28px !important;
|
|
913
|
-
right: auto !important;
|
|
914
|
-
display: table;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
/* Ensure proper spacing for message content */
|
|
918
|
-
.sw-ttyw-message .message-content {
|
|
919
|
-
margin-left: 0 !important;
|
|
920
|
-
margin-right: 0 !important;
|
|
921
|
-
padding-left: 0 !important;
|
|
922
|
-
padding-right: 0 !important;
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
/* Empty state styling */
|
|
926
|
-
.sw-ttyw-empty-state {
|
|
927
|
-
background-color: var(--swttyw-background-color) !important;
|
|
928
|
-
transition: opacity 0.3s ease-in-out !important;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
.sw-ttyw-empty-state:hover {
|
|
932
|
-
opacity: 0.5 !important;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
/* Ensure empty state doesn't interfere with scrolling */
|
|
936
|
-
.sw-ttyw-messages:has(.sw-ttyw-empty-state) {
|
|
937
|
-
overflow: hidden !important;
|
|
938
|
-
}
|
|
939
|
-
` }),
|
|
940
|
-
/* @__PURE__ */ t.jsxs(
|
|
941
|
-
"div",
|
|
942
|
-
{
|
|
943
|
-
className: "sw-ttyw-chatbot",
|
|
944
|
-
style: j ? a.containerMinimized : a.container,
|
|
945
|
-
onClick: j ? () => $(!1) : void 0,
|
|
946
|
-
children: [
|
|
947
|
-
j ? (
|
|
948
|
-
/* Minimized State - Horizontal Button */
|
|
949
|
-
/* @__PURE__ */ t.jsxs("div", { style: a.minimizedContent, children: [
|
|
950
|
-
/* @__PURE__ */ t.jsxs("svg", { style: a.chatIcon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
951
|
-
/* @__PURE__ */ t.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" }),
|
|
952
|
-
/* @__PURE__ */ t.jsx("path", { d: "M8 9H16", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }),
|
|
953
|
-
/* @__PURE__ */ t.jsx("path", { d: "M8 13H12", stroke: "white", strokeWidth: "2", strokeLinecap: "round" })
|
|
954
|
-
] }),
|
|
955
|
-
/* @__PURE__ */ t.jsx("div", { style: a.minimizedTitle, children: n })
|
|
956
|
-
] })
|
|
957
|
-
) : (
|
|
958
|
-
/* Full State - Header with Controls */
|
|
959
|
-
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-header", style: a.header, children: [
|
|
960
|
-
/* @__PURE__ */ t.jsx("div", { className: "sw-ttyw-name", style: a.name, children: n }),
|
|
961
|
-
/* @__PURE__ */ t.jsxs("div", { style: a.headerActions, children: [
|
|
962
|
-
/* @__PURE__ */ t.jsx(
|
|
963
|
-
"button",
|
|
964
|
-
{
|
|
965
|
-
onClick: () => $(!j),
|
|
966
|
-
style: a.headerButton,
|
|
967
|
-
title: j ? "Maximize chat" : "Minimize chat",
|
|
968
|
-
children: /* @__PURE__ */ t.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t.jsx("path", { d: "M6 9H18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
969
|
-
}
|
|
970
|
-
),
|
|
971
|
-
p && p.length > 0 && /* @__PURE__ */ t.jsx(
|
|
972
|
-
"button",
|
|
973
|
-
{
|
|
974
|
-
onClick: U,
|
|
975
|
-
style: a.headerButton,
|
|
976
|
-
title: "Download PDF Report",
|
|
977
|
-
disabled: u,
|
|
978
|
-
children: /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
979
|
-
/* @__PURE__ */ t.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" }),
|
|
980
|
-
/* @__PURE__ */ t.jsx("path", { d: "M7 10L12 15L17 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
981
|
-
/* @__PURE__ */ t.jsx("path", { d: "M12 15V3", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
982
|
-
] })
|
|
983
|
-
}
|
|
984
|
-
),
|
|
985
|
-
/* @__PURE__ */ t.jsx(
|
|
986
|
-
"button",
|
|
987
|
-
{
|
|
988
|
-
onClick: () => S(!0),
|
|
989
|
-
style: a.headerButton,
|
|
990
|
-
title: "Clear chat",
|
|
991
|
-
children: /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
992
|
-
/* @__PURE__ */ t.jsx("path", { d: "M3 6H5H21", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
993
|
-
/* @__PURE__ */ t.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" }),
|
|
994
|
-
/* @__PURE__ */ t.jsx("path", { d: "M10 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
995
|
-
/* @__PURE__ */ t.jsx("path", { d: "M14 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
996
|
-
] })
|
|
997
|
-
}
|
|
998
|
-
)
|
|
999
|
-
] })
|
|
758
|
+
}, [u, s]);
|
|
759
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs(
|
|
760
|
+
"div",
|
|
761
|
+
{
|
|
762
|
+
className: "sw-ttyw-chatbot",
|
|
763
|
+
style: {
|
|
764
|
+
...k ? a.containerMinimized : E ? a.containerExpanded : a.container,
|
|
765
|
+
"--swttyw-primary-color": X,
|
|
766
|
+
"--swttyw-avatar-image": "url('')",
|
|
767
|
+
"--swttyw-user-avatar-image": "url('')",
|
|
768
|
+
"--swttyw-background-color": "#F7F7F7",
|
|
769
|
+
"--swttyw-header-font-size": "16px",
|
|
770
|
+
"--swttyw-body-font-size": "15px",
|
|
771
|
+
"--swttyw-footer-font-size": "16px",
|
|
772
|
+
"--swttyw-user-background-image": "url('')"
|
|
773
|
+
},
|
|
774
|
+
onClick: k ? () => z(!1) : void 0,
|
|
775
|
+
children: [
|
|
776
|
+
k ? (
|
|
777
|
+
/* Minimized State - Horizontal Button */
|
|
778
|
+
/* @__PURE__ */ t.jsxs("div", { style: a.minimizedContent, children: [
|
|
779
|
+
/* @__PURE__ */ t.jsxs("svg", { style: a.chatIcon, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
780
|
+
/* @__PURE__ */ t.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" }),
|
|
781
|
+
/* @__PURE__ */ t.jsx("path", { d: "M8 9H16", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }),
|
|
782
|
+
/* @__PURE__ */ t.jsx("path", { d: "M8 13H12", stroke: "white", strokeWidth: "2", strokeLinecap: "round" })
|
|
783
|
+
] }),
|
|
784
|
+
/* @__PURE__ */ t.jsx("div", { style: a.minimizedTitle, children: n })
|
|
785
|
+
] })
|
|
786
|
+
) : (
|
|
787
|
+
/* Full State - Header with Controls */
|
|
788
|
+
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-header", style: a.header, children: [
|
|
789
|
+
/* @__PURE__ */ t.jsx("div", { className: "sw-ttyw-name", style: a.name, children: n }),
|
|
790
|
+
/* @__PURE__ */ t.jsxs("div", { style: a.headerActions, children: [
|
|
791
|
+
/* @__PURE__ */ t.jsx(
|
|
792
|
+
"button",
|
|
793
|
+
{
|
|
794
|
+
onClick: () => W((o) => !o),
|
|
795
|
+
style: a.headerButton,
|
|
796
|
+
title: E ? "Shrink chat" : "Expand chat",
|
|
797
|
+
children: E ? /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
798
|
+
/* @__PURE__ */ t.jsx("path", { d: "M9 4V9H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
799
|
+
/* @__PURE__ */ t.jsx("path", { d: "M15 4V9H20", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
800
|
+
/* @__PURE__ */ t.jsx("path", { d: "M9 20V15H4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
801
|
+
/* @__PURE__ */ t.jsx("path", { d: "M15 20V15H20", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
802
|
+
] }) : /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
803
|
+
/* @__PURE__ */ t.jsx("path", { d: "M4 9V4H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
804
|
+
/* @__PURE__ */ t.jsx("path", { d: "M20 9V4H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
805
|
+
/* @__PURE__ */ t.jsx("path", { d: "M4 15V20H9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
806
|
+
/* @__PURE__ */ t.jsx("path", { d: "M20 15V20H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
807
|
+
] })
|
|
808
|
+
}
|
|
809
|
+
),
|
|
810
|
+
/* @__PURE__ */ t.jsx(
|
|
811
|
+
"button",
|
|
812
|
+
{
|
|
813
|
+
onClick: () => {
|
|
814
|
+
k || W(!1), z(!k);
|
|
815
|
+
},
|
|
816
|
+
style: a.headerButton,
|
|
817
|
+
title: k ? "Maximize chat" : "Minimize chat",
|
|
818
|
+
children: /* @__PURE__ */ t.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ t.jsx("path", { d: "M6 9H18", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) })
|
|
819
|
+
}
|
|
820
|
+
),
|
|
821
|
+
u && u.length > 0 && /* @__PURE__ */ t.jsx(
|
|
822
|
+
"button",
|
|
823
|
+
{
|
|
824
|
+
onClick: U,
|
|
825
|
+
style: a.headerButton,
|
|
826
|
+
title: "Download PDF Report",
|
|
827
|
+
disabled: p,
|
|
828
|
+
children: /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
829
|
+
/* @__PURE__ */ t.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" }),
|
|
830
|
+
/* @__PURE__ */ t.jsx("path", { d: "M7 10L12 15L17 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
831
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 15V3", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
832
|
+
] })
|
|
833
|
+
}
|
|
834
|
+
),
|
|
835
|
+
/* @__PURE__ */ t.jsx(
|
|
836
|
+
"button",
|
|
837
|
+
{
|
|
838
|
+
onClick: () => _(!0),
|
|
839
|
+
style: a.headerButton,
|
|
840
|
+
title: "Clear chat",
|
|
841
|
+
children: /* @__PURE__ */ t.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
842
|
+
/* @__PURE__ */ t.jsx("path", { d: "M3 6H5H21", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
843
|
+
/* @__PURE__ */ t.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" }),
|
|
844
|
+
/* @__PURE__ */ t.jsx("path", { d: "M10 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
845
|
+
/* @__PURE__ */ t.jsx("path", { d: "M14 11V17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
846
|
+
] })
|
|
847
|
+
}
|
|
848
|
+
)
|
|
1000
849
|
] })
|
|
1001
|
-
)
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
850
|
+
] })
|
|
851
|
+
),
|
|
852
|
+
!k && /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-section", style: { flexGrow: 1, display: "flex", flexDirection: "column" }, children: [
|
|
853
|
+
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-messages", style: a.chatSection, children: [
|
|
854
|
+
s.length === 0 && !p && /* @__PURE__ */ t.jsx("div", { className: "sw-ttyw-empty-state", style: {
|
|
855
|
+
display: "flex",
|
|
856
|
+
flexDirection: "column",
|
|
857
|
+
alignItems: "center",
|
|
858
|
+
justifyContent: "center",
|
|
859
|
+
height: "100%",
|
|
860
|
+
position: "relative"
|
|
861
|
+
}, children: /* @__PURE__ */ t.jsx(
|
|
862
|
+
"img",
|
|
863
|
+
{
|
|
864
|
+
src: "/images/superwise-logo.svg",
|
|
865
|
+
alt: "Superwise Logo",
|
|
866
|
+
style: {
|
|
867
|
+
width: "350px",
|
|
868
|
+
height: "200px",
|
|
869
|
+
opacity: 0.8,
|
|
870
|
+
objectFit: "contain"
|
|
871
|
+
},
|
|
872
|
+
onError: (o) => {
|
|
873
|
+
console.log("Logo failed to load, using fallback"), o.target.style.display = "none";
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
) }),
|
|
877
|
+
s.map((o, e) => /* @__PURE__ */ t.jsx(
|
|
878
|
+
he,
|
|
879
|
+
{
|
|
880
|
+
msg: o,
|
|
881
|
+
isTyping: J.has(e),
|
|
882
|
+
onTypingComplete: () => {
|
|
883
|
+
T((r) => {
|
|
884
|
+
const d = new Set(r);
|
|
885
|
+
return d.delete(e), d;
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
e
|
|
890
|
+
)),
|
|
891
|
+
N && /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-validation-message", children: [
|
|
892
|
+
/* @__PURE__ */ t.jsx("span", { className: "error-icon", children: "⚠️" }),
|
|
893
|
+
/* @__PURE__ */ t.jsx("span", { children: N })
|
|
894
|
+
] }),
|
|
895
|
+
p && /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-message other message-loading", style: { ...a.message, ...a.messageOther }, children: [
|
|
896
|
+
/* @__PURE__ */ t.jsx("div", { className: "message-avatar", style: a.messageAvatar, children: /* @__PURE__ */ t.jsx(
|
|
1012
897
|
"img",
|
|
1013
898
|
{
|
|
1014
|
-
src: "
|
|
1015
|
-
alt: "
|
|
899
|
+
src: "/images/avatars/default_avatar.png",
|
|
900
|
+
alt: "AI Avatar",
|
|
1016
901
|
style: {
|
|
1017
|
-
width: "
|
|
1018
|
-
height: "
|
|
1019
|
-
|
|
1020
|
-
objectFit: "
|
|
1021
|
-
},
|
|
1022
|
-
onError: (o) => {
|
|
1023
|
-
console.log("Logo failed to load, using fallback"), o.target.style.display = "none";
|
|
902
|
+
width: "20px",
|
|
903
|
+
height: "20px",
|
|
904
|
+
borderRadius: "50%",
|
|
905
|
+
objectFit: "cover"
|
|
1024
906
|
}
|
|
1025
907
|
}
|
|
1026
908
|
) }),
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
{
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
909
|
+
/* @__PURE__ */ t.jsxs("div", { className: "message-content", style: a.messageContent, children: [
|
|
910
|
+
/* @__PURE__ */ t.jsx("div", { className: "typing typing-1" }),
|
|
911
|
+
/* @__PURE__ */ t.jsx("div", { className: "typing typing-2" }),
|
|
912
|
+
/* @__PURE__ */ t.jsx("div", { className: "typing typing-3" })
|
|
913
|
+
] })
|
|
914
|
+
] }),
|
|
915
|
+
/* @__PURE__ */ t.jsx("div", { ref: M })
|
|
916
|
+
] }),
|
|
917
|
+
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-input-section", style: a.inputSection, children: [
|
|
918
|
+
/* @__PURE__ */ t.jsx(
|
|
919
|
+
"textarea",
|
|
920
|
+
{
|
|
921
|
+
className: "sw-ttyw-input",
|
|
922
|
+
placeholder: "Please ask question here",
|
|
923
|
+
value: c,
|
|
924
|
+
onChange: (o) => {
|
|
925
|
+
m(o.target.value), N && S("");
|
|
1038
926
|
},
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
/* @__PURE__ */ t.jsx("
|
|
1047
|
-
|
|
1048
|
-
{
|
|
1049
|
-
src: "https://superwise.ai/wp-content/uploads/2025/07/cropped-Superwise-icon-1-32x32.png",
|
|
1050
|
-
alt: "AI Avatar",
|
|
1051
|
-
style: {
|
|
1052
|
-
width: "20px",
|
|
1053
|
-
height: "20px",
|
|
1054
|
-
borderRadius: "50%",
|
|
1055
|
-
objectFit: "cover"
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
) }),
|
|
1059
|
-
/* @__PURE__ */ t.jsxs("div", { className: "message-content", style: a.messageContent, children: [
|
|
1060
|
-
/* @__PURE__ */ t.jsx("div", { className: "typing typing-1" }),
|
|
1061
|
-
/* @__PURE__ */ t.jsx("div", { className: "typing typing-2" }),
|
|
1062
|
-
/* @__PURE__ */ t.jsx("div", { className: "typing typing-3" })
|
|
1063
|
-
] })
|
|
927
|
+
maxLength: 1e3,
|
|
928
|
+
style: a.textarea,
|
|
929
|
+
onKeyDown: (o) => o.key === "Enter" && !o.shiftKey && (o.preventDefault(), O())
|
|
930
|
+
}
|
|
931
|
+
),
|
|
932
|
+
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-input-content", style: a.inputFooter, children: [
|
|
933
|
+
/* @__PURE__ */ t.jsxs("small", { id: "sw-ttyw-chat-textbox-status", style: a.characterCount, children: [
|
|
934
|
+
/* @__PURE__ */ t.jsx("span", { children: c.length }),
|
|
935
|
+
"/1000"
|
|
1064
936
|
] }),
|
|
1065
|
-
/* @__PURE__ */ t.jsx("div", { ref: P })
|
|
1066
|
-
] }),
|
|
1067
|
-
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-input-section", style: a.inputSection, children: [
|
|
1068
937
|
/* @__PURE__ */ t.jsx(
|
|
1069
|
-
"
|
|
938
|
+
"button",
|
|
1070
939
|
{
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
onKeyDown: (o) => o.key === "Enter" && !o.shiftKey && (o.preventDefault(), D())
|
|
940
|
+
id: "sw-ttyw-chat-send-message",
|
|
941
|
+
onClick: O,
|
|
942
|
+
"aria-label": "Send message",
|
|
943
|
+
style: a.sendButton,
|
|
944
|
+
children: /* @__PURE__ */ t.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000", className: "cwv replaced-svg", children: [
|
|
945
|
+
/* @__PURE__ */ t.jsx("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
946
|
+
/* @__PURE__ */ t.jsx("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" })
|
|
947
|
+
] })
|
|
1080
948
|
}
|
|
1081
|
-
)
|
|
1082
|
-
/* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-input-content", style: a.inputFooter, children: [
|
|
1083
|
-
/* @__PURE__ */ t.jsxs("small", { id: "sw-ttyw-chat-textbox-status", style: a.characterCount, children: [
|
|
1084
|
-
/* @__PURE__ */ t.jsx("span", { children: c.length }),
|
|
1085
|
-
"/1000"
|
|
1086
|
-
] }),
|
|
1087
|
-
/* @__PURE__ */ t.jsx(
|
|
1088
|
-
"button",
|
|
1089
|
-
{
|
|
1090
|
-
id: "sw-ttyw-chat-send-message",
|
|
1091
|
-
onClick: D,
|
|
1092
|
-
"aria-label": "Send message",
|
|
1093
|
-
style: a.sendButton,
|
|
1094
|
-
children: /* @__PURE__ */ t.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 0 24 24", width: "24px", fill: "#000000", className: "cwv replaced-svg", children: [
|
|
1095
|
-
/* @__PURE__ */ t.jsx("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1096
|
-
/* @__PURE__ */ t.jsx("path", { d: "M2.01 21L23 12 2.01 3 2 10l15 2-15 2z" })
|
|
1097
|
-
] })
|
|
1098
|
-
}
|
|
1099
|
-
)
|
|
1100
|
-
] })
|
|
949
|
+
)
|
|
1101
950
|
] })
|
|
1102
|
-
] })
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
951
|
+
] })
|
|
952
|
+
] }),
|
|
953
|
+
R && /* @__PURE__ */ t.jsxs("div", { className: "swttyw-modal swttyw-modal-clear-history", style: a.modalOverlay, children: [
|
|
954
|
+
/* @__PURE__ */ t.jsx("div", { className: "swtty-modal-header" }),
|
|
955
|
+
/* @__PURE__ */ t.jsxs("div", { className: "swtty-modal-body", style: a.modalBody, children: [
|
|
956
|
+
/* @__PURE__ */ t.jsx("div", { className: "swtty-content", children: "Are you sure you want to delete the chat history?" }),
|
|
957
|
+
/* @__PURE__ */ t.jsxs("div", { className: "swtty-action", style: a.modalActions, children: [
|
|
958
|
+
/* @__PURE__ */ t.jsx(
|
|
959
|
+
"input",
|
|
960
|
+
{
|
|
961
|
+
type: "button",
|
|
962
|
+
className: "swttyw-btn swttyw-btn-primary",
|
|
963
|
+
id: "swttyw-btn-clear-history-yes",
|
|
964
|
+
onClick: Y,
|
|
965
|
+
value: "Yes",
|
|
966
|
+
style: {
|
|
967
|
+
background: "var(--swttyw-primary-color)",
|
|
968
|
+
color: "white",
|
|
969
|
+
border: "none",
|
|
970
|
+
padding: "10px 20px",
|
|
971
|
+
cursor: "pointer",
|
|
972
|
+
borderRadius: "8px",
|
|
973
|
+
margin: "10px 5px"
|
|
1125
974
|
}
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
975
|
+
}
|
|
976
|
+
),
|
|
977
|
+
/* @__PURE__ */ t.jsx(
|
|
978
|
+
"input",
|
|
979
|
+
{
|
|
980
|
+
type: "button",
|
|
981
|
+
className: "swttyw-btn swttyw-btn-primary-inverse",
|
|
982
|
+
id: "swttyw-btn-clear-history-no",
|
|
983
|
+
onClick: () => _(!1),
|
|
984
|
+
value: "No",
|
|
985
|
+
style: {
|
|
986
|
+
background: "transparent",
|
|
987
|
+
color: "var(--swttyw-primary-color)",
|
|
988
|
+
border: "1px solid var(--swttyw-primary-color)",
|
|
989
|
+
padding: "10px 20px",
|
|
990
|
+
cursor: "pointer",
|
|
991
|
+
borderRadius: "8px",
|
|
992
|
+
margin: "10px 5px"
|
|
1144
993
|
}
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
] })
|
|
1148
|
-
/* @__PURE__ */ t.jsx("div", { className: "swtty-modal-footer" })
|
|
994
|
+
}
|
|
995
|
+
)
|
|
996
|
+
] })
|
|
1149
997
|
] }),
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
998
|
+
/* @__PURE__ */ t.jsx("div", { className: "swtty-modal-footer" })
|
|
999
|
+
] }),
|
|
1000
|
+
!k && /* @__PURE__ */ t.jsxs("div", { className: "sw-ttyw-chat-footer", style: a.footer, children: [
|
|
1001
|
+
"Powered by ",
|
|
1002
|
+
/* @__PURE__ */ t.jsx("a", { href: "https://superwise.ai/", className: "ml-1", target: "_new", style: { marginLeft: "0.25rem", lineHeight: 0 }, children: /* @__PURE__ */ t.jsx("img", { src: "/images/White%20-%20Logo_Superwise%20-%20Standard.png", alt: "SUPERWISE®", height: "20" }) })
|
|
1003
|
+
] })
|
|
1004
|
+
]
|
|
1005
|
+
}
|
|
1006
|
+
) });
|
|
1158
1007
|
}
|
|
1159
1008
|
export {
|
|
1160
|
-
|
|
1009
|
+
ye as Chatbot
|
|
1161
1010
|
};
|